ih264_buf_mgr_size:
   93|   289k|{
   94|   289k|    WORD32 size;
   95|       |
   96|   289k|    size = sizeof(buf_mgr_t);
   97|   289k|    size += ithread_get_mutex_lock_size();
   98|       |
   99|   289k|    return size;
  100|   289k|}
ih264_buf_mgr_lock:
  120|  1.54M|{
  121|  1.54M|    WORD32 retval;
  122|       |
  123|  1.54M|    retval = ithread_mutex_lock(ps_buf_mgr->pv_mutex);
  124|  1.54M|    if(retval)
  ------------------
  |  Branch (124:8): [True: 0, False: 1.54M]
  ------------------
  125|      0|        return IH264_FAIL;
  126|  1.54M|    return IH264_SUCCESS;
  127|  1.54M|}
ih264_buf_mgr_unlock:
  147|  1.54M|{
  148|  1.54M|    WORD32 retval;
  149|       |
  150|  1.54M|    retval = ithread_mutex_unlock(ps_buf_mgr->pv_mutex);
  151|  1.54M|    if(retval)
  ------------------
  |  Branch (151:8): [True: 0, False: 1.54M]
  ------------------
  152|      0|        return IH264_FAIL;
  153|  1.54M|    return IH264_SUCCESS;
  154|  1.54M|}
ih264_buf_mgr_free:
  211|  46.5k|{
  212|  46.5k|    WORD32 ret;
  213|       |
  214|  46.5k|    ret = ithread_mutex_destroy(ps_buf_mgr->pv_mutex);
  215|  46.5k|    if(0 == ret)
  ------------------
  |  Branch (215:8): [True: 46.5k, False: 0]
  ------------------
  216|  46.5k|        return IH264_SUCCESS;
  217|      0|    return IH264_FAIL;
  218|  46.5k|}
ih264_buf_mgr_init:
  238|  47.2k|{
  239|  47.2k|    WORD32 id;
  240|  47.2k|    UWORD8 *pu1_buf = (UWORD8 *)pv_buf;
  241|  47.2k|    buf_mgr_t *ps_buf_mgr = (buf_mgr_t *)pu1_buf;
  242|       |
  243|  47.2k|    pu1_buf += sizeof(buf_mgr_t);
  244|  47.2k|    ps_buf_mgr->pv_mutex = pu1_buf;
  245|       |
  246|  47.2k|    pu1_buf += ithread_get_mutex_lock_size();
  247|  47.2k|    ithread_mutex_init(ps_buf_mgr->pv_mutex);
  248|       |
  249|  47.2k|    ps_buf_mgr->i4_max_buf_cnt = BUF_MGR_MAX_CNT;
  ------------------
  |  |   44|  47.2k|#define BUF_MGR_MAX_CNT 64
  ------------------
  250|  47.2k|    ps_buf_mgr->i4_active_buf_cnt = 0;
  251|  3.07M|    for(id = 0; id < BUF_MGR_MAX_CNT; id++)
  ------------------
  |  |   44|  3.07M|#define BUF_MGR_MAX_CNT 64
  ------------------
  |  Branch (251:17): [True: 3.02M, False: 47.2k]
  ------------------
  252|  3.02M|    {
  253|  3.02M|        ps_buf_mgr->au4_status[id] = 0;
  254|  3.02M|        ps_buf_mgr->apv_ptr[id] = NULL;
  255|  3.02M|    }
  256|       |
  257|  47.2k|    return ps_buf_mgr;
  258|  47.2k|}
ih264_buf_mgr_reset:
  278|   165k|{
  279|   165k|    WORD32 id;
  280|   165k|    buf_mgr_t *ps_buf_mgr;
  281|       |
  282|   165k|    ps_buf_mgr = (buf_mgr_t *) pv_buf_mgr;
  283|       |
  284|  10.7M|    for(id = 0; id < BUF_MGR_MAX_CNT; id++)
  ------------------
  |  |   44|  10.7M|#define BUF_MGR_MAX_CNT 64
  ------------------
  |  Branch (284:17): [True: 10.6M, False: 165k]
  ------------------
  285|  10.6M|    {
  286|  10.6M|        ps_buf_mgr->au4_status[id] = 0;
  287|  10.6M|    }
  288|       |
  289|   165k|    return;
  290|   165k|}
ih264_buf_mgr_add:
  320|   472k|{
  321|   472k|    IH264_ERROR_T ret = IH264_SUCCESS;
  322|       |
  323|   472k|    ret = ih264_buf_mgr_lock(ps_buf_mgr);
  324|   472k|    RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|   472k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 472k]
  |  |  ------------------
  ------------------
  325|       |
  326|       |    /* Check if buffer ID is within allowed range */
  327|   472k|    if(buf_id >= ps_buf_mgr->i4_max_buf_cnt)
  ------------------
  |  Branch (327:8): [True: 0, False: 472k]
  ------------------
  328|      0|    {
  329|      0|        ret = ih264_buf_mgr_unlock(ps_buf_mgr);
  330|      0|        RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|      0|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  331|      0|        return IH264_FAIL;
  332|      0|    }
  333|       |
  334|       |    /* Check if the current ID is being used to hold some other buffer */
  335|   472k|    if((ps_buf_mgr->apv_ptr[buf_id] != NULL) &&
  ------------------
  |  Branch (335:8): [True: 0, False: 472k]
  ------------------
  336|      0|       (ps_buf_mgr->apv_ptr[buf_id] != pv_ptr))
  ------------------
  |  Branch (336:8): [True: 0, False: 0]
  ------------------
  337|      0|    {
  338|      0|        ret = ih264_buf_mgr_unlock(ps_buf_mgr);
  339|      0|        RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|      0|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  340|      0|        return IH264_FAIL;
  341|      0|    }
  342|   472k|    ps_buf_mgr->apv_ptr[buf_id] = pv_ptr;
  343|   472k|    ps_buf_mgr->i4_active_buf_cnt++;
  344|       |
  345|   472k|    ret = ih264_buf_mgr_unlock(ps_buf_mgr);
  346|   472k|    RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|   472k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 472k]
  |  |  ------------------
  ------------------
  347|       |
  348|   472k|    return ret;
  349|   472k|}
ih264_buf_mgr_get_next_free:
  374|   277k|{
  375|   277k|    WORD32 id;
  376|   277k|    void *pv_ret_ptr = NULL;
  377|   277k|    IH264_ERROR_T ret = IH264_SUCCESS;
  378|       |
  379|   277k|    ret = ih264_buf_mgr_lock(ps_buf_mgr);
  380|   277k|    RETURN_IF((ret != IH264_SUCCESS), NULL);
  ------------------
  |  |   44|   277k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 277k]
  |  |  ------------------
  ------------------
  381|       |
  382|   608k|    for(id = 0; id < ps_buf_mgr->i4_active_buf_cnt; id++)
  ------------------
  |  Branch (382:17): [True: 606k, False: 1.88k]
  ------------------
  383|   606k|    {
  384|       |        /* Check if the buffer is non-null and status is zero */
  385|   606k|        if((ps_buf_mgr->au4_status[id] == 0) && (ps_buf_mgr->apv_ptr[id]))
  ------------------
  |  Branch (385:12): [True: 275k, False: 330k]
  |  Branch (385:49): [True: 275k, False: 0]
  ------------------
  386|   275k|        {
  387|   275k|            *pi4_buf_id = id;
  388|       |            /* mark buffer as busy before returning */
  389|   275k|            ps_buf_mgr->au4_status[id] = 1;
  390|   275k|            pv_ret_ptr = ps_buf_mgr->apv_ptr[id];
  391|   275k|            break;
  392|   275k|        }
  393|   606k|    }
  394|   277k|    ret = ih264_buf_mgr_unlock(ps_buf_mgr);
  395|   277k|    RETURN_IF((ret != IH264_SUCCESS), NULL);
  ------------------
  |  |   44|   277k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 277k]
  |  |  ------------------
  ------------------
  396|       |
  397|   277k|    return pv_ret_ptr;
  398|   277k|}
ih264_buf_mgr_release:
  470|   442k|{
  471|   442k|    IH264_ERROR_T ret = IH264_SUCCESS;
  472|       |
  473|   442k|    ret = ih264_buf_mgr_lock(ps_buf_mgr);
  474|   442k|    RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|   442k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 442k]
  |  |  ------------------
  ------------------
  475|       |
  476|       |    /* If the given id is pointing to an id which is not yet added */
  477|   442k|    if(buf_id >= ps_buf_mgr->i4_active_buf_cnt)
  ------------------
  |  Branch (477:8): [True: 110k, False: 331k]
  ------------------
  478|   110k|    {
  479|   110k|        ret = ih264_buf_mgr_unlock(ps_buf_mgr);
  480|   110k|        RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|   110k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 110k]
  |  |  ------------------
  ------------------
  481|   110k|        return IH264_FAIL;
  482|   110k|    }
  483|       |
  484|   331k|    ps_buf_mgr->au4_status[buf_id] &= ~mask;
  485|       |
  486|       |    /* If both the REF and DISP are zero, DEC is set to zero */
  487|   331k|    if(ps_buf_mgr->au4_status[buf_id] == 1)
  ------------------
  |  Branch (487:8): [True: 164k, False: 167k]
  ------------------
  488|   164k|    {
  489|   164k|        ps_buf_mgr->au4_status[buf_id] = 0;
  490|   164k|    }
  491|       |
  492|   331k|    ret = ih264_buf_mgr_unlock(ps_buf_mgr);
  493|   331k|    RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|   331k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 331k]
  |  |  ------------------
  ------------------
  494|       |
  495|   331k|    return ret;
  496|   331k|}
ih264_buf_mgr_set_status:
  525|   354k|{
  526|   354k|    IH264_ERROR_T ret = IH264_SUCCESS;
  527|       |
  528|   354k|    ret = ih264_buf_mgr_lock(ps_buf_mgr);
  529|   354k|    RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|   354k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 354k]
  |  |  ------------------
  ------------------
  530|       |
  531|   354k|    if(buf_id >= ps_buf_mgr->i4_active_buf_cnt)
  ------------------
  |  Branch (531:8): [True: 0, False: 354k]
  ------------------
  532|      0|    {
  533|      0|        ret = ih264_buf_mgr_unlock(ps_buf_mgr);
  534|      0|        RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|      0|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  535|      0|        return IH264_FAIL;
  536|      0|    }
  537|       |
  538|   354k|    if((ps_buf_mgr->au4_status[buf_id] & mask) != 0)
  ------------------
  |  Branch (538:8): [True: 0, False: 354k]
  ------------------
  539|      0|    {
  540|      0|        ret = ih264_buf_mgr_unlock(ps_buf_mgr);
  541|      0|        RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|      0|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  542|      0|        return IH264_FAIL;
  543|      0|    }
  544|       |
  545|   354k|    ps_buf_mgr->au4_status[buf_id] |= mask;
  546|   354k|    ret = ih264_buf_mgr_unlock(ps_buf_mgr);
  547|   354k|    RETURN_IF((ret != IH264_SUCCESS), ret);
  ------------------
  |  |   44|   354k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 354k]
  |  |  ------------------
  ------------------
  548|       |
  549|   354k|    return ret;
  550|   354k|}

ih264_intra_pred_chroma_8x8_mode_dc:
  118|  84.4k|{
  119|       |    /* availability of left predictors (only for DC) */
  120|  84.4k|    WORD32 left_avail, left_avail1, left_avail2;
  121|       |
  122|       |    /* availability of top predictors (only for DC) */
  123|  84.4k|    WORD32 top_avail;
  124|       |
  125|       |    /* Pointer to start of left predictors */
  126|  84.4k|    UWORD8 *pu1_left = NULL;
  127|       |
  128|       |    /* Pointer to start of top predictors */
  129|  84.4k|    UWORD8 *pu1_top = NULL;
  130|       |
  131|       |    /* temporary variables to store accumulated first left half, second left half,
  132|       |     * first top half, second top half of U and V values*/
  133|  84.4k|    WORD32 val_u_l1 = 0, val_u_l2 = 0, val_u_t1 = 0, val_u_t2 = 0;
  134|  84.4k|    WORD32 val_v_l1 = 0, val_v_l2 = 0, val_v_t1 = 0, val_v_t2 = 0;
  135|  84.4k|    WORD32 val_u1 = 0, val_u2 = 0, val_v1 = 0, val_v2 = 0;
  136|       |
  137|       |    /* temp */
  138|  84.4k|    WORD32 col, row;
  139|       |
  140|  84.4k|    UNUSED(src_strd);
  ------------------
  |  |   45|  84.4k|#define UNUSED(x) ((void)(x))
  ------------------
  141|  84.4k|    left_avail = ngbr_avail & 0x11;
  142|  84.4k|    left_avail1 = ngbr_avail & 1;
  143|  84.4k|    left_avail2 = (ngbr_avail >> 4) & 1;
  144|  84.4k|    top_avail = (ngbr_avail >> 2) & 1;
  145|       |
  146|  84.4k|    pu1_top = pu1_src + 2 * BLK8x8SIZE + 2;
  ------------------
  |  |  510|  84.4k|#define BLK8x8SIZE          8
  ------------------
  147|  84.4k|    pu1_left = pu1_src + 2 * BLK8x8SIZE - 2;
  ------------------
  |  |  510|  84.4k|#define BLK8x8SIZE          8
  ------------------
  148|       |
  149|  84.4k|    if(left_avail1)
  ------------------
  |  Branch (149:8): [True: 53.9k, False: 30.4k]
  ------------------
  150|  53.9k|    {
  151|       |        /* First 4x4 block */
  152|  53.9k|        val_u_l1 += *pu1_left;
  153|  53.9k|        val_v_l1 += *(pu1_left + 1);
  154|  53.9k|        pu1_left -= 2;
  155|  53.9k|        val_u_l1 += *pu1_left;
  156|  53.9k|        val_v_l1 += *(pu1_left + 1);
  157|  53.9k|        pu1_left -= 2;
  158|  53.9k|        val_u_l1 += *pu1_left;
  159|  53.9k|        val_v_l1 += *(pu1_left + 1);
  160|  53.9k|        pu1_left -= 2;
  161|  53.9k|        val_u_l1 += *pu1_left + 2;
  162|  53.9k|        val_v_l1 += *(pu1_left + 1) + 2;
  163|  53.9k|        pu1_left -= 2;
  164|  53.9k|    }
  165|  30.4k|    else
  166|  30.4k|    {
  167|  30.4k|        pu1_left -= 2 * 4;
  168|  30.4k|    }
  169|       |
  170|  84.4k|    if(left_avail2)
  ------------------
  |  Branch (170:8): [True: 53.9k, False: 30.4k]
  ------------------
  171|  53.9k|    {
  172|       |        /* Second 4x4 block */
  173|  53.9k|        val_u_l2 += *pu1_left;
  174|  53.9k|        val_v_l2 += *(pu1_left + 1);
  175|  53.9k|        pu1_left -= 2;
  176|  53.9k|        val_u_l2 += *pu1_left;
  177|  53.9k|        val_v_l2 += *(pu1_left + 1);
  178|  53.9k|        pu1_left -= 2;
  179|  53.9k|        val_u_l2 += *pu1_left;
  180|  53.9k|        val_v_l2 += *(pu1_left + 1);
  181|  53.9k|        pu1_left -= 2;
  182|  53.9k|        val_u_l2 += *pu1_left + 2;
  183|  53.9k|        val_v_l2 += *(pu1_left + 1) + 2;
  184|  53.9k|        pu1_left -= 2;
  185|  53.9k|    }
  186|  30.4k|    else
  187|  30.4k|    {
  188|  30.4k|        pu1_left -= 2 * 4;
  189|  30.4k|    }
  190|       |
  191|  84.4k|    if(top_avail)
  ------------------
  |  Branch (191:8): [True: 53.6k, False: 30.7k]
  ------------------
  192|  53.6k|    {
  193|  53.6k|        val_u_t1 += *pu1_top + *(pu1_top + 2) + *(pu1_top + 4)
  194|  53.6k|                        + *(pu1_top + 6) + 2;
  195|  53.6k|        val_u_t2 += *(pu1_top + 8) + *(pu1_top + 10) + *(pu1_top + 12)
  196|  53.6k|                        + *(pu1_top + 14) + 2;
  197|  53.6k|        val_v_t1 += *(pu1_top + 1) + *(pu1_top + 3) + *(pu1_top + 5)
  198|  53.6k|                        + *(pu1_top + 7) + 2;
  199|  53.6k|        val_v_t2 += *(pu1_top + 9) + *(pu1_top + 11) + *(pu1_top + 13)
  200|  53.6k|                        + *(pu1_top + 15) + 2;
  201|  53.6k|    }
  202|       |
  203|  84.4k|    if(left_avail + top_avail)
  ------------------
  |  Branch (203:8): [True: 68.4k, False: 15.9k]
  ------------------
  204|  68.4k|    {
  205|  68.4k|        val_u1 = (left_avail1 + top_avail) ?
  ------------------
  |  Branch (205:18): [True: 68.4k, False: 0]
  ------------------
  206|  68.4k|                        ((val_u_l1 + val_u_t1)
  207|  68.4k|                                        >> (1 + left_avail1 + top_avail)) :128;
  208|  68.4k|        val_v1 = (left_avail1 + top_avail) ?
  ------------------
  |  Branch (208:18): [True: 68.4k, False: 0]
  ------------------
  209|  68.4k|                        ((val_v_l1 + val_v_t1)
  210|  68.4k|                                        >> (1 + left_avail1 + top_avail)) :128;
  211|  68.4k|        if(top_avail)
  ------------------
  |  Branch (211:12): [True: 53.6k, False: 14.8k]
  ------------------
  212|  53.6k|        {
  213|  53.6k|            val_u2 = val_u_t2 >> 2;
  214|  53.6k|            val_v2 = val_v_t2 >> 2;
  215|  53.6k|        }
  216|  14.8k|        else if(left_avail1)
  ------------------
  |  Branch (216:17): [True: 14.8k, False: 0]
  ------------------
  217|  14.8k|        {
  218|  14.8k|            val_u2 = val_u_l1 >> 2;
  219|  14.8k|            val_v2 = val_v_l1 >> 2;
  220|  14.8k|        }
  221|      0|        else
  222|      0|        {
  223|      0|            val_u2 = val_v2 = 128;
  224|      0|        }
  225|       |
  226|   342k|        for(row = 0; row < 4; row++)
  ------------------
  |  Branch (226:22): [True: 273k, False: 68.4k]
  ------------------
  227|   273k|        {
  228|       |            /* top left 4x4 block */
  229|  1.36M|            for(col = 0; col < 8; col += 2)
  ------------------
  |  Branch (229:26): [True: 1.09M, False: 273k]
  ------------------
  230|  1.09M|            {
  231|  1.09M|                *(pu1_dst + row * dst_strd + col) = val_u1;
  232|  1.09M|                *(pu1_dst + row * dst_strd + col + 1) = val_v1;
  233|  1.09M|            }
  234|       |            /* top right 4x4 block */
  235|  1.36M|            for(col = 8; col < 16; col += 2)
  ------------------
  |  Branch (235:26): [True: 1.09M, False: 273k]
  ------------------
  236|  1.09M|            {
  237|  1.09M|                *(pu1_dst + row * dst_strd + col) = val_u2;
  238|  1.09M|                *(pu1_dst + row * dst_strd + col + 1) = val_v2;
  239|  1.09M|            }
  240|   273k|        }
  241|       |
  242|  68.4k|        if(left_avail2)
  ------------------
  |  Branch (242:12): [True: 53.9k, False: 14.5k]
  ------------------
  243|  53.9k|        {
  244|  53.9k|            val_u1 = val_u_l2 >> 2;
  245|  53.9k|            val_v1 = val_v_l2 >> 2;
  246|  53.9k|        }
  247|  14.5k|        else if(top_avail)
  ------------------
  |  Branch (247:17): [True: 14.5k, False: 0]
  ------------------
  248|  14.5k|        {
  249|  14.5k|            val_u1 = val_u_t1 >> 2;
  250|  14.5k|            val_v1 = val_v_t1 >> 2;
  251|  14.5k|        }
  252|      0|        else
  253|      0|        {
  254|      0|            val_u1 = val_v1 = 128;
  255|      0|        }
  256|  68.4k|        val_u2 = (left_avail2 + top_avail) ?
  ------------------
  |  Branch (256:18): [True: 68.4k, False: 0]
  ------------------
  257|  68.4k|                        ((val_u_l2 + val_u_t2)
  258|  68.4k|                                        >> (1 + left_avail2 + top_avail)) : 128;
  259|  68.4k|        val_v2 = (left_avail2 + top_avail) ?
  ------------------
  |  Branch (259:18): [True: 68.4k, False: 0]
  ------------------
  260|  68.4k|                        ((val_v_l2 + val_v_t2)
  261|  68.4k|                                        >> (1 + left_avail2 + top_avail)) :  128;
  262|       |
  263|   342k|        for(row = 4; row < 8; row++)
  ------------------
  |  Branch (263:22): [True: 273k, False: 68.4k]
  ------------------
  264|   273k|        {
  265|       |            /* bottom left 4x4 block */
  266|  1.36M|            for(col = 0; col < 8; col += 2)
  ------------------
  |  Branch (266:26): [True: 1.09M, False: 273k]
  ------------------
  267|  1.09M|            {
  268|  1.09M|                *(pu1_dst + row * dst_strd + col) = val_u1;
  269|  1.09M|                *(pu1_dst + row * dst_strd + col + 1) = val_v1;
  270|  1.09M|            }
  271|       |            /* bottom right 4x4 block */
  272|  1.36M|            for(col = 8; col < 16; col += 2)
  ------------------
  |  Branch (272:26): [True: 1.09M, False: 273k]
  ------------------
  273|  1.09M|            {
  274|  1.09M|                *(pu1_dst + row * dst_strd + col) = val_u2;
  275|  1.09M|                *(pu1_dst + row * dst_strd + col + 1) = val_v2;
  276|  1.09M|            }
  277|   273k|        }
  278|  68.4k|    }
  279|  15.9k|    else
  280|  15.9k|    {
  281|       |        /* Both left and top are unavailable, set the block to 128 */
  282|   143k|        for(row = 0; row < 8; row++)
  ------------------
  |  Branch (282:22): [True: 127k, False: 15.9k]
  ------------------
  283|   127k|        {
  284|   127k|            memset(pu1_dst + row * dst_strd, 128, 8 * sizeof(UWORD16));
  285|   127k|        }
  286|  15.9k|    }
  287|  84.4k|}
ih264_intra_pred_chroma_8x8_mode_horz:
  323|  22.1k|{
  324|       |    /* Pointer to start of left predictors */
  325|  22.1k|    UWORD8 *pu1_left = NULL;
  326|       |
  327|       |    /* temp */
  328|  22.1k|    WORD32 rows, cols;
  329|       |
  330|  22.1k|    UNUSED(src_strd);
  ------------------
  |  |   45|  22.1k|#define UNUSED(x) ((void)(x))
  ------------------
  331|  22.1k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  22.1k|#define UNUSED(x) ((void)(x))
  ------------------
  332|  22.1k|    pu1_left = pu1_src + 2 * BLK8x8SIZE - 2;
  ------------------
  |  |  510|  22.1k|#define BLK8x8SIZE          8
  ------------------
  333|   199k|    for(rows = 0; rows < 8; rows++)
  ------------------
  |  Branch (333:19): [True: 177k, False: 22.1k]
  ------------------
  334|   177k|    {
  335|  1.59M|        for(cols = 0; cols < 16; cols += 2)
  ------------------
  |  Branch (335:23): [True: 1.41M, False: 177k]
  ------------------
  336|  1.41M|        {
  337|  1.41M|            *(pu1_dst + rows * dst_strd + cols) = *pu1_left;
  338|  1.41M|            *(pu1_dst + rows * dst_strd + cols + 1) = *(pu1_left + 1);
  339|  1.41M|        }
  340|   177k|        pu1_left -= 2;
  341|   177k|    }
  342|  22.1k|}
ih264_intra_pred_chroma_8x8_mode_vert:
  379|  15.0k|{
  380|       |    /* Pointer to start of top predictors */
  381|  15.0k|    UWORD8 *pu1_top = NULL;
  382|       |
  383|       |    /* temp */
  384|  15.0k|    WORD32 row;
  385|       |
  386|  15.0k|    UNUSED(src_strd);
  ------------------
  |  |   45|  15.0k|#define UNUSED(x) ((void)(x))
  ------------------
  387|  15.0k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  15.0k|#define UNUSED(x) ((void)(x))
  ------------------
  388|  15.0k|    pu1_top = pu1_src + 2 * BLK8x8SIZE + 2;
  ------------------
  |  |  510|  15.0k|#define BLK8x8SIZE          8
  ------------------
  389|       |
  390|       |    /* 8 bytes are copied from src to dst */
  391|  45.2k|    for(row = 0; row < 2; row++)
  ------------------
  |  Branch (391:18): [True: 30.1k, False: 15.0k]
  ------------------
  392|  30.1k|    {
  393|  30.1k|        memcpy(pu1_dst, pu1_top, 16);
  394|       |
  395|  30.1k|        pu1_dst += dst_strd;
  396|  30.1k|        memcpy(pu1_dst, pu1_top, 16);
  397|       |
  398|  30.1k|        pu1_dst += dst_strd;
  399|  30.1k|        memcpy(pu1_dst, pu1_top, 16);
  400|       |
  401|  30.1k|        pu1_dst += dst_strd;
  402|  30.1k|        memcpy(pu1_dst, pu1_top, 16);
  403|       |
  404|  30.1k|        pu1_dst += dst_strd;
  405|  30.1k|    }
  406|  15.0k|}
ih264_intra_pred_chroma_8x8_mode_plane:
  443|  3.26k|{
  444|       |    /* Pointer to start of left predictors */
  445|  3.26k|    UWORD8 *pu1_left = NULL;
  446|       |
  447|       |    /* Pointer to start of top predictors */
  448|  3.26k|    UWORD8 *pu1_top = NULL;
  449|       |
  450|       |    /* temp */
  451|  3.26k|    WORD32 val = 0;
  452|  3.26k|    WORD32 rows, cols;
  453|       |
  454|       |    /* Implementing section 8.3.4.4. The variables represent the corresponding
  455|       |     * variables in the section */
  456|  3.26k|    WORD32 a_u, b_u, c_u, h_u, v_u;
  457|  3.26k|    WORD32 a_v, b_v, c_v, h_v, v_v;
  458|       |
  459|  3.26k|    UNUSED(src_strd);
  ------------------
  |  |   45|  3.26k|#define UNUSED(x) ((void)(x))
  ------------------
  460|  3.26k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  3.26k|#define UNUSED(x) ((void)(x))
  ------------------
  461|  3.26k|    a_u = b_u = c_u = h_u = v_u = 0;
  462|  3.26k|    a_v = b_v = c_v = h_v = v_v = 0;
  463|       |
  464|  3.26k|    pu1_top = pu1_src + 2 * BLK8x8SIZE + 2;
  ------------------
  |  |  510|  3.26k|#define BLK8x8SIZE          8
  ------------------
  465|  3.26k|    pu1_left = pu1_src + 2 * BLK8x8SIZE - 2;
  ------------------
  |  |  510|  3.26k|#define BLK8x8SIZE          8
  ------------------
  466|       |
  467|  16.3k|    for(cols = 0; cols < 4; cols++)
  ------------------
  |  Branch (467:19): [True: 13.0k, False: 3.26k]
  ------------------
  468|  13.0k|    {
  469|  13.0k|        h_u += (cols + 1) * (pu1_top[8 + 2 * cols] - pu1_top[4 - 2 * cols]);
  470|  13.0k|        h_v += (cols + 1) * (pu1_top[8 + 2 * cols + 1] - pu1_top[4 - 2 * cols+ 1]);
  471|       |
  472|  13.0k|        v_u += (cols + 1) * (pu1_left[(4 + cols) * (-2)] - pu1_left[(2 - cols) * (-2)]);
  473|  13.0k|        v_v += (cols + 1)  * (pu1_left[(4 + cols) * (-2) + 1]  - pu1_left[(2 - cols) * (-2) + 1]);
  474|  13.0k|    }
  475|  3.26k|    a_u = 16 * (pu1_left[7 * (-2)] + pu1_top[14]);
  476|  3.26k|    a_v = 16 * (pu1_left[7 * (-2) + 1] + pu1_top[15]);
  477|  3.26k|    b_u = (34 * h_u + 32) >> 6;
  478|  3.26k|    b_v = (34 * h_v + 32) >> 6;
  479|  3.26k|    c_u = (34 * v_u + 32) >> 6;
  480|  3.26k|    c_v = (34 * v_v + 32) >> 6;
  481|       |
  482|  29.3k|    for(rows = 0; rows < 8; rows++)
  ------------------
  |  Branch (482:19): [True: 26.1k, False: 3.26k]
  ------------------
  483|  26.1k|    {
  484|   235k|        for(cols = 0; cols < 8; cols++)
  ------------------
  |  Branch (484:23): [True: 209k, False: 26.1k]
  ------------------
  485|   209k|        {
  486|   209k|            val = (a_u + b_u * (cols - 3) + c_u * (rows - 3) );
  487|   209k|            val = (val + 16) >> 5;
  488|   209k|            *(pu1_dst + rows * dst_strd + 2 * cols) = CLIP_U8(val);
  ------------------
  |  |   58|   209k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   209k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 6.26k, False: 202k]
  |  |  |  |  |  Branch (77:54): [True: 3.90k, False: 198k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  489|   209k|            val = (a_v + b_v * (cols - 3) + c_v * (rows - 3) );
  490|   209k|            val = (val + 16) >> 5;
  491|   209k|            *(pu1_dst + rows * dst_strd + 2 * cols + 1) = CLIP_U8(val);
  ------------------
  |  |   58|   209k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   209k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 9.02k, False: 199k]
  |  |  |  |  |  Branch (77:54): [True: 2.20k, False: 197k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  492|   209k|        }
  493|  26.1k|    }
  494|  3.26k|}

ih264_deblk_luma_vert_bs4:
  108|  43.0k|{
  109|  43.0k|    UWORD8 p3, p2, p1, p0, q0, q1, q2, q3;
  110|  43.0k|    WORD32 pos_p3, pos_p2, pos_p1, pos_p0;
  111|  43.0k|    WORD32 pos_q0, pos_q1, pos_q2,pos_q3;
  112|  43.0k|    UWORD8 a_p, a_q; /* threshold variables */
  113|  43.0k|    WORD32 blk_strd = src_strd << 2; /* block_increment = src_strd * 4 */
  114|  43.0k|    UWORD8 *pu1_src_temp;
  115|  43.0k|    WORD8 i = 0, edge;
  116|       |
  117|  43.0k|    pos_q0 = 0;
  118|  43.0k|    pos_q1 = 1;
  119|  43.0k|    pos_q2 = 2;
  120|  43.0k|    pos_q3 = 3;
  121|  43.0k|    pos_p0 = -1;
  122|  43.0k|    pos_p1 = -2;
  123|  43.0k|    pos_p2 = -3;
  124|  43.0k|    pos_p3 = -4;
  125|       |
  126|   215k|    for(edge = 0; edge < 4; edge++, pu1_src += blk_strd)
  ------------------
  |  Branch (126:19): [True: 172k, False: 43.0k]
  ------------------
  127|   172k|    {
  128|   172k|        pu1_src_temp = pu1_src;
  129|   860k|        for(i = 0; i < 4; ++i, pu1_src_temp += src_strd)
  ------------------
  |  Branch (129:20): [True: 688k, False: 172k]
  ------------------
  130|   688k|        {
  131|   688k|            q0 = pu1_src_temp[pos_q0];
  132|   688k|            q1 = pu1_src_temp[pos_q1];
  133|   688k|            p0 = pu1_src_temp[pos_p0];
  134|   688k|            p1 = pu1_src_temp[pos_p1];
  135|       |
  136|       |            /* Filter Decision */
  137|   688k|            if((ABS(p0 - q0) >= alpha) ||
  ------------------
  |  |  100|   688k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 151k, False: 537k]
  |  |  ------------------
  ------------------
  |  Branch (137:16): [True: 192k, False: 496k]
  ------------------
  138|   496k|               (ABS(q1 - q0) >= beta)  ||
  ------------------
  |  |  100|   496k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 47.1k, False: 449k]
  |  |  ------------------
  ------------------
  |  Branch (138:16): [True: 26.4k, False: 469k]
  ------------------
  139|   469k|               (ABS(p1 - p0) >= beta))
  ------------------
  |  |  100|   469k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 23.6k, False: 446k]
  |  |  ------------------
  ------------------
  |  Branch (139:16): [True: 13.6k, False: 456k]
  ------------------
  140|   232k|                continue;
  141|       |
  142|   456k|            p2 = pu1_src_temp[pos_p2];
  143|   456k|            p3 = pu1_src_temp[pos_p3];
  144|   456k|            q2 = pu1_src_temp[pos_q2];
  145|   456k|            q3 = pu1_src_temp[pos_q3];
  146|       |
  147|   456k|            if(ABS(p0 - q0) < ((alpha >> 2) + 2))
  ------------------
  |  |  100|   456k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 93.7k, False: 362k]
  |  |  ------------------
  ------------------
  |  Branch (147:16): [True: 433k, False: 22.7k]
  ------------------
  148|   433k|            {
  149|       |                /* Threshold Variables */
  150|   433k|                a_p = (UWORD8)ABS(p2 - p0);
  ------------------
  |  |  100|   433k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 32.4k, False: 400k]
  |  |  ------------------
  ------------------
  151|   433k|                a_q = (UWORD8)ABS(q2 - q0);
  ------------------
  |  |  100|   433k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 23.7k, False: 409k]
  |  |  ------------------
  ------------------
  152|       |
  153|   433k|                if(a_p < beta)
  ------------------
  |  Branch (153:20): [True: 429k, False: 4.26k]
  ------------------
  154|   429k|                {
  155|       |                    /* p0', p1', p2' */
  156|   429k|                    pu1_src_temp[pos_p0] = ((p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   429k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_p0] = ((p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   429k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_p0] = ((p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   429k|#define X2(a)   ((a) << 1)
  ------------------
  157|   429k|                                    + 4) >> 3);
  158|   429k|                    pu1_src_temp[pos_p1] = ((p2 + p1 + p0 + q0 + 2) >> 2);
  159|   429k|                    pu1_src_temp[pos_p2] =
  160|   429k|                                    ((X2(p3) + X3(p2) + p1 + p0 + q0
  ------------------
  |  |   91|   429k|#define X2(a)   ((a) << 1)
  ------------------
                                                  ((X2(p3) + X3(p2) + p1 + p0 + q0
  ------------------
  |  |   92|   429k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  161|   429k|                                                    + 4) >> 3);
  162|   429k|                }
  163|  4.26k|                else
  164|  4.26k|                {
  165|       |                    /* p0'*/
  166|  4.26k|                    pu1_src_temp[pos_p0] = ((X2(p1) + p0 + q1 + 2) >> 2);
  ------------------
  |  |   91|  4.26k|#define X2(a)   ((a) << 1)
  ------------------
  167|  4.26k|                }
  168|       |
  169|   433k|                if(a_q < beta)
  ------------------
  |  Branch (169:20): [True: 429k, False: 4.14k]
  ------------------
  170|   429k|                {
  171|       |                    /* q0', q1', q2' */
  172|   429k|                    pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1) + q2
  ------------------
  |  |   91|   429k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1) + q2
  ------------------
  |  |   91|   429k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1) + q2
  ------------------
  |  |   91|   429k|#define X2(a)   ((a) << 1)
  ------------------
  173|   429k|                                    + 4) >> 3;
  174|   429k|                    pu1_src_temp[pos_q1] = (p0 + q0 + q1 + q2 + 2) >> 2;
  175|   429k|                    pu1_src_temp[pos_q2] = (X2(q3) + X3(q2) + q1 + q0 + p0 + 4)
  ------------------
  |  |   91|   429k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q2] = (X2(q3) + X3(q2) + q1 + q0 + p0 + 4)
  ------------------
  |  |   92|   429k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  176|   429k|                                    >> 3;
  177|   429k|                }
  178|  4.14k|                else
  179|  4.14k|                {
  180|       |                    /* q0'*/
  181|  4.14k|                    pu1_src_temp[pos_q0] = (X2(q1) + q0 + p1 + 2) >> 2;
  ------------------
  |  |   91|  4.14k|#define X2(a)   ((a) << 1)
  ------------------
  182|  4.14k|                }
  183|   433k|            }
  184|  22.7k|            else
  185|  22.7k|            {
  186|       |                /* p0', q0'*/
  187|  22.7k|                pu1_src_temp[pos_p0] = ((X2(p1) + p0 + q1 + 2) >> 2);
  ------------------
  |  |   91|  22.7k|#define X2(a)   ((a) << 1)
  ------------------
  188|  22.7k|                pu1_src_temp[pos_q0] = (X2(q1) + q0 + p1 + 2) >> 2;
  ------------------
  |  |   91|  22.7k|#define X2(a)   ((a) << 1)
  ------------------
  189|  22.7k|            }
  190|   456k|        }
  191|   172k|    }
  192|  43.0k|}
ih264_deblk_luma_horz_bs4:
  226|  52.4k|{
  227|  52.4k|    UWORD8 p3, p2, p1, p0, q0, q1, q2, q3;
  228|  52.4k|    WORD32 pos_p3, pos_p2, pos_p1, pos_p0, pos_q0, pos_q1,
  229|  52.4k|                    pos_q2, pos_q3;
  230|  52.4k|    UWORD8 a_p, a_q; /* threshold variables */
  231|  52.4k|    UWORD8 *pu1_p3; /* pointer to the src sample p3 */
  232|  52.4k|    UWORD8 *pu1_p3_temp;
  233|  52.4k|    UWORD8 *pu1_src_temp;
  234|  52.4k|    WORD8 i = 0, edge;
  235|       |
  236|  52.4k|    pu1_p3 = pu1_src - (src_strd << 2);
  237|  52.4k|    pos_q0 = 0;
  238|  52.4k|    pos_q1 = src_strd;
  239|  52.4k|    pos_q2 = X2(src_strd);
  ------------------
  |  |   91|  52.4k|#define X2(a)   ((a) << 1)
  ------------------
  240|  52.4k|    pos_q3 = X3(src_strd);
  ------------------
  |  |   92|  52.4k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  241|  52.4k|    pos_p0 = X3(src_strd);
  ------------------
  |  |   92|  52.4k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  242|  52.4k|    pos_p1 = X2(src_strd);
  ------------------
  |  |   91|  52.4k|#define X2(a)   ((a) << 1)
  ------------------
  243|  52.4k|    pos_p2 = src_strd;
  244|  52.4k|    pos_p3 = 0;
  245|       |
  246|   262k|    for(edge = 0; edge < 4; edge++, pu1_src += 4, pu1_p3 += 4)
  ------------------
  |  Branch (246:19): [True: 209k, False: 52.4k]
  ------------------
  247|   209k|    {
  248|   209k|        pu1_src_temp = pu1_src;
  249|   209k|        pu1_p3_temp = pu1_p3;
  250|  1.04M|        for(i = 0; i < 4; ++i, pu1_src_temp++, pu1_p3_temp++)
  ------------------
  |  Branch (250:20): [True: 839k, False: 209k]
  ------------------
  251|   839k|        {
  252|   839k|            q0 = pu1_src_temp[pos_q0];
  253|   839k|            q1 = pu1_src_temp[pos_q1];
  254|   839k|            p0 = pu1_p3_temp[pos_p0];
  255|   839k|            p1 = pu1_p3_temp[pos_p1];
  256|       |
  257|       |            /* Filter Decision */
  258|   839k|            if((ABS(p0 - q0) >= alpha) ||
  ------------------
  |  |  100|   839k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 163k, False: 676k]
  |  |  ------------------
  ------------------
  |  Branch (258:16): [True: 215k, False: 624k]
  ------------------
  259|   624k|               (ABS(q1 - q0) >= beta) ||
  ------------------
  |  |  100|   624k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 37.1k, False: 586k]
  |  |  ------------------
  ------------------
  |  Branch (259:16): [True: 22.9k, False: 601k]
  ------------------
  260|   601k|               (ABS(p1 - p0) >= beta))
  ------------------
  |  |  100|   601k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 25.2k, False: 575k]
  |  |  ------------------
  ------------------
  |  Branch (260:16): [True: 10.4k, False: 590k]
  ------------------
  261|   248k|                continue;
  262|       |
  263|   590k|            p2 = pu1_p3_temp[pos_p2];
  264|   590k|            p3 = pu1_p3_temp[pos_p3];
  265|   590k|            q2 = pu1_src_temp[pos_q2];
  266|   590k|            q3 = pu1_src_temp[pos_q3];
  267|       |
  268|   590k|            if(ABS(p0 - q0) < ((alpha >> 2) + 2))
  ------------------
  |  |  100|   590k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 107k, False: 483k]
  |  |  ------------------
  ------------------
  |  Branch (268:16): [True: 556k, False: 34.1k]
  ------------------
  269|   556k|            {
  270|       |                /* Threshold Variables */
  271|   556k|                a_p = ABS(p2 - p0);
  ------------------
  |  |  100|   556k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 38.3k, False: 518k]
  |  |  ------------------
  ------------------
  272|   556k|                a_q = ABS(q2 - q0);
  ------------------
  |  |  100|   556k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 33.4k, False: 523k]
  |  |  ------------------
  ------------------
  273|       |
  274|   556k|                if((a_p < beta))
  ------------------
  |  Branch (274:20): [True: 547k, False: 8.57k]
  ------------------
  275|   547k|                {
  276|       |                    /* p0', p1', p2' */
  277|   547k|                    pu1_p3_temp[pos_p0] = (p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   547k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_p3_temp[pos_p0] = (p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   547k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_p3_temp[pos_p0] = (p2 + X2(p1) + X2(p0) + X2(q0) + q1
  ------------------
  |  |   91|   547k|#define X2(a)   ((a) << 1)
  ------------------
  278|   547k|                                    + 4) >> 3;
  279|   547k|                    pu1_p3_temp[pos_p1] = (p2 + p1 + p0 + q0 + 2) >> 2;
  280|   547k|                    pu1_p3_temp[pos_p2] =
  281|   547k|                                    (X2(p3) + X3(p2) + p1 + p0 + q0
  ------------------
  |  |   91|   547k|#define X2(a)   ((a) << 1)
  ------------------
                                                  (X2(p3) + X3(p2) + p1 + p0 + q0
  ------------------
  |  |   92|   547k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  282|   547k|                                                    + 4) >> 3;
  283|   547k|                }
  284|  8.57k|                else
  285|  8.57k|                {
  286|       |                    /* p0'*/
  287|  8.57k|                    pu1_p3_temp[pos_p0] = (X2(p1) + p0 + q1 + 2) >> 2;
  ------------------
  |  |   91|  8.57k|#define X2(a)   ((a) << 1)
  ------------------
  288|  8.57k|                }
  289|       |
  290|   556k|                if(a_q < beta)
  ------------------
  |  Branch (290:20): [True: 547k, False: 9.20k]
  ------------------
  291|   547k|                {
  292|       |                    /* q0', q1', q2' */
  293|   547k|                    pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1)
  ------------------
  |  |   91|   547k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1)
  ------------------
  |  |   91|   547k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q0] = (p1 + X2(p0) + X2(q0) + X2(q1)
  ------------------
  |  |   91|   547k|#define X2(a)   ((a) << 1)
  ------------------
  294|   547k|                                    + q2 + 4) >> 3;
  295|   547k|                    pu1_src_temp[pos_q1] = (p0 + q0 + q1 + q2 + 2) >> 2;
  296|   547k|                    pu1_src_temp[pos_q2] = (X2(q3) + X3(q2) + q1 + q0 + p0
  ------------------
  |  |   91|   547k|#define X2(a)   ((a) << 1)
  ------------------
                                  pu1_src_temp[pos_q2] = (X2(q3) + X3(q2) + q1 + q0 + p0
  ------------------
  |  |   92|   547k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  297|   547k|                                    + 4) >> 3;
  298|   547k|                }
  299|  9.20k|                else
  300|  9.20k|                {
  301|       |                    /* q0'*/
  302|  9.20k|                    pu1_src_temp[pos_q0] = (X2(q1) + q0 + p1 + 2) >> 2;
  ------------------
  |  |   91|  9.20k|#define X2(a)   ((a) << 1)
  ------------------
  303|  9.20k|                }
  304|   556k|            }
  305|  34.1k|            else
  306|  34.1k|            {
  307|       |                /* p0', q0'*/
  308|  34.1k|                pu1_p3_temp[pos_p0] = (X2(p1) + p0 + q1 + 2) >> 2;
  ------------------
  |  |   91|  34.1k|#define X2(a)   ((a) << 1)
  ------------------
  309|  34.1k|                pu1_src_temp[pos_q0] = (X2(q1) + q0 + p1 + 2) >> 2;
  ------------------
  |  |   91|  34.1k|#define X2(a)   ((a) << 1)
  ------------------
  310|  34.1k|            }
  311|   590k|        }
  312|   209k|    }
  313|  52.4k|}
ih264_deblk_luma_vert_bslt4:
  538|   285k|{
  539|   285k|    WORD8 i = 0, edge;
  540|   285k|    UWORD8 p2, p1, p0, q0, q1, q2;
  541|   285k|    WORD32 pos_p2, pos_p1, pos_p0, pos_q0, pos_q1, pos_q2;
  542|   285k|    UWORD8 a_p, a_q; /* threshold variables */
  543|   285k|    WORD32 blk_strd = src_strd << 2; /* block_increment = src_strd * 4 */
  544|   285k|    UWORD8 *pu1_src_temp;
  545|   285k|    WORD8 delta;
  546|   285k|    WORD8 tc;
  547|   285k|    WORD16 val;
  548|   285k|    UWORD8 tc0, u1_bs;
  549|       |
  550|   285k|    pos_q0 = 0;
  551|   285k|    pos_q1 = 1;
  552|   285k|    pos_q2 = 2;
  553|   285k|    pos_p0 = -1;
  554|   285k|    pos_p1 = -2;
  555|   285k|    pos_p2 = -3;
  556|       |
  557|  1.42M|    for(edge = 0; edge < 4; edge++, pu1_src += blk_strd)
  ------------------
  |  Branch (557:19): [True: 1.14M, False: 285k]
  ------------------
  558|  1.14M|    {
  559|  1.14M|        pu1_src_temp = pu1_src;
  560|       |        /* Filter Decision */
  561|  1.14M|        u1_bs = (UWORD8)((u4_bs >> ((3 - edge) << 3)) & 0x0ff);
  562|  1.14M|        if(!u1_bs)
  ------------------
  |  Branch (562:12): [True: 119k, False: 1.02M]
  ------------------
  563|   119k|            continue;
  564|       |        /* tc0 */
  565|  1.02M|        tc0 = pu1_cliptab[u1_bs];
  566|  5.11M|        for(i = 0; i < 4; ++i, pu1_src_temp += src_strd)
  ------------------
  |  Branch (566:20): [True: 4.09M, False: 1.02M]
  ------------------
  567|  4.09M|        {
  568|  4.09M|            q0 = pu1_src_temp[pos_q0];
  569|  4.09M|            q1 = pu1_src_temp[pos_q1];
  570|  4.09M|            p0 = pu1_src_temp[pos_p0];
  571|  4.09M|            p1 = pu1_src_temp[pos_p1];
  572|       |
  573|       |            /* Filter Decision */
  574|  4.09M|            if((ABS(p0 - q0) >= alpha) ||
  ------------------
  |  |  100|  4.09M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 513k, False: 3.57M]
  |  |  ------------------
  ------------------
  |  Branch (574:16): [True: 593k, False: 3.49M]
  ------------------
  575|  3.49M|               (ABS(q1 - q0) >= beta) ||
  ------------------
  |  |  100|  3.49M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 250k, False: 3.24M]
  |  |  ------------------
  ------------------
  |  Branch (575:16): [True: 175k, False: 3.32M]
  ------------------
  576|  3.32M|               (ABS(p1 - p0) >= beta))
  ------------------
  |  |  100|  3.32M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 251k, False: 3.07M]
  |  |  ------------------
  ------------------
  |  Branch (576:16): [True: 78.3k, False: 3.24M]
  ------------------
  577|   847k|                continue;
  578|       |
  579|  3.24M|            q2 = pu1_src_temp[pos_q2];
  580|  3.24M|            p2 = pu1_src_temp[pos_p2];
  581|       |
  582|  3.24M|            a_p = ABS(p2 - p0);
  ------------------
  |  |  100|  3.24M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 293k, False: 2.95M]
  |  |  ------------------
  ------------------
  583|  3.24M|            a_q = ABS(q2 - q0);
  ------------------
  |  |  100|  3.24M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 179k, False: 3.06M]
  |  |  ------------------
  ------------------
  584|       |
  585|       |            /* tc */
  586|  3.24M|            tc = tc0 + (a_p < beta) + (a_q < beta);
  587|       |
  588|  3.24M|            val = ((((q0 - p0) << 2) + (p1 - q1) + 4) >> 3);
  589|  3.24M|            delta = CLIP3(-tc, tc, val);
  ------------------
  |  |   77|  3.24M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 33.8k, False: 3.20M]
  |  |  |  Branch (77:54): [True: 41.4k, False: 3.16M]
  |  |  ------------------
  ------------------
  590|       |
  591|       |            /* p0' */
  592|  3.24M|            val = p0 + delta;
  593|  3.24M|            pu1_src_temp[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  3.24M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  3.24M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.18k, False: 3.24M]
  |  |  |  |  |  Branch (77:54): [True: 482, False: 3.24M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  594|       |            /* q0' */
  595|  3.24M|            val = q0 - delta;
  596|  3.24M|            pu1_src_temp[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  3.24M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  3.24M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.38k, False: 3.23M]
  |  |  |  |  |  Branch (77:54): [True: 1.07k, False: 3.23M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  597|       |
  598|       |            /* Luma only */
  599|  3.24M|            if(a_p < beta)
  ------------------
  |  Branch (599:16): [True: 3.17M, False: 72.6k]
  ------------------
  600|  3.17M|            {
  601|       |                /* p1' */
  602|  3.17M|                val = ((p2 + ((p0 + q0 + 1) >> 1) - (p1 << 1)) >> 1);
  603|  3.17M|                pu1_src_temp[pos_p1] += CLIP3(-tc0, tc0, val);
  ------------------
  |  |   77|  3.17M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 50.0k, False: 3.12M]
  |  |  |  Branch (77:54): [True: 50.7k, False: 3.06M]
  |  |  ------------------
  ------------------
  604|  3.17M|            }
  605|       |
  606|  3.24M|            if(a_q < beta)
  ------------------
  |  Branch (606:16): [True: 3.18M, False: 57.9k]
  ------------------
  607|  3.18M|            {
  608|       |                /* q1' */
  609|  3.18M|                val = ((q2 + ((p0 + q0 + 1) >> 1) - (q1 << 1)) >> 1);
  610|  3.18M|                pu1_src_temp[pos_q1] += CLIP3(-tc0, tc0, val);
  ------------------
  |  |   77|  3.18M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 52.2k, False: 3.13M]
  |  |  |  Branch (77:54): [True: 43.4k, False: 3.08M]
  |  |  ------------------
  ------------------
  611|  3.18M|            }
  612|  3.24M|        }
  613|  1.02M|    }
  614|   285k|}
ih264_deblk_luma_horz_bslt4:
  772|   295k|{
  773|   295k|    UWORD8 p2, p1, p0, q0, q1, q2;
  774|   295k|    WORD32 pos_p2, pos_p1, pos_p0, pos_q0, pos_q1, pos_q2;
  775|   295k|    UWORD8 a_p, a_q; /* Threshold variables */
  776|   295k|    UWORD8 *pu1_p2; /* Pointer to the src sample p2 */
  777|   295k|    UWORD8 *pu1_p2_temp;
  778|   295k|    UWORD8 *pu1_src_temp;
  779|   295k|    WORD8 i = 0, edge;
  780|   295k|    WORD8 delta;
  781|   295k|    WORD8 tc;
  782|   295k|    WORD16 val;
  783|   295k|    UWORD8 tc0, u1_bs;
  784|       |
  785|   295k|    pu1_p2 = pu1_src - (src_strd << 2);
  786|   295k|    pos_q0 = 0;
  787|   295k|    pos_q1 = src_strd;
  788|   295k|    pos_q2 = X2(src_strd);
  ------------------
  |  |   91|   295k|#define X2(a)   ((a) << 1)
  ------------------
  789|   295k|    pos_p0 = X3(src_strd);
  ------------------
  |  |   92|   295k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  790|   295k|    pos_p1 = X2(src_strd);
  ------------------
  |  |   91|   295k|#define X2(a)   ((a) << 1)
  ------------------
  791|   295k|    pos_p2 = src_strd;
  792|       |
  793|  1.47M|    for(edge = 0; edge < 4; edge++, pu1_src += 4, pu1_p2 += 4)
  ------------------
  |  Branch (793:19): [True: 1.18M, False: 295k]
  ------------------
  794|  1.18M|    {
  795|  1.18M|        pu1_src_temp = pu1_src;
  796|  1.18M|        pu1_p2_temp = pu1_p2;
  797|       |
  798|       |        /* Filter Decision */
  799|  1.18M|        u1_bs = (UWORD8)((u4_bs >> ((3 - edge) << 3)) & 0x0ff);
  800|  1.18M|        if(!u1_bs)
  ------------------
  |  Branch (800:12): [True: 118k, False: 1.06M]
  ------------------
  801|   118k|            continue;
  802|       |        /* tc0 */
  803|  1.06M|        tc0 = pu1_cliptab[u1_bs];
  804|       |
  805|  5.31M|        for(i = 0; i < 4; ++i, pu1_src_temp++, pu1_p2_temp++)
  ------------------
  |  Branch (805:20): [True: 4.25M, False: 1.06M]
  ------------------
  806|  4.25M|        {
  807|  4.25M|            q0 = pu1_src_temp[pos_q0];
  808|  4.25M|            q1 = pu1_src_temp[pos_q1];
  809|  4.25M|            p0 = pu1_p2_temp[pos_p0];
  810|  4.25M|            p1 = pu1_p2_temp[pos_p1];
  811|       |
  812|       |            /* Filter Decision */
  813|  4.25M|            if((ABS(p0 - q0) >= alpha) ||
  ------------------
  |  |  100|  4.25M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 538k, False: 3.71M]
  |  |  ------------------
  ------------------
  |  Branch (813:16): [True: 618k, False: 3.63M]
  ------------------
  814|  3.63M|               (ABS(q1 - q0) >= beta) ||
  ------------------
  |  |  100|  3.63M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 279k, False: 3.35M]
  |  |  ------------------
  ------------------
  |  Branch (814:16): [True: 155k, False: 3.47M]
  ------------------
  815|  3.47M|               (ABS(p1 - p0) >= beta))
  ------------------
  |  |  100|  3.47M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 237k, False: 3.23M]
  |  |  ------------------
  ------------------
  |  Branch (815:16): [True: 84.5k, False: 3.39M]
  ------------------
  816|   858k|                continue;
  817|       |
  818|  3.39M|            q2 = pu1_src_temp[pos_q2];
  819|  3.39M|            p2 = pu1_p2_temp[pos_p2];
  820|       |
  821|  3.39M|            a_p = ABS(p2 - p0);
  ------------------
  |  |  100|  3.39M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 284k, False: 3.10M]
  |  |  ------------------
  ------------------
  822|  3.39M|            a_q = ABS(q2 - q0);
  ------------------
  |  |  100|  3.39M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 212k, False: 3.17M]
  |  |  ------------------
  ------------------
  823|       |
  824|       |            /* tc */
  825|  3.39M|            tc = tc0 + (a_p < beta) + (a_q < beta);
  826|  3.39M|            val = ((((q0 - p0) << 2) + (p1 - q1) + 4) >> 3);
  827|  3.39M|            delta = CLIP3(-tc, tc, val);
  ------------------
  |  |   77|  3.39M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 24.7k, False: 3.36M]
  |  |  |  Branch (77:54): [True: 30.6k, False: 3.33M]
  |  |  ------------------
  ------------------
  828|       |            /* p0' */
  829|  3.39M|            val = p0 + delta;
  830|  3.39M|            pu1_p2_temp[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  3.39M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  3.39M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.18k, False: 3.38M]
  |  |  |  |  |  Branch (77:54): [True: 635, False: 3.38M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  831|       |            /* q0' */
  832|  3.39M|            val = q0 - delta;
  833|  3.39M|            pu1_src_temp[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  3.39M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  3.39M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 4.83k, False: 3.38M]
  |  |  |  |  |  Branch (77:54): [True: 780, False: 3.38M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  834|       |
  835|       |            /* Luma */
  836|  3.39M|            if(a_p < beta)
  ------------------
  |  Branch (836:16): [True: 3.32M, False: 66.0k]
  ------------------
  837|  3.32M|            {
  838|       |                /* p1' */
  839|  3.32M|                val = ((p2 + ((p0 + q0 + 1) >> 1) - (p1 << 1)) >> 1);
  840|  3.32M|                pu1_p2_temp[pos_p1] += CLIP3(-tc0, tc0, val);
  ------------------
  |  |   77|  3.32M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 49.6k, False: 3.27M]
  |  |  |  Branch (77:54): [True: 38.6k, False: 3.23M]
  |  |  ------------------
  ------------------
  841|  3.32M|            }
  842|       |
  843|  3.39M|            if(a_q < beta)
  ------------------
  |  Branch (843:16): [True: 3.32M, False: 64.6k]
  ------------------
  844|  3.32M|            {
  845|       |                /* q1' */
  846|  3.32M|                val = ((q2 + ((p0 + q0 + 1) >> 1) - (q1 << 1)) >> 1);
  847|  3.32M|                pu1_src_temp[pos_q1] += CLIP3(-tc0, tc0, val);
  ------------------
  |  |   77|  3.32M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 39.9k, False: 3.28M]
  |  |  |  Branch (77:54): [True: 38.0k, False: 3.24M]
  |  |  ------------------
  ------------------
  848|  3.32M|            }
  849|  3.39M|        }
  850|  1.06M|    }
  851|   295k|}
ih264_deblk_chroma_vert_bs4:
 1456|  43.0k|{
 1457|  43.0k|    UWORD8 *pu1_src_u = pu1_src; /* Pointer to the src sample q0 of U */
 1458|  43.0k|    UWORD8 *pu1_src_v = pu1_src + 1; /* Pointer to the src sample q0 of V */
 1459|  43.0k|    UWORD8 p1_u, p0_u, q0_u, q1_u, p1_v, p0_v, q0_v, q1_v;
 1460|  43.0k|    WORD32 blk_strd = src_strd << 1; /* block_increment = src_strd * 2*/
 1461|  43.0k|    WORD32 pos_p1, pos_p0, pos_q0, pos_q1;
 1462|  43.0k|    UWORD8 *pu1_src_temp_u, *pu1_src_temp_v;
 1463|  43.0k|    WORD8 i = 0, edge;
 1464|       |
 1465|  43.0k|    pos_q0 = 0;
 1466|  43.0k|    pos_q1 = 2;
 1467|  43.0k|    pos_p0 = -2;
 1468|  43.0k|    pos_p1 = -4;
 1469|       |
 1470|   215k|    for(edge = 0; edge < 4;
  ------------------
  |  Branch (1470:19): [True: 172k, False: 43.0k]
  ------------------
 1471|   172k|                    edge++, pu1_src_u += blk_strd, pu1_src_v += blk_strd)
 1472|   172k|    {
 1473|   172k|        pu1_src_temp_u = pu1_src_u;
 1474|   172k|        pu1_src_temp_v = pu1_src_v;
 1475|   516k|        for(i = 0; i < 2; ++i, pu1_src_temp_u += src_strd, pu1_src_temp_v +=
  ------------------
  |  Branch (1475:20): [True: 344k, False: 172k]
  ------------------
 1476|   344k|                        src_strd)
 1477|   344k|        {
 1478|   344k|            q0_u = pu1_src_temp_u[pos_q0];
 1479|   344k|            q1_u = pu1_src_temp_u[pos_q1];
 1480|   344k|            p0_u = pu1_src_temp_u[pos_p0];
 1481|   344k|            p1_u = pu1_src_temp_u[pos_p1];
 1482|   344k|            q0_v = pu1_src_temp_v[pos_q0];
 1483|   344k|            q1_v = pu1_src_temp_v[pos_q1];
 1484|   344k|            p0_v = pu1_src_temp_v[pos_p0];
 1485|   344k|            p1_v = pu1_src_temp_v[pos_p1];
 1486|       |
 1487|       |            /* Filter Decision */
 1488|   344k|            if((ABS(p0_u - q0_u) < alpha_cb) &&
  ------------------
  |  |  100|   344k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 43.0k, False: 301k]
  |  |  ------------------
  ------------------
  |  Branch (1488:16): [True: 246k, False: 97.9k]
  ------------------
 1489|   246k|               (ABS(q1_u - q0_u) < beta_cb) &&
  ------------------
  |  |  100|   246k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 5.63k, False: 240k]
  |  |  ------------------
  ------------------
  |  Branch (1489:16): [True: 240k, False: 5.71k]
  ------------------
 1490|   240k|               (ABS(p1_u - p0_u) < beta_cb))
  ------------------
  |  |  100|   240k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 8.18k, False: 232k]
  |  |  ------------------
  ------------------
  |  Branch (1490:16): [True: 237k, False: 2.88k]
  ------------------
 1491|   237k|            {
 1492|       |                /* p0' */
 1493|   237k|                pu1_src_temp_u[pos_p0] = ((X2(p1_u) + p0_u + q1_u + 2) >> 2);
  ------------------
  |  |   91|   237k|#define X2(a)   ((a) << 1)
  ------------------
 1494|       |                /* q0' */
 1495|   237k|                pu1_src_temp_u[pos_q0] = (X2(q1_u) + q0_u + p1_u + 2) >> 2;
  ------------------
  |  |   91|   237k|#define X2(a)   ((a) << 1)
  ------------------
 1496|   237k|            }
 1497|       |
 1498|       |            /* Filter Decision */
 1499|   344k|            if((ABS(p0_v - q0_v) < alpha_cr) &&
  ------------------
  |  |  100|   344k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 34.6k, False: 309k]
  |  |  ------------------
  ------------------
  |  Branch (1499:16): [True: 246k, False: 97.9k]
  ------------------
 1500|   246k|               (ABS(q1_v - q0_v) < beta_cr) &&
  ------------------
  |  |  100|   246k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 7.13k, False: 239k]
  |  |  ------------------
  ------------------
  |  Branch (1500:16): [True: 241k, False: 4.83k]
  ------------------
 1501|   241k|               (ABS(p1_v - p0_v) < beta_cr))
  ------------------
  |  |  100|   241k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 5.28k, False: 236k]
  |  |  ------------------
  ------------------
  |  Branch (1501:16): [True: 238k, False: 3.25k]
  ------------------
 1502|   238k|            {
 1503|       |                /* p0' */
 1504|   238k|                pu1_src_temp_v[pos_p0] = ((X2(p1_v) + p0_v + q1_v + 2) >> 2);
  ------------------
  |  |   91|   238k|#define X2(a)   ((a) << 1)
  ------------------
 1505|       |                /* q0' */
 1506|   238k|                pu1_src_temp_v[pos_q0] = (X2(q1_v) + q0_v + p1_v + 2) >> 2;
  ------------------
  |  |   91|   238k|#define X2(a)   ((a) << 1)
  ------------------
 1507|   238k|            }
 1508|   344k|        }
 1509|   172k|    }
 1510|  43.0k|}
ih264_deblk_chroma_horz_bs4:
 1552|  52.4k|{
 1553|  52.4k|    UWORD8 *pu1_src_u = pu1_src; /* Pointer to the src sample q0 of U */
 1554|  52.4k|    UWORD8 *pu1_src_v = pu1_src + 1; /* Pointer to the src sample q0 of V */
 1555|  52.4k|    UWORD8 p1_u, p0_u, q0_u, q1_u, p1_v, p0_v, q0_v, q1_v;
 1556|  52.4k|    WORD32 pos_p1, pos_p0, pos_q0, pos_q1;
 1557|  52.4k|    UWORD8 *pu1_src_temp_u, *pu1_src_temp_v;
 1558|  52.4k|    UWORD8 *pu1_p1_u; /* Pointer to the src sample p1 of U */
 1559|  52.4k|    UWORD8 *pu1_p1_v; /* Pointer to the src sample p1 of U */
 1560|  52.4k|    UWORD8 *pu1_p1_temp_u, *pu1_p1_temp_v;
 1561|  52.4k|    WORD8 i = 0, edge;
 1562|       |
 1563|  52.4k|    pu1_p1_u = pu1_src_u - (src_strd << 1);
 1564|  52.4k|    pu1_p1_v = pu1_src_v - (src_strd << 1);
 1565|  52.4k|    pos_q0 = 0;
 1566|  52.4k|    pos_q1 = src_strd;
 1567|  52.4k|    pos_p0 = src_strd;
 1568|  52.4k|    pos_p1 = 0;
 1569|       |
 1570|   262k|    for(edge = 0; edge < 4; edge++, pu1_src_u += 4, pu1_p1_u += 4, pu1_src_v +=
  ------------------
  |  Branch (1570:19): [True: 209k, False: 52.4k]
  ------------------
 1571|   209k|                    4, pu1_p1_v += 4)
 1572|   209k|    {
 1573|   209k|        pu1_src_temp_u = pu1_src_u;
 1574|   209k|        pu1_p1_temp_u = pu1_p1_u;
 1575|   209k|        pu1_src_temp_v = pu1_src_v;
 1576|   209k|        pu1_p1_temp_v = pu1_p1_v;
 1577|   629k|        for(i = 0; i < 2; ++i, pu1_src_temp_u += 2, pu1_p1_temp_u += 2,
  ------------------
  |  Branch (1577:20): [True: 419k, False: 209k]
  ------------------
 1578|   419k|                       pu1_src_temp_v += 2, pu1_p1_temp_v += 2)
 1579|   419k|        {
 1580|   419k|            q0_u = pu1_src_temp_u[pos_q0];
 1581|   419k|            q1_u = pu1_src_temp_u[pos_q1];
 1582|   419k|            p0_u = pu1_p1_temp_u[pos_p0];
 1583|   419k|            p1_u = pu1_p1_temp_u[pos_p1];
 1584|       |
 1585|   419k|            q0_v = pu1_src_temp_v[pos_q0];
 1586|   419k|            q1_v = pu1_src_temp_v[pos_q1];
 1587|   419k|            p0_v = pu1_p1_temp_v[pos_p0];
 1588|   419k|            p1_v = pu1_p1_temp_v[pos_p1];
 1589|       |
 1590|       |            /* Filter Decision */
 1591|   419k|            if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|   419k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 60.0k, False: 359k]
  |  |  ------------------
  ------------------
                          if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|   287k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 6.24k, False: 281k]
  |  |  ------------------
  ------------------
  |  Branch (1591:16): [True: 287k, False: 132k]
  |  Branch (1591:47): [True: 281k, False: 6.54k]
  ------------------
 1592|   281k|                            && ABS(p1_u - p0_u) < beta_cb)
  ------------------
  |  |  100|   281k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 7.97k, False: 273k]
  |  |  ------------------
  ------------------
  |  Branch (1592:32): [True: 277k, False: 3.14k]
  ------------------
 1593|   277k|            {
 1594|       |                /* p0' */
 1595|   277k|                pu1_p1_temp_u[pos_p0] = (X2(p1_u) + p0_u + q1_u + 2) >> 2;
  ------------------
  |  |   91|   277k|#define X2(a)   ((a) << 1)
  ------------------
 1596|       |                /* q0' */
 1597|   277k|                pu1_src_temp_u[pos_q0] = (X2(q1_u) + q0_u + p1_u + 2) >> 2;
  ------------------
  |  |   91|   277k|#define X2(a)   ((a) << 1)
  ------------------
 1598|   277k|            }
 1599|       |
 1600|       |            /* Filter Decision */
 1601|   419k|            if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|   419k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 59.3k, False: 360k]
  |  |  ------------------
  ------------------
                          if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|   287k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 7.51k, False: 279k]
  |  |  ------------------
  ------------------
  |  Branch (1601:16): [True: 287k, False: 132k]
  |  Branch (1601:47): [True: 280k, False: 7.33k]
  ------------------
 1602|   280k|                            && ABS(p1_v - p0_v) < beta_cr)
  ------------------
  |  |  100|   280k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 6.50k, False: 273k]
  |  |  ------------------
  ------------------
  |  Branch (1602:32): [True: 276k, False: 3.11k]
  ------------------
 1603|   276k|            {
 1604|       |                /* p0' */
 1605|   276k|                pu1_p1_temp_v[pos_p0] = (X2(p1_v) + p0_v + q1_v + 2) >> 2;
  ------------------
  |  |   91|   276k|#define X2(a)   ((a) << 1)
  ------------------
 1606|       |                /* q0' */
 1607|   276k|                pu1_src_temp_v[pos_q0] = (X2(q1_v) + q0_v + p1_v + 2) >> 2;
  ------------------
  |  |   91|   276k|#define X2(a)   ((a) << 1)
  ------------------
 1608|   276k|            }
 1609|   419k|        }
 1610|   209k|    }
 1611|  52.4k|}
ih264_deblk_chroma_vert_bslt4:
 1665|   164k|{
 1666|   164k|    UWORD8 *pu1_src_u = pu1_src; /* Pointer to the src sample q0 of plane U*/
 1667|   164k|    UWORD8 *pu1_src_v = pu1_src + 1; /* Pointer to the src sample q0 of plane V*/
 1668|   164k|    UWORD8 p1_u, p0_u, q0_u, q1_u, p1_v, p0_v, q0_v, q1_v;
 1669|   164k|    WORD32 blk_strd = src_strd << 1; /* block_increment = src_strd * 2 */
 1670|   164k|    WORD32 pos_p1, pos_p0, pos_q0, pos_q1;
 1671|   164k|    UWORD8 *pu1_src_temp_u, *pu1_src_temp_v;
 1672|   164k|    WORD8 i = 0, edge;
 1673|   164k|    WORD8 delta;
 1674|   164k|    WORD8 tcb, tcr;
 1675|   164k|    WORD16 val;
 1676|   164k|    UWORD8 tcb0, tcr0, u1_bs;
 1677|       |
 1678|   164k|    pos_q0 = 0;
 1679|   164k|    pos_q1 = 2;
 1680|   164k|    pos_p0 = -2;
 1681|   164k|    pos_p1 = -4;
 1682|       |
 1683|   823k|    for(edge = 0; edge < 4;
  ------------------
  |  Branch (1683:19): [True: 658k, False: 164k]
  ------------------
 1684|   658k|                    edge++, pu1_src_u += blk_strd, pu1_src_v += blk_strd)
 1685|   658k|    {
 1686|   658k|        pu1_src_temp_u = pu1_src_u;
 1687|   658k|        pu1_src_temp_v = pu1_src_v;
 1688|       |        /* Filter Decision */
 1689|   658k|        u1_bs = (UWORD8)((u4_bs >> ((3 - edge) << 3)) & 0x0ff);
 1690|   658k|        if(!u1_bs)
  ------------------
  |  Branch (1690:12): [True: 67.8k, False: 591k]
  ------------------
 1691|  67.8k|            continue;
 1692|       |        /* tc0 */
 1693|   591k|        tcb0 = pu1_cliptab_cb[u1_bs];
 1694|   591k|        tcr0 = pu1_cliptab_cr[u1_bs];
 1695|   591k|        tcb = tcb0 + 1;
 1696|   591k|        tcr = tcr0 + 1;
 1697|  1.77M|        for(i = 0; i < 2; ++i, pu1_src_temp_u += src_strd, pu1_src_temp_v +=
  ------------------
  |  Branch (1697:20): [True: 1.18M, False: 591k]
  ------------------
 1698|  1.18M|                        src_strd)
 1699|  1.18M|        {
 1700|  1.18M|            q0_u = pu1_src_temp_u[pos_q0];
 1701|  1.18M|            q1_u = pu1_src_temp_u[pos_q1];
 1702|  1.18M|            p0_u = pu1_src_temp_u[pos_p0];
 1703|  1.18M|            p1_u = pu1_src_temp_u[pos_p1];
 1704|       |
 1705|  1.18M|            q0_v = pu1_src_temp_v[pos_q0];
 1706|  1.18M|            q1_v = pu1_src_temp_v[pos_q1];
 1707|  1.18M|            p0_v = pu1_src_temp_v[pos_p0];
 1708|  1.18M|            p1_v = pu1_src_temp_v[pos_p1];
 1709|       |
 1710|       |            /* Filter Decision */
 1711|  1.18M|            if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|  1.18M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 95.6k, False: 1.08M]
  |  |  ------------------
  ------------------
                          if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|  1.04M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 25.9k, False: 1.01M]
  |  |  ------------------
  ------------------
  |  Branch (1711:16): [True: 1.04M, False: 139k]
  |  Branch (1711:47): [True: 1.02M, False: 17.1k]
  ------------------
 1712|  1.02M|                            && ABS(p1_u - p0_u) < beta_cb)
  ------------------
  |  |  100|  1.02M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 19.3k, False: 1.00M]
  |  |  ------------------
  ------------------
  |  Branch (1712:32): [True: 1.02M, False: 5.14k]
  ------------------
 1713|  1.02M|            {
 1714|  1.02M|                val = ((((q0_u - p0_u) << 2) + (p1_u - q1_u) + 4) >> 3);
 1715|  1.02M|                delta = CLIP3(-tcb, tcb, val);
  ------------------
  |  |   77|  1.02M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 9.23k, False: 1.01M]
  |  |  |  Branch (77:54): [True: 7.07k, False: 1.00M]
  |  |  ------------------
  ------------------
 1716|       |                /* p0' */
 1717|  1.02M|                val = p0_u + delta;
 1718|  1.02M|                pu1_src_temp_u[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.02M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.02M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 750, False: 1.01M]
  |  |  |  |  |  Branch (77:54): [True: 399, False: 1.01M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1719|       |                /* q0' */
 1720|  1.02M|                val = q0_u - delta;
 1721|  1.02M|                pu1_src_temp_u[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.02M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.02M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.01k, False: 1.01M]
  |  |  |  |  |  Branch (77:54): [True: 506, False: 1.01M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1722|  1.02M|            }
 1723|       |
 1724|       |            /* Filter Decision */
 1725|  1.18M|            if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|  1.18M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 78.5k, False: 1.10M]
  |  |  ------------------
  ------------------
                          if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|  1.04M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 22.4k, False: 1.02M]
  |  |  ------------------
  ------------------
  |  Branch (1725:16): [True: 1.04M, False: 135k]
  |  Branch (1725:47): [True: 1.03M, False: 14.6k]
  ------------------
 1726|  1.03M|                            && ABS(p1_v - p0_v) < beta_cr)
  ------------------
  |  |  100|  1.03M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 15.2k, False: 1.01M]
  |  |  ------------------
  ------------------
  |  Branch (1726:32): [True: 1.02M, False: 4.24k]
  ------------------
 1727|  1.02M|            {
 1728|  1.02M|                val = ((((q0_v - p0_v) << 2) + (p1_v - q1_v) + 4) >> 3);
 1729|  1.02M|                delta = CLIP3(-tcr, tcr, val);
  ------------------
  |  |   77|  1.02M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 5.39k, False: 1.02M]
  |  |  |  Branch (77:54): [True: 3.33k, False: 1.01M]
  |  |  ------------------
  ------------------
 1730|       |                /* p0' */
 1731|  1.02M|                val = p0_v + delta;
 1732|  1.02M|                pu1_src_temp_v[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.02M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.02M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 246, False: 1.02M]
  |  |  |  |  |  Branch (77:54): [True: 765, False: 1.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1733|       |                /* q0' */
 1734|  1.02M|                val = q0_v - delta;
 1735|  1.02M|                pu1_src_temp_v[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.02M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.02M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 756, False: 1.02M]
  |  |  |  |  |  Branch (77:54): [True: 494, False: 1.02M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1736|  1.02M|            }
 1737|  1.18M|        }
 1738|   591k|    }
 1739|   164k|}
ih264_deblk_chroma_horz_bslt4:
 1793|   175k|{
 1794|   175k|    UWORD8 *pu1_src_u = pu1_src; /* Pointer to the src sample q0 of plane U*/
 1795|   175k|    UWORD8 *pu1_src_v = pu1_src + 1; /* Pointer to the src sample q0 of plane V*/
 1796|   175k|    UWORD8 p1_u, p0_u, q0_u, q1_u, p1_v, p0_v, q0_v, q1_v;
 1797|   175k|    WORD32 pos_p1, pos_p0, pos_q0, pos_q1;
 1798|   175k|    UWORD8 *pu1_src_temp_u, *pu1_src_temp_v;
 1799|   175k|    UWORD8 *pu1_p1_u; /* Pointer to the src sample p1 of plane U*/
 1800|   175k|    UWORD8 *pu1_p1_v; /* Pointer to the src sample p1 of plane V*/
 1801|   175k|    UWORD8 *pu1_p1_temp_u, *pu1_p1_temp_v;
 1802|   175k|    WORD8 i = 0, edge;
 1803|   175k|    WORD8 delta;
 1804|   175k|    WORD8 tcb, tcr;
 1805|   175k|    WORD16 val;
 1806|   175k|    UWORD8 u1_bs;
 1807|   175k|    UWORD8 tcb0, tcr0;
 1808|       |
 1809|   175k|    pu1_p1_u = pu1_src_u - (src_strd << 1);
 1810|   175k|    pu1_p1_v = pu1_src_v - (src_strd << 1);
 1811|   175k|    pos_q0 = 0;
 1812|   175k|    pos_q1 = src_strd;
 1813|   175k|    pos_p0 = src_strd;
 1814|   175k|    pos_p1 = 0;
 1815|       |
 1816|   877k|    for(edge = 0; edge < 4; edge++, pu1_src_u += 4, pu1_p1_u += 4,
  ------------------
  |  Branch (1816:19): [True: 702k, False: 175k]
  ------------------
 1817|   702k|                    pu1_src_v += 4, pu1_p1_v += 4)
 1818|   702k|    {
 1819|   702k|        pu1_src_temp_u = pu1_src_u;
 1820|   702k|        pu1_p1_temp_u = pu1_p1_u;
 1821|   702k|        pu1_src_temp_v = pu1_src_v;
 1822|   702k|        pu1_p1_temp_v = pu1_p1_v;
 1823|       |
 1824|       |        /* Filter Decision */
 1825|   702k|        u1_bs = (UWORD8)((u4_bs >> ((3 - edge) << 3)) & 0x0ff);
 1826|   702k|        if(!u1_bs)
  ------------------
  |  Branch (1826:12): [True: 69.6k, False: 632k]
  ------------------
 1827|  69.6k|            continue;
 1828|       |        /* tc0 */
 1829|   632k|        tcb0 = pu1_cliptab_cb[u1_bs];
 1830|   632k|        tcr0 = pu1_cliptab_cr[u1_bs];
 1831|       |
 1832|  1.89M|        for(i = 0; i < 2; ++i, pu1_src_temp_u += 2, pu1_p1_temp_u += 2,
  ------------------
  |  Branch (1832:20): [True: 1.26M, False: 632k]
  ------------------
 1833|  1.26M|                       pu1_src_temp_v += 2, pu1_p1_temp_v += 2)
 1834|  1.26M|        {
 1835|  1.26M|            q0_u = pu1_src_temp_u[pos_q0];
 1836|  1.26M|            q1_u = pu1_src_temp_u[pos_q1];
 1837|  1.26M|            p0_u = pu1_p1_temp_u[pos_p0];
 1838|  1.26M|            p1_u = pu1_p1_temp_u[pos_p1];
 1839|       |
 1840|  1.26M|            q0_v = pu1_src_temp_v[pos_q0];
 1841|  1.26M|            q1_v = pu1_src_temp_v[pos_q1];
 1842|  1.26M|            p0_v = pu1_p1_temp_v[pos_p0];
 1843|  1.26M|            p1_v = pu1_p1_temp_v[pos_p1];
 1844|       |
 1845|       |            /* tc */
 1846|  1.26M|            tcb = tcb0 + 1;
 1847|  1.26M|            tcr = tcr0 + 1;
 1848|       |            /* Filter Decision */
 1849|  1.26M|            if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|  1.26M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 102k, False: 1.16M]
  |  |  ------------------
  ------------------
                          if(ABS(p0_u - q0_u) < alpha_cb && ABS(q1_u - q0_u) < beta_cb
  ------------------
  |  |  100|  1.11M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 32.1k, False: 1.08M]
  |  |  ------------------
  ------------------
  |  Branch (1849:16): [True: 1.11M, False: 145k]
  |  Branch (1849:47): [True: 1.10M, False: 17.7k]
  ------------------
 1850|  1.10M|                            && ABS(p1_u - p0_u) < beta_cb)
  ------------------
  |  |  100|  1.10M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 21.5k, False: 1.07M]
  |  |  ------------------
  ------------------
  |  Branch (1850:32): [True: 1.09M, False: 4.56k]
  ------------------
 1851|  1.09M|            {
 1852|  1.09M|                val = ((((q0_u - p0_u) << 2) + (p1_u - q1_u) + 4) >> 3);
 1853|  1.09M|                delta = CLIP3(-tcb, tcb, val);
  ------------------
  |  |   77|  1.09M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 9.85k, False: 1.08M]
  |  |  |  Branch (77:54): [True: 6.39k, False: 1.08M]
  |  |  ------------------
  ------------------
 1854|       |                /* p0' */
 1855|  1.09M|                val = p0_u + delta;
 1856|  1.09M|                pu1_p1_temp_u[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.09M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.09M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 436, False: 1.09M]
  |  |  |  |  |  Branch (77:54): [True: 416, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1857|       |                /* q0' */
 1858|  1.09M|                val = q0_u - delta;
 1859|  1.09M|                pu1_src_temp_u[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.09M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.09M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 329, False: 1.09M]
  |  |  |  |  |  Branch (77:54): [True: 797, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1860|  1.09M|            }
 1861|       |            /* Filter Decision */
 1862|  1.26M|            if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|  1.26M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 100k, False: 1.16M]
  |  |  ------------------
  ------------------
                          if(ABS(p0_v - q0_v) < alpha_cr && ABS(q1_v - q0_v) < beta_cr
  ------------------
  |  |  100|  1.12M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 28.7k, False: 1.09M]
  |  |  ------------------
  ------------------
  |  Branch (1862:16): [True: 1.12M, False: 142k]
  |  Branch (1862:47): [True: 1.10M, False: 13.7k]
  ------------------
 1863|  1.10M|                            && ABS(p1_v - p0_v) < beta_cr)
  ------------------
  |  |  100|  1.10M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 15.2k, False: 1.09M]
  |  |  ------------------
  ------------------
  |  Branch (1863:32): [True: 1.10M, False: 4.20k]
  ------------------
 1864|  1.10M|            {
 1865|  1.10M|                val = ((((q0_v - p0_v) << 2) + (p1_v - q1_v) + 4) >> 3);
 1866|  1.10M|                delta = CLIP3(-tcr, tcr, val);
  ------------------
  |  |   77|  1.10M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 5.44k, False: 1.09M]
  |  |  |  Branch (77:54): [True: 4.92k, False: 1.09M]
  |  |  ------------------
  ------------------
 1867|       |                /* p0' */
 1868|  1.10M|                val = p0_v + delta;
 1869|  1.10M|                pu1_p1_temp_v[pos_p0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.10M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.10M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 328, False: 1.10M]
  |  |  |  |  |  Branch (77:54): [True: 950, False: 1.10M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1870|       |                /* q0' */
 1871|  1.10M|                val = q0_v - delta;
 1872|  1.10M|                pu1_src_temp_v[pos_q0] = CLIP_U8(val);
  ------------------
  |  |   58|  1.10M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.10M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 356, False: 1.10M]
  |  |  |  |  |  Branch (77:54): [True: 767, False: 1.10M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1873|  1.10M|            }
 1874|  1.26M|        }
 1875|   632k|    }
 1876|   175k|}

ih264_disp_mgr_init:
   77|  23.6k|{
   78|  23.6k|    WORD32 id;
   79|       |
   80|  23.6k|    ps_disp_mgr->u4_last_abs_poc = DEFAULT_POC;
  ------------------
  |  |   45|  23.6k|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
   81|       |
   82|  1.53M|    for(id = 0; id < DISP_MGR_MAX_CNT; id++)
  ------------------
  |  |   44|  1.53M|#define DISP_MGR_MAX_CNT 64
  ------------------
  |  Branch (82:17): [True: 1.51M, False: 23.6k]
  ------------------
   83|  1.51M|    {
   84|  1.51M|        ps_disp_mgr->ai4_abs_poc[id] = DEFAULT_POC;
  ------------------
  |  |   45|  1.51M|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
   85|       |        ps_disp_mgr->apv_ptr[id] = NULL;
   86|  1.51M|    }
   87|  23.6k|}
ih264_disp_mgr_add:
  120|  97.3k|{
  121|  97.3k|    if(buf_id >= DISP_MGR_MAX_CNT)
  ------------------
  |  |   44|  97.3k|#define DISP_MGR_MAX_CNT 64
  ------------------
  |  Branch (121:8): [True: 0, False: 97.3k]
  ------------------
  122|      0|    {
  123|      0|        return (-1);
  124|      0|    }
  125|       |
  126|  97.3k|    if(ps_disp_mgr->apv_ptr[buf_id] != NULL)
  ------------------
  |  Branch (126:8): [True: 538, False: 96.8k]
  ------------------
  127|    538|    {
  128|    538|        return (-1);
  129|    538|    }
  130|       |
  131|  96.8k|    ps_disp_mgr->apv_ptr[buf_id] = pv_ptr;
  132|  96.8k|    ps_disp_mgr->ai4_abs_poc[buf_id] = abs_poc;
  133|       |
  134|  96.8k|    return 0;
  135|  97.3k|}
ih264_disp_mgr_get:
  159|   188k|{
  160|   188k|    WORD32 id;
  161|   188k|    void *pv_ret_ptr = NULL;
  162|   188k|    WORD32 i4_min_poc = 0x7FFFFFFF;
  163|   188k|    WORD32 min_poc_id = -1;
  164|       |
  165|       |    /* Find minimum POC */
  166|  12.2M|    for(id = 0; id < DISP_MGR_MAX_CNT; id++)
  ------------------
  |  |   44|  12.2M|#define DISP_MGR_MAX_CNT 64
  ------------------
  |  Branch (166:17): [True: 12.0M, False: 188k]
  ------------------
  167|  12.0M|    {
  168|  12.0M|        if((DEFAULT_POC != ps_disp_mgr->ai4_abs_poc[id]) &&
  ------------------
  |  |   45|  12.0M|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
  |  Branch (168:12): [True: 110k, False: 11.9M]
  ------------------
  169|   110k|           (ps_disp_mgr->ai4_abs_poc[id] <= i4_min_poc))
  ------------------
  |  Branch (169:12): [True: 94.8k, False: 15.1k]
  ------------------
  170|  94.8k|        {
  171|  94.8k|            i4_min_poc = ps_disp_mgr->ai4_abs_poc[id];
  172|  94.8k|            min_poc_id = id;
  173|  94.8k|        }
  174|  12.0M|    }
  175|   188k|    *pi4_buf_id = min_poc_id;
  176|       |    /* If all pocs are still default_poc then return NULL */
  177|   188k|    if(-1 == min_poc_id)
  ------------------
  |  Branch (177:8): [True: 100k, False: 88.0k]
  ------------------
  178|   100k|    {
  179|   100k|        return NULL;
  180|   100k|    }
  181|       |
  182|  88.0k|    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|  88.0k|    ps_disp_mgr->apv_ptr[min_poc_id] = NULL;
  186|  88.0k|    ps_disp_mgr->ai4_abs_poc[min_poc_id] = DEFAULT_POC;
  ------------------
  |  |   45|  88.0k|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
  187|       |
  188|  88.0k|    return pv_ret_ptr;
  189|   188k|}

ih264_ihadamard_scaling_4x4:
  102|  27.5k|{
  103|  27.5k|    WORD32 i;
  104|  27.5k|    WORD32 x0, x1, x2, x3, x4, x5, x6, x7;
  105|  27.5k|    WORD16 *pi2_src_ptr, *pi2_out_ptr;
  106|  27.5k|    WORD32 *pi4_tmp_ptr;
  107|  27.5k|    WORD32 rnd_fact = (u4_qp_div_6 < 6) ? (1 << (5 - u4_qp_div_6)) : 0;
  ------------------
  |  Branch (107:23): [True: 12.4k, False: 15.0k]
  ------------------
  108|       |
  109|  27.5k|    pi4_tmp_ptr = pi4_tmp;
  110|  27.5k|    pi2_src_ptr = pi2_src;
  111|  27.5k|    pi2_out_ptr = pi2_out;
  112|       |
  113|       |    /* horizontal transform */
  114|   137k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   137k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (114:16): [True: 110k, False: 27.5k]
  ------------------
  115|   110k|    {
  116|   110k|        x4 = pi2_src_ptr[0];
  117|   110k|        x5 = pi2_src_ptr[1];
  118|   110k|        x6 = pi2_src_ptr[2];
  119|   110k|        x7 = pi2_src_ptr[3];
  120|       |
  121|   110k|        x0 = x4 + x7;
  122|   110k|        x1 = x5 + x6;
  123|   110k|        x2 = x5 - x6;
  124|   110k|        x3 = x4 - x7;
  125|       |
  126|   110k|        pi4_tmp_ptr[0] = x0 + x1;
  127|   110k|        pi4_tmp_ptr[1] = x2 + x3;
  128|   110k|        pi4_tmp_ptr[2] = x0 - x1;
  129|   110k|        pi4_tmp_ptr[3] = x3 - x2;
  130|       |
  131|   110k|        pi4_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   110k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  132|   110k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   110k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  133|   110k|    }
  134|       |
  135|       |    /* vertical transform */
  136|  27.5k|    pi4_tmp_ptr = pi4_tmp;
  137|   137k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   137k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (137:16): [True: 110k, False: 27.5k]
  ------------------
  138|   110k|    {
  139|   110k|        x4 = pi4_tmp_ptr[0];
  140|   110k|        x5 = pi4_tmp_ptr[4];
  141|   110k|        x6 = pi4_tmp_ptr[8];
  142|   110k|        x7 = pi4_tmp_ptr[12];
  143|       |
  144|   110k|        x0 = x4 + x7;
  145|   110k|        x1 = x5 + x6;
  146|   110k|        x2 = x5 - x6;
  147|   110k|        x3 = x4 - x7;
  148|       |
  149|   110k|        pi4_tmp_ptr[0] = x0 + x1;
  150|   110k|        pi4_tmp_ptr[4] = x2 + x3;
  151|   110k|        pi4_tmp_ptr[8] = x0 - x1;
  152|   110k|        pi4_tmp_ptr[12] = x3 - x2;
  153|       |
  154|   110k|        pi4_tmp_ptr++;
  155|   110k|    }
  156|  27.5k|    pi4_tmp_ptr = pi4_tmp;
  157|       |
  158|       |    /* scaling */
  159|   467k|    for(i = 0; i < (SUB_BLK_WIDTH_4x4 * SUB_BLK_WIDTH_4x4); i++)
  ------------------
  |  |   48|   467k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
                  for(i = 0; i < (SUB_BLK_WIDTH_4x4 * SUB_BLK_WIDTH_4x4); i++)
  ------------------
  |  |   48|   467k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (159:16): [True: 440k, False: 27.5k]
  ------------------
  160|   440k|    {
  161|   440k|        INV_QUANT(pi4_tmp_ptr[i], pu2_iscal_mat[0], pu2_weigh_mat[0],
  ------------------
  |  |  103|   440k|                {\
  |  |  104|   440k|                    i4_value *= quant_scale;\
  |  |  105|   440k|                    i4_value *= weight_scale;\
  |  |  106|   440k|                    i4_value += rndfactor;\
  |  |  107|   440k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   440k|                    i4_value >>= qbits;\
  |  |  109|   440k|                }
  ------------------
  162|   440k|                  u4_qp_div_6, rnd_fact, 6);
  163|   440k|        pi2_out_ptr[i] = pi4_tmp_ptr[i];
  164|   440k|    }
  165|  27.5k|}

ih264_inter_pred_luma_copy:
  129|  2.70M|{
  130|  2.70M|    WORD32 row, col;
  131|       |
  132|  2.70M|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  2.70M|#define UNUSED(x) ((void)(x))
  ------------------
  133|  2.70M|    UNUSED(dydx);
  ------------------
  |  |   45|  2.70M|#define UNUSED(x) ((void)(x))
  ------------------
  134|  45.5M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (134:18): [True: 42.8M, False: 2.70M]
  ------------------
  135|  42.8M|    {
  136|   723M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (136:22): [True: 681M, False: 42.8M]
  ------------------
  137|   681M|        {
  138|   681M|            pu1_dst[col] = pu1_src[col];
  139|   681M|        }
  140|       |
  141|  42.8M|        pu1_src += src_strd;
  142|  42.8M|        pu1_dst += dst_strd;
  143|  42.8M|    }
  144|  2.70M|}
ih264_inter_pred_luma_horz:
  251|  43.7k|{
  252|  43.7k|    WORD32 row, col;
  253|  43.7k|    WORD16 i2_tmp;
  254|       |
  255|  43.7k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  43.7k|#define UNUSED(x) ((void)(x))
  ------------------
  256|  43.7k|    UNUSED(dydx);
  ------------------
  |  |   45|  43.7k|#define UNUSED(x) ((void)(x))
  ------------------
  257|   636k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (257:18): [True: 593k, False: 43.7k]
  ------------------
  258|   593k|    {
  259|  9.21M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (259:22): [True: 8.62M, False: 593k]
  ------------------
  260|  8.62M|        {
  261|  8.62M|            i2_tmp = ih264_g_six_tap[0] * (pu1_src[col - 2] + pu1_src[col + 3])
  262|  8.62M|                     + ih264_g_six_tap[1] * (pu1_src[col - 1] + pu1_src[col + 2])
  263|  8.62M|                     + ih264_g_six_tap[2] * (pu1_src[col] + pu1_src[col + 1]);
  264|  8.62M|            i2_tmp = (i2_tmp + 16) >> 5;
  265|  8.62M|            pu1_dst[col] = CLIP_U8(i2_tmp);
  ------------------
  |  |   58|  8.62M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  8.62M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.31k, False: 8.61M]
  |  |  |  |  |  Branch (77:54): [True: 134k, False: 8.48M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  266|  8.62M|        }
  267|   593k|        pu1_src += src_strd;
  268|   593k|        pu1_dst += dst_strd;
  269|   593k|    }
  270|  43.7k|}
ih264_inter_pred_luma_vert:
  321|  20.0k|{
  322|  20.0k|    WORD32 row, col;
  323|  20.0k|    WORD16 i2_tmp;
  324|       |
  325|  20.0k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  20.0k|#define UNUSED(x) ((void)(x))
  ------------------
  326|  20.0k|    UNUSED(dydx);
  ------------------
  |  |   45|  20.0k|#define UNUSED(x) ((void)(x))
  ------------------
  327|   303k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (327:18): [True: 283k, False: 20.0k]
  ------------------
  328|   283k|    {
  329|  4.26M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (329:22): [True: 3.98M, False: 283k]
  ------------------
  330|  3.98M|        {
  331|  3.98M|            i2_tmp = ih264_g_six_tap[0] * (pu1_src[col - 2 * src_strd] + pu1_src[col + 3 * src_strd])
  332|  3.98M|                     + ih264_g_six_tap[1] * (pu1_src[col - 1 * src_strd] + pu1_src[col + 2 * src_strd])
  333|  3.98M|                     + ih264_g_six_tap[2] * (pu1_src[col] + pu1_src[col + 1 * src_strd]);
  334|  3.98M|            i2_tmp = (i2_tmp + 16) >> 5;
  335|  3.98M|            pu1_dst[col] = CLIP_U8(i2_tmp);
  ------------------
  |  |   58|  3.98M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  3.98M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 4.80k, False: 3.97M]
  |  |  |  |  |  Branch (77:54): [True: 68.8k, False: 3.90M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  336|  3.98M|        }
  337|   283k|        pu1_src += src_strd;
  338|   283k|        pu1_dst += dst_strd;
  339|   283k|    }
  340|  20.0k|}
ih264_inter_pred_luma_horz_hpel_vert_hpel:
  400|  20.6k|{
  401|  20.6k|    WORD32 row, col;
  402|  20.6k|    WORD32 tmp;
  403|  20.6k|    WORD16 *pi2_pred1_temp;
  404|  20.6k|    WORD16 *pi2_pred1;
  405|       |
  406|  20.6k|    UNUSED(dydx);
  ------------------
  |  |   45|  20.6k|#define UNUSED(x) ((void)(x))
  ------------------
  407|  20.6k|    pi2_pred1_temp = (WORD16*)pu1_tmp;
  408|  20.6k|    pi2_pred1_temp += 2;
  409|  20.6k|    pi2_pred1 = pi2_pred1_temp;
  410|       |
  411|   246k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (411:18): [True: 225k, False: 20.6k]
  ------------------
  412|   225k|    {
  413|  4.13M|        for(col = -2; col < wd + 3; col++)
  ------------------
  |  Branch (413:23): [True: 3.90M, False: 225k]
  ------------------
  414|  3.90M|        {
  415|  3.90M|            tmp = ih264_g_six_tap[0] * (pu1_src[col - 2 * src_strd] + pu1_src[col + 3 * src_strd])
  416|  3.90M|                  + ih264_g_six_tap[1] * (pu1_src[col - 1 * src_strd] + pu1_src[col + 2 * src_strd])
  417|  3.90M|                  + ih264_g_six_tap[2] * (pu1_src[col] + pu1_src[col + 1 * src_strd]);
  418|  3.90M|            pi2_pred1_temp[col] = tmp;
  419|  3.90M|        }
  420|   225k|        pu1_src += src_strd;
  421|   225k|        pi2_pred1_temp = pi2_pred1_temp + wd + 5;
  422|   225k|    }
  423|       |
  424|   246k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (424:18): [True: 225k, False: 20.6k]
  ------------------
  425|   225k|    {
  426|  3.00M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (426:22): [True: 2.77M, False: 225k]
  ------------------
  427|  2.77M|        {
  428|  2.77M|            tmp = ih264_g_six_tap[0] * (pi2_pred1[col - 2] + pi2_pred1[col + 3])
  429|  2.77M|                  + ih264_g_six_tap[1] * (pi2_pred1[col - 1] + pi2_pred1[col + 2])
  430|  2.77M|                  + ih264_g_six_tap[2] * (pi2_pred1[col] + pi2_pred1[col + 1]);
  431|  2.77M|            tmp = (tmp + 512) >> 10;
  432|  2.77M|            pu1_dst[col] = CLIP_U8(tmp);
  ------------------
  |  |   58|  2.77M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  2.77M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 13.0k, False: 2.76M]
  |  |  |  |  |  Branch (77:54): [True: 2.42k, False: 2.76M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  433|  2.77M|        }
  434|   225k|        pi2_pred1 += (wd + 5);
  435|   225k|        pu1_dst += dst_strd;
  436|   225k|    }
  437|  20.6k|}
ih264_inter_pred_luma_horz_qpel:
  496|  55.4k|{
  497|  55.4k|    WORD32 row, col;
  498|  55.4k|    UWORD8 *pu1_pred1;
  499|  55.4k|    WORD32 x_offset = dydx & 0x3;
  500|  55.4k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  55.4k|#define UNUSED(x) ((void)(x))
  ------------------
  501|  55.4k|    pu1_pred1 = pu1_src + (x_offset >> 1);
  502|       |
  503|   752k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (503:18): [True: 696k, False: 55.4k]
  ------------------
  504|   696k|    {
  505|  10.2M|        for(col = 0; col < wd; col++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (505:22): [True: 9.56M, False: 696k]
  ------------------
  506|  9.56M|        {
  507|  9.56M|            WORD16 i2_temp;
  508|       |            /* The logic below implements the following equation
  509|       |             i2_temp = puc_pred[-2] - 5 * (puc_pred[-1] + puc_pred[2]) +
  510|       |             20 * (puc_pred[0] + puc_pred[1]) + puc_pred[3]; */
  511|  9.56M|            i2_temp = pu1_src[-2] + pu1_src[3]
  512|  9.56M|                      - (pu1_src[-1] + pu1_src[2])
  513|  9.56M|                      + ((pu1_src[0] + pu1_src[1] - pu1_src[-1] - pu1_src[2]) << 2)
  514|  9.56M|                      + ((pu1_src[0] + pu1_src[1]) << 4);
  515|  9.56M|            i2_temp = (i2_temp + 16) >> 5;
  516|  9.56M|            i2_temp = CLIP_U8(i2_temp);
  ------------------
  |  |   58|  9.56M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  9.56M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 15.4k, False: 9.55M]
  |  |  |  |  |  Branch (77:54): [True: 1.07k, False: 9.55M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  517|  9.56M|            *pu1_dst = (i2_temp + *pu1_pred1 + 1) >> 1;
  518|       |
  519|  9.56M|            pu1_pred1++;
  520|  9.56M|        }
  521|   696k|        pu1_dst += dst_strd - wd;
  522|   696k|        pu1_src += src_strd - wd;
  523|   696k|        pu1_pred1 += src_strd - wd;
  524|   696k|    }
  525|  55.4k|}
ih264_inter_pred_luma_vert_qpel:
  584|  60.0k|{
  585|  60.0k|    WORD32 row, col;
  586|  60.0k|    WORD32 y_offset = dydx >> 2;
  587|  60.0k|    WORD32 off1, off2, off3;
  588|  60.0k|    UWORD8 *pu1_pred1;
  589|  60.0k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  60.0k|#define UNUSED(x) ((void)(x))
  ------------------
  590|  60.0k|    y_offset = y_offset & 0x3;
  591|       |
  592|  60.0k|    off1 = src_strd;
  593|  60.0k|    off2 = src_strd << 1;
  594|  60.0k|    off3 = off1 + off2;
  595|       |
  596|  60.0k|    pu1_pred1 = pu1_src + (y_offset >> 1) * src_strd;
  597|       |
  598|   893k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (598:18): [True: 833k, False: 60.0k]
  ------------------
  599|   833k|    {
  600|  12.6M|        for(col = 0; col < wd; col++, pu1_dst++, pu1_src++, pu1_pred1++)
  ------------------
  |  Branch (600:22): [True: 11.7M, False: 833k]
  ------------------
  601|  11.7M|        {
  602|  11.7M|            WORD16 i2_temp;
  603|       |            /* The logic below implements the following equation
  604|       |             i16_temp = puc_pred[-2*src_strd] + puc_pred[3*src_strd] -
  605|       |             5 * (puc_pred[-1*src_strd] + puc_pred[2*src_strd])  +
  606|       |             20 * (puc_pred[0] + puc_pred[src_strd]); */
  607|  11.7M|            i2_temp = pu1_src[-off2] + pu1_src[off3]
  608|  11.7M|                       - (pu1_src[-off1] + pu1_src[off2])
  609|  11.7M|                       + ((pu1_src[0] + pu1_src[off1] - pu1_src[-off1] - pu1_src[off2]) << 2)
  610|  11.7M|                       + ((pu1_src[0] + pu1_src[off1]) << 4);
  611|  11.7M|            i2_temp = (i2_temp + 16) >> 5;
  612|  11.7M|            i2_temp = CLIP_U8(i2_temp);
  ------------------
  |  |   58|  11.7M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  11.7M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 11.9k, False: 11.7M]
  |  |  |  |  |  Branch (77:54): [True: 7.66k, False: 11.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  613|       |
  614|  11.7M|            *pu1_dst = (i2_temp + *pu1_pred1 + 1) >> 1;
  615|  11.7M|        }
  616|   833k|        pu1_src += src_strd - wd;
  617|   833k|        pu1_pred1 += src_strd - wd;
  618|   833k|        pu1_dst += dst_strd - wd;
  619|   833k|    }
  620|  60.0k|}
ih264_inter_pred_luma_horz_qpel_vert_qpel:
  679|  75.6k|{
  680|  75.6k|    WORD32 row, col;
  681|  75.6k|    WORD32 x_offset = dydx & 0x3;
  682|  75.6k|    WORD32 y_offset = dydx >> 2;
  683|       |
  684|  75.6k|    WORD32 off1, off2, off3;
  685|  75.6k|    UWORD8* pu1_pred_vert, *pu1_pred_horz;
  686|  75.6k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  75.6k|#define UNUSED(x) ((void)(x))
  ------------------
  687|  75.6k|    y_offset = y_offset & 0x3;
  688|       |
  689|  75.6k|    off1 = src_strd;
  690|  75.6k|    off2 = src_strd << 1;
  691|  75.6k|    off3 = off1 + off2;
  692|       |
  693|  75.6k|    pu1_pred_horz = pu1_src + (y_offset >> 1) * src_strd;
  694|  75.6k|    pu1_pred_vert = pu1_src + (x_offset >> 1);
  695|       |
  696|  1.10M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (696:18): [True: 1.03M, False: 75.6k]
  ------------------
  697|  1.03M|    {
  698|  15.3M|        for(col = 0; col < wd;
  ------------------
  |  Branch (698:22): [True: 14.3M, False: 1.03M]
  ------------------
  699|  14.3M|                        col++, pu1_dst++, pu1_pred_vert++, pu1_pred_horz++)
  700|  14.3M|        {
  701|  14.3M|            WORD16 i2_temp_vert, i2_temp_horz;
  702|       |            /* The logic below implements the following equation
  703|       |             i2_temp = puc_pred[-2*src_strd] + puc_pred[3*src_strd] -
  704|       |             5 * (puc_pred[-1*src_strd] + puc_pred[2*src_strd])  +
  705|       |             20 * (puc_pred[0] + puc_pred[src_strd]); */
  706|  14.3M|            i2_temp_vert = pu1_pred_vert[-off2] + pu1_pred_vert[off3]
  707|  14.3M|                            - (pu1_pred_vert[-off1] + pu1_pred_vert[off2])
  708|  14.3M|                            + ((pu1_pred_vert[0] + pu1_pred_vert[off1]
  709|  14.3M|                                            - pu1_pred_vert[-off1]
  710|  14.3M|                                            - pu1_pred_vert[off2]) << 2)
  711|  14.3M|                            + ((pu1_pred_vert[0] + pu1_pred_vert[off1]) << 4);
  712|  14.3M|            i2_temp_vert = (i2_temp_vert + 16) >> 5;
  713|  14.3M|            i2_temp_vert = CLIP_U8(i2_temp_vert);
  ------------------
  |  |   58|  14.3M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  14.3M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 20.0k, False: 14.2M]
  |  |  |  |  |  Branch (77:54): [True: 376k, False: 13.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  714|       |
  715|       |            /* The logic below implements the following equation
  716|       |             i16_temp = puc_pred[-2] - 5 * (puc_pred[-1] + puc_pred[2]) +
  717|       |             20 * (puc_pred[0] + puc_pred[1]) + puc_pred[3]; */
  718|  14.3M|            i2_temp_horz = pu1_pred_horz[-2] + pu1_pred_horz[3]
  719|  14.3M|                            - (pu1_pred_horz[-1] + pu1_pred_horz[2])
  720|  14.3M|                            + ((pu1_pred_horz[0] + pu1_pred_horz[1]
  721|  14.3M|                                            - pu1_pred_horz[-1]
  722|  14.3M|                                            - pu1_pred_horz[2]) << 2)
  723|  14.3M|                            + ((pu1_pred_horz[0] + pu1_pred_horz[1]) << 4);
  724|  14.3M|            i2_temp_horz = (i2_temp_horz + 16) >> 5;
  725|  14.3M|            i2_temp_horz = CLIP_U8(i2_temp_horz);
  ------------------
  |  |   58|  14.3M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  14.3M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 8.50k, False: 14.3M]
  |  |  |  |  |  Branch (77:54): [True: 39.0k, False: 14.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  726|  14.3M|            *pu1_dst = (i2_temp_vert + i2_temp_horz + 1) >> 1;
  727|  14.3M|        }
  728|  1.03M|        pu1_pred_vert += (src_strd - wd);
  729|  1.03M|        pu1_pred_horz += (src_strd - wd);
  730|  1.03M|        pu1_dst += (dst_strd - wd);
  731|  1.03M|    }
  732|  75.6k|}
ih264_inter_pred_luma_horz_qpel_vert_hpel:
  792|  30.5k|{
  793|  30.5k|    WORD32 row, col;
  794|  30.5k|    WORD32 tmp;
  795|  30.5k|    WORD16* pi2_pred1_temp, *pi2_pred1;
  796|  30.5k|    UWORD8* pu1_dst_tmp;
  797|  30.5k|    WORD32 x_offset = dydx & 0x3;
  798|  30.5k|    WORD16 i2_macro;
  799|       |
  800|  30.5k|    pi2_pred1_temp = (WORD16*)pu1_tmp;
  801|  30.5k|    pi2_pred1_temp += 2;
  802|  30.5k|    pi2_pred1 = pi2_pred1_temp;
  803|  30.5k|    pu1_dst_tmp = pu1_dst;
  804|       |
  805|   467k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (805:18): [True: 436k, False: 30.5k]
  ------------------
  806|   436k|    {
  807|  8.94M|        for(col = -2; col < wd + 3; col++)
  ------------------
  |  Branch (807:23): [True: 8.51M, False: 436k]
  ------------------
  808|  8.51M|        {
  809|  8.51M|            tmp = 0;/*ih264_g_six_tap[] is the array containing the filter coeffs*/
  810|  8.51M|            tmp = ih264_g_six_tap[0] *
  811|  8.51M|                            (pu1_src[col - 2 * src_strd] + pu1_src[col + 3 * src_strd])
  812|  8.51M|                  + ih264_g_six_tap[1] *
  813|  8.51M|                            (pu1_src[col - 1 * src_strd] + pu1_src[col + 2 * src_strd])
  814|  8.51M|                  + ih264_g_six_tap[2] *
  815|  8.51M|                            (pu1_src[col] + pu1_src[col + 1 * src_strd]);
  816|  8.51M|            pi2_pred1_temp[col] = tmp;
  817|  8.51M|        }
  818|       |
  819|   436k|        pu1_src += src_strd;
  820|   436k|        pi2_pred1_temp = pi2_pred1_temp + wd + 5;
  821|   436k|    }
  822|       |
  823|  30.5k|    pi2_pred1_temp = pi2_pred1;
  824|   467k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (824:18): [True: 436k, False: 30.5k]
  ------------------
  825|   436k|    {
  826|  6.76M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (826:22): [True: 6.32M, False: 436k]
  ------------------
  827|  6.32M|        {
  828|  6.32M|            tmp = 0;/*ih264_g_six_tap[] is the array containing the filter coeffs*/
  829|  6.32M|            tmp = ih264_g_six_tap[0] *
  830|  6.32M|                            (pi2_pred1[col - 2] + pi2_pred1[col + 3])
  831|  6.32M|                  + ih264_g_six_tap[1] *
  832|  6.32M|                            (pi2_pred1[col - 1] + pi2_pred1[col + 2])
  833|  6.32M|                  + ih264_g_six_tap[2] *
  834|  6.32M|                            (pi2_pred1[col] + pi2_pred1[col + 1]);
  835|  6.32M|            tmp = (tmp + 512) >> 10;
  836|  6.32M|            pu1_dst[col] = CLIP_U8(tmp);
  ------------------
  |  |   58|  6.32M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  6.32M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 13.0k, False: 6.31M]
  |  |  |  |  |  Branch (77:54): [True: 1.00k, False: 6.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  837|  6.32M|        }
  838|   436k|        pi2_pred1 += (wd + 5);
  839|   436k|        pu1_dst += dst_strd;
  840|   436k|    }
  841|       |
  842|  30.5k|    pu1_dst = pu1_dst_tmp;
  843|  30.5k|    pi2_pred1_temp += (x_offset >> 1);
  844|   467k|    for(row = ht; row != 0; row--)
  ------------------
  |  Branch (844:19): [True: 436k, False: 30.5k]
  ------------------
  845|   436k|    {
  846|  6.76M|        for(col = wd; col != 0; col--, pu1_dst++, pi2_pred1_temp++)
  ------------------
  |  Branch (846:23): [True: 6.32M, False: 436k]
  ------------------
  847|  6.32M|        {
  848|  6.32M|            UWORD8 uc_temp;
  849|       |            /* Clipping the output of the six tap filter obtained from the
  850|       |             first stage of the 2d filter stage */
  851|  6.32M|            *pi2_pred1_temp = (*pi2_pred1_temp + 16) >> 5;
  852|  6.32M|            i2_macro = (*pi2_pred1_temp);
  853|  6.32M|            uc_temp = CLIP_U8(i2_macro);
  ------------------
  |  |   58|  6.32M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  6.32M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 8.52k, False: 6.31M]
  |  |  |  |  |  Branch (77:54): [True: 895, False: 6.31M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  854|  6.32M|            *pu1_dst = (*pu1_dst + uc_temp + 1) >> 1;
  855|  6.32M|        }
  856|   436k|        pi2_pred1_temp += 5;
  857|   436k|        pu1_dst += dst_strd - wd;
  858|   436k|    }
  859|  30.5k|}
ih264_inter_pred_luma_horz_hpel_vert_qpel:
  957|  61.3k|{
  958|       |
  959|  61.3k|    WORD32 row, col;
  960|  61.3k|    WORD32 tmp;
  961|  61.3k|    WORD32 y_offset = dydx >> 2;
  962|  61.3k|    WORD16* pi2_pred1_temp, *pi2_pred1;
  963|  61.3k|    UWORD8* pu1_dst_tmp;
  964|       |    //WORD32 x_offset = dydx & 0x3;
  965|  61.3k|    WORD16 i2_macro;
  966|       |
  967|  61.3k|    y_offset = y_offset & 0x3;
  968|       |
  969|  61.3k|    pi2_pred1_temp = (WORD16*)pu1_tmp;
  970|  61.3k|    pi2_pred1_temp += 2 * wd;
  971|  61.3k|    pi2_pred1 = pi2_pred1_temp;
  972|  61.3k|    pu1_dst_tmp = pu1_dst;
  973|  61.3k|    pu1_src -= 2 * src_strd;
  974|  1.24M|    for(row = -2; row < ht + 3; row++)
  ------------------
  |  Branch (974:19): [True: 1.18M, False: 61.3k]
  ------------------
  975|  1.18M|    {
  976|  18.6M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (976:22): [True: 17.4M, False: 1.18M]
  ------------------
  977|  17.4M|        {
  978|  17.4M|            tmp = 0;/*ih264_g_six_tap[] is the array containing the filter coeffs*/
  979|  17.4M|            tmp = ih264_g_six_tap[0] * (pu1_src[col - 2] + pu1_src[col + 3])
  980|  17.4M|                  + ih264_g_six_tap[1] * (pu1_src[col - 1] + pu1_src[col + 2])
  981|  17.4M|                  + ih264_g_six_tap[2] * (pu1_src[col] + pu1_src[col + 1]);
  982|  17.4M|            pi2_pred1_temp[col - 2 * wd] = tmp;
  983|  17.4M|        }
  984|       |
  985|  1.18M|        pu1_src += src_strd;
  986|  1.18M|        pi2_pred1_temp += wd;
  987|  1.18M|    }
  988|  61.3k|    pi2_pred1_temp = pi2_pred1;
  989|   938k|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (989:18): [True: 877k, False: 61.3k]
  ------------------
  990|   877k|    {
  991|  13.9M|        for(col = 0; col < wd; col++)
  ------------------
  |  Branch (991:22): [True: 13.0M, False: 877k]
  ------------------
  992|  13.0M|        {
  993|  13.0M|            tmp = 0;/*ih264_g_six_tap[] is the array containing the filter coeffs*/
  994|  13.0M|            tmp = ih264_g_six_tap[0] * (pi2_pred1[col - 2 * wd] + pi2_pred1[col + 3 * wd])
  995|  13.0M|                  + ih264_g_six_tap[1] * (pi2_pred1[col - 1 * wd] + pi2_pred1[col + 2 * wd])
  996|  13.0M|                  + ih264_g_six_tap[2] * (pi2_pred1[col] + pi2_pred1[col + 1 * wd]);
  997|  13.0M|            tmp = (tmp + 512) >> 10;
  998|  13.0M|            pu1_dst[col] = CLIP_U8(tmp);
  ------------------
  |  |   58|  13.0M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 13.7k, False: 13.0M]
  |  |  |  |  |  Branch (77:54): [True: 77.7k, False: 12.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  999|  13.0M|        }
 1000|   877k|        pi2_pred1 += wd;
 1001|   877k|        pu1_dst += dst_strd;
 1002|   877k|    }
 1003|  61.3k|    pu1_dst = pu1_dst_tmp;
 1004|  61.3k|    pi2_pred1_temp += (y_offset >> 1) * wd;
 1005|   938k|    for(row = ht; row != 0; row--)
  ------------------
  |  Branch (1005:19): [True: 877k, False: 61.3k]
  ------------------
 1006|       |
 1007|   877k|    {
 1008|  13.9M|        for(col = wd; col != 0; col--, pu1_dst++, pi2_pred1_temp++)
  ------------------
  |  Branch (1008:23): [True: 13.0M, False: 877k]
  ------------------
 1009|  13.0M|        {
 1010|  13.0M|            UWORD8 u1_temp;
 1011|       |            /* Clipping the output of the six tap filter obtained from the
 1012|       |             first stage of the 2d filter stage */
 1013|  13.0M|            *pi2_pred1_temp = (*pi2_pred1_temp + 16) >> 5;
 1014|  13.0M|            i2_macro = (*pi2_pred1_temp);
 1015|  13.0M|            u1_temp = CLIP_U8(i2_macro);
  ------------------
  |  |   58|  13.0M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 6.04k, False: 13.0M]
  |  |  |  |  |  Branch (77:54): [True: 59.8k, False: 13.0M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1016|  13.0M|            *pu1_dst = (*pu1_dst + u1_temp + 1) >> 1;
 1017|  13.0M|        }
 1018|       |        //pi16_pred1_temp += wd;
 1019|   877k|        pu1_dst += dst_strd - wd;
 1020|   877k|    }
 1021|  61.3k|}
ih264_inter_pred_chroma:
 1141|  3.06M|{
 1142|  3.06M|    WORD32 row, col;
 1143|  3.06M|    WORD16 i2_tmp;
 1144|       |
 1145|  26.9M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (1145:18): [True: 23.8M, False: 3.06M]
  ------------------
 1146|  23.8M|    {
 1147|   399M|        for(col = 0; col < 2 * wd; col++)
  ------------------
  |  Branch (1147:22): [True: 375M, False: 23.8M]
  ------------------
 1148|   375M|        {
 1149|   375M|            i2_tmp = 0; /* applies equation (8-266) in section 8.4.2.2.2 */
 1150|   375M|            i2_tmp = (8 - dx) * (8 - dy) * pu1_src[col]
 1151|   375M|                     + (dx) * (8 - dy) * pu1_src[col + 2]
 1152|   375M|                     + (8 - dx) * (dy) * (pu1_src + src_strd)[col]
 1153|   375M|                     + (dx) * (dy) * (pu1_src + src_strd)[col + 2];
 1154|   375M|            i2_tmp = (i2_tmp + 32) >> 6;
 1155|   375M|            pu1_dst[col] = CLIP_U8(i2_tmp);
  ------------------
  |  |   58|   375M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   375M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 375M]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 375M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1156|   375M|        }
 1157|  23.8M|        pu1_src += src_strd;
 1158|  23.8M|        pu1_dst += dst_strd;
 1159|  23.8M|    }
 1160|  3.06M|}

ih264_iquant_itrans_recon_4x4:
  126|  62.3k|{
  127|  62.3k|    WORD16 *pi2_src_ptr = pi2_src;
  128|  62.3k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  129|  62.3k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  130|  62.3k|    UWORD8 *pu1_out_ptr = pu1_out;
  131|  62.3k|    WORD16 x0, x1, x2, x3, i;
  132|  62.3k|    WORD32 q0, q1, q2, q3;
  133|  62.3k|    WORD16 i_macro;
  134|  62.3k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (134:23): [True: 6.58k, False: 55.7k]
  ------------------
  135|       |
  136|       |    /* inverse quant */
  137|       |    /* horizontal inverse transform */
  138|   311k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   311k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (138:16): [True: 249k, False: 62.3k]
  ------------------
  139|   249k|    {
  140|   249k|        q0 = pi2_src_ptr[0];
  141|   249k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   249k|                {\
  |  |  104|   249k|                    i4_value *= quant_scale;\
  |  |  105|   249k|                    i4_value *= weight_scale;\
  |  |  106|   249k|                    i4_value += rndfactor;\
  |  |  107|   249k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   249k|                    i4_value >>= qbits;\
  |  |  109|   249k|                }
  ------------------
  142|       |        /* Restoring dc value for intra case */
  143|   249k|        if (i==0 && iq_start_idx == 1)
  ------------------
  |  Branch (143:13): [True: 62.3k, False: 186k]
  |  Branch (143:21): [True: 8.32k, False: 53.9k]
  ------------------
  144|  8.32k|        {
  145|  8.32k|            q0 = pi2_dc_ld_addr[0];
  146|  8.32k|        }
  147|       |
  148|   249k|        q2 = pi2_src_ptr[2];
  149|   249k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   249k|                {\
  |  |  104|   249k|                    i4_value *= quant_scale;\
  |  |  105|   249k|                    i4_value *= weight_scale;\
  |  |  106|   249k|                    i4_value += rndfactor;\
  |  |  107|   249k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   249k|                    i4_value >>= qbits;\
  |  |  109|   249k|                }
  ------------------
  150|       |
  151|   249k|        x0 = q0 + q2;
  152|   249k|        x1 = q0 - q2;
  153|       |
  154|   249k|        q1 = pi2_src_ptr[1];
  155|   249k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   249k|                {\
  |  |  104|   249k|                    i4_value *= quant_scale;\
  |  |  105|   249k|                    i4_value *= weight_scale;\
  |  |  106|   249k|                    i4_value += rndfactor;\
  |  |  107|   249k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   249k|                    i4_value >>= qbits;\
  |  |  109|   249k|                }
  ------------------
  156|       |
  157|   249k|        q3 = pi2_src_ptr[3];
  158|   249k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   249k|                {\
  |  |  104|   249k|                    i4_value *= quant_scale;\
  |  |  105|   249k|                    i4_value *= weight_scale;\
  |  |  106|   249k|                    i4_value += rndfactor;\
  |  |  107|   249k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   249k|                    i4_value >>= qbits;\
  |  |  109|   249k|                }
  ------------------
  159|       |
  160|   249k|        x2 = (q1 >> 1) - q3;
  161|   249k|        x3 = q1 + (q3 >> 1);
  162|       |
  163|   249k|        pi2_tmp_ptr[0] = x0 + x3;
  164|   249k|        pi2_tmp_ptr[1] = x1 + x2;
  165|   249k|        pi2_tmp_ptr[2] = x1 - x2;
  166|   249k|        pi2_tmp_ptr[3] = x0 - x3;
  167|       |
  168|   249k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   249k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  169|   249k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   249k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  170|   249k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   249k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  171|   249k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   249k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  172|   249k|    }
  173|       |
  174|       |    /* vertical inverse transform */
  175|  62.3k|    pi2_tmp_ptr = pi2_tmp;
  176|   311k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   311k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (176:16): [True: 249k, False: 62.3k]
  ------------------
  177|   249k|    {
  178|   249k|        pu1_pred_ptr = pu1_pred;
  179|   249k|        pu1_out = pu1_out_ptr;
  180|       |
  181|   249k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  182|   249k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  183|   249k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  184|   249k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  185|       |
  186|       |        /* inverse prediction */
  187|   249k|        i_macro = x0 + x3;
  188|   249k|        i_macro = ((i_macro + 32) >> 6);
  189|   249k|        i_macro += *pu1_pred_ptr;
  190|   249k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   249k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   249k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 77.0k, False: 172k]
  |  |  |  |  |  Branch (77:54): [True: 14.0k, False: 158k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  191|   249k|        pu1_pred_ptr += pred_strd;
  192|   249k|        pu1_out += out_strd;
  193|       |
  194|   249k|        i_macro = x1 + x2;
  195|   249k|        i_macro = ((i_macro + 32) >> 6);
  196|   249k|        i_macro += *pu1_pred_ptr;
  197|   249k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   249k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   249k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 78.0k, False: 171k]
  |  |  |  |  |  Branch (77:54): [True: 12.2k, False: 158k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  198|   249k|        pu1_pred_ptr += pred_strd;
  199|   249k|        pu1_out += out_strd;
  200|       |
  201|   249k|        i_macro = x1 - x2;
  202|   249k|        i_macro = ((i_macro + 32) >> 6);
  203|   249k|        i_macro += *pu1_pred_ptr;
  204|   249k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   249k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   249k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 77.6k, False: 171k]
  |  |  |  |  |  Branch (77:54): [True: 12.5k, False: 158k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|   249k|        pu1_pred_ptr += pred_strd;
  206|   249k|        pu1_out += out_strd;
  207|       |
  208|   249k|        i_macro = x0 - x3;
  209|   249k|        i_macro = ((i_macro + 32) >> 6);
  210|   249k|        i_macro += *pu1_pred_ptr;
  211|   249k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   249k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   249k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 79.0k, False: 170k]
  |  |  |  |  |  Branch (77:54): [True: 13.2k, False: 156k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  212|       |
  213|   249k|        pi2_tmp_ptr++;
  214|   249k|        pu1_out_ptr++;
  215|   249k|        pu1_pred++;
  216|   249k|    }
  217|  62.3k|}
ih264_iquant_itrans_recon_4x4_dc:
  280|   384k|{
  281|   384k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  282|   384k|    UWORD8 *pu1_out_ptr = pu1_out;
  283|   384k|    WORD32 q0;
  284|   384k|    WORD16 x, i_macro, i;
  285|   384k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (285:23): [True: 85.7k, False: 298k]
  ------------------
  286|       |
  287|   384k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|   384k|#define UNUSED(x) ((void)(x))
  ------------------
  288|   384k|    if(iq_start_idx == 0)
  ------------------
  |  Branch (288:8): [True: 19.0k, False: 365k]
  ------------------
  289|  19.0k|    {
  290|  19.0k|        q0 = pi2_src[0];
  291|  19.0k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  19.0k|                {\
  |  |  104|  19.0k|                    i4_value *= quant_scale;\
  |  |  105|  19.0k|                    i4_value *= weight_scale;\
  |  |  106|  19.0k|                    i4_value += rndfactor;\
  |  |  107|  19.0k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  19.0k|                    i4_value >>= qbits;\
  |  |  109|  19.0k|                }
  ------------------
  292|  19.0k|    }
  293|   365k|    else
  294|   365k|    {
  295|   365k|        q0 = pi2_dc_ld_addr[0]; // Restoring dc value for intra case3
  296|   365k|    }
  297|   384k|    i_macro = ((q0 + 32) >> 6);
  298|  1.92M|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  1.92M|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (298:16): [True: 1.53M, False: 384k]
  ------------------
  299|  1.53M|    {
  300|  1.53M|        pu1_pred_ptr = pu1_pred;
  301|  1.53M|        pu1_out = pu1_out_ptr;
  302|       |
  303|       |        /* inverse prediction */
  304|  1.53M|        x = i_macro + *pu1_pred_ptr;
  305|  1.53M|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  1.53M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.53M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 217k, False: 1.31M]
  |  |  |  |  |  Branch (77:54): [True: 222k, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  306|  1.53M|        pu1_pred_ptr += pred_strd;
  307|  1.53M|        pu1_out += out_strd;
  308|       |
  309|  1.53M|        x = i_macro + *pu1_pred_ptr;
  310|  1.53M|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  1.53M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.53M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 217k, False: 1.31M]
  |  |  |  |  |  Branch (77:54): [True: 223k, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  311|  1.53M|        pu1_pred_ptr += pred_strd;
  312|  1.53M|        pu1_out += out_strd;
  313|       |
  314|  1.53M|        x = i_macro + *pu1_pred_ptr;
  315|  1.53M|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  1.53M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.53M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 217k, False: 1.31M]
  |  |  |  |  |  Branch (77:54): [True: 223k, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  316|  1.53M|        pu1_pred_ptr += pred_strd;
  317|  1.53M|        pu1_out += out_strd;
  318|       |
  319|  1.53M|        x = i_macro + *pu1_pred_ptr;
  320|  1.53M|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  1.53M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.53M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 217k, False: 1.31M]
  |  |  |  |  |  Branch (77:54): [True: 224k, False: 1.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  321|       |
  322|  1.53M|        pu1_out_ptr++;
  323|  1.53M|        pu1_pred++;
  324|  1.53M|    }
  325|   384k|}
ih264_iquant_itrans_recon_8x8:
  389|  33.2k|{
  390|  33.2k|    WORD32 i;
  391|  33.2k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  392|  33.2k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  393|  33.2k|    UWORD8 *pu1_out_ptr = pu1_out;
  394|  33.2k|    WORD16 i_z0, i_z1, i_z2, i_z3, i_z4, i_z5, i_z6, i_z7;
  395|  33.2k|    WORD16 i_y0, i_y1, i_y2, i_y3, i_y4, i_y5, i_y6, i_y7;
  396|  33.2k|    WORD16 i_macro;
  397|  33.2k|    WORD32 q;
  398|  33.2k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (398:23): [True: 21.8k, False: 11.4k]
  ------------------
  399|       |
  400|  33.2k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  33.2k|#define UNUSED(x) ((void)(x))
  ------------------
  401|  33.2k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  33.2k|#define UNUSED(x) ((void)(x))
  ------------------
  402|       |    /*************************************************************/
  403|       |    /* De quantization of coefficients. Will be replaced by SIMD */
  404|       |    /* operations on platform. Note : DC coeff is not scaled     */
  405|       |    /*************************************************************/
  406|  2.16M|    for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|  2.16M|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
                  for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|  2.16M|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (406:16): [True: 2.12M, False: 33.2k]
  ------------------
  407|  2.12M|    {
  408|  2.12M|        q = pi2_src[i];
  409|  2.12M|        INV_QUANT(q, pu2_iscale_mat[i], pu2_weigh_mat[i], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  2.12M|                {\
  |  |  104|  2.12M|                    i4_value *= quant_scale;\
  |  |  105|  2.12M|                    i4_value *= weight_scale;\
  |  |  106|  2.12M|                    i4_value += rndfactor;\
  |  |  107|  2.12M|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  2.12M|                    i4_value >>= qbits;\
  |  |  109|  2.12M|                }
  ------------------
  410|  2.12M|        pi2_tmp_ptr[i] = q;
  411|  2.12M|    }
  412|       |    /* Perform Inverse transform */
  413|       |    /*--------------------------------------------------------------------*/
  414|       |    /* IDCT [ Horizontal transformation ]                                 */
  415|       |    /*--------------------------------------------------------------------*/
  416|   299k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   299k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (416:16): [True: 266k, False: 33.2k]
  ------------------
  417|   266k|    {
  418|       |        /*------------------------------------------------------------------*/
  419|       |        /* y0 = w0 + w4                                                     */
  420|       |        /* y1 = -w3 + w5 - w7 - (w7 >> 1)                                   */
  421|       |        /* y2 = w0 - w4                                                     */
  422|       |        /* y3 = w1 + w7 - w3 - (w3 >> 1)                                    */
  423|       |        /* y4 = (w2 >> 1) - w6                                              */
  424|       |        /* y5 = -w1 + w7 + w5 + (w5 >> 1)                                   */
  425|       |        /* y6 = w2 + (w6 >> 1)                                              */
  426|       |        /* y7 = w3 + w5 + w1 + (w1 >> 1)                                    */
  427|       |        /*------------------------------------------------------------------*/
  428|   266k|        i_y0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[4] );
  429|       |
  430|   266k|        i_y1 = ((WORD32)(-pi2_tmp_ptr[3]) + pi2_tmp_ptr[5] - pi2_tmp_ptr[7]
  431|   266k|                        - (pi2_tmp_ptr[7] >> 1));
  432|       |
  433|   266k|        i_y2 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[4] );
  434|       |
  435|   266k|        i_y3 = ((WORD32)pi2_tmp_ptr[1] + pi2_tmp_ptr[7] - pi2_tmp_ptr[3]
  436|   266k|                        - (pi2_tmp_ptr[3] >> 1));
  437|       |
  438|   266k|        i_y4 = ((pi2_tmp_ptr[2] >> 1) - pi2_tmp_ptr[6] );
  439|       |
  440|   266k|        i_y5 = ((WORD32)(-pi2_tmp_ptr[1]) + pi2_tmp_ptr[7] + pi2_tmp_ptr[5]
  441|   266k|                        + (pi2_tmp_ptr[5] >> 1));
  442|       |
  443|   266k|        i_y6 = (pi2_tmp_ptr[2] + (pi2_tmp_ptr[6] >> 1));
  444|       |
  445|   266k|        i_y7 = ((WORD32)pi2_tmp_ptr[3] + pi2_tmp_ptr[5] + pi2_tmp_ptr[1]
  446|   266k|                        + (pi2_tmp_ptr[1] >> 1));
  447|       |
  448|       |        /*------------------------------------------------------------------*/
  449|       |        /* z0 = y0 + y6                                                     */
  450|       |        /* z1 = y1 + (y7 >> 2)                                              */
  451|       |        /* z2 = y2 + y4                                                     */
  452|       |        /* z3 = y3 + (y5 >> 2)                                              */
  453|       |        /* z4 = y2 - y4                                                     */
  454|       |        /* z5 = (y3 >> 2) - y5                                              */
  455|       |        /* z6 = y0 - y6                                                     */
  456|       |        /* z7 = y7 - (y1 >> 2)                                              */
  457|       |        /*------------------------------------------------------------------*/
  458|   266k|        i_z0 = i_y0 + i_y6;
  459|   266k|        i_z1 = i_y1 + (i_y7 >> 2);
  460|   266k|        i_z2 = i_y2 + i_y4;
  461|   266k|        i_z3 = i_y3 + (i_y5 >> 2);
  462|   266k|        i_z4 = i_y2 - i_y4;
  463|   266k|        i_z5 = (i_y3 >> 2) - i_y5;
  464|   266k|        i_z6 = i_y0 - i_y6;
  465|   266k|        i_z7 = i_y7 - (i_y1 >> 2);
  466|       |
  467|       |        /*------------------------------------------------------------------*/
  468|       |        /* x0 = z0 + z7                                                     */
  469|       |        /* x1 = z2 + z5                                                     */
  470|       |        /* x2 = z4 + z3                                                     */
  471|       |        /* x3 = z6 + z1                                                     */
  472|       |        /* x4 = z6 - z1                                                     */
  473|       |        /* x5 = z4 - z3                                                     */
  474|       |        /* x6 = z2 - z5                                                     */
  475|       |        /* x7 = z0 - z7                                                     */
  476|       |        /*------------------------------------------------------------------*/
  477|   266k|        pi2_tmp_ptr[0] = i_z0 + i_z7;
  478|   266k|        pi2_tmp_ptr[1] = i_z2 + i_z5;
  479|   266k|        pi2_tmp_ptr[2] = i_z4 + i_z3;
  480|   266k|        pi2_tmp_ptr[3] = i_z6 + i_z1;
  481|   266k|        pi2_tmp_ptr[4] = i_z6 - i_z1;
  482|   266k|        pi2_tmp_ptr[5] = i_z4 - i_z3;
  483|   266k|        pi2_tmp_ptr[6] = i_z2 - i_z5;
  484|   266k|        pi2_tmp_ptr[7] = i_z0 - i_z7;
  485|       |
  486|       |        /* move to the next row */
  487|       |        //pi2_src_ptr += SUB_BLK_WIDTH_8x8;
  488|   266k|        pi2_tmp_ptr += SUB_BLK_WIDTH_8x8;
  ------------------
  |  |   53|   266k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  489|   266k|    }
  490|       |
  491|       |    /*--------------------------------------------------------------------*/
  492|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6            */
  493|       |    /*                                                                    */
  494|       |    /* Add the prediction and store it back to reconstructed frame buffer */
  495|       |    /* [Prediction buffer itself in this case]                            */
  496|       |    /*--------------------------------------------------------------------*/
  497|  33.2k|    pi2_tmp_ptr = pi2_tmp;
  498|   299k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   299k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (498:16): [True: 266k, False: 33.2k]
  ------------------
  499|   266k|    {
  500|   266k|        pu1_pred_ptr = pu1_pred;
  501|   266k|        pu1_out = pu1_out_ptr;
  502|       |        /*------------------------------------------------------------------*/
  503|       |        /* y0j = w0j + w4j                                                  */
  504|       |        /* y1j = -w3j + w5j -w7j -(w7j >> 1)                                */
  505|       |        /* y2j = w0j -w4j                                                   */
  506|       |        /* y3j = w1j + w7j -w3j -(w3j >> 1)                                 */
  507|       |        /* y4j = ( w2j >> 1 ) -w6j                                          */
  508|       |        /* y5j = -w1j + w7j + w5j + (w5j >> 1)                              */
  509|       |        /* y6j = w2j + ( w6j >> 1 )                                         */
  510|       |        /* y7j = w3j + w5j + w1j + (w1j >> 1)                               */
  511|       |        /*------------------------------------------------------------------*/
  512|   266k|        i_y0 = pi2_tmp_ptr[0] + pi2_tmp_ptr[32];
  513|       |
  514|   266k|        i_y1 = (WORD32)(-pi2_tmp_ptr[24]) + pi2_tmp_ptr[40] - pi2_tmp_ptr[56]
  515|   266k|                        - (pi2_tmp_ptr[56] >> 1);
  516|       |
  517|   266k|        i_y2 = pi2_tmp_ptr[0] - pi2_tmp_ptr[32];
  518|       |
  519|   266k|        i_y3 = (WORD32)pi2_tmp_ptr[8] + pi2_tmp_ptr[56] - pi2_tmp_ptr[24]
  520|   266k|                        - (pi2_tmp_ptr[24] >> 1);
  521|       |
  522|   266k|        i_y4 = (pi2_tmp_ptr[16] >> 1) - pi2_tmp_ptr[48];
  523|       |
  524|   266k|        i_y5 = (WORD32)(-pi2_tmp_ptr[8]) + pi2_tmp_ptr[56] + pi2_tmp_ptr[40]
  525|   266k|                        + (pi2_tmp_ptr[40] >> 1);
  526|       |
  527|   266k|        i_y6 = pi2_tmp_ptr[16] + (pi2_tmp_ptr[48] >> 1);
  528|       |
  529|   266k|        i_y7 = (WORD32)pi2_tmp_ptr[24] + pi2_tmp_ptr[40] + pi2_tmp_ptr[8]
  530|   266k|                        + (pi2_tmp_ptr[8] >> 1);
  531|       |
  532|       |        /*------------------------------------------------------------------*/
  533|       |        /* z0j = y0j + y6j                                                  */
  534|       |        /* z1j = y1j + (y7j >> 2)                                           */
  535|       |        /* z2j = y2j + y4j                                                  */
  536|       |        /* z3j = y3j + (y5j >> 2)                                           */
  537|       |        /* z4j = y2j -y4j                                                   */
  538|       |        /* z5j = (y3j >> 2) -y5j                                            */
  539|       |        /* z6j = y0j -y6j                                                   */
  540|       |        /* z7j = y7j -(y1j >> 2)                                            */
  541|       |        /*------------------------------------------------------------------*/
  542|   266k|        i_z0 = i_y0 + i_y6;
  543|   266k|        i_z1 = i_y1 + (i_y7 >> 2);
  544|   266k|        i_z2 = i_y2 + i_y4;
  545|   266k|        i_z3 = i_y3 + (i_y5 >> 2);
  546|   266k|        i_z4 = i_y2 - i_y4;
  547|   266k|        i_z5 = (i_y3 >> 2) - i_y5;
  548|   266k|        i_z6 = i_y0 - i_y6;
  549|   266k|        i_z7 = i_y7 - (i_y1 >> 2);
  550|       |
  551|       |        /*------------------------------------------------------------------*/
  552|       |        /* x0j = z0j + z7j                                                  */
  553|       |        /* x1j = z2j + z5j                                                  */
  554|       |        /* x2j = z4j + z3j                                                  */
  555|       |        /* x3j = z6j + z1j                                                  */
  556|       |        /* x4j = z6j -z1j                                                   */
  557|       |        /* x5j = z4j -z3j                                                   */
  558|       |        /* x6j = z2j -z5j                                                   */
  559|       |        /* x7j = z0j -z7j                                                   */
  560|       |        /*------------------------------------------------------------------*/
  561|   266k|        i_macro = ((i_z0 + i_z7 + 32) >> 6) + *pu1_pred_ptr;
  562|   266k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   266k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   266k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 31.6k, False: 234k]
  |  |  |  |  |  Branch (77:54): [True: 11.8k, False: 222k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  563|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  564|   266k|        pu1_pred_ptr += pred_strd;
  565|   266k|        pu1_out += out_strd;
  566|       |
  567|   266k|        i_macro = ((i_z2 + i_z5 + 32) >> 6) + *pu1_pred_ptr;
  568|   266k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   266k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   266k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 30.0k, False: 236k]
  |  |  |  |  |  Branch (77:54): [True: 10.9k, False: 225k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  569|   266k|        pu1_pred_ptr += pred_strd;
  570|   266k|        pu1_out += out_strd;
  571|       |
  572|   266k|        i_macro = ((i_z4 + i_z3 + 32) >> 6) + *pu1_pred_ptr;
  573|   266k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   266k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   266k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 34.6k, False: 231k]
  |  |  |  |  |  Branch (77:54): [True: 12.3k, False: 219k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  574|   266k|        pu1_pred_ptr += pred_strd;
  575|   266k|        pu1_out += out_strd;
  576|       |
  577|   266k|        i_macro = ((i_z6 + i_z1 + 32) >> 6) + *pu1_pred_ptr;
  578|   266k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   266k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   266k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 33.4k, False: 232k]
  |  |  |  |  |  Branch (77:54): [True: 12.1k, False: 220k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  579|   266k|        pu1_pred_ptr += pred_strd;
  580|   266k|        pu1_out += out_strd;
  581|       |
  582|   266k|        i_macro = ((i_z6 - i_z1 + 32) >> 6) + *pu1_pred_ptr;
  583|   266k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   266k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   266k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 37.5k, False: 228k]
  |  |  |  |  |  Branch (77:54): [True: 12.4k, False: 216k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  584|   266k|        pu1_pred_ptr += pred_strd;
  585|   266k|        pu1_out += out_strd;
  586|       |
  587|   266k|        i_macro = ((i_z4 - i_z3 + 32) >> 6) + *pu1_pred_ptr;
  588|   266k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   266k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   266k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 37.4k, False: 228k]
  |  |  |  |  |  Branch (77:54): [True: 11.9k, False: 216k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  589|   266k|        pu1_pred_ptr += pred_strd;
  590|   266k|        pu1_out += out_strd;
  591|       |
  592|   266k|        i_macro = ((i_z2 - i_z5 + 32) >> 6) + *pu1_pred_ptr;
  593|   266k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   266k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   266k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 32.4k, False: 233k]
  |  |  |  |  |  Branch (77:54): [True: 10.0k, False: 223k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  594|   266k|        pu1_pred_ptr += pred_strd;
  595|   266k|        pu1_out += out_strd;
  596|       |
  597|   266k|        i_macro = ((i_z0 - i_z7 + 32) >> 6) + *pu1_pred_ptr;
  598|   266k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   266k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   266k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 35.7k, False: 230k]
  |  |  |  |  |  Branch (77:54): [True: 11.5k, False: 218k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  599|       |
  600|   266k|        pi2_tmp_ptr++;
  601|   266k|        pu1_out_ptr++;
  602|   266k|        pu1_pred++;
  603|   266k|    }
  604|  33.2k|}
ih264_iquant_itrans_recon_8x8_dc:
  668|  12.0k|{
  669|  12.0k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  670|  12.0k|    UWORD8 *pu1_out_ptr = pu1_out;
  671|  12.0k|    WORD16 x, i, i_macro;
  672|  12.0k|    WORD32 q;
  673|  12.0k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (673:23): [True: 5.06k, False: 6.97k]
  ------------------
  674|       |
  675|  12.0k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  12.0k|#define UNUSED(x) ((void)(x))
  ------------------
  676|  12.0k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  12.0k|#define UNUSED(x) ((void)(x))
  ------------------
  677|  12.0k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  12.0k|#define UNUSED(x) ((void)(x))
  ------------------
  678|       |    /*************************************************************/
  679|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
  680|       |    /* operations on platform. Note : DC coeff is not scaled     */
  681|       |    /*************************************************************/
  682|  12.0k|    q = pi2_src[0];
  683|  12.0k|    INV_QUANT(q, pu2_iscale_mat[0], pu2_weigh_mat[0], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  12.0k|                {\
  |  |  104|  12.0k|                    i4_value *= quant_scale;\
  |  |  105|  12.0k|                    i4_value *= weight_scale;\
  |  |  106|  12.0k|                    i4_value += rndfactor;\
  |  |  107|  12.0k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  12.0k|                    i4_value >>= qbits;\
  |  |  109|  12.0k|                }
  ------------------
  684|  12.0k|    i_macro = (q + 32) >> 6;
  685|       |    /* Perform Inverse transform */
  686|       |    /*--------------------------------------------------------------------*/
  687|       |    /* IDCT [ Horizontal transformation ]                                 */
  688|       |    /*--------------------------------------------------------------------*/
  689|       |    /*--------------------------------------------------------------------*/
  690|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6            */
  691|       |    /*                                                                    */
  692|       |    /* Add the prediction and store it back to reconstructed frame buffer */
  693|       |    /* [Prediction buffer itself in this case]                            */
  694|       |    /*--------------------------------------------------------------------*/
  695|   108k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   108k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (695:16): [True: 96.3k, False: 12.0k]
  ------------------
  696|  96.3k|    {
  697|  96.3k|        pu1_pred_ptr = pu1_pred;
  698|  96.3k|        pu1_out = pu1_out_ptr;
  699|       |
  700|  96.3k|        x = i_macro + *pu1_pred_ptr;
  701|  96.3k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  96.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  96.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.43k, False: 92.8k]
  |  |  |  |  |  Branch (77:54): [True: 26.5k, False: 66.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  702|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  703|  96.3k|        pu1_pred_ptr += pred_strd;
  704|  96.3k|        pu1_out += out_strd;
  705|       |
  706|  96.3k|        x = i_macro + *pu1_pred_ptr;
  707|  96.3k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  96.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  96.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.40k, False: 92.9k]
  |  |  |  |  |  Branch (77:54): [True: 26.6k, False: 66.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  708|  96.3k|        pu1_pred_ptr += pred_strd;
  709|  96.3k|        pu1_out += out_strd;
  710|       |
  711|  96.3k|        x = i_macro + *pu1_pred_ptr;
  712|  96.3k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  96.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  96.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.40k, False: 92.9k]
  |  |  |  |  |  Branch (77:54): [True: 26.6k, False: 66.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  713|  96.3k|        pu1_pred_ptr += pred_strd;
  714|  96.3k|        pu1_out += out_strd;
  715|       |
  716|  96.3k|        x = i_macro + *pu1_pred_ptr;
  717|  96.3k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  96.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  96.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.39k, False: 92.9k]
  |  |  |  |  |  Branch (77:54): [True: 26.6k, False: 66.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  718|  96.3k|        pu1_pred_ptr += pred_strd;
  719|  96.3k|        pu1_out += out_strd;
  720|       |
  721|  96.3k|        x = i_macro + *pu1_pred_ptr;
  722|  96.3k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  96.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  96.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.39k, False: 92.9k]
  |  |  |  |  |  Branch (77:54): [True: 26.6k, False: 66.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  723|  96.3k|        pu1_pred_ptr += pred_strd;
  724|  96.3k|        pu1_out += out_strd;
  725|       |
  726|  96.3k|        x = i_macro + *pu1_pred_ptr;
  727|  96.3k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  96.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  96.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.41k, False: 92.9k]
  |  |  |  |  |  Branch (77:54): [True: 26.6k, False: 66.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  728|  96.3k|        pu1_pred_ptr += pred_strd;
  729|  96.3k|        pu1_out += out_strd;
  730|       |
  731|  96.3k|        x = i_macro + *pu1_pred_ptr;
  732|  96.3k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  96.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  96.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.44k, False: 92.8k]
  |  |  |  |  |  Branch (77:54): [True: 26.6k, False: 66.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  733|  96.3k|        pu1_pred_ptr += pred_strd;
  734|  96.3k|        pu1_out += out_strd;
  735|       |
  736|  96.3k|        x = i_macro + *pu1_pred_ptr;
  737|  96.3k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  96.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  96.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.45k, False: 92.8k]
  |  |  |  |  |  Branch (77:54): [True: 26.6k, False: 66.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  738|       |
  739|  96.3k|        pu1_out_ptr++;
  740|  96.3k|        pu1_pred++;
  741|  96.3k|    }
  742|  12.0k|}
ih264_iquant_itrans_recon_chroma_4x4:
  801|  22.1k|{
  802|  22.1k|    WORD16 *pi2_src_ptr = pi2_src;
  803|  22.1k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  804|  22.1k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  805|  22.1k|    UWORD8 *pu1_out_ptr = pu1_out;
  806|  22.1k|    WORD16 x0, x1, x2, x3, i;
  807|  22.1k|    WORD32 q0, q1, q2, q3;
  808|  22.1k|    WORD16 i_macro;
  809|  22.1k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (809:23): [True: 5.73k, False: 16.4k]
  ------------------
  810|       |
  811|       |    /* inverse quant */
  812|       |    /* horizontal inverse transform */
  813|   110k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   110k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (813:16): [True: 88.7k, False: 22.1k]
  ------------------
  814|  88.7k|    {
  815|  88.7k|        if(i == 0)
  ------------------
  |  Branch (815:12): [True: 22.1k, False: 66.5k]
  ------------------
  816|  22.1k|        {
  817|  22.1k|            q0 = pi2_dc_src[0];
  818|  22.1k|        }
  819|  66.5k|        else
  820|  66.5k|        {
  821|  66.5k|            q0 = pi2_src_ptr[0];
  822|  66.5k|            INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  66.5k|                {\
  |  |  104|  66.5k|                    i4_value *= quant_scale;\
  |  |  105|  66.5k|                    i4_value *= weight_scale;\
  |  |  106|  66.5k|                    i4_value += rndfactor;\
  |  |  107|  66.5k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  66.5k|                    i4_value >>= qbits;\
  |  |  109|  66.5k|                }
  ------------------
  823|  66.5k|        }
  824|       |
  825|  88.7k|        q2 = pi2_src_ptr[2];
  826|  88.7k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  88.7k|                {\
  |  |  104|  88.7k|                    i4_value *= quant_scale;\
  |  |  105|  88.7k|                    i4_value *= weight_scale;\
  |  |  106|  88.7k|                    i4_value += rndfactor;\
  |  |  107|  88.7k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  88.7k|                    i4_value >>= qbits;\
  |  |  109|  88.7k|                }
  ------------------
  827|       |
  828|  88.7k|        x0 = q0 + q2;
  829|  88.7k|        x1 = q0 - q2;
  830|       |
  831|  88.7k|        q1 = pi2_src_ptr[1];
  832|  88.7k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  88.7k|                {\
  |  |  104|  88.7k|                    i4_value *= quant_scale;\
  |  |  105|  88.7k|                    i4_value *= weight_scale;\
  |  |  106|  88.7k|                    i4_value += rndfactor;\
  |  |  107|  88.7k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  88.7k|                    i4_value >>= qbits;\
  |  |  109|  88.7k|                }
  ------------------
  833|       |
  834|  88.7k|        q3 = pi2_src_ptr[3];
  835|  88.7k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  88.7k|                {\
  |  |  104|  88.7k|                    i4_value *= quant_scale;\
  |  |  105|  88.7k|                    i4_value *= weight_scale;\
  |  |  106|  88.7k|                    i4_value += rndfactor;\
  |  |  107|  88.7k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  88.7k|                    i4_value >>= qbits;\
  |  |  109|  88.7k|                }
  ------------------
  836|       |
  837|  88.7k|        x2 = (q1 >> 1) - q3;
  838|  88.7k|        x3 = q1 + (q3 >> 1);
  839|       |
  840|  88.7k|        pi2_tmp_ptr[0] = x0 + x3;
  841|  88.7k|        pi2_tmp_ptr[1] = x1 + x2;
  842|  88.7k|        pi2_tmp_ptr[2] = x1 - x2;
  843|  88.7k|        pi2_tmp_ptr[3] = x0 - x3;
  844|       |
  845|  88.7k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  88.7k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  846|  88.7k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  88.7k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  847|  88.7k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  88.7k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  848|  88.7k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  88.7k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  849|  88.7k|    }
  850|       |
  851|       |    /* vertical inverse transform */
  852|  22.1k|    pi2_tmp_ptr = pi2_tmp;
  853|   110k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   110k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (853:16): [True: 88.7k, False: 22.1k]
  ------------------
  854|  88.7k|    {
  855|  88.7k|        pu1_pred_ptr = pu1_pred;
  856|  88.7k|        pu1_out = pu1_out_ptr;
  857|       |
  858|  88.7k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  859|  88.7k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  860|  88.7k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  861|  88.7k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  862|       |
  863|       |        /* inverse prediction */
  864|  88.7k|        i_macro = x0 + x3;
  865|  88.7k|        i_macro = ((i_macro + 32) >> 6);
  866|  88.7k|        i_macro += *pu1_pred_ptr;
  867|  88.7k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  88.7k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  88.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 22.7k, False: 66.0k]
  |  |  |  |  |  Branch (77:54): [True: 5.36k, False: 60.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  868|  88.7k|        pu1_pred_ptr += pred_strd;
  869|  88.7k|        pu1_out += out_strd;
  870|       |
  871|  88.7k|        i_macro = x1 + x2;
  872|  88.7k|        i_macro = ((i_macro + 32) >> 6);
  873|  88.7k|        i_macro += *pu1_pred_ptr;
  874|  88.7k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  88.7k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  88.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 24.1k, False: 64.6k]
  |  |  |  |  |  Branch (77:54): [True: 5.20k, False: 59.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  875|  88.7k|        pu1_pred_ptr += pred_strd;
  876|  88.7k|        pu1_out += out_strd;
  877|       |
  878|  88.7k|        i_macro = x1 - x2;
  879|  88.7k|        i_macro = ((i_macro + 32) >> 6);
  880|  88.7k|        i_macro += *pu1_pred_ptr;
  881|  88.7k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  88.7k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  88.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 22.4k, False: 66.2k]
  |  |  |  |  |  Branch (77:54): [True: 5.18k, False: 61.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  882|  88.7k|        pu1_pred_ptr += pred_strd;
  883|  88.7k|        pu1_out += out_strd;
  884|       |
  885|  88.7k|        i_macro = x0 - x3;
  886|  88.7k|        i_macro = ((i_macro + 32) >> 6);
  887|  88.7k|        i_macro += *pu1_pred_ptr;
  888|  88.7k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  88.7k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  88.7k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 24.5k, False: 64.2k]
  |  |  |  |  |  Branch (77:54): [True: 5.08k, False: 59.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  889|       |
  890|  88.7k|        pi2_tmp_ptr++;
  891|  88.7k|        pu1_out_ptr += 2; // Interleaved store for output
  892|  88.7k|        pu1_pred += 2; // Interleaved load for pred buffer
  893|  88.7k|    }
  894|  22.1k|}
ih264_iquant_itrans_recon_chroma_4x4_dc:
  950|   137k|{
  951|   137k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  952|   137k|    UWORD8 *pu1_out_ptr = pu1_out;
  953|   137k|    WORD32 q0;
  954|   137k|    WORD16 x, i_macro, i;
  955|       |
  956|   137k|    UNUSED(pi2_src);
  ------------------
  |  |   45|   137k|#define UNUSED(x) ((void)(x))
  ------------------
  957|   137k|    UNUSED(pu2_iscal_mat);
  ------------------
  |  |   45|   137k|#define UNUSED(x) ((void)(x))
  ------------------
  958|   137k|    UNUSED(pu2_weigh_mat);
  ------------------
  |  |   45|   137k|#define UNUSED(x) ((void)(x))
  ------------------
  959|   137k|    UNUSED(u4_qp_div_6);
  ------------------
  |  |   45|   137k|#define UNUSED(x) ((void)(x))
  ------------------
  960|   137k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|   137k|#define UNUSED(x) ((void)(x))
  ------------------
  961|       |
  962|   137k|    q0 = pi2_dc_src[0];    // Restoring dc value for intra case3
  963|   137k|    i_macro = ((q0 + 32) >> 6);
  964|       |
  965|   685k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   685k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (965:16): [True: 548k, False: 137k]
  ------------------
  966|   548k|    {
  967|   548k|        pu1_pred_ptr = pu1_pred;
  968|   548k|        pu1_out = pu1_out_ptr;
  969|       |
  970|       |        /* inverse prediction */
  971|   548k|        x = i_macro + *pu1_pred_ptr;
  972|   548k|        *pu1_out =  CLIP_U8(x);
  ------------------
  |  |   58|   548k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   548k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 140k, False: 407k]
  |  |  |  |  |  Branch (77:54): [True: 7.28k, False: 399k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  973|   548k|        pu1_pred_ptr += pred_strd;
  974|   548k|        pu1_out += out_strd;
  975|       |
  976|   548k|        x = i_macro + *pu1_pred_ptr;
  977|   548k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   548k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   548k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 141k, False: 406k]
  |  |  |  |  |  Branch (77:54): [True: 7.32k, False: 399k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|   548k|        pu1_pred_ptr += pred_strd;
  979|   548k|        pu1_out += out_strd;
  980|       |
  981|   548k|        x = i_macro + *pu1_pred_ptr;
  982|   548k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   548k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   548k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 141k, False: 406k]
  |  |  |  |  |  Branch (77:54): [True: 7.34k, False: 399k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  983|   548k|        pu1_pred_ptr += pred_strd;
  984|   548k|        pu1_out += out_strd;
  985|       |
  986|   548k|        x = i_macro + *pu1_pred_ptr;
  987|   548k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   548k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   548k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 141k, False: 407k]
  |  |  |  |  |  Branch (77:54): [True: 7.30k, False: 399k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  988|       |
  989|   548k|        pu1_out_ptr+=2;
  990|   548k|        pu1_pred+=2;
  991|   548k|    }
  992|   137k|}

ih264_intra_pred_luma_4x4_mode_vert:
  139|  74.9k|{
  140|  74.9k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
  141|       |
  142|  74.9k|    UNUSED(src_strd);
  ------------------
  |  |   45|  74.9k|#define UNUSED(x) ((void)(x))
  ------------------
  143|  74.9k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  74.9k|#define UNUSED(x) ((void)(x))
  ------------------
  144|  74.9k|    pu1_top = pu1_src + BLK_SIZE + 1;
  ------------------
  |  |  511|  74.9k|#define BLK_SIZE            4
  ------------------
  145|  74.9k|    memcpy(pu1_dst, pu1_top, 4);
  146|  74.9k|    memcpy(pu1_dst + dst_strd, pu1_top, 4);
  147|  74.9k|    memcpy(pu1_dst + 2 * dst_strd, pu1_top, 4);
  148|  74.9k|    memcpy(pu1_dst + 3 * dst_strd, pu1_top, 4);
  149|  74.9k|}
ih264_intra_pred_luma_4x4_mode_horz:
  188|  15.6k|{
  189|  15.6k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
  190|       |
  191|  15.6k|    UNUSED(src_strd);
  ------------------
  |  |   45|  15.6k|#define UNUSED(x) ((void)(x))
  ------------------
  192|  15.6k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  15.6k|#define UNUSED(x) ((void)(x))
  ------------------
  193|  15.6k|    pu1_left = pu1_src + BLK_SIZE - 1;
  ------------------
  |  |  511|  15.6k|#define BLK_SIZE            4
  ------------------
  194|  15.6k|    memset(pu1_dst, *pu1_left, 4);
  195|  15.6k|    memset(pu1_dst + dst_strd, *(pu1_left - 1), 4);
  196|  15.6k|    memset(pu1_dst + 2 * dst_strd, *(pu1_left - 2), 4);
  197|  15.6k|    memset(pu1_dst + 3 * dst_strd, *(pu1_left - 3), 4);
  198|  15.6k|}
ih264_intra_pred_luma_4x4_mode_dc:
  236|  62.0k|{
  237|  62.0k|    UWORD8 u1_useleft; /* availability of left predictors (only for DC) */
  238|  62.0k|    UWORD8 u1_usetop; /* availability of top predictors (only for DC) */
  239|  62.0k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
  240|  62.0k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
  241|  62.0k|    WORD32 val = 0;
  242|       |
  243|  62.0k|    UNUSED(src_strd);
  ------------------
  |  |   45|  62.0k|#define UNUSED(x) ((void)(x))
  ------------------
  244|  62.0k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  62.0k|#define UNUSED(x) ((void)(x))
  ------------------
  245|  62.0k|    u1_useleft = BOOLEAN(ngbr_avail & LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|  62.0k|#define BOOLEAN(x) (!!(x))
  ------------------
  246|  62.0k|    u1_usetop = BOOLEAN(ngbr_avail & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|  62.0k|#define BOOLEAN(x) (!!(x))
  ------------------
  247|  62.0k|    pu1_top = pu1_src + BLK_SIZE + 1;
  ------------------
  |  |  511|  62.0k|#define BLK_SIZE            4
  ------------------
  248|  62.0k|    pu1_left = pu1_src + BLK_SIZE - 1;
  ------------------
  |  |  511|  62.0k|#define BLK_SIZE            4
  ------------------
  249|       |
  250|  62.0k|    if(u1_useleft)
  ------------------
  |  Branch (250:8): [True: 49.3k, False: 12.6k]
  ------------------
  251|  49.3k|    {
  252|  49.3k|        val += *pu1_left--;
  253|  49.3k|        val += *pu1_left--;
  254|  49.3k|        val += *pu1_left--;
  255|  49.3k|        val += *pu1_left + 2;
  256|  49.3k|    }
  257|  62.0k|    if(u1_usetop)
  ------------------
  |  Branch (257:8): [True: 54.0k, False: 8.04k]
  ------------------
  258|  54.0k|    {
  259|  54.0k|        val += *pu1_top + *(pu1_top + 1) + *(pu1_top + 2) + *(pu1_top + 3)
  260|  54.0k|                        + 2;
  261|  54.0k|    }
  262|       |    /* Since 2 is added if either left/top pred is there,
  263|       |     val still being zero implies both preds are not there */
  264|  62.0k|    val = (val) ? (val >> (1 + u1_useleft + u1_usetop)) : 128;
  ------------------
  |  Branch (264:11): [True: 61.3k, False: 768]
  ------------------
  265|       |    /* 4 bytes are copied from src to dst */
  266|  62.0k|    memset(pu1_dst, val, 4);
  267|  62.0k|    memset(pu1_dst + dst_strd, val, 4);
  268|  62.0k|    memset(pu1_dst + 2 * dst_strd, val, 4);
  269|  62.0k|    memset(pu1_dst + 3 * dst_strd, val, 4);
  270|  62.0k|}
ih264_intra_pred_luma_4x4_mode_diag_dl:
  309|  5.45k|{
  310|  5.45k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
  311|  5.45k|    UWORD32 ui4_a, ui4_b, ui4_c, ui4_d, ui4_e, ui4_f, ui4_g, ui4_h;
  312|  5.45k|    UWORD8 predicted_pixels[7];
  313|       |
  314|  5.45k|    UNUSED(src_strd);
  ------------------
  |  |   45|  5.45k|#define UNUSED(x) ((void)(x))
  ------------------
  315|  5.45k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  5.45k|#define UNUSED(x) ((void)(x))
  ------------------
  316|  5.45k|    pu1_top = pu1_src +BLK_SIZE + 1;
  ------------------
  |  |  511|  5.45k|#define BLK_SIZE            4
  ------------------
  317|       |
  318|  5.45k|    ui4_a = *pu1_top++;
  319|  5.45k|    ui4_b = *pu1_top++;
  320|  5.45k|    ui4_c = *pu1_top++;
  321|  5.45k|    ui4_d = *pu1_top++;
  322|  5.45k|    ui4_e = *pu1_top++;
  323|  5.45k|    ui4_f = *pu1_top++;
  324|  5.45k|    ui4_g = *pu1_top++;
  325|  5.45k|    ui4_h = *pu1_top;
  326|       |
  327|  5.45k|    predicted_pixels[0] = FILT121(ui4_a, ui4_b, ui4_c);
  ------------------
  |  |   46|  5.45k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  328|  5.45k|    predicted_pixels[1] = FILT121(ui4_b, ui4_c, ui4_d);
  ------------------
  |  |   46|  5.45k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  329|  5.45k|    predicted_pixels[2] = FILT121(ui4_c, ui4_d, ui4_e);
  ------------------
  |  |   46|  5.45k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  330|  5.45k|    predicted_pixels[3] = FILT121(ui4_d, ui4_e, ui4_f);
  ------------------
  |  |   46|  5.45k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  331|  5.45k|    predicted_pixels[4] = FILT121(ui4_e, ui4_f, ui4_g);
  ------------------
  |  |   46|  5.45k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  332|  5.45k|    predicted_pixels[5] = FILT121(ui4_f, ui4_g, ui4_h);
  ------------------
  |  |   46|  5.45k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  333|  5.45k|    predicted_pixels[6] = FILT121(ui4_g, ui4_h, ui4_h);
  ------------------
  |  |   46|  5.45k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  334|       |
  335|  5.45k|    memcpy(pu1_dst, predicted_pixels, 4);
  336|  5.45k|    memcpy(pu1_dst + dst_strd, predicted_pixels + 1, 4);
  337|  5.45k|    memcpy(pu1_dst + 2 * dst_strd, predicted_pixels + 2, 4);
  338|  5.45k|    memcpy(pu1_dst + 3 * dst_strd, predicted_pixels + 3, 4);
  339|  5.45k|}
ih264_intra_pred_luma_4x4_mode_diag_dr:
  378|  2.04k|{
  379|  2.04k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
  380|  2.04k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
  381|  2.04k|    UWORD8 *pu1_topleft = NULL;/* Pointer to top left predictor */
  382|  2.04k|    UWORD32 ui4_a, ui4_b, ui4_c, ui4_d, ui4_i, ui4_j, ui4_k, ui4_l, ui4_m;
  383|  2.04k|    UWORD8 predicted_pixels[7];
  384|       |
  385|  2.04k|    UNUSED(src_strd);
  ------------------
  |  |   45|  2.04k|#define UNUSED(x) ((void)(x))
  ------------------
  386|  2.04k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  2.04k|#define UNUSED(x) ((void)(x))
  ------------------
  387|  2.04k|    pu1_top = pu1_src + BLK_SIZE + 1;
  ------------------
  |  |  511|  2.04k|#define BLK_SIZE            4
  ------------------
  388|  2.04k|    pu1_left = pu1_src + BLK_SIZE - 1;
  ------------------
  |  |  511|  2.04k|#define BLK_SIZE            4
  ------------------
  389|  2.04k|    pu1_topleft = pu1_src +BLK_SIZE;
  ------------------
  |  |  511|  2.04k|#define BLK_SIZE            4
  ------------------
  390|       |
  391|  2.04k|    ui4_a = *pu1_top++;
  392|  2.04k|    ui4_b = *pu1_top++;
  393|  2.04k|    ui4_c = *pu1_top++;
  394|  2.04k|    ui4_d = *pu1_top++;
  395|  2.04k|    ui4_i = *pu1_left--;
  396|  2.04k|    ui4_j = *pu1_left--;
  397|  2.04k|    ui4_k = *pu1_left--;
  398|  2.04k|    ui4_l = *pu1_left;
  399|  2.04k|    ui4_m = *pu1_topleft;
  400|       |
  401|  2.04k|    predicted_pixels[2] = FILT121(ui4_j, ui4_i, ui4_m);
  ------------------
  |  |   46|  2.04k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  402|  2.04k|    predicted_pixels[1] = FILT121(ui4_k, ui4_j, ui4_i);
  ------------------
  |  |   46|  2.04k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  403|  2.04k|    predicted_pixels[0] = FILT121(ui4_l, ui4_k, ui4_j);
  ------------------
  |  |   46|  2.04k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  404|  2.04k|    predicted_pixels[3] = FILT121(ui4_i, ui4_m, ui4_a);
  ------------------
  |  |   46|  2.04k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  405|  2.04k|    predicted_pixels[4] = FILT121(ui4_m, ui4_a, ui4_b);
  ------------------
  |  |   46|  2.04k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  406|  2.04k|    predicted_pixels[5] = FILT121(ui4_a, ui4_b, ui4_c);
  ------------------
  |  |   46|  2.04k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  407|  2.04k|    predicted_pixels[6] = FILT121(ui4_b, ui4_c, ui4_d);
  ------------------
  |  |   46|  2.04k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  408|       |
  409|  2.04k|    memcpy(pu1_dst, predicted_pixels + 3, 4);
  410|  2.04k|    memcpy(pu1_dst + dst_strd, predicted_pixels + 2, 4);
  411|  2.04k|    memcpy(pu1_dst + 2 * dst_strd, predicted_pixels + 1, 4);
  412|  2.04k|    memcpy(pu1_dst + 3 * dst_strd, predicted_pixels, 4);
  413|  2.04k|}
ih264_intra_pred_luma_4x4_mode_vert_r:
  452|  2.08k|{
  453|       |
  454|  2.08k|    UWORD32 ui4_a, ui4_b, ui4_c, ui4_d, ui4_i, ui4_j, ui4_k, ui4_m;
  455|  2.08k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
  456|  2.08k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
  457|  2.08k|    UWORD8 *pu1_topleft = NULL;/* Pointer to top left predictor */
  458|  2.08k|    UWORD8 predicted_pixels[10];
  459|       |
  460|  2.08k|    UNUSED(src_strd);
  ------------------
  |  |   45|  2.08k|#define UNUSED(x) ((void)(x))
  ------------------
  461|  2.08k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  2.08k|#define UNUSED(x) ((void)(x))
  ------------------
  462|  2.08k|    pu1_top = pu1_src +BLK_SIZE + 1;
  ------------------
  |  |  511|  2.08k|#define BLK_SIZE            4
  ------------------
  463|  2.08k|    pu1_left = pu1_src + BLK_SIZE - 1;
  ------------------
  |  |  511|  2.08k|#define BLK_SIZE            4
  ------------------
  464|  2.08k|    pu1_topleft = pu1_src + BLK_SIZE;
  ------------------
  |  |  511|  2.08k|#define BLK_SIZE            4
  ------------------
  465|       |
  466|  2.08k|    ui4_a = *pu1_top++;
  467|  2.08k|    ui4_b = *pu1_top++;
  468|  2.08k|    ui4_c = *pu1_top++;
  469|  2.08k|    ui4_d = *pu1_top++;
  470|  2.08k|    ui4_i = *pu1_left--;
  471|  2.08k|    ui4_j = *pu1_left--;
  472|  2.08k|    ui4_k = *pu1_left;
  473|  2.08k|    ui4_m = *pu1_topleft;
  474|       |
  475|  2.08k|    predicted_pixels[6] = FILT11(ui4_m, ui4_a);
  ------------------
  |  |   49|  2.08k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  476|  2.08k|    predicted_pixels[7] = FILT11(ui4_a, ui4_b);
  ------------------
  |  |   49|  2.08k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  477|  2.08k|    predicted_pixels[8] = FILT11(ui4_b, ui4_c);
  ------------------
  |  |   49|  2.08k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  478|  2.08k|    predicted_pixels[9] = FILT11(ui4_c, ui4_d);
  ------------------
  |  |   49|  2.08k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  479|  2.08k|    predicted_pixels[1] = FILT121(ui4_i, ui4_m, ui4_a);
  ------------------
  |  |   46|  2.08k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  480|  2.08k|    predicted_pixels[2] = FILT121(ui4_m, ui4_a, ui4_b);
  ------------------
  |  |   46|  2.08k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  481|  2.08k|    predicted_pixels[3] = FILT121(ui4_a, ui4_b, ui4_c);
  ------------------
  |  |   46|  2.08k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  482|  2.08k|    predicted_pixels[4] = FILT121(ui4_b, ui4_c, ui4_d);
  ------------------
  |  |   46|  2.08k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  483|  2.08k|    predicted_pixels[5] = FILT121(ui4_j, ui4_i, ui4_m);
  ------------------
  |  |   46|  2.08k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  484|  2.08k|    predicted_pixels[0] = FILT121(ui4_k, ui4_j, ui4_i);
  ------------------
  |  |   46|  2.08k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  485|       |
  486|  2.08k|    memcpy(pu1_dst, predicted_pixels + 6, 4);
  487|  2.08k|    memcpy(pu1_dst + dst_strd, predicted_pixels + 1, 4);
  488|  2.08k|    memcpy(pu1_dst + 2 * dst_strd, predicted_pixels + 5, 4);
  489|  2.08k|    memcpy(pu1_dst + 3 * dst_strd, predicted_pixels, 4);
  490|  2.08k|}
ih264_intra_pred_luma_4x4_mode_horz_d:
  529|  3.62k|{
  530|  3.62k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
  531|  3.62k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
  532|  3.62k|    UWORD8 *pu1_topleft = NULL;/* Pointer to top left predictor */
  533|  3.62k|    UWORD32 ui4_a, ui4_b, ui4_c, ui4_i, ui4_j, ui4_k, ui4_l, ui4_m;
  534|  3.62k|    UWORD8 predicted_pixels[10];
  535|       |
  536|  3.62k|    UNUSED(src_strd);
  ------------------
  |  |   45|  3.62k|#define UNUSED(x) ((void)(x))
  ------------------
  537|  3.62k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  3.62k|#define UNUSED(x) ((void)(x))
  ------------------
  538|  3.62k|    pu1_top = pu1_src + BLK_SIZE + 1;
  ------------------
  |  |  511|  3.62k|#define BLK_SIZE            4
  ------------------
  539|  3.62k|    pu1_left = pu1_src + BLK_SIZE - 1;
  ------------------
  |  |  511|  3.62k|#define BLK_SIZE            4
  ------------------
  540|  3.62k|    pu1_topleft = pu1_src + BLK_SIZE;
  ------------------
  |  |  511|  3.62k|#define BLK_SIZE            4
  ------------------
  541|       |
  542|  3.62k|    ui4_a = *pu1_top++;
  543|  3.62k|    ui4_b = *pu1_top++;
  544|  3.62k|    ui4_c = *pu1_top++;
  545|  3.62k|    ui4_i = *pu1_left--;
  546|  3.62k|    ui4_j = *pu1_left--;
  547|  3.62k|    ui4_k = *pu1_left--;
  548|  3.62k|    ui4_l = *pu1_left--;
  549|  3.62k|    ui4_m = *pu1_topleft;
  550|       |
  551|  3.62k|    predicted_pixels[6] = FILT11(ui4_i, ui4_m);
  ------------------
  |  |   49|  3.62k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  552|  3.62k|    predicted_pixels[7] = FILT121(ui4_i, ui4_m, ui4_a);
  ------------------
  |  |   46|  3.62k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  553|  3.62k|    predicted_pixels[8] = FILT121(ui4_m, ui4_a, ui4_b);
  ------------------
  |  |   46|  3.62k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  554|  3.62k|    predicted_pixels[9] = FILT121(ui4_a, ui4_b, ui4_c);
  ------------------
  |  |   46|  3.62k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  555|  3.62k|    predicted_pixels[1] = FILT121(ui4_l, ui4_k, ui4_j);
  ------------------
  |  |   46|  3.62k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  556|  3.62k|    predicted_pixels[2] = FILT11(ui4_k, ui4_j);
  ------------------
  |  |   49|  3.62k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  557|  3.62k|    predicted_pixels[3] = FILT121(ui4_k, ui4_j, ui4_i);
  ------------------
  |  |   46|  3.62k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  558|  3.62k|    predicted_pixels[4] = FILT11(ui4_j, ui4_i);
  ------------------
  |  |   49|  3.62k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  559|  3.62k|    predicted_pixels[5] = FILT121(ui4_j, ui4_i, ui4_m);
  ------------------
  |  |   46|  3.62k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  560|  3.62k|    predicted_pixels[0] = FILT11(ui4_l, ui4_k);
  ------------------
  |  |   49|  3.62k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  561|       |
  562|  3.62k|    memcpy(pu1_dst, predicted_pixels + 6, 4);
  563|  3.62k|    memcpy(pu1_dst + dst_strd, predicted_pixels + 4, 4);
  564|  3.62k|    memcpy(pu1_dst + 2 * dst_strd, predicted_pixels + 2, 4);
  565|  3.62k|    memcpy(pu1_dst + 3 * dst_strd, predicted_pixels, 4);
  566|  3.62k|}
ih264_intra_pred_luma_4x4_mode_vert_l:
  605|  5.58k|{
  606|  5.58k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
  607|  5.58k|    UWORD32 ui4_a, ui4_b, ui4_c, ui4_d, ui4_e, ui4_f, ui4_g;
  608|  5.58k|    UWORD8 predicted_pixels[10];
  609|       |
  610|  5.58k|    UNUSED(src_strd);
  ------------------
  |  |   45|  5.58k|#define UNUSED(x) ((void)(x))
  ------------------
  611|  5.58k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  5.58k|#define UNUSED(x) ((void)(x))
  ------------------
  612|  5.58k|    pu1_top = pu1_src + BLK_SIZE + 1;
  ------------------
  |  |  511|  5.58k|#define BLK_SIZE            4
  ------------------
  613|       |
  614|  5.58k|    ui4_a = *pu1_top++;
  615|  5.58k|    ui4_b = *pu1_top++;
  616|  5.58k|    ui4_c = *pu1_top++;
  617|  5.58k|    ui4_d = *pu1_top++;
  618|  5.58k|    ui4_e = *pu1_top++;
  619|  5.58k|    ui4_f = *pu1_top++;
  620|  5.58k|    ui4_g = *pu1_top;
  621|       |
  622|  5.58k|    predicted_pixels[5] = FILT11(ui4_a, ui4_b);
  ------------------
  |  |   49|  5.58k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  623|  5.58k|    predicted_pixels[6] = FILT11(ui4_b, ui4_c);
  ------------------
  |  |   49|  5.58k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  624|  5.58k|    predicted_pixels[7] = FILT11(ui4_c, ui4_d);
  ------------------
  |  |   49|  5.58k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  625|  5.58k|    predicted_pixels[8] = FILT11(ui4_d, ui4_e);
  ------------------
  |  |   49|  5.58k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  626|  5.58k|    predicted_pixels[0] = FILT121(ui4_a, ui4_b, ui4_c);
  ------------------
  |  |   46|  5.58k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  627|  5.58k|    predicted_pixels[1] = FILT121(ui4_b, ui4_c, ui4_d);
  ------------------
  |  |   46|  5.58k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  628|  5.58k|    predicted_pixels[2] = FILT121(ui4_c, ui4_d, ui4_e);
  ------------------
  |  |   46|  5.58k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  629|  5.58k|    predicted_pixels[3] = FILT121(ui4_d, ui4_e, ui4_f);
  ------------------
  |  |   46|  5.58k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  630|  5.58k|    predicted_pixels[9] = FILT11(ui4_e, ui4_f);
  ------------------
  |  |   49|  5.58k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  631|  5.58k|    predicted_pixels[4] = FILT121(ui4_e, ui4_f, ui4_g);
  ------------------
  |  |   46|  5.58k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  632|       |
  633|  5.58k|    memcpy(pu1_dst, predicted_pixels + 5, 4);
  634|  5.58k|    memcpy(pu1_dst + dst_strd, predicted_pixels, 4);
  635|  5.58k|    memcpy(pu1_dst + 2 * dst_strd, predicted_pixels + 6, 4);
  636|  5.58k|    memcpy(pu1_dst + 3 * dst_strd, predicted_pixels + 1, 4);
  637|  5.58k|}
ih264_intra_pred_luma_4x4_mode_horz_u:
  676|  9.74k|{
  677|  9.74k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
  678|  9.74k|    UWORD32 ui4_i, ui4_j, ui4_k, ui4_l;
  679|  9.74k|    UWORD8 predicted_pixels[10];
  680|       |
  681|  9.74k|    UNUSED(src_strd);
  ------------------
  |  |   45|  9.74k|#define UNUSED(x) ((void)(x))
  ------------------
  682|  9.74k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  9.74k|#define UNUSED(x) ((void)(x))
  ------------------
  683|  9.74k|    pu1_left = pu1_src + BLK_SIZE - 1;
  ------------------
  |  |  511|  9.74k|#define BLK_SIZE            4
  ------------------
  684|       |
  685|  9.74k|    ui4_i = *pu1_left--;
  686|  9.74k|    ui4_j = *pu1_left--;
  687|  9.74k|    ui4_k = *pu1_left--;
  688|  9.74k|    ui4_l = *pu1_left--;
  689|       |
  690|  9.74k|    predicted_pixels[0] = FILT11(ui4_j, ui4_i);
  ------------------
  |  |   49|  9.74k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  691|  9.74k|    predicted_pixels[1] = FILT121(ui4_k, ui4_j, ui4_i);
  ------------------
  |  |   46|  9.74k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  692|  9.74k|    predicted_pixels[2] = FILT11(ui4_k, ui4_j);
  ------------------
  |  |   49|  9.74k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  693|  9.74k|    predicted_pixels[3] = FILT121(ui4_l, ui4_k, ui4_j);
  ------------------
  |  |   46|  9.74k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  694|  9.74k|    predicted_pixels[4] = FILT11(ui4_l, ui4_k);
  ------------------
  |  |   49|  9.74k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
  695|  9.74k|    predicted_pixels[5] = FILT121(ui4_l, ui4_l, ui4_k);
  ------------------
  |  |   46|  9.74k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  696|  9.74k|    predicted_pixels[6] = ui4_l;
  697|  9.74k|    predicted_pixels[7] = ui4_l;
  698|  9.74k|    predicted_pixels[8] = ui4_l;
  699|  9.74k|    predicted_pixels[9] = ui4_l;
  700|       |
  701|  9.74k|    memcpy(pu1_dst, predicted_pixels, 4);
  702|  9.74k|    memcpy(pu1_dst + dst_strd, predicted_pixels + 2, 4);
  703|  9.74k|    memcpy(pu1_dst + 2 * dst_strd, predicted_pixels + 4, 4);
  704|  9.74k|    memcpy(pu1_dst + 3 * dst_strd, predicted_pixels + 6, 4);
  705|  9.74k|}
ih264_intra_pred_luma_8x8_mode_ref_filtering:
  747|   149k|{
  748|   149k|    WORD32 top_avail, left_avail, top_left_avail, top_right_avail;
  749|       |
  750|   149k|    left_avail = BOOLEAN(ngbr_avail & LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|   149k|#define BOOLEAN(x) (!!(x))
  ------------------
  751|   149k|    top_avail = BOOLEAN(ngbr_avail & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|   149k|#define BOOLEAN(x) (!!(x))
  ------------------
  752|   149k|    top_left_avail = BOOLEAN(ngbr_avail & TOP_LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|   149k|#define BOOLEAN(x) (!!(x))
  ------------------
  753|   149k|    top_right_avail = BOOLEAN(ngbr_avail & TOP_RIGHT_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|   149k|#define BOOLEAN(x) (!!(x))
  ------------------
  754|       |
  755|   149k|    if(top_avail)
  ------------------
  |  Branch (755:8): [True: 122k, False: 26.7k]
  ------------------
  756|   122k|    {
  757|   122k|        WORD32 i;
  758|   122k|        UWORD32 u4_xm1;
  759|       |
  760|   122k|        if(!top_right_avail)
  ------------------
  |  Branch (760:12): [True: 44.0k, False: 78.3k]
  ------------------
  761|  44.0k|        {
  762|  44.0k|            memset(pu1_dst + 8 + 1 + 8, pu1_top[7], 8);
  763|  44.0k|            top_right_avail = 1;
  764|  44.0k|        }
  765|  78.3k|        else
  766|  78.3k|        {
  767|  78.3k|            memcpy(pu1_dst + 8 + 1 + 8, pu1_top + 8, 8);
  768|  78.3k|        }
  769|       |
  770|   122k|        if(top_left_avail)
  ------------------
  |  Branch (770:12): [True: 104k, False: 17.6k]
  ------------------
  771|   104k|        {
  772|   104k|            pu1_dst[8 + 1 + 0] = FILT121((*pu1_topleft), pu1_top[0],
  ------------------
  |  |   46|   104k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  773|   104k|                                         pu1_top[1]);
  774|   104k|        }
  775|  17.6k|        else
  776|  17.6k|        {
  777|  17.6k|            pu1_dst[8 + 1] = ((3 * pu1_top[0]) + pu1_top[1] + 2) >> 2;
  778|  17.6k|        }
  779|       |
  780|   856k|        for(i = 1; i <= 6; i++)
  ------------------
  |  Branch (780:20): [True: 734k, False: 122k]
  ------------------
  781|   734k|        {
  782|   734k|            pu1_dst[8 + 1 + i] = FILT121(pu1_top[i - 1], pu1_top[i],
  ------------------
  |  |   46|   734k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  783|   734k|                                         pu1_top[i + 1]);
  784|   734k|        }
  785|       |        /* First byte of Top Right input is in pu1_dst[8 + 1 + 8]*/
  786|   122k|        pu1_dst[8 + 1 + 7] = FILT121(pu1_top[6], pu1_top[7],
  ------------------
  |  |   46|   122k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  787|   122k|                                     pu1_dst[8 + 1 + 8]);
  788|       |
  789|       |        /* filtered output and source in same buf, to prevent output(x - 1)
  790|       |         being over written in process */
  791|   122k|        u4_xm1 = pu1_top[7];
  792|       |
  793|   979k|        for(i = 8; i <= 14; i++)
  ------------------
  |  Branch (793:20): [True: 856k, False: 122k]
  ------------------
  794|   856k|        {
  795|   856k|            UWORD32 u4_x;
  796|   856k|            u4_x = (u4_xm1 + (pu1_dst[8 + 1 + i] << 1) + pu1_dst[8 + 1 + i + 1]
  797|   856k|                            + 2) >> 2;
  798|       |            /* assigning u4_xm1 from the un-filtered values for the next iteration */
  799|   856k|            u4_xm1 = pu1_dst[8 + 1 + i];
  800|   856k|            pu1_dst[8 + 1 + i] = u4_x;
  801|   856k|        }
  802|       |
  803|   122k|        pu1_dst[8 + 1 + 15] = (u4_xm1 + (3 * pu1_dst[8 + 1 + 15]) + 2) >> 2;
  804|   122k|    }
  805|       |
  806|       |    /* pu1_topleft is overloaded. It is both: */
  807|       |    /* a. A pointer for the top left pixel */
  808|       |    /* b. An indicator of availability of top left. */
  809|       |    /*    If it is null then top left not available */
  810|   149k|    if(top_left_avail)
  ------------------
  |  Branch (810:8): [True: 106k, False: 42.4k]
  ------------------
  811|   106k|    {
  812|   106k|        if((!top_avail) || (!left_avail))
  ------------------
  |  Branch (812:12): [True: 1.98k, False: 104k]
  |  Branch (812:28): [True: 743, False: 104k]
  ------------------
  813|  2.73k|        {
  814|  2.73k|            if(top_avail)
  ------------------
  |  Branch (814:16): [True: 743, False: 1.98k]
  ------------------
  815|    743|                pu1_dst[8] = (3 * pu1_topleft[0] + pu1_top[0] + 2) >> 2;
  816|  1.98k|            else if(left_avail)
  ------------------
  |  Branch (816:21): [True: 498, False: 1.48k]
  ------------------
  817|    498|                pu1_dst[8] = (3 * pu1_topleft[0] + pu1_left[0] + 2) >> 2;
  818|  2.73k|        }
  819|   104k|        else
  820|   104k|        {
  821|   104k|            pu1_dst[8] = FILT121(pu1_top[0], (*pu1_topleft), pu1_left[0]);
  ------------------
  |  |   46|   104k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  822|   104k|        }
  823|   106k|    }
  824|       |
  825|   149k|    if(left_avail)
  ------------------
  |  Branch (825:8): [True: 127k, False: 21.6k]
  ------------------
  826|   127k|    {
  827|   127k|        UWORD32 idx;
  828|   127k|        if(0 != pu1_topleft)
  ------------------
  |  Branch (828:12): [True: 104k, False: 23.0k]
  ------------------
  829|   104k|        {
  830|   104k|            pu1_dst[7] = FILT121((*pu1_topleft), pu1_left[0],
  ------------------
  |  |   46|   104k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  831|   104k|                                 pu1_left[src_strd]);
  832|   104k|        }
  833|  23.0k|        else
  834|  23.0k|        {
  835|  23.0k|            pu1_dst[7] = ((3 * pu1_left[0]) + pu1_left[src_strd] + 2) >> 2;
  836|  23.0k|        }
  837|       |
  838|   892k|        for(idx = 1; idx <= 6; idx++)
  ------------------
  |  Branch (838:22): [True: 765k, False: 127k]
  ------------------
  839|   765k|        {
  840|   765k|            pu1_dst[7 - idx] = FILT121(pu1_left[(idx - 1) * src_strd],
  ------------------
  |  |   46|   765k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
  841|   765k|                                       pu1_left[idx * src_strd],
  842|   765k|                                       pu1_left[(idx + 1) * src_strd]);
  843|       |
  844|   765k|        }
  845|   127k|        pu1_dst[0] = (pu1_left[6 * src_strd] + 3 * pu1_left[7 * src_strd] + 2)
  846|   127k|                        >> 2;
  847|   127k|    }
  848|   149k|}
ih264_intra_pred_luma_8x8_mode_vert:
  887|  16.2k|{
  888|  16.2k|    UWORD8 *pu1_top = NULL;
  889|       |
  890|  16.2k|    UNUSED(src_strd);
  ------------------
  |  |   45|  16.2k|#define UNUSED(x) ((void)(x))
  ------------------
  891|  16.2k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  16.2k|#define UNUSED(x) ((void)(x))
  ------------------
  892|  16.2k|    pu1_top = pu1_src + BLK8x8SIZE + 1;
  ------------------
  |  |  510|  16.2k|#define BLK8x8SIZE          8
  ------------------
  893|       |
  894|  16.2k|    memcpy(pu1_dst, pu1_top, 8);
  895|  16.2k|    memcpy(pu1_dst + dst_strd, pu1_top, 8);
  896|  16.2k|    memcpy(pu1_dst + 2 * dst_strd, pu1_top, 8);
  897|  16.2k|    memcpy(pu1_dst + 3 * dst_strd, pu1_top, 8);
  898|  16.2k|    memcpy(pu1_dst + 4 * dst_strd, pu1_top, 8);
  899|  16.2k|    memcpy(pu1_dst + 5 * dst_strd, pu1_top, 8);
  900|  16.2k|    memcpy(pu1_dst + 6 * dst_strd, pu1_top, 8);
  901|  16.2k|    memcpy(pu1_dst + 7 * dst_strd, pu1_top, 8);
  902|  16.2k|}
ih264_intra_pred_luma_8x8_mode_horz:
  941|  3.10k|{
  942|  3.10k|    UWORD8 *pu1_left = pu1_src + BLK8x8SIZE - 1;
  ------------------
  |  |  510|  3.10k|#define BLK8x8SIZE          8
  ------------------
  943|       |
  944|  3.10k|    UNUSED(src_strd);
  ------------------
  |  |   45|  3.10k|#define UNUSED(x) ((void)(x))
  ------------------
  945|  3.10k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  3.10k|#define UNUSED(x) ((void)(x))
  ------------------
  946|  3.10k|    memset(pu1_dst, *pu1_left, 8);
  947|  3.10k|    memset(pu1_dst + dst_strd, *(pu1_left - 1), 8);
  948|  3.10k|    memset(pu1_dst + 2 * dst_strd, *(pu1_left - 2), 8);
  949|  3.10k|    memset(pu1_dst + 3 * dst_strd, *(pu1_left - 3), 8);
  950|  3.10k|    memset(pu1_dst + 4 * dst_strd, *(pu1_left - 4), 8);
  951|  3.10k|    memset(pu1_dst + 5 * dst_strd, *(pu1_left - 5), 8);
  952|  3.10k|    memset(pu1_dst + 6 * dst_strd, *(pu1_left - 6), 8);
  953|  3.10k|    memset(pu1_dst + 7 * dst_strd, *(pu1_left - 7), 8);
  954|  3.10k|}
ih264_intra_pred_luma_8x8_mode_dc:
  992|  35.3k|{
  993|  35.3k|    UWORD8 u1_useleft; /* availability of left predictors (only for DC) */
  994|  35.3k|    UWORD8 u1_usetop; /* availability of top predictors (only for DC) */
  995|  35.3k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
  996|  35.3k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
  997|  35.3k|    WORD32 row;
  998|  35.3k|    WORD32 val = 0;
  999|       |
 1000|  35.3k|    UNUSED(src_strd);
  ------------------
  |  |   45|  35.3k|#define UNUSED(x) ((void)(x))
  ------------------
 1001|  35.3k|    u1_useleft = BOOLEAN(ngbr_avail & LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|  35.3k|#define BOOLEAN(x) (!!(x))
  ------------------
 1002|  35.3k|    u1_usetop = BOOLEAN(ngbr_avail & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|  35.3k|#define BOOLEAN(x) (!!(x))
  ------------------
 1003|  35.3k|    pu1_top = pu1_src + BLK8x8SIZE + 1;
  ------------------
  |  |  510|  35.3k|#define BLK8x8SIZE          8
  ------------------
 1004|  35.3k|    pu1_left = pu1_src + BLK8x8SIZE - 1;
  ------------------
  |  |  510|  35.3k|#define BLK8x8SIZE          8
  ------------------
 1005|       |
 1006|  35.3k|    if(u1_useleft)
  ------------------
  |  Branch (1006:8): [True: 28.4k, False: 6.83k]
  ------------------
 1007|  28.4k|    {
 1008|   256k|        for(row = 0; row < BLK8x8SIZE; row++)
  ------------------
  |  |  510|   256k|#define BLK8x8SIZE          8
  ------------------
  |  Branch (1008:22): [True: 227k, False: 28.4k]
  ------------------
 1009|   227k|            val += *(pu1_left - row);
 1010|  28.4k|        val += 4;
 1011|  28.4k|    }
 1012|  35.3k|    if(u1_usetop)
  ------------------
  |  Branch (1012:8): [True: 26.0k, False: 9.31k]
  ------------------
 1013|  26.0k|    {
 1014|   234k|        for(row = 0; row < BLK8x8SIZE; row++)
  ------------------
  |  |  510|   234k|#define BLK8x8SIZE          8
  ------------------
  |  Branch (1014:22): [True: 208k, False: 26.0k]
  ------------------
 1015|   208k|            val += *(pu1_top + row);
 1016|  26.0k|        val += 4;
 1017|  26.0k|    }
 1018|       |
 1019|       |    /* Since 4 is added if either left/top pred is there,
 1020|       |     val still being zero implies both preds are not there */
 1021|  35.3k|    val = (val) ? (val >> (2 + u1_useleft + u1_usetop)) : 128;
  ------------------
  |  Branch (1021:11): [True: 34.2k, False: 1.06k]
  ------------------
 1022|       |
 1023|  35.3k|    memset(pu1_dst, val, 8);
 1024|  35.3k|    memset(pu1_dst + dst_strd, val, 8);
 1025|  35.3k|    memset(pu1_dst + 2 * dst_strd, val, 8);
 1026|  35.3k|    memset(pu1_dst + 3 * dst_strd, val, 8);
 1027|  35.3k|    memset(pu1_dst + 4 * dst_strd, val, 8);
 1028|  35.3k|    memset(pu1_dst + 5 * dst_strd, val, 8);
 1029|  35.3k|    memset(pu1_dst + 6 * dst_strd, val, 8);
 1030|  35.3k|    memset(pu1_dst + 7 * dst_strd, val, 8);
 1031|  35.3k|}
ih264_intra_pred_luma_8x8_mode_diag_dl:
 1070|    909|{
 1071|    909|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
 1072|    909|    UWORD32 ui4_a, ui4_b, ui4_c, ui4_d, ui4_e, ui4_f, ui4_g, ui4_h;
 1073|    909|    UWORD32 ui4_i, ui4_j, ui4_k, ui4_l, ui4_m, ui4_n, ui4_o, ui4_p;
 1074|    909|    UWORD8 predicted_pixels[15];
 1075|       |
 1076|    909|    UNUSED(src_strd);
  ------------------
  |  |   45|    909|#define UNUSED(x) ((void)(x))
  ------------------
 1077|    909|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|    909|#define UNUSED(x) ((void)(x))
  ------------------
 1078|    909|    pu1_top = pu1_src + BLK8x8SIZE + 1;
  ------------------
  |  |  510|    909|#define BLK8x8SIZE          8
  ------------------
 1079|       |
 1080|    909|    ui4_a = *pu1_top++;
 1081|    909|    ui4_b = *pu1_top++;
 1082|    909|    ui4_c = *pu1_top++;
 1083|    909|    ui4_d = *pu1_top++;
 1084|    909|    ui4_e = *pu1_top++;
 1085|    909|    ui4_f = *pu1_top++;
 1086|    909|    ui4_g = *pu1_top++;
 1087|    909|    ui4_h = *pu1_top++;
 1088|    909|    ui4_i = *pu1_top++;
 1089|    909|    ui4_j = *pu1_top++;
 1090|    909|    ui4_k = *pu1_top++;
 1091|    909|    ui4_l = *pu1_top++;
 1092|    909|    ui4_m = *pu1_top++;
 1093|    909|    ui4_n = *pu1_top++;
 1094|    909|    ui4_o = *pu1_top++;
 1095|    909|    ui4_p = *pu1_top;
 1096|       |
 1097|    909|    predicted_pixels[0] = FILT121(ui4_a, ui4_b, ui4_c);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1098|    909|    predicted_pixels[1] = FILT121(ui4_b, ui4_c, ui4_d);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1099|    909|    predicted_pixels[2] = FILT121(ui4_c, ui4_d, ui4_e);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1100|    909|    predicted_pixels[3] = FILT121(ui4_d, ui4_e, ui4_f);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1101|    909|    predicted_pixels[4] = FILT121(ui4_e, ui4_f, ui4_g);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1102|    909|    predicted_pixels[5] = FILT121(ui4_f, ui4_g, ui4_h);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1103|    909|    predicted_pixels[6] = FILT121(ui4_g, ui4_h, ui4_i);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1104|    909|    predicted_pixels[7] = FILT121(ui4_h, ui4_i, ui4_j);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1105|    909|    predicted_pixels[8] = FILT121(ui4_i, ui4_j, ui4_k);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1106|    909|    predicted_pixels[9] = FILT121(ui4_j, ui4_k, ui4_l);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1107|    909|    predicted_pixels[10] = FILT121(ui4_k, ui4_l, ui4_m);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1108|    909|    predicted_pixels[11] = FILT121(ui4_l, ui4_m, ui4_n);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1109|    909|    predicted_pixels[12] = FILT121(ui4_m, ui4_n, ui4_o);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1110|    909|    predicted_pixels[13] = FILT121(ui4_n, ui4_o, ui4_p);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1111|    909|    predicted_pixels[14] = FILT121(ui4_o, ui4_p, ui4_p);
  ------------------
  |  |   46|    909|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1112|       |
 1113|    909|    memcpy(pu1_dst, predicted_pixels, 8);
 1114|    909|    memcpy(pu1_dst + dst_strd, predicted_pixels + 1, 8);
 1115|    909|    memcpy(pu1_dst + 2 * dst_strd, predicted_pixels + 2, 8);
 1116|    909|    memcpy(pu1_dst + 3 * dst_strd, predicted_pixels + 3, 8);
 1117|    909|    memcpy(pu1_dst + 4 * dst_strd, predicted_pixels + 4, 8);
 1118|    909|    memcpy(pu1_dst + 5 * dst_strd, predicted_pixels + 5, 8);
 1119|    909|    memcpy(pu1_dst + 6 * dst_strd, predicted_pixels + 6, 8);
 1120|    909|    memcpy(pu1_dst + 7 * dst_strd, predicted_pixels + 7, 8);
 1121|    909|}
ih264_intra_pred_luma_8x8_mode_diag_dr:
 1160|    878|{
 1161|    878|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
 1162|    878|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
 1163|    878|    UWORD8 *pu1_topleft = NULL; /* Pointer to start of top left predictors */
 1164|    878|    UWORD32 ui4_a;
 1165|    878|    UWORD32 ui4_b, ui4_c, ui4_d, ui4_e, ui4_f, ui4_g, ui4_h, ui4_i;
 1166|    878|    UWORD32 ui4_j, ui4_k, ui4_l, ui4_m, ui4_n, ui4_o, ui4_p, ui4_q;
 1167|    878|    UWORD8 predicted_pixels[15];
 1168|       |
 1169|    878|    UNUSED(src_strd);
  ------------------
  |  |   45|    878|#define UNUSED(x) ((void)(x))
  ------------------
 1170|    878|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|    878|#define UNUSED(x) ((void)(x))
  ------------------
 1171|    878|    pu1_top = pu1_src + BLK8x8SIZE + 1;
  ------------------
  |  |  510|    878|#define BLK8x8SIZE          8
  ------------------
 1172|    878|    pu1_left = pu1_src + BLK8x8SIZE - 1;
  ------------------
  |  |  510|    878|#define BLK8x8SIZE          8
  ------------------
 1173|    878|    pu1_topleft = pu1_src + BLK8x8SIZE;
  ------------------
  |  |  510|    878|#define BLK8x8SIZE          8
  ------------------
 1174|       |
 1175|    878|    ui4_a = *pu1_topleft;
 1176|    878|    ui4_b = *pu1_top++;
 1177|    878|    ui4_c = *pu1_top++;
 1178|    878|    ui4_d = *pu1_top++;
 1179|    878|    ui4_e = *pu1_top++;
 1180|    878|    ui4_f = *pu1_top++;
 1181|    878|    ui4_g = *pu1_top++;
 1182|    878|    ui4_h = *pu1_top++;
 1183|    878|    ui4_i = *pu1_top;
 1184|    878|    ui4_j = *pu1_left--;
 1185|    878|    ui4_k = *pu1_left--;
 1186|    878|    ui4_l = *pu1_left--;
 1187|    878|    ui4_m = *pu1_left--;
 1188|    878|    ui4_n = *pu1_left--;
 1189|    878|    ui4_o = *pu1_left--;
 1190|    878|    ui4_p = *pu1_left--;
 1191|    878|    ui4_q = *pu1_left;
 1192|       |
 1193|    878|    predicted_pixels[6] = FILT121(ui4_a, ui4_j, ui4_k);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1194|    878|    predicted_pixels[5] = FILT121(ui4_j, ui4_k, ui4_l);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1195|    878|    predicted_pixels[4] = FILT121(ui4_k, ui4_l, ui4_m);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1196|    878|    predicted_pixels[3] = FILT121(ui4_l, ui4_m, ui4_n);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1197|    878|    predicted_pixels[2] = FILT121(ui4_m, ui4_n, ui4_o);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1198|    878|    predicted_pixels[1] = FILT121(ui4_n, ui4_o, ui4_p);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1199|    878|    predicted_pixels[0] = FILT121(ui4_o, ui4_p, ui4_q);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1200|    878|    predicted_pixels[7] = FILT121(ui4_b, ui4_a, ui4_j);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1201|    878|    predicted_pixels[8] = FILT121(ui4_a, ui4_b, ui4_c);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1202|    878|    predicted_pixels[9] = FILT121(ui4_b, ui4_c, ui4_d);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1203|    878|    predicted_pixels[10] = FILT121(ui4_c, ui4_d, ui4_e);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1204|    878|    predicted_pixels[11] = FILT121(ui4_d, ui4_e, ui4_f);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1205|    878|    predicted_pixels[12] = FILT121(ui4_e, ui4_f, ui4_g);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1206|    878|    predicted_pixels[13] = FILT121(ui4_f, ui4_g, ui4_h);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1207|    878|    predicted_pixels[14] = FILT121(ui4_g, ui4_h, ui4_i);
  ------------------
  |  |   46|    878|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1208|       |
 1209|    878|    memcpy(pu1_dst, predicted_pixels + 7, 8);
 1210|    878|    memcpy(pu1_dst + dst_strd, predicted_pixels + 6, 8);
 1211|    878|    memcpy(pu1_dst + 2 * dst_strd, predicted_pixels + 5, 8);
 1212|    878|    memcpy(pu1_dst + 3 * dst_strd, predicted_pixels + 4, 8);
 1213|    878|    memcpy(pu1_dst + 4 * dst_strd, predicted_pixels + 3, 8);
 1214|    878|    memcpy(pu1_dst + 5 * dst_strd, predicted_pixels + 2, 8);
 1215|    878|    memcpy(pu1_dst + 6 * dst_strd, predicted_pixels + 1, 8);
 1216|    878|    memcpy(pu1_dst + 7 * dst_strd, predicted_pixels, 8);
 1217|    878|}
ih264_intra_pred_luma_8x8_mode_vert_r:
 1256|    774|{
 1257|    774|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
 1258|    774|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
 1259|    774|    UWORD8 *pu1_topleft = NULL; /* Pointer to start of top left predictors */
 1260|    774|    UWORD32 ui4_a;
 1261|    774|    UWORD32 ui4_b, ui4_c, ui4_d, ui4_e, ui4_f, ui4_g, ui4_h, ui4_i;
 1262|    774|    UWORD32 ui4_j, ui4_k, ui4_l, ui4_m, ui4_n, ui4_o, ui4_p;
 1263|    774|    UWORD8 predicted_pixels[22];
 1264|       |
 1265|    774|    UNUSED(src_strd);
  ------------------
  |  |   45|    774|#define UNUSED(x) ((void)(x))
  ------------------
 1266|    774|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|    774|#define UNUSED(x) ((void)(x))
  ------------------
 1267|    774|    pu1_top = pu1_src + BLK8x8SIZE + 1;
  ------------------
  |  |  510|    774|#define BLK8x8SIZE          8
  ------------------
 1268|    774|    pu1_left = pu1_src + BLK8x8SIZE - 1;
  ------------------
  |  |  510|    774|#define BLK8x8SIZE          8
  ------------------
 1269|    774|    pu1_topleft = pu1_src + BLK8x8SIZE;
  ------------------
  |  |  510|    774|#define BLK8x8SIZE          8
  ------------------
 1270|       |
 1271|    774|    ui4_a = *pu1_topleft;
 1272|       |
 1273|    774|    ui4_b = *pu1_top++;
 1274|    774|    ui4_c = *pu1_top++;
 1275|    774|    ui4_d = *pu1_top++;
 1276|    774|    ui4_e = *pu1_top++;
 1277|    774|    ui4_f = *pu1_top++;
 1278|    774|    ui4_g = *pu1_top++;
 1279|    774|    ui4_h = *pu1_top++;
 1280|    774|    ui4_i = *pu1_top;
 1281|    774|    ui4_j = *pu1_left--;
 1282|    774|    ui4_k = *pu1_left--;
 1283|    774|    ui4_l = *pu1_left--;
 1284|    774|    ui4_m = *pu1_left--;
 1285|    774|    ui4_n = *pu1_left--;
 1286|    774|    ui4_o = *pu1_left--;
 1287|    774|    ui4_p = *pu1_left--;
 1288|       |
 1289|    774|    predicted_pixels[0] = FILT121(ui4_o, ui4_n, ui4_m);
  ------------------
  |  |   46|    774|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1290|    774|    predicted_pixels[1] = FILT121(ui4_m, ui4_l, ui4_k);
  ------------------
  |  |   46|    774|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1291|    774|    predicted_pixels[2] = FILT121(ui4_k, ui4_j, ui4_a);
  ------------------
  |  |   46|    774|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1292|    774|    predicted_pixels[3] = FILT11(ui4_a, ui4_b);
  ------------------
  |  |   49|    774|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1293|    774|    predicted_pixels[4] = FILT11(ui4_b, ui4_c);
  ------------------
  |  |   49|    774|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1294|    774|    predicted_pixels[5] = FILT11(ui4_c, ui4_d);
  ------------------
  |  |   49|    774|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1295|    774|    predicted_pixels[6] = FILT11(ui4_d, ui4_e);
  ------------------
  |  |   49|    774|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1296|    774|    predicted_pixels[7] = FILT11(ui4_e, ui4_f);
  ------------------
  |  |   49|    774|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1297|    774|    predicted_pixels[8] = FILT11(ui4_f, ui4_g);
  ------------------
  |  |   49|    774|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1298|    774|    predicted_pixels[9] = FILT11(ui4_g, ui4_h);
  ------------------
  |  |   49|    774|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1299|    774|    predicted_pixels[10] = FILT11(ui4_h, ui4_i);
  ------------------
  |  |   49|    774|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1300|    774|    predicted_pixels[11] = FILT121(ui4_p, ui4_o, ui4_n);
  ------------------
  |  |   46|    774|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1301|    774|    predicted_pixels[12] = FILT121(ui4_n, ui4_m, ui4_l);
  ------------------
  |  |   46|    774|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1302|    774|    predicted_pixels[13] = FILT121(ui4_l, ui4_k, ui4_j);
  ------------------
  |  |   46|    774|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1303|    774|    predicted_pixels[14] = FILT121(ui4_b, ui4_a, ui4_j);
  ------------------
  |  |   46|    774|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1304|    774|    predicted_pixels[15] = FILT121(ui4_a, ui4_b, ui4_c);
  ------------------
  |  |   46|    774|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1305|    774|    predicted_pixels[16] = FILT121(ui4_b, ui4_c, ui4_d);
  ------------------
  |  |   46|    774|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1306|    774|    predicted_pixels[17] = FILT121(ui4_c, ui4_d, ui4_e);
  ------------------
  |  |   46|    774|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1307|    774|    predicted_pixels[18] = FILT121(ui4_d, ui4_e, ui4_f);
  ------------------
  |  |   46|    774|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1308|    774|    predicted_pixels[19] = FILT121(ui4_e, ui4_f, ui4_g);
  ------------------
  |  |   46|    774|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1309|    774|    predicted_pixels[20] = FILT121(ui4_f, ui4_g, ui4_h);
  ------------------
  |  |   46|    774|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1310|    774|    predicted_pixels[21] = FILT121(ui4_g, ui4_h, ui4_i);
  ------------------
  |  |   46|    774|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1311|       |
 1312|    774|    memcpy(pu1_dst, predicted_pixels + 3, 8);
 1313|    774|    memcpy(pu1_dst + 1 * dst_strd, predicted_pixels + 14, 8);
 1314|    774|    memcpy(pu1_dst + 2 * dst_strd, predicted_pixels + 2, 8);
 1315|    774|    memcpy(pu1_dst + 3 * dst_strd, predicted_pixels + 13, 8);
 1316|    774|    memcpy(pu1_dst + 4 * dst_strd, predicted_pixels + 1, 8);
 1317|    774|    memcpy(pu1_dst + 5 * dst_strd, predicted_pixels + 12, 8);
 1318|    774|    memcpy(pu1_dst + 6 * dst_strd, predicted_pixels, 8);
 1319|    774|    memcpy(pu1_dst + 7 * dst_strd, predicted_pixels + 11, 8);
 1320|    774|}
ih264_intra_pred_luma_8x8_mode_horz_d:
 1359|  2.51k|{
 1360|  2.51k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
 1361|  2.51k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
 1362|  2.51k|    UWORD8 *pu1_topleft = NULL; /* Pointer to start of top left predictors */
 1363|  2.51k|    UWORD32 ui4_a;
 1364|  2.51k|    UWORD32 ui4_b, ui4_c, ui4_d, ui4_e, ui4_f, ui4_g, ui4_h, ui4_i;
 1365|  2.51k|    UWORD32 ui4_j, ui4_k, ui4_l, ui4_m, ui4_n, ui4_o, ui4_p;
 1366|  2.51k|    UWORD8 predicted_pixels[22];
 1367|       |
 1368|  2.51k|    UNUSED(src_strd);
  ------------------
  |  |   45|  2.51k|#define UNUSED(x) ((void)(x))
  ------------------
 1369|  2.51k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  2.51k|#define UNUSED(x) ((void)(x))
  ------------------
 1370|  2.51k|    pu1_top = pu1_src + BLK8x8SIZE + 1;
  ------------------
  |  |  510|  2.51k|#define BLK8x8SIZE          8
  ------------------
 1371|  2.51k|    pu1_left = pu1_src + BLK8x8SIZE - 1;
  ------------------
  |  |  510|  2.51k|#define BLK8x8SIZE          8
  ------------------
 1372|  2.51k|    pu1_topleft = pu1_src + BLK8x8SIZE;
  ------------------
  |  |  510|  2.51k|#define BLK8x8SIZE          8
  ------------------
 1373|       |
 1374|  2.51k|    ui4_a = *pu1_topleft;
 1375|  2.51k|    ui4_j = *pu1_top++;
 1376|  2.51k|    ui4_k = *pu1_top++;
 1377|  2.51k|    ui4_l = *pu1_top++;
 1378|  2.51k|    ui4_m = *pu1_top++;
 1379|  2.51k|    ui4_n = *pu1_top++;
 1380|  2.51k|    ui4_o = *pu1_top++;
 1381|  2.51k|    ui4_p = *pu1_top++;
 1382|  2.51k|    ui4_b = *pu1_left--;
 1383|  2.51k|    ui4_c = *pu1_left--;
 1384|  2.51k|    ui4_d = *pu1_left--;
 1385|  2.51k|    ui4_e = *pu1_left--;
 1386|  2.51k|    ui4_f = *pu1_left--;
 1387|  2.51k|    ui4_g = *pu1_left--;
 1388|  2.51k|    ui4_h = *pu1_left--;
 1389|  2.51k|    ui4_i = *pu1_left;
 1390|       |
 1391|  2.51k|    predicted_pixels[0] = FILT11(ui4_h, ui4_i);
  ------------------
  |  |   49|  2.51k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1392|  2.51k|    predicted_pixels[1] = FILT121(ui4_g, ui4_h, ui4_i);
  ------------------
  |  |   46|  2.51k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1393|  2.51k|    predicted_pixels[2] = FILT11(ui4_g, ui4_h);
  ------------------
  |  |   49|  2.51k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1394|  2.51k|    predicted_pixels[3] = FILT121(ui4_f, ui4_g, ui4_h);
  ------------------
  |  |   46|  2.51k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1395|  2.51k|    predicted_pixels[4] = FILT11(ui4_f, ui4_g);
  ------------------
  |  |   49|  2.51k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1396|  2.51k|    predicted_pixels[5] = FILT121(ui4_e, ui4_f, ui4_g);
  ------------------
  |  |   46|  2.51k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1397|  2.51k|    predicted_pixels[6] = FILT11(ui4_e, ui4_f);
  ------------------
  |  |   49|  2.51k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1398|  2.51k|    predicted_pixels[7] = FILT121(ui4_d, ui4_e, ui4_f);
  ------------------
  |  |   46|  2.51k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1399|  2.51k|    predicted_pixels[8] = FILT11(ui4_d, ui4_e);
  ------------------
  |  |   49|  2.51k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1400|  2.51k|    predicted_pixels[9] = FILT121(ui4_c, ui4_d, ui4_e);
  ------------------
  |  |   46|  2.51k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1401|  2.51k|    predicted_pixels[10] = FILT11(ui4_c, ui4_d);
  ------------------
  |  |   49|  2.51k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1402|  2.51k|    predicted_pixels[11] = FILT121(ui4_b, ui4_c, ui4_d);
  ------------------
  |  |   46|  2.51k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1403|  2.51k|    predicted_pixels[12] = FILT11(ui4_b, ui4_c);
  ------------------
  |  |   49|  2.51k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1404|  2.51k|    predicted_pixels[13] = FILT121(ui4_a, ui4_b, ui4_c);
  ------------------
  |  |   46|  2.51k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1405|  2.51k|    predicted_pixels[14] = FILT11(ui4_a, ui4_b);
  ------------------
  |  |   49|  2.51k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1406|  2.51k|    predicted_pixels[15] = FILT121(ui4_j, ui4_a, ui4_b);
  ------------------
  |  |   46|  2.51k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1407|  2.51k|    predicted_pixels[16] = FILT121(ui4_k, ui4_j, ui4_a);
  ------------------
  |  |   46|  2.51k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1408|  2.51k|    predicted_pixels[17] = FILT121(ui4_l, ui4_k, ui4_j);
  ------------------
  |  |   46|  2.51k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1409|  2.51k|    predicted_pixels[18] = FILT121(ui4_m, ui4_l, ui4_k);
  ------------------
  |  |   46|  2.51k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1410|  2.51k|    predicted_pixels[19] = FILT121(ui4_n, ui4_m, ui4_l);
  ------------------
  |  |   46|  2.51k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1411|  2.51k|    predicted_pixels[20] = FILT121(ui4_o, ui4_n, ui4_m);
  ------------------
  |  |   46|  2.51k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1412|  2.51k|    predicted_pixels[21] = FILT121(ui4_p, ui4_o, ui4_n);
  ------------------
  |  |   46|  2.51k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1413|       |
 1414|  2.51k|    memcpy(pu1_dst, predicted_pixels + 14, 8);
 1415|  2.51k|    memcpy(pu1_dst + dst_strd, predicted_pixels + 12, 8);
 1416|  2.51k|    memcpy(pu1_dst + 2 * dst_strd, predicted_pixels + 10, 8);
 1417|  2.51k|    memcpy(pu1_dst + 3 * dst_strd, predicted_pixels + 8, 8);
 1418|  2.51k|    memcpy(pu1_dst + 4 * dst_strd, predicted_pixels + 6, 8);
 1419|  2.51k|    memcpy(pu1_dst + 5 * dst_strd, predicted_pixels + 4, 8);
 1420|  2.51k|    memcpy(pu1_dst + 6 * dst_strd, predicted_pixels + 2, 8);
 1421|  2.51k|    memcpy(pu1_dst + 7 * dst_strd, predicted_pixels, 8);
 1422|  2.51k|}
ih264_intra_pred_luma_8x8_mode_vert_l:
 1462|  3.25k|{
 1463|  3.25k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
 1464|  3.25k|    UWORD32 ui4_a, ui4_b, ui4_c, ui4_d, ui4_e, ui4_f, ui4_g, ui4_h;
 1465|  3.25k|    UWORD32 ui4_i, ui4_j, ui4_k, ui4_l, ui4_m;
 1466|  3.25k|    UWORD8 predicted_pixels[22];
 1467|       |
 1468|  3.25k|    UNUSED(src_strd);
  ------------------
  |  |   45|  3.25k|#define UNUSED(x) ((void)(x))
  ------------------
 1469|  3.25k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  3.25k|#define UNUSED(x) ((void)(x))
  ------------------
 1470|  3.25k|    pu1_top = pu1_src + BLK8x8SIZE + 1;
  ------------------
  |  |  510|  3.25k|#define BLK8x8SIZE          8
  ------------------
 1471|       |
 1472|  3.25k|    ui4_a = *pu1_top++;
 1473|  3.25k|    ui4_b = *pu1_top++;
 1474|  3.25k|    ui4_c = *pu1_top++;
 1475|  3.25k|    ui4_d = *pu1_top++;
 1476|  3.25k|    ui4_e = *pu1_top++;
 1477|  3.25k|    ui4_f = *pu1_top++;
 1478|  3.25k|    ui4_g = *pu1_top++;
 1479|  3.25k|    ui4_h = *pu1_top++;
 1480|  3.25k|    ui4_i = *pu1_top++;
 1481|  3.25k|    ui4_j = *pu1_top++;
 1482|  3.25k|    ui4_k = *pu1_top++;
 1483|  3.25k|    ui4_l = *pu1_top++;
 1484|  3.25k|    ui4_m = *pu1_top++;
 1485|       |
 1486|  3.25k|    predicted_pixels[0] = FILT11(ui4_a, ui4_b);
  ------------------
  |  |   49|  3.25k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1487|  3.25k|    predicted_pixels[1] = FILT11(ui4_b, ui4_c);
  ------------------
  |  |   49|  3.25k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1488|  3.25k|    predicted_pixels[2] = FILT11(ui4_c, ui4_d);
  ------------------
  |  |   49|  3.25k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1489|  3.25k|    predicted_pixels[3] = FILT11(ui4_d, ui4_e);
  ------------------
  |  |   49|  3.25k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1490|  3.25k|    predicted_pixels[4] = FILT11(ui4_e, ui4_f);
  ------------------
  |  |   49|  3.25k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1491|  3.25k|    predicted_pixels[5] = FILT11(ui4_f, ui4_g);
  ------------------
  |  |   49|  3.25k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1492|  3.25k|    predicted_pixels[6] = FILT11(ui4_g, ui4_h);
  ------------------
  |  |   49|  3.25k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1493|  3.25k|    predicted_pixels[7] = FILT11(ui4_h, ui4_i);
  ------------------
  |  |   49|  3.25k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1494|  3.25k|    predicted_pixels[8] = FILT11(ui4_i, ui4_j);
  ------------------
  |  |   49|  3.25k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1495|  3.25k|    predicted_pixels[9] = FILT11(ui4_j, ui4_k);
  ------------------
  |  |   49|  3.25k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1496|  3.25k|    predicted_pixels[10] = FILT11(ui4_k, ui4_l);
  ------------------
  |  |   49|  3.25k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1497|  3.25k|    predicted_pixels[11] = FILT121(ui4_a, ui4_b, ui4_c);
  ------------------
  |  |   46|  3.25k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1498|  3.25k|    predicted_pixels[12] = FILT121(ui4_b, ui4_c, ui4_d);
  ------------------
  |  |   46|  3.25k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1499|  3.25k|    predicted_pixels[13] = FILT121(ui4_c, ui4_d, ui4_e);
  ------------------
  |  |   46|  3.25k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1500|  3.25k|    predicted_pixels[14] = FILT121(ui4_d, ui4_e, ui4_f);
  ------------------
  |  |   46|  3.25k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1501|  3.25k|    predicted_pixels[15] = FILT121(ui4_e, ui4_f, ui4_g);
  ------------------
  |  |   46|  3.25k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1502|  3.25k|    predicted_pixels[16] = FILT121(ui4_f, ui4_g, ui4_h);
  ------------------
  |  |   46|  3.25k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1503|  3.25k|    predicted_pixels[17] = FILT121(ui4_g, ui4_h, ui4_i);
  ------------------
  |  |   46|  3.25k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1504|  3.25k|    predicted_pixels[18] = FILT121(ui4_h, ui4_i, ui4_j);
  ------------------
  |  |   46|  3.25k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1505|  3.25k|    predicted_pixels[19] = FILT121(ui4_i, ui4_j, ui4_k);
  ------------------
  |  |   46|  3.25k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1506|  3.25k|    predicted_pixels[20] = FILT121(ui4_j, ui4_k, ui4_l);
  ------------------
  |  |   46|  3.25k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1507|  3.25k|    predicted_pixels[21] = FILT121(ui4_k, ui4_l, ui4_m);
  ------------------
  |  |   46|  3.25k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1508|       |
 1509|  3.25k|    memcpy(pu1_dst, predicted_pixels, 8);
 1510|  3.25k|    memcpy(pu1_dst + 2 * dst_strd, predicted_pixels + 1, 8);
 1511|  3.25k|    memcpy(pu1_dst + 4 * dst_strd, predicted_pixels + 2, 8);
 1512|  3.25k|    memcpy(pu1_dst + 6 * dst_strd, predicted_pixels + 3, 8);
 1513|  3.25k|    memcpy(pu1_dst + 1 * dst_strd, predicted_pixels + 11, 8);
 1514|  3.25k|    memcpy(pu1_dst + 3 * dst_strd, predicted_pixels + 12, 8);
 1515|  3.25k|    memcpy(pu1_dst + 5 * dst_strd, predicted_pixels + 13, 8);
 1516|  3.25k|    memcpy(pu1_dst + 7 * dst_strd, predicted_pixels + 14, 8);
 1517|  3.25k|}
ih264_intra_pred_luma_8x8_mode_horz_u:
 1556|  7.14k|{
 1557|  7.14k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
 1558|  7.14k|    UWORD32 ui4_j, ui4_k, ui4_l, ui4_m, ui4_n, ui4_o, ui4_p, ui4_q;
 1559|  7.14k|    UWORD8 predicted_pixels[22];
 1560|       |
 1561|  7.14k|    UNUSED(src_strd);
  ------------------
  |  |   45|  7.14k|#define UNUSED(x) ((void)(x))
  ------------------
 1562|  7.14k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  7.14k|#define UNUSED(x) ((void)(x))
  ------------------
 1563|  7.14k|    pu1_left = pu1_src + BLK8x8SIZE - 1;
  ------------------
  |  |  510|  7.14k|#define BLK8x8SIZE          8
  ------------------
 1564|       |
 1565|  7.14k|    ui4_j = *pu1_left--;
 1566|  7.14k|    ui4_k = *pu1_left--;
 1567|  7.14k|    ui4_l = *pu1_left--;
 1568|  7.14k|    ui4_m = *pu1_left--;
 1569|  7.14k|    ui4_n = *pu1_left--;
 1570|  7.14k|    ui4_o = *pu1_left--;
 1571|  7.14k|    ui4_p = *pu1_left--;
 1572|  7.14k|    ui4_q = *pu1_left;
 1573|       |
 1574|  7.14k|    pu1_left = pu1_src + BLK8x8SIZE - 1;
  ------------------
  |  |  510|  7.14k|#define BLK8x8SIZE          8
  ------------------
 1575|       |
 1576|  7.14k|    predicted_pixels[0] = FILT11(ui4_j, ui4_k);
  ------------------
  |  |   49|  7.14k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1577|  7.14k|    predicted_pixels[1] = FILT121(ui4_j, ui4_k, ui4_l);
  ------------------
  |  |   46|  7.14k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1578|  7.14k|    predicted_pixels[2] = FILT11(ui4_k, ui4_l);
  ------------------
  |  |   49|  7.14k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1579|  7.14k|    predicted_pixels[3] = FILT121(ui4_k, ui4_l, ui4_m);
  ------------------
  |  |   46|  7.14k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1580|  7.14k|    predicted_pixels[4] = FILT11(ui4_l, ui4_m);
  ------------------
  |  |   49|  7.14k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1581|  7.14k|    predicted_pixels[5] = FILT121(ui4_l, ui4_m, ui4_n);
  ------------------
  |  |   46|  7.14k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1582|  7.14k|    predicted_pixels[6] = FILT11(ui4_m, ui4_n);
  ------------------
  |  |   49|  7.14k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1583|  7.14k|    predicted_pixels[7] = FILT121(ui4_m, ui4_n, ui4_o);
  ------------------
  |  |   46|  7.14k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1584|  7.14k|    predicted_pixels[8] = FILT11(ui4_n, ui4_o);
  ------------------
  |  |   49|  7.14k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1585|  7.14k|    predicted_pixels[9] = FILT121(ui4_n, ui4_o, ui4_p);
  ------------------
  |  |   46|  7.14k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1586|  7.14k|    predicted_pixels[10] = FILT11(ui4_o, ui4_p);
  ------------------
  |  |   49|  7.14k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1587|  7.14k|    predicted_pixels[11] = FILT121(ui4_o, ui4_p, ui4_q);
  ------------------
  |  |   46|  7.14k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1588|  7.14k|    predicted_pixels[12] = FILT11(ui4_p, ui4_q);
  ------------------
  |  |   49|  7.14k|#define FILT11(a,b) ((a + b + 1) >> 1)
  ------------------
 1589|  7.14k|    predicted_pixels[13] = FILT121(ui4_p, ui4_q, ui4_q);
  ------------------
  |  |   46|  7.14k|#define FILT121(a,b,c) ((a + (b << 1) + c + 2) >> 2)
  ------------------
 1590|  7.14k|    memset(predicted_pixels+14,ui4_q,8);
 1591|       |
 1592|  7.14k|    memcpy(pu1_dst, predicted_pixels, 8);
 1593|  7.14k|    memcpy(pu1_dst + 1 * dst_strd, predicted_pixels + 2, 8);
 1594|  7.14k|    memcpy(pu1_dst + 2 * dst_strd, predicted_pixels + 4, 8);
 1595|  7.14k|    memcpy(pu1_dst + 3 * dst_strd, predicted_pixels + 6, 8);
 1596|  7.14k|    memcpy(pu1_dst + 4 * dst_strd, predicted_pixels + 8, 8);
 1597|  7.14k|    memcpy(pu1_dst + 5 * dst_strd, predicted_pixels + 10, 8);
 1598|  7.14k|    memcpy(pu1_dst + 6 * dst_strd, predicted_pixels + 12, 8);
 1599|  7.14k|    memcpy(pu1_dst + 7 * dst_strd, predicted_pixels + 14, 8);
 1600|  7.14k|}
ih264_intra_pred_luma_16x16_mode_vert:
 1639|  20.7k|{
 1640|  20.7k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
 1641|  20.7k|    WORD32 rows; /* loop variables*/
 1642|       |
 1643|  20.7k|    UNUSED(src_strd);
  ------------------
  |  |   45|  20.7k|#define UNUSED(x) ((void)(x))
  ------------------
 1644|  20.7k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  20.7k|#define UNUSED(x) ((void)(x))
  ------------------
 1645|  20.7k|    pu1_top = pu1_src + MB_SIZE + 1;
  ------------------
  |  |  509|  20.7k|#define MB_SIZE             16
  ------------------
 1646|   103k|    for(rows = 0; rows < 16; rows += 4, pu1_dst += dst_strd)
  ------------------
  |  Branch (1646:19): [True: 83.0k, False: 20.7k]
  ------------------
 1647|  83.0k|    {
 1648|  83.0k|        memcpy(pu1_dst, pu1_top, 16);
 1649|  83.0k|        pu1_dst += dst_strd;
 1650|  83.0k|        memcpy(pu1_dst, pu1_top, 16);
 1651|  83.0k|        pu1_dst += dst_strd;
 1652|  83.0k|        memcpy(pu1_dst, pu1_top, 16);
 1653|  83.0k|        pu1_dst += dst_strd;
 1654|  83.0k|        memcpy(pu1_dst, pu1_top, 16);
 1655|  83.0k|    }
 1656|  20.7k|}
ih264_intra_pred_luma_16x16_mode_horz:
 1695|  9.97k|{
 1696|  9.97k|    UWORD8 *pu1_left = NULL; /* Pointer to start of top predictors */
 1697|  9.97k|    WORD32 rows;
 1698|       |
 1699|  9.97k|    UNUSED(src_strd);
  ------------------
  |  |   45|  9.97k|#define UNUSED(x) ((void)(x))
  ------------------
 1700|  9.97k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  9.97k|#define UNUSED(x) ((void)(x))
  ------------------
 1701|  9.97k|    pu1_left = pu1_src + MB_SIZE - 1;
  ------------------
  |  |  509|  9.97k|#define MB_SIZE             16
  ------------------
 1702|  49.8k|    for(rows = 0; rows < 16; rows += 4, pu1_dst += dst_strd, pu1_left --)
  ------------------
  |  Branch (1702:19): [True: 39.9k, False: 9.97k]
  ------------------
 1703|  39.9k|    {
 1704|  39.9k|        memset(pu1_dst, *pu1_left, 16); /* copy the left value to the entire row*/
 1705|  39.9k|        pu1_left --;
 1706|  39.9k|        pu1_dst += dst_strd;
 1707|  39.9k|        memset(pu1_dst, *pu1_left, 16);
 1708|  39.9k|        pu1_left --;
 1709|  39.9k|        pu1_dst += dst_strd;
 1710|  39.9k|        memset(pu1_dst, *pu1_left, 16);
 1711|  39.9k|        pu1_left --;
 1712|  39.9k|        pu1_dst += dst_strd;
 1713|  39.9k|        memset(pu1_dst, *pu1_left, 16);
 1714|  39.9k|    }
 1715|  9.97k|}
ih264_intra_pred_luma_16x16_mode_dc:
 1753|  18.5k|{
 1754|  18.5k|    WORD8 u1_useleft; /* availability of left predictors (only for DC) */
 1755|  18.5k|    UWORD8 u1_usetop; /* availability of top predictors (only for DC) */
 1756|  18.5k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
 1757|  18.5k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
 1758|  18.5k|    WORD32 rows; /* loop variables*/
 1759|  18.5k|    WORD32 val = 0;
 1760|       |
 1761|  18.5k|    UNUSED(src_strd);
  ------------------
  |  |   45|  18.5k|#define UNUSED(x) ((void)(x))
  ------------------
 1762|  18.5k|    u1_useleft = BOOLEAN(ngbr_avail & LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|  18.5k|#define BOOLEAN(x) (!!(x))
  ------------------
 1763|  18.5k|    u1_usetop = BOOLEAN(ngbr_avail & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|  18.5k|#define BOOLEAN(x) (!!(x))
  ------------------
 1764|  18.5k|    pu1_top = pu1_src + MB_SIZE + 1;
  ------------------
  |  |  509|  18.5k|#define MB_SIZE             16
  ------------------
 1765|  18.5k|    pu1_left = pu1_src + MB_SIZE - 1;
  ------------------
  |  |  509|  18.5k|#define MB_SIZE             16
  ------------------
 1766|  18.5k|    if(u1_useleft)
  ------------------
  |  Branch (1766:8): [True: 13.6k, False: 4.94k]
  ------------------
 1767|  13.6k|    {
 1768|   231k|        for(rows = 0; rows < 16; rows++)
  ------------------
  |  Branch (1768:23): [True: 218k, False: 13.6k]
  ------------------
 1769|   218k|            val += *(pu1_left - rows);
 1770|  13.6k|        val += 8;
 1771|  13.6k|    }
 1772|  18.5k|    if(u1_usetop)
  ------------------
  |  Branch (1772:8): [True: 12.7k, False: 5.84k]
  ------------------
 1773|  12.7k|    {
 1774|   216k|        for(rows = 0; rows < 16; rows++)
  ------------------
  |  Branch (1774:23): [True: 203k, False: 12.7k]
  ------------------
 1775|   203k|            val += *(pu1_top + rows);
 1776|  12.7k|        val += 8;
 1777|  12.7k|    }
 1778|       |    /* Since 8 is added if either left/top pred is there,
 1779|       |     val still being zero implies both preds are not there */
 1780|  18.5k|    val = (val) ? (val >> (3 + u1_useleft + u1_usetop)) : 128;
  ------------------
  |  Branch (1780:11): [True: 17.0k, False: 1.54k]
  ------------------
 1781|       |
 1782|  92.9k|    for(rows = 0; rows < 16; rows += 4, pu1_dst += dst_strd)
  ------------------
  |  Branch (1782:19): [True: 74.3k, False: 18.5k]
  ------------------
 1783|  74.3k|    {
 1784|  74.3k|        memset(pu1_dst, val, 16);
 1785|  74.3k|        pu1_dst += dst_strd;
 1786|  74.3k|        memset(pu1_dst, val, 16);
 1787|  74.3k|        pu1_dst += dst_strd;
 1788|  74.3k|        memset(pu1_dst, val, 16);
 1789|  74.3k|        pu1_dst += dst_strd;
 1790|  74.3k|        memset(pu1_dst, val, 16);
 1791|  74.3k|    }
 1792|  18.5k|}
ih264_intra_pred_luma_16x16_mode_plane:
 1830|  2.70k|{
 1831|       |    /*! Written with no multiplications */
 1832|  2.70k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
 1833|  2.70k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
 1834|  2.70k|    UWORD8 *pu1_topleft = NULL;
 1835|  2.70k|    WORD32 a, b, c, tmp;
 1836|  2.70k|    UWORD8 *pu1_tmp1, *pu1_tmp2;
 1837|  2.70k|    WORD32 shift;
 1838|       |
 1839|  2.70k|    UNUSED(src_strd);
  ------------------
  |  |   45|  2.70k|#define UNUSED(x) ((void)(x))
  ------------------
 1840|  2.70k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  2.70k|#define UNUSED(x) ((void)(x))
  ------------------
 1841|  2.70k|    pu1_top = pu1_src + MB_SIZE + 1;
  ------------------
  |  |  509|  2.70k|#define MB_SIZE             16
  ------------------
 1842|  2.70k|    pu1_left = pu1_src + MB_SIZE - 1;
  ------------------
  |  |  509|  2.70k|#define MB_SIZE             16
  ------------------
 1843|  2.70k|    pu1_topleft = pu1_src + MB_SIZE;
  ------------------
  |  |  509|  2.70k|#define MB_SIZE             16
  ------------------
 1844|       |
 1845|  2.70k|    {
 1846|  2.70k|        a = (*(pu1_top + 15) + *(pu1_left - 15)) << 4;
 1847|       |
 1848|       |        /*! Implement Sum(x*(P((x+7),-1) - P((x-7),-1))) x=1...8 */
 1849|  2.70k|        pu1_tmp1 = pu1_top + 8;
 1850|  2.70k|        pu1_tmp2 = pu1_tmp1 - 2;
 1851|       |
 1852|       |        /* Pixel diffs are only 9 bits;
 1853|       |         so sign extension allows shifts to be used even for signed */
 1854|  2.70k|        b = ((*pu1_tmp1++) - (*pu1_tmp2--)); /* x=1 */
 1855|  2.70k|        b += ((*pu1_tmp1++) - (*pu1_tmp2--)) << 1; /* x=2 */
 1856|  2.70k|        tmp = ((*pu1_tmp1++) - (*pu1_tmp2--));
 1857|  2.70k|        b += (tmp << 1) + tmp; /* x=3 */
 1858|  2.70k|        b += ((*pu1_tmp1++) - (*pu1_tmp2--)) << 2; /* x=4 */
 1859|       |
 1860|  2.70k|        tmp = ((*pu1_tmp1++) - (*pu1_tmp2--));
 1861|  2.70k|        b += (tmp << 2) + tmp; /* x=5 */
 1862|  2.70k|        tmp = ((*pu1_tmp1++) - (*pu1_tmp2--));
 1863|  2.70k|        b += (tmp << 2) + (tmp << 1); /* x=6 */
 1864|  2.70k|        tmp = ((*pu1_tmp1++) - (*pu1_tmp2--));
 1865|  2.70k|        b += (tmp << 3) - tmp; /* x=7 */
 1866|  2.70k|        b += ((*pu1_tmp1) - (*pu1_topleft)) << 3; /* x=8 */
 1867|       |
 1868|  2.70k|        b = ((b << 2) + b + 32) >> 6; /*! (5*H + 32)>>6 */
 1869|       |
 1870|       |        /*! Implement Sum(y*(P(-1,(y+7)) - P(-1,(y-7)))) y=1...8 */
 1871|  2.70k|        pu1_tmp1 = pu1_left - 8;
 1872|  2.70k|        pu1_tmp2 = pu1_tmp1 + 2;
 1873|       |
 1874|  2.70k|        c = ((*pu1_tmp1) - (*pu1_tmp2)); /* y=1 */
 1875|  2.70k|        pu1_tmp1--;
 1876|  2.70k|        pu1_tmp2++;
 1877|  2.70k|        c += ((*pu1_tmp1) - (*pu1_tmp2)) << 1; /* y=2 */
 1878|  2.70k|        pu1_tmp1--;
 1879|  2.70k|        pu1_tmp2++;
 1880|  2.70k|        tmp = ((*pu1_tmp1) - (*pu1_tmp2));
 1881|  2.70k|        c += (tmp << 1) + tmp; /* y=3 */
 1882|  2.70k|        pu1_tmp1--;
 1883|  2.70k|        pu1_tmp2++;
 1884|  2.70k|        c += ((*pu1_tmp1) - (*pu1_tmp2)) << 2; /* y=4 */
 1885|  2.70k|        pu1_tmp1--;
 1886|  2.70k|        pu1_tmp2++;
 1887|       |
 1888|  2.70k|        tmp = ((*pu1_tmp1) - (*pu1_tmp2));
 1889|  2.70k|        c += (tmp << 2) + tmp; /* y=5 */
 1890|  2.70k|        pu1_tmp1--;
 1891|  2.70k|        pu1_tmp2++;
 1892|  2.70k|        tmp = ((*pu1_tmp1) - (*pu1_tmp2));
 1893|  2.70k|        c += (tmp << 2) + (tmp << 1); /* y=6 */
 1894|  2.70k|        pu1_tmp1--;
 1895|  2.70k|        pu1_tmp2++;
 1896|  2.70k|        tmp = ((*pu1_tmp1) - (*pu1_tmp2));
 1897|  2.70k|        c += (tmp << 3) - tmp; /* y=7 */
 1898|  2.70k|        pu1_tmp1--; //pu1_tmp2 ++;
 1899|       |        /* Modified to get (-1,-1) location as *(pu1_top - 1) instead of (pu1_left - ui4_stride) */
 1900|       |        //c += ((*pu1_tmp1) - (*(pu1_top - 1)))<<3;      /* y=8 */
 1901|  2.70k|        c += ((*pu1_tmp1) - (*pu1_topleft)) << 3; /* y=8 */
 1902|       |
 1903|  2.70k|        c = ((c << 2) + c + 32) >> 6; /*! (5*V + 32)>>32 */
 1904|  2.70k|        shift = 3;
 1905|  2.70k|    }
 1906|       |
 1907|       |    /*! Now from the plane parameters a, b, and c,
 1908|       |     compute the fitted plane values over the block */
 1909|  2.70k|    {
 1910|  2.70k|        WORD32 tmp1, tmpx, tmpx_init, j, i;
 1911|       |
 1912|  2.70k|        tmpx_init = -(b << shift); /* -8b */
 1913|  2.70k|        tmp = a - (c << shift) + 16; /* a-((4or8)*c)+16 */
 1914|  45.9k|        for(i = 0; i < 16; i++)
  ------------------
  |  Branch (1914:20): [True: 43.2k, False: 2.70k]
  ------------------
 1915|  43.2k|        {
 1916|  43.2k|            tmp += c; /*increment every time by c to get c*(y-7or3)*/
 1917|  43.2k|            tmpx = tmpx_init; /* Init to -8b */
 1918|   734k|            for(j = 0; j < 16; j++)
  ------------------
  |  Branch (1918:24): [True: 691k, False: 43.2k]
  ------------------
 1919|   691k|            {
 1920|   691k|                tmpx += b; /* increment every time by b to get b*(x-7or3) */
 1921|   691k|                tmp1 = (tmp + tmpx) >> 5;
 1922|   691k|                *pu1_dst++ = CLIP_U8(tmp1);
  ------------------
  |  |   58|   691k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   691k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 17.4k, False: 673k]
  |  |  |  |  |  Branch (77:54): [True: 5.12k, False: 668k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1923|   691k|            }
 1924|  43.2k|            pu1_dst += (dst_strd - 16);
 1925|  43.2k|        }
 1926|  2.70k|    }
 1927|  2.70k|}

ih264_pad_top:
   94|   224k|{
   95|   224k|    WORD32 row;
   96|       |
   97|  3.37M|    for(row = 1; row <= pad_size; row++)
  ------------------
  |  Branch (97:18): [True: 3.14M, False: 224k]
  ------------------
   98|  3.14M|    {
   99|  3.14M|        memcpy(pu1_src - row * src_strd, pu1_src, wd);
  100|  3.14M|    }
  101|   224k|}
ih264_pad_bottom:
  133|   224k|{
  134|   224k|    WORD32 row;
  135|       |
  136|  3.37M|    for(row = 1; row <= pad_size; row++)
  ------------------
  |  Branch (136:18): [True: 3.14M, False: 224k]
  ------------------
  137|  3.14M|    {
  138|  3.14M|        memcpy(pu1_src + (row - 1) * src_strd, pu1_src - 1 * src_strd, wd);
  139|  3.14M|    }
  140|   224k|}
ih264_pad_left_luma:
  172|  40.2k|{
  173|  40.2k|    WORD32 row;
  174|       |
  175|  10.4M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (175:18): [True: 10.4M, False: 40.2k]
  ------------------
  176|  10.4M|    {
  177|  10.4M|        memset(pu1_src - pad_size, *pu1_src, pad_size);
  178|  10.4M|        pu1_src += src_strd;
  179|  10.4M|    }
  180|  40.2k|}
ih264_pad_left_chroma:
  212|  40.2k|{
  213|  40.2k|    WORD32 row, col;
  214|  40.2k|    UWORD16 u2_uv_val;
  215|  40.2k|    UWORD16 *pu2_src = (UWORD16 *)pu1_src;
  216|       |
  217|  40.2k|    src_strd >>= 1;
  218|  40.2k|    pad_size >>= 1;
  219|       |
  220|  5.25M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (220:18): [True: 5.21M, False: 40.2k]
  ------------------
  221|  5.21M|    {
  222|  5.21M|        u2_uv_val = pu2_src[0];
  223|  88.5M|        for(col = -pad_size; col < 0; col++)
  ------------------
  |  Branch (223:30): [True: 83.3M, False: 5.21M]
  ------------------
  224|  83.3M|        {
  225|  83.3M|            pu2_src[col] = u2_uv_val;
  226|  83.3M|        }
  227|  5.21M|        pu2_src += src_strd;
  228|  5.21M|    }
  229|  40.2k|}
ih264_pad_right_luma:
  261|  40.2k|{
  262|  40.2k|    WORD32 row;
  263|       |
  264|  10.4M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (264:18): [True: 10.4M, False: 40.2k]
  ------------------
  265|  10.4M|    {
  266|  10.4M|        memset(pu1_src, *(pu1_src -1), pad_size);
  267|  10.4M|        pu1_src += src_strd;
  268|  10.4M|    }
  269|  40.2k|}
ih264_pad_right_chroma:
  301|  40.2k|{
  302|  40.2k|    WORD32 row, col;
  303|  40.2k|    UWORD16 u2_uv_val;
  304|  40.2k|    UWORD16 *pu2_src = (UWORD16 *)pu1_src;
  305|       |
  306|  40.2k|    src_strd >>= 1;
  307|  40.2k|    pad_size >>= 1;
  308|       |
  309|  5.25M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (309:18): [True: 5.21M, False: 40.2k]
  ------------------
  310|  5.21M|    {
  311|  5.21M|        u2_uv_val = pu2_src[-1];
  312|  88.5M|        for(col = 0; col < pad_size; col++)
  ------------------
  |  Branch (312:22): [True: 83.3M, False: 5.21M]
  ------------------
  313|  83.3M|        {
  314|  83.3M|            pu2_src[col] = u2_uv_val;
  315|  83.3M|        }
  316|  5.21M|        pu2_src += src_strd;
  317|  5.21M|    }
  318|  40.2k|}

ih264_default_weighted_pred_luma:
  110|  78.6k|{
  111|  78.6k|    WORD32 i, j;
  112|       |
  113|  78.6k|    src_strd1 -= wd;
  114|  78.6k|    src_strd2 -= wd;
  115|  78.6k|    dst_strd -= wd;
  116|       |
  117|  1.20M|    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (117:16): [True: 1.13M, False: 78.6k]
  ------------------
  118|  1.13M|    {
  119|  17.9M|        for(j = 0; j < wd; j++, pu1_src1++, pu1_src2++, pu1_dst++)
  ------------------
  |  Branch (119:20): [True: 16.8M, False: 1.13M]
  ------------------
  120|  16.8M|            *pu1_dst = (*pu1_src1 + *pu1_src2 + 1) >> 1;
  121|       |
  122|  1.13M|        pu1_src1 += src_strd1;
  123|  1.13M|        pu1_src2 += src_strd2;
  124|  1.13M|        pu1_dst += dst_strd;
  125|  1.13M|    }
  126|  78.6k|}
ih264_default_weighted_pred_chroma:
  178|  78.6k|{
  179|  78.6k|    WORD32 i, j;
  180|       |
  181|  78.6k|    wd = wd << 1;
  182|       |
  183|  78.6k|    src_strd1 -= wd;
  184|  78.6k|    src_strd2 -= wd;
  185|  78.6k|    dst_strd -= wd;
  186|       |
  187|   643k|    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (187:16): [True: 565k, False: 78.6k]
  ------------------
  188|   565k|    {
  189|  8.99M|        for(j = 0; j < wd; j++, pu1_src1++, pu1_src2++, pu1_dst++)
  ------------------
  |  Branch (189:20): [True: 8.43M, False: 565k]
  ------------------
  190|  8.43M|            *pu1_dst = (*pu1_src1 + *pu1_src2 + 1) >> 1;
  191|       |
  192|   565k|        pu1_src1 += src_strd1;
  193|   565k|        pu1_src2 += src_strd2;
  194|   565k|        pu1_dst += dst_strd;
  195|   565k|    }
  196|  78.6k|}
ih264_weighted_pred_luma:
  252|  1.31M|{
  253|  1.31M|    WORD32 i, j;
  254|       |
  255|  1.31M|    wt = (WORD16)(wt & 0xffff);
  256|  1.31M|    ofst = (WORD8)(ofst & 0xff);
  257|       |
  258|  1.31M|    src_strd -= wd;
  259|  1.31M|    dst_strd -= wd;
  260|       |
  261|  1.31M|    if(log_wd >= 1)
  ------------------
  |  Branch (261:8): [True: 451k, False: 862k]
  ------------------
  262|   451k|    {
  263|   451k|        WORD32 i_ofst = (1 << (log_wd - 1)) + (ofst << log_wd);
  264|  7.47M|        for(i = 0; i < ht; i++)
  ------------------
  |  Branch (264:20): [True: 7.02M, False: 451k]
  ------------------
  265|  7.02M|        {
  266|   117M|            for(j = 0; j < wd; j++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (266:24): [True: 110M, False: 7.02M]
  ------------------
  267|   110M|                *pu1_dst = CLIP_U8((wt * (*pu1_src) + i_ofst) >> log_wd);
  ------------------
  |  |   58|   110M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   110M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 23.8M, False: 86.4M]
  |  |  |  |  |  Branch (77:54): [True: 32.6k, False: 86.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  268|       |
  269|  7.02M|            pu1_src += src_strd;
  270|  7.02M|            pu1_dst += dst_strd;
  271|  7.02M|        }
  272|   451k|    }
  273|   862k|    else
  274|   862k|    {
  275|  14.4M|        for(i = 0; i < ht; i++)
  ------------------
  |  Branch (275:20): [True: 13.6M, False: 862k]
  ------------------
  276|  13.6M|        {
  277|   230M|            for(j = 0; j < wd; j++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (277:24): [True: 216M, False: 13.6M]
  ------------------
  278|   216M|                *pu1_dst = CLIP_U8(wt * (*pu1_src) + ofst);
  ------------------
  |  |   58|   216M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   216M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 12.7M, False: 203M]
  |  |  |  |  |  Branch (77:54): [True: 90.0k, False: 203M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|       |
  280|  13.6M|            pu1_src += src_strd;
  281|  13.6M|            pu1_dst += dst_strd;
  282|  13.6M|        }
  283|   862k|    }
  284|  1.31M|}
ih264_weighted_pred_chroma:
  340|  1.31M|{
  341|  1.31M|    WORD32 i, j;
  342|  1.31M|    WORD32 wt_u, wt_v;
  343|  1.31M|    WORD32 ofst_u, ofst_v;
  344|       |
  345|  1.31M|    wt_u = (WORD16)(wt & 0xffff);
  346|  1.31M|    wt_v = (WORD16)(wt >> 16);
  347|       |
  348|  1.31M|    ofst_u = (WORD8)(ofst & 0xff);
  349|  1.31M|    ofst_v = (WORD8)(ofst >> 8);
  350|       |
  351|  1.31M|    src_strd -= wd << 1;
  352|  1.31M|    dst_strd -= wd << 1;
  353|       |
  354|  1.31M|    if(log_wd >= 1)
  ------------------
  |  Branch (354:8): [True: 429k, False: 884k]
  ------------------
  355|   429k|    {
  356|   429k|        ofst_u = (1 << (log_wd - 1)) + (ofst_u << log_wd);
  357|   429k|        ofst_v = (1 << (log_wd - 1)) + (ofst_v << log_wd);
  358|       |
  359|  3.75M|        for(i = 0; i < ht; i++)
  ------------------
  |  Branch (359:20): [True: 3.33M, False: 429k]
  ------------------
  360|  3.33M|        {
  361|  29.4M|            for(j = 0; j < wd; j++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (361:24): [True: 26.1M, False: 3.33M]
  ------------------
  362|  26.1M|            {
  363|  26.1M|                *pu1_dst = CLIP_U8((wt_u * (*pu1_src) + ofst_u) >> log_wd);
  ------------------
  |  |   58|  26.1M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  26.1M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 951k, False: 25.1M]
  |  |  |  |  |  Branch (77:54): [True: 1.21M, False: 23.9M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  364|  26.1M|                pu1_src++;
  365|  26.1M|                pu1_dst++;
  366|  26.1M|                *pu1_dst = CLIP_U8((wt_v * (*pu1_src) + ofst_v) >> log_wd);
  ------------------
  |  |   58|  26.1M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  26.1M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 974k, False: 25.1M]
  |  |  |  |  |  Branch (77:54): [True: 780k, False: 24.3M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  367|  26.1M|            }
  368|  3.33M|            pu1_src += src_strd;
  369|  3.33M|            pu1_dst += dst_strd;
  370|  3.33M|        }
  371|   429k|    }
  372|   884k|    else
  373|   884k|    {
  374|  7.87M|        for(i = 0; i < ht; i++)
  ------------------
  |  Branch (374:20): [True: 6.98M, False: 884k]
  ------------------
  375|  6.98M|        {
  376|  62.5M|            for(j = 0; j < wd; j++, pu1_src++, pu1_dst++)
  ------------------
  |  Branch (376:24): [True: 55.5M, False: 6.98M]
  ------------------
  377|  55.5M|            {
  378|  55.5M|                *pu1_dst = CLIP_U8(wt_u * (*pu1_src) + ofst_u);
  ------------------
  |  |   58|  55.5M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  55.5M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.17M, False: 54.4M]
  |  |  |  |  |  Branch (77:54): [True: 293k, False: 54.1M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  379|  55.5M|                pu1_src++;
  380|  55.5M|                pu1_dst++;
  381|  55.5M|                *pu1_dst = CLIP_U8(wt_v * (*pu1_src) + ofst_v);
  ------------------
  |  |   58|  55.5M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  55.5M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 796k, False: 54.7M]
  |  |  |  |  |  Branch (77:54): [True: 490k, False: 54.2M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  382|  55.5M|            }
  383|  6.98M|            pu1_src += src_strd;
  384|  6.98M|            pu1_dst += dst_strd;
  385|  6.98M|        }
  386|   884k|    }
  387|  1.31M|}
ih264_weighted_bi_pred_luma:
  460|   230k|{
  461|   230k|    WORD32 i, j;
  462|   230k|    WORD32 shft, ofst;
  463|       |
  464|   230k|    ofst1 = (WORD8)(ofst1 & 0xff);
  465|   230k|    ofst2 = (WORD8)(ofst2 & 0xff);
  466|   230k|    wt1 = (WORD16)(wt1 & 0xffff);
  467|   230k|    wt2 = (WORD16)(wt2 & 0xffff);
  468|   230k|    ofst = (ofst1 + ofst2 + 1) >> 1;
  469|       |
  470|   230k|    shft = log_wd + 1;
  471|   230k|    ofst = (1 << log_wd) + (ofst << shft);
  472|       |
  473|   230k|    src_strd1 -= wd;
  474|   230k|    src_strd2 -= wd;
  475|   230k|    dst_strd -= wd;
  476|       |
  477|  3.84M|    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (477:16): [True: 3.61M, False: 230k]
  ------------------
  478|  3.61M|    {
  479|  60.2M|        for(j = 0; j < wd; j++, pu1_src1++, pu1_src2++, pu1_dst++)
  ------------------
  |  Branch (479:20): [True: 56.5M, False: 3.61M]
  ------------------
  480|  56.5M|            *pu1_dst = CLIP_U8((wt1 * (*pu1_src1) + wt2 * (*pu1_src2) + ofst) >> shft);
  ------------------
  |  |   58|  56.5M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  56.5M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 13.6M, False: 42.9M]
  |  |  |  |  |  Branch (77:54): [True: 246k, False: 42.6M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  481|       |
  482|  3.61M|        pu1_src1 += src_strd1;
  483|  3.61M|        pu1_src2 += src_strd2;
  484|  3.61M|        pu1_dst += dst_strd;
  485|  3.61M|    }
  486|   230k|}
ih264_weighted_bi_pred_chroma:
  559|   230k|{
  560|   230k|    WORD32 i, j;
  561|   230k|    WORD32 wt1_u, wt1_v, wt2_u, wt2_v;
  562|   230k|    WORD32 ofst1_u, ofst1_v, ofst2_u, ofst2_v;
  563|   230k|    WORD32 ofst_u, ofst_v;
  564|   230k|    WORD32 shft;
  565|       |
  566|   230k|    ofst1_u = (WORD8)(ofst1 & 0xff);
  567|   230k|    ofst1_v = (WORD8)(ofst1 >> 8);
  568|   230k|    ofst2_u = (WORD8)(ofst2 & 0xff);
  569|   230k|    ofst2_v = (WORD8)(ofst2 >> 8);
  570|   230k|    wt1_u = (WORD16)(wt1 & 0xffff);
  571|   230k|    wt1_v = (WORD16)(wt1 >> 16);
  572|   230k|    wt2_u = (WORD16)(wt2 & 0xffff);
  573|   230k|    wt2_v = (WORD16)(wt2 >> 16);
  574|   230k|    ofst_u = (ofst1_u + ofst2_u + 1) >> 1;
  575|   230k|    ofst_v = (ofst1_v + ofst2_v + 1) >> 1;
  576|       |
  577|   230k|    src_strd1 -= wd << 1;
  578|   230k|    src_strd2 -= wd << 1;
  579|   230k|    dst_strd -= wd << 1;
  580|       |
  581|   230k|    shft = log_wd + 1;
  582|   230k|    ofst_u = (1 << log_wd) + (ofst_u << shft);
  583|   230k|    ofst_v = (1 << log_wd) + (ofst_v << shft);
  584|       |
  585|  2.03M|    for(i = 0; i < ht; i++)
  ------------------
  |  Branch (585:16): [True: 1.80M, False: 230k]
  ------------------
  586|  1.80M|    {
  587|  15.9M|        for(j = 0; j < wd; j++, pu1_src1++, pu1_src2++, pu1_dst++)
  ------------------
  |  Branch (587:20): [True: 14.1M, False: 1.80M]
  ------------------
  588|  14.1M|        {
  589|  14.1M|            *pu1_dst = CLIP_U8((wt1_u * (*pu1_src1) + wt2_u * (*pu1_src2) + ofst_u) >> shft);
  ------------------
  |  |   58|  14.1M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  14.1M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 722k, False: 13.4M]
  |  |  |  |  |  Branch (77:54): [True: 721k, False: 12.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  590|  14.1M|            pu1_src1++;
  591|  14.1M|            pu1_src2++;
  592|  14.1M|            pu1_dst++;
  593|  14.1M|            *pu1_dst = CLIP_U8((wt1_v * (*pu1_src1) + wt2_v * (*pu1_src2) + ofst_v) >> shft);
  ------------------
  |  |   58|  14.1M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  14.1M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.18M, False: 12.9M]
  |  |  |  |  |  Branch (77:54): [True: 142k, False: 12.8M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  594|  14.1M|        }
  595|  1.80M|        pu1_src1 += src_strd1;
  596|  1.80M|        pu1_src2 += src_strd2;
  597|  1.80M|        pu1_dst += dst_strd;
  598|  1.80M|    }
  599|   230k|}

ithread_get_handle_size:
   67|   129k|{
   68|   129k|    return sizeof(pthread_t);
   69|   129k|}
ithread_get_mutex_lock_size:
   72|   336k|{
   73|   336k|    return sizeof(pthread_mutex_t);
   74|   336k|}
ithread_create:
   78|  51.6k|{
   79|  51.6k|    UNUSED(attribute);
  ------------------
  |  |   47|  51.6k|#define UNUSED(x) ((void)(x))
  ------------------
   80|       |    return pthread_create((pthread_t *)thread_handle, NULL,(void *(*)(void *)) strt, argument);
   81|  51.6k|}
ithread_join:
   84|  51.6k|{
   85|  51.6k|    pthread_t *pthread_handle   = (pthread_t *)thread_handle;
   86|  51.6k|    UNUSED(val_ptr);
  ------------------
  |  |   47|  51.6k|#define UNUSED(x) ((void)(x))
  ------------------
   87|       |    return pthread_join(*pthread_handle, NULL);
   88|  51.6k|}
ithread_mutex_init:
   95|  47.2k|{
   96|       |    return pthread_mutex_init((pthread_mutex_t *) mutex, NULL);
   97|  47.2k|}
ithread_mutex_destroy:
  100|  46.5k|{
  101|  46.5k|    return pthread_mutex_destroy((pthread_mutex_t *) mutex);
  102|  46.5k|}
ithread_mutex_lock:
  105|  1.54M|{
  106|  1.54M|    return pthread_mutex_lock((pthread_mutex_t *)mutex);
  107|  1.54M|}
ithread_mutex_unlock:
  110|  1.54M|{
  111|  1.54M|    return pthread_mutex_unlock((pthread_mutex_t *)mutex);
  112|  1.54M|}
ithread_yield:
  115|   357k|{
  116|   357k|    sched_yield();
  117|   357k|}
ithread_set_name:
  163|   789k|{
  164|       |
  165|   789k|#ifndef WIN32
  166|   789k|#ifndef QNX
  167|   789k|#ifndef IOS
  168|   789k|    UNUSED(pc_thread_name);
  ------------------
  |  |   47|   789k|#define UNUSED(x) ((void)(x))
  ------------------
  169|       |//prctl(PR_SET_NAME, (unsigned long)pu1_thread_name, 0, 0, 0);
  170|   789k|#endif
  171|   789k|#endif
  172|   789k|#endif
  173|       |
  174|   789k|}

ih264_intra_pred_chroma_8x8_mode_horz_ssse3:
  101|  14.2k|{
  102|       |
  103|  14.2k|    UWORD8 *pu1_left; /* Pointer to start of top predictors */
  104|  14.2k|    WORD32 dst_strd2;
  105|       |
  106|  14.2k|    __m128i row1_16x8b, row2_16x8b;
  107|       |
  108|  14.2k|    UNUSED(src_strd);
  ------------------
  |  |   45|  14.2k|#define UNUSED(x) ((void)(x))
  ------------------
  109|  14.2k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  14.2k|#define UNUSED(x) ((void)(x))
  ------------------
  110|       |
  111|  14.2k|    pu1_left = pu1_src + 2 * BLK8x8SIZE - 2;
  ------------------
  |  |  510|  14.2k|#define BLK8x8SIZE          8
  ------------------
  112|       |
  113|       |
  114|  14.2k|    dst_strd2 = dst_strd << 1;
  115|  14.2k|    row1_16x8b = _mm_set1_epi16(*((WORD16 *)(pu1_left)));
  116|  14.2k|    row2_16x8b = _mm_set1_epi16(*((WORD16 *)(pu1_left - 2)));
  117|  14.2k|    _mm_storeu_si128((__m128i *)pu1_dst, row1_16x8b);
  118|  14.2k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), row2_16x8b);
  119|       |
  120|  14.2k|    pu1_dst += dst_strd2;
  121|  14.2k|    row1_16x8b = _mm_set1_epi16(*((WORD16 *)(pu1_left - 4)));
  122|  14.2k|    row2_16x8b = _mm_set1_epi16(*((WORD16 *)(pu1_left - 6)));
  123|  14.2k|    _mm_storeu_si128((__m128i *)pu1_dst, row1_16x8b);
  124|  14.2k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), row2_16x8b);
  125|       |
  126|  14.2k|    pu1_dst += dst_strd2;
  127|  14.2k|    row1_16x8b = _mm_set1_epi16(*((WORD16 *)(pu1_left - 8)));
  128|  14.2k|    row2_16x8b = _mm_set1_epi16(*((WORD16 *)(pu1_left - 10)));
  129|  14.2k|    _mm_storeu_si128((__m128i *)pu1_dst, row1_16x8b);
  130|  14.2k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), row2_16x8b);
  131|       |
  132|  14.2k|    pu1_dst += dst_strd2;
  133|  14.2k|    row1_16x8b = _mm_set1_epi16(*((WORD16 *)(pu1_left - 12)));
  134|  14.2k|    row2_16x8b = _mm_set1_epi16(*((WORD16 *)(pu1_left - 14)));
  135|  14.2k|    _mm_storeu_si128((__m128i *)pu1_dst, row1_16x8b);
  136|  14.2k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), row2_16x8b);
  137|  14.2k|}
ih264_intra_pred_chroma_8x8_mode_vert_ssse3:
  177|  7.13k|{
  178|  7.13k|    UWORD8 *pu1_top; /* Pointer to start of top predictors */
  179|  7.13k|    WORD32 dst_strd2;
  180|       |
  181|  7.13k|    __m128i top_16x8b;
  182|       |
  183|  7.13k|    UNUSED(src_strd);
  ------------------
  |  |   45|  7.13k|#define UNUSED(x) ((void)(x))
  ------------------
  184|  7.13k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  7.13k|#define UNUSED(x) ((void)(x))
  ------------------
  185|       |
  186|  7.13k|    pu1_top = pu1_src + 2 * BLK8x8SIZE + 2;
  ------------------
  |  |  510|  7.13k|#define BLK8x8SIZE          8
  ------------------
  187|       |
  188|  7.13k|    top_16x8b = _mm_loadu_si128((__m128i *)pu1_top);
  189|       |
  190|  7.13k|    dst_strd2 = dst_strd << 1;
  191|  7.13k|    _mm_storeu_si128((__m128i *)pu1_dst, top_16x8b);
  192|  7.13k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), top_16x8b);
  193|       |
  194|  7.13k|    pu1_dst += dst_strd2;
  195|  7.13k|    _mm_storeu_si128((__m128i *)pu1_dst, top_16x8b);
  196|  7.13k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), top_16x8b);
  197|       |
  198|  7.13k|    pu1_dst += dst_strd2;
  199|  7.13k|    _mm_storeu_si128((__m128i *)pu1_dst, top_16x8b);
  200|  7.13k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), top_16x8b);
  201|       |
  202|  7.13k|    pu1_dst += dst_strd2;
  203|  7.13k|    _mm_storeu_si128((__m128i *)pu1_dst, top_16x8b);
  204|  7.13k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), top_16x8b);
  205|  7.13k|}
ih264_intra_pred_chroma_8x8_mode_plane_ssse3:
  245|  1.37k|{
  246|  1.37k|    UWORD8 *pu1_left, *pu1_top;
  247|  1.37k|    WORD32 a_u, a_v, b_u, b_v, c_u, c_v;
  248|       |
  249|  1.37k|    __m128i mul_8x16b, shuffle_8x16b;
  250|       |
  251|  1.37k|    UNUSED(src_strd);
  ------------------
  |  |   45|  1.37k|#define UNUSED(x) ((void)(x))
  ------------------
  252|  1.37k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  1.37k|#define UNUSED(x) ((void)(x))
  ------------------
  253|       |
  254|  1.37k|    pu1_top = pu1_src + MB_SIZE + 2;
  ------------------
  |  |  509|  1.37k|#define MB_SIZE             16
  ------------------
  255|  1.37k|    pu1_left = pu1_src + MB_SIZE - 2;
  ------------------
  |  |  509|  1.37k|#define MB_SIZE             16
  ------------------
  256|       |
  257|  1.37k|    mul_8x16b = _mm_setr_epi16(1, 2, 3, 4, 1, 2, 3, 4);
  258|  1.37k|    shuffle_8x16b = _mm_setr_epi16(0xff00, 0xff02, 0xff04, 0xff06,
  259|  1.37k|                                   0xff01, 0xff03, 0xff05, 0xff07);
  260|       |
  261|       |    //calculating a, b and c
  262|  1.37k|    {
  263|  1.37k|        WORD32 h_u, h_v, v_u, v_v;
  264|       |
  265|  1.37k|        __m128i h_val1_16x8b, h_val2_16x8b;
  266|  1.37k|        __m128i h_val1_8x16b, h_val2_8x16b, h_val_4x32b;
  267|  1.37k|        __m128i v_val1_16x8b, v_val2_16x8b;
  268|  1.37k|        __m128i v_val1_8x16b, v_val2_8x16b, v_val_4x32b;
  269|  1.37k|        __m128i hv_val_4x32b;
  270|       |
  271|  1.37k|        h_val1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_top + 8));
  272|  1.37k|        h_val2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_top - 2));
  273|  1.37k|        v_val1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_left - 14));
  274|  1.37k|        v_val2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_left - 4));
  275|       |
  276|       |        // reversing the order
  277|  1.37k|        h_val2_16x8b = _mm_shufflelo_epi16(h_val2_16x8b, 0x1b);
  278|  1.37k|        v_val1_16x8b = _mm_shufflelo_epi16(v_val1_16x8b, 0x1b);
  279|       |
  280|       |        // separating u and v and 8-bit to 16-bit conversion
  281|  1.37k|        h_val1_8x16b = _mm_shuffle_epi8(h_val1_16x8b, shuffle_8x16b);
  282|  1.37k|        h_val2_8x16b = _mm_shuffle_epi8(h_val2_16x8b, shuffle_8x16b);
  283|  1.37k|        v_val1_8x16b = _mm_shuffle_epi8(v_val1_16x8b, shuffle_8x16b);
  284|  1.37k|        v_val2_8x16b = _mm_shuffle_epi8(v_val2_16x8b, shuffle_8x16b);
  285|       |
  286|  1.37k|        h_val1_8x16b = _mm_sub_epi16(h_val1_8x16b, h_val2_8x16b);
  287|  1.37k|        v_val1_8x16b = _mm_sub_epi16(v_val1_8x16b, v_val2_8x16b);
  288|       |
  289|  1.37k|        h_val_4x32b = _mm_madd_epi16(mul_8x16b, h_val1_8x16b);
  290|  1.37k|        v_val_4x32b = _mm_madd_epi16(mul_8x16b, v_val1_8x16b);
  291|       |
  292|  1.37k|        hv_val_4x32b = _mm_hadd_epi32(h_val_4x32b, v_val_4x32b);
  293|       |
  294|  1.37k|        a_u = (pu1_left[7 * (-2)] + pu1_top[14]) << 4;
  295|  1.37k|        a_v = (pu1_left[7 * (-2) + 1] + pu1_top[15]) << 4;
  296|       |
  297|  1.37k|        h_u = _mm_extract_epi16(hv_val_4x32b, 0);
  298|  1.37k|        h_v = _mm_extract_epi16(hv_val_4x32b, 2);
  299|  1.37k|        v_u = _mm_extract_epi16(hv_val_4x32b, 4);
  300|  1.37k|        v_v = _mm_extract_epi16(hv_val_4x32b, 6);
  301|       |
  302|  1.37k|        h_u = (h_u << 16) >> 15; // sign-extension and multiplication by 2
  303|  1.37k|        h_v = (h_v << 16) >> 15;
  304|  1.37k|        v_u = (v_u << 16) >> 15;
  305|  1.37k|        v_v = (v_v << 16) >> 15;
  306|       |
  307|  1.37k|        b_u = ((h_u << 4) + h_u + 32) >> 6;
  308|  1.37k|        b_v = ((h_v << 4) + h_v + 32) >> 6;
  309|  1.37k|        c_u = ((v_u << 4) + v_u + 32) >> 6;
  310|  1.37k|        c_v = ((v_v << 4) + v_v + 32) >> 6;
  311|  1.37k|    }
  312|       |    //using a, b and c to compute the fitted plane values
  313|  1.37k|    {
  314|  1.37k|        __m128i const_8x16b, c2_8x16b;
  315|  1.37k|        __m128i res1_l_8x16b, res1_h_8x16b;
  316|  1.37k|        __m128i res2_l_8x16b, res2_h_8x16b;
  317|  1.37k|        __m128i res1_sh_l_8x16b, res1_sh_h_8x16b, res1_16x8b;
  318|  1.37k|        __m128i res2_sh_l_8x16b, res2_sh_h_8x16b, res2_16x8b;
  319|       |
  320|  1.37k|        WORD32 b_u2, b_v2, b_u3, b_v3;
  321|  1.37k|        WORD32 const_u, const_v;
  322|  1.37k|        WORD32 dst_strd2;
  323|       |
  324|  1.37k|        const_u = a_u - (c_u << 1) - c_u + 16;
  325|  1.37k|        const_v = a_v - (c_v << 1) - c_v + 16;
  326|       |
  327|  1.37k|        b_u2 = b_u << 1;
  328|  1.37k|        b_v2 = b_v << 1;
  329|  1.37k|        b_u3 = b_u + b_u2;
  330|  1.37k|        b_v3 = b_v + b_v2;
  331|       |
  332|  1.37k|        const_8x16b = _mm_setr_epi16(const_u, const_v, const_u, const_v, const_u, const_v, const_u, const_v);
  333|  1.37k|        res1_l_8x16b = _mm_setr_epi16(-b_u3, -b_v3, -b_u2, -b_v2, -b_u, -b_v, 0, 0);
  334|       |        //contains {-b*3, -b*2, -b*1, b*0}
  335|  1.37k|        res1_h_8x16b = _mm_setr_epi16(b_u, b_v, b_u2, b_v2, b_u3, b_v3, b_u << 2, b_v << 2);
  336|       |        //contains {b*1, b*2, b*3, b*4}
  337|  1.37k|        c2_8x16b = _mm_setr_epi16(c_u, c_v, c_u, c_v, c_u, c_v, c_u, c_v);
  338|       |
  339|       |        // rows 1, 2
  340|  1.37k|        res1_l_8x16b = _mm_add_epi16(res1_l_8x16b, const_8x16b);
  341|  1.37k|        res1_h_8x16b = _mm_add_epi16(res1_h_8x16b, const_8x16b);
  342|  1.37k|        res2_l_8x16b = _mm_add_epi16(res1_l_8x16b, c2_8x16b);
  343|  1.37k|        res2_h_8x16b = _mm_add_epi16(res1_h_8x16b, c2_8x16b);
  344|       |
  345|  1.37k|        res1_sh_l_8x16b = _mm_srai_epi16(res1_l_8x16b, 5);
  346|  1.37k|        res1_sh_h_8x16b = _mm_srai_epi16(res1_h_8x16b, 5);
  347|  1.37k|        res2_sh_l_8x16b = _mm_srai_epi16(res2_l_8x16b, 5);
  348|  1.37k|        res2_sh_h_8x16b = _mm_srai_epi16(res2_h_8x16b, 5);
  349|       |
  350|  1.37k|        dst_strd2 = dst_strd << 1;
  351|  1.37k|        c2_8x16b = _mm_slli_epi16(c2_8x16b, 1);
  352|       |
  353|  1.37k|        res1_16x8b = _mm_packus_epi16(res1_sh_l_8x16b, res1_sh_h_8x16b);
  354|  1.37k|        res2_16x8b = _mm_packus_epi16(res2_sh_l_8x16b, res2_sh_h_8x16b);
  355|       |
  356|  1.37k|        _mm_storeu_si128((__m128i *)pu1_dst, res1_16x8b);
  357|  1.37k|        _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), res2_16x8b);
  358|       |
  359|       |        // rows 3, 4
  360|  1.37k|        res1_l_8x16b = _mm_add_epi16(res1_l_8x16b, c2_8x16b);
  361|  1.37k|        res1_h_8x16b = _mm_add_epi16(res1_h_8x16b, c2_8x16b);
  362|  1.37k|        res2_l_8x16b = _mm_add_epi16(res2_l_8x16b, c2_8x16b);
  363|  1.37k|        res2_h_8x16b = _mm_add_epi16(res2_h_8x16b, c2_8x16b);
  364|       |
  365|  1.37k|        res1_sh_l_8x16b = _mm_srai_epi16(res1_l_8x16b, 5);
  366|  1.37k|        res1_sh_h_8x16b = _mm_srai_epi16(res1_h_8x16b, 5);
  367|  1.37k|        res2_sh_l_8x16b = _mm_srai_epi16(res2_l_8x16b, 5);
  368|  1.37k|        res2_sh_h_8x16b = _mm_srai_epi16(res2_h_8x16b, 5);
  369|       |
  370|  1.37k|        pu1_dst += dst_strd2;
  371|       |
  372|  1.37k|        res1_16x8b = _mm_packus_epi16(res1_sh_l_8x16b, res1_sh_h_8x16b);
  373|  1.37k|        res2_16x8b = _mm_packus_epi16(res2_sh_l_8x16b, res2_sh_h_8x16b);
  374|       |
  375|  1.37k|        _mm_storeu_si128((__m128i *)pu1_dst, res1_16x8b);
  376|  1.37k|        _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), res2_16x8b);
  377|       |
  378|       |        // rows 5, 6
  379|  1.37k|        res1_l_8x16b = _mm_add_epi16(res1_l_8x16b, c2_8x16b);
  380|  1.37k|        res1_h_8x16b = _mm_add_epi16(res1_h_8x16b, c2_8x16b);
  381|  1.37k|        res2_l_8x16b = _mm_add_epi16(res2_l_8x16b, c2_8x16b);
  382|  1.37k|        res2_h_8x16b = _mm_add_epi16(res2_h_8x16b, c2_8x16b);
  383|       |
  384|  1.37k|        res1_sh_l_8x16b = _mm_srai_epi16(res1_l_8x16b, 5);
  385|  1.37k|        res1_sh_h_8x16b = _mm_srai_epi16(res1_h_8x16b, 5);
  386|  1.37k|        res2_sh_l_8x16b = _mm_srai_epi16(res2_l_8x16b, 5);
  387|  1.37k|        res2_sh_h_8x16b = _mm_srai_epi16(res2_h_8x16b, 5);
  388|       |
  389|  1.37k|        pu1_dst += dst_strd2;
  390|       |
  391|  1.37k|        res1_16x8b = _mm_packus_epi16(res1_sh_l_8x16b, res1_sh_h_8x16b);
  392|  1.37k|        res2_16x8b = _mm_packus_epi16(res2_sh_l_8x16b, res2_sh_h_8x16b);
  393|       |
  394|  1.37k|        _mm_storeu_si128((__m128i *)pu1_dst, res1_16x8b);
  395|  1.37k|        _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), res2_16x8b);
  396|       |
  397|       |        // rows 7, 8
  398|  1.37k|        res1_l_8x16b = _mm_add_epi16(res1_l_8x16b, c2_8x16b);
  399|  1.37k|        res1_h_8x16b = _mm_add_epi16(res1_h_8x16b, c2_8x16b);
  400|  1.37k|        res2_l_8x16b = _mm_add_epi16(res2_l_8x16b, c2_8x16b);
  401|  1.37k|        res2_h_8x16b = _mm_add_epi16(res2_h_8x16b, c2_8x16b);
  402|       |
  403|  1.37k|        res1_sh_l_8x16b = _mm_srai_epi16(res1_l_8x16b, 5);
  404|  1.37k|        res1_sh_h_8x16b = _mm_srai_epi16(res1_h_8x16b, 5);
  405|  1.37k|        res2_sh_l_8x16b = _mm_srai_epi16(res2_l_8x16b, 5);
  406|  1.37k|        res2_sh_h_8x16b = _mm_srai_epi16(res2_h_8x16b, 5);
  407|       |
  408|  1.37k|        pu1_dst += dst_strd2;
  409|       |
  410|  1.37k|        res1_16x8b = _mm_packus_epi16(res1_sh_l_8x16b, res1_sh_h_8x16b);
  411|  1.37k|        res2_16x8b = _mm_packus_epi16(res2_sh_l_8x16b, res2_sh_h_8x16b);
  412|       |
  413|  1.37k|        _mm_storeu_si128((__m128i *)pu1_dst, res1_16x8b);
  414|  1.37k|        _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), res2_16x8b);
  415|       |
  416|  1.37k|    }
  417|  1.37k|}

ih264_deblk_chroma_vert_bs4_ssse3:
  100|  36.8k|{
  101|  36.8k|    UWORD8 *pu1_src_uv = pu1_src; /* Pointer to the src sample q0 of plane U*/
  102|  36.8k|    WORD32 alpha_cbcr = (alpha_cr << 16) + alpha_cb;
  103|  36.8k|    WORD32 beta_cbcr = (beta_cr << 16) + beta_cb;
  104|  36.8k|    __m128i linea, lineb, linec, lined, linee, linef, lineg, lineh;
  105|  36.8k|    __m128i temp1, temp2, temp3, temp4;
  106|       |
  107|  36.8k|    __m128i q0_uv_16x8, p0_uv_16x8, q1_uv_16x8, p1_uv_16x8;
  108|  36.8k|    __m128i q0_uv_8x16, p0_uv_8x16, q1_uv_8x16, p1_uv_8x16;
  109|  36.8k|    __m128i flag1, flag2;
  110|  36.8k|    __m128i diff, alpha_cbcr_16x8, beta_cbcr_16x8;
  111|  36.8k|    __m128i zero = _mm_setzero_si128();
  112|  36.8k|    __m128i p0_uv_8x16_1, p0_uv_8x16_2, q0_uv_8x16_1, q0_uv_8x16_2;
  113|       |
  114|       |    /* Load and transpose the pixel values */
  115|  36.8k|    linea = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4));
  116|  36.8k|    lineb = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4 + src_strd));
  117|  36.8k|    linec = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4 + 2 * src_strd));
  118|  36.8k|    lined = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4 + 3 * src_strd));
  119|  36.8k|    linee = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4 + 4 * src_strd));
  120|  36.8k|    linef = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4 + 5 * src_strd));
  121|  36.8k|    lineg = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4 + 6 * src_strd));
  122|  36.8k|    lineh = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4 + 7 * src_strd));
  123|       |
  124|  36.8k|    temp1 = _mm_unpacklo_epi16(linea, lineb);
  125|  36.8k|    temp2 = _mm_unpacklo_epi16(linec, lined);
  126|  36.8k|    temp3 = _mm_unpacklo_epi16(linee, linef);
  127|  36.8k|    temp4 = _mm_unpacklo_epi16(lineg, lineh);
  128|       |
  129|  36.8k|    p1_uv_8x16 = _mm_unpacklo_epi32(temp1, temp2);
  130|  36.8k|    p0_uv_8x16 = _mm_unpacklo_epi32(temp3, temp4);
  131|  36.8k|    q0_uv_8x16 = _mm_unpackhi_epi32(temp1, temp2);
  132|  36.8k|    q1_uv_8x16 = _mm_unpackhi_epi32(temp3, temp4);
  133|       |
  134|  36.8k|    p1_uv_16x8 = _mm_unpacklo_epi64(p1_uv_8x16, p0_uv_8x16);
  135|  36.8k|    p0_uv_16x8 = _mm_unpackhi_epi64(p1_uv_8x16, p0_uv_8x16);
  136|  36.8k|    q0_uv_16x8 = _mm_unpacklo_epi64(q0_uv_8x16, q1_uv_8x16);
  137|  36.8k|    q1_uv_16x8 = _mm_unpackhi_epi64(q0_uv_8x16, q1_uv_8x16);
  138|       |    /* End of transpose */
  139|       |
  140|  36.8k|    q0_uv_8x16 = _mm_unpacklo_epi8(q0_uv_16x8, zero);
  141|  36.8k|    q1_uv_8x16 = _mm_unpacklo_epi8(q1_uv_16x8, zero);
  142|  36.8k|    p1_uv_8x16 = _mm_unpacklo_epi8(p1_uv_16x8, zero);
  143|  36.8k|    p0_uv_8x16 = _mm_unpacklo_epi8(p0_uv_16x8, zero);
  144|       |
  145|  36.8k|    diff = _mm_subs_epi16(p0_uv_8x16, q0_uv_8x16); //Condn 1
  146|  36.8k|    diff = _mm_abs_epi16(diff);
  147|  36.8k|    alpha_cbcr_16x8 = _mm_set1_epi32(alpha_cbcr);
  148|  36.8k|    flag1 = _mm_cmpgt_epi16(alpha_cbcr_16x8, diff);
  149|       |
  150|  36.8k|    diff = _mm_subs_epi16(q1_uv_8x16, q0_uv_8x16); //Condtn 2
  151|  36.8k|    diff = _mm_abs_epi16(diff);
  152|  36.8k|    beta_cbcr_16x8 = _mm_set1_epi32(beta_cbcr);
  153|  36.8k|    flag1 = _mm_and_si128(flag1, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  154|       |
  155|  36.8k|    diff = _mm_subs_epi16(p1_uv_8x16, p0_uv_8x16); //Condtn 3
  156|  36.8k|    diff = _mm_abs_epi16(diff);
  157|  36.8k|    flag1 = _mm_and_si128(flag1, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  158|       |
  159|  36.8k|    temp1 = _mm_slli_epi16(p1_uv_8x16, 1);
  160|  36.8k|    temp2 = _mm_add_epi16(p0_uv_8x16, q1_uv_8x16);
  161|  36.8k|    temp1 = _mm_add_epi16(temp1, _mm_set1_epi16(2));
  162|  36.8k|    temp1 = _mm_add_epi16(temp1, temp2);
  163|  36.8k|    p0_uv_8x16_1 = _mm_srai_epi16(temp1, 2);
  164|       |
  165|  36.8k|    temp1 = _mm_slli_epi16(q1_uv_8x16, 1);
  166|  36.8k|    temp2 = _mm_add_epi16(p1_uv_8x16, q0_uv_8x16);
  167|  36.8k|    temp1 = _mm_add_epi16(temp1, _mm_set1_epi16(2));
  168|  36.8k|    temp1 = _mm_add_epi16(temp1, temp2);
  169|  36.8k|    q0_uv_8x16_1 = _mm_srai_epi16(temp1, 2);
  170|       |
  171|  36.8k|    q0_uv_8x16 = _mm_unpackhi_epi8(q0_uv_16x8, zero);
  172|  36.8k|    q1_uv_8x16 = _mm_unpackhi_epi8(q1_uv_16x8, zero);
  173|  36.8k|    p1_uv_8x16 = _mm_unpackhi_epi8(p1_uv_16x8, zero);
  174|  36.8k|    p0_uv_8x16 = _mm_unpackhi_epi8(p0_uv_16x8, zero);
  175|       |
  176|  36.8k|    diff = _mm_subs_epi16(p0_uv_8x16, q0_uv_8x16); //Condn 1
  177|  36.8k|    diff = _mm_abs_epi16(diff);
  178|  36.8k|    alpha_cbcr_16x8 = _mm_set1_epi32(alpha_cbcr);
  179|  36.8k|    flag2 = _mm_cmpgt_epi16(alpha_cbcr_16x8, diff);
  180|       |
  181|  36.8k|    diff = _mm_subs_epi16(q1_uv_8x16, q0_uv_8x16); //Condtn 2
  182|  36.8k|    diff = _mm_abs_epi16(diff);
  183|  36.8k|    beta_cbcr_16x8 = _mm_set1_epi32(beta_cbcr);
  184|  36.8k|    flag2 = _mm_and_si128(flag2, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  185|       |
  186|  36.8k|    diff = _mm_subs_epi16(p1_uv_8x16, p0_uv_8x16); //Condtn 3
  187|  36.8k|    diff = _mm_abs_epi16(diff);
  188|  36.8k|    flag2 = _mm_and_si128(flag2, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  189|       |
  190|  36.8k|    temp1 = _mm_slli_epi16(p1_uv_8x16, 1);
  191|  36.8k|    temp2 = _mm_add_epi16(p0_uv_8x16, q1_uv_8x16);
  192|  36.8k|    temp1 = _mm_add_epi16(temp1, _mm_set1_epi16(2));
  193|  36.8k|    temp1 = _mm_add_epi16(temp1, temp2);
  194|  36.8k|    p0_uv_8x16_2 = _mm_srai_epi16(temp1, 2);
  195|       |
  196|  36.8k|    temp1 = _mm_slli_epi16(q1_uv_8x16, 1);
  197|  36.8k|    temp2 = _mm_add_epi16(p1_uv_8x16, q0_uv_8x16);
  198|  36.8k|    temp1 = _mm_add_epi16(temp1, _mm_set1_epi16(2));
  199|  36.8k|    temp1 = _mm_add_epi16(temp1, temp2);
  200|  36.8k|    q0_uv_8x16_2 = _mm_srai_epi16(temp1, 2);
  201|       |
  202|  36.8k|    p0_uv_8x16_2 = _mm_packus_epi16(p0_uv_8x16_1, p0_uv_8x16_2);
  203|  36.8k|    q0_uv_8x16_2 = _mm_packus_epi16(q0_uv_8x16_1, q0_uv_8x16_2);
  204|       |
  205|  36.8k|    flag1 = _mm_packs_epi16(flag1, flag2);
  206|       |
  207|  36.8k|    p0_uv_8x16_1 = _mm_and_si128(p0_uv_16x8,
  208|  36.8k|                                 _mm_xor_si128(flag1, _mm_set1_epi8(0xFF)));
  209|  36.8k|    p0_uv_8x16_2 = _mm_and_si128(p0_uv_8x16_2, flag1);
  210|  36.8k|    p0_uv_16x8 = _mm_add_epi8(p0_uv_8x16_1, p0_uv_8x16_2);
  211|       |
  212|  36.8k|    q0_uv_8x16_1 = _mm_and_si128(q0_uv_16x8,
  213|  36.8k|                                 _mm_xor_si128(flag1, _mm_set1_epi8(0xFF)));
  214|  36.8k|    q0_uv_8x16_2 = _mm_and_si128(q0_uv_8x16_2, flag1);
  215|  36.8k|    q0_uv_16x8 = _mm_add_epi8(q0_uv_8x16_1, q0_uv_8x16_2);
  216|       |
  217|       |    /* Inverse-transpose and store back */
  218|  36.8k|    temp1 = _mm_unpacklo_epi16(p1_uv_16x8, p0_uv_16x8);
  219|  36.8k|    temp2 = _mm_unpackhi_epi16(p1_uv_16x8, p0_uv_16x8);
  220|  36.8k|    temp3 = _mm_unpacklo_epi16(q0_uv_16x8, q1_uv_16x8);
  221|  36.8k|    temp4 = _mm_unpackhi_epi16(q0_uv_16x8, q1_uv_16x8);
  222|       |
  223|  36.8k|    linea = _mm_unpacklo_epi32(temp1, temp3);
  224|  36.8k|    lineb = _mm_srli_si128(linea, 8);
  225|  36.8k|    linec = _mm_unpackhi_epi32(temp1, temp3);
  226|  36.8k|    lined = _mm_srli_si128(linec, 8);
  227|  36.8k|    linee = _mm_unpacklo_epi32(temp2, temp4);
  228|  36.8k|    linef = _mm_srli_si128(linee, 8);
  229|  36.8k|    lineg = _mm_unpackhi_epi32(temp2, temp4);
  230|  36.8k|    lineh = _mm_srli_si128(lineg, 8);
  231|       |
  232|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4), linea);
  233|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4 + src_strd), lineb);
  234|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4 + 2 * src_strd), linec);
  235|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4 + 3 * src_strd), lined);
  236|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4 + 4 * src_strd), linee);
  237|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4 + 5 * src_strd), linef);
  238|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4 + 6 * src_strd), lineg);
  239|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4 + 7 * src_strd), lineh);
  240|       |
  241|  36.8k|}
ih264_deblk_chroma_horz_bs4_ssse3:
  283|  39.3k|{
  284|  39.3k|    UWORD8 *pu1_src_uv = pu1_src; /* Pointer to the src sample q0 of plane U*/
  285|  39.3k|    WORD16 i16_posP1, i16_posP0, i16_posQ1;
  286|       |
  287|  39.3k|    UWORD8 *pu1_HorzPixelUV; /*! < Pointer to the first pixel of the boundary */
  288|  39.3k|    WORD32 alpha_cbcr = (alpha_cr << 16) + alpha_cb;
  289|  39.3k|    WORD32 beta_cbcr = (beta_cr << 16) + beta_cb;
  290|  39.3k|    __m128i q0_uv_16x8, p0_uv_16x8, q1_uv_16x8, p1_uv_16x8;
  291|  39.3k|    __m128i q0_uv_8x16, p0_uv_8x16, q1_uv_8x16, p1_uv_8x16;
  292|  39.3k|    __m128i flag1, flag2;
  293|  39.3k|    __m128i diff, alpha_cbcr_16x8, beta_cbcr_16x8;
  294|  39.3k|    __m128i zero = _mm_setzero_si128();
  295|  39.3k|    __m128i p0_uv_8x16_1, p0_uv_8x16_2, q0_uv_8x16_1, q0_uv_8x16_2;
  296|  39.3k|    __m128i temp1, temp2;
  297|       |
  298|  39.3k|    pu1_HorzPixelUV = pu1_src_uv - (src_strd << 1);
  299|       |
  300|  39.3k|    i16_posQ1 = src_strd;
  301|  39.3k|    i16_posP0 = src_strd;
  302|  39.3k|    i16_posP1 = 0;
  303|       |
  304|  39.3k|    q0_uv_16x8 = _mm_loadu_si128((__m128i *)(pu1_src_uv));
  305|  39.3k|    q1_uv_16x8 = _mm_loadu_si128((__m128i *)(pu1_src_uv + i16_posQ1));
  306|  39.3k|    p1_uv_16x8 = _mm_loadu_si128((__m128i *)(pu1_HorzPixelUV + i16_posP1));
  307|  39.3k|    p0_uv_16x8 = _mm_loadu_si128((__m128i *)(pu1_HorzPixelUV + i16_posP0));
  308|       |
  309|  39.3k|    q0_uv_8x16 = _mm_unpacklo_epi8(q0_uv_16x8, zero);
  310|  39.3k|    q1_uv_8x16 = _mm_unpacklo_epi8(q1_uv_16x8, zero);
  311|  39.3k|    p1_uv_8x16 = _mm_unpacklo_epi8(p1_uv_16x8, zero);
  312|  39.3k|    p0_uv_8x16 = _mm_unpacklo_epi8(p0_uv_16x8, zero);
  313|       |
  314|  39.3k|    diff = _mm_subs_epi16(p0_uv_8x16, q0_uv_8x16); //Condn 1
  315|  39.3k|    diff = _mm_abs_epi16(diff);
  316|  39.3k|    alpha_cbcr_16x8 = _mm_set1_epi32(alpha_cbcr);
  317|  39.3k|    flag1 = _mm_cmpgt_epi16(alpha_cbcr_16x8, diff);
  318|       |
  319|  39.3k|    diff = _mm_subs_epi16(q1_uv_8x16, q0_uv_8x16); //Condtn 2
  320|  39.3k|    diff = _mm_abs_epi16(diff);
  321|  39.3k|    beta_cbcr_16x8 = _mm_set1_epi32(beta_cbcr);
  322|  39.3k|    flag1 = _mm_and_si128(flag1, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  323|       |
  324|  39.3k|    diff = _mm_subs_epi16(p1_uv_8x16, p0_uv_8x16); //Condtn 3
  325|  39.3k|    diff = _mm_abs_epi16(diff);
  326|  39.3k|    flag1 = _mm_and_si128(flag1, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  327|       |
  328|  39.3k|    temp1 = _mm_slli_epi16(p1_uv_8x16, 1);
  329|  39.3k|    temp2 = _mm_add_epi16(p0_uv_8x16, q1_uv_8x16);
  330|  39.3k|    temp1 = _mm_add_epi16(temp1, _mm_set1_epi16(2));
  331|  39.3k|    temp1 = _mm_add_epi16(temp1, temp2);
  332|  39.3k|    p0_uv_8x16_1 = _mm_srai_epi16(temp1, 2);
  333|       |
  334|  39.3k|    temp1 = _mm_slli_epi16(q1_uv_8x16, 1);
  335|  39.3k|    temp2 = _mm_add_epi16(p1_uv_8x16, q0_uv_8x16);
  336|  39.3k|    temp1 = _mm_add_epi16(temp1, _mm_set1_epi16(2));
  337|  39.3k|    temp1 = _mm_add_epi16(temp1, temp2);
  338|  39.3k|    q0_uv_8x16_1 = _mm_srai_epi16(temp1, 2);
  339|       |
  340|  39.3k|    q0_uv_8x16 = _mm_unpackhi_epi8(q0_uv_16x8, zero);
  341|  39.3k|    q1_uv_8x16 = _mm_unpackhi_epi8(q1_uv_16x8, zero);
  342|  39.3k|    p1_uv_8x16 = _mm_unpackhi_epi8(p1_uv_16x8, zero);
  343|  39.3k|    p0_uv_8x16 = _mm_unpackhi_epi8(p0_uv_16x8, zero);
  344|       |
  345|  39.3k|    diff = _mm_subs_epi16(p0_uv_8x16, q0_uv_8x16); //Condn 1
  346|  39.3k|    diff = _mm_abs_epi16(diff);
  347|  39.3k|    alpha_cbcr_16x8 = _mm_set1_epi32(alpha_cbcr);
  348|  39.3k|    flag2 = _mm_cmpgt_epi16(alpha_cbcr_16x8, diff);
  349|       |
  350|  39.3k|    diff = _mm_subs_epi16(q1_uv_8x16, q0_uv_8x16); //Condtn 2
  351|  39.3k|    diff = _mm_abs_epi16(diff);
  352|  39.3k|    beta_cbcr_16x8 = _mm_set1_epi32(beta_cbcr);
  353|  39.3k|    flag2 = _mm_and_si128(flag2, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  354|       |
  355|  39.3k|    diff = _mm_subs_epi16(p1_uv_8x16, p0_uv_8x16); //Condtn 3
  356|  39.3k|    diff = _mm_abs_epi16(diff);
  357|  39.3k|    flag2 = _mm_and_si128(flag2, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  358|       |
  359|  39.3k|    temp1 = _mm_slli_epi16(p1_uv_8x16, 1);
  360|  39.3k|    temp2 = _mm_add_epi16(p0_uv_8x16, q1_uv_8x16);
  361|  39.3k|    temp1 = _mm_add_epi16(temp1, _mm_set1_epi16(2));
  362|  39.3k|    temp1 = _mm_add_epi16(temp1, temp2);
  363|  39.3k|    p0_uv_8x16_2 = _mm_srai_epi16(temp1, 2);
  364|       |
  365|  39.3k|    temp1 = _mm_slli_epi16(q1_uv_8x16, 1);
  366|  39.3k|    temp2 = _mm_add_epi16(p1_uv_8x16, q0_uv_8x16);
  367|  39.3k|    temp1 = _mm_add_epi16(temp1, _mm_set1_epi16(2));
  368|  39.3k|    temp1 = _mm_add_epi16(temp1, temp2);
  369|  39.3k|    q0_uv_8x16_2 = _mm_srai_epi16(temp1, 2);
  370|       |
  371|  39.3k|    p0_uv_8x16_2 = _mm_packus_epi16(p0_uv_8x16_1, p0_uv_8x16_2);
  372|  39.3k|    q0_uv_8x16_2 = _mm_packus_epi16(q0_uv_8x16_1, q0_uv_8x16_2);
  373|       |
  374|  39.3k|    flag1 = _mm_packs_epi16(flag1, flag2);
  375|       |
  376|  39.3k|    p0_uv_8x16_1 = _mm_and_si128(p0_uv_16x8,
  377|  39.3k|                                 _mm_xor_si128(flag1, _mm_set1_epi8(0xFF)));
  378|  39.3k|    p0_uv_8x16_2 = _mm_and_si128(p0_uv_8x16_2, flag1);
  379|  39.3k|    p0_uv_8x16_1 = _mm_add_epi8(p0_uv_8x16_1, p0_uv_8x16_2);
  380|  39.3k|    _mm_storeu_si128((__m128i *)(pu1_HorzPixelUV + i16_posP0), p0_uv_8x16_1);
  381|       |
  382|  39.3k|    q0_uv_8x16_1 = _mm_and_si128(q0_uv_16x8,
  383|  39.3k|                                 _mm_xor_si128(flag1, _mm_set1_epi8(0xFF)));
  384|  39.3k|    q0_uv_8x16_2 = _mm_and_si128(q0_uv_8x16_2, flag1);
  385|  39.3k|    q0_uv_8x16_1 = _mm_add_epi8(q0_uv_8x16_1, q0_uv_8x16_2);
  386|  39.3k|    _mm_storeu_si128((__m128i *)(pu1_src_uv), q0_uv_8x16_1);
  387|       |
  388|  39.3k|}
ih264_deblk_chroma_vert_bslt4_ssse3:
  436|   161k|{
  437|   161k|    UWORD8 *pu1_src_uv = pu1_src; /* Pointer to the src sample q0 of plane U*/
  438|   161k|    UWORD8 u1_Bs0, u1_Bs1, u1_Bs2, u1_Bs3;
  439|   161k|    WORD32 alpha_cbcr = (alpha_cr << 16) + alpha_cb;
  440|   161k|    WORD32 beta_cbcr = (beta_cr << 16) + beta_cb;
  441|   161k|    __m128i linea, lineb, linec, lined, linee, linef, lineg, lineh;
  442|   161k|    __m128i temp1, temp2, temp3, temp4;
  443|       |
  444|   161k|    __m128i q0_uv_16x8, p0_uv_16x8, q1_uv_16x8, p1_uv_16x8;
  445|   161k|    __m128i q0_uv_8x16, p0_uv_8x16, q1_uv_8x16, p1_uv_8x16;
  446|   161k|    __m128i flag_bs, flag1, flag2;
  447|   161k|    __m128i diff, diff1, alpha_cbcr_16x8, beta_cbcr_16x8, in_macro;
  448|   161k|    __m128i zero = _mm_setzero_si128();
  449|   161k|    __m128i C0_uv_8x16;
  450|   161k|    __m128i p0_uv_8x16_1, p0_uv_8x16_2, q0_uv_8x16_1, q0_uv_8x16_2;
  451|       |
  452|   161k|    u1_Bs0 = (u4_bs >> 24) & 0xff;
  453|   161k|    u1_Bs1 = (u4_bs >> 16) & 0xff;
  454|   161k|    u1_Bs2 = (u4_bs >> 8) & 0xff;
  455|   161k|    u1_Bs3 = (u4_bs >> 0) & 0xff;
  456|       |
  457|   161k|    flag_bs = _mm_set_epi8(u1_Bs3, u1_Bs3, u1_Bs3, u1_Bs3, u1_Bs2, u1_Bs2,
  458|   161k|                           u1_Bs2, u1_Bs2, u1_Bs1, u1_Bs1, u1_Bs1, u1_Bs1,
  459|   161k|                           u1_Bs0, u1_Bs0, u1_Bs0, u1_Bs0);
  460|   161k|    flag_bs = _mm_cmpeq_epi8(flag_bs, zero); //Set flag to 1s and 0s
  461|   161k|    flag_bs = _mm_xor_si128(flag_bs, _mm_set1_epi8(0xFF)); //Invert for required mask
  462|       |
  463|       |    /* Load and transpose the pixel values */
  464|   161k|    linea = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4));
  465|   161k|    lineb = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4 + src_strd));
  466|   161k|    linec = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4 + 2 * src_strd));
  467|   161k|    lined = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4 + 3 * src_strd));
  468|   161k|    linee = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4 + 4 * src_strd));
  469|   161k|    linef = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4 + 5 * src_strd));
  470|   161k|    lineg = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4 + 6 * src_strd));
  471|   161k|    lineh = _mm_loadl_epi64((__m128i *)(pu1_src_uv - 4 + 7 * src_strd));
  472|       |
  473|   161k|    temp1 = _mm_unpacklo_epi16(linea, lineb);
  474|   161k|    temp2 = _mm_unpacklo_epi16(linec, lined);
  475|   161k|    temp3 = _mm_unpacklo_epi16(linee, linef);
  476|   161k|    temp4 = _mm_unpacklo_epi16(lineg, lineh);
  477|       |
  478|   161k|    p1_uv_8x16 = _mm_unpacklo_epi32(temp1, temp2);
  479|   161k|    p0_uv_8x16 = _mm_unpacklo_epi32(temp3, temp4);
  480|   161k|    q0_uv_8x16 = _mm_unpackhi_epi32(temp1, temp2);
  481|   161k|    q1_uv_8x16 = _mm_unpackhi_epi32(temp3, temp4);
  482|       |
  483|   161k|    p1_uv_16x8 = _mm_unpacklo_epi64(p1_uv_8x16, p0_uv_8x16);
  484|   161k|    p0_uv_16x8 = _mm_unpackhi_epi64(p1_uv_8x16, p0_uv_8x16);
  485|   161k|    q0_uv_16x8 = _mm_unpacklo_epi64(q0_uv_8x16, q1_uv_8x16);
  486|   161k|    q1_uv_16x8 = _mm_unpackhi_epi64(q0_uv_8x16, q1_uv_8x16);
  487|       |    /* End of transpose */
  488|       |
  489|   161k|    q0_uv_8x16 = _mm_unpacklo_epi8(q0_uv_16x8, zero);
  490|   161k|    q1_uv_8x16 = _mm_unpacklo_epi8(q1_uv_16x8, zero);
  491|   161k|    p1_uv_8x16 = _mm_unpacklo_epi8(p1_uv_16x8, zero);
  492|   161k|    p0_uv_8x16 = _mm_unpacklo_epi8(p0_uv_16x8, zero);
  493|       |
  494|   161k|    diff = _mm_subs_epi16(p0_uv_8x16, q0_uv_8x16); //Condn 1
  495|   161k|    diff = _mm_abs_epi16(diff);
  496|   161k|    alpha_cbcr_16x8 = _mm_set1_epi32(alpha_cbcr);
  497|   161k|    flag1 = _mm_cmpgt_epi16(alpha_cbcr_16x8, diff);
  498|       |
  499|   161k|    diff = _mm_subs_epi16(q1_uv_8x16, q0_uv_8x16); //Condtn 2
  500|   161k|    diff = _mm_abs_epi16(diff);
  501|   161k|    beta_cbcr_16x8 = _mm_set1_epi32(beta_cbcr);
  502|   161k|    flag1 = _mm_and_si128(flag1, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  503|       |
  504|   161k|    diff = _mm_subs_epi16(p1_uv_8x16, p0_uv_8x16); //Condtn 3
  505|   161k|    diff = _mm_abs_epi16(diff);
  506|   161k|    flag1 = _mm_and_si128(flag1, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  507|       |
  508|   161k|    diff = _mm_subs_epi16(q0_uv_8x16, p0_uv_8x16);
  509|   161k|    diff = _mm_slli_epi16(diff, 2);
  510|   161k|    diff1 = _mm_subs_epi16(p1_uv_8x16, q1_uv_8x16);
  511|   161k|    diff = _mm_add_epi16(diff, diff1);
  512|   161k|    diff = _mm_add_epi16(diff, _mm_set1_epi16(4));
  513|   161k|    in_macro = _mm_srai_epi16(diff, 3);
  514|       |
  515|   161k|    C0_uv_8x16 = _mm_set_epi16(pu1_cliptab_cr[u1_Bs1], pu1_cliptab_cb[u1_Bs1],
  516|   161k|                               pu1_cliptab_cr[u1_Bs1], pu1_cliptab_cb[u1_Bs1],
  517|   161k|                               pu1_cliptab_cr[u1_Bs0], pu1_cliptab_cb[u1_Bs0],
  518|   161k|                               pu1_cliptab_cr[u1_Bs0], pu1_cliptab_cb[u1_Bs0]);
  519|       |
  520|   161k|    C0_uv_8x16 = _mm_add_epi16(C0_uv_8x16, _mm_set1_epi16(1));
  521|       |
  522|   161k|    in_macro = _mm_min_epi16(C0_uv_8x16, in_macro); //CLIP3
  523|   161k|    C0_uv_8x16 = _mm_subs_epi16(zero, C0_uv_8x16);
  524|   161k|    in_macro = _mm_max_epi16(C0_uv_8x16, in_macro);
  525|       |
  526|   161k|    p0_uv_8x16_1 = _mm_add_epi16(p0_uv_8x16, in_macro);
  527|   161k|    q0_uv_8x16_1 = _mm_sub_epi16(q0_uv_8x16, in_macro);
  528|       |
  529|   161k|    q0_uv_8x16 = _mm_unpackhi_epi8(q0_uv_16x8, zero);
  530|   161k|    q1_uv_8x16 = _mm_unpackhi_epi8(q1_uv_16x8, zero);
  531|   161k|    p1_uv_8x16 = _mm_unpackhi_epi8(p1_uv_16x8, zero);
  532|   161k|    p0_uv_8x16 = _mm_unpackhi_epi8(p0_uv_16x8, zero);
  533|       |
  534|   161k|    diff = _mm_subs_epi16(p0_uv_8x16, q0_uv_8x16); //Condn 1
  535|   161k|    diff = _mm_abs_epi16(diff);
  536|   161k|    alpha_cbcr_16x8 = _mm_set1_epi32(alpha_cbcr);
  537|   161k|    flag2 = _mm_cmpgt_epi16(alpha_cbcr_16x8, diff);
  538|       |
  539|   161k|    diff = _mm_subs_epi16(q1_uv_8x16, q0_uv_8x16); //Condtn 2
  540|   161k|    diff = _mm_abs_epi16(diff);
  541|   161k|    beta_cbcr_16x8 = _mm_set1_epi32(beta_cbcr);
  542|   161k|    flag2 = _mm_and_si128(flag2, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  543|       |
  544|   161k|    diff = _mm_subs_epi16(p1_uv_8x16, p0_uv_8x16); //Condtn 3
  545|   161k|    diff = _mm_abs_epi16(diff);
  546|   161k|    flag2 = _mm_and_si128(flag2, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  547|       |
  548|   161k|    diff = _mm_subs_epi16(q0_uv_8x16, p0_uv_8x16);
  549|   161k|    diff = _mm_slli_epi16(diff, 2);
  550|   161k|    diff1 = _mm_subs_epi16(p1_uv_8x16, q1_uv_8x16);
  551|   161k|    diff = _mm_add_epi16(diff, diff1);
  552|   161k|    diff = _mm_add_epi16(diff, _mm_set1_epi16(4));
  553|   161k|    in_macro = _mm_srai_epi16(diff, 3);
  554|       |
  555|   161k|    C0_uv_8x16 = _mm_set_epi16(pu1_cliptab_cr[u1_Bs3], pu1_cliptab_cb[u1_Bs3],
  556|   161k|                               pu1_cliptab_cr[u1_Bs3], pu1_cliptab_cb[u1_Bs3],
  557|   161k|                               pu1_cliptab_cr[u1_Bs2], pu1_cliptab_cb[u1_Bs2],
  558|   161k|                               pu1_cliptab_cr[u1_Bs2], pu1_cliptab_cb[u1_Bs2]);
  559|       |
  560|   161k|    C0_uv_8x16 = _mm_add_epi16(C0_uv_8x16, _mm_set1_epi16(1));
  561|       |
  562|   161k|    in_macro = _mm_min_epi16(C0_uv_8x16, in_macro); //CLIP3
  563|   161k|    C0_uv_8x16 = _mm_subs_epi16(zero, C0_uv_8x16);
  564|   161k|    in_macro = _mm_max_epi16(C0_uv_8x16, in_macro);
  565|       |
  566|   161k|    p0_uv_8x16_2 = _mm_add_epi16(p0_uv_8x16, in_macro);
  567|   161k|    q0_uv_8x16_2 = _mm_sub_epi16(q0_uv_8x16, in_macro);
  568|       |
  569|   161k|    p0_uv_8x16_2 = _mm_packus_epi16(p0_uv_8x16_1, p0_uv_8x16_2);
  570|   161k|    q0_uv_8x16_2 = _mm_packus_epi16(q0_uv_8x16_1, q0_uv_8x16_2);
  571|       |
  572|   161k|    flag1 = _mm_packs_epi16(flag1, flag2);
  573|   161k|    flag1 = _mm_and_si128(flag1, flag_bs); //Final flag (BS condition + other 3 conditions)
  574|       |
  575|   161k|    p0_uv_8x16_1 = _mm_and_si128(p0_uv_16x8,
  576|   161k|                                 _mm_xor_si128(flag1, _mm_set1_epi8(0xFF)));
  577|   161k|    p0_uv_8x16_2 = _mm_and_si128(p0_uv_8x16_2, flag1);
  578|   161k|    p0_uv_16x8 = _mm_add_epi8(p0_uv_8x16_1, p0_uv_8x16_2);
  579|       |
  580|   161k|    q0_uv_8x16_1 = _mm_and_si128(q0_uv_16x8,
  581|   161k|                                 _mm_xor_si128(flag1, _mm_set1_epi8(0xFF)));
  582|   161k|    q0_uv_8x16_2 = _mm_and_si128(q0_uv_8x16_2, flag1);
  583|   161k|    q0_uv_16x8 = _mm_add_epi8(q0_uv_8x16_1, q0_uv_8x16_2);
  584|       |
  585|       |    /* Inverse-transpose and store back */
  586|   161k|    temp1 = _mm_unpacklo_epi16(p1_uv_16x8, p0_uv_16x8);
  587|   161k|    temp2 = _mm_unpackhi_epi16(p1_uv_16x8, p0_uv_16x8);
  588|   161k|    temp3 = _mm_unpacklo_epi16(q0_uv_16x8, q1_uv_16x8);
  589|   161k|    temp4 = _mm_unpackhi_epi16(q0_uv_16x8, q1_uv_16x8);
  590|       |
  591|   161k|    linea = _mm_unpacklo_epi32(temp1, temp3);
  592|   161k|    lineb = _mm_srli_si128(linea, 8);
  593|   161k|    linec = _mm_unpackhi_epi32(temp1, temp3);
  594|   161k|    lined = _mm_srli_si128(linec, 8);
  595|   161k|    linee = _mm_unpacklo_epi32(temp2, temp4);
  596|   161k|    linef = _mm_srli_si128(linee, 8);
  597|   161k|    lineg = _mm_unpackhi_epi32(temp2, temp4);
  598|   161k|    lineh = _mm_srli_si128(lineg, 8);
  599|       |
  600|   161k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4), linea);
  601|   161k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4 + src_strd), lineb);
  602|   161k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4 + 2 * src_strd), linec);
  603|   161k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4 + 3 * src_strd), lined);
  604|   161k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4 + 4 * src_strd), linee);
  605|   161k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4 + 5 * src_strd), linef);
  606|   161k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4 + 6 * src_strd), lineg);
  607|   161k|    _mm_storel_epi64((__m128i *)(pu1_src_uv - 4 + 7 * src_strd), lineh);
  608|       |
  609|   161k|}
ih264_deblk_chroma_horz_bslt4_ssse3:
  657|   197k|{
  658|   197k|    UWORD8 *pu1_src_uv = pu1_src; /* Pointer to the src sample q0 of plane U*/
  659|   197k|    WORD16 i16_posP1, i16_posP0, i16_posQ1;
  660|   197k|    UWORD8 u1_Bs0, u1_Bs1, u1_Bs2, u1_Bs3;
  661|       |
  662|   197k|    UWORD8 *pu1_HorzPixelUV; /*! < Pointer to the first pixel of the boundary */
  663|   197k|    WORD32 alpha_cbcr = (alpha_cr << 16) + alpha_cb;
  664|   197k|    WORD32 beta_cbcr = (beta_cr << 16) + beta_cb;
  665|   197k|    __m128i q0_uv_16x8, p0_uv_16x8, q1_uv_16x8, p1_uv_16x8;
  666|   197k|    __m128i q0_uv_8x16, p0_uv_8x16, q1_uv_8x16, p1_uv_8x16;
  667|   197k|    __m128i flag_bs, flag1, flag2;
  668|   197k|    __m128i diff, diff1, alpha_cbcr_16x8, beta_cbcr_16x8, in_macro;
  669|   197k|    __m128i zero = _mm_setzero_si128();
  670|   197k|    __m128i C0_uv_8x16;
  671|   197k|    __m128i p0_uv_8x16_1, p0_uv_8x16_2, q0_uv_8x16_1, q0_uv_8x16_2;
  672|       |
  673|   197k|    pu1_HorzPixelUV = pu1_src_uv - (src_strd << 1);
  674|       |
  675|   197k|    i16_posQ1 = src_strd;
  676|   197k|    i16_posP0 = src_strd;
  677|   197k|    i16_posP1 = 0;
  678|       |
  679|   197k|    u1_Bs0 = (u4_bs >> 24) & 0xff;
  680|   197k|    u1_Bs1 = (u4_bs >> 16) & 0xff;
  681|   197k|    u1_Bs2 = (u4_bs >> 8) & 0xff;
  682|   197k|    u1_Bs3 = (u4_bs >> 0) & 0xff;
  683|       |
  684|   197k|    flag_bs = _mm_set_epi8(u1_Bs3, u1_Bs3, u1_Bs3, u1_Bs3, u1_Bs2, u1_Bs2,
  685|   197k|                           u1_Bs2, u1_Bs2, u1_Bs1, u1_Bs1, u1_Bs1, u1_Bs1,
  686|   197k|                           u1_Bs0, u1_Bs0, u1_Bs0, u1_Bs0);
  687|   197k|    flag_bs = _mm_cmpeq_epi8(flag_bs, zero); //Set flag to 1s and 0s
  688|   197k|    flag_bs = _mm_xor_si128(flag_bs, _mm_set1_epi8(0xFF)); //Invert for required mask
  689|       |
  690|   197k|    q0_uv_16x8 = _mm_loadu_si128((__m128i *)(pu1_src_uv));
  691|   197k|    q1_uv_16x8 = _mm_loadu_si128((__m128i *)(pu1_src_uv + i16_posQ1));
  692|   197k|    p1_uv_16x8 = _mm_loadu_si128((__m128i *)(pu1_HorzPixelUV + i16_posP1));
  693|   197k|    p0_uv_16x8 = _mm_loadu_si128((__m128i *)(pu1_HorzPixelUV + i16_posP0));
  694|       |
  695|   197k|    q0_uv_8x16 = _mm_unpacklo_epi8(q0_uv_16x8, zero);
  696|   197k|    q1_uv_8x16 = _mm_unpacklo_epi8(q1_uv_16x8, zero);
  697|   197k|    p1_uv_8x16 = _mm_unpacklo_epi8(p1_uv_16x8, zero);
  698|   197k|    p0_uv_8x16 = _mm_unpacklo_epi8(p0_uv_16x8, zero);
  699|       |
  700|   197k|    diff = _mm_subs_epi16(p0_uv_8x16, q0_uv_8x16); //Condn 1
  701|   197k|    diff = _mm_abs_epi16(diff);
  702|   197k|    alpha_cbcr_16x8 = _mm_set1_epi32(alpha_cbcr);
  703|   197k|    flag1 = _mm_cmpgt_epi16(alpha_cbcr_16x8, diff);
  704|       |
  705|   197k|    diff = _mm_subs_epi16(q1_uv_8x16, q0_uv_8x16); //Condtn 2
  706|   197k|    diff = _mm_abs_epi16(diff);
  707|   197k|    beta_cbcr_16x8 = _mm_set1_epi32(beta_cbcr);
  708|   197k|    flag1 = _mm_and_si128(flag1, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  709|       |
  710|   197k|    diff = _mm_subs_epi16(p1_uv_8x16, p0_uv_8x16); //Condtn 3
  711|   197k|    diff = _mm_abs_epi16(diff);
  712|   197k|    flag1 = _mm_and_si128(flag1, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  713|       |
  714|   197k|    diff = _mm_subs_epi16(q0_uv_8x16, p0_uv_8x16);
  715|   197k|    diff = _mm_slli_epi16(diff, 2);
  716|   197k|    diff1 = _mm_subs_epi16(p1_uv_8x16, q1_uv_8x16);
  717|   197k|    diff = _mm_add_epi16(diff, diff1);
  718|   197k|    diff = _mm_add_epi16(diff, _mm_set1_epi16(4));
  719|   197k|    in_macro = _mm_srai_epi16(diff, 3);
  720|       |
  721|   197k|    C0_uv_8x16 = _mm_set_epi16(pu1_cliptab_cr[u1_Bs1], pu1_cliptab_cb[u1_Bs1],
  722|   197k|                               pu1_cliptab_cr[u1_Bs1], pu1_cliptab_cb[u1_Bs1],
  723|   197k|                               pu1_cliptab_cr[u1_Bs0], pu1_cliptab_cb[u1_Bs0],
  724|   197k|                               pu1_cliptab_cr[u1_Bs0], pu1_cliptab_cb[u1_Bs0]);
  725|       |
  726|   197k|    C0_uv_8x16 = _mm_add_epi16(C0_uv_8x16, _mm_set1_epi16(1));
  727|       |
  728|   197k|    in_macro = _mm_min_epi16(C0_uv_8x16, in_macro); //CLIP3
  729|   197k|    C0_uv_8x16 = _mm_subs_epi16(zero, C0_uv_8x16);
  730|   197k|    in_macro = _mm_max_epi16(C0_uv_8x16, in_macro);
  731|       |
  732|   197k|    p0_uv_8x16_1 = _mm_add_epi16(p0_uv_8x16, in_macro);
  733|   197k|    q0_uv_8x16_1 = _mm_sub_epi16(q0_uv_8x16, in_macro);
  734|       |
  735|   197k|    q0_uv_8x16 = _mm_unpackhi_epi8(q0_uv_16x8, zero);
  736|   197k|    q1_uv_8x16 = _mm_unpackhi_epi8(q1_uv_16x8, zero);
  737|   197k|    p1_uv_8x16 = _mm_unpackhi_epi8(p1_uv_16x8, zero);
  738|   197k|    p0_uv_8x16 = _mm_unpackhi_epi8(p0_uv_16x8, zero);
  739|       |
  740|   197k|    diff = _mm_subs_epi16(p0_uv_8x16, q0_uv_8x16); //Condn 1
  741|   197k|    diff = _mm_abs_epi16(diff);
  742|   197k|    alpha_cbcr_16x8 = _mm_set1_epi32(alpha_cbcr);
  743|   197k|    flag2 = _mm_cmpgt_epi16(alpha_cbcr_16x8, diff);
  744|       |
  745|   197k|    diff = _mm_subs_epi16(q1_uv_8x16, q0_uv_8x16); //Condtn 2
  746|   197k|    diff = _mm_abs_epi16(diff);
  747|   197k|    beta_cbcr_16x8 = _mm_set1_epi32(beta_cbcr);
  748|   197k|    flag2 = _mm_and_si128(flag2, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  749|       |
  750|   197k|    diff = _mm_subs_epi16(p1_uv_8x16, p0_uv_8x16); //Condtn 3
  751|   197k|    diff = _mm_abs_epi16(diff);
  752|   197k|    flag2 = _mm_and_si128(flag2, _mm_cmpgt_epi16(beta_cbcr_16x8, diff));
  753|       |
  754|   197k|    diff = _mm_subs_epi16(q0_uv_8x16, p0_uv_8x16);
  755|   197k|    diff = _mm_slli_epi16(diff, 2);
  756|   197k|    diff1 = _mm_subs_epi16(p1_uv_8x16, q1_uv_8x16);
  757|   197k|    diff = _mm_add_epi16(diff, diff1);
  758|   197k|    diff = _mm_add_epi16(diff, _mm_set1_epi16(4));
  759|   197k|    in_macro = _mm_srai_epi16(diff, 3);
  760|       |
  761|   197k|    C0_uv_8x16 = _mm_set_epi16(pu1_cliptab_cr[u1_Bs3], pu1_cliptab_cb[u1_Bs3],
  762|   197k|                               pu1_cliptab_cr[u1_Bs3], pu1_cliptab_cb[u1_Bs3],
  763|   197k|                               pu1_cliptab_cr[u1_Bs2], pu1_cliptab_cb[u1_Bs2],
  764|   197k|                               pu1_cliptab_cr[u1_Bs2], pu1_cliptab_cb[u1_Bs2]);
  765|       |
  766|   197k|    C0_uv_8x16 = _mm_add_epi16(C0_uv_8x16, _mm_set1_epi16(1));
  767|       |
  768|   197k|    in_macro = _mm_min_epi16(C0_uv_8x16, in_macro); //CLIP3
  769|   197k|    C0_uv_8x16 = _mm_subs_epi16(zero, C0_uv_8x16);
  770|   197k|    in_macro = _mm_max_epi16(C0_uv_8x16, in_macro);
  771|       |
  772|   197k|    p0_uv_8x16_2 = _mm_add_epi16(p0_uv_8x16, in_macro);
  773|   197k|    q0_uv_8x16_2 = _mm_sub_epi16(q0_uv_8x16, in_macro);
  774|       |
  775|   197k|    p0_uv_8x16_2 = _mm_packus_epi16(p0_uv_8x16_1, p0_uv_8x16_2);
  776|   197k|    q0_uv_8x16_2 = _mm_packus_epi16(q0_uv_8x16_1, q0_uv_8x16_2);
  777|       |
  778|   197k|    flag1 = _mm_packs_epi16(flag1, flag2);
  779|   197k|    flag1 = _mm_and_si128(flag1, flag_bs); //Final flag (BS condition + other 3 conditions)
  780|       |
  781|   197k|    p0_uv_8x16_1 = _mm_and_si128(p0_uv_16x8,
  782|   197k|                                 _mm_xor_si128(flag1, _mm_set1_epi8(0xFF)));
  783|   197k|    p0_uv_8x16_2 = _mm_and_si128(p0_uv_8x16_2, flag1);
  784|   197k|    p0_uv_8x16_1 = _mm_add_epi8(p0_uv_8x16_1, p0_uv_8x16_2);
  785|   197k|    _mm_storeu_si128((__m128i *)(pu1_HorzPixelUV + i16_posP0), p0_uv_8x16_1);
  786|       |
  787|   197k|    q0_uv_8x16_1 = _mm_and_si128(q0_uv_16x8,
  788|   197k|                                 _mm_xor_si128(flag1, _mm_set1_epi8(0xFF)));
  789|   197k|    q0_uv_8x16_2 = _mm_and_si128(q0_uv_8x16_2, flag1);
  790|   197k|    q0_uv_8x16_1 = _mm_add_epi8(q0_uv_8x16_1, q0_uv_8x16_2);
  791|   197k|    _mm_storeu_si128((__m128i *)(pu1_src_uv), q0_uv_8x16_1);
  792|       |
  793|   197k|}

ih264_deblk_luma_vert_bs4_ssse3:
   94|  36.8k|{
   95|  36.8k|    __m128i zero = _mm_setzero_si128();
   96|  36.8k|    __m128i q0_16x8, q1_16x8, q2_16x8, q3_16x8;
   97|  36.8k|    __m128i p0_16x8, p1_16x8, p2_16x8, p3_16x8;
   98|  36.8k|    __m128i q0_8x16, q1_8x16, q2_8x16, q3_8x16;
   99|  36.8k|    __m128i p0_8x16, p1_8x16, p2_8x16, p3_8x16;
  100|  36.8k|    __m128i q0_16x8_1;
  101|  36.8k|    __m128i p0_16x8_1;
  102|  36.8k|    __m128i q0_16x8_2, q1_16x8_2, q2_16x8_2;
  103|  36.8k|    __m128i p0_16x8_2, p1_16x8_2, p2_16x8_2;
  104|  36.8k|    __m128i temp1, temp2, temp3, temp4, temp5, temp6;
  105|  36.8k|    __m128i Alpha_8x16, Beta_8x16;
  106|  36.8k|    __m128i flag1_16x8, flag2_16x8, flag3_16x8, flag4_16x8;
  107|  36.8k|    __m128i const_val2_16x8 = _mm_set1_epi16(2);
  108|  36.8k|    __m128i line1, line2, line3, line4, line5, line6, line7, line8;
  109|       |
  110|  36.8k|    Alpha_8x16 = _mm_set1_epi16(alpha);
  111|  36.8k|    Beta_8x16 = _mm_set1_epi16(beta);
  112|       |
  113|  36.8k|    line1 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 0 * src_strd));
  114|  36.8k|    line2 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 1 * src_strd));
  115|  36.8k|    line3 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 2 * src_strd));
  116|  36.8k|    line4 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 3 * src_strd));
  117|  36.8k|    line5 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 4 * src_strd));
  118|  36.8k|    line6 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 5 * src_strd));
  119|  36.8k|    line7 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 6 * src_strd));
  120|  36.8k|    line8 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 7 * src_strd));
  121|       |
  122|  36.8k|    temp1 = _mm_unpacklo_epi8(line1, line2);
  123|  36.8k|    temp2 = _mm_unpacklo_epi8(line3, line4);
  124|  36.8k|    temp3 = _mm_unpacklo_epi8(line5, line6);
  125|  36.8k|    temp4 = _mm_unpacklo_epi8(line7, line8);
  126|       |
  127|  36.8k|    line1 = _mm_unpacklo_epi16(temp1, temp2);
  128|  36.8k|    line2 = _mm_unpackhi_epi16(temp1, temp2);
  129|  36.8k|    line3 = _mm_unpacklo_epi16(temp3, temp4);
  130|  36.8k|    line4 = _mm_unpackhi_epi16(temp3, temp4);
  131|       |
  132|  36.8k|    p1_8x16 = _mm_unpacklo_epi32(line1, line3);
  133|  36.8k|    p0_8x16 = _mm_unpackhi_epi32(line1, line3);
  134|  36.8k|    q0_8x16 = _mm_unpacklo_epi32(line2, line4);
  135|  36.8k|    q1_8x16 = _mm_unpackhi_epi32(line2, line4);
  136|       |
  137|  36.8k|    line1 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 8 * src_strd));
  138|  36.8k|    line2 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 9 * src_strd));
  139|  36.8k|    line3 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 10 * src_strd));
  140|  36.8k|    line4 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 11 * src_strd));
  141|  36.8k|    line5 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 12 * src_strd));
  142|  36.8k|    line6 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 13 * src_strd));
  143|  36.8k|    line7 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 14 * src_strd));
  144|  36.8k|    line8 = _mm_loadl_epi64((__m128i *)(pu1_src - 4 + 15 * src_strd));
  145|       |
  146|  36.8k|    temp1 = _mm_unpacklo_epi8(line1, line2);
  147|  36.8k|    temp2 = _mm_unpacklo_epi8(line3, line4);
  148|  36.8k|    temp3 = _mm_unpacklo_epi8(line5, line6);
  149|  36.8k|    temp4 = _mm_unpacklo_epi8(line7, line8);
  150|       |
  151|  36.8k|    line1 = _mm_unpacklo_epi16(temp1, temp2);
  152|  36.8k|    line2 = _mm_unpackhi_epi16(temp1, temp2);
  153|  36.8k|    line3 = _mm_unpacklo_epi16(temp3, temp4);
  154|  36.8k|    line4 = _mm_unpackhi_epi16(temp3, temp4);
  155|       |
  156|  36.8k|    temp1 = _mm_unpacklo_epi32(line1, line3);
  157|  36.8k|    temp2 = _mm_unpackhi_epi32(line1, line3);
  158|  36.8k|    temp3 = _mm_unpacklo_epi32(line2, line4);
  159|  36.8k|    temp4 = _mm_unpackhi_epi32(line2, line4);
  160|       |
  161|  36.8k|    p3_16x8 = _mm_unpacklo_epi64(p1_8x16, temp1);
  162|  36.8k|    p2_16x8 = _mm_unpackhi_epi64(p1_8x16, temp1);
  163|  36.8k|    q2_16x8 = _mm_unpacklo_epi64(q1_8x16, temp4);
  164|  36.8k|    q3_16x8 = _mm_unpackhi_epi64(q1_8x16, temp4);
  165|  36.8k|    p1_16x8 = _mm_unpacklo_epi64(p0_8x16, temp2);
  166|  36.8k|    p0_16x8 = _mm_unpackhi_epi64(p0_8x16, temp2);
  167|  36.8k|    q0_16x8 = _mm_unpacklo_epi64(q0_8x16, temp3);
  168|  36.8k|    q1_16x8 = _mm_unpackhi_epi64(q0_8x16, temp3);
  169|       |
  170|       |    //Cond1 (ABS(p0 - q0) < alpha)
  171|  36.8k|    temp1 = _mm_subs_epu8(q0_16x8, p0_16x8);
  172|  36.8k|    temp2 = _mm_subs_epu8(p0_16x8, q0_16x8);
  173|  36.8k|    temp1 = _mm_add_epi8(temp1, temp2);
  174|       |
  175|  36.8k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
  176|  36.8k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
  177|       |
  178|  36.8k|    temp2 = _mm_cmpgt_epi16(Alpha_8x16, temp2);
  179|  36.8k|    temp1 = _mm_cmpgt_epi16(Alpha_8x16, temp1);
  180|       |
  181|  36.8k|    flag1_16x8 = _mm_packs_epi16(temp2, temp1);
  182|       |
  183|       |    //Cond2 (ABS(q1 - q0) < beta)
  184|  36.8k|    temp1 = _mm_subs_epu8(q0_16x8, q1_16x8);
  185|  36.8k|    temp2 = _mm_subs_epu8(q1_16x8, q0_16x8);
  186|  36.8k|    temp1 = _mm_add_epi8(temp1, temp2);
  187|       |
  188|  36.8k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
  189|  36.8k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
  190|       |
  191|  36.8k|    temp2 = _mm_cmpgt_epi16(Beta_8x16, temp2);
  192|  36.8k|    temp1 = _mm_cmpgt_epi16(Beta_8x16, temp1);
  193|       |
  194|  36.8k|    flag2_16x8 = _mm_packs_epi16(temp2, temp1);
  195|       |
  196|  36.8k|    flag1_16x8 = _mm_and_si128(flag1_16x8, flag2_16x8);
  197|       |
  198|       |    //Cond3 (ABS(p1 - p0) < beta)
  199|  36.8k|    temp1 = _mm_subs_epu8(p0_16x8, p1_16x8);
  200|  36.8k|    temp2 = _mm_subs_epu8(p1_16x8, p0_16x8);
  201|  36.8k|    temp1 = _mm_add_epi8(temp1, temp2);
  202|       |
  203|  36.8k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
  204|  36.8k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
  205|       |
  206|  36.8k|    temp2 = _mm_cmpgt_epi16(Beta_8x16, temp2);
  207|  36.8k|    temp1 = _mm_cmpgt_epi16(Beta_8x16, temp1);
  208|       |
  209|  36.8k|    flag2_16x8 = _mm_packs_epi16(temp2, temp1);
  210|       |
  211|       |    // !((ABS(p0 - q0) < alpha) || (ABS(q1 - q0) < beta) || (ABS(p1 - p0) < beta))
  212|  36.8k|    flag1_16x8 = _mm_and_si128(flag1_16x8, flag2_16x8);
  213|       |
  214|       |    // (ABS(p0 - q0) < ((alpha >> 2) + 2))
  215|  36.8k|    temp1 = _mm_subs_epu8(p0_16x8, q0_16x8);
  216|  36.8k|    temp2 = _mm_subs_epu8(q0_16x8, p0_16x8);
  217|  36.8k|    temp1 = _mm_add_epi8(temp1, temp2);
  218|  36.8k|    Alpha_8x16 = _mm_srai_epi16(Alpha_8x16, 2);
  219|  36.8k|    Alpha_8x16 = _mm_add_epi16(Alpha_8x16, const_val2_16x8);
  220|       |
  221|  36.8k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
  222|  36.8k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
  223|  36.8k|    temp2 = _mm_cmpgt_epi16(Alpha_8x16, temp2);
  224|  36.8k|    temp1 = _mm_cmpgt_epi16(Alpha_8x16, temp1);
  225|       |
  226|  36.8k|    flag2_16x8 = _mm_packs_epi16(temp2, temp1);
  227|  36.8k|    flag2_16x8 = _mm_and_si128(flag1_16x8, flag2_16x8);
  228|       |
  229|       |    // (ABS(p2 - p0) < beta)
  230|  36.8k|    temp1 = _mm_subs_epu8(p0_16x8, p2_16x8);
  231|  36.8k|    temp2 = _mm_subs_epu8(p2_16x8, p0_16x8);
  232|  36.8k|    temp1 = _mm_add_epi8(temp1, temp2);
  233|       |
  234|  36.8k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
  235|  36.8k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
  236|  36.8k|    temp2 = _mm_cmpgt_epi16(Beta_8x16, temp2);
  237|  36.8k|    temp1 = _mm_cmpgt_epi16(Beta_8x16, temp1);
  238|       |
  239|  36.8k|    flag3_16x8 = _mm_packs_epi16(temp2, temp1);
  240|  36.8k|    flag3_16x8 = _mm_and_si128(flag3_16x8, flag2_16x8);
  241|       |
  242|       |    // (ABS(q2 - q0) < beta)
  243|  36.8k|    temp1 = _mm_subs_epu8(q0_16x8, q2_16x8);
  244|  36.8k|    temp2 = _mm_subs_epu8(q2_16x8, q0_16x8);
  245|  36.8k|    temp1 = _mm_add_epi8(temp1, temp2);
  246|       |
  247|  36.8k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
  248|  36.8k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
  249|  36.8k|    temp2 = _mm_cmpgt_epi16(Beta_8x16, temp2);
  250|  36.8k|    temp1 = _mm_cmpgt_epi16(Beta_8x16, temp1);
  251|       |
  252|  36.8k|    flag4_16x8 = _mm_packs_epi16(temp2, temp1);
  253|  36.8k|    flag4_16x8 = _mm_and_si128(flag4_16x8, flag2_16x8);
  254|       |
  255|       |    // First 8 pixels
  256|  36.8k|    p3_8x16 = _mm_unpacklo_epi8(p3_16x8, zero);
  257|  36.8k|    p2_8x16 = _mm_unpacklo_epi8(p2_16x8, zero);
  258|  36.8k|    p1_8x16 = _mm_unpacklo_epi8(p1_16x8, zero);
  259|  36.8k|    p0_8x16 = _mm_unpacklo_epi8(p0_16x8, zero);
  260|  36.8k|    q0_8x16 = _mm_unpacklo_epi8(q0_16x8, zero);
  261|  36.8k|    q1_8x16 = _mm_unpacklo_epi8(q1_16x8, zero);
  262|  36.8k|    q2_8x16 = _mm_unpacklo_epi8(q2_16x8, zero);
  263|  36.8k|    q3_8x16 = _mm_unpacklo_epi8(q3_16x8, zero);
  264|       |
  265|       |    // p0_1 and q0_1
  266|  36.8k|    temp1 = _mm_add_epi16(p0_8x16, q1_8x16);
  267|  36.8k|    temp2 = _mm_add_epi16(p1_8x16, q0_8x16);
  268|  36.8k|    temp5 = _mm_add_epi16(temp1, const_val2_16x8);
  269|  36.8k|    temp6 = _mm_add_epi16(temp2, const_val2_16x8);
  270|  36.8k|    temp3 = _mm_slli_epi16(p1_8x16, 1);
  271|  36.8k|    temp4 = _mm_slli_epi16(q1_8x16, 1);
  272|  36.8k|    temp1 = _mm_add_epi16(temp5, temp3);
  273|  36.8k|    temp2 = _mm_add_epi16(temp6, temp4);
  274|  36.8k|    p0_16x8_1 = _mm_srai_epi16(temp1, 2);
  275|  36.8k|    q0_16x8_1 = _mm_srai_epi16(temp2, 2);
  276|       |
  277|       |    // p1_2 and q1_2
  278|  36.8k|    temp6 = _mm_add_epi16(temp6, p0_8x16);
  279|  36.8k|    temp5 = _mm_add_epi16(temp5, q0_8x16);
  280|  36.8k|    temp1 = _mm_add_epi16(temp6, p2_8x16);
  281|  36.8k|    temp2 = _mm_add_epi16(temp5, q2_8x16);
  282|  36.8k|    p1_16x8_2 = _mm_srai_epi16(temp1, 2);
  283|  36.8k|    q1_16x8_2 = _mm_srai_epi16(temp2, 2);
  284|       |
  285|       |    // p0_2 and q0_2
  286|  36.8k|    temp1 = _mm_add_epi16(temp3, p2_8x16);
  287|  36.8k|    temp2 = _mm_add_epi16(temp4, q2_8x16);
  288|  36.8k|    temp1 = _mm_add_epi16(temp1, q1_8x16);
  289|  36.8k|    temp2 = _mm_add_epi16(temp2, p1_8x16);
  290|  36.8k|    temp3 = _mm_add_epi16(p0_8x16, q0_8x16);
  291|  36.8k|    temp3 = _mm_slli_epi16(temp3, 1);
  292|  36.8k|    temp1 = _mm_add_epi16(temp1, temp3);
  293|  36.8k|    temp2 = _mm_add_epi16(temp2, temp3);
  294|  36.8k|    temp1 = _mm_add_epi16(temp1, _mm_set1_epi16(4));
  295|  36.8k|    temp2 = _mm_add_epi16(temp2, _mm_set1_epi16(4));
  296|  36.8k|    p0_16x8_2 = _mm_srai_epi16(temp1, 3);
  297|  36.8k|    q0_16x8_2 = _mm_srai_epi16(temp2, 3);
  298|       |
  299|       |    // p2_2 and q2_2
  300|  36.8k|    temp1 = _mm_add_epi16(temp6, const_val2_16x8);
  301|  36.8k|    temp2 = _mm_add_epi16(temp5, const_val2_16x8);
  302|  36.8k|    temp3 = _mm_slli_epi16(p2_8x16, 1);
  303|  36.8k|    temp4 = _mm_slli_epi16(q2_8x16, 1);
  304|  36.8k|    temp3 = _mm_add_epi16(p2_8x16, temp3);
  305|  36.8k|    temp4 = _mm_add_epi16(q2_8x16, temp4);
  306|  36.8k|    temp5 = _mm_slli_epi16(p3_8x16, 1);
  307|  36.8k|    temp6 = _mm_slli_epi16(q3_8x16, 1);
  308|  36.8k|    temp1 = _mm_add_epi16(temp1, temp3);
  309|  36.8k|    temp2 = _mm_add_epi16(temp2, temp4);
  310|  36.8k|    temp1 = _mm_add_epi16(temp1, temp5);
  311|  36.8k|    temp2 = _mm_add_epi16(temp2, temp6);
  312|  36.8k|    p2_16x8_2 = _mm_srai_epi16(temp1, 3);
  313|  36.8k|    q2_16x8_2 = _mm_srai_epi16(temp2, 3);
  314|       |
  315|       |    // Second 8 pixels and packing with first 8 pixels
  316|  36.8k|    p3_8x16 = _mm_unpackhi_epi8(p3_16x8, zero);
  317|  36.8k|    p2_8x16 = _mm_unpackhi_epi8(p2_16x8, zero);
  318|  36.8k|    p1_8x16 = _mm_unpackhi_epi8(p1_16x8, zero);
  319|  36.8k|    p0_8x16 = _mm_unpackhi_epi8(p0_16x8, zero);
  320|  36.8k|    q0_8x16 = _mm_unpackhi_epi8(q0_16x8, zero);
  321|  36.8k|    q1_8x16 = _mm_unpackhi_epi8(q1_16x8, zero);
  322|  36.8k|    q2_8x16 = _mm_unpackhi_epi8(q2_16x8, zero);
  323|  36.8k|    q3_8x16 = _mm_unpackhi_epi8(q3_16x8, zero);
  324|       |
  325|       |    // p0_1 and q0_1
  326|  36.8k|    temp1 = _mm_add_epi16(p0_8x16, q1_8x16);
  327|  36.8k|    temp2 = _mm_add_epi16(p1_8x16, q0_8x16);
  328|  36.8k|    temp5 = _mm_add_epi16(temp1, const_val2_16x8);
  329|  36.8k|    temp6 = _mm_add_epi16(temp2, const_val2_16x8);
  330|  36.8k|    temp3 = _mm_slli_epi16(p1_8x16, 1);
  331|  36.8k|    temp4 = _mm_slli_epi16(q1_8x16, 1);
  332|  36.8k|    temp1 = _mm_add_epi16(temp5, temp3);
  333|  36.8k|    temp2 = _mm_add_epi16(temp6, temp4);
  334|  36.8k|    temp1 = _mm_srai_epi16(temp1, 2);
  335|  36.8k|    temp2 = _mm_srai_epi16(temp2, 2);
  336|  36.8k|    p0_16x8_1 = _mm_packus_epi16(p0_16x8_1, temp1);
  337|  36.8k|    q0_16x8_1 = _mm_packus_epi16(q0_16x8_1, temp2);
  338|       |
  339|       |    // p1_2 and q1_2
  340|  36.8k|    temp6 = _mm_add_epi16(temp6, p0_8x16);
  341|  36.8k|    temp5 = _mm_add_epi16(temp5, q0_8x16);
  342|  36.8k|    temp1 = _mm_add_epi16(temp6, p2_8x16);
  343|  36.8k|    temp2 = _mm_add_epi16(temp5, q2_8x16);
  344|  36.8k|    temp1 = _mm_srai_epi16(temp1, 2);
  345|  36.8k|    temp2 = _mm_srai_epi16(temp2, 2);
  346|  36.8k|    p1_16x8_2 = _mm_packus_epi16(p1_16x8_2, temp1);
  347|  36.8k|    q1_16x8_2 = _mm_packus_epi16(q1_16x8_2, temp2);
  348|       |
  349|       |    // p0_2 and q0_2
  350|  36.8k|    temp1 = _mm_add_epi16(temp3, p2_8x16);
  351|  36.8k|    temp2 = _mm_add_epi16(temp4, q2_8x16);
  352|  36.8k|    temp1 = _mm_add_epi16(temp1, q1_8x16);
  353|  36.8k|    temp2 = _mm_add_epi16(temp2, p1_8x16);
  354|  36.8k|    temp3 = _mm_add_epi16(p0_8x16, q0_8x16);
  355|  36.8k|    temp3 = _mm_slli_epi16(temp3, 1);
  356|  36.8k|    temp1 = _mm_add_epi16(temp1, temp3);
  357|  36.8k|    temp2 = _mm_add_epi16(temp2, temp3);
  358|  36.8k|    temp1 = _mm_add_epi16(temp1, _mm_set1_epi16(4));
  359|  36.8k|    temp2 = _mm_add_epi16(temp2, _mm_set1_epi16(4));
  360|  36.8k|    temp1 = _mm_srai_epi16(temp1, 3);
  361|  36.8k|    temp2 = _mm_srai_epi16(temp2, 3);
  362|  36.8k|    p0_16x8_2 = _mm_packus_epi16(p0_16x8_2, temp1);
  363|  36.8k|    q0_16x8_2 = _mm_packus_epi16(q0_16x8_2, temp2);
  364|       |
  365|       |    // p2_2 and q2_2
  366|  36.8k|    temp1 = _mm_add_epi16(temp6, const_val2_16x8);
  367|  36.8k|    temp2 = _mm_add_epi16(temp5, const_val2_16x8);
  368|  36.8k|    temp3 = _mm_slli_epi16(p2_8x16, 1);
  369|  36.8k|    temp4 = _mm_slli_epi16(q2_8x16, 1);
  370|  36.8k|    temp3 = _mm_add_epi16(p2_8x16, temp3);
  371|  36.8k|    temp4 = _mm_add_epi16(q2_8x16, temp4);
  372|  36.8k|    temp5 = _mm_slli_epi16(p3_8x16, 1);
  373|  36.8k|    temp6 = _mm_slli_epi16(q3_8x16, 1);
  374|  36.8k|    temp1 = _mm_add_epi16(temp1, temp3);
  375|  36.8k|    temp2 = _mm_add_epi16(temp2, temp4);
  376|  36.8k|    temp1 = _mm_add_epi16(temp1, temp5);
  377|  36.8k|    temp2 = _mm_add_epi16(temp2, temp6);
  378|  36.8k|    temp1 = _mm_srai_epi16(temp1, 3);
  379|  36.8k|    temp2 = _mm_srai_epi16(temp2, 3);
  380|  36.8k|    p2_16x8_2 = _mm_packus_epi16(p2_16x8_2, temp1);
  381|  36.8k|    q2_16x8_2 = _mm_packus_epi16(q2_16x8_2, temp2);
  382|       |
  383|       |    // p0 and q0
  384|  36.8k|    p0_16x8 = _mm_and_si128(p0_16x8,
  385|  36.8k|                            _mm_xor_si128(flag1_16x8, _mm_set1_epi8(0xFF)));
  386|  36.8k|    p0_16x8_1 = _mm_and_si128(p0_16x8_1, flag1_16x8);
  387|  36.8k|    p0_16x8 = _mm_add_epi8(p0_16x8, p0_16x8_1);
  388|  36.8k|    q0_16x8 = _mm_and_si128(q0_16x8,
  389|  36.8k|                            _mm_xor_si128(flag1_16x8, _mm_set1_epi8(0xFF)));
  390|  36.8k|    q0_16x8_1 = _mm_and_si128(q0_16x8_1, flag1_16x8);
  391|  36.8k|    q0_16x8 = _mm_add_epi8(q0_16x8, q0_16x8_1);
  392|       |
  393|       |    // p0 and q0
  394|  36.8k|    p0_16x8 = _mm_and_si128(p0_16x8,
  395|  36.8k|                            _mm_xor_si128(flag3_16x8, _mm_set1_epi8(0xFF)));
  396|  36.8k|    p0_16x8_2 = _mm_and_si128(p0_16x8_2, flag3_16x8);
  397|  36.8k|    p0_16x8 = _mm_add_epi8(p0_16x8, p0_16x8_2);
  398|  36.8k|    q0_16x8 = _mm_and_si128(q0_16x8,
  399|  36.8k|                            _mm_xor_si128(flag4_16x8, _mm_set1_epi8(0xFF)));
  400|  36.8k|    q0_16x8_2 = _mm_and_si128(q0_16x8_2, flag4_16x8);
  401|  36.8k|    q0_16x8 = _mm_add_epi8(q0_16x8, q0_16x8_2);
  402|       |
  403|       |    // p1 and q1
  404|  36.8k|    p1_16x8 = _mm_and_si128(p1_16x8,
  405|  36.8k|                            _mm_xor_si128(flag3_16x8, _mm_set1_epi8(0xFF)));
  406|  36.8k|    p1_16x8_2 = _mm_and_si128(p1_16x8_2, flag3_16x8);
  407|  36.8k|    p1_16x8 = _mm_add_epi8(p1_16x8, p1_16x8_2);
  408|  36.8k|    q1_16x8 = _mm_and_si128(q1_16x8,
  409|  36.8k|                            _mm_xor_si128(flag4_16x8, _mm_set1_epi8(0xFF)));
  410|  36.8k|    q1_16x8_2 = _mm_and_si128(q1_16x8_2, flag4_16x8);
  411|  36.8k|    q1_16x8 = _mm_add_epi8(q1_16x8, q1_16x8_2);
  412|       |
  413|       |    // p2 and q2
  414|  36.8k|    p2_16x8 = _mm_and_si128(p2_16x8,
  415|  36.8k|                            _mm_xor_si128(flag3_16x8, _mm_set1_epi8(0xFF)));
  416|  36.8k|    p2_16x8_2 = _mm_and_si128(p2_16x8_2, flag3_16x8);
  417|  36.8k|    p2_16x8 = _mm_add_epi8(p2_16x8, p2_16x8_2);
  418|  36.8k|    q2_16x8 = _mm_and_si128(q2_16x8,
  419|  36.8k|                            _mm_xor_si128(flag4_16x8, _mm_set1_epi8(0xFF)));
  420|  36.8k|    q2_16x8_2 = _mm_and_si128(q2_16x8_2, flag4_16x8);
  421|  36.8k|    q2_16x8 = _mm_add_epi8(q2_16x8, q2_16x8_2);
  422|       |
  423|  36.8k|    temp1 = _mm_unpacklo_epi8(p3_16x8, p2_16x8);
  424|  36.8k|    temp2 = _mm_unpacklo_epi8(p1_16x8, p0_16x8);
  425|  36.8k|    temp3 = _mm_unpacklo_epi8(q0_16x8, q1_16x8);
  426|  36.8k|    temp4 = _mm_unpacklo_epi8(q2_16x8, q3_16x8);
  427|       |
  428|  36.8k|    p3_8x16 = _mm_unpacklo_epi16(temp1, temp2);
  429|  36.8k|    p2_8x16 = _mm_unpackhi_epi16(temp1, temp2);
  430|  36.8k|    q2_8x16 = _mm_unpacklo_epi16(temp3, temp4);
  431|  36.8k|    q3_8x16 = _mm_unpackhi_epi16(temp3, temp4);
  432|       |
  433|  36.8k|    line1 = _mm_unpacklo_epi32(p3_8x16, q2_8x16);
  434|  36.8k|    line2 = _mm_srli_si128(line1, 8);
  435|  36.8k|    line3 = _mm_unpackhi_epi32(p3_8x16, q2_8x16);
  436|  36.8k|    line4 = _mm_srli_si128(line3, 8);
  437|  36.8k|    line5 = _mm_unpacklo_epi32(p2_8x16, q3_8x16);
  438|  36.8k|    line6 = _mm_srli_si128(line5, 8);
  439|  36.8k|    line7 = _mm_unpackhi_epi32(p2_8x16, q3_8x16);
  440|  36.8k|    line8 = _mm_srli_si128(line7, 8);
  441|       |
  442|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 0 * src_strd), line1);
  443|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 1 * src_strd), line2);
  444|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 2 * src_strd), line3);
  445|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 3 * src_strd), line4);
  446|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 4 * src_strd), line5);
  447|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 5 * src_strd), line6);
  448|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 6 * src_strd), line7);
  449|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 7 * src_strd), line8);
  450|       |
  451|  36.8k|    temp1 = _mm_unpackhi_epi8(p3_16x8, p2_16x8);
  452|  36.8k|    temp2 = _mm_unpackhi_epi8(p1_16x8, p0_16x8);
  453|  36.8k|    temp3 = _mm_unpackhi_epi8(q0_16x8, q1_16x8);
  454|  36.8k|    temp4 = _mm_unpackhi_epi8(q2_16x8, q3_16x8);
  455|       |
  456|  36.8k|    p3_8x16 = _mm_unpacklo_epi16(temp1, temp2);
  457|  36.8k|    p2_8x16 = _mm_unpackhi_epi16(temp1, temp2);
  458|  36.8k|    q2_8x16 = _mm_unpacklo_epi16(temp3, temp4);
  459|  36.8k|    q3_8x16 = _mm_unpackhi_epi16(temp3, temp4);
  460|       |
  461|  36.8k|    line1 = _mm_unpacklo_epi32(p3_8x16, q2_8x16);
  462|  36.8k|    line2 = _mm_srli_si128(line1, 8);
  463|  36.8k|    line3 = _mm_unpackhi_epi32(p3_8x16, q2_8x16);
  464|  36.8k|    line4 = _mm_srli_si128(line3, 8);
  465|  36.8k|    line5 = _mm_unpacklo_epi32(p2_8x16, q3_8x16);
  466|  36.8k|    line6 = _mm_srli_si128(line5, 8);
  467|  36.8k|    line7 = _mm_unpackhi_epi32(p2_8x16, q3_8x16);
  468|  36.8k|    line8 = _mm_srli_si128(line7, 8);
  469|       |
  470|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 8 * src_strd), line1);
  471|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 9 * src_strd), line2);
  472|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 10 * src_strd), line3);
  473|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 11 * src_strd), line4);
  474|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 12 * src_strd), line5);
  475|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 13 * src_strd), line6);
  476|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 14 * src_strd), line7);
  477|  36.8k|    _mm_storel_epi64((__m128i *)(pu1_src - 4 + 15 * src_strd), line8);
  478|       |
  479|  36.8k|}
ih264_deblk_luma_horz_bs4_ssse3:
  515|  39.3k|{
  516|  39.3k|    WORD16 i16_posP3, i16_posP2, i16_posP1, i16_posP0;
  517|  39.3k|    WORD16 i16_posQ1, i16_posQ2, i16_posQ3;
  518|  39.3k|    UWORD8 *pu1_HorzPixel;
  519|  39.3k|    __m128i zero = _mm_setzero_si128();
  520|  39.3k|    __m128i q0_16x8, q1_16x8, q2_16x8, q3_16x8;
  521|  39.3k|    __m128i p0_16x8, p1_16x8, p2_16x8, p3_16x8;
  522|  39.3k|    __m128i q0_8x16, q1_8x16, q2_8x16, q3_8x16;
  523|  39.3k|    __m128i p0_8x16, p1_8x16, p2_8x16, p3_8x16;
  524|  39.3k|    __m128i q0_16x8_1;
  525|  39.3k|    __m128i p0_16x8_1;
  526|  39.3k|    __m128i q0_16x8_2, q1_16x8_2, q2_16x8_2;
  527|  39.3k|    __m128i p0_16x8_2, p1_16x8_2, p2_16x8_2;
  528|  39.3k|    __m128i temp1, temp2, temp3, temp4, temp5, temp6;
  529|  39.3k|    __m128i Alpha_8x16, Beta_8x16;
  530|  39.3k|    __m128i flag1_16x8, flag2_16x8, flag3_16x8, flag4_16x8;
  531|  39.3k|    __m128i const_val2_16x8 = _mm_set1_epi16(2);
  532|       |
  533|  39.3k|    pu1_HorzPixel = pu1_src - (src_strd << 2);
  534|       |
  535|  39.3k|    i16_posQ1 = src_strd;
  536|  39.3k|    i16_posQ2 = X2(src_strd);
  ------------------
  |  |   91|  39.3k|#define X2(a)   ((a) << 1)
  ------------------
  537|  39.3k|    i16_posQ3 = X3(src_strd);
  ------------------
  |  |   92|  39.3k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  538|  39.3k|    i16_posP0 = X3(src_strd);
  ------------------
  |  |   92|  39.3k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  539|  39.3k|    i16_posP1 = X2(src_strd);
  ------------------
  |  |   91|  39.3k|#define X2(a)   ((a) << 1)
  ------------------
  540|  39.3k|    i16_posP2 = src_strd;
  541|  39.3k|    i16_posP3 = 0;
  542|       |
  543|  39.3k|    Alpha_8x16 = _mm_set1_epi16(alpha);
  544|  39.3k|    Beta_8x16 = _mm_set1_epi16(beta);
  545|       |
  546|  39.3k|    p3_16x8 = _mm_loadu_si128((__m128i *)(pu1_HorzPixel + i16_posP3));
  547|  39.3k|    p2_16x8 = _mm_loadu_si128((__m128i *)(pu1_HorzPixel + i16_posP2));
  548|  39.3k|    p1_16x8 = _mm_loadu_si128((__m128i *)(pu1_HorzPixel + i16_posP1));
  549|  39.3k|    p0_16x8 = _mm_loadu_si128((__m128i *)(pu1_HorzPixel + i16_posP0));
  550|  39.3k|    q0_16x8 = _mm_loadu_si128((__m128i *)(pu1_src));
  551|  39.3k|    q1_16x8 = _mm_loadu_si128((__m128i *)(pu1_src + i16_posQ1));
  552|  39.3k|    q2_16x8 = _mm_loadu_si128((__m128i *)(pu1_src + i16_posQ2));
  553|  39.3k|    q3_16x8 = _mm_loadu_si128((__m128i *)(pu1_src + i16_posQ3));
  554|       |
  555|       |    //Cond1 (ABS(p0 - q0) < alpha)
  556|  39.3k|    temp1 = _mm_subs_epu8(q0_16x8, p0_16x8);
  557|  39.3k|    temp2 = _mm_subs_epu8(p0_16x8, q0_16x8);
  558|  39.3k|    temp1 = _mm_add_epi8(temp1, temp2);
  559|       |
  560|  39.3k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
  561|  39.3k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
  562|       |
  563|  39.3k|    temp2 = _mm_cmpgt_epi16(Alpha_8x16, temp2);
  564|  39.3k|    temp1 = _mm_cmpgt_epi16(Alpha_8x16, temp1);
  565|       |
  566|  39.3k|    flag1_16x8 = _mm_packs_epi16(temp2, temp1);
  567|       |
  568|       |    //Cond2 (ABS(q1 - q0) < beta)
  569|  39.3k|    temp1 = _mm_subs_epu8(q0_16x8, q1_16x8);
  570|  39.3k|    temp2 = _mm_subs_epu8(q1_16x8, q0_16x8);
  571|  39.3k|    temp1 = _mm_add_epi8(temp1, temp2);
  572|       |
  573|  39.3k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
  574|  39.3k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
  575|       |
  576|  39.3k|    temp2 = _mm_cmpgt_epi16(Beta_8x16, temp2);
  577|  39.3k|    temp1 = _mm_cmpgt_epi16(Beta_8x16, temp1);
  578|       |
  579|  39.3k|    flag2_16x8 = _mm_packs_epi16(temp2, temp1);
  580|       |
  581|  39.3k|    flag1_16x8 = _mm_and_si128(flag1_16x8, flag2_16x8);
  582|       |
  583|       |    //Cond3 (ABS(p1 - p0) < beta)
  584|  39.3k|    temp1 = _mm_subs_epu8(p0_16x8, p1_16x8);
  585|  39.3k|    temp2 = _mm_subs_epu8(p1_16x8, p0_16x8);
  586|  39.3k|    temp1 = _mm_add_epi8(temp1, temp2);
  587|       |
  588|  39.3k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
  589|  39.3k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
  590|       |
  591|  39.3k|    temp2 = _mm_cmpgt_epi16(Beta_8x16, temp2);
  592|  39.3k|    temp1 = _mm_cmpgt_epi16(Beta_8x16, temp1);
  593|       |
  594|  39.3k|    flag2_16x8 = _mm_packs_epi16(temp2, temp1);
  595|       |
  596|       |    // !((ABS(p0 - q0) < alpha) || (ABS(q1 - q0) < beta) || (ABS(p1 - p0) < beta))
  597|  39.3k|    flag1_16x8 = _mm_and_si128(flag1_16x8, flag2_16x8);
  598|       |
  599|       |    // (ABS(p0 - q0) < ((alpha >> 2) + 2))
  600|  39.3k|    temp1 = _mm_subs_epu8(p0_16x8, q0_16x8);
  601|  39.3k|    temp2 = _mm_subs_epu8(q0_16x8, p0_16x8);
  602|  39.3k|    temp1 = _mm_add_epi8(temp1, temp2);
  603|  39.3k|    Alpha_8x16 = _mm_srai_epi16(Alpha_8x16, 2);
  604|  39.3k|    Alpha_8x16 = _mm_add_epi16(Alpha_8x16, const_val2_16x8);
  605|       |
  606|  39.3k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
  607|  39.3k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
  608|  39.3k|    temp2 = _mm_cmpgt_epi16(Alpha_8x16, temp2);
  609|  39.3k|    temp1 = _mm_cmpgt_epi16(Alpha_8x16, temp1);
  610|       |
  611|  39.3k|    flag2_16x8 = _mm_packs_epi16(temp2, temp1);
  612|  39.3k|    flag2_16x8 = _mm_and_si128(flag1_16x8, flag2_16x8);
  613|       |
  614|       |    // (ABS(p2 - p0) < beta)
  615|  39.3k|    temp1 = _mm_subs_epu8(p0_16x8, p2_16x8);
  616|  39.3k|    temp2 = _mm_subs_epu8(p2_16x8, p0_16x8);
  617|  39.3k|    temp1 = _mm_add_epi8(temp1, temp2);
  618|       |
  619|  39.3k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
  620|  39.3k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
  621|  39.3k|    temp2 = _mm_cmpgt_epi16(Beta_8x16, temp2);
  622|  39.3k|    temp1 = _mm_cmpgt_epi16(Beta_8x16, temp1);
  623|       |
  624|  39.3k|    flag3_16x8 = _mm_packs_epi16(temp2, temp1);
  625|  39.3k|    flag3_16x8 = _mm_and_si128(flag3_16x8, flag2_16x8);
  626|       |
  627|       |    // (ABS(q2 - q0) < beta)
  628|  39.3k|    temp1 = _mm_subs_epu8(q0_16x8, q2_16x8);
  629|  39.3k|    temp2 = _mm_subs_epu8(q2_16x8, q0_16x8);
  630|  39.3k|    temp1 = _mm_add_epi8(temp1, temp2);
  631|       |
  632|  39.3k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
  633|  39.3k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
  634|  39.3k|    temp2 = _mm_cmpgt_epi16(Beta_8x16, temp2);
  635|  39.3k|    temp1 = _mm_cmpgt_epi16(Beta_8x16, temp1);
  636|       |
  637|  39.3k|    flag4_16x8 = _mm_packs_epi16(temp2, temp1);
  638|  39.3k|    flag4_16x8 = _mm_and_si128(flag4_16x8, flag2_16x8);
  639|       |
  640|       |    // First 8 pixels
  641|  39.3k|    p3_8x16 = _mm_unpacklo_epi8(p3_16x8, zero);
  642|  39.3k|    p2_8x16 = _mm_unpacklo_epi8(p2_16x8, zero);
  643|  39.3k|    p1_8x16 = _mm_unpacklo_epi8(p1_16x8, zero);
  644|  39.3k|    p0_8x16 = _mm_unpacklo_epi8(p0_16x8, zero);
  645|  39.3k|    q0_8x16 = _mm_unpacklo_epi8(q0_16x8, zero);
  646|  39.3k|    q1_8x16 = _mm_unpacklo_epi8(q1_16x8, zero);
  647|  39.3k|    q2_8x16 = _mm_unpacklo_epi8(q2_16x8, zero);
  648|  39.3k|    q3_8x16 = _mm_unpacklo_epi8(q3_16x8, zero);
  649|       |
  650|       |    // p0_1 and q0_1
  651|  39.3k|    temp1 = _mm_add_epi16(p0_8x16, q1_8x16);
  652|  39.3k|    temp2 = _mm_add_epi16(p1_8x16, q0_8x16);
  653|  39.3k|    temp5 = _mm_add_epi16(temp1, const_val2_16x8);
  654|  39.3k|    temp6 = _mm_add_epi16(temp2, const_val2_16x8);
  655|  39.3k|    temp3 = _mm_slli_epi16(p1_8x16, 1);
  656|  39.3k|    temp4 = _mm_slli_epi16(q1_8x16, 1);
  657|  39.3k|    temp1 = _mm_add_epi16(temp5, temp3);
  658|  39.3k|    temp2 = _mm_add_epi16(temp6, temp4);
  659|  39.3k|    p0_16x8_1 = _mm_srai_epi16(temp1, 2);
  660|  39.3k|    q0_16x8_1 = _mm_srai_epi16(temp2, 2);
  661|       |
  662|       |    // p1_2 and q1_2
  663|  39.3k|    temp6 = _mm_add_epi16(temp6, p0_8x16);
  664|  39.3k|    temp5 = _mm_add_epi16(temp5, q0_8x16);
  665|  39.3k|    temp1 = _mm_add_epi16(temp6, p2_8x16);
  666|  39.3k|    temp2 = _mm_add_epi16(temp5, q2_8x16);
  667|  39.3k|    p1_16x8_2 = _mm_srai_epi16(temp1, 2);
  668|  39.3k|    q1_16x8_2 = _mm_srai_epi16(temp2, 2);
  669|       |
  670|       |    // p0_2 and q0_2
  671|  39.3k|    temp1 = _mm_add_epi16(temp3, p2_8x16);
  672|  39.3k|    temp2 = _mm_add_epi16(temp4, q2_8x16);
  673|  39.3k|    temp1 = _mm_add_epi16(temp1, q1_8x16);
  674|  39.3k|    temp2 = _mm_add_epi16(temp2, p1_8x16);
  675|  39.3k|    temp3 = _mm_add_epi16(p0_8x16, q0_8x16);
  676|  39.3k|    temp3 = _mm_slli_epi16(temp3, 1);
  677|  39.3k|    temp1 = _mm_add_epi16(temp1, temp3);
  678|  39.3k|    temp2 = _mm_add_epi16(temp2, temp3);
  679|  39.3k|    temp1 = _mm_add_epi16(temp1, _mm_set1_epi16(4));
  680|  39.3k|    temp2 = _mm_add_epi16(temp2, _mm_set1_epi16(4));
  681|  39.3k|    p0_16x8_2 = _mm_srai_epi16(temp1, 3);
  682|  39.3k|    q0_16x8_2 = _mm_srai_epi16(temp2, 3);
  683|       |
  684|       |    // p2_2 and q2_2
  685|  39.3k|    temp1 = _mm_add_epi16(temp6, const_val2_16x8);
  686|  39.3k|    temp2 = _mm_add_epi16(temp5, const_val2_16x8);
  687|  39.3k|    temp3 = _mm_slli_epi16(p2_8x16, 1);
  688|  39.3k|    temp4 = _mm_slli_epi16(q2_8x16, 1);
  689|  39.3k|    temp3 = _mm_add_epi16(p2_8x16, temp3);
  690|  39.3k|    temp4 = _mm_add_epi16(q2_8x16, temp4);
  691|  39.3k|    temp5 = _mm_slli_epi16(p3_8x16, 1);
  692|  39.3k|    temp6 = _mm_slli_epi16(q3_8x16, 1);
  693|  39.3k|    temp1 = _mm_add_epi16(temp1, temp3);
  694|  39.3k|    temp2 = _mm_add_epi16(temp2, temp4);
  695|  39.3k|    temp1 = _mm_add_epi16(temp1, temp5);
  696|  39.3k|    temp2 = _mm_add_epi16(temp2, temp6);
  697|  39.3k|    p2_16x8_2 = _mm_srai_epi16(temp1, 3);
  698|  39.3k|    q2_16x8_2 = _mm_srai_epi16(temp2, 3);
  699|       |
  700|       |    // Second 8 pixels and packing with first 8 pixels
  701|  39.3k|    p3_8x16 = _mm_unpackhi_epi8(p3_16x8, zero);
  702|  39.3k|    p2_8x16 = _mm_unpackhi_epi8(p2_16x8, zero);
  703|  39.3k|    p1_8x16 = _mm_unpackhi_epi8(p1_16x8, zero);
  704|  39.3k|    p0_8x16 = _mm_unpackhi_epi8(p0_16x8, zero);
  705|  39.3k|    q0_8x16 = _mm_unpackhi_epi8(q0_16x8, zero);
  706|  39.3k|    q1_8x16 = _mm_unpackhi_epi8(q1_16x8, zero);
  707|  39.3k|    q2_8x16 = _mm_unpackhi_epi8(q2_16x8, zero);
  708|  39.3k|    q3_8x16 = _mm_unpackhi_epi8(q3_16x8, zero);
  709|       |
  710|       |    // p0_1 and q0_1
  711|  39.3k|    temp1 = _mm_add_epi16(p0_8x16, q1_8x16);
  712|  39.3k|    temp2 = _mm_add_epi16(p1_8x16, q0_8x16);
  713|  39.3k|    temp5 = _mm_add_epi16(temp1, const_val2_16x8);
  714|  39.3k|    temp6 = _mm_add_epi16(temp2, const_val2_16x8);
  715|  39.3k|    temp3 = _mm_slli_epi16(p1_8x16, 1);
  716|  39.3k|    temp4 = _mm_slli_epi16(q1_8x16, 1);
  717|  39.3k|    temp1 = _mm_add_epi16(temp5, temp3);
  718|  39.3k|    temp2 = _mm_add_epi16(temp6, temp4);
  719|  39.3k|    temp1 = _mm_srai_epi16(temp1, 2);
  720|  39.3k|    temp2 = _mm_srai_epi16(temp2, 2);
  721|  39.3k|    p0_16x8_1 = _mm_packus_epi16(p0_16x8_1, temp1);
  722|  39.3k|    q0_16x8_1 = _mm_packus_epi16(q0_16x8_1, temp2);
  723|       |
  724|       |    // p1_2 and q1_2
  725|  39.3k|    temp6 = _mm_add_epi16(temp6, p0_8x16);
  726|  39.3k|    temp5 = _mm_add_epi16(temp5, q0_8x16);
  727|  39.3k|    temp1 = _mm_add_epi16(temp6, p2_8x16);
  728|  39.3k|    temp2 = _mm_add_epi16(temp5, q2_8x16);
  729|  39.3k|    temp1 = _mm_srai_epi16(temp1, 2);
  730|  39.3k|    temp2 = _mm_srai_epi16(temp2, 2);
  731|  39.3k|    p1_16x8_2 = _mm_packus_epi16(p1_16x8_2, temp1);
  732|  39.3k|    q1_16x8_2 = _mm_packus_epi16(q1_16x8_2, temp2);
  733|       |
  734|       |    // p0_2 and q0_2
  735|  39.3k|    temp1 = _mm_add_epi16(temp3, p2_8x16);
  736|  39.3k|    temp2 = _mm_add_epi16(temp4, q2_8x16);
  737|  39.3k|    temp1 = _mm_add_epi16(temp1, q1_8x16);
  738|  39.3k|    temp2 = _mm_add_epi16(temp2, p1_8x16);
  739|  39.3k|    temp3 = _mm_add_epi16(p0_8x16, q0_8x16);
  740|  39.3k|    temp3 = _mm_slli_epi16(temp3, 1);
  741|  39.3k|    temp1 = _mm_add_epi16(temp1, temp3);
  742|  39.3k|    temp2 = _mm_add_epi16(temp2, temp3);
  743|  39.3k|    temp1 = _mm_add_epi16(temp1, _mm_set1_epi16(4));
  744|  39.3k|    temp2 = _mm_add_epi16(temp2, _mm_set1_epi16(4));
  745|  39.3k|    temp1 = _mm_srai_epi16(temp1, 3);
  746|  39.3k|    temp2 = _mm_srai_epi16(temp2, 3);
  747|  39.3k|    p0_16x8_2 = _mm_packus_epi16(p0_16x8_2, temp1);
  748|  39.3k|    q0_16x8_2 = _mm_packus_epi16(q0_16x8_2, temp2);
  749|       |
  750|       |    // p2_2 and q2_2
  751|  39.3k|    temp1 = _mm_add_epi16(temp6, const_val2_16x8);
  752|  39.3k|    temp2 = _mm_add_epi16(temp5, const_val2_16x8);
  753|  39.3k|    temp3 = _mm_slli_epi16(p2_8x16, 1);
  754|  39.3k|    temp4 = _mm_slli_epi16(q2_8x16, 1);
  755|  39.3k|    temp3 = _mm_add_epi16(p2_8x16, temp3);
  756|  39.3k|    temp4 = _mm_add_epi16(q2_8x16, temp4);
  757|  39.3k|    temp5 = _mm_slli_epi16(p3_8x16, 1);
  758|  39.3k|    temp6 = _mm_slli_epi16(q3_8x16, 1);
  759|  39.3k|    temp1 = _mm_add_epi16(temp1, temp3);
  760|  39.3k|    temp2 = _mm_add_epi16(temp2, temp4);
  761|  39.3k|    temp1 = _mm_add_epi16(temp1, temp5);
  762|  39.3k|    temp2 = _mm_add_epi16(temp2, temp6);
  763|  39.3k|    temp1 = _mm_srai_epi16(temp1, 3);
  764|  39.3k|    temp2 = _mm_srai_epi16(temp2, 3);
  765|  39.3k|    p2_16x8_2 = _mm_packus_epi16(p2_16x8_2, temp1);
  766|  39.3k|    q2_16x8_2 = _mm_packus_epi16(q2_16x8_2, temp2);
  767|       |
  768|       |    // p0 and q0
  769|  39.3k|    p0_16x8 = _mm_and_si128(p0_16x8,
  770|  39.3k|                            _mm_xor_si128(flag1_16x8, _mm_set1_epi8(0xFF)));
  771|  39.3k|    p0_16x8_1 = _mm_and_si128(p0_16x8_1, flag1_16x8);
  772|  39.3k|    p0_16x8 = _mm_add_epi8(p0_16x8, p0_16x8_1);
  773|  39.3k|    q0_16x8 = _mm_and_si128(q0_16x8,
  774|  39.3k|                            _mm_xor_si128(flag1_16x8, _mm_set1_epi8(0xFF)));
  775|  39.3k|    q0_16x8_1 = _mm_and_si128(q0_16x8_1, flag1_16x8);
  776|  39.3k|    q0_16x8 = _mm_add_epi8(q0_16x8, q0_16x8_1);
  777|       |
  778|       |    // p0 and q0
  779|  39.3k|    p0_16x8 = _mm_and_si128(p0_16x8,
  780|  39.3k|                            _mm_xor_si128(flag3_16x8, _mm_set1_epi8(0xFF)));
  781|  39.3k|    p0_16x8_2 = _mm_and_si128(p0_16x8_2, flag3_16x8);
  782|  39.3k|    p0_16x8 = _mm_add_epi8(p0_16x8, p0_16x8_2);
  783|  39.3k|    q0_16x8 = _mm_and_si128(q0_16x8,
  784|  39.3k|                            _mm_xor_si128(flag4_16x8, _mm_set1_epi8(0xFF)));
  785|  39.3k|    q0_16x8_2 = _mm_and_si128(q0_16x8_2, flag4_16x8);
  786|  39.3k|    q0_16x8 = _mm_add_epi8(q0_16x8, q0_16x8_2);
  787|       |
  788|       |    // p1 and q1
  789|  39.3k|    p1_16x8 = _mm_and_si128(p1_16x8,
  790|  39.3k|                            _mm_xor_si128(flag3_16x8, _mm_set1_epi8(0xFF)));
  791|  39.3k|    p1_16x8_2 = _mm_and_si128(p1_16x8_2, flag3_16x8);
  792|  39.3k|    p1_16x8 = _mm_add_epi8(p1_16x8, p1_16x8_2);
  793|  39.3k|    q1_16x8 = _mm_and_si128(q1_16x8,
  794|  39.3k|                            _mm_xor_si128(flag4_16x8, _mm_set1_epi8(0xFF)));
  795|  39.3k|    q1_16x8_2 = _mm_and_si128(q1_16x8_2, flag4_16x8);
  796|  39.3k|    q1_16x8 = _mm_add_epi8(q1_16x8, q1_16x8_2);
  797|       |
  798|       |    // p2 and q2
  799|  39.3k|    p2_16x8 = _mm_and_si128(p2_16x8,
  800|  39.3k|                            _mm_xor_si128(flag3_16x8, _mm_set1_epi8(0xFF)));
  801|  39.3k|    p2_16x8_2 = _mm_and_si128(p2_16x8_2, flag3_16x8);
  802|  39.3k|    p2_16x8 = _mm_add_epi8(p2_16x8, p2_16x8_2);
  803|  39.3k|    q2_16x8 = _mm_and_si128(q2_16x8,
  804|  39.3k|                            _mm_xor_si128(flag4_16x8, _mm_set1_epi8(0xFF)));
  805|  39.3k|    q2_16x8_2 = _mm_and_si128(q2_16x8_2, flag4_16x8);
  806|  39.3k|    q2_16x8 = _mm_add_epi8(q2_16x8, q2_16x8_2);
  807|       |
  808|  39.3k|    _mm_storeu_si128((__m128i *)(pu1_HorzPixel + i16_posP2), p2_16x8);
  809|  39.3k|    _mm_storeu_si128((__m128i *)(pu1_HorzPixel + i16_posP1), p1_16x8);
  810|  39.3k|    _mm_storeu_si128((__m128i *)(pu1_HorzPixel + i16_posP0), p0_16x8);
  811|       |
  812|  39.3k|    _mm_storeu_si128((__m128i *)(pu1_src), q0_16x8);
  813|  39.3k|    _mm_storeu_si128((__m128i *)(pu1_src + i16_posQ1), q1_16x8);
  814|  39.3k|    _mm_storeu_si128((__m128i *)(pu1_src + i16_posQ2), q2_16x8);
  815|       |
  816|  39.3k|}
ih264_deblk_luma_vert_bslt4_ssse3:
  856|   261k|{
  857|   261k|    UWORD8 u1_Bs, u1_Bs1;
  858|       |
  859|   261k|    WORD32 j = 0;
  860|       |
  861|   261k|    __m128i linea, lineb, linec, lined, linee, linef, lineg, lineh;
  862|   261k|    __m128i int1, int2, int3, int4, high1, high2;
  863|   261k|    __m128i flag, flag1, i_C, i_C0;
  864|   261k|    __m128i i_Ap, i_Aq, diff, const1, const2, in_macro, in_macrotemp, temp,
  865|   261k|                    temp1;
  866|   261k|    __m128i zero = _mm_setzero_si128();
  867|       |
  868|   784k|    for(j = 0; j <= 8 * src_strd; j += 8 * src_strd)
  ------------------
  |  Branch (868:16): [True: 522k, False: 261k]
  ------------------
  869|   522k|    {
  870|       |        //Transpose
  871|   522k|        linea = _mm_loadl_epi64((__m128i *)(pu1_src - 3 + j));
  872|   522k|        lineb = _mm_loadl_epi64((__m128i *)(pu1_src - 3 + src_strd + j));
  873|   522k|        linec = _mm_loadl_epi64((__m128i *)(pu1_src - 3 + 2 * src_strd + j));
  874|   522k|        lined = _mm_loadl_epi64((__m128i *)(pu1_src - 3 + 3 * src_strd + j));
  875|       |
  876|   522k|        linea = _mm_unpacklo_epi8(linea, zero);
  877|   522k|        lineb = _mm_unpacklo_epi8(lineb, zero);
  878|   522k|        linec = _mm_unpacklo_epi8(linec, zero);
  879|   522k|        lined = _mm_unpacklo_epi8(lined, zero);
  880|       |
  881|   522k|        int1 = _mm_unpacklo_epi16(linea, lineb);
  882|   522k|        lineb = _mm_unpackhi_epi16(linea, lineb);
  883|       |
  884|   522k|        int2 = _mm_unpacklo_epi16(linec, lined);
  885|   522k|        lined = _mm_unpackhi_epi16(linec, lined);
  886|       |
  887|   522k|        linea = _mm_unpacklo_epi16(int1, int2);
  888|   522k|        int1 = _mm_unpackhi_epi16(int1, int2);
  889|       |
  890|   522k|        linec = _mm_unpacklo_epi16(lineb, lined);
  891|   522k|        high1 = _mm_unpackhi_epi16(lineb, lined);
  892|       |
  893|   522k|        linee = _mm_loadl_epi64((__m128i *)(pu1_src - 3 + 4 * src_strd + j));
  894|   522k|        linef = _mm_loadl_epi64((__m128i *)(pu1_src - 3 + 5 * src_strd + j));
  895|   522k|        lineg = _mm_loadl_epi64((__m128i *)(pu1_src - 3 + 6 * src_strd + j));
  896|   522k|        lineh = _mm_loadl_epi64((__m128i *)(pu1_src - 3 + 7 * src_strd + j));
  897|       |
  898|   522k|        linee = _mm_unpacklo_epi8(linee, zero);
  899|   522k|        linef = _mm_unpacklo_epi8(linef, zero);
  900|   522k|        lineg = _mm_unpacklo_epi8(lineg, zero);
  901|   522k|        lineh = _mm_unpacklo_epi8(lineh, zero);
  902|       |
  903|   522k|        int2 = _mm_unpacklo_epi16(linee, linef);
  904|   522k|        linef = _mm_unpackhi_epi16(linee, linef);
  905|       |
  906|   522k|        int3 = _mm_unpacklo_epi16(lineg, lineh);
  907|   522k|        lineh = _mm_unpackhi_epi16(lineg, lineh);
  908|       |
  909|   522k|        linee = _mm_unpacklo_epi16(int2, int3);
  910|   522k|        int2 = _mm_unpackhi_epi16(int2, int3);
  911|       |
  912|   522k|        lineg = _mm_unpacklo_epi16(linef, lineh);
  913|   522k|        high2 = _mm_unpackhi_epi16(linef, lineh);
  914|       |
  915|   522k|        int4 = _mm_unpacklo_epi16(linea, linee);
  916|   522k|        lineb = _mm_unpackhi_epi16(linea, linee);
  917|       |
  918|   522k|        int3 = _mm_unpacklo_epi16(int1, int2);
  919|   522k|        lined = _mm_unpackhi_epi16(int1, int2);
  920|       |
  921|   522k|        int2 = _mm_unpacklo_epi16(linec, lineg);
  922|   522k|        linef = _mm_unpackhi_epi16(linec, lineg);
  923|       |
  924|   522k|        linea = int4;
  925|   522k|        linec = int3;
  926|   522k|        linee = int2;
  927|       |
  928|   522k|        lineg = _mm_unpacklo_epi16(high1, high2);
  929|   522k|        lineh = _mm_unpackhi_epi16(high1, high2);
  930|       |
  931|       |        //end of transpose
  932|       |
  933|   522k|        u1_Bs = (u4_bs >> 24) & 0xff;
  934|   522k|        u1_Bs1 = (u4_bs >> 16) & 0xff;
  935|   522k|        u4_bs <<= 16;
  936|       |
  937|   522k|        flag1 = _mm_set_epi16(u1_Bs1, u1_Bs, u1_Bs1, u1_Bs, u1_Bs1, u1_Bs,
  938|   522k|                              u1_Bs1, u1_Bs);
  939|   522k|        flag1 = _mm_cmpeq_epi16(flag1, zero); //Set flag to 1s and 0s
  940|   522k|        flag1 = _mm_xor_si128(flag1, _mm_set1_epi16(0xFFFF)); //Invert for required mask
  941|       |
  942|   522k|        i_C0 = _mm_set_epi16(pu1_cliptab[u1_Bs1], pu1_cliptab[u1_Bs],
  943|   522k|                             pu1_cliptab[u1_Bs1], pu1_cliptab[u1_Bs],
  944|   522k|                             pu1_cliptab[u1_Bs1], pu1_cliptab[u1_Bs],
  945|   522k|                             pu1_cliptab[u1_Bs1], pu1_cliptab[u1_Bs]);
  946|       |
  947|   522k|        diff = _mm_subs_epi16(linec, lined); //Condn 1
  948|   522k|        diff = _mm_abs_epi16(diff);
  949|   522k|        const1 = _mm_set1_epi16(alpha);
  950|   522k|        flag = _mm_cmpgt_epi16(const1, diff);
  951|       |
  952|   522k|        diff = _mm_subs_epi16(linee, lined); //Condtn 2
  953|   522k|        diff = _mm_abs_epi16(diff);
  954|   522k|        const1 = _mm_set1_epi16(beta);
  955|   522k|        flag = _mm_and_si128(flag, _mm_cmpgt_epi16(const1, diff));
  956|       |
  957|   522k|        diff = _mm_subs_epi16(lineb, linec); //Condtn 3
  958|   522k|        diff = _mm_abs_epi16(diff);
  959|   522k|        flag = _mm_and_si128(flag, _mm_cmpgt_epi16(const1, diff)); //Const 1= Beta from now on
  960|       |
  961|   522k|        flag = _mm_and_si128(flag, flag1); //Final flag (ui_B condition + other 3 conditions)
  962|       |
  963|       |        //Adding Ap<Beta and Aq<Beta
  964|   522k|        i_Ap = _mm_subs_epi16(linea, linec);
  965|   522k|        i_Ap = _mm_abs_epi16(i_Ap);
  966|   522k|        const2 = _mm_cmpgt_epi16(const1, i_Ap);
  967|   522k|        const2 = _mm_subs_epi16(zero, const2); //Make FFFF=1 and 0000=0
  968|   522k|        i_C = _mm_add_epi16(i_C0, const2);
  969|       |
  970|   522k|        i_Aq = _mm_subs_epi16(linef, lined);
  971|   522k|        i_Aq = _mm_abs_epi16(i_Aq);
  972|   522k|        const2 = _mm_cmpgt_epi16(const1, i_Aq);
  973|   522k|        const2 = _mm_subs_epi16(zero, const2);
  974|   522k|        i_C = _mm_add_epi16(i_C, const2);
  975|       |
  976|       |        //Calculate in_macro
  977|   522k|        diff = _mm_subs_epi16(lined, linec);
  978|   522k|        diff = _mm_slli_epi16(diff, 2);
  979|   522k|        const2 = _mm_subs_epi16(lineb, linee);
  980|   522k|        diff = _mm_add_epi16(diff, const2);
  981|   522k|        const2 = _mm_set1_epi16(4);
  982|   522k|        diff = _mm_add_epi16(diff, const2);
  983|   522k|        in_macro = _mm_srai_epi16(diff, 3);
  984|       |
  985|   522k|        in_macro = _mm_min_epi16(i_C, in_macro); //CLIP3
  986|   522k|        i_C = _mm_subs_epi16(zero, i_C);
  987|   522k|        in_macro = _mm_max_epi16(i_C, in_macro);
  988|       |
  989|       |        //Compute and store
  990|   522k|        in_macrotemp = _mm_add_epi16(linec, in_macro);
  991|   522k|        in_macrotemp = _mm_and_si128(in_macrotemp, flag);
  992|   522k|        temp = _mm_and_si128(linec,
  993|   522k|                             _mm_xor_si128(flag, _mm_set1_epi16(0xFFFF)));
  994|   522k|        temp = _mm_add_epi16(temp, in_macrotemp);
  995|       |        //temp= _mm_packus_epi16 (temp, zero);
  996|       |        //_mm_storel_epi64(uc_HorzPixel+i16_posP0+i, in_macrotemp);
  997|       |
  998|   522k|        in_macrotemp = _mm_subs_epi16(lined, in_macro);
  999|   522k|        in_macrotemp = _mm_and_si128(in_macrotemp, flag);
 1000|   522k|        temp1 = _mm_and_si128(lined,
 1001|   522k|                              _mm_xor_si128(flag, _mm_set1_epi16(0xFFFF)));
 1002|   522k|        temp1 = _mm_add_epi16(temp1, in_macrotemp);
 1003|       |        //temp1= _mm_packus_epi16 (temp1, zero);
 1004|       |        //_mm_storel_epi64(pu1_src+i, in_macrotemp);
 1005|       |
 1006|       |        //If Ap<Beta
 1007|   522k|        flag1 = _mm_cmpgt_epi16(const1, i_Ap);
 1008|   522k|        flag1 = _mm_and_si128(flag, flag1);
 1009|   522k|        in_macrotemp = _mm_add_epi16(linec, lined);
 1010|   522k|        in_macrotemp = _mm_add_epi16(in_macrotemp, _mm_set1_epi16(1));
 1011|   522k|        in_macrotemp = _mm_srai_epi16(in_macrotemp, 1);
 1012|   522k|        in_macro = _mm_add_epi16(in_macrotemp, linea);
 1013|   522k|        in_macro = _mm_subs_epi16(in_macro, _mm_slli_epi16(lineb, 1));
 1014|   522k|        in_macro = _mm_srai_epi16(in_macro, 1);
 1015|       |
 1016|   522k|        in_macro = _mm_min_epi16(i_C0, in_macro); //CLIP3
 1017|   522k|        i_C0 = _mm_subs_epi16(zero, i_C0);
 1018|   522k|        in_macro = _mm_max_epi16(i_C0, in_macro);
 1019|       |
 1020|   522k|        in_macro = _mm_and_si128(in_macro, flag1);
 1021|   522k|        lineb = _mm_add_epi16(lineb, in_macro);
 1022|       |        //in_macro= _mm_packus_epi16 (i_p1, zero);
 1023|       |        //_mm_storel_epi64(uc_HorzPixel+i16_posP1+i, in_macro);
 1024|       |
 1025|   522k|        flag1 = _mm_cmpgt_epi16(const1, i_Aq);
 1026|   522k|        flag1 = _mm_and_si128(flag, flag1);
 1027|   522k|        in_macro = _mm_add_epi16(in_macrotemp, linef);
 1028|   522k|        in_macro = _mm_subs_epi16(in_macro, _mm_slli_epi16(linee, 1));
 1029|   522k|        in_macro = _mm_srai_epi16(in_macro, 1);
 1030|       |
 1031|   522k|        i_C0 = _mm_abs_epi16(i_C0);
 1032|   522k|        in_macro = _mm_min_epi16(i_C0, in_macro); //CLIP3
 1033|   522k|        i_C0 = _mm_subs_epi16(zero, i_C0);
 1034|   522k|        in_macro = _mm_max_epi16(i_C0, in_macro);
 1035|       |
 1036|   522k|        in_macro = _mm_and_si128(in_macro, flag1);
 1037|   522k|        linee = _mm_add_epi16(linee, in_macro);
 1038|       |        //in_macro= _mm_packus_epi16 (i_q1, zero);
 1039|       |        //_mm_storel_epi64(pu1_src+i16_posQ1+i, in_macro);
 1040|   522k|        linec = temp;
 1041|   522k|        lined = temp1;
 1042|       |        //End of filtering
 1043|       |
 1044|   522k|        int1 = _mm_unpacklo_epi16(linea, linee);
 1045|   522k|        linee = _mm_unpackhi_epi16(linea, linee);
 1046|       |
 1047|   522k|        int2 = _mm_unpacklo_epi16(linec, lineg);
 1048|   522k|        lineg = _mm_unpackhi_epi16(linec, lineg);
 1049|       |
 1050|   522k|        linea = _mm_unpacklo_epi16(int1, int2);
 1051|   522k|        int3 = _mm_unpackhi_epi16(int1, int2);
 1052|       |
 1053|   522k|        linec = _mm_unpacklo_epi16(linee, lineg);
 1054|   522k|        lineg = _mm_unpackhi_epi16(linee, lineg);
 1055|       |
 1056|   522k|        int1 = _mm_unpacklo_epi16(lineb, linef);
 1057|   522k|        linef = _mm_unpackhi_epi16(lineb, linef);
 1058|       |
 1059|   522k|        int2 = _mm_unpacklo_epi16(lined, lineh);
 1060|   522k|        lineh = _mm_unpackhi_epi16(lined, lineh);
 1061|       |
 1062|   522k|        lineb = _mm_unpacklo_epi16(int1, int2);
 1063|   522k|        int4 = _mm_unpackhi_epi16(int1, int2);
 1064|       |
 1065|   522k|        lined = _mm_unpacklo_epi16(linef, lineh);
 1066|   522k|        lineh = _mm_unpackhi_epi16(linef, lineh);
 1067|       |
 1068|   522k|        int1 = _mm_unpackhi_epi16(linea, lineb);
 1069|   522k|        linea = _mm_unpacklo_epi16(linea, lineb);
 1070|       |
 1071|   522k|        int2 = _mm_unpacklo_epi16(int3, int4);
 1072|   522k|        high1 = _mm_unpackhi_epi16(int3, int4);
 1073|       |
 1074|   522k|        lineb = _mm_unpacklo_epi16(linec, lined);
 1075|   522k|        linef = _mm_unpackhi_epi16(linec, lined);
 1076|       |
 1077|   522k|        lined = _mm_unpacklo_epi16(lineg, lineh);
 1078|   522k|        lineh = _mm_unpackhi_epi16(lineg, lineh);
 1079|       |
 1080|   522k|        linee = int1;
 1081|   522k|        lineg = high1;
 1082|   522k|        linec = int2;
 1083|       |        //End of inverse transpose
 1084|       |
 1085|       |        //Packs and stores
 1086|   522k|        linea = _mm_packus_epi16(linea, zero);
 1087|   522k|        _mm_storel_epi64((__m128i *)(pu1_src - 3 + j), linea);
 1088|       |
 1089|   522k|        lineb = _mm_packus_epi16(lineb, zero);
 1090|   522k|        _mm_storel_epi64((__m128i *)(pu1_src - 3 + src_strd + j), lineb);
 1091|       |
 1092|   522k|        linec = _mm_packus_epi16(linec, zero);
 1093|   522k|        _mm_storel_epi64((__m128i *)(pu1_src - 3 + 2 * src_strd + j), linec);
 1094|       |
 1095|   522k|        lined = _mm_packus_epi16(lined, zero);
 1096|   522k|        _mm_storel_epi64((__m128i *)(pu1_src - 3 + 3 * src_strd + j), lined);
 1097|       |
 1098|   522k|        linee = _mm_packus_epi16(linee, zero);
 1099|   522k|        _mm_storel_epi64((__m128i *)(pu1_src - 3 + 4 * src_strd + j), linee);
 1100|       |
 1101|   522k|        linef = _mm_packus_epi16(linef, zero);
 1102|   522k|        _mm_storel_epi64((__m128i *)(pu1_src - 3 + 5 * src_strd + j), linef);
 1103|       |
 1104|   522k|        lineg = _mm_packus_epi16(lineg, zero);
 1105|   522k|        _mm_storel_epi64((__m128i *)(pu1_src - 3 + 6 * src_strd + j), lineg);
 1106|       |
 1107|   522k|        lineh = _mm_packus_epi16(lineh, zero);
 1108|   522k|        _mm_storel_epi64((__m128i *)(pu1_src - 3 + 7 * src_strd + j), lineh);
 1109|       |
 1110|   522k|    }
 1111|   261k|}
ih264_deblk_luma_horz_bslt4_ssse3:
 1151|   296k|{
 1152|   296k|    WORD16 i16_posP2, i16_posP1, i16_posP0, i16_posQ1, i16_posQ2;
 1153|   296k|    UWORD8 *pu1_HorzPixel;
 1154|   296k|    __m128i zero = _mm_setzero_si128();
 1155|   296k|    __m128i bs_flag_16x8b, C0_16x8, C0_8x16, C0_hi_8x16, C_8x16, C_hi_8x16;
 1156|   296k|    __m128i q0_16x8, q1_16x8, q2_16x8, p0_16x8, p1_16x8, p2_16x8;
 1157|   296k|    __m128i temp1, temp2;
 1158|   296k|    __m128i Alpha_8x16, Beta_8x16, flag1_16x8, flag2_16x8, flag3_16x8;
 1159|   296k|    __m128i in_macro_16x8, in_macro_hi_16x8;
 1160|   296k|    __m128i const_val4_8x16;
 1161|   296k|    UWORD8 u1_Bs0, u1_Bs1, u1_Bs2, u1_Bs3;
 1162|   296k|    UWORD8 clip0, clip1, clip2, clip3;
 1163|       |
 1164|   296k|    pu1_HorzPixel = pu1_src - (src_strd << 2);
 1165|       |
 1166|   296k|    i16_posQ1 = src_strd;
 1167|   296k|    i16_posQ2 = X2(src_strd);
  ------------------
  |  |   91|   296k|#define X2(a)   ((a) << 1)
  ------------------
 1168|   296k|    i16_posP0 = X3(src_strd);
  ------------------
  |  |   92|   296k|#define X3(a)   (((a) << 1) + (a))
  ------------------
 1169|   296k|    i16_posP1 = X2(src_strd);
  ------------------
  |  |   91|   296k|#define X2(a)   ((a) << 1)
  ------------------
 1170|   296k|    i16_posP2 = src_strd;
 1171|       |
 1172|   296k|    q0_16x8 = _mm_loadu_si128((__m128i *)(pu1_src));
 1173|   296k|    q1_16x8 = _mm_loadu_si128((__m128i *)(pu1_src + i16_posQ1));
 1174|       |
 1175|   296k|    u1_Bs0 = (u4_bs >> 24) & 0xff;
 1176|   296k|    u1_Bs1 = (u4_bs >> 16) & 0xff;
 1177|   296k|    u1_Bs2 = (u4_bs >> 8) & 0xff;
 1178|   296k|    u1_Bs3 = (u4_bs >> 0) & 0xff;
 1179|   296k|    clip0 = pu1_cliptab[u1_Bs0];
 1180|   296k|    clip1 = pu1_cliptab[u1_Bs1];
 1181|   296k|    clip2 = pu1_cliptab[u1_Bs2];
 1182|   296k|    clip3 = pu1_cliptab[u1_Bs3];
 1183|       |
 1184|   296k|    Alpha_8x16 = _mm_set1_epi16(alpha);
 1185|   296k|    Beta_8x16 = _mm_set1_epi16(beta);
 1186|       |
 1187|   296k|    bs_flag_16x8b = _mm_set_epi8(u1_Bs3, u1_Bs3, u1_Bs3, u1_Bs3, u1_Bs2, u1_Bs2,
 1188|   296k|                                 u1_Bs2, u1_Bs2, u1_Bs1, u1_Bs1, u1_Bs1, u1_Bs1,
 1189|   296k|                                 u1_Bs0, u1_Bs0, u1_Bs0, u1_Bs0);
 1190|       |
 1191|   296k|    C0_16x8 = _mm_set_epi8(clip3, clip3, clip3, clip3, clip2, clip2, clip2,
 1192|   296k|                           clip2, clip1, clip1, clip1, clip1, clip0, clip0,
 1193|   296k|                           clip0, clip0);
 1194|       |
 1195|   296k|    bs_flag_16x8b = _mm_cmpeq_epi8(bs_flag_16x8b, zero);
 1196|   296k|    bs_flag_16x8b = _mm_xor_si128(bs_flag_16x8b, _mm_set1_epi8(0xFF)); //Invert for required mask
 1197|   296k|    C0_8x16 = _mm_unpacklo_epi8(C0_16x8, zero);
 1198|   296k|    C0_hi_8x16 = _mm_unpackhi_epi8(C0_16x8, zero);
 1199|       |
 1200|   296k|    p1_16x8 = _mm_loadu_si128((__m128i *)(pu1_HorzPixel + i16_posP1));
 1201|   296k|    p0_16x8 = _mm_loadu_si128((__m128i *)(pu1_HorzPixel + i16_posP0));
 1202|   296k|    p2_16x8 = _mm_loadu_si128((__m128i *)(pu1_HorzPixel + i16_posP2));
 1203|   296k|    q2_16x8 = _mm_loadu_si128((__m128i *)(pu1_src + i16_posQ2));
 1204|       |
 1205|       |    //Cond1 (ABS(p0 - q0) < alpha)
 1206|   296k|    temp1 = _mm_subs_epu8(q0_16x8, p0_16x8);
 1207|   296k|    temp2 = _mm_subs_epu8(p0_16x8, q0_16x8);
 1208|   296k|    temp1 = _mm_add_epi8(temp1, temp2);
 1209|       |
 1210|   296k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
 1211|   296k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
 1212|       |
 1213|   296k|    temp2 = _mm_cmpgt_epi16(Alpha_8x16, temp2);
 1214|   296k|    temp1 = _mm_cmpgt_epi16(Alpha_8x16, temp1);
 1215|       |
 1216|   296k|    flag1_16x8 = _mm_packs_epi16(temp2, temp1);
 1217|   296k|    flag1_16x8 = _mm_and_si128(flag1_16x8, bs_flag_16x8b);
 1218|       |
 1219|       |    //Cond2 (ABS(q1 - q0) < beta)
 1220|   296k|    temp1 = _mm_subs_epu8(q0_16x8, q1_16x8);
 1221|   296k|    temp2 = _mm_subs_epu8(q1_16x8, q0_16x8);
 1222|   296k|    temp1 = _mm_add_epi8(temp1, temp2);
 1223|       |
 1224|   296k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
 1225|   296k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
 1226|       |
 1227|   296k|    temp2 = _mm_cmpgt_epi16(Beta_8x16, temp2);
 1228|   296k|    temp1 = _mm_cmpgt_epi16(Beta_8x16, temp1);
 1229|       |
 1230|   296k|    flag2_16x8 = _mm_packs_epi16(temp2, temp1);
 1231|       |
 1232|   296k|    flag1_16x8 = _mm_and_si128(flag1_16x8, flag2_16x8);
 1233|       |
 1234|       |    //Cond3 (ABS(p1 - p0) < beta)
 1235|   296k|    temp1 = _mm_subs_epu8(p0_16x8, p1_16x8);
 1236|   296k|    temp2 = _mm_subs_epu8(p1_16x8, p0_16x8);
 1237|   296k|    temp1 = _mm_add_epi8(temp1, temp2);
 1238|       |
 1239|   296k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
 1240|   296k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
 1241|       |
 1242|   296k|    temp2 = _mm_cmpgt_epi16(Beta_8x16, temp2);
 1243|   296k|    temp1 = _mm_cmpgt_epi16(Beta_8x16, temp1);
 1244|       |
 1245|   296k|    flag2_16x8 = _mm_packs_epi16(temp2, temp1);
 1246|       |
 1247|       |    // !((ABS(p0 - q0) < alpha) || (ABS(q1 - q0) < beta) || (ABS(p1 - p0) < beta))
 1248|   296k|    flag1_16x8 = _mm_and_si128(flag1_16x8, flag2_16x8);
 1249|       |
 1250|       |    // (ABS(p2 - p0) < beta)
 1251|   296k|    temp1 = _mm_subs_epu8(p0_16x8, p2_16x8);
 1252|   296k|    temp2 = _mm_subs_epu8(p2_16x8, p0_16x8);
 1253|   296k|    temp1 = _mm_add_epi8(temp1, temp2);
 1254|       |
 1255|   296k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
 1256|   296k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
 1257|   296k|    temp2 = _mm_cmpgt_epi16(Beta_8x16, temp2);
 1258|   296k|    temp1 = _mm_cmpgt_epi16(Beta_8x16, temp1);
 1259|       |
 1260|   296k|    flag2_16x8 = _mm_packs_epi16(temp2, temp1);
 1261|   296k|    flag2_16x8 = _mm_and_si128(flag1_16x8, flag2_16x8);
 1262|       |
 1263|   296k|    temp2 = _mm_subs_epi16(zero, temp2);
 1264|   296k|    temp1 = _mm_subs_epi16(zero, temp1);
 1265|       |
 1266|   296k|    C_8x16 = _mm_add_epi16(C0_8x16, temp2);
 1267|   296k|    C_hi_8x16 = _mm_add_epi16(C0_hi_8x16, temp1);
 1268|       |
 1269|       |    // (ABS(q2 - q0) < beta)
 1270|   296k|    temp1 = _mm_subs_epu8(q0_16x8, q2_16x8);
 1271|   296k|    temp2 = _mm_subs_epu8(q2_16x8, q0_16x8);
 1272|   296k|    temp1 = _mm_add_epi8(temp1, temp2);
 1273|       |
 1274|   296k|    temp2 = _mm_unpacklo_epi8(temp1, zero);
 1275|   296k|    temp1 = _mm_unpackhi_epi8(temp1, zero);
 1276|   296k|    temp2 = _mm_cmpgt_epi16(Beta_8x16, temp2);
 1277|   296k|    temp1 = _mm_cmpgt_epi16(Beta_8x16, temp1);
 1278|       |
 1279|   296k|    flag3_16x8 = _mm_packs_epi16(temp2, temp1);
 1280|   296k|    flag3_16x8 = _mm_and_si128(flag1_16x8, flag3_16x8);
 1281|       |
 1282|   296k|    temp2 = _mm_subs_epi16(zero, temp2);
 1283|   296k|    temp1 = _mm_subs_epi16(zero, temp1);
 1284|       |
 1285|   296k|    C_8x16 = _mm_add_epi16(C_8x16, temp2);
 1286|   296k|    C_hi_8x16 = _mm_add_epi16(C_hi_8x16, temp1);
 1287|       |
 1288|   296k|    const_val4_8x16 = _mm_set1_epi16(4);
 1289|   296k|    temp1 = _mm_subs_epi16(_mm_unpacklo_epi8(q0_16x8, zero),
 1290|   296k|                           _mm_unpacklo_epi8(p0_16x8, zero));
 1291|   296k|    temp2 = _mm_subs_epi16(_mm_unpacklo_epi8(p1_16x8, zero),
 1292|   296k|                           _mm_unpacklo_epi8(q1_16x8, zero));
 1293|   296k|    temp1 = _mm_slli_epi16(temp1, 2);
 1294|   296k|    temp1 = _mm_add_epi16(temp1, temp2);
 1295|   296k|    temp1 = _mm_add_epi16(temp1, const_val4_8x16);
 1296|   296k|    in_macro_16x8 = _mm_srai_epi16(temp1, 3);
 1297|       |
 1298|   296k|    temp1 = _mm_subs_epi16(_mm_unpackhi_epi8(q0_16x8, zero),
 1299|   296k|                           _mm_unpackhi_epi8(p0_16x8, zero));
 1300|   296k|    temp2 = _mm_subs_epi16(_mm_unpackhi_epi8(p1_16x8, zero),
 1301|   296k|                           _mm_unpackhi_epi8(q1_16x8, zero));
 1302|   296k|    temp1 = _mm_slli_epi16(temp1, 2);
 1303|   296k|    temp1 = _mm_add_epi16(temp1, temp2);
 1304|   296k|    temp1 = _mm_add_epi16(temp1, const_val4_8x16);
 1305|   296k|    in_macro_hi_16x8 = _mm_srai_epi16(temp1, 3);
 1306|       |
 1307|   296k|    in_macro_16x8 = _mm_min_epi16(C_8x16, in_macro_16x8); //CLIP3
 1308|   296k|    in_macro_hi_16x8 = _mm_min_epi16(C_hi_8x16, in_macro_hi_16x8); //CLIP3
 1309|   296k|    C_8x16 = _mm_subs_epi16(zero, C_8x16);
 1310|   296k|    C_hi_8x16 = _mm_subs_epi16(zero, C_hi_8x16);
 1311|   296k|    in_macro_16x8 = _mm_max_epi16(C_8x16, in_macro_16x8); //CLIP3
 1312|   296k|    in_macro_hi_16x8 = _mm_max_epi16(C_hi_8x16, in_macro_hi_16x8); //CLIP3
 1313|       |
 1314|   296k|    temp1 = _mm_add_epi16(_mm_unpacklo_epi8(p0_16x8, zero), in_macro_16x8);
 1315|   296k|    temp2 = _mm_add_epi16(_mm_unpackhi_epi8(p0_16x8, zero), in_macro_hi_16x8);
 1316|       |
 1317|   296k|    temp1 = _mm_packus_epi16(temp1, temp2);
 1318|       |
 1319|   296k|    temp1 = _mm_and_si128(temp1, flag1_16x8);
 1320|   296k|    temp2 = _mm_and_si128(p0_16x8,
 1321|   296k|                          _mm_xor_si128(flag1_16x8, _mm_set1_epi16(0xFFFF)));
 1322|       |
 1323|   296k|    temp1 = _mm_add_epi8(temp1, temp2);
 1324|       |
 1325|   296k|    _mm_storeu_si128((__m128i *)(pu1_HorzPixel + i16_posP0), temp1);
 1326|       |
 1327|   296k|    temp1 = _mm_sub_epi16(_mm_unpacklo_epi8(q0_16x8, zero), in_macro_16x8);
 1328|   296k|    temp2 = _mm_sub_epi16(_mm_unpackhi_epi8(q0_16x8, zero), in_macro_hi_16x8);
 1329|       |
 1330|   296k|    temp1 = _mm_packus_epi16(temp1, temp2);
 1331|       |
 1332|   296k|    temp1 = _mm_and_si128(temp1, flag1_16x8);
 1333|   296k|    temp2 = _mm_and_si128(q0_16x8,
 1334|   296k|                          _mm_xor_si128(flag1_16x8, _mm_set1_epi16(0xFFFF)));
 1335|       |
 1336|   296k|    temp1 = _mm_add_epi8(temp1, temp2);
 1337|   296k|    _mm_storeu_si128((__m128i *)(pu1_src), temp1);
 1338|       |
 1339|       |    //if(Ap < Beta)
 1340|   296k|    temp1 = _mm_avg_epu16(_mm_unpacklo_epi8(q0_16x8, zero),
 1341|   296k|                          _mm_unpacklo_epi8(p0_16x8, zero));
 1342|   296k|    temp2 = _mm_slli_epi16(_mm_unpacklo_epi8(p1_16x8, zero), 1);
 1343|       |    //temp2 = _mm_subs_epi16(zero,temp2);
 1344|   296k|    temp2 = _mm_subs_epi16(_mm_unpacklo_epi8(p2_16x8, zero), temp2);
 1345|   296k|    temp2 = _mm_add_epi16(temp1, temp2);
 1346|   296k|    in_macro_16x8 = _mm_srai_epi16(temp2, 1);
 1347|       |
 1348|   296k|    temp1 = _mm_avg_epu16(_mm_unpackhi_epi8(q0_16x8, zero),
 1349|   296k|                          _mm_unpackhi_epi8(p0_16x8, zero));
 1350|   296k|    temp2 = _mm_slli_epi16(_mm_unpackhi_epi8(p1_16x8, zero), 1);
 1351|       |    //temp2 = _mm_subs_epi16(zero,temp2);
 1352|   296k|    temp2 = _mm_subs_epi16(_mm_unpackhi_epi8(p2_16x8, zero), temp2);
 1353|   296k|    temp2 = _mm_add_epi16(temp1, temp2);
 1354|   296k|    in_macro_hi_16x8 = _mm_srai_epi16(temp2, 1);
 1355|       |
 1356|   296k|    in_macro_16x8 = _mm_min_epi16(C0_8x16, in_macro_16x8); //CLIP3
 1357|   296k|    in_macro_hi_16x8 = _mm_min_epi16(C0_hi_8x16, in_macro_hi_16x8); //CLIP3
 1358|   296k|    C0_8x16 = _mm_subs_epi16(zero, C0_8x16);
 1359|   296k|    C0_hi_8x16 = _mm_subs_epi16(zero, C0_hi_8x16);
 1360|   296k|    in_macro_16x8 = _mm_max_epi16(C0_8x16, in_macro_16x8); //CLIP3
 1361|   296k|    in_macro_hi_16x8 = _mm_max_epi16(C0_hi_8x16, in_macro_hi_16x8); //CLIP3
 1362|       |
 1363|   296k|    temp1 = _mm_add_epi16(_mm_unpacklo_epi8(p1_16x8, zero), in_macro_16x8);
 1364|   296k|    temp2 = _mm_add_epi16(_mm_unpackhi_epi8(p1_16x8, zero), in_macro_hi_16x8);
 1365|       |
 1366|   296k|    temp1 = _mm_packus_epi16(temp1, temp2);
 1367|       |
 1368|   296k|    temp1 = _mm_and_si128(temp1, flag2_16x8);
 1369|   296k|    temp2 = _mm_and_si128(p1_16x8,
 1370|   296k|                          _mm_xor_si128(flag2_16x8, _mm_set1_epi16(0xFFFF)));
 1371|   296k|    temp1 = _mm_add_epi8(temp1, temp2);
 1372|   296k|    _mm_storeu_si128((__m128i *)(pu1_HorzPixel + i16_posP1), temp1);
 1373|       |
 1374|       |    //if(Aq < Beta)
 1375|   296k|    temp1 = _mm_avg_epu16(_mm_unpacklo_epi8(q0_16x8, zero),
 1376|   296k|                          _mm_unpacklo_epi8(p0_16x8, zero));
 1377|   296k|    temp2 = _mm_slli_epi16(_mm_unpacklo_epi8(q1_16x8, zero), 1);
 1378|       |    //temp2 = _mm_slli_epi16 (temp2, 1);
 1379|   296k|    temp2 = _mm_subs_epi16(_mm_unpacklo_epi8(q2_16x8, zero), temp2);
 1380|   296k|    temp2 = _mm_add_epi16(temp1, temp2);
 1381|   296k|    in_macro_16x8 = _mm_srai_epi16(temp2, 1);
 1382|       |
 1383|   296k|    temp1 = _mm_avg_epu16(_mm_unpackhi_epi8(q0_16x8, zero),
 1384|   296k|                          _mm_unpackhi_epi8(p0_16x8, zero));
 1385|   296k|    temp2 = _mm_slli_epi16(_mm_unpackhi_epi8(q1_16x8, zero), 1);
 1386|       |    //temp2 = _mm_slli_epi16 (temp2, 1);
 1387|   296k|    temp2 = _mm_subs_epi16(_mm_unpackhi_epi8(q2_16x8, zero), temp2);
 1388|   296k|    temp2 = _mm_add_epi16(temp1, temp2);
 1389|   296k|    in_macro_hi_16x8 = _mm_srai_epi16(temp2, 1);
 1390|       |
 1391|   296k|    in_macro_16x8 = _mm_max_epi16(C0_8x16, in_macro_16x8); //CLIP3
 1392|   296k|    in_macro_hi_16x8 = _mm_max_epi16(C0_hi_8x16, in_macro_hi_16x8); //CLIP3
 1393|   296k|    C0_8x16 = _mm_subs_epi16(zero, C0_8x16);
 1394|   296k|    C0_hi_8x16 = _mm_subs_epi16(zero, C0_hi_8x16);
 1395|   296k|    in_macro_16x8 = _mm_min_epi16(C0_8x16, in_macro_16x8); //CLIP3
 1396|   296k|    in_macro_hi_16x8 = _mm_min_epi16(C0_hi_8x16, in_macro_hi_16x8); //CLIP3
 1397|       |
 1398|   296k|    temp1 = _mm_add_epi16(_mm_unpacklo_epi8(q1_16x8, zero), in_macro_16x8);
 1399|   296k|    temp2 = _mm_add_epi16(_mm_unpackhi_epi8(q1_16x8, zero), in_macro_hi_16x8);
 1400|       |
 1401|   296k|    temp1 = _mm_packus_epi16(temp1, temp2);
 1402|       |
 1403|   296k|    temp1 = _mm_and_si128(temp1, flag3_16x8);
 1404|   296k|    temp2 = _mm_and_si128(q1_16x8,
 1405|   296k|                          _mm_xor_si128(flag3_16x8, _mm_set1_epi16(0xFFFF)));
 1406|   296k|    temp1 = _mm_add_epi8(temp1, temp2);
 1407|       |
 1408|   296k|    _mm_storeu_si128((__m128i *)(pu1_src + i16_posQ1), temp1);
 1409|       |
 1410|   296k|}

ih264_ihadamard_scaling_4x4_sse42:
   95|  12.2k|{
   96|  12.2k|    __m128i src_r0_r1, src_r2_r3;
   97|  12.2k|    __m128i src_r0, src_r1, src_r2, src_r3;
   98|  12.2k|    __m128i temp0, temp1, temp2, temp3;
   99|  12.2k|    __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 6) ? (1 << (5 - u4_qp_div_6)) : 0);
  ------------------
  |  Branch (99:41): [True: 8.16k, False: 4.12k]
  ------------------
  100|  12.2k|    __m128i mult_val = _mm_set1_epi32(pu2_iscal_mat[0] * pu2_weigh_mat[0]);
  101|  12.2k|    UNUSED (pi4_tmp);
  ------------------
  |  |   45|  12.2k|#define UNUSED(x) ((void)(x))
  ------------------
  102|       |
  103|  12.2k|    src_r0_r1 = _mm_loadu_si128((__m128i *) (pi2_src)); //a00 a01 a02 a03 a10 a11 a12 a13 -- the source matrix 0th,1st row
  104|  12.2k|    src_r2_r3 = _mm_loadu_si128((__m128i *) (pi2_src + 8)); //a20 a21 a22 a23 a30 a31 a32 a33 -- the source matrix 2nd,3rd row
  105|       |    //sign_reg = _mm_cmpgt_epi16(zero_8x16b, src_r0_r1);
  106|  12.2k|    src_r0 = _mm_cvtepi16_epi32(src_r0_r1);
  107|  12.2k|    src_r0_r1 = _mm_srli_si128(src_r0_r1, 8);
  108|  12.2k|    src_r1 = _mm_cvtepi16_epi32(src_r0_r1);
  109|       |
  110|  12.2k|    src_r2 = _mm_cvtepi16_epi32(src_r2_r3);
  111|  12.2k|    src_r2_r3 = _mm_srli_si128(src_r2_r3, 8);
  112|  12.2k|    src_r3 = _mm_cvtepi16_epi32(src_r2_r3);
  113|       |
  114|       |    /* Perform Inverse transform */
  115|       |    /*-------------------------------------------------------------*/
  116|       |    /* IDCT [ Horizontal transformation ]                          */
  117|       |    /*-------------------------------------------------------------*/
  118|       |    // Matrix transpose
  119|       |    /*
  120|       |     *  a0 a1 a2 a3
  121|       |     *  b0 b1 b2 b3
  122|       |     *  c0 c1 c2 c3
  123|       |     *  d0 d1 d2 d3
  124|       |     */
  125|  12.2k|    temp0 = _mm_unpacklo_epi32(src_r0, src_r1);                  //a0 b0 a1 b1
  126|  12.2k|    temp2 = _mm_unpacklo_epi32(src_r2, src_r3);                  //c0 d0 c1 d1
  127|  12.2k|    temp1 = _mm_unpackhi_epi32(src_r0, src_r1);                  //a2 b2 a3 b3
  128|  12.2k|    temp3 = _mm_unpackhi_epi32(src_r2, src_r3);                  //c2 d2 c3 d3
  129|  12.2k|    src_r0 = _mm_unpacklo_epi64(temp0, temp2);                    //a0 b0 c0 d0
  130|  12.2k|    src_r1 = _mm_unpackhi_epi64(temp0, temp2);                    //a1 b1 c1 d1
  131|  12.2k|    src_r2 = _mm_unpacklo_epi64(temp1, temp3);                    //a2 b2 c2 d2
  132|  12.2k|    src_r3 = _mm_unpackhi_epi64(temp1, temp3);                    //a3 b3 c3 d3
  133|       |
  134|  12.2k|    temp0 = _mm_add_epi32(src_r0, src_r3);
  135|  12.2k|    temp1 = _mm_add_epi32(src_r1, src_r2);
  136|  12.2k|    temp2 = _mm_sub_epi32(src_r1, src_r2);
  137|  12.2k|    temp3 = _mm_sub_epi32(src_r0, src_r3);
  138|       |
  139|  12.2k|    src_r0 = _mm_add_epi32(temp0, temp1);
  140|  12.2k|    src_r1 = _mm_add_epi32(temp2, temp3);
  141|  12.2k|    src_r2 = _mm_sub_epi32(temp0, temp1);
  142|  12.2k|    src_r3 = _mm_sub_epi32(temp3, temp2);
  143|       |
  144|       |    /*-------------------------------------------------------------*/
  145|       |    /* IDCT [ Vertical transformation ]                          */
  146|       |    /*-------------------------------------------------------------*/
  147|       |    // Matrix transpose
  148|       |    /*
  149|       |     *  a0 b0 c0 d0
  150|       |     *  a1 b1 c1 d1
  151|       |     *  a2 b2 c2 d2
  152|       |     *  a3 b3 c3 d3
  153|       |     */
  154|  12.2k|    temp0 = _mm_unpacklo_epi32(src_r0, src_r1);                  //a0 a1 b0 b1
  155|  12.2k|    temp2 = _mm_unpacklo_epi32(src_r2, src_r3);                  //a2 a3 b2 b3
  156|  12.2k|    temp1 = _mm_unpackhi_epi32(src_r0, src_r1);                  //c0 c1 d0 d1
  157|  12.2k|    temp3 = _mm_unpackhi_epi32(src_r2, src_r3);                  //c2 c3 d2 d3
  158|  12.2k|    src_r0 = _mm_unpacklo_epi64(temp0, temp2);                   //a0 a1 a2 a3
  159|  12.2k|    src_r1 = _mm_unpackhi_epi64(temp0, temp2);                   //b0 b1 b2 b3
  160|  12.2k|    src_r2 = _mm_unpacklo_epi64(temp1, temp3);                   //c0 c1 c2 c3
  161|  12.2k|    src_r3 = _mm_unpackhi_epi64(temp1, temp3);                   //d0 d1 d2 d3
  162|       |
  163|  12.2k|    temp0 = _mm_add_epi32(src_r0, src_r3);
  164|  12.2k|    temp1 = _mm_add_epi32(src_r1, src_r2);
  165|  12.2k|    temp2 = _mm_sub_epi32(src_r1, src_r2);
  166|  12.2k|    temp3 = _mm_sub_epi32(src_r0, src_r3);
  167|       |
  168|  12.2k|    src_r0 = _mm_add_epi32(temp0, temp1);
  169|  12.2k|    src_r1 = _mm_add_epi32(temp2, temp3);
  170|  12.2k|    src_r2 = _mm_sub_epi32(temp0, temp1);
  171|  12.2k|    src_r3 = _mm_sub_epi32(temp3, temp2);
  172|       |
  173|  12.2k|    src_r0 = _mm_mullo_epi32(src_r0, mult_val);
  174|  12.2k|    src_r1 = _mm_mullo_epi32(src_r1, mult_val);
  175|  12.2k|    src_r2 = _mm_mullo_epi32(src_r2, mult_val);
  176|  12.2k|    src_r3 = _mm_mullo_epi32(src_r3, mult_val);
  177|       |
  178|       |    //Scaling
  179|  12.2k|    if(u4_qp_div_6 >= 6)
  ------------------
  |  Branch (179:8): [True: 4.12k, False: 8.16k]
  ------------------
  180|  4.12k|    {
  181|  4.12k|        src_r0 = _mm_slli_epi32(src_r0, u4_qp_div_6 - 6);
  182|  4.12k|        src_r1 = _mm_slli_epi32(src_r1, u4_qp_div_6 - 6);
  183|  4.12k|        src_r2 = _mm_slli_epi32(src_r2, u4_qp_div_6 - 6);
  184|  4.12k|        src_r3 = _mm_slli_epi32(src_r3, u4_qp_div_6 - 6);
  185|  4.12k|    }
  186|  8.16k|    else
  187|  8.16k|    {
  188|  8.16k|        temp0 = _mm_add_epi32(src_r0, add_rshift);
  189|  8.16k|        temp1 = _mm_add_epi32(src_r1, add_rshift);
  190|  8.16k|        temp2 = _mm_add_epi32(src_r2, add_rshift);
  191|  8.16k|        temp3 = _mm_add_epi32(src_r3, add_rshift);
  192|  8.16k|        src_r0 = _mm_srai_epi32(temp0, 6 - u4_qp_div_6);
  193|  8.16k|        src_r1 = _mm_srai_epi32(temp1, 6 - u4_qp_div_6);
  194|  8.16k|        src_r2 = _mm_srai_epi32(temp2, 6 - u4_qp_div_6);
  195|  8.16k|        src_r3 = _mm_srai_epi32(temp3, 6 - u4_qp_div_6);
  196|  8.16k|    }
  197|  12.2k|    src_r0_r1 = _mm_packs_epi32(src_r0, src_r1);
  198|  12.2k|    src_r2_r3 = _mm_packs_epi32(src_r2, src_r3);
  199|       |
  200|  12.2k|    _mm_storeu_si128((__m128i *) (&pi2_out[0]), src_r0_r1);
  201|  12.2k|    _mm_storeu_si128((__m128i *) (&pi2_out[8]), src_r2_r3);
  202|  12.2k|}

ih264_inter_pred_luma_copy_ssse3:
   98|  10.1M|{
   99|  10.1M|    __m128i y_0_16x8b, y_1_16x8b, y_2_16x8b, y_3_16x8b;
  100|       |
  101|  10.1M|    WORD32 src_strd2, src_strd3, src_strd4, dst_strd2, dst_strd3, dst_strd4;
  102|  10.1M|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  10.1M|#define UNUSED(x) ((void)(x))
  ------------------
  103|  10.1M|    UNUSED(dydx);
  ------------------
  |  |   45|  10.1M|#define UNUSED(x) ((void)(x))
  ------------------
  104|       |
  105|  10.1M|    src_strd2 = src_strd << 1;
  106|  10.1M|    dst_strd2 = dst_strd << 1;
  107|  10.1M|    src_strd4 = src_strd << 2;
  108|  10.1M|    dst_strd4 = dst_strd << 2;
  109|  10.1M|    src_strd3 = src_strd2 + src_strd;
  110|  10.1M|    dst_strd3 = dst_strd2 + dst_strd;
  111|       |
  112|  10.1M|    if(wd == 4)
  ------------------
  |  Branch (112:8): [True: 24.7k, False: 10.1M]
  ------------------
  113|  24.7k|    {
  114|  24.7k|        do
  115|  43.0k|        {
  116|  43.0k|            *((WORD32 *)(pu1_dst)) =  *((WORD32 *)(pu1_src));
  117|  43.0k|            *((WORD32 *)(pu1_dst + dst_strd)) = *((WORD32 *)(pu1_src + src_strd));
  118|  43.0k|            *((WORD32 *)(pu1_dst + dst_strd2)) = *((WORD32 *)(pu1_src + src_strd2));
  119|  43.0k|            *((WORD32 *)(pu1_dst + dst_strd3)) = *((WORD32 *)(pu1_src + src_strd3));
  120|       |
  121|  43.0k|            ht -= 4;
  122|  43.0k|            pu1_src += src_strd4;
  123|  43.0k|            pu1_dst += dst_strd4;
  124|  43.0k|        }
  125|  43.0k|        while(ht > 0);
  ------------------
  |  Branch (125:15): [True: 18.2k, False: 24.7k]
  ------------------
  126|  24.7k|    }
  127|  10.1M|    else if(wd == 8)
  ------------------
  |  Branch (127:13): [True: 109k, False: 10.0M]
  ------------------
  128|   109k|    {
  129|   109k|        do
  130|   255k|        {
  131|   255k|            y_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  132|   255k|            y_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
  133|   255k|            y_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd2));
  134|   255k|            y_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd3));
  135|       |
  136|   255k|            _mm_storel_epi64((__m128i *)pu1_dst, y_0_16x8b);
  137|   255k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), y_1_16x8b);
  138|   255k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd2), y_2_16x8b);
  139|   255k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd3), y_3_16x8b);
  140|       |
  141|   255k|            ht -= 4;
  142|   255k|            pu1_src += src_strd4;
  143|   255k|            pu1_dst += dst_strd4;
  144|   255k|        }
  145|   255k|        while(ht > 0);
  ------------------
  |  Branch (145:15): [True: 146k, False: 109k]
  ------------------
  146|   109k|    }
  147|  10.0M|    else // wd == 16
  148|  10.0M|    {
  149|  10.0M|        WORD32 src_strd5, src_strd6, src_strd7, src_strd8;
  150|  10.0M|        WORD32 dst_strd5, dst_strd6, dst_strd7, dst_strd8;
  151|       |
  152|  10.0M|        __m128i y_4_16x8b, y_5_16x8b, y_6_16x8b, y_7_16x8b;
  153|       |
  154|  10.0M|        src_strd5 = src_strd2 + src_strd3;
  155|  10.0M|        dst_strd5 = dst_strd2 + dst_strd3;
  156|  10.0M|        src_strd6 = src_strd3 << 1;
  157|  10.0M|        dst_strd6 = dst_strd3 << 1;
  158|  10.0M|        src_strd7 = src_strd3 + src_strd4;
  159|  10.0M|        dst_strd7 = dst_strd3 + dst_strd4;
  160|  10.0M|        src_strd8 = src_strd << 3;
  161|  10.0M|        dst_strd8 = dst_strd << 3;
  162|       |
  163|  10.0M|        do
  164|  20.0M|        {
  165|  20.0M|            y_0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
  166|  20.0M|            y_1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));
  167|  20.0M|            y_2_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd2));
  168|  20.0M|            y_3_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd3));
  169|  20.0M|            y_4_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd4));
  170|  20.0M|            y_5_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd5));
  171|  20.0M|            y_6_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd6));
  172|  20.0M|            y_7_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd7));
  173|       |
  174|  20.0M|            _mm_storeu_si128((__m128i *)pu1_dst, y_0_16x8b);
  175|  20.0M|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), y_1_16x8b);
  176|  20.0M|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd2), y_2_16x8b);
  177|  20.0M|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd3), y_3_16x8b);
  178|  20.0M|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd4), y_4_16x8b);
  179|  20.0M|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd5), y_5_16x8b);
  180|  20.0M|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd6), y_6_16x8b);
  181|  20.0M|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd7), y_7_16x8b);
  182|       |
  183|  20.0M|            ht -= 8;
  184|  20.0M|            pu1_src += src_strd8;
  185|  20.0M|            pu1_dst += dst_strd8;
  186|  20.0M|        }
  187|  20.0M|        while(ht > 0);
  ------------------
  |  Branch (187:15): [True: 10.0M, False: 10.0M]
  ------------------
  188|  10.0M|    }
  189|  10.1M|}
ih264_inter_pred_luma_horz_ssse3:
  224|  42.1k|{
  225|  42.1k|    __m128i coeff0_1_16x8b, coeff2_3_16x8b, coeff4_5_16x8b;
  226|  42.1k|    __m128i const_val16_8x16b;
  227|       |
  228|  42.1k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  42.1k|#define UNUSED(x) ((void)(x))
  ------------------
  229|  42.1k|    UNUSED(dydx);
  ------------------
  |  |   45|  42.1k|#define UNUSED(x) ((void)(x))
  ------------------
  230|       |
  231|  42.1k|    pu1_src -= 2; // the filter input starts from x[-2] (till x[3])
  232|       |
  233|  42.1k|    coeff0_1_16x8b = _mm_set1_epi32(0xFB01FB01); //c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1
  234|  42.1k|    coeff2_3_16x8b = _mm_set1_epi32(0x14141414); //c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3
  235|  42.1k|    coeff4_5_16x8b = _mm_set1_epi32(0x01FB01FB); //c4 c5 c4 c5 c4 c5 c4 c5 c4 c5 c4 c5 c4 c5 c4 c5
  236|       |                                                 //c0 = c5 = 1, c1 = c4 = -5, c2 = c3 = 20
  237|  42.1k|    const_val16_8x16b = _mm_set1_epi16(16);
  238|       |
  239|  42.1k|    if(wd == 4)
  ------------------
  |  Branch (239:8): [True: 4.94k, False: 37.1k]
  ------------------
  240|  4.94k|    {
  241|  4.94k|        __m128i src_r0_16x8b, src_r1_16x8b, src_r0r1_16x8b;
  242|  4.94k|        __m128i src_r0_sht_16x8b, src_r1_sht_16x8b;
  243|       |
  244|  4.94k|        __m128i res_r0r1_t1_8x16b, res_r0r1_t2_8x16b, res_r0r1_t3_8x16b;
  245|  4.94k|        __m128i res_r0r1_16x8b;
  246|       |
  247|       |        //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
  248|       |        //Row1 : b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
  249|       |
  250|  4.94k|        do
  251|  12.9k|        {
  252|  12.9k|            src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);                     //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
  253|  12.9k|            src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));        //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9....b15
  254|       |
  255|  12.9k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                     //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
  256|  12.9k|            src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                     //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
  257|       |
  258|  12.9k|            src_r0_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);       //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
  259|  12.9k|            src_r1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);       //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
  260|       |
  261|  12.9k|            src_r0r1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);        //a0 a1 a1 a2 a2 a3 a3 a4 b0 b1 b1 b2 b2 b3 b3 b4
  262|  12.9k|            res_r0r1_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);  //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
  263|       |                                                                                    //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
  264|       |
  265|  12.9k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 4);                         //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8  0  0  0  0
  266|  12.9k|            src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 4);                         //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8  0  0  0  0
  267|       |
  268|  12.9k|            src_r0r1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);        //a2 a3 a3 a4 a4 a5 a5 a6 b2 b3 b3 b4 b4 b5 b5 b6
  269|  12.9k|            res_r0r1_t2_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff2_3_16x8b);  //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
  270|       |                                                                                    //b2*c2+b3*c3 b3*c2+b4*c3 b4*c2+b5*c3 b5*c2+b6*c3
  271|       |
  272|  12.9k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 4);                         //a4 a5 a5 a6 a6 a7 a7 a8  0  0  0  0  0  0  0  0
  273|  12.9k|            src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 4);                         //b4 b5 b5 b6 b6 b7 b7 b8  0  0  0  0  0  0  0  0
  274|       |
  275|  12.9k|            src_r0r1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);        //a4 a5 a5 a6 a6 a7 a7 a8 b4 b5 b5 b6 b6 b7 b7 b8
  276|  12.9k|            res_r0r1_t3_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff4_5_16x8b);  //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
  277|       |                                                                                    //b4*c4+b5*c5 b5*c4+b6*c5 b4*c6+b7*c5 b7*c4+b8*c5
  278|       |
  279|  12.9k|            res_r0r1_t1_8x16b = _mm_add_epi16(res_r0r1_t1_8x16b, res_r0r1_t2_8x16b);
  280|  12.9k|            res_r0r1_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_r0r1_t3_8x16b);
  281|  12.9k|            res_r0r1_t1_8x16b = _mm_add_epi16(res_r0r1_t1_8x16b, res_r0r1_t3_8x16b); //a0*c0+a1*c1+a2*c2+a3*c3+a4*a4+a5*c5 + 16;
  282|       |                                                                                     //a1*c0+a2*c1+a2*c2+a3*c3+a5*a4+a6*c5 + 16;
  283|       |                                                                                     //a2*c0+a3*c1+a4*c2+a5*c3+a6*a4+a7*c5 + 16;
  284|       |                                                                                     //a3*c0+a4*c1+a5*c2+a6*c3+a6*a4+a8*c5 + 16;
  285|       |                                                                                     //b0*c0+b1*c1+b2*c2+b3*c3+b4*b4+b5*c5 + 16;
  286|       |                                                                                     //b1*c0+b2*c1+b2*c2+b3*c3+b5*b4+b6*c5 + 16;
  287|       |                                                                                     //b2*c0+b3*c1+b4*c2+b5*c3+b6*b4+b7*c5 + 16;
  288|       |                                                                                     //b3*c0+b4*c1+b5*c2+b6*c3+b6*b4+b8*c5 + 16;
  289|       |
  290|  12.9k|            res_r0r1_t1_8x16b = _mm_srai_epi16(res_r0r1_t1_8x16b, 5);                //shifting right by 5 bits.
  291|       |
  292|  12.9k|            res_r0r1_16x8b = _mm_packus_epi16(res_r0r1_t1_8x16b, res_r0r1_t1_8x16b);
  293|       |
  294|  12.9k|            *((WORD32 *)(pu1_dst)) = _mm_cvtsi128_si32(res_r0r1_16x8b);
  295|  12.9k|            res_r0r1_16x8b = _mm_srli_si128(res_r0r1_16x8b, 4);
  296|  12.9k|            *((WORD32 *)(pu1_dst + dst_strd)) = _mm_cvtsi128_si32(res_r0r1_16x8b);
  297|       |
  298|  12.9k|            ht -= 2;
  299|  12.9k|            pu1_src += src_strd << 1;
  300|  12.9k|            pu1_dst += dst_strd << 1;
  301|  12.9k|        }
  302|  12.9k|        while(ht > 0);
  ------------------
  |  Branch (302:15): [True: 7.96k, False: 4.94k]
  ------------------
  303|  4.94k|    }
  304|  37.1k|    else if(wd == 8)
  ------------------
  |  Branch (304:13): [True: 16.7k, False: 20.4k]
  ------------------
  305|  16.7k|    {
  306|  16.7k|        __m128i src_r0_16x8b, src_r1_16x8b, src_r0_sht_16x8b, src_r1_sht_16x8b;
  307|  16.7k|        __m128i src_r0_t1_16x8b, src_r1_t1_16x8b;
  308|       |
  309|  16.7k|        __m128i res_r0_t1_8x16b, res_r0_t2_8x16b, res_r0_t3_8x16b;
  310|  16.7k|        __m128i res_r1_t1_8x16b, res_r1_t2_8x16b, res_r1_t3_8x16b;
  311|       |
  312|       |        //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
  313|       |        //Row1 : b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
  314|       |
  315|  16.7k|        do
  316|  74.5k|        {
  317|  74.5k|            src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);                   //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
  318|  74.5k|            src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));      //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9....b15
  319|       |
  320|  74.5k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                   //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
  321|  74.5k|            src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                   //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
  322|       |
  323|  74.5k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);  //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
  324|  74.5k|            src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);  //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
  325|       |
  326|  74.5k|            res_r0_t1_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff0_1_16x8b); //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
  327|       |                                                                                  //a4*c0+a5*c1 a5*c0+a6*c1 a6*c0+a7*c1 a7*c0+a8*c1
  328|  74.5k|            res_r1_t1_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff0_1_16x8b); //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
  329|       |                                                                                  //b4*c0+b5*c1 b5*c0+b6*c1 b6*c0+b7*c1 b7*c0+b8*c1
  330|       |
  331|  74.5k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                       //a2 a3 a4 a5 a6 a7 a8 a9....a15 0 0
  332|  74.5k|            src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                       //b2 b3 b4 b5 b6 b7 b8 b9....b15 0 0
  333|       |
  334|  74.5k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);               //a3 a4 a5 a6 a7 a8 a9....a15 0  0  0
  335|  74.5k|            src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);               //b3 b4 b5 b6 b7 b8 b9....b15 0  0  0
  336|       |
  337|  74.5k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);  //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10
  338|  74.5k|            src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);  //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8 a8 a9 a9 a10
  339|       |
  340|  74.5k|            res_r0_t2_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff2_3_16x8b); //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
  341|       |                                                                                  //a6*c2+a7*c3 a7*c2+a8*c3 a8*c2+a9*c3 a9*c2+a10*c3
  342|  74.5k|            res_r1_t2_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff2_3_16x8b); //b2*c2+b3*c3 b3*c2+b4*c3 b2*c4+b5*c3 b5*c2+b6*c3
  343|       |                                                                                  //b6*c2+b7*c3 b7*c2+b8*c3 b8*c2+b9*c3 b9*c2+b10*c3
  344|       |
  345|  74.5k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                       //a4 a5 a6 a7 a8 a9....a15 0  0  0  0
  346|  74.5k|            src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                       //b4 b5 b6 b7 b8 b9....b15 0  0  0  0
  347|       |
  348|  74.5k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);               //a5 a6 a7 a8 a9....a15 0  0  0  0  0
  349|  74.5k|            src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);               //b5 b6 b7 b8 b9....b15 0  0  0  0  0
  350|       |
  351|  74.5k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);  //a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10 a10 a11 a11 a12
  352|  74.5k|            src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);  //b4 b5 b5 b6 b6 b7 b7 b8 b8 b9 b9 b10 b10 b11 b11 b12
  353|       |
  354|  74.5k|            res_r0_t3_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff4_5_16x8b); //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
  355|       |                                                                                  //a8*c4+a9*c5 a9*c4+a10*c5 a10*c4+a11*c5 a11*c4+a12*c5
  356|  74.5k|            res_r1_t3_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff4_5_16x8b); //b4*c4+b5*c5 b5*c4+b6*c5 b6*c4+b7*c5 b7*c4+b8*c5
  357|       |                                                                                  //b8*c4+b9*c5 b9*c4+b10*c5 b10*c4+b11*c5 b11*c4+b12*c5
  358|  74.5k|            res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t2_8x16b);
  359|  74.5k|            res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t2_8x16b);
  360|  74.5k|            res_r0_t3_8x16b = _mm_add_epi16(res_r0_t3_8x16b, const_val16_8x16b);
  361|  74.5k|            res_r1_t3_8x16b = _mm_add_epi16(res_r1_t3_8x16b, const_val16_8x16b);
  362|  74.5k|            res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t3_8x16b);
  363|  74.5k|            res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t3_8x16b);
  364|       |
  365|  74.5k|            res_r0_t1_8x16b = _mm_srai_epi16(res_r0_t1_8x16b, 5);                 //shifting right by 5 bits.
  366|  74.5k|            res_r1_t1_8x16b = _mm_srai_epi16(res_r1_t1_8x16b, 5);
  367|       |
  368|  74.5k|            src_r0_16x8b = _mm_packus_epi16(res_r0_t1_8x16b, res_r0_t1_8x16b);
  369|  74.5k|            src_r1_16x8b = _mm_packus_epi16(res_r1_t1_8x16b, res_r1_t1_8x16b);
  370|       |
  371|  74.5k|            _mm_storel_epi64((__m128i *)pu1_dst, src_r0_16x8b);
  372|  74.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), src_r1_16x8b);
  373|       |
  374|  74.5k|            ht -= 2;
  375|  74.5k|            pu1_src += src_strd << 1;
  376|  74.5k|            pu1_dst += dst_strd << 1;
  377|  74.5k|        }
  378|  74.5k|        while(ht > 0);
  ------------------
  |  Branch (378:15): [True: 57.8k, False: 16.7k]
  ------------------
  379|  16.7k|    }
  380|  20.4k|    else // wd == 16
  381|  20.4k|    {
  382|  20.4k|        __m128i src_r0_16x8b, src_r1_16x8b, src_r0_sht_16x8b, src_r1_sht_16x8b;
  383|  20.4k|        __m128i src_r0_t1_16x8b, src_r1_t1_16x8b;
  384|       |
  385|  20.4k|        __m128i res_r0_t1_8x16b, res_r0_t2_8x16b, res_r0_t3_8x16b;
  386|  20.4k|        __m128i res_r1_t1_8x16b, res_r1_t2_8x16b, res_r1_t3_8x16b;
  387|       |
  388|       |        //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
  389|       |        //Row0 :                         b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
  390|       |        //b0 is same a8. Similarly other bn pixels are same as a(n+8) pixels.
  391|       |
  392|  20.4k|        do
  393|   277k|        {
  394|   277k|            src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);                  //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
  395|   277k|            src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 8));            //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9....b15
  396|       |
  397|   277k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                   //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
  398|   277k|            src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                   //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
  399|       |
  400|   277k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);  //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
  401|   277k|            src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);  //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
  402|       |
  403|   277k|            res_r0_t1_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff0_1_16x8b); //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
  404|       |                                                                                  //a4*c0+a5*c1 a5*c0+a6*c1 a6*c0+a7*c1 a7*c0+a8*c1
  405|   277k|            res_r1_t1_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff0_1_16x8b); //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
  406|       |                                                                                  //b4*c0+b5*c1 b5*c0+b6*c1 b6*c0+b7*c1 b7*c0+b8*c1
  407|       |
  408|   277k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                       //a2 a3 a4 a5 a6 a7 a8 a9....a15 0 0
  409|   277k|            src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                       //b2 b3 b4 b5 b6 b7 b8 b9....b15 0 0
  410|       |
  411|   277k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);               //a3 a4 a5 a6 a7 a8 a9....a15 0  0  0
  412|   277k|            src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);               //b3 b4 b5 b6 b7 b8 b9....b15 0  0  0
  413|       |
  414|   277k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);  //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10
  415|   277k|            src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);  //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8 a8 a9 a9 a10
  416|       |
  417|   277k|            res_r0_t2_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff2_3_16x8b); //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
  418|       |                                                                                  //a6*c2+a7*c3 a7*c2+a8*c3 a8*c2+a9*c3 a9*c2+a10*c3
  419|   277k|            res_r1_t2_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff2_3_16x8b); //b2*c2+b3*c3 b3*c2+b4*c3 b2*c4+b5*c3 b5*c2+b6*c3
  420|       |                                                                                  //b6*c2+b7*c3 b7*c2+b8*c3 b8*c2+b9*c3 b9*c2+b10*c3
  421|       |
  422|   277k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                       //a4 a5 a6 a7 a8 a9....a15 0  0  0  0
  423|   277k|            src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                       //b4 b5 b6 b7 b8 b9....b15 0  0  0  0
  424|       |
  425|   277k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);               //a5 a6 a7 a8 a9....a15 0  0  0  0  0
  426|   277k|            src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);               //b5 b6 b7 b8 b9....b15 0  0  0  0  0
  427|       |
  428|   277k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);  //a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10 a10 a11 a11 a12
  429|   277k|            src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);  //b4 b5 b5 b6 b6 b7 b7 b8 b8 b9 b9 b10 b10 b11 b11 b12
  430|       |
  431|   277k|            res_r0_t3_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff4_5_16x8b); //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
  432|       |                                                                                  //a8*c4+a9*c5 a9*c4+a10*c5 a10*c4+a11*c5 a11*c4+a12*c5
  433|   277k|            res_r1_t3_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff4_5_16x8b); //b4*c4+b5*c5 b5*c4+b6*c5 b6*c4+b7*c5 b7*c4+b8*c5
  434|       |                                                                                  //b8*c4+b9*c5 b9*c4+b10*c5 b10*c4+b11*c5 b11*c4+b12*c5
  435|   277k|            res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t2_8x16b);
  436|   277k|            res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t2_8x16b);
  437|   277k|            res_r0_t3_8x16b = _mm_add_epi16(res_r0_t3_8x16b, const_val16_8x16b);
  438|   277k|            res_r1_t3_8x16b = _mm_add_epi16(res_r1_t3_8x16b, const_val16_8x16b);
  439|   277k|            res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t3_8x16b);
  440|   277k|            res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t3_8x16b);
  441|       |
  442|   277k|            res_r0_t1_8x16b = _mm_srai_epi16(res_r0_t1_8x16b, 5);                 //shifting right by 5 bits.
  443|   277k|            res_r1_t1_8x16b = _mm_srai_epi16(res_r1_t1_8x16b, 5);
  444|       |
  445|   277k|            src_r0_16x8b = _mm_packus_epi16(res_r0_t1_8x16b, res_r1_t1_8x16b);
  446|   277k|            _mm_storeu_si128((__m128i *)pu1_dst, src_r0_16x8b);
  447|       |
  448|   277k|            ht--;
  449|   277k|            pu1_src += src_strd;
  450|   277k|            pu1_dst += dst_strd;
  451|   277k|        }
  452|   277k|        while(ht > 0);
  ------------------
  |  Branch (452:15): [True: 257k, False: 20.4k]
  ------------------
  453|  20.4k|    }
  454|  42.1k|}
ih264_inter_pred_luma_vert_ssse3:
  489|  39.6k|{
  490|  39.6k|    __m128i src_r0_16x8b, src_r1_16x8b, src_r2_16x8b, src_r3_16x8b, src_r4_16x8b;
  491|  39.6k|    __m128i src_r5_16x8b, src_r6_16x8b;
  492|  39.6k|    __m128i src_r0r1_16x8b, src_r2r3_16x8b, src_r4r5_16x8b;
  493|       |
  494|  39.6k|    __m128i res_16x8b, res_t1_8x16b, res_t2_8x16b, res_t3_8x16b;
  495|       |
  496|  39.6k|    __m128i coeff0_1_16x8b, coeff2_3_16x8b, coeff4_5_16x8b;
  497|  39.6k|    __m128i const_val16_8x16b;
  498|       |
  499|  39.6k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  39.6k|#define UNUSED(x) ((void)(x))
  ------------------
  500|  39.6k|    UNUSED(dydx);
  ------------------
  |  |   45|  39.6k|#define UNUSED(x) ((void)(x))
  ------------------
  501|       |
  502|  39.6k|    coeff0_1_16x8b = _mm_set1_epi32(0xFB01FB01); //c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1
  503|  39.6k|    coeff2_3_16x8b = _mm_set1_epi32(0x14141414); //c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3
  504|  39.6k|    coeff4_5_16x8b = _mm_set1_epi32(0x01FB01FB); //c4 c5 c4 c5 c4 c5 c4 c5 c4 c5 c4 c5 c4 c5 c4 c5
  505|       |                                                 //c0 = c5 = 1, c1 = c4 = -5, c2 = c3 = 20
  506|  39.6k|    const_val16_8x16b = _mm_set1_epi16(16);
  507|       |
  508|  39.6k|    pu1_src -= src_strd << 1; // the filter input starts from x[-2] (till x[3])
  509|       |
  510|  39.6k|    if(wd == 4)
  ------------------
  |  Branch (510:8): [True: 3.20k, False: 36.4k]
  ------------------
  511|  3.20k|    {
  512|       |        //Epilogue: Load all the pred rows except sixth and seventh row
  513|       |        //          for the first and second row processing.
  514|  3.20k|        src_r0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  515|  3.20k|        pu1_src += src_strd;
  516|  3.20k|        src_r1_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  517|  3.20k|        pu1_src += src_strd;
  518|  3.20k|        src_r2_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  519|  3.20k|        pu1_src += src_strd;
  520|  3.20k|        src_r3_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  521|  3.20k|        pu1_src += src_strd;
  522|  3.20k|        src_r4_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  523|  3.20k|        pu1_src += src_strd;
  524|       |
  525|  3.20k|        src_r0_16x8b = _mm_unpacklo_epi32(src_r0_16x8b, src_r1_16x8b);
  526|  3.20k|        src_r1_16x8b = _mm_unpacklo_epi32(src_r1_16x8b, src_r2_16x8b);
  527|  3.20k|        src_r2_16x8b = _mm_unpacklo_epi32(src_r2_16x8b, src_r3_16x8b);
  528|  3.20k|        src_r3_16x8b = _mm_unpacklo_epi32(src_r3_16x8b, src_r4_16x8b);
  529|       |
  530|  3.20k|        do
  531|  11.0k|        {
  532|  11.0k|            src_r5_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  533|  11.0k|            src_r6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
  534|       |
  535|  11.0k|            src_r4_16x8b = _mm_unpacklo_epi32(src_r4_16x8b, src_r5_16x8b);
  536|  11.0k|            src_r5_16x8b = _mm_unpacklo_epi32(src_r5_16x8b, src_r6_16x8b);
  537|       |
  538|  11.0k|            src_r0r1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r1_16x8b);
  539|  11.0k|            src_r2r3_16x8b = _mm_unpacklo_epi8(src_r2_16x8b, src_r3_16x8b);
  540|  11.0k|            src_r4r5_16x8b = _mm_unpacklo_epi8(src_r4_16x8b, src_r5_16x8b);
  541|       |
  542|  11.0k|            res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
  543|  11.0k|            res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
  544|  11.0k|            res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
  545|       |
  546|  11.0k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
  547|  11.0k|            res_t3_8x16b = _mm_add_epi16(res_t3_8x16b, const_val16_8x16b);
  548|  11.0k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
  549|       |
  550|  11.0k|            res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
  551|  11.0k|            res_16x8b = _mm_packus_epi16(res_t1_8x16b, res_t1_8x16b);
  552|       |
  553|  11.0k|            *((WORD32 *)(pu1_dst)) = _mm_cvtsi128_si32(res_16x8b);
  554|  11.0k|            res_16x8b = _mm_srli_si128(res_16x8b, 4);
  555|  11.0k|            *((WORD32 *)(pu1_dst + dst_strd)) = _mm_cvtsi128_si32(res_16x8b);
  556|       |
  557|  11.0k|            src_r0_16x8b = src_r2_16x8b;
  558|  11.0k|            src_r1_16x8b = src_r3_16x8b;
  559|  11.0k|            src_r2_16x8b = src_r4_16x8b;
  560|  11.0k|            src_r3_16x8b = src_r5_16x8b;
  561|  11.0k|            src_r4_16x8b = src_r6_16x8b;
  562|       |
  563|  11.0k|            ht -= 2;
  564|  11.0k|            pu1_src += src_strd << 1;
  565|  11.0k|            pu1_dst += dst_strd << 1;
  566|  11.0k|        }
  567|  11.0k|        while(ht > 0);
  ------------------
  |  Branch (567:15): [True: 7.79k, False: 3.20k]
  ------------------
  568|  3.20k|    }
  569|       |
  570|  36.4k|    else if(wd == 8)
  ------------------
  |  Branch (570:13): [True: 13.8k, False: 22.5k]
  ------------------
  571|  13.8k|    {
  572|       |        //Epilogue: Load all the pred rows except sixth and seventh row
  573|       |        //          for the first and second row processing.
  574|  13.8k|        src_r0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  575|  13.8k|        pu1_src += src_strd;
  576|  13.8k|        src_r1_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  577|  13.8k|        pu1_src += src_strd;
  578|  13.8k|        src_r2_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  579|  13.8k|        pu1_src += src_strd;
  580|  13.8k|        src_r3_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  581|  13.8k|        pu1_src += src_strd;
  582|  13.8k|        src_r4_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  583|  13.8k|        pu1_src += src_strd;
  584|       |
  585|  13.8k|        src_r0_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);
  586|  13.8k|        src_r1_16x8b = _mm_unpacklo_epi64(src_r1_16x8b, src_r2_16x8b);
  587|  13.8k|        src_r2_16x8b = _mm_unpacklo_epi64(src_r2_16x8b, src_r3_16x8b);
  588|  13.8k|        src_r3_16x8b = _mm_unpacklo_epi64(src_r3_16x8b, src_r4_16x8b);
  589|       |
  590|  13.8k|        do
  591|  67.1k|        {
  592|  67.1k|            src_r5_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  593|  67.1k|            src_r6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
  594|       |
  595|  67.1k|            src_r4_16x8b = _mm_unpacklo_epi64(src_r4_16x8b, src_r5_16x8b);
  596|  67.1k|            src_r5_16x8b = _mm_unpacklo_epi64(src_r5_16x8b, src_r6_16x8b);
  597|       |
  598|  67.1k|            src_r0r1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r1_16x8b);
  599|  67.1k|            src_r2r3_16x8b = _mm_unpacklo_epi8(src_r2_16x8b, src_r3_16x8b);
  600|  67.1k|            src_r4r5_16x8b = _mm_unpacklo_epi8(src_r4_16x8b, src_r5_16x8b);
  601|       |
  602|  67.1k|            res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
  603|  67.1k|            res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
  604|  67.1k|            res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
  605|       |
  606|  67.1k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
  607|  67.1k|            res_t3_8x16b = _mm_add_epi16(res_t3_8x16b, const_val16_8x16b);
  608|  67.1k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
  609|       |
  610|  67.1k|            res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
  611|  67.1k|            res_16x8b = _mm_packus_epi16(res_t1_8x16b, res_t1_8x16b);
  612|       |
  613|  67.1k|            _mm_storel_epi64((__m128i *)pu1_dst, res_16x8b);
  614|       |
  615|  67.1k|            src_r0r1_16x8b = _mm_unpackhi_epi8(src_r0_16x8b, src_r1_16x8b);
  616|  67.1k|            src_r2r3_16x8b = _mm_unpackhi_epi8(src_r2_16x8b, src_r3_16x8b);
  617|  67.1k|            src_r4r5_16x8b = _mm_unpackhi_epi8(src_r4_16x8b, src_r5_16x8b);
  618|       |
  619|  67.1k|            res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
  620|  67.1k|            res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
  621|  67.1k|            res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
  622|       |
  623|  67.1k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
  624|  67.1k|            res_t3_8x16b = _mm_add_epi16(res_t3_8x16b, const_val16_8x16b);
  625|  67.1k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
  626|       |
  627|  67.1k|            res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
  628|  67.1k|            res_16x8b = _mm_packus_epi16(res_t1_8x16b, res_t1_8x16b);
  629|       |
  630|  67.1k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), res_16x8b);
  631|       |
  632|  67.1k|            src_r0_16x8b = src_r2_16x8b;
  633|  67.1k|            src_r1_16x8b = src_r3_16x8b;
  634|  67.1k|            src_r2_16x8b = src_r4_16x8b;
  635|  67.1k|            src_r3_16x8b = src_r5_16x8b;
  636|  67.1k|            src_r4_16x8b = src_r6_16x8b;
  637|       |
  638|  67.1k|            ht -= 2;
  639|  67.1k|            pu1_src += src_strd << 1;
  640|  67.1k|            pu1_dst += dst_strd << 1;
  641|  67.1k|        }
  642|  67.1k|        while(ht > 0);
  ------------------
  |  Branch (642:15): [True: 53.2k, False: 13.8k]
  ------------------
  643|  13.8k|    }
  644|  22.5k|    else // wd == 16
  645|  22.5k|    {
  646|  22.5k|        __m128i res_t0_8x16b;
  647|       |
  648|       |        //Epilogue: Load all the pred rows except sixth and seventh row
  649|       |        //          for the first and second row processing.
  650|  22.5k|        src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
  651|  22.5k|        pu1_src += src_strd;
  652|  22.5k|        src_r1_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
  653|  22.5k|        pu1_src += src_strd;
  654|  22.5k|        src_r2_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
  655|  22.5k|        pu1_src += src_strd;
  656|  22.5k|        src_r3_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
  657|  22.5k|        pu1_src += src_strd;
  658|  22.5k|        src_r4_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
  659|  22.5k|        pu1_src += src_strd;
  660|       |
  661|  22.5k|        do
  662|   163k|        {
  663|   163k|            src_r5_16x8b  = _mm_loadu_si128((__m128i *)pu1_src);
  664|   163k|            src_r6_16x8b  = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));
  665|       |
  666|   163k|            src_r0r1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r1_16x8b);
  667|   163k|            src_r2r3_16x8b = _mm_unpacklo_epi8(src_r2_16x8b, src_r3_16x8b);
  668|   163k|            src_r4r5_16x8b = _mm_unpacklo_epi8(src_r4_16x8b, src_r5_16x8b);
  669|       |
  670|   163k|            res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
  671|   163k|            res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
  672|   163k|            res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
  673|       |
  674|   163k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
  675|   163k|            res_t3_8x16b = _mm_add_epi16(res_t3_8x16b, const_val16_8x16b);
  676|   163k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
  677|   163k|            res_t0_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
  678|       |
  679|   163k|            src_r0r1_16x8b = _mm_unpackhi_epi8(src_r0_16x8b, src_r1_16x8b);
  680|   163k|            src_r2r3_16x8b = _mm_unpackhi_epi8(src_r2_16x8b, src_r3_16x8b);
  681|   163k|            src_r4r5_16x8b = _mm_unpackhi_epi8(src_r4_16x8b, src_r5_16x8b);
  682|       |
  683|   163k|            res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
  684|   163k|            res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
  685|   163k|            res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
  686|       |
  687|   163k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
  688|   163k|            res_t3_8x16b = _mm_add_epi16(res_t3_8x16b, const_val16_8x16b);
  689|   163k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
  690|   163k|            res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
  691|       |
  692|   163k|            res_16x8b = _mm_packus_epi16(res_t0_8x16b, res_t1_8x16b);
  693|       |
  694|   163k|            _mm_storeu_si128((__m128i *)pu1_dst, res_16x8b);
  695|       |
  696|   163k|            src_r0r1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r2_16x8b);
  697|   163k|            src_r2r3_16x8b = _mm_unpacklo_epi8(src_r3_16x8b, src_r4_16x8b);
  698|   163k|            src_r4r5_16x8b = _mm_unpacklo_epi8(src_r5_16x8b, src_r6_16x8b);
  699|       |
  700|   163k|            res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
  701|   163k|            res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
  702|   163k|            res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
  703|       |
  704|   163k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
  705|   163k|            res_t3_8x16b = _mm_add_epi16(res_t3_8x16b, const_val16_8x16b);
  706|   163k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
  707|   163k|            res_t0_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
  708|       |
  709|   163k|            src_r0r1_16x8b = _mm_unpackhi_epi8(src_r1_16x8b, src_r2_16x8b);
  710|   163k|            src_r2r3_16x8b = _mm_unpackhi_epi8(src_r3_16x8b, src_r4_16x8b);
  711|   163k|            src_r4r5_16x8b = _mm_unpackhi_epi8(src_r5_16x8b, src_r6_16x8b);
  712|       |
  713|   163k|            res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
  714|   163k|            res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
  715|   163k|            res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
  716|       |
  717|   163k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
  718|   163k|            res_t3_8x16b = _mm_add_epi16(res_t3_8x16b, const_val16_8x16b);
  719|   163k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
  720|   163k|            res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
  721|       |
  722|   163k|            res_16x8b = _mm_packus_epi16(res_t0_8x16b, res_t1_8x16b);
  723|       |
  724|   163k|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), res_16x8b);
  725|       |
  726|   163k|            src_r0_16x8b = src_r2_16x8b;
  727|   163k|            src_r1_16x8b = src_r3_16x8b;
  728|   163k|            src_r2_16x8b = src_r4_16x8b;
  729|   163k|            src_r3_16x8b = src_r5_16x8b;
  730|   163k|            src_r4_16x8b = src_r6_16x8b;
  731|       |
  732|   163k|            ht -= 2;
  733|   163k|            pu1_src += src_strd << 1;
  734|   163k|            pu1_dst += dst_strd << 1;
  735|   163k|        }
  736|   163k|        while(ht > 0);
  ------------------
  |  Branch (736:15): [True: 140k, False: 22.5k]
  ------------------
  737|  22.5k|    }
  738|  39.6k|}
ih264_inter_pred_luma_horz_hpel_vert_hpel_ssse3:
  775|  30.8k|{
  776|  30.8k|    UNUSED(dydx);
  ------------------
  |  |   45|  30.8k|#define UNUSED(x) ((void)(x))
  ------------------
  777|       |
  778|  30.8k|    if(wd == 4)
  ------------------
  |  Branch (778:8): [True: 10.0k, False: 20.8k]
  ------------------
  779|  10.0k|    {
  780|  10.0k|        WORD16 *pi2_temp;
  781|       |
  782|  10.0k|        pu1_tmp += 4;
  783|  10.0k|        pu1_src -= src_strd << 1;
  784|  10.0k|        pi2_temp = (WORD16 *)pu1_tmp;
  785|  10.0k|        pu1_src -= 2; // the filter input starts from x[-2] (till x[3])
  786|       |
  787|       |        // Horizontal 6-tap filtering
  788|  10.0k|        {
  789|  10.0k|            WORD32 ht_tmp = ht + 4;
  790|       |
  791|  10.0k|            __m128i src_r0_16x8b, src_r1_16x8b;
  792|  10.0k|            __m128i src_r0_sht_16x8b, src_r1_sht_16x8b;
  793|  10.0k|            __m128i src_r0r1_t1_16x8b;
  794|  10.0k|            __m128i res_r0r1_t1_8x16b, res_r0r1_t2_8x16b, res_r0r1_t3_8x16b;
  795|  10.0k|            __m128i coeff0_1_16x8b, coeff2_3_16x8b, coeff4_5_16x8b;
  796|       |
  797|  10.0k|            coeff0_1_16x8b = _mm_set1_epi32(0xFB01FB01);  //c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1
  798|  10.0k|            coeff2_3_16x8b = _mm_set1_epi32(0x14141414);  //c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3
  799|  10.0k|            coeff4_5_16x8b = _mm_set1_epi32(0x01FB01FB);  //c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5
  800|       |                                                          //c0 = c5 = 1, c1 = c4 = -5, c2 = c3 = 20
  801|       |            //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
  802|       |            //Row1 : b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
  803|       |
  804|  10.0k|            do
  805|  59.1k|            {
  806|  59.1k|                src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);                       //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
  807|  59.1k|                src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));          //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9....b15
  808|       |
  809|  59.1k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                       //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
  810|  59.1k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                       //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
  811|       |
  812|  59.1k|                src_r0_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);         //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
  813|  59.1k|                src_r1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);         //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
  814|       |
  815|  59.1k|                src_r0r1_t1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);       //a0 a1 a1 a2 a2 a3 a3 a4 b0 b1 b1 b2 b2 b3 b3 b4
  816|  59.1k|                res_r0r1_t1_8x16b = _mm_maddubs_epi16(src_r0r1_t1_16x8b, coeff0_1_16x8b); //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
  817|       |                                                                                          //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
  818|       |
  819|  59.1k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 4);                           //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8  0  0  0  0
  820|  59.1k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 4);                           //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8  0  0  0  0
  821|       |
  822|  59.1k|                src_r0r1_t1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);       //a2 a3 a3 a4 a4 a5 a5 a6 b2 b3 b3 b4 b4 b5 b5 b6
  823|  59.1k|                res_r0r1_t2_8x16b = _mm_maddubs_epi16(src_r0r1_t1_16x8b, coeff2_3_16x8b); //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
  824|       |                                                                                          //b2*c2+b3*c3 b3*c2+b4*c3 b4*c2+b5*c3 b5*c2+b6*c3
  825|       |
  826|  59.1k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 4);                           //a4 a5 a5 a6 a6 a7 a7 a8  0  0  0  0  0  0  0  0
  827|  59.1k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 4);                           //b4 b5 b5 b6 b6 b7 b7 b8  0  0  0  0  0  0  0  0
  828|       |
  829|  59.1k|                src_r0r1_t1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);       //a4 a5 a5 a6 a6 a7 a7 a8 b4 b5 b5 b6 b6 b7 b7 b8
  830|  59.1k|                res_r0r1_t3_8x16b = _mm_maddubs_epi16(src_r0r1_t1_16x8b, coeff4_5_16x8b); //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
  831|       |                                                                                          //b4*c4+b5*c5 b5*c4+b6*c5 b4*c6+b7*c5 b7*c4+b8*c5
  832|  59.1k|                res_r0r1_t1_8x16b = _mm_add_epi16(res_r0r1_t1_8x16b, res_r0r1_t2_8x16b);
  833|  59.1k|                res_r0r1_t1_8x16b = _mm_add_epi16(res_r0r1_t3_8x16b, res_r0r1_t1_8x16b);
  834|       |
  835|  59.1k|                _mm_storeu_si128((__m128i *)pi2_temp, res_r0r1_t1_8x16b);
  836|       |
  837|  59.1k|                ht_tmp -= 2;
  838|  59.1k|                pu1_src += src_strd << 1;
  839|  59.1k|                pi2_temp += 8;
  840|  59.1k|            }
  841|  59.1k|            while(ht_tmp > 0);
  ------------------
  |  Branch (841:19): [True: 49.1k, False: 10.0k]
  ------------------
  842|       |
  843|  10.0k|            src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);                           //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
  844|  10.0k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                           //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
  845|       |
  846|  10.0k|            src_r0_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);             //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
  847|  10.0k|            res_r0r1_t1_8x16b = _mm_maddubs_epi16(src_r0_16x8b, coeff0_1_16x8b);          //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
  848|       |
  849|  10.0k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b,4);                                //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8  0  0  0  0
  850|  10.0k|            res_r0r1_t2_8x16b = _mm_maddubs_epi16(src_r0_16x8b, coeff2_3_16x8b);          //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
  851|       |
  852|  10.0k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b,4);                                //a4 a5 a5 a6 a6 a7 a7 a8  0  0  0  0  0  0  0  0
  853|  10.0k|            res_r0r1_t3_8x16b = _mm_maddubs_epi16(src_r0_16x8b, coeff4_5_16x8b);          //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
  854|       |
  855|  10.0k|            res_r0r1_t1_8x16b = _mm_add_epi16(res_r0r1_t1_8x16b, res_r0r1_t2_8x16b);
  856|  10.0k|            res_r0r1_t1_8x16b = _mm_add_epi16(res_r0r1_t3_8x16b, res_r0r1_t1_8x16b);
  857|       |
  858|  10.0k|            _mm_storel_epi64((__m128i *)pi2_temp, res_r0r1_t1_8x16b);
  859|  10.0k|        }
  860|       |
  861|  10.0k|        pi2_temp = (WORD16 *)pu1_tmp;
  862|       |
  863|       |        // Vertical 6-tap filtering
  864|  10.0k|        {
  865|  10.0k|            __m128i src_r0_8x16b, src_r1_8x16b, src_r2_8x16b, src_r3_8x16b,
  866|  10.0k|                            src_r4_8x16b;
  867|  10.0k|            __m128i src_r5_8x16b, src_r6_8x16b;
  868|  10.0k|            __m128i src_t1_8x16b, src_t2_8x16b;
  869|       |
  870|  10.0k|            __m128i res_t0_4x32b, res_t1_4x32b, res_t2_4x32b, res_t3_4x32b;
  871|  10.0k|            __m128i res_8x16b, res_16x8b;
  872|       |
  873|  10.0k|            __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b;
  874|  10.0k|            __m128i const_val512_4x32b;
  875|       |
  876|  10.0k|            coeff0_1_8x16b = _mm_set1_epi32(0xFFFB0001);
  877|  10.0k|            coeff2_3_8x16b = _mm_set1_epi32(0x00140014);
  878|  10.0k|            coeff4_5_8x16b = _mm_set1_epi32(0x0001FFFB);
  879|       |
  880|  10.0k|            const_val512_4x32b = _mm_set1_epi32(512);
  881|       |
  882|  10.0k|            src_r0_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp));
  883|  10.0k|            src_r1_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp + 4));
  884|  10.0k|            src_r2_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp + 8));
  885|  10.0k|            src_r3_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp + 12));
  886|  10.0k|            src_r4_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp + 16));
  887|  10.0k|            pi2_temp += 20;
  888|       |
  889|  10.0k|            do
  890|  39.0k|            {
  891|  39.0k|                src_r5_8x16b = _mm_loadl_epi64((__m128i *)pi2_temp);
  892|  39.0k|                src_r6_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp + 4));
  893|       |
  894|  39.0k|                src_r0_8x16b = _mm_unpacklo_epi16(src_r0_8x16b, src_r1_8x16b);
  895|  39.0k|                src_t1_8x16b = _mm_unpacklo_epi16(src_r2_8x16b, src_r3_8x16b);
  896|  39.0k|                src_t2_8x16b = _mm_unpacklo_epi16(src_r4_8x16b, src_r5_8x16b);
  897|       |
  898|  39.0k|                res_t1_4x32b = _mm_madd_epi16(src_r0_8x16b, coeff0_1_8x16b);
  899|  39.0k|                res_t2_4x32b = _mm_madd_epi16(src_t1_8x16b, coeff2_3_8x16b);
  900|  39.0k|                res_t3_4x32b = _mm_madd_epi16(src_t2_8x16b, coeff4_5_8x16b);
  901|       |
  902|  39.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
  903|  39.0k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
  904|  39.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
  905|       |
  906|  39.0k|                res_t0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
  907|       |
  908|  39.0k|                src_r1_8x16b = _mm_unpacklo_epi16(src_r1_8x16b, src_r2_8x16b);
  909|  39.0k|                src_t1_8x16b = _mm_unpacklo_epi16(src_r3_8x16b, src_r4_8x16b);
  910|  39.0k|                src_t2_8x16b = _mm_unpacklo_epi16(src_r5_8x16b, src_r6_8x16b);
  911|       |
  912|  39.0k|                res_t1_4x32b = _mm_madd_epi16(src_r1_8x16b, coeff0_1_8x16b);
  913|  39.0k|                res_t2_4x32b = _mm_madd_epi16(src_t1_8x16b, coeff2_3_8x16b);
  914|  39.0k|                res_t3_4x32b = _mm_madd_epi16(src_t2_8x16b, coeff4_5_8x16b);
  915|       |
  916|  39.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
  917|  39.0k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
  918|  39.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
  919|       |
  920|  39.0k|                res_t1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
  921|       |
  922|  39.0k|                res_8x16b = _mm_packs_epi32(res_t0_4x32b, res_t1_4x32b);
  923|  39.0k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
  924|       |
  925|  39.0k|                *((WORD32 *)(pu1_dst)) = _mm_cvtsi128_si32(res_16x8b);
  926|  39.0k|                res_16x8b = _mm_srli_si128(res_16x8b, 4);
  927|  39.0k|                *((WORD32 *)(pu1_dst + dst_strd)) = _mm_cvtsi128_si32(res_16x8b);
  928|       |
  929|  39.0k|                src_r0_8x16b = src_r2_8x16b;
  930|  39.0k|                src_r1_8x16b = src_r3_8x16b;
  931|  39.0k|                src_r2_8x16b = src_r4_8x16b;
  932|  39.0k|                src_r3_8x16b = src_r5_8x16b;
  933|  39.0k|                src_r4_8x16b = src_r6_8x16b;
  934|       |
  935|  39.0k|                ht -= 2;
  936|  39.0k|                pi2_temp += 8;
  937|  39.0k|                pu1_dst += dst_strd << 1;
  938|  39.0k|            }
  939|  39.0k|            while(ht > 0);
  ------------------
  |  Branch (939:19): [True: 29.0k, False: 10.0k]
  ------------------
  940|  10.0k|        }
  941|  10.0k|    }
  942|  20.8k|    else if(wd == 8)
  ------------------
  |  Branch (942:13): [True: 9.26k, False: 11.5k]
  ------------------
  943|  9.26k|    {
  944|  9.26k|        WORD16 *pi2_temp;
  945|       |
  946|  9.26k|        pu1_tmp += 4;
  947|  9.26k|        pu1_src -= src_strd << 1;
  948|  9.26k|        pi2_temp = (WORD16 *)pu1_tmp;
  949|  9.26k|        pu1_src -= 2; // the filter input starts from x[-2] (till x[3])
  950|       |
  951|       |        // Horizontal 6-tap filtering
  952|  9.26k|        {
  953|  9.26k|            WORD32 ht_tmp = ht + 4;
  954|       |
  955|  9.26k|            __m128i src_r0_16x8b, src_r1_16x8b;
  956|  9.26k|            __m128i src_r0_sht_16x8b, src_r1_sht_16x8b;
  957|  9.26k|            __m128i src_r0_t1_16x8b, src_r1_t1_16x8b;
  958|  9.26k|            __m128i res_r0_t1_8x16b, res_r0_t2_8x16b, res_r0_t3_8x16b;
  959|  9.26k|            __m128i res_r1_t1_8x16b, res_r1_t2_8x16b, res_r1_t3_8x16b;
  960|  9.26k|            __m128i coeff0_1_16x8b, coeff2_3_16x8b, coeff4_5_16x8b;
  961|       |
  962|  9.26k|            coeff0_1_16x8b = _mm_set1_epi32(0xFB01FB01);  //c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1
  963|  9.26k|            coeff2_3_16x8b = _mm_set1_epi32(0x14141414);  //c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3
  964|  9.26k|            coeff4_5_16x8b = _mm_set1_epi32(0x01FB01FB);  //c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5
  965|       |                                                          //c0 = c5 = 1, c1 = c4 = -5, c2 = c3 = 20
  966|       |            //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
  967|       |            //Row1 : b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
  968|       |
  969|  9.26k|            do
  970|  62.4k|            {
  971|  62.4k|                src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);                      //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15
  972|  62.4k|                src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));         //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15
  973|       |
  974|  62.4k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                      //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
  975|  62.4k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                      //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
  976|       |
  977|  62.4k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
  978|  62.4k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
  979|       |
  980|  62.4k|                res_r0_t1_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff0_1_16x8b);    //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
  981|       |                                                                                         //a4*c0+a5*c1 a5*c0+a6*c1 a6*c0+a7*c1 a7*c0+a8*c1
  982|  62.4k|                res_r1_t1_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff0_1_16x8b);    //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
  983|       |                                                                                         //b4*c0+b5*c1 b5*c0+b6*c1 b6*c0+b7*c1 b7*c0+b8*c1
  984|       |
  985|  62.4k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                          //a2 a3 a4 a5 a6 a7 a8 a9....a15 0 0
  986|  62.4k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                          //b2 b3 b4 b5 b6 b7 b8 b9....b15 0 0
  987|       |
  988|  62.4k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                  //a3 a4 a5 a6 a7 a8 a9....a15 0  0  0
  989|  62.4k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                  //b3 b4 b5 b6 b7 b8 b9....b15 0  0  0
  990|       |
  991|  62.4k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10
  992|  62.4k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8 a8 a9 a9 a10
  993|       |
  994|  62.4k|                res_r0_t2_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff2_3_16x8b);    //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
  995|       |                                                                                         //a6*c2+a7*c3 a7*c2+a8*c3 a8*c2+a9*c3 a9*c2+a10*c3
  996|  62.4k|                res_r1_t2_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff2_3_16x8b);    //b2*c2+b3*c3 b3*c2+b4*c3 b2*c4+b5*c3 b5*c2+b6*c3
  997|       |                                                                                         //b6*c2+b7*c3 b7*c2+b8*c3 b8*c2+b9*c3 b9*c2+b10*c3
  998|       |
  999|  62.4k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                          //a4 a5 a6 a7 a8 a9....a15 0  0  0  0
 1000|  62.4k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                          //b4 b5 b6 b7 b8 b9....b15 0  0  0  0
 1001|       |
 1002|  62.4k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                  //a5 a6 a7 a8 a9....a15 0  0  0  0  0
 1003|  62.4k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                  //b5 b6 b7 b8 b9....b15 0  0  0  0  0
 1004|       |
 1005|  62.4k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10 a10 a11 a11 a12
 1006|  62.4k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b4 b5 b5 b6 b6 b7 b7 b8 b8 b9 b9 b10 b10 b11 b11 b12
 1007|       |
 1008|  62.4k|                res_r0_t3_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff4_5_16x8b);    //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
 1009|       |                                                                                         //a8*c4+a9*c5 a9*c4+a10*c5 a10*c4+a11*c5 a11*c4+a12*c5
 1010|  62.4k|                res_r1_t3_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff4_5_16x8b);    //b4*c4+b5*c5 b5*c4+b6*c5 b6*c4+b7*c5 b7*c4+b8*c5
 1011|       |                                                                                         //b8*c4+b9*c5 b9*c4+b10*c5 b10*c4+b11*c5 b11*c4+b12*c5
 1012|  62.4k|                res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t2_8x16b);
 1013|  62.4k|                res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t3_8x16b);
 1014|       |
 1015|  62.4k|                res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t2_8x16b);
 1016|  62.4k|                res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t3_8x16b);
 1017|       |
 1018|  62.4k|                _mm_storeu_si128((__m128i *)pi2_temp, res_r0_t1_8x16b);
 1019|  62.4k|                _mm_storeu_si128((__m128i *)(pi2_temp + 8), res_r1_t1_8x16b);
 1020|       |
 1021|  62.4k|                ht_tmp -= 2;
 1022|  62.4k|                pu1_src += src_strd << 1;
 1023|  62.4k|                pi2_temp += 16;
 1024|  62.4k|            }
 1025|  62.4k|            while(ht_tmp > 0);
  ------------------
  |  Branch (1025:19): [True: 53.1k, False: 9.26k]
  ------------------
 1026|       |
 1027|  9.26k|            src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);                          //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9 a10 a11 a12 a13 a14 a15
 1028|  9.26k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                          //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
 1029|       |
 1030|  9.26k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b,src_r0_sht_16x8b);          //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
 1031|  9.26k|            res_r0_t1_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b,coeff0_1_16x8b);         //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
 1032|       |                                                                                         //a4*c0+a5*c1 a5*c0+a6*c1 a6*c0+a7*c1 a7*c0+a8*c1
 1033|       |
 1034|  9.26k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                              //a2 a3 a4 a5 a6 a7 a8 a9....a15 0 0
 1035|  9.26k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                      //a3 a4 a5 a6 a7 a8 a9....a15 0  0  0
 1036|       |
 1037|  9.26k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);         //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10
 1038|  9.26k|            res_r0_t2_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff2_3_16x8b);        //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
 1039|       |                                                                                         //a6*c2+a7*c3 a7*c2+a8*c3 a8*c2+a9*c3 a9*c2+a10*c3
 1040|       |
 1041|  9.26k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                              //a4 a5 a6 a7 a8 a9....a15 0  0  0  0
 1042|  9.26k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                      //a5 a6 a7 a8 a9....a15 0  0  0  0  0
 1043|       |
 1044|  9.26k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);         //a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10 a10 a11 a11 a12
 1045|  9.26k|            res_r0_t3_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff4_5_16x8b);        //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
 1046|       |                                                                                         //a8*c4+a9*c5 a9*c4+a10*c5 a10*c4+a11*c5 a11*c4+a12*c5
 1047|  9.26k|            res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t2_8x16b);
 1048|  9.26k|            res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t3_8x16b);
 1049|       |
 1050|  9.26k|            _mm_storeu_si128((__m128i *)pi2_temp, res_r0_t1_8x16b);
 1051|  9.26k|        }
 1052|       |
 1053|  9.26k|        pi2_temp = (WORD16 *)pu1_tmp;
 1054|       |
 1055|       |        // Vertical 6-tap filtering
 1056|  9.26k|        {
 1057|  9.26k|            __m128i src_r0_8x16b, src_r1_8x16b, src_r2_8x16b, src_r3_8x16b,
 1058|  9.26k|                            src_r4_8x16b;
 1059|  9.26k|            __m128i src_r5_8x16b, src_r6_8x16b;
 1060|  9.26k|            __m128i src_r0r1_8x16b, src_r2r3_8x16b, src_r4r5_8x16b;
 1061|       |
 1062|  9.26k|            __m128i res_t1_4x32b, res_t2_4x32b, res_t3_4x32b;
 1063|  9.26k|            __m128i res_c0_4x32b, res_c1_4x32b;
 1064|  9.26k|            __m128i res_8x16b, res_16x8b;
 1065|       |
 1066|  9.26k|            __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b;
 1067|  9.26k|            __m128i const_val512_4x32b;
 1068|       |
 1069|  9.26k|            coeff0_1_8x16b = _mm_set1_epi32(0xFFFB0001);
 1070|  9.26k|            coeff2_3_8x16b = _mm_set1_epi32(0x00140014);
 1071|  9.26k|            coeff4_5_8x16b = _mm_set1_epi32(0x0001FFFB);
 1072|       |
 1073|  9.26k|            const_val512_4x32b = _mm_set1_epi32(512);
 1074|       |
 1075|  9.26k|            src_r0_8x16b = _mm_loadu_si128((__m128i *)pi2_temp);
 1076|  9.26k|            src_r1_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp + 8));
 1077|  9.26k|            src_r2_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp + 16));
 1078|  9.26k|            src_r3_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp + 24));
 1079|  9.26k|            src_r4_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp + 32));
 1080|  9.26k|            pi2_temp += 40;
 1081|       |
 1082|  9.26k|            do
 1083|  43.9k|            {
 1084|  43.9k|                src_r5_8x16b = _mm_loadu_si128((__m128i *)pi2_temp);
 1085|  43.9k|                src_r6_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp + 8));
 1086|       |
 1087|  43.9k|                src_r0r1_8x16b = _mm_unpacklo_epi16(src_r0_8x16b, src_r1_8x16b);
 1088|  43.9k|                src_r2r3_8x16b = _mm_unpacklo_epi16(src_r2_8x16b, src_r3_8x16b);
 1089|  43.9k|                src_r4r5_8x16b = _mm_unpacklo_epi16(src_r4_8x16b, src_r5_8x16b);
 1090|       |
 1091|  43.9k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 1092|  43.9k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 1093|  43.9k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 1094|       |
 1095|  43.9k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 1096|  43.9k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 1097|  43.9k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 1098|  43.9k|                res_c0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 1099|       |
 1100|  43.9k|                src_r0r1_8x16b = _mm_unpackhi_epi16(src_r0_8x16b, src_r1_8x16b);
 1101|  43.9k|                src_r2r3_8x16b = _mm_unpackhi_epi16(src_r2_8x16b, src_r3_8x16b);
 1102|  43.9k|                src_r4r5_8x16b = _mm_unpackhi_epi16(src_r4_8x16b, src_r5_8x16b);
 1103|       |
 1104|  43.9k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 1105|  43.9k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 1106|  43.9k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 1107|       |
 1108|  43.9k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 1109|  43.9k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 1110|  43.9k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 1111|  43.9k|                res_c1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 1112|       |
 1113|  43.9k|                res_8x16b = _mm_packs_epi32(res_c0_4x32b, res_c1_4x32b);
 1114|  43.9k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 1115|       |
 1116|  43.9k|                _mm_storel_epi64((__m128i *)pu1_dst, res_16x8b);
 1117|       |
 1118|  43.9k|                src_r0r1_8x16b = _mm_unpacklo_epi16(src_r1_8x16b, src_r2_8x16b);
 1119|  43.9k|                src_r2r3_8x16b = _mm_unpacklo_epi16(src_r3_8x16b, src_r4_8x16b);
 1120|  43.9k|                src_r4r5_8x16b = _mm_unpacklo_epi16(src_r5_8x16b, src_r6_8x16b);
 1121|       |
 1122|  43.9k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 1123|  43.9k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 1124|  43.9k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 1125|       |
 1126|  43.9k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 1127|  43.9k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 1128|  43.9k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 1129|  43.9k|                res_c0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 1130|       |
 1131|  43.9k|                src_r0r1_8x16b = _mm_unpackhi_epi16(src_r1_8x16b, src_r2_8x16b);
 1132|  43.9k|                src_r2r3_8x16b = _mm_unpackhi_epi16(src_r3_8x16b, src_r4_8x16b);
 1133|  43.9k|                src_r4r5_8x16b = _mm_unpackhi_epi16(src_r5_8x16b, src_r6_8x16b);
 1134|       |
 1135|  43.9k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 1136|  43.9k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 1137|  43.9k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 1138|       |
 1139|  43.9k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 1140|  43.9k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 1141|  43.9k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 1142|  43.9k|                res_c1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 1143|       |
 1144|  43.9k|                res_8x16b = _mm_packs_epi32(res_c0_4x32b, res_c1_4x32b);
 1145|  43.9k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 1146|       |
 1147|  43.9k|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), res_16x8b);
 1148|       |
 1149|  43.9k|                src_r0_8x16b = src_r2_8x16b;
 1150|  43.9k|                src_r1_8x16b = src_r3_8x16b;
 1151|  43.9k|                src_r2_8x16b = src_r4_8x16b;
 1152|  43.9k|                src_r3_8x16b = src_r5_8x16b;
 1153|  43.9k|                src_r4_8x16b = src_r6_8x16b;
 1154|       |
 1155|  43.9k|                ht -= 2;
 1156|  43.9k|                pi2_temp += 16;
 1157|  43.9k|                pu1_dst += dst_strd << 1;
 1158|  43.9k|            }
 1159|  43.9k|            while(ht > 0);
  ------------------
  |  Branch (1159:19): [True: 34.6k, False: 9.26k]
  ------------------
 1160|  9.26k|        }
 1161|  9.26k|    }
 1162|  11.5k|    else // wd == 16
 1163|  11.5k|    {
 1164|  11.5k|        WORD16 *pi2_temp;
 1165|  11.5k|        WORD32 ht_tmp;
 1166|       |
 1167|  11.5k|        pu1_tmp += 4;
 1168|  11.5k|        pu1_src -= src_strd << 1;
 1169|  11.5k|        pi2_temp = (WORD16 *)pu1_tmp;
 1170|  11.5k|        pu1_src -= 2; // the filter input starts from x[-2] (till x[3])
 1171|       |
 1172|       |        // Horizontal 6-tap filtering
 1173|  11.5k|        {
 1174|  11.5k|            __m128i src_r0_16x8b, src_r1_16x8b, src_r0_sht_16x8b, src_r1_sht_16x8b;
 1175|  11.5k|            __m128i src_r0_t1_16x8b, src_r1_t1_16x8b;
 1176|       |
 1177|  11.5k|            __m128i res_r0_t1_8x16b, res_r0_t2_8x16b, res_r0_t3_8x16b;
 1178|  11.5k|            __m128i res_r1_t1_8x16b, res_r1_t2_8x16b, res_r1_t3_8x16b;
 1179|       |
 1180|  11.5k|            __m128i coeff0_1_16x8b, coeff2_3_16x8b, coeff4_5_16x8b;
 1181|       |
 1182|  11.5k|            ht_tmp = ht + 5;
 1183|       |
 1184|  11.5k|            coeff0_1_16x8b = _mm_set1_epi32(0xFB01FB01);  //c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1
 1185|  11.5k|            coeff2_3_16x8b = _mm_set1_epi32(0x14141414);  //c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3
 1186|  11.5k|            coeff4_5_16x8b = _mm_set1_epi32(0x01FB01FB);  //c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5
 1187|       |                                                          //c0 = c5 = 1, c1 = c4 = -5, c2 = c3 = 20
 1188|       |            //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
 1189|       |            //Row0 :                         b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
 1190|       |            //b0 is same a8. Similarly other bn pixels are same as a(n+8) pixels.
 1191|       |
 1192|  11.5k|            do
 1193|   215k|            {
 1194|   215k|                src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);                      //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
 1195|   215k|                src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 8));                //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9....b15
 1196|       |
 1197|   215k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                      //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
 1198|   215k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                      //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
 1199|       |
 1200|   215k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
 1201|   215k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
 1202|       |
 1203|   215k|                res_r0_t1_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff0_1_16x8b);    //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
 1204|       |                                                                                         //a4*c0+a5*c1 a5*c0+a6*c1 a6*c0+a7*c1 a7*c0+a8*c1
 1205|   215k|                res_r1_t1_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff0_1_16x8b);    //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
 1206|       |                                                                                         //b4*c0+b5*c1 b5*c0+b6*c1 b6*c0+b7*c1 b7*c0+b8*c1
 1207|       |
 1208|   215k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                          //a2 a3 a4 a5 a6 a7 a8 a9....a15 0 0
 1209|   215k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                          //b2 b3 b4 b5 b6 b7 b8 b9....b15 0 0
 1210|       |
 1211|   215k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                  //a3 a4 a5 a6 a7 a8 a9....a15 0  0  0
 1212|   215k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                  //b3 b4 b5 b6 b7 b8 b9....b15 0  0  0
 1213|       |
 1214|   215k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10
 1215|   215k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8 a8 a9 a9 a10
 1216|       |
 1217|   215k|                res_r0_t2_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff2_3_16x8b);    //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
 1218|       |                                                                                         //a6*c2+a7*c3 a7*c2+a8*c3 a8*c2+a9*c3 a9*c2+a10*c3
 1219|   215k|                res_r1_t2_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff2_3_16x8b);    //b2*c2+b3*c3 b3*c2+b4*c3 b2*c4+b5*c3 b5*c2+b6*c3
 1220|       |                                                                                         //b6*c2+b7*c3 b7*c2+b8*c3 b8*c2+b9*c3 b9*c2+b10*c3
 1221|       |
 1222|   215k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                          //a4 a5 a6 a7 a8 a9....a15 0  0  0  0
 1223|   215k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                          //b4 b5 b6 b7 b8 b9....b15 0  0  0  0
 1224|       |
 1225|   215k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                  //a5 a6 a7 a8 a9....a15 0  0  0  0  0
 1226|   215k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                  //b5 b6 b7 b8 b9....b15 0  0  0  0  0
 1227|       |
 1228|   215k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10 a10 a11 a11 a12
 1229|   215k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b4 b5 b5 b6 b6 b7 b7 b8 b8 b9 b9 b10 b10 b11 b11 b12
 1230|       |
 1231|   215k|                res_r0_t3_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff4_5_16x8b);    //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
 1232|       |                                                                                         //a8*c4+a9*c5 a9*c4+a10*c5 a10*c4+a11*c5 a11*c4+a12*c5
 1233|   215k|                res_r1_t3_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff4_5_16x8b);    //b4*c4+b5*c5 b5*c4+b6*c5 b6*c4+b7*c5 b7*c4+b8*c5
 1234|       |                                                                                         //b8*c4+b9*c5 b9*c4+b10*c5 b10*c4+b11*c5 b11*c4+b12*c5
 1235|   215k|                res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t2_8x16b);
 1236|   215k|                res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t3_8x16b);
 1237|       |
 1238|   215k|                res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t2_8x16b);
 1239|   215k|                res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t3_8x16b);
 1240|       |
 1241|   215k|                _mm_storeu_si128((__m128i *)pi2_temp, res_r0_t1_8x16b);
 1242|   215k|                _mm_storeu_si128((__m128i *)(pi2_temp + 8), res_r1_t1_8x16b);
 1243|       |
 1244|   215k|                ht_tmp--;
 1245|   215k|                pu1_src += src_strd;
 1246|   215k|                pi2_temp += 16;
 1247|   215k|            }
 1248|   215k|            while(ht_tmp > 0);
  ------------------
  |  Branch (1248:19): [True: 204k, False: 11.5k]
  ------------------
 1249|  11.5k|        }
 1250|       |
 1251|  11.5k|        pi2_temp = (WORD16 *)pu1_tmp;
 1252|       |
 1253|       |        // Vertical 6-tap filtering
 1254|  11.5k|        {
 1255|  11.5k|            WORD16 *pi2_temp2;
 1256|  11.5k|            UWORD8 *pu1_dst2;
 1257|  11.5k|            WORD32 ht_tmp;
 1258|       |
 1259|  11.5k|            __m128i src_r0_8x16b, src_r1_8x16b, src_r2_8x16b, src_r3_8x16b, src_r4_8x16b;
 1260|  11.5k|            __m128i src_r5_8x16b, src_r6_8x16b;
 1261|  11.5k|            __m128i src_r0r1_8x16b, src_r2r3_8x16b, src_r4r5_8x16b;
 1262|       |
 1263|  11.5k|            __m128i res_t1_4x32b, res_t2_4x32b, res_t3_4x32b;
 1264|  11.5k|            __m128i res_c0_4x32b, res_c1_4x32b;
 1265|  11.5k|            __m128i res_8x16b, res_16x8b;
 1266|       |
 1267|  11.5k|            __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b;
 1268|  11.5k|            __m128i const_val512_4x32b;
 1269|       |
 1270|  11.5k|            coeff0_1_8x16b = _mm_set1_epi32(0xFFFB0001);
 1271|  11.5k|            coeff2_3_8x16b = _mm_set1_epi32(0x00140014);
 1272|  11.5k|            coeff4_5_8x16b = _mm_set1_epi32(0x0001FFFB);
 1273|       |
 1274|  11.5k|            const_val512_4x32b = _mm_set1_epi32(512);
 1275|       |
 1276|  11.5k|            pi2_temp2 = pi2_temp + 8;
 1277|  11.5k|            pu1_dst2 = pu1_dst + 8;
 1278|  11.5k|            ht_tmp = ht;
 1279|       |
 1280|       |            /**********************************************************/
 1281|       |            /*     Do first height x 8 block                          */
 1282|       |            /**********************************************************/
 1283|  11.5k|            src_r0_8x16b = _mm_loadu_si128((__m128i *)pi2_temp);
 1284|  11.5k|            src_r1_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp + 16));
 1285|  11.5k|            src_r2_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp + 32));
 1286|  11.5k|            src_r3_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp + 48));
 1287|  11.5k|            src_r4_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp + 64));
 1288|  11.5k|            pi2_temp += 80;
 1289|       |
 1290|  11.5k|            do
 1291|  79.0k|            {
 1292|  79.0k|                src_r5_8x16b = _mm_loadu_si128((__m128i *)pi2_temp);
 1293|  79.0k|                src_r6_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp + 16));
 1294|       |
 1295|  79.0k|                src_r0r1_8x16b = _mm_unpacklo_epi16(src_r0_8x16b, src_r1_8x16b);
 1296|  79.0k|                src_r2r3_8x16b = _mm_unpacklo_epi16(src_r2_8x16b, src_r3_8x16b);
 1297|  79.0k|                src_r4r5_8x16b = _mm_unpacklo_epi16(src_r4_8x16b, src_r5_8x16b);
 1298|       |
 1299|  79.0k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 1300|  79.0k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 1301|  79.0k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 1302|       |
 1303|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 1304|  79.0k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 1305|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 1306|  79.0k|                res_c0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 1307|       |
 1308|  79.0k|                src_r0r1_8x16b = _mm_unpackhi_epi16(src_r0_8x16b, src_r1_8x16b);
 1309|  79.0k|                src_r2r3_8x16b = _mm_unpackhi_epi16(src_r2_8x16b, src_r3_8x16b);
 1310|  79.0k|                src_r4r5_8x16b = _mm_unpackhi_epi16(src_r4_8x16b, src_r5_8x16b);
 1311|       |
 1312|  79.0k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 1313|  79.0k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 1314|  79.0k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 1315|       |
 1316|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 1317|  79.0k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 1318|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 1319|  79.0k|                res_c1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 1320|       |
 1321|  79.0k|                res_8x16b = _mm_packs_epi32(res_c0_4x32b, res_c1_4x32b);
 1322|  79.0k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 1323|       |
 1324|  79.0k|                _mm_storel_epi64((__m128i *)pu1_dst, res_16x8b);
 1325|       |
 1326|  79.0k|                src_r0r1_8x16b = _mm_unpacklo_epi16(src_r1_8x16b, src_r2_8x16b);
 1327|  79.0k|                src_r2r3_8x16b = _mm_unpacklo_epi16(src_r3_8x16b, src_r4_8x16b);
 1328|  79.0k|                src_r4r5_8x16b = _mm_unpacklo_epi16(src_r5_8x16b, src_r6_8x16b);
 1329|       |
 1330|  79.0k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 1331|  79.0k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 1332|  79.0k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 1333|       |
 1334|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 1335|  79.0k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 1336|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 1337|  79.0k|                res_c0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 1338|       |
 1339|  79.0k|                src_r0r1_8x16b = _mm_unpackhi_epi16(src_r1_8x16b, src_r2_8x16b);
 1340|  79.0k|                src_r2r3_8x16b = _mm_unpackhi_epi16(src_r3_8x16b, src_r4_8x16b);
 1341|  79.0k|                src_r4r5_8x16b = _mm_unpackhi_epi16(src_r5_8x16b, src_r6_8x16b);
 1342|       |
 1343|  79.0k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 1344|  79.0k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 1345|  79.0k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 1346|       |
 1347|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 1348|  79.0k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 1349|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 1350|  79.0k|                res_c1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 1351|       |
 1352|  79.0k|                res_8x16b = _mm_packs_epi32(res_c0_4x32b, res_c1_4x32b);
 1353|  79.0k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 1354|       |
 1355|  79.0k|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), res_16x8b);
 1356|       |
 1357|  79.0k|                src_r0_8x16b = src_r2_8x16b;
 1358|  79.0k|                src_r1_8x16b = src_r3_8x16b;
 1359|  79.0k|                src_r2_8x16b = src_r4_8x16b;
 1360|  79.0k|                src_r3_8x16b = src_r5_8x16b;
 1361|  79.0k|                src_r4_8x16b = src_r6_8x16b;
 1362|       |
 1363|  79.0k|                ht_tmp -= 2;
 1364|  79.0k|                pi2_temp += 32;
 1365|  79.0k|                pu1_dst += dst_strd << 1;
 1366|  79.0k|            }
 1367|  79.0k|            while(ht_tmp > 0);
  ------------------
  |  Branch (1367:19): [True: 67.5k, False: 11.5k]
  ------------------
 1368|       |
 1369|       |            /**********************************************************/
 1370|       |            /*     Do second ht x 8 block                          */
 1371|       |            /**********************************************************/
 1372|  11.5k|            src_r0_8x16b = _mm_loadu_si128((__m128i *)pi2_temp2);
 1373|  11.5k|            src_r1_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 16));
 1374|  11.5k|            src_r2_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 32));
 1375|  11.5k|            src_r3_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 48));
 1376|  11.5k|            src_r4_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 64));
 1377|  11.5k|            pi2_temp2 += 80;
 1378|       |
 1379|  11.5k|            do
 1380|  79.0k|            {
 1381|  79.0k|                src_r5_8x16b = _mm_loadu_si128((__m128i *)pi2_temp2);
 1382|  79.0k|                src_r6_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 16));
 1383|       |
 1384|  79.0k|                src_r0r1_8x16b = _mm_unpacklo_epi16(src_r0_8x16b, src_r1_8x16b);
 1385|  79.0k|                src_r2r3_8x16b = _mm_unpacklo_epi16(src_r2_8x16b, src_r3_8x16b);
 1386|  79.0k|                src_r4r5_8x16b = _mm_unpacklo_epi16(src_r4_8x16b, src_r5_8x16b);
 1387|       |
 1388|  79.0k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 1389|  79.0k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 1390|  79.0k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 1391|       |
 1392|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 1393|  79.0k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 1394|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 1395|  79.0k|                res_c0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 1396|       |
 1397|  79.0k|                src_r0r1_8x16b = _mm_unpackhi_epi16(src_r0_8x16b, src_r1_8x16b);
 1398|  79.0k|                src_r2r3_8x16b = _mm_unpackhi_epi16(src_r2_8x16b, src_r3_8x16b);
 1399|  79.0k|                src_r4r5_8x16b = _mm_unpackhi_epi16(src_r4_8x16b, src_r5_8x16b);
 1400|       |
 1401|  79.0k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 1402|  79.0k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 1403|  79.0k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 1404|       |
 1405|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 1406|  79.0k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 1407|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 1408|  79.0k|                res_c1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 1409|       |
 1410|  79.0k|                res_8x16b = _mm_packs_epi32(res_c0_4x32b, res_c1_4x32b);
 1411|  79.0k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 1412|       |
 1413|  79.0k|                _mm_storel_epi64((__m128i *)pu1_dst2, res_16x8b);
 1414|       |
 1415|  79.0k|                src_r0r1_8x16b = _mm_unpacklo_epi16(src_r1_8x16b, src_r2_8x16b);
 1416|  79.0k|                src_r2r3_8x16b = _mm_unpacklo_epi16(src_r3_8x16b, src_r4_8x16b);
 1417|  79.0k|                src_r4r5_8x16b = _mm_unpacklo_epi16(src_r5_8x16b, src_r6_8x16b);
 1418|       |
 1419|  79.0k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 1420|  79.0k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 1421|  79.0k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 1422|       |
 1423|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 1424|  79.0k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 1425|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 1426|  79.0k|                res_c0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 1427|       |
 1428|  79.0k|                src_r0r1_8x16b = _mm_unpackhi_epi16(src_r1_8x16b, src_r2_8x16b);
 1429|  79.0k|                src_r2r3_8x16b = _mm_unpackhi_epi16(src_r3_8x16b, src_r4_8x16b);
 1430|  79.0k|                src_r4r5_8x16b = _mm_unpackhi_epi16(src_r5_8x16b, src_r6_8x16b);
 1431|       |
 1432|  79.0k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 1433|  79.0k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 1434|  79.0k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 1435|       |
 1436|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 1437|  79.0k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 1438|  79.0k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 1439|  79.0k|                res_c1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 1440|       |
 1441|  79.0k|                res_8x16b = _mm_packs_epi32(res_c0_4x32b, res_c1_4x32b);
 1442|  79.0k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 1443|       |
 1444|  79.0k|                _mm_storel_epi64((__m128i *)(pu1_dst2 + dst_strd), res_16x8b);
 1445|       |
 1446|  79.0k|                src_r0_8x16b = src_r2_8x16b;
 1447|  79.0k|                src_r1_8x16b = src_r3_8x16b;
 1448|  79.0k|                src_r2_8x16b = src_r4_8x16b;
 1449|  79.0k|                src_r3_8x16b = src_r5_8x16b;
 1450|  79.0k|                src_r4_8x16b = src_r6_8x16b;
 1451|       |
 1452|  79.0k|                ht -= 2;
 1453|  79.0k|                pi2_temp2 += 32;
 1454|  79.0k|                pu1_dst2 += dst_strd << 1;
 1455|  79.0k|            }
 1456|  79.0k|            while(ht > 0);
  ------------------
  |  Branch (1456:19): [True: 67.5k, False: 11.5k]
  ------------------
 1457|  11.5k|        }
 1458|  11.5k|    }
 1459|  30.8k|}
ih264_inter_pred_luma_horz_qpel_ssse3:
 1499|   115k|{
 1500|   115k|    WORD32 x_offset;
 1501|   115k|    UWORD8 *pu1_pred1;
 1502|       |
 1503|   115k|    __m128i src_r0_16x8b, src_r1_16x8b;
 1504|   115k|    __m128i src_r0_sht_16x8b, src_r1_sht_16x8b;
 1505|   115k|    __m128i coeff0_1_16x8b, coeff2_3_16x8b, coeff4_5_16x8b;
 1506|   115k|    __m128i const_val16_8x16b;
 1507|       |
 1508|   115k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|   115k|#define UNUSED(x) ((void)(x))
  ------------------
 1509|       |
 1510|   115k|    x_offset = dydx & 3;
 1511|       |
 1512|   115k|    coeff0_1_16x8b = _mm_set1_epi32(0xFB01FB01); //c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1
 1513|   115k|    coeff2_3_16x8b = _mm_set1_epi32(0x14141414); //c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3
 1514|   115k|    coeff4_5_16x8b = _mm_set1_epi32(0x01FB01FB); //c4 c5 c4 c5 c4 c5 c4 c5 c4 c5 c4 c5 c4 c5 c4 c5
 1515|       |                                                 //c0 = c5 = 1, c1 = c4 = -5, c2 = c3 = 20
 1516|   115k|    pu1_pred1 = pu1_src + (x_offset >> 1);
 1517|       |
 1518|   115k|    const_val16_8x16b = _mm_set1_epi16(16);
 1519|       |
 1520|   115k|    pu1_src -= 2; // the filter input starts from x[-2] (till x[3])
 1521|       |
 1522|   115k|    if(wd == 4)
  ------------------
  |  Branch (1522:8): [True: 15.8k, False: 99.6k]
  ------------------
 1523|  15.8k|    {
 1524|  15.8k|        __m128i src_r0r1_16x8b;
 1525|       |
 1526|  15.8k|        __m128i res_r0r1_t1_8x16b, res_r0r1_t2_8x16b, res_r0r1_t3_8x16b;
 1527|  15.8k|        __m128i res_r0r1_16x8b;
 1528|       |
 1529|       |        //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
 1530|       |        //Row1 : b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
 1531|       |
 1532|  15.8k|        do
 1533|  49.4k|        {
 1534|  49.4k|            src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);                         //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
 1535|  49.4k|            src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));            //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9....b15
 1536|       |
 1537|  49.4k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                         //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
 1538|  49.4k|            src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                         //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
 1539|       |
 1540|  49.4k|            src_r0_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);           //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
 1541|  49.4k|            src_r1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);           //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
 1542|       |
 1543|  49.4k|            src_r0r1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);            //a0 a1 a1 a2 a2 a3 a3 a4 b0 b1 b1 b2 b2 b3 b3 b4
 1544|  49.4k|            res_r0r1_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);      //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
 1545|       |                                                                                        //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
 1546|       |
 1547|  49.4k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 4);                             //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8  0  0  0  0
 1548|  49.4k|            src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 4);                             //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8  0  0  0  0
 1549|       |
 1550|  49.4k|            src_r0r1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);            //a2 a3 a3 a4 a4 a5 a5 a6 b2 b3 b3 b4 b4 b5 b5 b6
 1551|  49.4k|            res_r0r1_t2_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff2_3_16x8b);      //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
 1552|       |                                                                                        //b2*c2+b3*c3 b3*c2+b4*c3 b4*c2+b5*c3 b5*c2+b6*c3
 1553|       |
 1554|  49.4k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 4);                             //a4 a5 a5 a6 a6 a7 a7 a8  0  0  0  0  0  0  0  0
 1555|  49.4k|            src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 4);                             //b4 b5 b5 b6 b6 b7 b7 b8  0  0  0  0  0  0  0  0
 1556|       |
 1557|  49.4k|            src_r0r1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);            //a4 a5 a5 a6 a6 a7 a7 a8 b4 b5 b5 b6 b6 b7 b7 b8
 1558|  49.4k|            res_r0r1_t3_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff4_5_16x8b);      //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
 1559|       |                                                                                        //b4*c4+b5*c5 b5*c4+b6*c5 b4*c6+b7*c5 b7*c4+b8*c5
 1560|  49.4k|            src_r0_16x8b = _mm_loadl_epi64((__m128i *)pu1_pred1);
 1561|  49.4k|            src_r1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred1 + src_strd));
 1562|       |
 1563|  49.4k|            res_r0r1_t1_8x16b = _mm_add_epi16(res_r0r1_t1_8x16b, res_r0r1_t2_8x16b);
 1564|  49.4k|            res_r0r1_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_r0r1_t3_8x16b);
 1565|  49.4k|            res_r0r1_t1_8x16b = _mm_add_epi16(res_r0r1_t1_8x16b, res_r0r1_t3_8x16b);    //a0*c0+a1*c1+a2*c2+a3*c3+a4*a4+a5*c5 + 16;
 1566|       |                                                                                        //a1*c0+a2*c1+a2*c2+a3*c3+a5*a4+a6*c5 + 16;
 1567|       |                                                                                        //a2*c0+a3*c1+a4*c2+a5*c3+a6*a4+a7*c5 + 16;
 1568|       |                                                                                        //a3*c0+a4*c1+a5*c2+a6*c3+a6*a4+a8*c5 + 16;
 1569|       |                                                                                        //b0*c0+b1*c1+b2*c2+b3*c3+b4*b4+b5*c5 + 16;
 1570|       |                                                                                        //b1*c0+b2*c1+b2*c2+b3*c3+b5*b4+b6*c5 + 16;
 1571|       |                                                                                        //b2*c0+b3*c1+b4*c2+b5*c3+b6*b4+b7*c5 + 16;
 1572|       |                                                                                        //b3*c0+b4*c1+b5*c2+b6*c3+b6*b4+b8*c5 + 16;
 1573|  49.4k|            src_r0r1_16x8b = _mm_unpacklo_epi32(src_r0_16x8b,src_r1_16x8b);
 1574|       |
 1575|  49.4k|            res_r0r1_t1_8x16b = _mm_srai_epi16(res_r0r1_t1_8x16b, 5);                   //shifting right by 5 bits.
 1576|       |
 1577|  49.4k|            res_r0r1_16x8b = _mm_packus_epi16(res_r0r1_t1_8x16b, res_r0r1_t1_8x16b);
 1578|  49.4k|            res_r0r1_16x8b = _mm_avg_epu8(src_r0r1_16x8b, res_r0r1_16x8b);              //computing q-pel
 1579|       |
 1580|  49.4k|            *((WORD32 *)(pu1_dst)) = _mm_cvtsi128_si32(res_r0r1_16x8b);
 1581|  49.4k|            res_r0r1_16x8b = _mm_srli_si128(res_r0r1_16x8b, 4);
 1582|  49.4k|            *((WORD32 *)(pu1_dst + dst_strd)) = _mm_cvtsi128_si32(res_r0r1_16x8b);
 1583|       |
 1584|  49.4k|            ht -= 2;
 1585|  49.4k|            pu1_src += src_strd << 1;
 1586|  49.4k|            pu1_pred1 += src_strd << 1;
 1587|  49.4k|            pu1_dst += dst_strd << 1;
 1588|  49.4k|        }
 1589|  49.4k|        while(ht > 0);
  ------------------
  |  Branch (1589:15): [True: 33.6k, False: 15.8k]
  ------------------
 1590|  15.8k|    }
 1591|  99.6k|    else if(wd == 8)
  ------------------
  |  Branch (1591:13): [True: 45.2k, False: 54.4k]
  ------------------
 1592|  45.2k|    {
 1593|  45.2k|        __m128i src_r0_t1_16x8b, src_r1_t1_16x8b;
 1594|       |
 1595|  45.2k|        __m128i res_r0_t1_8x16b, res_r0_t2_8x16b, res_r0_t3_8x16b;
 1596|  45.2k|        __m128i res_r1_t1_8x16b, res_r1_t2_8x16b, res_r1_t3_8x16b;
 1597|  45.2k|        __m128i res_r0_16x8b, res_r1_16x8b;
 1598|       |
 1599|       |        //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
 1600|       |        //Row1 : b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
 1601|       |
 1602|  45.2k|        do
 1603|   213k|        {
 1604|   213k|            src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);                      //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
 1605|   213k|            src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));         //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9....b15
 1606|       |
 1607|   213k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                      //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
 1608|   213k|            src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                      //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
 1609|       |
 1610|   213k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
 1611|   213k|            src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
 1612|       |
 1613|   213k|            res_r0_t1_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff0_1_16x8b);    //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
 1614|       |                                                                                     //a4*c0+a5*c1 a5*c0+a6*c1 a6*c0+a7*c1 a7*c0+a8*c1
 1615|   213k|            res_r1_t1_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff0_1_16x8b);    //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
 1616|       |                                                                                     //b4*c0+b5*c1 b5*c0+b6*c1 b6*c0+b7*c1 b7*c0+b8*c1
 1617|       |
 1618|   213k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                          //a2 a3 a4 a5 a6 a7 a8 a9....a15 0 0
 1619|   213k|            src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                          //b2 b3 b4 b5 b6 b7 b8 b9....b15 0 0
 1620|       |
 1621|   213k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                  //a3 a4 a5 a6 a7 a8 a9....a15 0  0  0
 1622|   213k|            src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                  //b3 b4 b5 b6 b7 b8 b9....b15 0  0  0
 1623|       |
 1624|   213k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10
 1625|   213k|            src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8 a8 a9 a9 a10
 1626|       |
 1627|   213k|            res_r0_t2_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff2_3_16x8b);    //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
 1628|       |                                                                                     //a6*c2+a7*c3 a7*c2+a8*c3 a8*c2+a9*c3 a9*c2+a10*c3
 1629|   213k|            res_r1_t2_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff2_3_16x8b);    //b2*c2+b3*c3 b3*c2+b4*c3 b2*c4+b5*c3 b5*c2+b6*c3
 1630|       |                                                                                     //b6*c2+b7*c3 b7*c2+b8*c3 b8*c2+b9*c3 b9*c2+b10*c3
 1631|       |
 1632|   213k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                          //a4 a5 a6 a7 a8 a9....a15 0  0  0  0
 1633|   213k|            src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                          //b4 b5 b6 b7 b8 b9....b15 0  0  0  0
 1634|       |
 1635|   213k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                  //a5 a6 a7 a8 a9....a15 0  0  0  0  0
 1636|   213k|            src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                  //b5 b6 b7 b8 b9....b15 0  0  0  0  0
 1637|       |
 1638|   213k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10 a10 a11 a11 a12
 1639|   213k|            src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b4 b5 b5 b6 b6 b7 b7 b8 b8 b9 b9 b10 b10 b11 b11 b12
 1640|       |
 1641|   213k|            res_r0_t3_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff4_5_16x8b);    //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
 1642|       |                                                                                     //a8*c4+a9*c5 a9*c4+a10*c5 a10*c4+a11*c5 a11*c4+a12*c5
 1643|   213k|            res_r1_t3_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff4_5_16x8b);    //b4*c4+b5*c5 b5*c4+b6*c5 b6*c4+b7*c5 b7*c4+b8*c5
 1644|       |                                                                                     //b8*c4+b9*c5 b9*c4+b10*c5 b10*c4+b11*c5 b11*c4+b12*c5
 1645|   213k|            src_r0_16x8b = _mm_loadl_epi64((__m128i *)pu1_pred1);
 1646|   213k|            src_r1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred1 + src_strd));
 1647|       |
 1648|   213k|            res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t2_8x16b);
 1649|   213k|            res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t2_8x16b);
 1650|   213k|            res_r0_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_r0_t3_8x16b);
 1651|   213k|            res_r1_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_r1_t3_8x16b);
 1652|   213k|            res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t3_8x16b);
 1653|   213k|            res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t3_8x16b);
 1654|       |
 1655|   213k|            res_r0_t1_8x16b = _mm_srai_epi16(res_r0_t1_8x16b, 5);
 1656|   213k|            res_r1_t1_8x16b = _mm_srai_epi16(res_r1_t1_8x16b, 5);                    //shifting right by 5 bits.
 1657|       |
 1658|   213k|            res_r0_16x8b = _mm_packus_epi16(res_r0_t1_8x16b, res_r0_t1_8x16b);
 1659|   213k|            res_r1_16x8b = _mm_packus_epi16(res_r1_t1_8x16b, res_r1_t1_8x16b);
 1660|       |
 1661|   213k|            res_r0_16x8b = _mm_avg_epu8(src_r0_16x8b, res_r0_16x8b);
 1662|   213k|            res_r1_16x8b = _mm_avg_epu8(src_r1_16x8b, res_r1_16x8b);                 //computing q-pel
 1663|       |
 1664|   213k|            _mm_storel_epi64((__m128i *)pu1_dst, res_r0_16x8b);
 1665|   213k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), res_r1_16x8b);
 1666|       |
 1667|   213k|            ht -= 2;
 1668|   213k|            pu1_src += src_strd << 1;
 1669|   213k|            pu1_pred1 += src_strd << 1;
 1670|   213k|            pu1_dst += dst_strd << 1;
 1671|   213k|        }
 1672|   213k|        while(ht > 0);
  ------------------
  |  Branch (1672:15): [True: 168k, False: 45.2k]
  ------------------
 1673|  45.2k|    }
 1674|  54.4k|    else // wd == 16
 1675|  54.4k|    {
 1676|  54.4k|        __m128i src_r0_t1_16x8b, src_r1_t1_16x8b;
 1677|       |
 1678|  54.4k|        __m128i res_r0_t1_8x16b, res_r0_t2_8x16b, res_r0_t3_8x16b;
 1679|  54.4k|        __m128i res_r1_t1_8x16b, res_r1_t2_8x16b, res_r1_t3_8x16b;
 1680|  54.4k|        __m128i res_16x8b;
 1681|       |
 1682|       |        //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
 1683|       |        //Row0 :                         b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
 1684|       |        //b0 is same a8. Similarly other bn pixels are same as a(n+8) pixels.
 1685|       |
 1686|  54.4k|        do
 1687|   749k|        {
 1688|   749k|            src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);                      //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
 1689|   749k|            src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 8));                //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9....b15
 1690|       |
 1691|   749k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                      //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
 1692|   749k|            src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                      //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
 1693|       |
 1694|   749k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
 1695|   749k|            src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
 1696|       |
 1697|   749k|            res_r0_t1_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff0_1_16x8b);    //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
 1698|       |                                                                                     //a4*c0+a5*c1 a5*c0+a6*c1 a6*c0+a7*c1 a7*c0+a8*c1
 1699|   749k|            res_r1_t1_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff0_1_16x8b);    //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
 1700|       |                                                                                     //b4*c0+b5*c1 b5*c0+b6*c1 b6*c0+b7*c1 b7*c0+b8*c1
 1701|       |
 1702|   749k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                          //a2 a3 a4 a5 a6 a7 a8 a9....a15 0 0
 1703|   749k|            src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                          //b2 b3 b4 b5 b6 b7 b8 b9....b15 0 0
 1704|       |
 1705|   749k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                  //a3 a4 a5 a6 a7 a8 a9....a15 0  0  0
 1706|   749k|            src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                  //b3 b4 b5 b6 b7 b8 b9....b15 0  0  0
 1707|       |
 1708|   749k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10
 1709|   749k|            src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8 a8 a9 a9 a10
 1710|       |
 1711|   749k|            res_r0_t2_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff2_3_16x8b);    //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
 1712|       |                                                                                     //a6*c2+a7*c3 a7*c2+a8*c3 a8*c2+a9*c3 a9*c2+a10*c3
 1713|   749k|            res_r1_t2_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff2_3_16x8b);    //b2*c2+b3*c3 b3*c2+b4*c3 b2*c4+b5*c3 b5*c2+b6*c3
 1714|       |                                                                                     //b6*c2+b7*c3 b7*c2+b8*c3 b8*c2+b9*c3 b9*c2+b10*c3
 1715|       |
 1716|   749k|            src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                          //a4 a5 a6 a7 a8 a9....a15 0  0  0  0
 1717|   749k|            src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                          //b4 b5 b6 b7 b8 b9....b15 0  0  0  0
 1718|       |
 1719|   749k|            src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                  //a5 a6 a7 a8 a9....a15 0  0  0  0  0
 1720|   749k|            src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                  //b5 b6 b7 b8 b9....b15 0  0  0  0  0
 1721|       |
 1722|   749k|            src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10 a10 a11 a11 a12
 1723|   749k|            src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b4 b5 b5 b6 b6 b7 b7 b8 b8 b9 b9 b10 b10 b11 b11 b12
 1724|       |
 1725|   749k|            res_r0_t3_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff4_5_16x8b);    //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
 1726|       |                                                                                     //a8*c4+a9*c5 a9*c4+a10*c5 a10*c4+a11*c5 a11*c4+a12*c5
 1727|   749k|            res_r1_t3_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff4_5_16x8b);    //b4*c4+b5*c5 b5*c4+b6*c5 b6*c4+b7*c5 b7*c4+b8*c5
 1728|       |                                                                                     //b8*c4+b9*c5 b9*c4+b10*c5 b10*c4+b11*c5 b11*c4+b12*c5
 1729|   749k|            src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_pred1);
 1730|       |
 1731|   749k|            res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t2_8x16b);
 1732|   749k|            res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t2_8x16b);
 1733|   749k|            res_r0_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_r0_t3_8x16b);
 1734|   749k|            res_r1_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_r1_t3_8x16b);
 1735|   749k|            res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t3_8x16b);
 1736|   749k|            res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t3_8x16b);
 1737|       |
 1738|   749k|            res_r0_t1_8x16b = _mm_srai_epi16(res_r0_t1_8x16b, 5);
 1739|   749k|            res_r1_t1_8x16b = _mm_srai_epi16(res_r1_t1_8x16b, 5);                    //shifting right by 5 bits
 1740|       |
 1741|   749k|            res_16x8b = _mm_packus_epi16(res_r0_t1_8x16b, res_r1_t1_8x16b);
 1742|   749k|            res_16x8b = _mm_avg_epu8(src_r0_16x8b, res_16x8b);                       //computing q-pel
 1743|       |
 1744|   749k|            _mm_storeu_si128((__m128i *)pu1_dst, res_16x8b);
 1745|       |
 1746|   749k|            ht--;
 1747|   749k|            pu1_src += src_strd;
 1748|   749k|            pu1_pred1 += src_strd;
 1749|   749k|            pu1_dst += dst_strd;
 1750|   749k|        }
 1751|   749k|        while(ht > 0);
  ------------------
  |  Branch (1751:15): [True: 695k, False: 54.4k]
  ------------------
 1752|  54.4k|    }
 1753|   115k|}
ih264_inter_pred_luma_vert_qpel_ssse3:
 1793|  79.0k|{
 1794|  79.0k|    WORD32 y_offset;
 1795|  79.0k|    UWORD8 *pu1_pred1;
 1796|       |
 1797|       |
 1798|  79.0k|    __m128i src_r0_16x8b, src_r1_16x8b, src_r2_16x8b, src_r3_16x8b, src_r4_16x8b;
 1799|  79.0k|    __m128i src_r5_16x8b, src_r6_16x8b;
 1800|  79.0k|    __m128i src_r0r1_16x8b, src_r2r3_16x8b, src_r4r5_16x8b;
 1801|  79.0k|    __m128i res_16x8b, res_t1_8x16b, res_t2_8x16b, res_t3_8x16b;
 1802|       |
 1803|  79.0k|    __m128i coeff0_1_16x8b, coeff2_3_16x8b, coeff4_5_16x8b;
 1804|  79.0k|    __m128i const_val16_8x16b;
 1805|       |
 1806|  79.0k|    UNUSED(pu1_tmp);
  ------------------
  |  |   45|  79.0k|#define UNUSED(x) ((void)(x))
  ------------------
 1807|  79.0k|    y_offset = dydx & 0xf;
 1808|       |
 1809|  79.0k|    coeff0_1_16x8b = _mm_set1_epi32(0xFB01FB01); //c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1
 1810|  79.0k|    coeff2_3_16x8b = _mm_set1_epi32(0x14141414); //c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3
 1811|  79.0k|    coeff4_5_16x8b = _mm_set1_epi32(0x01FB01FB); //c4 c5 c4 c5 c4 c5 c4 c5 c4 c5 c4 c5 c4 c5 c4 c5
 1812|       |                                                 //c0 = c5 = 1, c1 = c4 = -5, c2 = c3 = 20
 1813|       |
 1814|  79.0k|    pu1_pred1 = pu1_src + (y_offset >> 3) * src_strd;
 1815|       |
 1816|  79.0k|    const_val16_8x16b = _mm_set1_epi16(16);
 1817|       |
 1818|  79.0k|    pu1_src -= src_strd << 1; // the filter input starts from x[-2] (till x[3])
 1819|       |
 1820|  79.0k|    if(wd == 4)
  ------------------
  |  Branch (1820:8): [True: 7.49k, False: 71.5k]
  ------------------
 1821|  7.49k|    {
 1822|       |        //Epilogue: Load all the pred rows except sixth and seventh row
 1823|       |        //          for the first and second row processing.
 1824|  7.49k|        src_r0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
 1825|  7.49k|        pu1_src += src_strd;
 1826|  7.49k|        src_r1_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
 1827|  7.49k|        pu1_src += src_strd;
 1828|  7.49k|        src_r2_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
 1829|  7.49k|        pu1_src += src_strd;
 1830|  7.49k|        src_r3_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
 1831|  7.49k|        pu1_src += src_strd;
 1832|  7.49k|        src_r4_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
 1833|  7.49k|        pu1_src += src_strd;
 1834|       |
 1835|  7.49k|        src_r0_16x8b = _mm_unpacklo_epi32(src_r0_16x8b, src_r1_16x8b);
 1836|  7.49k|        src_r1_16x8b = _mm_unpacklo_epi32(src_r1_16x8b, src_r2_16x8b);
 1837|  7.49k|        src_r2_16x8b = _mm_unpacklo_epi32(src_r2_16x8b, src_r3_16x8b);
 1838|  7.49k|        src_r3_16x8b = _mm_unpacklo_epi32(src_r3_16x8b, src_r4_16x8b);
 1839|       |
 1840|  7.49k|        do
 1841|  26.2k|        {
 1842|  26.2k|            src_r5_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
 1843|  26.2k|            src_r6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
 1844|       |
 1845|  26.2k|            src_r4_16x8b = _mm_unpacklo_epi32(src_r4_16x8b, src_r5_16x8b);
 1846|  26.2k|            src_r5_16x8b = _mm_unpacklo_epi32(src_r5_16x8b, src_r6_16x8b);
 1847|       |
 1848|  26.2k|            src_r0r1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r1_16x8b);
 1849|  26.2k|            src_r2r3_16x8b = _mm_unpacklo_epi8(src_r2_16x8b, src_r3_16x8b);
 1850|  26.2k|            src_r4r5_16x8b = _mm_unpacklo_epi8(src_r4_16x8b, src_r5_16x8b);
 1851|       |
 1852|  26.2k|            res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 1853|  26.2k|            res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 1854|  26.2k|            res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 1855|       |
 1856|  26.2k|            src_r0_16x8b = _mm_loadl_epi64((__m128i *)pu1_pred1);
 1857|  26.2k|            src_r1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred1 + src_strd));
 1858|       |
 1859|  26.2k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 1860|  26.2k|            res_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_t3_8x16b);
 1861|  26.2k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
 1862|       |
 1863|  26.2k|            src_r0r1_16x8b = _mm_unpacklo_epi32(src_r0_16x8b,src_r1_16x8b);
 1864|       |
 1865|  26.2k|            res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
 1866|       |
 1867|  26.2k|            res_16x8b = _mm_packus_epi16(res_t1_8x16b, res_t1_8x16b);
 1868|       |
 1869|  26.2k|            res_16x8b = _mm_avg_epu8(src_r0r1_16x8b, res_16x8b); //computing q-pel
 1870|       |
 1871|  26.2k|            *((WORD32 *)(pu1_dst)) = _mm_cvtsi128_si32(res_16x8b);
 1872|  26.2k|            res_16x8b = _mm_srli_si128(res_16x8b, 4);
 1873|  26.2k|            *((WORD32 *)(pu1_dst + dst_strd)) = _mm_cvtsi128_si32(res_16x8b);
 1874|       |
 1875|  26.2k|            src_r0_16x8b = src_r2_16x8b;
 1876|  26.2k|            src_r1_16x8b = src_r3_16x8b;
 1877|  26.2k|            src_r2_16x8b = src_r4_16x8b;
 1878|  26.2k|            src_r3_16x8b = src_r5_16x8b;
 1879|  26.2k|            src_r4_16x8b = src_r6_16x8b;
 1880|       |
 1881|  26.2k|            ht -= 2;
 1882|  26.2k|            pu1_src += src_strd << 1;
 1883|  26.2k|            pu1_pred1 += src_strd << 1;
 1884|  26.2k|            pu1_dst += dst_strd << 1;
 1885|  26.2k|        }
 1886|  26.2k|        while(ht > 0);
  ------------------
  |  Branch (1886:15): [True: 18.7k, False: 7.49k]
  ------------------
 1887|  7.49k|    }
 1888|       |
 1889|  71.5k|    else if(wd == 8)
  ------------------
  |  Branch (1889:13): [True: 30.1k, False: 41.4k]
  ------------------
 1890|  30.1k|    {
 1891|       |        //Epilogue: Load all the pred rows except sixth and seventh row
 1892|       |        //          for the first and second row processing.
 1893|  30.1k|        src_r0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
 1894|  30.1k|        pu1_src += src_strd;
 1895|  30.1k|        src_r1_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
 1896|  30.1k|        pu1_src += src_strd;
 1897|  30.1k|        src_r2_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
 1898|  30.1k|        pu1_src += src_strd;
 1899|  30.1k|        src_r3_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
 1900|  30.1k|        pu1_src += src_strd;
 1901|  30.1k|        src_r4_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
 1902|  30.1k|        pu1_src += src_strd;
 1903|       |
 1904|  30.1k|        src_r0_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);
 1905|  30.1k|        src_r1_16x8b = _mm_unpacklo_epi64(src_r1_16x8b, src_r2_16x8b);
 1906|  30.1k|        src_r2_16x8b = _mm_unpacklo_epi64(src_r2_16x8b, src_r3_16x8b);
 1907|  30.1k|        src_r3_16x8b = _mm_unpacklo_epi64(src_r3_16x8b, src_r4_16x8b);
 1908|       |
 1909|  30.1k|        do
 1910|   152k|        {
 1911|   152k|            src_r5_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
 1912|   152k|            src_r6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
 1913|       |
 1914|   152k|            src_r4_16x8b = _mm_unpacklo_epi64(src_r4_16x8b, src_r5_16x8b);
 1915|   152k|            src_r5_16x8b = _mm_unpacklo_epi64(src_r5_16x8b, src_r6_16x8b);
 1916|       |
 1917|   152k|            src_r0r1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r1_16x8b);
 1918|   152k|            src_r2r3_16x8b = _mm_unpacklo_epi8(src_r2_16x8b, src_r3_16x8b);
 1919|   152k|            src_r4r5_16x8b = _mm_unpacklo_epi8(src_r4_16x8b, src_r5_16x8b);
 1920|       |
 1921|   152k|            res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 1922|   152k|            res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 1923|   152k|            res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 1924|       |
 1925|   152k|            src_r0r1_16x8b = _mm_loadl_epi64((__m128i *)pu1_pred1);
 1926|       |
 1927|   152k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 1928|   152k|            res_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_t3_8x16b);
 1929|   152k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
 1930|       |
 1931|   152k|            res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
 1932|       |
 1933|   152k|            res_16x8b = _mm_packus_epi16(res_t1_8x16b, res_t1_8x16b);
 1934|   152k|            res_16x8b = _mm_avg_epu8(src_r0r1_16x8b, res_16x8b); //computing q-pel
 1935|       |
 1936|   152k|            _mm_storel_epi64((__m128i *)pu1_dst, res_16x8b);
 1937|       |
 1938|   152k|            src_r0r1_16x8b = _mm_unpackhi_epi8(src_r0_16x8b, src_r1_16x8b);
 1939|   152k|            src_r2r3_16x8b = _mm_unpackhi_epi8(src_r2_16x8b, src_r3_16x8b);
 1940|   152k|            src_r4r5_16x8b = _mm_unpackhi_epi8(src_r4_16x8b, src_r5_16x8b);
 1941|       |
 1942|   152k|            res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 1943|   152k|            res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 1944|   152k|            res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 1945|       |
 1946|   152k|            src_r0r1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred1 + src_strd));
 1947|       |
 1948|   152k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 1949|   152k|            res_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_t3_8x16b);
 1950|   152k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
 1951|       |
 1952|   152k|            res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
 1953|       |
 1954|   152k|            res_16x8b = _mm_packus_epi16(res_t1_8x16b, res_t1_8x16b);
 1955|   152k|            res_16x8b = _mm_avg_epu8(src_r0r1_16x8b, res_16x8b); //computing q-pel
 1956|       |
 1957|   152k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), res_16x8b);
 1958|       |
 1959|   152k|            src_r0_16x8b = src_r2_16x8b;
 1960|   152k|            src_r1_16x8b = src_r3_16x8b;
 1961|   152k|            src_r2_16x8b = src_r4_16x8b;
 1962|   152k|            src_r3_16x8b = src_r5_16x8b;
 1963|   152k|            src_r4_16x8b = src_r6_16x8b;
 1964|       |
 1965|   152k|            ht -= 2;
 1966|   152k|            pu1_src += src_strd << 1;
 1967|   152k|            pu1_pred1 += src_strd << 1;
 1968|   152k|            pu1_dst += dst_strd << 1;
 1969|   152k|        }
 1970|   152k|        while(ht > 0);
  ------------------
  |  Branch (1970:15): [True: 122k, False: 30.1k]
  ------------------
 1971|  30.1k|    }
 1972|  41.4k|    else // wd == 16
 1973|  41.4k|    {
 1974|  41.4k|        __m128i res_t0_8x16b;
 1975|       |
 1976|       |        //Epilogue: Load all the pred rows except sixth and seventh row
 1977|       |        //          for the first and second row processing.
 1978|  41.4k|        src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
 1979|  41.4k|        pu1_src += src_strd;
 1980|  41.4k|        src_r1_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
 1981|  41.4k|        pu1_src += src_strd;
 1982|  41.4k|        src_r2_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
 1983|  41.4k|        pu1_src += src_strd;
 1984|  41.4k|        src_r3_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
 1985|  41.4k|        pu1_src += src_strd;
 1986|  41.4k|        src_r4_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
 1987|  41.4k|        pu1_src += src_strd;
 1988|       |
 1989|  41.4k|        do
 1990|   299k|        {
 1991|   299k|            src_r5_16x8b  = _mm_loadu_si128((__m128i *)pu1_src);
 1992|   299k|            src_r6_16x8b  = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));
 1993|       |
 1994|   299k|            src_r0r1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r1_16x8b);
 1995|   299k|            src_r2r3_16x8b = _mm_unpacklo_epi8(src_r2_16x8b, src_r3_16x8b);
 1996|   299k|            src_r4r5_16x8b = _mm_unpacklo_epi8(src_r4_16x8b, src_r5_16x8b);
 1997|       |
 1998|   299k|            res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 1999|   299k|            res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2000|   299k|            res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2001|       |
 2002|   299k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2003|   299k|            res_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_t3_8x16b);
 2004|   299k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
 2005|       |
 2006|   299k|            res_t0_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
 2007|       |
 2008|   299k|            src_r0r1_16x8b = _mm_unpackhi_epi8(src_r0_16x8b, src_r1_16x8b);
 2009|   299k|            src_r2r3_16x8b = _mm_unpackhi_epi8(src_r2_16x8b, src_r3_16x8b);
 2010|   299k|            src_r4r5_16x8b = _mm_unpackhi_epi8(src_r4_16x8b, src_r5_16x8b);
 2011|       |
 2012|   299k|            res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2013|   299k|            res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2014|   299k|            res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2015|       |
 2016|   299k|            src_r0r1_16x8b = _mm_loadu_si128((__m128i *)pu1_pred1);
 2017|       |
 2018|   299k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2019|   299k|            res_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_t3_8x16b);
 2020|   299k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
 2021|       |
 2022|   299k|            res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
 2023|       |
 2024|   299k|            res_16x8b = _mm_packus_epi16(res_t0_8x16b, res_t1_8x16b);
 2025|   299k|            res_16x8b = _mm_avg_epu8(src_r0r1_16x8b, res_16x8b); //computing q-pel
 2026|       |
 2027|   299k|            _mm_storeu_si128((__m128i *)pu1_dst, res_16x8b);
 2028|       |
 2029|   299k|            src_r0r1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r2_16x8b);
 2030|   299k|            src_r2r3_16x8b = _mm_unpacklo_epi8(src_r3_16x8b, src_r4_16x8b);
 2031|   299k|            src_r4r5_16x8b = _mm_unpacklo_epi8(src_r5_16x8b, src_r6_16x8b);
 2032|       |
 2033|   299k|            res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2034|   299k|            res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2035|   299k|            res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2036|       |
 2037|   299k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2038|   299k|            res_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_t3_8x16b);
 2039|   299k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
 2040|       |
 2041|   299k|            res_t0_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
 2042|       |
 2043|   299k|            src_r0r1_16x8b = _mm_unpackhi_epi8(src_r1_16x8b, src_r2_16x8b);
 2044|   299k|            src_r2r3_16x8b = _mm_unpackhi_epi8(src_r3_16x8b, src_r4_16x8b);
 2045|   299k|            src_r4r5_16x8b = _mm_unpackhi_epi8(src_r5_16x8b, src_r6_16x8b);
 2046|       |
 2047|   299k|            res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2048|   299k|            res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2049|   299k|            res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2050|       |
 2051|   299k|            src_r0r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_pred1 + src_strd));
 2052|       |
 2053|   299k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2054|   299k|            res_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_t3_8x16b);
 2055|   299k|            res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
 2056|       |
 2057|   299k|            res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
 2058|       |
 2059|   299k|            res_16x8b = _mm_packus_epi16(res_t0_8x16b, res_t1_8x16b);
 2060|   299k|            res_16x8b = _mm_avg_epu8(src_r0r1_16x8b, res_16x8b); //computing q-pel
 2061|       |
 2062|   299k|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), res_16x8b);
 2063|       |
 2064|   299k|            src_r0_16x8b = src_r2_16x8b;
 2065|   299k|            src_r1_16x8b = src_r3_16x8b;
 2066|   299k|            src_r2_16x8b = src_r4_16x8b;
 2067|   299k|            src_r3_16x8b = src_r5_16x8b;
 2068|   299k|            src_r4_16x8b = src_r6_16x8b;
 2069|       |
 2070|   299k|            ht -= 2;
 2071|   299k|            pu1_src += src_strd << 1;
 2072|   299k|            pu1_pred1 += src_strd << 1;
 2073|   299k|            pu1_dst += dst_strd << 1;
 2074|   299k|        }
 2075|   299k|        while(ht > 0);
  ------------------
  |  Branch (2075:15): [True: 258k, False: 41.4k]
  ------------------
 2076|  41.4k|    }
 2077|  79.0k|}
ih264_inter_pred_luma_horz_qpel_vert_qpel_ssse3:
 2118|  86.5k|{
 2119|  86.5k|    WORD32 ht_temp;
 2120|  86.5k|    UWORD8 *pu1_pred_vert,*pu1_pred_horiz;
 2121|  86.5k|    UWORD8 *pu1_tmp1, *pu1_tmp2;
 2122|  86.5k|    WORD32 x_offset, y_offset;
 2123|       |
 2124|  86.5k|    __m128i coeff0_1_16x8b, coeff2_3_16x8b, coeff4_5_16x8b;
 2125|  86.5k|    __m128i const_val16_8x16b;
 2126|       |
 2127|  86.5k|    pu1_tmp1 = pu1_tmp;
 2128|       |
 2129|  86.5k|    dydx &= 0xf;
 2130|  86.5k|    ht_temp = ht;
 2131|  86.5k|    x_offset = dydx & 0x3;
 2132|  86.5k|    y_offset = dydx >> 2;
 2133|  86.5k|    pu1_tmp2 = pu1_tmp1;
 2134|       |
 2135|  86.5k|    pu1_pred_vert  = pu1_src + (x_offset >> 1) - 2*src_strd;
 2136|  86.5k|    pu1_pred_horiz = pu1_src + (y_offset >> 1) * src_strd - 2;
 2137|       |    //the filter input starts from x[-2] (till x[3])
 2138|       |
 2139|  86.5k|    coeff0_1_16x8b = _mm_set1_epi32(0xFB01FB01);  //c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1
 2140|  86.5k|    coeff2_3_16x8b = _mm_set1_epi32(0x14141414);  //c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3
 2141|  86.5k|    coeff4_5_16x8b = _mm_set1_epi32(0x01FB01FB);  //c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5
 2142|       |                                                  //c0 = c5 = 1, c1 = c4 = -5, c2 = c3 = 20
 2143|  86.5k|    const_val16_8x16b = _mm_set1_epi16(16);
 2144|       |
 2145|  86.5k|    if(wd == 4)
  ------------------
  |  Branch (2145:8): [True: 8.35k, False: 78.2k]
  ------------------
 2146|  8.35k|    {
 2147|       |        //vertical q-pel filter
 2148|  8.35k|        {
 2149|  8.35k|            __m128i src_r0_16x8b, src_r1_16x8b, src_r2_16x8b, src_r3_16x8b, src_r4_16x8b;
 2150|  8.35k|            __m128i src_r5_16x8b, src_r6_16x8b;
 2151|  8.35k|            __m128i src_r0r1_16x8b, src_r2r3_16x8b, src_r4r5_16x8b;
 2152|       |
 2153|  8.35k|            __m128i res_r0r1_16x8b, res_t1_8x16b, res_t2_8x16b, res_t3_8x16b;
 2154|       |
 2155|       |            //epilogue: Load all the pred rows except sixth  and seventh row for the
 2156|       |            //first and second row processing.
 2157|  8.35k|            src_r0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred_vert));
 2158|  8.35k|            pu1_pred_vert = pu1_pred_vert + src_strd;
 2159|       |
 2160|  8.35k|            src_r1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred_vert));
 2161|  8.35k|            pu1_pred_vert = pu1_pred_vert + src_strd;
 2162|  8.35k|            src_r0_16x8b = _mm_unpacklo_epi32(src_r0_16x8b, src_r1_16x8b);
 2163|       |
 2164|  8.35k|            src_r2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred_vert));
 2165|  8.35k|            pu1_pred_vert = pu1_pred_vert + src_strd;
 2166|  8.35k|            src_r1_16x8b = _mm_unpacklo_epi32(src_r1_16x8b, src_r2_16x8b);
 2167|       |
 2168|  8.35k|            src_r3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred_vert));
 2169|  8.35k|            pu1_pred_vert = pu1_pred_vert + src_strd;
 2170|  8.35k|            src_r2_16x8b = _mm_unpacklo_epi32(src_r2_16x8b, src_r3_16x8b);
 2171|       |
 2172|  8.35k|            src_r4_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred_vert));
 2173|  8.35k|            pu1_pred_vert = pu1_pred_vert + src_strd;
 2174|  8.35k|            src_r3_16x8b = _mm_unpacklo_epi32(src_r3_16x8b, src_r4_16x8b);
 2175|       |
 2176|       |            //Core Loop: Process all the rows.
 2177|  8.35k|            do
 2178|  28.3k|            {
 2179|  28.3k|                src_r5_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred_vert));
 2180|  28.3k|                src_r4_16x8b = _mm_unpacklo_epi32(src_r4_16x8b, src_r5_16x8b);
 2181|       |
 2182|  28.3k|                src_r6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred_vert + src_strd));
 2183|  28.3k|                src_r5_16x8b = _mm_unpacklo_epi32(src_r5_16x8b, src_r6_16x8b);
 2184|       |
 2185|  28.3k|                src_r0r1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r1_16x8b);
 2186|  28.3k|                src_r2r3_16x8b = _mm_unpacklo_epi8(src_r2_16x8b, src_r3_16x8b);
 2187|  28.3k|                src_r4r5_16x8b = _mm_unpacklo_epi8(src_r4_16x8b, src_r5_16x8b);
 2188|       |
 2189|  28.3k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2190|  28.3k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2191|  28.3k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2192|       |
 2193|  28.3k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2194|  28.3k|                res_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_t3_8x16b);
 2195|  28.3k|                res_t1_8x16b = _mm_add_epi16(res_t3_8x16b, res_t1_8x16b);
 2196|       |
 2197|  28.3k|                res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
 2198|  28.3k|                res_r0r1_16x8b = _mm_packus_epi16(res_t1_8x16b, res_t1_8x16b);
 2199|       |
 2200|  28.3k|                _mm_storel_epi64((__m128i *)pu1_tmp1, res_r0r1_16x8b);
 2201|       |
 2202|  28.3k|                src_r0_16x8b = src_r2_16x8b;
 2203|  28.3k|                src_r1_16x8b = src_r3_16x8b;
 2204|  28.3k|                src_r2_16x8b = src_r4_16x8b;
 2205|  28.3k|                src_r3_16x8b = src_r5_16x8b;
 2206|  28.3k|                src_r4_16x8b = src_r6_16x8b;
 2207|       |
 2208|  28.3k|                ht_temp -= 2;
 2209|  28.3k|                pu1_pred_vert += src_strd << 1;
 2210|  28.3k|                pu1_tmp1 += 8;
 2211|  28.3k|            }
 2212|  28.3k|            while(ht_temp > 0);
  ------------------
  |  Branch (2212:19): [True: 19.9k, False: 8.35k]
  ------------------
 2213|  8.35k|        }
 2214|       |
 2215|       |        //horizontal q-pel filter
 2216|  8.35k|        {
 2217|  8.35k|            __m128i src_r0_16x8b, src_r1_16x8b;
 2218|  8.35k|            __m128i src_r0_sht_16x8b, src_r1_sht_16x8b;
 2219|  8.35k|            __m128i src_r0r1_vpel_16x8b, src_r0r1_t1_16x8b;
 2220|       |
 2221|  8.35k|            __m128i res_r0r1_t1_8x16b, res_r0r1_t2_8x16b, res_r0r1_t3_8x16b;
 2222|  8.35k|            __m128i res_r0r1_16x8b;
 2223|       |
 2224|       |            //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
 2225|       |            //Row1 : b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
 2226|       |
 2227|  8.35k|            do
 2228|  28.3k|            {
 2229|  28.3k|                src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_pred_horiz);                  //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
 2230|  28.3k|                src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_pred_horiz + src_strd));     //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9....b15
 2231|       |
 2232|  28.3k|                src_r0r1_vpel_16x8b = _mm_loadl_epi64((__m128i *)pu1_tmp2);
 2233|       |
 2234|  28.3k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                          //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
 2235|  28.3k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                          //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
 2236|       |
 2237|  28.3k|                src_r0_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);            //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
 2238|  28.3k|                src_r1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);            //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
 2239|       |
 2240|  28.3k|                src_r0r1_t1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);          //a0 a1 a1 a2 a2 a3 a3 a4 b0 b1 b1 b2 b2 b3 b3 b4
 2241|  28.3k|                res_r0r1_t1_8x16b = _mm_maddubs_epi16(src_r0r1_t1_16x8b, coeff0_1_16x8b);    //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
 2242|       |                                                                                             //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
 2243|       |
 2244|  28.3k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 4);                              //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8  0  0  0  0
 2245|  28.3k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 4);                              //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8  0  0  0  0
 2246|       |
 2247|  28.3k|                src_r0r1_t1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);          //a2 a3 a3 a4 a4 a5 a5 a6 b2 b3 b3 b4 b4 b5 b5 b6
 2248|  28.3k|                res_r0r1_t2_8x16b = _mm_maddubs_epi16(src_r0r1_t1_16x8b, coeff2_3_16x8b);    //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
 2249|       |                                                                                             //b2*c2+b3*c3 b3*c2+b4*c3 b4*c2+b5*c3 b5*c2+b6*c3
 2250|       |
 2251|  28.3k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 4);                              //a4 a5 a5 a6 a6 a7 a7 a8  0  0  0  0  0  0  0  0
 2252|  28.3k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 4);                              //b4 b5 b5 b6 b6 b7 b7 b8  0  0  0  0  0  0  0  0
 2253|       |
 2254|  28.3k|                src_r0r1_t1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);          //a4 a5 a5 a6 a6 a7 a7 a8 b4 b5 b5 b6 b6 b7 b7 b8
 2255|  28.3k|                res_r0r1_t3_8x16b = _mm_maddubs_epi16(src_r0r1_t1_16x8b, coeff4_5_16x8b);    //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
 2256|       |                                                                                             //b4*c4+b5*c5 b5*c4+b6*c5 b4*c6+b7*c5 b7*c4+b8*c5
 2257|       |
 2258|  28.3k|                res_r0r1_t1_8x16b = _mm_add_epi16(res_r0r1_t1_8x16b, res_r0r1_t2_8x16b);
 2259|  28.3k|                res_r0r1_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_r0r1_t3_8x16b);
 2260|  28.3k|                res_r0r1_t1_8x16b = _mm_add_epi16(res_r0r1_t1_8x16b, res_r0r1_t3_8x16b);     //a0*c0+a1*c1+a2*c2+a3*c3+a4*a4+a5*c5 + 15;
 2261|       |                                                                                             //a1*c0+a2*c1+a2*c2+a3*c3+a5*a4+a6*c5 + 15;
 2262|       |                                                                                             //a2*c0+a3*c1+a4*c2+a5*c3+a6*a4+a7*c5 + 15;
 2263|       |                                                                                             //a3*c0+a4*c1+a5*c2+a6*c3+a6*a4+a8*c5 + 15;
 2264|       |                                                                                             //b0*c0+b1*c1+b2*c2+b3*c3+b4*b4+b5*c5 + 15;
 2265|       |                                                                                             //b1*c0+b2*c1+b2*c2+b3*c3+b5*b4+b6*c5 + 15;
 2266|       |                                                                                             //b2*c0+b3*c1+b4*c2+b5*c3+b6*b4+b7*c5 + 15;
 2267|       |                                                                                             //b3*c0+b4*c1+b5*c2+b6*c3+b6*b4+b8*c5 + 15;
 2268|       |
 2269|  28.3k|                res_r0r1_t1_8x16b = _mm_srai_epi16(res_r0r1_t1_8x16b, 5);                    //shifting right by 5 bits.
 2270|       |
 2271|  28.3k|                res_r0r1_16x8b = _mm_packus_epi16(res_r0r1_t1_8x16b,res_r0r1_t1_8x16b);
 2272|       |
 2273|  28.3k|                res_r0r1_16x8b = _mm_avg_epu8(res_r0r1_16x8b,src_r0r1_vpel_16x8b);
 2274|       |
 2275|  28.3k|                *((WORD32 *)(pu1_dst)) = _mm_cvtsi128_si32(res_r0r1_16x8b);
 2276|  28.3k|                res_r0r1_16x8b = _mm_srli_si128(res_r0r1_16x8b, 4);
 2277|  28.3k|                *((WORD32 *)(pu1_dst + dst_strd)) = _mm_cvtsi128_si32(res_r0r1_16x8b);
 2278|       |
 2279|  28.3k|                ht -= 2;
 2280|  28.3k|                pu1_pred_horiz += src_strd << 1;
 2281|  28.3k|                pu1_tmp2 += 8;
 2282|  28.3k|                pu1_dst += dst_strd << 1;
 2283|  28.3k|            }
 2284|  28.3k|            while(ht > 0);
  ------------------
  |  Branch (2284:19): [True: 19.9k, False: 8.35k]
  ------------------
 2285|  8.35k|        }
 2286|  8.35k|    }
 2287|  78.2k|    else if(wd == 8)
  ------------------
  |  Branch (2287:13): [True: 37.9k, False: 40.2k]
  ------------------
 2288|  37.9k|    {
 2289|       |        //vertical q-pel filter
 2290|  37.9k|        {
 2291|  37.9k|            __m128i src_r0_16x8b, src_r1_16x8b, src_r2_16x8b, src_r3_16x8b;
 2292|  37.9k|            __m128i src_r4_16x8b, src_r5_16x8b, src_r6_16x8b;
 2293|  37.9k|            __m128i src_r0r1_16x8b, src_r2r3_16x8b, src_r4r5_16x8b;
 2294|       |
 2295|  37.9k|            __m128i res_16x8b, res_t1_8x16b, res_t2_8x16b, res_t3_8x16b;
 2296|       |
 2297|       |            //epilogue: Load all the pred rows except sixth  and seventh row for the
 2298|       |            //first and second row processing.
 2299|  37.9k|            src_r0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred_vert));
 2300|  37.9k|            pu1_pred_vert = pu1_pred_vert + src_strd;
 2301|       |
 2302|  37.9k|            src_r1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred_vert));
 2303|  37.9k|            pu1_pred_vert = pu1_pred_vert + src_strd;
 2304|  37.9k|            src_r0_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);
 2305|       |
 2306|  37.9k|            src_r2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred_vert));
 2307|  37.9k|            pu1_pred_vert = pu1_pred_vert + src_strd;
 2308|  37.9k|            src_r1_16x8b = _mm_unpacklo_epi64(src_r1_16x8b, src_r2_16x8b);
 2309|       |
 2310|  37.9k|            src_r3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred_vert));
 2311|  37.9k|            pu1_pred_vert = pu1_pred_vert + src_strd;
 2312|  37.9k|            src_r2_16x8b = _mm_unpacklo_epi64(src_r2_16x8b, src_r3_16x8b);
 2313|       |
 2314|  37.9k|            src_r4_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred_vert));
 2315|  37.9k|            pu1_pred_vert = pu1_pred_vert + src_strd;
 2316|  37.9k|            src_r3_16x8b = _mm_unpacklo_epi64(src_r3_16x8b, src_r4_16x8b);
 2317|       |
 2318|       |            //Core Loop: Process all the rows.
 2319|  37.9k|            do
 2320|   209k|            {
 2321|   209k|                src_r5_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred_vert));
 2322|   209k|                src_r4_16x8b = _mm_unpacklo_epi64(src_r4_16x8b, src_r5_16x8b);
 2323|       |
 2324|   209k|                src_r6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_pred_vert + src_strd));
 2325|   209k|                src_r5_16x8b = _mm_unpacklo_epi64(src_r5_16x8b, src_r6_16x8b);
 2326|       |
 2327|   209k|                src_r0r1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r1_16x8b);
 2328|   209k|                src_r2r3_16x8b = _mm_unpacklo_epi8(src_r2_16x8b, src_r3_16x8b);
 2329|   209k|                src_r4r5_16x8b = _mm_unpacklo_epi8(src_r4_16x8b, src_r5_16x8b);
 2330|       |
 2331|   209k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2332|   209k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2333|   209k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2334|       |
 2335|   209k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2336|   209k|                res_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_t3_8x16b);
 2337|   209k|                res_t1_8x16b = _mm_add_epi16(res_t3_8x16b, res_t1_8x16b);
 2338|       |
 2339|   209k|                res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
 2340|   209k|                res_16x8b = _mm_packus_epi16(res_t1_8x16b, res_t1_8x16b);
 2341|       |
 2342|   209k|                _mm_storel_epi64((__m128i *)(pu1_tmp1), res_16x8b);
 2343|       |
 2344|   209k|                src_r0r1_16x8b = _mm_unpackhi_epi8(src_r0_16x8b, src_r1_16x8b);
 2345|   209k|                src_r2r3_16x8b = _mm_unpackhi_epi8(src_r2_16x8b, src_r3_16x8b);
 2346|   209k|                src_r4r5_16x8b = _mm_unpackhi_epi8(src_r4_16x8b, src_r5_16x8b);
 2347|       |
 2348|   209k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2349|   209k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2350|   209k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2351|       |
 2352|   209k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2353|   209k|                res_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_t3_8x16b);
 2354|   209k|                res_t1_8x16b = _mm_add_epi16(res_t3_8x16b, res_t1_8x16b);
 2355|       |
 2356|   209k|                res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
 2357|   209k|                res_16x8b = _mm_packus_epi16(res_t1_8x16b, res_t1_8x16b);
 2358|       |
 2359|   209k|                _mm_storel_epi64((__m128i *)(pu1_tmp1 + 8), res_16x8b);
 2360|       |
 2361|   209k|                src_r0_16x8b = src_r2_16x8b;
 2362|   209k|                src_r1_16x8b = src_r3_16x8b;
 2363|   209k|                src_r2_16x8b = src_r4_16x8b;
 2364|   209k|                src_r3_16x8b = src_r5_16x8b;
 2365|   209k|                src_r4_16x8b = src_r6_16x8b;
 2366|       |
 2367|   209k|                ht_temp -= 2;
 2368|   209k|                pu1_pred_vert += src_strd << 1;
 2369|   209k|                pu1_tmp1 += 16;
 2370|   209k|            }
 2371|   209k|            while(ht_temp > 0);
  ------------------
  |  Branch (2371:19): [True: 171k, False: 37.9k]
  ------------------
 2372|  37.9k|        }
 2373|       |
 2374|       |        //horizontal q-pel filter
 2375|  37.9k|        {
 2376|  37.9k|            __m128i src_r0_16x8b, src_r1_16x8b, src_r0_sht_16x8b, src_r1_sht_16x8b;
 2377|  37.9k|            __m128i src_r0_t1_16x8b, src_r1_t1_16x8b;
 2378|  37.9k|            __m128i src_r0_vpel_16x8b, src_r1_vpel_16x8b;
 2379|       |
 2380|  37.9k|            __m128i res_r0_t1_8x16b, res_r0_t2_8x16b, res_r0_t3_8x16b;
 2381|  37.9k|            __m128i res_r1_t1_8x16b, res_r1_t2_8x16b, res_r1_t3_8x16b, res_16x8b;
 2382|       |
 2383|       |            //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
 2384|       |            //Row1 : b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
 2385|       |
 2386|  37.9k|            do
 2387|   209k|            {
 2388|   209k|                src_r0_16x8b = _mm_loadu_si128((__m128i *)(pu1_pred_horiz));               //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
 2389|   209k|                src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_pred_horiz + src_strd));    //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9....b15
 2390|       |
 2391|   209k|                src_r0_vpel_16x8b = _mm_loadl_epi64((__m128i *)(pu1_tmp2));                //a2 a3 a4 a5 a6 a7 a8....a15 0 or
 2392|       |                                                                                           //a3 a4 a5 a6 a7 a8 a9....a15 0
 2393|   209k|                src_r1_vpel_16x8b = _mm_loadl_epi64((__m128i *)(pu1_tmp2 + 8));
 2394|       |                                                                                           //b2 b3 b4 b5 b6 b7 b8....b15 0 or
 2395|       |                                                                                           //b3 b4 b5 b6 b7 b8 b9....b15 0
 2396|       |
 2397|   209k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                        //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
 2398|   209k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                        //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
 2399|       |
 2400|   209k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);       //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
 2401|   209k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);       //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
 2402|       |
 2403|   209k|                res_r0_t1_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff0_1_16x8b);      //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
 2404|       |                                                                                           //a4*c0+a5*c1 a5*c0+a6*c1 a6*c0+a7*c1 a7*c0+a8*c1
 2405|   209k|                res_r1_t1_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff0_1_16x8b);      //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
 2406|       |                                                                                           //b4*c0+b5*c1 b5*c0+b6*c1 b6*c0+b7*c1 b7*c0+b8*c1
 2407|       |
 2408|   209k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                            //a2 a3 a4 a5 a6 a7 a8 a9....a15 0 0
 2409|   209k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                            //b2 b3 b4 b5 b6 b7 b8 b9....b15 0 0
 2410|       |
 2411|   209k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                    //a3 a4 a5 a6 a7 a8 a9....a15 0  0  0
 2412|   209k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                    //b3 b4 b5 b6 b7 b8 b9....b15 0  0  0
 2413|       |
 2414|   209k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);       //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10
 2415|   209k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);       //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8 a8 a9 a9 a10
 2416|       |
 2417|   209k|                res_r0_t2_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff2_3_16x8b);      //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
 2418|       |                                                                                           //a6*c2+a7*c3 a7*c2+a8*c3 a8*c2+a9*c3 a9*c2+a10*c3
 2419|   209k|                res_r1_t2_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff2_3_16x8b);      //b2*c2+b3*c3 b3*c2+b4*c3 b2*c4+b5*c3 b5*c2+b6*c3
 2420|       |                                                                                           //b6*c2+b7*c3 b7*c2+b8*c3 b8*c2+b9*c3 b9*c2+b10*c3
 2421|       |
 2422|   209k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                            //a4 a5 a6 a7 a8 a9....a15 0  0  0  0
 2423|   209k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                            //b4 b5 b6 b7 b8 b9....b15 0  0  0  0
 2424|       |
 2425|   209k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                    //a5 a6 a7 a8 a9....a15 0  0  0  0  0
 2426|   209k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                    //b5 b6 b7 b8 b9....b15 0  0  0  0  0
 2427|       |
 2428|   209k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);       //a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10 a10 a11 a11 a12
 2429|   209k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);       //b4 b5 b5 b6 b6 b7 b7 b8 b8 b9 b9 b10 b10 b11 b11 b12
 2430|       |
 2431|   209k|                res_r0_t3_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff4_5_16x8b);      //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
 2432|       |                                                                                           //a8*c4+a9*c5 a9*c4+a10*c5 a10*c4+a11*c5 a11*c4+a12*c5
 2433|   209k|                res_r1_t3_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff4_5_16x8b);      //b4*c4+b5*c5 b5*c4+b6*c5 b6*c4+b7*c5 b7*c4+b8*c5
 2434|       |                                                                                           //b8*c4+b9*c5 b9*c4+b10*c5 b10*c4+b11*c5 b11*c4+b12*c5
 2435|   209k|                res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t2_8x16b);
 2436|   209k|                res_r0_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_r0_t3_8x16b);
 2437|   209k|                res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t3_8x16b);
 2438|   209k|                res_r0_t1_8x16b = _mm_srai_epi16(res_r0_t1_8x16b, 5);                      //shifting right by 5 bits.
 2439|       |
 2440|   209k|                res_16x8b = _mm_packus_epi16(res_r0_t1_8x16b, res_r0_t1_8x16b);
 2441|   209k|                res_16x8b = _mm_avg_epu8(res_16x8b, src_r0_vpel_16x8b);
 2442|       |
 2443|   209k|                _mm_storel_epi64((__m128i *)(pu1_dst), res_16x8b);
 2444|       |
 2445|   209k|                res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t2_8x16b);
 2446|   209k|                res_r1_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_r1_t3_8x16b);
 2447|   209k|                res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t3_8x16b);
 2448|   209k|                res_r1_t1_8x16b = _mm_srai_epi16(res_r1_t1_8x16b, 5);                      //shifting right by 5 bits.
 2449|       |
 2450|   209k|                res_16x8b = _mm_packus_epi16(res_r1_t1_8x16b, res_r1_t1_8x16b);
 2451|   209k|                res_16x8b = _mm_avg_epu8(res_16x8b,src_r1_vpel_16x8b);
 2452|       |
 2453|   209k|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), res_16x8b);
 2454|       |
 2455|   209k|                ht -= 2;
 2456|   209k|                pu1_pred_horiz += src_strd << 1;
 2457|   209k|                pu1_dst += dst_strd << 1;
 2458|   209k|                pu1_tmp2 += 16;
 2459|   209k|            }
 2460|   209k|            while(ht > 0);
  ------------------
  |  Branch (2460:19): [True: 171k, False: 37.9k]
  ------------------
 2461|  37.9k|        }
 2462|  37.9k|    }
 2463|  40.2k|    else // wd == 16
 2464|  40.2k|    {
 2465|       |        //vertical q-pel filter
 2466|  40.2k|        {
 2467|  40.2k|            __m128i src_r0_16x8b, src_r1_16x8b, src_r2_16x8b, src_r3_16x8b;
 2468|  40.2k|            __m128i src_r4_16x8b, src_r5_16x8b, src_r6_16x8b;
 2469|  40.2k|            __m128i src_r0r1_16x8b, src_r2r3_16x8b, src_r4r5_16x8b;
 2470|       |
 2471|  40.2k|            __m128i res_t0_8x16b, res_t1_8x16b, res_t2_8x16b, res_t3_8x16b;
 2472|  40.2k|            __m128i res_16x8b;
 2473|       |
 2474|       |            //epilogue: Load all the pred rows except sixth  and seventh row for the
 2475|       |            //first and second row processing.
 2476|  40.2k|            src_r0_16x8b = _mm_loadu_si128((__m128i *)(pu1_pred_vert));
 2477|  40.2k|            pu1_pred_vert =  pu1_pred_vert + src_strd;
 2478|  40.2k|            src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_pred_vert));
 2479|  40.2k|            pu1_pred_vert =  pu1_pred_vert + src_strd;
 2480|  40.2k|            src_r2_16x8b = _mm_loadu_si128((__m128i *)(pu1_pred_vert));
 2481|  40.2k|            pu1_pred_vert =  pu1_pred_vert + src_strd;
 2482|  40.2k|            src_r3_16x8b = _mm_loadu_si128((__m128i *)(pu1_pred_vert));
 2483|  40.2k|            pu1_pred_vert =  pu1_pred_vert + src_strd;
 2484|  40.2k|            src_r4_16x8b = _mm_loadu_si128((__m128i *)(pu1_pred_vert));
 2485|  40.2k|            pu1_pred_vert =  pu1_pred_vert + src_strd;
 2486|       |
 2487|       |            //Core Loop: Process all the rows.
 2488|  40.2k|            do
 2489|   259k|            {
 2490|   259k|                src_r5_16x8b = _mm_loadu_si128((__m128i *)(pu1_pred_vert));
 2491|   259k|                src_r6_16x8b = _mm_loadu_si128((__m128i *)(pu1_pred_vert + src_strd));
 2492|       |
 2493|   259k|                src_r0r1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r1_16x8b);
 2494|   259k|                src_r2r3_16x8b = _mm_unpacklo_epi8(src_r2_16x8b, src_r3_16x8b);
 2495|   259k|                src_r4r5_16x8b = _mm_unpacklo_epi8(src_r4_16x8b, src_r5_16x8b);
 2496|       |
 2497|   259k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2498|   259k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2499|   259k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2500|       |
 2501|   259k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2502|   259k|                res_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_t3_8x16b);
 2503|   259k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
 2504|   259k|                res_t0_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
 2505|       |
 2506|   259k|                src_r0r1_16x8b = _mm_unpackhi_epi8(src_r0_16x8b, src_r1_16x8b);
 2507|   259k|                src_r2r3_16x8b = _mm_unpackhi_epi8(src_r2_16x8b, src_r3_16x8b);
 2508|   259k|                src_r4r5_16x8b = _mm_unpackhi_epi8(src_r4_16x8b, src_r5_16x8b);
 2509|       |
 2510|   259k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2511|   259k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2512|   259k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2513|       |
 2514|   259k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2515|   259k|                res_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_t3_8x16b);
 2516|   259k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
 2517|   259k|                res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
 2518|       |
 2519|   259k|                res_16x8b = _mm_packus_epi16(res_t0_8x16b, res_t1_8x16b);
 2520|       |
 2521|   259k|                _mm_storeu_si128((__m128i *)(pu1_tmp1), res_16x8b);
 2522|       |
 2523|   259k|                src_r0r1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r2_16x8b);
 2524|   259k|                src_r2r3_16x8b = _mm_unpacklo_epi8(src_r3_16x8b, src_r4_16x8b);
 2525|   259k|                src_r4r5_16x8b = _mm_unpacklo_epi8(src_r5_16x8b, src_r6_16x8b);
 2526|       |
 2527|   259k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2528|   259k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2529|   259k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2530|       |
 2531|   259k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2532|   259k|                res_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_t3_8x16b);
 2533|   259k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
 2534|   259k|                res_t0_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
 2535|       |
 2536|   259k|                src_r0r1_16x8b = _mm_unpackhi_epi8(src_r1_16x8b, src_r2_16x8b);
 2537|   259k|                src_r2r3_16x8b = _mm_unpackhi_epi8(src_r3_16x8b, src_r4_16x8b);
 2538|   259k|                src_r4r5_16x8b = _mm_unpackhi_epi8(src_r5_16x8b, src_r6_16x8b);
 2539|       |
 2540|   259k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2541|   259k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2542|   259k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2543|       |
 2544|   259k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2545|   259k|                res_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_t3_8x16b);
 2546|   259k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t3_8x16b);
 2547|   259k|                res_t1_8x16b = _mm_srai_epi16(res_t1_8x16b, 5); //shifting right by 5 bits.
 2548|       |
 2549|   259k|                res_16x8b = _mm_packus_epi16(res_t0_8x16b, res_t1_8x16b);
 2550|       |
 2551|   259k|                _mm_storeu_si128((__m128i *)(pu1_tmp1 + 16), res_16x8b);
 2552|       |
 2553|   259k|                src_r0_16x8b = src_r2_16x8b;
 2554|   259k|                src_r1_16x8b = src_r3_16x8b;
 2555|   259k|                src_r2_16x8b = src_r4_16x8b;
 2556|   259k|                src_r3_16x8b = src_r5_16x8b;
 2557|   259k|                src_r4_16x8b = src_r6_16x8b;
 2558|       |
 2559|   259k|                ht_temp -= 2;
 2560|   259k|                pu1_pred_vert += src_strd << 1;
 2561|   259k|                pu1_tmp1 += 32;
 2562|   259k|            }
 2563|   259k|            while(ht_temp > 0);
  ------------------
  |  Branch (2563:19): [True: 219k, False: 40.2k]
  ------------------
 2564|  40.2k|        }
 2565|       |        //horizontal q-pel filter
 2566|  40.2k|        {
 2567|  40.2k|            __m128i src_r0_16x8b, src_r1_16x8b, src_r0_sht_16x8b, src_r1_sht_16x8b;
 2568|  40.2k|            __m128i src_r0_t1_16x8b, src_r1_t1_16x8b;
 2569|  40.2k|            __m128i src_vpel_16x8b;
 2570|       |
 2571|  40.2k|            __m128i res_r0_t1_8x16b, res_r0_t2_8x16b, res_r0_t3_8x16b;
 2572|  40.2k|            __m128i res_r1_t1_8x16b, res_r1_t2_8x16b, res_r1_t3_8x16b;
 2573|  40.2k|            __m128i res_16x8b;
 2574|       |
 2575|       |            //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
 2576|       |            //Row0 :                         b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
 2577|       |            //b0 is same a8. Similarly other bn pixels are same as a(n+8) pixels.
 2578|       |
 2579|  40.2k|            do
 2580|   519k|            {
 2581|   519k|                src_r0_16x8b = _mm_loadu_si128((__m128i *)(pu1_pred_horiz));             //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
 2582|   519k|                src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_pred_horiz + 8));         //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9....b15
 2583|   519k|                src_vpel_16x8b = _mm_loadu_si128((__m128i *)(pu1_tmp2));
 2584|       |
 2585|   519k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                      //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
 2586|   519k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                      //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
 2587|       |
 2588|   519k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
 2589|   519k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
 2590|       |
 2591|   519k|                res_r0_t1_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff0_1_16x8b);    //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
 2592|       |                                                                                         //a4*c0+a5*c1 a5*c0+a6*c1 a6*c0+a7*c1 a7*c0+a8*c1
 2593|   519k|                res_r1_t1_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff0_1_16x8b);    //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
 2594|       |                                                                                         //b4*c0+b5*c1 b5*c0+b6*c1 b6*c0+b7*c1 b7*c0+b8*c1
 2595|       |
 2596|   519k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                          //a2 a3 a4 a5 a6 a7 a8 a9....a15 0 0
 2597|   519k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                          //b2 b3 b4 b5 b6 b7 b8 b9....b15 0 0
 2598|       |
 2599|   519k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                  //a3 a4 a5 a6 a7 a8 a9....a15 0  0  0
 2600|   519k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                  //b3 b4 b5 b6 b7 b8 b9....b15 0  0  0
 2601|       |
 2602|   519k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10
 2603|   519k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8 a8 a9 a9 a10
 2604|       |
 2605|   519k|                res_r0_t2_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff2_3_16x8b);    //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
 2606|       |                                                                                         //a6*c2+a7*c3 a7*c2+a8*c3 a8*c2+a9*c3 a9*c2+a10*c3
 2607|   519k|                res_r1_t2_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff2_3_16x8b);    //b2*c2+b3*c3 b3*c2+b4*c3 b2*c4+b5*c3 b5*c2+b6*c3
 2608|       |                                                                                         //b6*c2+b7*c3 b7*c2+b8*c3 b8*c2+b9*c3 b9*c2+b10*c3
 2609|       |
 2610|   519k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                          //a4 a5 a6 a7 a8 a9....a15 0  0  0  0
 2611|   519k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                          //b4 b5 b6 b7 b8 b9....b15 0  0  0  0
 2612|       |
 2613|   519k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                  //a5 a6 a7 a8 a9....a15 0  0  0  0  0
 2614|   519k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                  //b5 b6 b7 b8 b9....b15 0  0  0  0  0
 2615|       |
 2616|   519k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);     //a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10 a10 a11 a11 a12
 2617|   519k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);     //b4 b5 b5 b6 b6 b7 b7 b8 b8 b9 b9 b10 b10 b11 b11 b12
 2618|       |
 2619|   519k|                res_r0_t3_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff4_5_16x8b);    //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
 2620|       |                                                                                         //a8*c4+a9*c5 a9*c4+a10*c5 a10*c4+a11*c5 a11*c4+a12*c5
 2621|   519k|                res_r1_t3_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff4_5_16x8b);    //b4*c4+b5*c5 b5*c4+b6*c5 b6*c4+b7*c5 b7*c4+b8*c5
 2622|       |                                                                                         //b8*c4+b9*c5 b9*c4+b10*c5 b10*c4+b11*c5 b11*c4+b12*c5
 2623|   519k|                res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t2_8x16b);
 2624|   519k|                res_r0_t3_8x16b = _mm_add_epi16(const_val16_8x16b, res_r0_t3_8x16b);
 2625|   519k|                res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t3_8x16b);
 2626|   519k|                res_r0_t1_8x16b = _mm_srai_epi16(res_r0_t1_8x16b, 5);                    //shifting right by 5 bits.
 2627|       |
 2628|   519k|                res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t2_8x16b);
 2629|   519k|                res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t3_8x16b);
 2630|   519k|                res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, const_val16_8x16b);
 2631|   519k|                res_r1_t1_8x16b = _mm_srai_epi16(res_r1_t1_8x16b, 5);                    //shifting right by 5 bits.
 2632|       |
 2633|   519k|                res_16x8b = _mm_packus_epi16(res_r0_t1_8x16b, res_r1_t1_8x16b);
 2634|       |
 2635|   519k|                res_16x8b = _mm_avg_epu8(res_16x8b, src_vpel_16x8b);
 2636|   519k|                _mm_storeu_si128((__m128i *)(pu1_dst), res_16x8b);
 2637|       |
 2638|   519k|                ht --;
 2639|   519k|                pu1_pred_horiz  += src_strd;
 2640|   519k|                pu1_dst += dst_strd;
 2641|   519k|                pu1_tmp2 += 16;
 2642|   519k|            }
 2643|   519k|            while(ht > 0);
  ------------------
  |  Branch (2643:19): [True: 479k, False: 40.2k]
  ------------------
 2644|  40.2k|        }
 2645|  40.2k|    }
 2646|  86.5k|}
ih264_inter_pred_luma_horz_qpel_vert_hpel_ssse3:
 2686|  32.5k|{
 2687|  32.5k|    WORD32 ht_temp;
 2688|  32.5k|    WORD32 x_offset;
 2689|  32.5k|    WORD32 off0,off1, off2, off3, off4, off5;
 2690|  32.5k|    WORD16 *pi2_temp1,*pi2_temp2,*pi2_temp3;
 2691|       |
 2692|  32.5k|    ht_temp = ht;
 2693|  32.5k|    x_offset = dydx & 0x3;
 2694|  32.5k|    pi2_temp1 = (WORD16 *)pu1_tmp;
 2695|  32.5k|    pi2_temp2 = pi2_temp1;
 2696|  32.5k|    pi2_temp3 = pi2_temp1 + (x_offset >> 1);
 2697|       |
 2698|  32.5k|    pu1_src -= 2 * src_strd;
 2699|  32.5k|    pu1_src -= 2;
 2700|  32.5k|    pi2_temp3 += 2;
 2701|       |    //the filter input starts from x[-2] (till x[3])
 2702|       |
 2703|  32.5k|    if(wd == 4)
  ------------------
  |  Branch (2703:8): [True: 5.49k, False: 27.0k]
  ------------------
 2704|  5.49k|    {
 2705|       |        //vertical half-pel
 2706|  5.49k|        {
 2707|  5.49k|            __m128i src_r0_16x8b, src_r1_16x8b, src_r2_16x8b, src_r3_16x8b, src_r4_16x8b;
 2708|  5.49k|            __m128i src_r5_16x8b, src_r6_16x8b;
 2709|  5.49k|            __m128i src_r0r1_16x8b, src_r2r3_16x8b, src_r4r5_16x8b;
 2710|       |
 2711|  5.49k|            __m128i res_t1_8x16b, res_t2_8x16b, res_t3_8x16b;
 2712|       |
 2713|  5.49k|            __m128i coeff0_1_16x8b, coeff2_3_16x8b, coeff4_5_16x8b;
 2714|       |
 2715|  5.49k|            coeff0_1_16x8b = _mm_set1_epi32(0xFB01FB01);  //c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1
 2716|  5.49k|            coeff2_3_16x8b = _mm_set1_epi32(0x14141414);  //c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3
 2717|  5.49k|            coeff4_5_16x8b = _mm_set1_epi32(0x01FB01FB);  //c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5
 2718|       |                                                          //c0 = c5 = 1, c1 = c4 = -5, c2 = c3 = 20
 2719|  5.49k|            off0 = -((src_strd << 2) + src_strd) + 8;
 2720|  5.49k|            off1 = -(src_strd << 2) + 8;
 2721|  5.49k|            off2 = -((src_strd << 1) + src_strd) + 8;
 2722|  5.49k|            off3 = -(src_strd << 1) + 8;
 2723|  5.49k|            off4 = -src_strd + 8;
 2724|  5.49k|            off5 = 8;
 2725|       |
 2726|       |            //epilogue: Load all the pred rows except sixth  and seventh row for the
 2727|       |            //first and second row processing.
 2728|  5.49k|            src_r0_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 2729|  5.49k|            pu1_src =  pu1_src + src_strd;
 2730|       |
 2731|  5.49k|            src_r1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 2732|  5.49k|            pu1_src =  pu1_src + src_strd;
 2733|       |
 2734|  5.49k|            src_r2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 2735|  5.49k|            pu1_src =  pu1_src + src_strd;
 2736|       |
 2737|  5.49k|            src_r3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 2738|  5.49k|            pu1_src =  pu1_src + src_strd;
 2739|       |
 2740|  5.49k|            src_r4_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 2741|  5.49k|            pu1_src =  pu1_src + src_strd;
 2742|       |
 2743|       |            //Core Loop: Process all the rows.
 2744|  5.49k|            do
 2745|  18.2k|            {
 2746|  18.2k|                src_r5_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 2747|       |
 2748|  18.2k|                src_r0r1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r1_16x8b);
 2749|  18.2k|                src_r2r3_16x8b = _mm_unpacklo_epi8(src_r2_16x8b, src_r3_16x8b);
 2750|  18.2k|                src_r4r5_16x8b = _mm_unpacklo_epi8(src_r4_16x8b, src_r5_16x8b);
 2751|       |
 2752|  18.2k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2753|  18.2k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2754|  18.2k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2755|       |
 2756|  18.2k|                res_t1_8x16b = _mm_add_epi16(res_t2_8x16b, res_t1_8x16b);
 2757|  18.2k|                res_t1_8x16b = _mm_add_epi16(res_t3_8x16b, res_t1_8x16b);
 2758|       |
 2759|  18.2k|                _mm_storeu_si128((__m128i *)(pi2_temp1), res_t1_8x16b);
 2760|       |
 2761|  18.2k|                pi2_temp1[8] = pu1_src[off0] + pu1_src[off5]
 2762|  18.2k|                                   - (pu1_src[off1] + pu1_src[off4])
 2763|  18.2k|                                   + ((pu1_src[off2] + pu1_src[off3] - pu1_src[off1] - pu1_src[off4]) << 2)
 2764|  18.2k|                                   + ((pu1_src[off2] + pu1_src[off3]) << 4);
 2765|       |
 2766|  18.2k|                pu1_src = pu1_src + src_strd;
 2767|  18.2k|                pi2_temp1 = pi2_temp1 + 9;
 2768|       |
 2769|  18.2k|                src_r6_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src));
 2770|       |
 2771|  18.2k|                src_r0r1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r2_16x8b);
 2772|  18.2k|                src_r2r3_16x8b = _mm_unpacklo_epi8(src_r3_16x8b, src_r4_16x8b);
 2773|  18.2k|                src_r4r5_16x8b = _mm_unpacklo_epi8(src_r5_16x8b, src_r6_16x8b);
 2774|       |
 2775|  18.2k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2776|  18.2k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2777|  18.2k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2778|       |
 2779|  18.2k|                res_t1_8x16b = _mm_add_epi16(res_t2_8x16b, res_t1_8x16b);
 2780|  18.2k|                res_t1_8x16b = _mm_add_epi16(res_t3_8x16b, res_t1_8x16b);
 2781|       |
 2782|  18.2k|                _mm_storeu_si128((__m128i *)(pi2_temp1), res_t1_8x16b);
 2783|       |
 2784|  18.2k|                pi2_temp1[8] = pu1_src[off0] + pu1_src[off5]
 2785|  18.2k|                                   - (pu1_src[off1] + pu1_src[off4])
 2786|  18.2k|                                   + ((pu1_src[off2] + pu1_src[off3] - pu1_src[off1] - pu1_src[off4]) << 2)
 2787|  18.2k|                                   + ((pu1_src[off2] + pu1_src[off3]) << 4);
 2788|       |
 2789|  18.2k|                ht_temp -= 2;
 2790|  18.2k|                pu1_src = pu1_src + src_strd;
 2791|  18.2k|                pi2_temp1 = pi2_temp1 + 9;
 2792|       |
 2793|  18.2k|                src_r0_16x8b = src_r2_16x8b;
 2794|  18.2k|                src_r1_16x8b = src_r3_16x8b;
 2795|  18.2k|                src_r2_16x8b = src_r4_16x8b;
 2796|  18.2k|                src_r3_16x8b = src_r5_16x8b;
 2797|  18.2k|                src_r4_16x8b = src_r6_16x8b;
 2798|  18.2k|            }
 2799|  18.2k|            while(ht_temp > 0);
  ------------------
  |  Branch (2799:19): [True: 12.7k, False: 5.49k]
  ------------------
 2800|  5.49k|        }
 2801|       |
 2802|       |        //horizontal q-pel
 2803|  5.49k|        {
 2804|  5.49k|            __m128i src_r0_8x16b, src_r1_8x16b, src_r2_8x16b;
 2805|  5.49k|            __m128i src_r3_8x16b, src_r4_8x16b, src_r5_8x16b;
 2806|  5.49k|            __m128i src_r0r1_c0_8x16b, src_r2r3_c0_8x16b, src_r4r5_c0_8x16b;
 2807|  5.49k|            __m128i src_hpel_16x8b, src_hpel_8x16b;
 2808|       |
 2809|  5.49k|            __m128i res_t1_4x32b, res_t2_4x32b, res_t3_4x32b;
 2810|  5.49k|            __m128i res_8x16b, res_16x8b;
 2811|       |
 2812|  5.49k|            __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b;
 2813|  5.49k|            __m128i const_val512_4x32b, const_val16_8x16b;
 2814|       |
 2815|  5.49k|            coeff0_1_8x16b = _mm_set1_epi32(0xFFFB0001);
 2816|  5.49k|            coeff2_3_8x16b = _mm_set1_epi32(0x00140014);
 2817|  5.49k|            coeff4_5_8x16b = _mm_set1_epi32(0x0001FFFB);
 2818|       |
 2819|  5.49k|            const_val512_4x32b = _mm_set1_epi32(512);
 2820|  5.49k|            const_val16_8x16b = _mm_set1_epi16(16);
 2821|       |
 2822|  5.49k|            do
 2823|  36.4k|            {
 2824|  36.4k|                src_r0_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp2));
 2825|  36.4k|                src_r1_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 1));
 2826|  36.4k|                src_r2_8x16b = _mm_srli_si128(src_r1_8x16b, 2);
 2827|  36.4k|                src_r3_8x16b = _mm_srli_si128(src_r1_8x16b, 4);
 2828|  36.4k|                src_r4_8x16b = _mm_srli_si128(src_r1_8x16b, 6);
 2829|  36.4k|                src_r5_8x16b = _mm_srli_si128(src_r1_8x16b, 8);
 2830|       |
 2831|  36.4k|                src_r0r1_c0_8x16b = _mm_unpacklo_epi16(src_r0_8x16b, src_r1_8x16b);
 2832|  36.4k|                src_r2r3_c0_8x16b = _mm_unpacklo_epi16(src_r2_8x16b, src_r3_8x16b);
 2833|  36.4k|                src_r4r5_c0_8x16b = _mm_unpacklo_epi16(src_r4_8x16b, src_r5_8x16b);
 2834|       |
 2835|  36.4k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_c0_8x16b, coeff0_1_8x16b);
 2836|  36.4k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_c0_8x16b, coeff2_3_8x16b);
 2837|  36.4k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_c0_8x16b, coeff4_5_8x16b);
 2838|       |
 2839|  36.4k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 2840|  36.4k|                res_t3_4x32b = _mm_add_epi32(const_val512_4x32b, res_t3_4x32b);
 2841|  36.4k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 2842|  36.4k|                res_t1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 2843|       |
 2844|  36.4k|                res_8x16b = _mm_packs_epi32(res_t1_4x32b, res_t1_4x32b);
 2845|  36.4k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 2846|       |
 2847|  36.4k|                src_hpel_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp3));
 2848|  36.4k|                src_hpel_8x16b = _mm_add_epi16(src_hpel_8x16b, const_val16_8x16b);
 2849|  36.4k|                src_hpel_8x16b = _mm_srai_epi16(src_hpel_8x16b, 5); //shifting right by 5 bits.
 2850|  36.4k|                src_hpel_16x8b = _mm_packus_epi16(src_hpel_8x16b, src_hpel_8x16b);
 2851|       |
 2852|  36.4k|                res_16x8b = _mm_avg_epu8(res_16x8b, src_hpel_16x8b);
 2853|       |
 2854|  36.4k|                *((WORD32 *)(pu1_dst)) = _mm_cvtsi128_si32(res_16x8b);
 2855|       |
 2856|  36.4k|                ht--;
 2857|  36.4k|                pi2_temp2 = pi2_temp2 + 4 + 5;
 2858|  36.4k|                pi2_temp3 = pi2_temp3 + 4 + 5;
 2859|  36.4k|                pu1_dst = pu1_dst + dst_strd;
 2860|  36.4k|            }
 2861|  36.4k|            while(ht > 0);
  ------------------
  |  Branch (2861:19): [True: 30.9k, False: 5.49k]
  ------------------
 2862|  5.49k|        }
 2863|  5.49k|    }
 2864|  27.0k|    else if(wd == 8)
  ------------------
  |  Branch (2864:13): [True: 15.6k, False: 11.3k]
  ------------------
 2865|  15.6k|    {
 2866|       |        // vertical half-pel
 2867|  15.6k|        {
 2868|  15.6k|            __m128i src_r0_16x8b, src_r1_16x8b, src_r2_16x8b, src_r3_16x8b, src_r4_16x8b;
 2869|  15.6k|            __m128i src_r5_16x8b, src_r6_16x8b;
 2870|  15.6k|            __m128i src_r0r1_16x8b, src_r2r3_16x8b, src_r4r5_16x8b;
 2871|       |
 2872|  15.6k|            __m128i res_t1_8x16b, res_t2_8x16b, res_t3_8x16b;
 2873|       |
 2874|  15.6k|            __m128i coeff0_1_16x8b, coeff2_3_16x8b, coeff4_5_16x8b;
 2875|       |
 2876|  15.6k|            coeff0_1_16x8b = _mm_set1_epi32(0xFB01FB01);  //c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1
 2877|  15.6k|            coeff2_3_16x8b = _mm_set1_epi32(0x14141414);  //c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3
 2878|  15.6k|            coeff4_5_16x8b = _mm_set1_epi32(0x01FB01FB);  //c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5
 2879|       |
 2880|       |            //epilogue: Load all the pred rows except sixth  and seventh row for the
 2881|       |            //first and second row processing.
 2882|  15.6k|            src_r0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));
 2883|  15.6k|            pu1_src =  pu1_src + src_strd;
 2884|       |
 2885|  15.6k|            src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));
 2886|  15.6k|            pu1_src =  pu1_src + src_strd;
 2887|       |
 2888|  15.6k|            src_r2_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));
 2889|  15.6k|            pu1_src =  pu1_src + src_strd;
 2890|       |
 2891|  15.6k|            src_r3_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));
 2892|  15.6k|            pu1_src =  pu1_src + src_strd;
 2893|       |
 2894|  15.6k|            src_r4_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));
 2895|  15.6k|            pu1_src =  pu1_src + src_strd;
 2896|       |
 2897|       |            //Core Loop: Process all the rows.
 2898|  15.6k|            do
 2899|  79.1k|            {
 2900|  79.1k|                src_r5_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));
 2901|  79.1k|                src_r6_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));
 2902|       |
 2903|  79.1k|                src_r0r1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r1_16x8b);
 2904|  79.1k|                src_r2r3_16x8b = _mm_unpacklo_epi8(src_r2_16x8b, src_r3_16x8b);
 2905|  79.1k|                src_r4r5_16x8b = _mm_unpacklo_epi8(src_r4_16x8b, src_r5_16x8b);
 2906|       |
 2907|  79.1k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2908|  79.1k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2909|  79.1k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2910|       |
 2911|  79.1k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2912|  79.1k|                res_t1_8x16b = _mm_add_epi16(res_t3_8x16b, res_t1_8x16b);
 2913|       |
 2914|  79.1k|                _mm_storeu_si128((__m128i *)(pi2_temp1), res_t1_8x16b);
 2915|       |
 2916|  79.1k|                src_r0r1_16x8b = _mm_unpackhi_epi8(src_r0_16x8b, src_r1_16x8b);
 2917|  79.1k|                src_r2r3_16x8b = _mm_unpackhi_epi8(src_r2_16x8b, src_r3_16x8b);
 2918|  79.1k|                src_r4r5_16x8b = _mm_unpackhi_epi8(src_r4_16x8b, src_r5_16x8b);
 2919|       |
 2920|  79.1k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2921|  79.1k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2922|  79.1k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2923|       |
 2924|  79.1k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2925|  79.1k|                res_t1_8x16b = _mm_add_epi16(res_t3_8x16b, res_t1_8x16b);
 2926|       |
 2927|  79.1k|                _mm_storeu_si128((__m128i *)(pi2_temp1 + 8), res_t1_8x16b);
 2928|       |
 2929|  79.1k|                src_r0r1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r2_16x8b);
 2930|  79.1k|                src_r2r3_16x8b = _mm_unpacklo_epi8(src_r3_16x8b, src_r4_16x8b);
 2931|  79.1k|                src_r4r5_16x8b = _mm_unpacklo_epi8(src_r5_16x8b, src_r6_16x8b);
 2932|       |
 2933|  79.1k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2934|  79.1k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2935|  79.1k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2936|       |
 2937|  79.1k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2938|  79.1k|                res_t1_8x16b = _mm_add_epi16(res_t3_8x16b, res_t1_8x16b);
 2939|       |
 2940|  79.1k|                _mm_storeu_si128((__m128i *)(pi2_temp1 + 8 + 5), res_t1_8x16b);
 2941|       |
 2942|  79.1k|                src_r0r1_16x8b = _mm_unpackhi_epi8(src_r1_16x8b, src_r2_16x8b);
 2943|  79.1k|                src_r2r3_16x8b = _mm_unpackhi_epi8(src_r3_16x8b, src_r4_16x8b);
 2944|  79.1k|                src_r4r5_16x8b = _mm_unpackhi_epi8(src_r5_16x8b, src_r6_16x8b);
 2945|       |
 2946|  79.1k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 2947|  79.1k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 2948|  79.1k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 2949|       |
 2950|  79.1k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 2951|  79.1k|                res_t1_8x16b = _mm_add_epi16(res_t3_8x16b, res_t1_8x16b);
 2952|       |
 2953|  79.1k|                _mm_storeu_si128((__m128i *)(pi2_temp1 + 8 + 5 + 8), res_t1_8x16b);
 2954|       |
 2955|  79.1k|                src_r0_16x8b = src_r2_16x8b;
 2956|  79.1k|                src_r1_16x8b = src_r3_16x8b;
 2957|  79.1k|                src_r2_16x8b = src_r4_16x8b;
 2958|  79.1k|                src_r3_16x8b = src_r5_16x8b;
 2959|  79.1k|                src_r4_16x8b = src_r6_16x8b;
 2960|       |
 2961|  79.1k|                ht_temp -= 2;
 2962|  79.1k|                pu1_src =  pu1_src + (src_strd << 1);
 2963|  79.1k|                pi2_temp1 = pi2_temp1 + (13 << 1);
 2964|  79.1k|            }
 2965|  79.1k|            while(ht_temp > 0);
  ------------------
  |  Branch (2965:19): [True: 63.4k, False: 15.6k]
  ------------------
 2966|  15.6k|        }
 2967|       |        // horizontal q-pel
 2968|  15.6k|        {
 2969|  15.6k|            __m128i src_r0_8x16b, src_r1_8x16b, src_r2_8x16b, src_r3_8x16b;
 2970|  15.6k|            __m128i src_r4_8x16b, src_r5_8x16b;
 2971|  15.6k|            __m128i src_r0r1_c0_8x16b, src_r2r3_c0_8x16b, src_r4r5_c0_8x16b;
 2972|  15.6k|            __m128i src_r0r1_c1_8x16b, src_r2r3_c1_8x16b, src_r4r5_c1_8x16b;
 2973|  15.6k|            __m128i src_hpel_8x16b, src_hpel_16x8b;
 2974|       |
 2975|  15.6k|            __m128i res_t0_4x32b, res_t1_4x32b, res_t2_4x32b, res_t3_4x32b;
 2976|  15.6k|            __m128i res_8x16b, res_16x8b;
 2977|       |
 2978|  15.6k|            __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b;
 2979|  15.6k|            __m128i const_val512_4x32b, const_val16_8x16b;
 2980|       |
 2981|  15.6k|            coeff0_1_8x16b = _mm_set1_epi32(0xFFFB0001);
 2982|  15.6k|            coeff2_3_8x16b = _mm_set1_epi32(0x00140014);
 2983|  15.6k|            coeff4_5_8x16b = _mm_set1_epi32(0x0001FFFB);
 2984|       |
 2985|  15.6k|            const_val512_4x32b = _mm_set1_epi32(512);
 2986|  15.6k|            const_val16_8x16b = _mm_set1_epi16(16);
 2987|       |
 2988|  15.6k|            do
 2989|   158k|            {
 2990|   158k|                src_r0_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2));
 2991|   158k|                src_r1_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 1));
 2992|   158k|                src_r2_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 2));
 2993|   158k|                src_r3_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 3));
 2994|   158k|                src_r4_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 4));
 2995|   158k|                src_r5_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 5));
 2996|       |
 2997|   158k|                src_r0r1_c0_8x16b = _mm_unpacklo_epi16(src_r0_8x16b, src_r1_8x16b);
 2998|   158k|                src_r2r3_c0_8x16b = _mm_unpacklo_epi16(src_r2_8x16b, src_r3_8x16b);
 2999|   158k|                src_r4r5_c0_8x16b = _mm_unpacklo_epi16(src_r4_8x16b, src_r5_8x16b);
 3000|       |
 3001|   158k|                src_r0r1_c1_8x16b = _mm_unpackhi_epi16(src_r0_8x16b, src_r1_8x16b);
 3002|   158k|                src_r2r3_c1_8x16b = _mm_unpackhi_epi16(src_r2_8x16b, src_r3_8x16b);
 3003|   158k|                src_r4r5_c1_8x16b = _mm_unpackhi_epi16(src_r4_8x16b, src_r5_8x16b);
 3004|       |
 3005|   158k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_c0_8x16b, coeff0_1_8x16b);
 3006|   158k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_c0_8x16b, coeff2_3_8x16b);
 3007|   158k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_c0_8x16b, coeff4_5_8x16b);
 3008|       |
 3009|   158k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3010|   158k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3011|   158k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3012|       |
 3013|   158k|                res_t0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3014|       |
 3015|   158k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_c1_8x16b, coeff0_1_8x16b);
 3016|   158k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_c1_8x16b, coeff2_3_8x16b);
 3017|   158k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_c1_8x16b, coeff4_5_8x16b);
 3018|       |
 3019|   158k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3020|   158k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3021|   158k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3022|       |
 3023|   158k|                res_t1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3024|       |
 3025|   158k|                res_8x16b = _mm_packs_epi32(res_t0_4x32b, res_t1_4x32b);
 3026|   158k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 3027|       |
 3028|   158k|                src_hpel_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp3));
 3029|   158k|                src_hpel_8x16b = _mm_add_epi16(src_hpel_8x16b, const_val16_8x16b);
 3030|   158k|                src_hpel_8x16b = _mm_srai_epi16(src_hpel_8x16b, 5); //shifting right by 5 bits.
 3031|   158k|                src_hpel_16x8b = _mm_packus_epi16(src_hpel_8x16b, src_hpel_8x16b);
 3032|       |
 3033|   158k|                res_16x8b = _mm_avg_epu8(res_16x8b, src_hpel_16x8b);
 3034|       |
 3035|   158k|                _mm_storel_epi64((__m128i *)(pu1_dst), res_16x8b);
 3036|       |
 3037|   158k|                ht--;
 3038|   158k|                pi2_temp2 = pi2_temp2 + 8 + 5;
 3039|   158k|                pi2_temp3 = pi2_temp3 + 8 + 5;
 3040|   158k|                pu1_dst = pu1_dst + dst_strd;
 3041|   158k|            }
 3042|   158k|            while(ht > 0);
  ------------------
  |  Branch (3042:19): [True: 142k, False: 15.6k]
  ------------------
 3043|  15.6k|        }
 3044|  15.6k|    }
 3045|  11.3k|    else // wd == 16
 3046|  11.3k|    {
 3047|       |        // vertical half-pel
 3048|  11.3k|        {
 3049|  11.3k|            __m128i src_r0_16x8b, src_r1_16x8b, src_r2_16x8b, src_r3_16x8b;
 3050|  11.3k|            __m128i src_r4_16x8b, src_r5_16x8b;
 3051|  11.3k|            __m128i src_r0_c2_16x8b, src_r1_c2_16x8b, src_r2_c2_16x8b, src_r3_c2_16x8b;
 3052|  11.3k|            __m128i src_r4_c2_16x8b, src_r5_c2_16x8b;
 3053|  11.3k|            __m128i src_r0r1_16x8b, src_r2r3_16x8b, src_r4r5_16x8b;
 3054|       |
 3055|  11.3k|            __m128i res_t1_8x16b, res_t2_8x16b, res_t3_8x16b;
 3056|       |
 3057|  11.3k|            __m128i coeff0_1_16x8b,coeff2_3_16x8b,coeff4_5_16x8b;
 3058|       |
 3059|  11.3k|            coeff0_1_16x8b = _mm_set1_epi32(0xFB01FB01);  //c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1
 3060|  11.3k|            coeff2_3_16x8b = _mm_set1_epi32(0x14141414);  //c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3
 3061|  11.3k|            coeff4_5_16x8b = _mm_set1_epi32(0x01FB01FB);  //c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5
 3062|       |
 3063|  11.3k|            src_r0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));
 3064|  11.3k|            src_r0_c2_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 16));
 3065|  11.3k|            pu1_src =  pu1_src + src_strd;
 3066|  11.3k|            src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));
 3067|  11.3k|            src_r1_c2_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 16));
 3068|  11.3k|            pu1_src =  pu1_src + src_strd;
 3069|  11.3k|            src_r2_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));
 3070|  11.3k|            src_r2_c2_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 16));
 3071|  11.3k|            pu1_src =  pu1_src + src_strd;
 3072|  11.3k|            src_r3_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));
 3073|  11.3k|            src_r3_c2_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 16));
 3074|  11.3k|            pu1_src =  pu1_src + src_strd;
 3075|  11.3k|            src_r4_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));
 3076|  11.3k|            src_r4_c2_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 16));
 3077|  11.3k|            pu1_src =  pu1_src + src_strd;
 3078|       |
 3079|       |            //Core Loop: Process all the rows.
 3080|  11.3k|            do
 3081|   141k|            {
 3082|   141k|                src_r5_16x8b  = _mm_loadu_si128((__m128i *)(pu1_src));
 3083|   141k|                src_r5_c2_16x8b  = _mm_loadu_si128((__m128i *)(pu1_src + 16));
 3084|       |
 3085|   141k|                src_r0r1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r1_16x8b);
 3086|   141k|                src_r2r3_16x8b = _mm_unpacklo_epi8(src_r2_16x8b, src_r3_16x8b);
 3087|   141k|                src_r4r5_16x8b = _mm_unpacklo_epi8(src_r4_16x8b, src_r5_16x8b);
 3088|       |
 3089|   141k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 3090|   141k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 3091|   141k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 3092|       |
 3093|   141k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 3094|   141k|                res_t1_8x16b = _mm_add_epi16(res_t3_8x16b, res_t1_8x16b);
 3095|       |
 3096|   141k|                _mm_storeu_si128((__m128i *)(pi2_temp1), res_t1_8x16b);
 3097|       |
 3098|   141k|                src_r0r1_16x8b = _mm_unpackhi_epi8(src_r0_16x8b, src_r1_16x8b);
 3099|   141k|                src_r2r3_16x8b = _mm_unpackhi_epi8(src_r2_16x8b, src_r3_16x8b);
 3100|   141k|                src_r4r5_16x8b = _mm_unpackhi_epi8(src_r4_16x8b, src_r5_16x8b);
 3101|       |
 3102|   141k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 3103|   141k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 3104|   141k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 3105|       |
 3106|   141k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 3107|   141k|                res_t1_8x16b = _mm_add_epi16(res_t3_8x16b, res_t1_8x16b);
 3108|       |
 3109|   141k|                _mm_storeu_si128((__m128i *)(pi2_temp1 + 8), res_t1_8x16b);
 3110|       |
 3111|   141k|                src_r0r1_16x8b = _mm_unpacklo_epi8(src_r0_c2_16x8b, src_r1_c2_16x8b);
 3112|   141k|                src_r2r3_16x8b = _mm_unpacklo_epi8(src_r2_c2_16x8b, src_r3_c2_16x8b);
 3113|   141k|                src_r4r5_16x8b = _mm_unpacklo_epi8(src_r4_c2_16x8b, src_r5_c2_16x8b);
 3114|       |
 3115|   141k|                res_t1_8x16b = _mm_maddubs_epi16(src_r0r1_16x8b, coeff0_1_16x8b);
 3116|   141k|                res_t2_8x16b = _mm_maddubs_epi16(src_r2r3_16x8b, coeff2_3_16x8b);
 3117|   141k|                res_t3_8x16b = _mm_maddubs_epi16(src_r4r5_16x8b, coeff4_5_16x8b);
 3118|       |
 3119|   141k|                res_t1_8x16b = _mm_add_epi16(res_t1_8x16b, res_t2_8x16b);
 3120|   141k|                res_t1_8x16b = _mm_add_epi16(res_t3_8x16b, res_t1_8x16b);
 3121|       |
 3122|   141k|                _mm_storeu_si128((__m128i *)(pi2_temp1 + 16), res_t1_8x16b);
 3123|       |
 3124|   141k|                src_r0_16x8b = src_r1_16x8b;
 3125|   141k|                src_r1_16x8b = src_r2_16x8b;
 3126|   141k|                src_r2_16x8b = src_r3_16x8b;
 3127|   141k|                src_r3_16x8b = src_r4_16x8b;
 3128|   141k|                src_r4_16x8b = src_r5_16x8b;
 3129|       |
 3130|   141k|                src_r0_c2_16x8b = src_r1_c2_16x8b;
 3131|   141k|                src_r1_c2_16x8b = src_r2_c2_16x8b;
 3132|   141k|                src_r2_c2_16x8b = src_r3_c2_16x8b;
 3133|   141k|                src_r3_c2_16x8b = src_r4_c2_16x8b;
 3134|   141k|                src_r4_c2_16x8b = src_r5_c2_16x8b;
 3135|       |
 3136|   141k|                ht_temp--;
 3137|   141k|                pu1_src =  pu1_src + src_strd;
 3138|   141k|                pi2_temp1 =  pi2_temp1 + 16 + 5;
 3139|   141k|            }
 3140|   141k|            while(ht_temp > 0);
  ------------------
  |  Branch (3140:19): [True: 130k, False: 11.3k]
  ------------------
 3141|  11.3k|        }
 3142|       |        // horizontal q-pel
 3143|  11.3k|        {
 3144|  11.3k|            __m128i src_r0_8x16b, src_r1_8x16b, src_r2_8x16b, src_r3_8x16b;
 3145|  11.3k|            __m128i src_r4_8x16b, src_r5_8x16b;
 3146|  11.3k|            __m128i src_r0r1_8x16b, src_r2r3_8x16b, src_r4r5_8x16b;
 3147|  11.3k|            __m128i src_hpel1_8x16b, src_hpel2_8x16b, src_hpel_16x8b;
 3148|       |
 3149|  11.3k|            __m128i res_t0_4x32b, res_t1_4x32b, res_t2_4x32b, res_t3_4x32b;
 3150|  11.3k|            __m128i res_c0_8x16b, res_c1_8x16b, res_16x8b;
 3151|       |
 3152|  11.3k|            __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b;
 3153|  11.3k|            __m128i const_val512_4x32b, const_val16_8x16b;
 3154|       |
 3155|  11.3k|            coeff0_1_8x16b = _mm_set1_epi32(0xFFFB0001);
 3156|  11.3k|            coeff2_3_8x16b = _mm_set1_epi32(0x00140014);
 3157|  11.3k|            coeff4_5_8x16b = _mm_set1_epi32(0x0001FFFB);
 3158|       |
 3159|  11.3k|            const_val512_4x32b = _mm_set1_epi32(512);
 3160|  11.3k|            const_val16_8x16b = _mm_set1_epi16(16);
 3161|       |
 3162|  11.3k|            do
 3163|   141k|            {
 3164|   141k|                src_r0_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2));
 3165|   141k|                src_r1_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 1));
 3166|   141k|                src_r2_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 2));
 3167|   141k|                src_r3_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 3));
 3168|   141k|                src_r4_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 4));
 3169|   141k|                src_r5_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 5));
 3170|       |
 3171|   141k|                src_r0r1_8x16b = _mm_unpacklo_epi16(src_r0_8x16b, src_r1_8x16b);
 3172|   141k|                src_r2r3_8x16b = _mm_unpacklo_epi16(src_r2_8x16b, src_r3_8x16b);
 3173|   141k|                src_r4r5_8x16b = _mm_unpacklo_epi16(src_r4_8x16b, src_r5_8x16b);
 3174|       |
 3175|   141k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3176|   141k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3177|   141k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3178|       |
 3179|   141k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3180|   141k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3181|   141k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3182|   141k|                res_t0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3183|       |
 3184|   141k|                src_r0r1_8x16b = _mm_unpackhi_epi16(src_r0_8x16b, src_r1_8x16b);
 3185|   141k|                src_r2r3_8x16b = _mm_unpackhi_epi16(src_r2_8x16b, src_r3_8x16b);
 3186|   141k|                src_r4r5_8x16b = _mm_unpackhi_epi16(src_r4_8x16b, src_r5_8x16b);
 3187|       |
 3188|   141k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3189|   141k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3190|   141k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3191|       |
 3192|   141k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3193|   141k|                res_t3_4x32b = _mm_add_epi32(const_val512_4x32b, res_t3_4x32b);
 3194|   141k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3195|   141k|                res_t1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3196|       |
 3197|   141k|                res_c0_8x16b = _mm_packs_epi32(res_t0_4x32b, res_t1_4x32b);
 3198|       |
 3199|   141k|                src_r0_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 8));
 3200|   141k|                src_r1_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 8 + 1));
 3201|   141k|                src_r2_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 8 + 2));
 3202|   141k|                src_r3_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 8 + 3));
 3203|   141k|                src_r4_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 8 + 4));
 3204|   141k|                src_r5_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 8 + 5));
 3205|       |
 3206|   141k|                src_r0r1_8x16b = _mm_unpacklo_epi16(src_r0_8x16b, src_r1_8x16b);
 3207|   141k|                src_r2r3_8x16b = _mm_unpacklo_epi16(src_r2_8x16b, src_r3_8x16b);
 3208|   141k|                src_r4r5_8x16b = _mm_unpacklo_epi16(src_r4_8x16b, src_r5_8x16b);
 3209|       |
 3210|   141k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3211|   141k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3212|   141k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3213|       |
 3214|   141k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3215|   141k|                res_t3_4x32b = _mm_add_epi32(const_val512_4x32b, res_t3_4x32b);
 3216|   141k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3217|   141k|                res_t0_4x32b = _mm_srai_epi32(res_t1_4x32b ,10);
 3218|       |
 3219|   141k|                src_r0r1_8x16b = _mm_unpackhi_epi16(src_r0_8x16b, src_r1_8x16b);
 3220|   141k|                src_r2r3_8x16b = _mm_unpackhi_epi16(src_r2_8x16b, src_r3_8x16b);
 3221|   141k|                src_r4r5_8x16b = _mm_unpackhi_epi16(src_r4_8x16b, src_r5_8x16b);
 3222|       |
 3223|   141k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3224|   141k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3225|   141k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3226|       |
 3227|   141k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3228|   141k|                res_t3_4x32b = _mm_add_epi32(const_val512_4x32b, res_t3_4x32b);
 3229|   141k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3230|   141k|                res_t1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3231|       |
 3232|   141k|                res_c1_8x16b = _mm_packs_epi32(res_t0_4x32b, res_t1_4x32b);
 3233|   141k|                res_16x8b = _mm_packus_epi16(res_c0_8x16b, res_c1_8x16b);
 3234|       |
 3235|   141k|                src_hpel1_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp3));
 3236|   141k|                src_hpel1_8x16b = _mm_add_epi16(src_hpel1_8x16b, const_val16_8x16b);
 3237|   141k|                src_hpel1_8x16b = _mm_srai_epi16(src_hpel1_8x16b, 5); //shifting right by 5 bits.
 3238|       |
 3239|   141k|                src_hpel2_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp3 + 8));
 3240|   141k|                src_hpel2_8x16b = _mm_add_epi16(src_hpel2_8x16b, const_val16_8x16b);
 3241|   141k|                src_hpel2_8x16b = _mm_srai_epi16(src_hpel2_8x16b, 5); //shifting right by 5 bits.
 3242|       |
 3243|   141k|                src_hpel_16x8b = _mm_packus_epi16(src_hpel1_8x16b, src_hpel2_8x16b);
 3244|   141k|                res_16x8b = _mm_avg_epu8(res_16x8b, src_hpel_16x8b);
 3245|       |
 3246|   141k|                _mm_storeu_si128((__m128i *)(pu1_dst), res_16x8b);
 3247|       |
 3248|   141k|                ht--;
 3249|   141k|                pi2_temp2 = pi2_temp2 + 16 + 5;
 3250|   141k|                pi2_temp3 = pi2_temp3 + 16 + 5;
 3251|   141k|                pu1_dst = pu1_dst + dst_strd;
 3252|   141k|            }
 3253|   141k|            while(ht > 0);
  ------------------
  |  Branch (3253:19): [True: 130k, False: 11.3k]
  ------------------
 3254|  11.3k|        }
 3255|  11.3k|    }
 3256|  32.5k|}
ih264_inter_pred_luma_horz_hpel_vert_qpel_ssse3:
 3296|  41.9k|{
 3297|  41.9k|    WORD32 ht_temp;
 3298|  41.9k|    WORD32 y_offset;
 3299|  41.9k|    WORD16 *pi2_temp1,*pi2_temp2,*pi2_temp3;
 3300|       |
 3301|  41.9k|    y_offset = (dydx & 0xf) >> 2;
 3302|  41.9k|    pi2_temp1 = (WORD16 *)pu1_tmp;
 3303|  41.9k|    pi2_temp2 = pi2_temp1;
 3304|  41.9k|    pi2_temp3 = pi2_temp1 + (y_offset >> 1) * wd;
 3305|       |
 3306|  41.9k|    ht_temp = ht + 5;
 3307|  41.9k|    pu1_src -= src_strd << 1;
 3308|  41.9k|    pu1_src -= 2;
 3309|  41.9k|    pi2_temp3 += wd << 1;
 3310|       |    //the filter input starts from x[-2] (till x[3])
 3311|       |
 3312|  41.9k|    if(wd == 4)
  ------------------
  |  Branch (3312:8): [True: 7.85k, False: 34.0k]
  ------------------
 3313|  7.85k|    {
 3314|       |        // horizontal half-pel
 3315|  7.85k|        {
 3316|  7.85k|            __m128i src_r0_16x8b, src_r1_16x8b, src_r0r1_t1_16x8b;
 3317|  7.85k|            __m128i src_r0_sht_16x8b, src_r1_sht_16x8b;
 3318|  7.85k|            __m128i res_r0r1_t1_8x16b, res_r0r1_t2_8x16b, res_r0r1_t3_8x16b;
 3319|  7.85k|            __m128i coeff0_1_16x8b, coeff2_3_16x8b, coeff4_5_16x8b;
 3320|       |
 3321|  7.85k|            coeff0_1_16x8b = _mm_set1_epi32(0xFB01FB01);  //c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1
 3322|  7.85k|            coeff2_3_16x8b = _mm_set1_epi32(0x14141414);  //c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3
 3323|  7.85k|            coeff4_5_16x8b = _mm_set1_epi32(0x01FB01FB);  //c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5
 3324|       |
 3325|       |            //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
 3326|       |            //Row1 : b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
 3327|       |
 3328|  7.85k|            do
 3329|  53.1k|            {
 3330|  53.1k|                src_r0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);                         //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
 3331|  53.1k|                src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));            //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9....b15
 3332|       |
 3333|  53.1k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                         //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
 3334|  53.1k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                         //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
 3335|       |
 3336|  53.1k|                src_r0_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);           //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
 3337|  53.1k|                src_r1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);           //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
 3338|       |
 3339|  53.1k|                src_r0r1_t1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);         //a0 a1 a1 a2 a2 a3 a3 a4 b0 b1 b1 b2 b2 b3 b3 b4
 3340|  53.1k|                res_r0r1_t1_8x16b = _mm_maddubs_epi16(src_r0r1_t1_16x8b, coeff0_1_16x8b);   //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
 3341|       |                                                                                            //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
 3342|       |
 3343|  53.1k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 4);                             //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8  0  0  0  0
 3344|  53.1k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 4);                             //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8  0  0  0  0
 3345|       |
 3346|  53.1k|                src_r0r1_t1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);         //a2 a3 a3 a4 a4 a5 a5 a6 b2 b3 b3 b4 b4 b5 b5 b6
 3347|  53.1k|                res_r0r1_t2_8x16b = _mm_maddubs_epi16(src_r0r1_t1_16x8b, coeff2_3_16x8b);   //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
 3348|       |                                                                                            //b2*c2+b3*c3 b3*c2+b4*c3 b4*c2+b5*c3 b5*c2+b6*c3
 3349|       |
 3350|  53.1k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 4);                             //a4 a5 a5 a6 a6 a7 a7 a8  0  0  0  0  0  0  0  0
 3351|  53.1k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 4);                             //b4 b5 b5 b6 b6 b7 b7 b8  0  0  0  0  0  0  0  0
 3352|       |
 3353|  53.1k|                src_r0r1_t1_16x8b = _mm_unpacklo_epi64(src_r0_16x8b, src_r1_16x8b);         //a4 a5 a5 a6 a6 a7 a7 a8 b4 b5 b5 b6 b6 b7 b7 b8
 3354|  53.1k|                res_r0r1_t3_8x16b = _mm_maddubs_epi16(src_r0r1_t1_16x8b, coeff4_5_16x8b);   //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
 3355|       |                                                                                            //b4*c4+b5*c5 b5*c4+b6*c5 b4*c6+b7*c5 b7*c4+b8*c5
 3356|       |
 3357|  53.1k|                res_r0r1_t1_8x16b = _mm_add_epi16(res_r0r1_t1_8x16b, res_r0r1_t2_8x16b);
 3358|  53.1k|                res_r0r1_t1_8x16b = _mm_add_epi16(res_r0r1_t1_8x16b, res_r0r1_t3_8x16b);
 3359|       |
 3360|       |
 3361|  53.1k|                _mm_storeu_si128((__m128i *)(pi2_temp1), res_r0r1_t1_8x16b);
 3362|       |
 3363|  53.1k|                ht_temp -= 2;
 3364|  53.1k|                pu1_src =  pu1_src + (src_strd << 1);
 3365|  53.1k|                pi2_temp1 =  pi2_temp1 + (4 << 1);
 3366|  53.1k|            }
 3367|  53.1k|            while(ht_temp > 0);
  ------------------
  |  Branch (3367:19): [True: 45.2k, False: 7.85k]
  ------------------
 3368|  7.85k|        }
 3369|       |        // vertical q-pel
 3370|  7.85k|        {
 3371|  7.85k|            __m128i src_r0_8x16b, src_r1_8x16b, src_r2_8x16b, src_r3_8x16b;
 3372|  7.85k|            __m128i src_r4_8x16b, src_r5_8x16b, src_r6_8x16b;
 3373|  7.85k|            __m128i src_r0r1_c0_8x16b, src_r2r3_c0_8x16b, src_r4r5_c0_8x16b;
 3374|  7.85k|            __m128i src_hpel_16x8b, src_hpel_8x16b;
 3375|       |
 3376|  7.85k|            __m128i res_t0_4x32b, res_t1_4x32b, res_t2_4x32b, res_t3_4x32b;
 3377|  7.85k|            __m128i res_8x16b, res_16x8b;
 3378|       |
 3379|  7.85k|            __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b;
 3380|  7.85k|            __m128i const_val512_4x32b, const_val16_8x16b;
 3381|       |
 3382|  7.85k|            const_val512_4x32b = _mm_set1_epi32(512);
 3383|  7.85k|            const_val16_8x16b = _mm_set1_epi16(16);
 3384|       |
 3385|  7.85k|            coeff0_1_8x16b = _mm_set1_epi32(0xFFFB0001);
 3386|  7.85k|            coeff2_3_8x16b = _mm_set1_epi32(0x00140014);
 3387|  7.85k|            coeff4_5_8x16b = _mm_set1_epi32(0x0001FFFB);
 3388|       |
 3389|  7.85k|            src_r0_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp2));
 3390|  7.85k|            src_r1_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp2 + 4));
 3391|  7.85k|            src_r2_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp2 + 8));
 3392|  7.85k|            src_r3_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp2 + 12));
 3393|  7.85k|            src_r4_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp2 + 16));
 3394|  7.85k|            pi2_temp2 += 20;
 3395|       |
 3396|  7.85k|            do
 3397|  29.5k|            {
 3398|  29.5k|                src_r5_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp2));
 3399|  29.5k|                src_r6_8x16b = _mm_loadl_epi64((__m128i *)(pi2_temp2 + 4));
 3400|       |
 3401|  29.5k|                src_r0r1_c0_8x16b = _mm_unpacklo_epi16(src_r0_8x16b, src_r1_8x16b);
 3402|  29.5k|                src_r2r3_c0_8x16b = _mm_unpacklo_epi16(src_r2_8x16b, src_r3_8x16b);
 3403|  29.5k|                src_r4r5_c0_8x16b = _mm_unpacklo_epi16(src_r4_8x16b, src_r5_8x16b);
 3404|       |
 3405|  29.5k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_c0_8x16b, coeff0_1_8x16b);
 3406|  29.5k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_c0_8x16b, coeff2_3_8x16b);
 3407|  29.5k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_c0_8x16b, coeff4_5_8x16b);
 3408|       |
 3409|  29.5k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3410|  29.5k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3411|  29.5k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3412|  29.5k|                res_t0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3413|       |
 3414|  29.5k|                src_r0r1_c0_8x16b = _mm_unpacklo_epi16(src_r1_8x16b, src_r2_8x16b);
 3415|  29.5k|                src_r2r3_c0_8x16b = _mm_unpacklo_epi16(src_r3_8x16b, src_r4_8x16b);
 3416|  29.5k|                src_r4r5_c0_8x16b = _mm_unpacklo_epi16(src_r5_8x16b, src_r6_8x16b);
 3417|       |
 3418|  29.5k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_c0_8x16b, coeff0_1_8x16b);
 3419|  29.5k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_c0_8x16b, coeff2_3_8x16b);
 3420|  29.5k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_c0_8x16b, coeff4_5_8x16b);
 3421|       |
 3422|  29.5k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3423|  29.5k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3424|  29.5k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3425|  29.5k|                res_t1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3426|       |
 3427|  29.5k|                res_8x16b = _mm_packs_epi32(res_t0_4x32b, res_t1_4x32b);
 3428|  29.5k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 3429|       |
 3430|  29.5k|                src_hpel_8x16b = _mm_loadu_si128((__m128i *)pi2_temp3);
 3431|  29.5k|                src_hpel_8x16b = _mm_add_epi16(src_hpel_8x16b, const_val16_8x16b);
 3432|  29.5k|                src_hpel_8x16b = _mm_srai_epi16(src_hpel_8x16b, 5); //shifting right by 5 bits.
 3433|  29.5k|                src_hpel_16x8b = _mm_packus_epi16(src_hpel_8x16b, src_hpel_8x16b);
 3434|       |
 3435|  29.5k|                res_16x8b = _mm_avg_epu8(res_16x8b, src_hpel_16x8b);
 3436|       |
 3437|  29.5k|                *((WORD32 *)(pu1_dst)) = _mm_cvtsi128_si32(res_16x8b);
 3438|  29.5k|                res_16x8b = _mm_srli_si128(res_16x8b, 4);
 3439|  29.5k|                *((WORD32 *)(pu1_dst + dst_strd)) = _mm_cvtsi128_si32(res_16x8b);
 3440|       |
 3441|  29.5k|                src_r0_8x16b = src_r2_8x16b;
 3442|  29.5k|                src_r1_8x16b = src_r3_8x16b;
 3443|  29.5k|                src_r2_8x16b = src_r4_8x16b;
 3444|  29.5k|                src_r3_8x16b = src_r5_8x16b;
 3445|  29.5k|                src_r4_8x16b = src_r6_8x16b;
 3446|       |
 3447|  29.5k|                ht -= 2;
 3448|  29.5k|                pi2_temp2 =  pi2_temp2 + (4 << 1);
 3449|  29.5k|                pi2_temp3 =  pi2_temp3 + (4 << 1);
 3450|  29.5k|                pu1_dst = pu1_dst + (dst_strd << 1);
 3451|  29.5k|            }
 3452|  29.5k|            while(ht > 0);
  ------------------
  |  Branch (3452:19): [True: 21.7k, False: 7.85k]
  ------------------
 3453|  7.85k|        }
 3454|  7.85k|    }
 3455|  34.0k|    else if(wd == 8)
  ------------------
  |  Branch (3455:13): [True: 12.9k, False: 21.1k]
  ------------------
 3456|  12.9k|    {
 3457|       |        // horizontal half-pel
 3458|  12.9k|        {
 3459|  12.9k|            __m128i src_r0_16x8b, src_r1_16x8b, src_r0_sht_16x8b, src_r1_sht_16x8b;
 3460|  12.9k|            __m128i src_r0_t1_16x8b, src_r1_t1_16x8b;
 3461|       |
 3462|  12.9k|            __m128i res_r0_t1_8x16b, res_r0_t2_8x16b, res_r0_t3_8x16b;
 3463|  12.9k|            __m128i res_r1_t1_8x16b, res_r1_t2_8x16b, res_r1_t3_8x16b;
 3464|       |
 3465|  12.9k|            __m128i coeff0_1_16x8b, coeff2_3_16x8b, coeff4_5_16x8b;
 3466|       |
 3467|  12.9k|            coeff0_1_16x8b = _mm_set1_epi32(0xFB01FB01);  //c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1
 3468|  12.9k|            coeff2_3_16x8b = _mm_set1_epi32(0x14141414);  //c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3
 3469|  12.9k|            coeff4_5_16x8b = _mm_set1_epi32(0x01FB01FB);  //c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5
 3470|       |
 3471|       |            //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
 3472|       |            //Row1 : b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
 3473|       |
 3474|  12.9k|            do
 3475|   101k|            {
 3476|   101k|                src_r0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));                   //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
 3477|   101k|                src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));        //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9....b15
 3478|       |
 3479|   101k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                     //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
 3480|   101k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                     //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
 3481|       |
 3482|   101k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);    //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
 3483|   101k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);    //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
 3484|       |
 3485|   101k|                res_r0_t1_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff0_1_16x8b);   //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
 3486|       |                                                                                        //a4*c0+a5*c1 a5*c0+a6*c1 a6*c0+a7*c1 a7*c0+a8*c1
 3487|   101k|                res_r1_t1_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff0_1_16x8b);   //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
 3488|       |                                                                                        //b4*c0+b5*c1 b5*c0+b6*c1 b6*c0+b7*c1 b7*c0+b8*c1
 3489|       |
 3490|   101k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                         //a2 a3 a4 a5 a6 a7 a8 a9....a15 0 0
 3491|   101k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                         //b2 b3 b4 b5 b6 b7 b8 b9....b15 0 0
 3492|       |
 3493|   101k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                 //a3 a4 a5 a6 a7 a8 a9....a15 0  0  0
 3494|   101k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                 //b3 b4 b5 b6 b7 b8 b9....b15 0  0  0
 3495|       |
 3496|   101k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);    //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10
 3497|   101k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);    //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8 a8 a9 a9 a10
 3498|       |
 3499|   101k|                res_r0_t2_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff2_3_16x8b);   //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
 3500|       |                                                                                        //a6*c2+a7*c3 a7*c2+a8*c3 a8*c2+a9*c3 a9*c2+a10*c3
 3501|   101k|                res_r1_t2_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff2_3_16x8b);   //b2*c2+b3*c3 b3*c2+b4*c3 b2*c4+b5*c3 b5*c2+b6*c3
 3502|       |                                                                                        //b6*c2+b7*c3 b7*c2+b8*c3 b8*c2+b9*c3 b9*c2+b10*c3
 3503|       |
 3504|   101k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                         //a4 a5 a6 a7 a8 a9....a15 0  0  0  0
 3505|   101k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                         //b4 b5 b6 b7 b8 b9....b15 0  0  0  0
 3506|       |
 3507|   101k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                 //a5 a6 a7 a8 a9....a15 0  0  0  0  0
 3508|   101k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                 //b5 b6 b7 b8 b9....b15 0  0  0  0  0
 3509|       |
 3510|   101k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);    //a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10 a10 a11 a11 a12
 3511|   101k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);    //b4 b5 b5 b6 b6 b7 b7 b8 b8 b9 b9 b10 b10 b11 b11 b12
 3512|       |
 3513|   101k|                res_r0_t3_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff4_5_16x8b);   //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
 3514|       |                                                                                        //a8*c4+a9*c5 a9*c4+a10*c5 a10*c4+a11*c5 a11*c4+a12*c5
 3515|   101k|                res_r1_t3_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff4_5_16x8b);   //b4*c4+b5*c5 b5*c4+b6*c5 b6*c4+b7*c5 b7*c4+b8*c5
 3516|       |                                                                                        //b8*c4+b9*c5 b9*c4+b10*c5 b10*c4+b11*c5 b11*c4+b12*c5
 3517|   101k|                res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t2_8x16b);
 3518|   101k|                res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t3_8x16b);
 3519|       |
 3520|   101k|                res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t2_8x16b);
 3521|   101k|                res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t3_8x16b);
 3522|       |
 3523|   101k|                _mm_storeu_si128((__m128i *)(pi2_temp1), res_r0_t1_8x16b);
 3524|   101k|                _mm_storeu_si128((__m128i *)(pi2_temp1 + 8), res_r1_t1_8x16b);
 3525|       |
 3526|   101k|                ht_temp -= 2;
 3527|   101k|                pu1_src =  pu1_src + (src_strd << 1);
 3528|   101k|                pi2_temp1 =  pi2_temp1 + (8 << 1);
 3529|   101k|            }
 3530|   101k|            while(ht_temp > 0);
  ------------------
  |  Branch (3530:19): [True: 88.2k, False: 12.9k]
  ------------------
 3531|  12.9k|        }
 3532|       |        // vertical q-pel
 3533|  12.9k|        {
 3534|  12.9k|            __m128i src_r0_8x16b, src_r1_8x16b, src_r2_8x16b, src_r3_8x16b;
 3535|  12.9k|            __m128i src_r4_8x16b, src_r5_8x16b, src_r6_8x16b;
 3536|  12.9k|            __m128i src_r0r1_8x16b, src_r2r3_8x16b, src_r4r5_8x16b;
 3537|  12.9k|            __m128i src_hpel_8x16b, src_hpel_16x8b;
 3538|       |
 3539|  12.9k|            __m128i res_t0_4x32b, res_t1_4x32b, res_t2_4x32b, res_t3_4x32b;
 3540|  12.9k|            __m128i res_8x16b, res_16x8b;
 3541|       |
 3542|  12.9k|            __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b;
 3543|  12.9k|            __m128i const_val512_4x32b, const_val16_8x16b;
 3544|       |
 3545|  12.9k|            coeff0_1_8x16b = _mm_set1_epi32(0xFFFB0001);
 3546|  12.9k|            coeff2_3_8x16b = _mm_set1_epi32(0x00140014);
 3547|  12.9k|            coeff4_5_8x16b = _mm_set1_epi32(0x0001FFFB);
 3548|       |
 3549|  12.9k|            const_val512_4x32b = _mm_set1_epi32(512);
 3550|  12.9k|            const_val16_8x16b = _mm_set1_epi16(16);
 3551|       |
 3552|  12.9k|            src_r0_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2));
 3553|  12.9k|            src_r1_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 8));
 3554|  12.9k|            src_r2_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 16));
 3555|  12.9k|            src_r3_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 24));
 3556|  12.9k|            src_r4_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 32));
 3557|  12.9k|            pi2_temp2 += 40;
 3558|       |
 3559|  12.9k|            do
 3560|  62.2k|            {
 3561|  62.2k|                src_r5_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2));
 3562|  62.2k|                src_r6_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 8));
 3563|       |
 3564|  62.2k|                src_r0r1_8x16b = _mm_unpacklo_epi16(src_r0_8x16b, src_r1_8x16b);
 3565|  62.2k|                src_r2r3_8x16b = _mm_unpacklo_epi16(src_r2_8x16b, src_r3_8x16b);
 3566|  62.2k|                src_r4r5_8x16b = _mm_unpacklo_epi16(src_r4_8x16b, src_r5_8x16b);
 3567|       |
 3568|  62.2k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3569|  62.2k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3570|  62.2k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3571|       |
 3572|  62.2k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3573|  62.2k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3574|  62.2k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3575|  62.2k|                res_t0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3576|       |
 3577|  62.2k|                src_r0r1_8x16b = _mm_unpackhi_epi16(src_r0_8x16b, src_r1_8x16b);
 3578|  62.2k|                src_r2r3_8x16b = _mm_unpackhi_epi16(src_r2_8x16b, src_r3_8x16b);
 3579|  62.2k|                src_r4r5_8x16b = _mm_unpackhi_epi16(src_r4_8x16b, src_r5_8x16b);
 3580|       |
 3581|  62.2k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3582|  62.2k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3583|  62.2k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3584|       |
 3585|  62.2k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3586|  62.2k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3587|  62.2k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3588|  62.2k|                res_t1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3589|       |
 3590|  62.2k|                res_8x16b = _mm_packs_epi32(res_t0_4x32b, res_t1_4x32b);
 3591|  62.2k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 3592|       |
 3593|  62.2k|                src_hpel_8x16b = _mm_loadu_si128((__m128i *)pi2_temp3);
 3594|  62.2k|                src_hpel_8x16b = _mm_add_epi16(const_val16_8x16b, src_hpel_8x16b);
 3595|  62.2k|                src_hpel_8x16b = _mm_srai_epi16(src_hpel_8x16b, 5); //shifting right by 5 bits.
 3596|  62.2k|                src_hpel_16x8b = _mm_packus_epi16(src_hpel_8x16b, src_hpel_8x16b);
 3597|       |
 3598|  62.2k|                res_16x8b = _mm_avg_epu8(res_16x8b, src_hpel_16x8b);
 3599|       |
 3600|  62.2k|                _mm_storel_epi64((__m128i *)(pu1_dst), res_16x8b);
 3601|       |
 3602|  62.2k|                src_r0r1_8x16b = _mm_unpacklo_epi16(src_r1_8x16b, src_r2_8x16b);
 3603|  62.2k|                src_r2r3_8x16b = _mm_unpacklo_epi16(src_r3_8x16b, src_r4_8x16b);
 3604|  62.2k|                src_r4r5_8x16b = _mm_unpacklo_epi16(src_r5_8x16b, src_r6_8x16b);
 3605|       |
 3606|  62.2k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3607|  62.2k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3608|  62.2k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3609|       |
 3610|  62.2k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3611|  62.2k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3612|  62.2k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3613|  62.2k|                res_t0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3614|       |
 3615|  62.2k|                src_r0r1_8x16b = _mm_unpackhi_epi16(src_r1_8x16b, src_r2_8x16b);
 3616|  62.2k|                src_r2r3_8x16b = _mm_unpackhi_epi16(src_r3_8x16b, src_r4_8x16b);
 3617|  62.2k|                src_r4r5_8x16b = _mm_unpackhi_epi16(src_r5_8x16b, src_r6_8x16b);
 3618|       |
 3619|  62.2k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3620|  62.2k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3621|  62.2k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3622|       |
 3623|  62.2k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3624|  62.2k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3625|  62.2k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3626|  62.2k|                res_t1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3627|       |
 3628|  62.2k|                res_8x16b = _mm_packs_epi32(res_t0_4x32b, res_t1_4x32b);
 3629|  62.2k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 3630|       |
 3631|  62.2k|                src_hpel_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp3 + 8));
 3632|  62.2k|                src_hpel_8x16b = _mm_add_epi16(const_val16_8x16b, src_hpel_8x16b);
 3633|  62.2k|                src_hpel_8x16b = _mm_srai_epi16(src_hpel_8x16b, 5); //shifting right by 5 bits.
 3634|  62.2k|                src_hpel_16x8b = _mm_packus_epi16(src_hpel_8x16b, src_hpel_8x16b);
 3635|       |
 3636|  62.2k|                res_16x8b = _mm_avg_epu8(res_16x8b, src_hpel_16x8b);
 3637|       |
 3638|  62.2k|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), res_16x8b);
 3639|       |
 3640|  62.2k|                src_r0_8x16b = src_r2_8x16b;
 3641|  62.2k|                src_r1_8x16b = src_r3_8x16b;
 3642|  62.2k|                src_r2_8x16b = src_r4_8x16b;
 3643|  62.2k|                src_r3_8x16b = src_r5_8x16b;
 3644|  62.2k|                src_r4_8x16b = src_r6_8x16b;
 3645|       |
 3646|  62.2k|                ht -= 2;
 3647|  62.2k|                pi2_temp2 = pi2_temp2 + (8 << 1);
 3648|  62.2k|                pi2_temp3 = pi2_temp3 + (8 << 1);
 3649|  62.2k|                pu1_dst = pu1_dst + (dst_strd << 1);
 3650|  62.2k|            }
 3651|  62.2k|            while(ht > 0);
  ------------------
  |  Branch (3651:19): [True: 49.2k, False: 12.9k]
  ------------------
 3652|  12.9k|        }
 3653|  12.9k|    }
 3654|  21.1k|    else // wd == 16
 3655|  21.1k|    {
 3656|  21.1k|        UWORD8 *pu1_dst1;
 3657|  21.1k|        WORD16 *pi2_temp4,*pi2_temp5;
 3658|       |
 3659|  21.1k|        pu1_dst1 = pu1_dst + 8;
 3660|  21.1k|        pi2_temp4 = pi2_temp2 + 8;
 3661|  21.1k|        pi2_temp5 = pi2_temp3 + 8;
 3662|       |
 3663|       |        // horizontal half-pel
 3664|  21.1k|        {
 3665|  21.1k|            __m128i src_r0_16x8b, src_r1_16x8b, src_r0_sht_16x8b, src_r1_sht_16x8b;
 3666|  21.1k|            __m128i src_r0_t1_16x8b, src_r1_t1_16x8b;
 3667|       |
 3668|  21.1k|            __m128i res_r0_t1_8x16b, res_r0_t2_8x16b, res_r0_t3_8x16b;
 3669|  21.1k|            __m128i res_r1_t1_8x16b, res_r1_t2_8x16b, res_r1_t3_8x16b;
 3670|       |
 3671|  21.1k|            __m128i coeff0_1_16x8b, coeff2_3_16x8b, coeff4_5_16x8b;
 3672|       |
 3673|  21.1k|            coeff0_1_16x8b = _mm_set1_epi32(0xFB01FB01);  //c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1 c0 c1
 3674|  21.1k|            coeff2_3_16x8b = _mm_set1_epi32(0x14141414);  //c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3 c2 c3
 3675|  21.1k|            coeff4_5_16x8b = _mm_set1_epi32(0x01FB01FB);  //c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5 c4 c5 c5 c5
 3676|       |
 3677|       |            //Row0 : a0 a1 a2 a3 a4 a5 a6 a7 a8 a9.....
 3678|       |            //Row0 :                         b0 b1 b2 b3 b4 b5 b6 b7 b8 b9.....
 3679|       |            //b0 is same a8. Similarly other bn pixels are same as a(n+8) pixels.
 3680|       |
 3681|  21.1k|            do
 3682|   417k|            {
 3683|   417k|                src_r0_16x8b = _mm_loadu_si128((__m128i *)(pu1_src));                  //a0 a1 a2 a3 a4 a5 a6 a7 a8 a9....a15
 3684|   417k|                src_r1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 8));              //b0 b1 b2 b3 b4 b5 b6 b7 b8 b9....b15
 3685|       |
 3686|   417k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_16x8b, 1);                    //a1 a2 a3 a4 a5 a6 a7 a8 a9....a15 0
 3687|   417k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_16x8b, 1);                    //b1 b2 b3 b4 b5 b6 b7 b8 b9....b15 0
 3688|       |
 3689|   417k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);   //a0 a1 a1 a2 a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8
 3690|   417k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);   //b0 b1 b1 b2 b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8
 3691|       |
 3692|   417k|                res_r0_t1_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff0_1_16x8b);   //a0*c0+a1*c1 a1*c0+a2*c1 a2*c0+a3*c1 a3*c0+a4*c1
 3693|       |                                                                                        //a4*c0+a5*c1 a5*c0+a6*c1 a6*c0+a7*c1 a7*c0+a8*c1
 3694|   417k|                res_r1_t1_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff0_1_16x8b);   //b0*c0+b1*c1 b1*c0+b2*c1 b2*c0+b3*c1 b3*c0+b4*c1
 3695|       |                                                                                        //b4*c0+b5*c1 b5*c0+b6*c1 b6*c0+b7*c1 b7*c0+b8*c1
 3696|       |
 3697|   417k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                         //a2 a3 a4 a5 a6 a7 a8 a9....a15 0 0
 3698|   417k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                         //b2 b3 b4 b5 b6 b7 b8 b9....b15 0 0
 3699|       |
 3700|   417k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                 //a3 a4 a5 a6 a7 a8 a9....a15 0  0  0
 3701|   417k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                 //b3 b4 b5 b6 b7 b8 b9....b15 0  0  0
 3702|       |
 3703|   417k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);    //a2 a3 a3 a4 a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10
 3704|   417k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);    //b2 b3 b3 b4 b4 b5 b5 b6 b6 b7 b7 b8 a8 a9 a9 a10
 3705|       |
 3706|   417k|                res_r0_t2_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff2_3_16x8b);   //a2*c2+a3*c3 a3*c2+a4*c3 a4*c2+a5*c3 a5*c2+a6*c3
 3707|       |                                                                                        //a6*c2+a7*c3 a7*c2+a8*c3 a8*c2+a9*c3 a9*c2+a10*c3
 3708|   417k|                res_r1_t2_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff2_3_16x8b);   //b2*c2+b3*c3 b3*c2+b4*c3 b2*c4+b5*c3 b5*c2+b6*c3
 3709|       |                                                                                        //b6*c2+b7*c3 b7*c2+b8*c3 b8*c2+b9*c3 b9*c2+b10*c3
 3710|       |
 3711|   417k|                src_r0_16x8b = _mm_srli_si128(src_r0_16x8b, 2);                         //a4 a5 a6 a7 a8 a9....a15 0  0  0  0
 3712|   417k|                src_r1_16x8b = _mm_srli_si128(src_r1_16x8b, 2);                         //b4 b5 b6 b7 b8 b9....b15 0  0  0  0
 3713|       |
 3714|   417k|                src_r0_sht_16x8b = _mm_srli_si128(src_r0_sht_16x8b, 2);                 //a5 a6 a7 a8 a9....a15 0  0  0  0  0
 3715|   417k|                src_r1_sht_16x8b = _mm_srli_si128(src_r1_sht_16x8b, 2);                 //b5 b6 b7 b8 b9....b15 0  0  0  0  0
 3716|       |
 3717|   417k|                src_r0_t1_16x8b = _mm_unpacklo_epi8(src_r0_16x8b, src_r0_sht_16x8b);    //a4 a5 a5 a6 a6 a7 a7 a8 a8 a9 a9 a10 a10 a11 a11 a12
 3718|   417k|                src_r1_t1_16x8b = _mm_unpacklo_epi8(src_r1_16x8b, src_r1_sht_16x8b);    //b4 b5 b5 b6 b6 b7 b7 b8 b8 b9 b9 b10 b10 b11 b11 b12
 3719|       |
 3720|   417k|                res_r0_t3_8x16b = _mm_maddubs_epi16(src_r0_t1_16x8b, coeff4_5_16x8b);   //a4*c4+a5*c5 a5*c4+a6*c5 a6*c4+a7*c5 a7*c4+a8*c5
 3721|       |                                                                                        //a8*c4+a9*c5 a9*c4+a10*c5 a10*c4+a11*c5 a11*c4+a12*c5
 3722|   417k|                res_r1_t3_8x16b = _mm_maddubs_epi16(src_r1_t1_16x8b, coeff4_5_16x8b);   //b4*c4+b5*c5 b5*c4+b6*c5 b6*c4+b7*c5 b7*c4+b8*c5
 3723|       |                                                                                        //b8*c4+b9*c5 b9*c4+b10*c5 b10*c4+b11*c5 b11*c4+b12*c5
 3724|   417k|                res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t2_8x16b);
 3725|   417k|                res_r0_t1_8x16b = _mm_add_epi16(res_r0_t1_8x16b, res_r0_t3_8x16b);
 3726|       |
 3727|   417k|                res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t2_8x16b);
 3728|   417k|                res_r1_t1_8x16b = _mm_add_epi16(res_r1_t1_8x16b, res_r1_t3_8x16b);
 3729|       |
 3730|   417k|                _mm_storeu_si128((__m128i *)(pi2_temp1), res_r0_t1_8x16b);
 3731|   417k|                _mm_storeu_si128((__m128i *)(pi2_temp1 + 8), res_r1_t1_8x16b);
 3732|       |
 3733|   417k|                ht_temp--;
 3734|   417k|                pu1_src =  pu1_src + src_strd;
 3735|   417k|                pi2_temp1 =  pi2_temp1 + 16;
 3736|   417k|            }
 3737|   417k|            while(ht_temp > 0);
  ------------------
  |  Branch (3737:19): [True: 395k, False: 21.1k]
  ------------------
 3738|  21.1k|        }
 3739|       |        // vertical q-pel
 3740|  21.1k|        {
 3741|  21.1k|            __m128i src_r0_8x16b, src_r1_8x16b, src_r2_8x16b, src_r3_8x16b, src_r4_8x16b;
 3742|  21.1k|            __m128i src_r5_8x16b, src_r6_8x16b;
 3743|  21.1k|            __m128i src_r0r1_8x16b, src_r2r3_8x16b, src_r4r5_8x16b;
 3744|  21.1k|            __m128i src_hpel_8x16b, src_hpel_16x8b;
 3745|       |
 3746|  21.1k|            __m128i res_t0_4x32b, res_t1_4x32b, res_t2_4x32b, res_t3_4x32b;
 3747|  21.1k|            __m128i res_8x16b, res_16x8b;
 3748|       |
 3749|  21.1k|            __m128i coeff0_1_8x16b, coeff2_3_8x16b, coeff4_5_8x16b;
 3750|  21.1k|            __m128i const_val512_4x32b, const_val16_8x16b;
 3751|       |
 3752|  21.1k|            coeff0_1_8x16b = _mm_set1_epi32(0xFFFB0001);
 3753|  21.1k|            coeff2_3_8x16b = _mm_set1_epi32(0x00140014);
 3754|  21.1k|            coeff4_5_8x16b = _mm_set1_epi32(0x0001FFFB);
 3755|       |
 3756|  21.1k|            const_val512_4x32b = _mm_set1_epi32(512);
 3757|  21.1k|            const_val16_8x16b = _mm_set1_epi16(16);
 3758|       |
 3759|       |            /**********************************************************/
 3760|       |            /*     Do first height x 8 block                          */
 3761|       |            /**********************************************************/
 3762|  21.1k|            src_r0_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2));
 3763|  21.1k|            src_r1_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 16));
 3764|  21.1k|            src_r2_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 32));
 3765|  21.1k|            src_r3_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 48));
 3766|  21.1k|            src_r4_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 64));
 3767|  21.1k|            pi2_temp2 += 80;
 3768|       |
 3769|  21.1k|            ht_temp = ht;
 3770|  21.1k|            do
 3771|   155k|            {
 3772|   155k|                src_r5_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2));
 3773|   155k|                src_r6_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp2 + 16));
 3774|       |
 3775|   155k|                src_r0r1_8x16b = _mm_unpacklo_epi16(src_r0_8x16b, src_r1_8x16b);
 3776|   155k|                src_r2r3_8x16b = _mm_unpacklo_epi16(src_r2_8x16b, src_r3_8x16b);
 3777|   155k|                src_r4r5_8x16b = _mm_unpacklo_epi16(src_r4_8x16b, src_r5_8x16b);
 3778|       |
 3779|   155k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3780|   155k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3781|   155k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3782|       |
 3783|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3784|   155k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3785|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3786|   155k|                res_t0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3787|       |
 3788|   155k|                src_r0r1_8x16b = _mm_unpackhi_epi16(src_r0_8x16b, src_r1_8x16b);
 3789|   155k|                src_r2r3_8x16b = _mm_unpackhi_epi16(src_r2_8x16b, src_r3_8x16b);
 3790|   155k|                src_r4r5_8x16b = _mm_unpackhi_epi16(src_r4_8x16b, src_r5_8x16b);
 3791|       |
 3792|   155k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3793|   155k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3794|   155k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3795|       |
 3796|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3797|   155k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3798|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3799|   155k|                res_t1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3800|       |
 3801|   155k|                res_8x16b = _mm_packs_epi32(res_t0_4x32b, res_t1_4x32b);
 3802|   155k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 3803|       |
 3804|   155k|                src_hpel_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp3));
 3805|   155k|                src_hpel_8x16b = _mm_add_epi16(src_hpel_8x16b, const_val16_8x16b);
 3806|   155k|                src_hpel_8x16b = _mm_srai_epi16(src_hpel_8x16b, 5); //shifting right by 5 bits.
 3807|   155k|                src_hpel_16x8b = _mm_packus_epi16(src_hpel_8x16b, src_hpel_8x16b);
 3808|       |
 3809|   155k|                res_16x8b = _mm_avg_epu8(res_16x8b, src_hpel_16x8b);
 3810|   155k|                _mm_storel_epi64((__m128i *)(pu1_dst), res_16x8b);
 3811|       |
 3812|   155k|                src_r0r1_8x16b = _mm_unpacklo_epi16(src_r1_8x16b, src_r2_8x16b);
 3813|   155k|                src_r2r3_8x16b = _mm_unpacklo_epi16(src_r3_8x16b, src_r4_8x16b);
 3814|   155k|                src_r4r5_8x16b = _mm_unpacklo_epi16(src_r5_8x16b, src_r6_8x16b);
 3815|       |
 3816|   155k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3817|   155k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3818|   155k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3819|       |
 3820|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3821|   155k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3822|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3823|   155k|                res_t0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3824|       |
 3825|   155k|                src_r0r1_8x16b = _mm_unpackhi_epi16(src_r1_8x16b, src_r2_8x16b);
 3826|   155k|                src_r2r3_8x16b = _mm_unpackhi_epi16(src_r3_8x16b, src_r4_8x16b);
 3827|   155k|                src_r4r5_8x16b = _mm_unpackhi_epi16(src_r5_8x16b, src_r6_8x16b);
 3828|       |
 3829|   155k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3830|   155k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3831|   155k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3832|       |
 3833|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3834|   155k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3835|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3836|   155k|                res_t1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3837|       |
 3838|   155k|                res_8x16b = _mm_packs_epi32(res_t0_4x32b, res_t1_4x32b);
 3839|   155k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 3840|       |
 3841|   155k|                src_hpel_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp3 + 16));
 3842|   155k|                src_hpel_8x16b = _mm_add_epi16(src_hpel_8x16b, const_val16_8x16b);
 3843|   155k|                src_hpel_8x16b = _mm_srai_epi16(src_hpel_8x16b, 5); //shifting right by 5 bits.
 3844|   155k|                src_hpel_16x8b = _mm_packus_epi16(src_hpel_8x16b, src_hpel_8x16b);
 3845|       |
 3846|   155k|                res_16x8b = _mm_avg_epu8(res_16x8b, src_hpel_16x8b);
 3847|   155k|                _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), res_16x8b);
 3848|       |
 3849|   155k|                src_r0_8x16b = src_r2_8x16b;
 3850|   155k|                src_r1_8x16b = src_r3_8x16b;
 3851|   155k|                src_r2_8x16b = src_r4_8x16b;
 3852|   155k|                src_r3_8x16b = src_r5_8x16b;
 3853|   155k|                src_r4_8x16b = src_r6_8x16b;
 3854|       |
 3855|   155k|                ht_temp -= 2;
 3856|   155k|                pi2_temp3 = pi2_temp3 + (16 << 1);
 3857|   155k|                pi2_temp2 = pi2_temp2 + (16 << 1);
 3858|   155k|                pu1_dst = pu1_dst + (dst_strd << 1);
 3859|   155k|            }
 3860|   155k|            while(ht_temp > 0);
  ------------------
  |  Branch (3860:19): [True: 134k, False: 21.1k]
  ------------------
 3861|       |
 3862|       |            /**********************************************************/
 3863|       |            /*     Do second height * 8 block                         */
 3864|       |            /**********************************************************/
 3865|  21.1k|            src_r0_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp4));
 3866|  21.1k|            src_r1_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp4 + 16));
 3867|  21.1k|            src_r2_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp4 + 32));
 3868|  21.1k|            src_r3_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp4 + 48));
 3869|  21.1k|            src_r4_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp4 + 64));
 3870|  21.1k|            pi2_temp4 += 80;
 3871|       |
 3872|  21.1k|            do
 3873|   155k|            {
 3874|   155k|                src_r5_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp4));
 3875|   155k|                src_r6_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp4 + 16));
 3876|       |
 3877|   155k|                src_r0r1_8x16b = _mm_unpacklo_epi16(src_r0_8x16b, src_r1_8x16b);
 3878|   155k|                src_r2r3_8x16b = _mm_unpacklo_epi16(src_r2_8x16b, src_r3_8x16b);
 3879|   155k|                src_r4r5_8x16b = _mm_unpacklo_epi16(src_r4_8x16b, src_r5_8x16b);
 3880|       |
 3881|   155k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3882|   155k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3883|   155k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3884|       |
 3885|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3886|   155k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3887|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3888|   155k|                res_t0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3889|       |
 3890|   155k|                src_r0r1_8x16b = _mm_unpackhi_epi16(src_r0_8x16b, src_r1_8x16b);
 3891|   155k|                src_r2r3_8x16b = _mm_unpackhi_epi16(src_r2_8x16b, src_r3_8x16b);
 3892|   155k|                src_r4r5_8x16b = _mm_unpackhi_epi16(src_r4_8x16b, src_r5_8x16b);
 3893|       |
 3894|   155k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3895|   155k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3896|   155k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3897|       |
 3898|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3899|   155k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3900|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3901|   155k|                res_t1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3902|       |
 3903|   155k|                res_8x16b = _mm_packs_epi32(res_t0_4x32b, res_t1_4x32b);
 3904|   155k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 3905|       |
 3906|   155k|                src_hpel_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp5));
 3907|   155k|                src_hpel_8x16b = _mm_add_epi16(src_hpel_8x16b, const_val16_8x16b);
 3908|   155k|                src_hpel_8x16b = _mm_srai_epi16(src_hpel_8x16b, 5); //shifting right by 5 bits.
 3909|   155k|                src_hpel_16x8b = _mm_packus_epi16(src_hpel_8x16b, src_hpel_8x16b);
 3910|       |
 3911|   155k|                res_16x8b = _mm_avg_epu8(res_16x8b, src_hpel_16x8b);
 3912|   155k|                _mm_storel_epi64((__m128i *)(pu1_dst1), res_16x8b);
 3913|       |
 3914|   155k|                src_r0r1_8x16b = _mm_unpacklo_epi16(src_r1_8x16b, src_r2_8x16b);
 3915|   155k|                src_r2r3_8x16b = _mm_unpacklo_epi16(src_r3_8x16b, src_r4_8x16b);
 3916|   155k|                src_r4r5_8x16b = _mm_unpacklo_epi16(src_r5_8x16b, src_r6_8x16b);
 3917|       |
 3918|   155k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3919|   155k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3920|   155k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3921|       |
 3922|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3923|   155k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3924|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3925|   155k|                res_t0_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3926|       |
 3927|   155k|                src_r0r1_8x16b = _mm_unpackhi_epi16(src_r1_8x16b, src_r2_8x16b);
 3928|   155k|                src_r2r3_8x16b = _mm_unpackhi_epi16(src_r3_8x16b, src_r4_8x16b);
 3929|   155k|                src_r4r5_8x16b = _mm_unpackhi_epi16(src_r5_8x16b, src_r6_8x16b);
 3930|       |
 3931|   155k|                res_t1_4x32b = _mm_madd_epi16(src_r0r1_8x16b, coeff0_1_8x16b);
 3932|   155k|                res_t2_4x32b = _mm_madd_epi16(src_r2r3_8x16b, coeff2_3_8x16b);
 3933|   155k|                res_t3_4x32b = _mm_madd_epi16(src_r4r5_8x16b, coeff4_5_8x16b);
 3934|       |
 3935|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t2_4x32b);
 3936|   155k|                res_t3_4x32b = _mm_add_epi32(res_t3_4x32b, const_val512_4x32b);
 3937|   155k|                res_t1_4x32b = _mm_add_epi32(res_t1_4x32b, res_t3_4x32b);
 3938|   155k|                res_t1_4x32b = _mm_srai_epi32(res_t1_4x32b, 10);
 3939|       |
 3940|   155k|                res_8x16b = _mm_packs_epi32(res_t0_4x32b, res_t1_4x32b);
 3941|   155k|                res_16x8b = _mm_packus_epi16(res_8x16b, res_8x16b);
 3942|       |
 3943|   155k|                src_hpel_8x16b = _mm_loadu_si128((__m128i *)(pi2_temp5 + 16));
 3944|   155k|                src_hpel_8x16b = _mm_add_epi16(src_hpel_8x16b, const_val16_8x16b);
 3945|   155k|                src_hpel_8x16b = _mm_srai_epi16(src_hpel_8x16b, 5); //shifting right by 5 bits.
 3946|   155k|                src_hpel_16x8b = _mm_packus_epi16(src_hpel_8x16b, src_hpel_8x16b);
 3947|       |
 3948|   155k|                res_16x8b = _mm_avg_epu8(res_16x8b, src_hpel_16x8b);
 3949|   155k|                _mm_storel_epi64((__m128i *)(pu1_dst1 + dst_strd), res_16x8b);
 3950|       |
 3951|   155k|                src_r0_8x16b = src_r2_8x16b;
 3952|   155k|                src_r1_8x16b = src_r3_8x16b;
 3953|   155k|                src_r2_8x16b = src_r4_8x16b;
 3954|   155k|                src_r3_8x16b = src_r5_8x16b;
 3955|   155k|                src_r4_8x16b = src_r6_8x16b;
 3956|       |
 3957|   155k|                ht -= 2;
 3958|   155k|                pi2_temp5 = pi2_temp5 + (16 << 1);
 3959|   155k|                pi2_temp4 = pi2_temp4 + (16 << 1);
 3960|   155k|                pu1_dst1 = pu1_dst1 + (dst_strd << 1);
 3961|   155k|            }
 3962|   155k|            while(ht > 0);
  ------------------
  |  Branch (3962:19): [True: 134k, False: 21.1k]
  ------------------
 3963|  21.1k|        }
 3964|  21.1k|    }
 3965|  41.9k|}
ih264_inter_pred_chroma_ssse3:
 4002|  10.6M|{
 4003|  10.6M|    WORD32 i, j, A, B, C, D;
 4004|       |
 4005|  10.6M|    i = 8 - dx;
 4006|  10.6M|    j = 8 - dy;
 4007|       |
 4008|  10.6M|    A = i * j;
 4009|  10.6M|    B = dx * j;
 4010|  10.6M|    C = i * dy;
 4011|  10.6M|    D = dx * dy;
 4012|       |
 4013|  10.6M|    if(wd == 2)
  ------------------
  |  Branch (4013:8): [True: 88.0k, False: 10.5M]
  ------------------
 4014|  88.0k|    {
 4015|  88.0k|        WORD32 tmp1, tmp2, tmp3, tmp4;
 4016|       |
 4017|  88.0k|        do
 4018|   150k|        {
 4019|       |            //U
 4020|   150k|            tmp1 = A * pu1_src[0] + B * pu1_src[2] + C * pu1_src[src_strd] + D * pu1_src[src_strd + 2];
 4021|   150k|            tmp2 = A * pu1_src[2] + B * pu1_src[4] + C * pu1_src[src_strd + 2] + D * pu1_src[src_strd + 4];
 4022|       |            //V
 4023|   150k|            tmp3 = A * pu1_src[1] + B * pu1_src[3] + C * pu1_src[src_strd + 1] + D * pu1_src[src_strd + 3];
 4024|   150k|            tmp4 = A * pu1_src[3] + B * pu1_src[5] + C * pu1_src[src_strd + 3] + D * pu1_src[src_strd + 5];
 4025|       |
 4026|   150k|            tmp1 = (tmp1 + 32) >> 6;
 4027|   150k|            tmp2 = (tmp2 + 32) >> 6;
 4028|   150k|            tmp3 = (tmp3 + 32) >> 6;
 4029|   150k|            tmp4 = (tmp4 + 32) >> 6;
 4030|       |
 4031|   150k|            pu1_dst[0] = CLIP_U8(tmp1);
  ------------------
  |  |   58|   150k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   150k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 150k]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4032|   150k|            pu1_dst[2] = CLIP_U8(tmp2);
  ------------------
  |  |   58|   150k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   150k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 150k]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4033|   150k|            pu1_dst[1] = CLIP_U8(tmp3);
  ------------------
  |  |   58|   150k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   150k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 150k]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4034|   150k|            pu1_dst[3] = CLIP_U8(tmp4);
  ------------------
  |  |   58|   150k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   150k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 150k]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4035|       |
 4036|   150k|            pu1_src += src_strd;
 4037|   150k|            pu1_dst += dst_strd;
 4038|       |
 4039|   150k|            tmp1 = A * pu1_src[0] + B * pu1_src[2] + C * pu1_src[src_strd] + D * pu1_src[src_strd + 2];
 4040|   150k|            tmp2 = A * pu1_src[2] + B * pu1_src[4] + C * pu1_src[src_strd + 2] + D * pu1_src[src_strd + 4];
 4041|   150k|            tmp3 = A * pu1_src[1] + B * pu1_src[3] + C * pu1_src[src_strd + 1] + D * pu1_src[src_strd + 3];
 4042|   150k|            tmp4 = A * pu1_src[3] + B * pu1_src[5] + C * pu1_src[src_strd + 3] + D * pu1_src[src_strd + 5];
 4043|       |
 4044|   150k|            tmp1 = (tmp1 + 32) >> 6;
 4045|   150k|            tmp2 = (tmp2 + 32) >> 6;
 4046|   150k|            tmp3 = (tmp3 + 32) >> 6;
 4047|   150k|            tmp4 = (tmp4 + 32) >> 6;
 4048|       |
 4049|   150k|            pu1_dst[0] = CLIP_U8(tmp1);
  ------------------
  |  |   58|   150k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   150k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 150k]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4050|   150k|            pu1_dst[2] = CLIP_U8(tmp2);
  ------------------
  |  |   58|   150k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   150k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 150k]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4051|   150k|            pu1_dst[1] = CLIP_U8(tmp3);
  ------------------
  |  |   58|   150k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   150k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 150k]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4052|   150k|            pu1_dst[3] = CLIP_U8(tmp4);
  ------------------
  |  |   58|   150k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   150k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 150k]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4053|       |
 4054|   150k|            ht -= 2;
 4055|   150k|            pu1_src += src_strd;
 4056|   150k|            pu1_dst += dst_strd;
 4057|   150k|        }
 4058|   150k|        while(ht > 0);
  ------------------
  |  Branch (4058:15): [True: 62.4k, False: 88.0k]
  ------------------
 4059|       |
 4060|  88.0k|    }
 4061|  10.5M|    else if(wd == 4)
  ------------------
  |  Branch (4061:13): [True: 290k, False: 10.2M]
  ------------------
 4062|   290k|    {
 4063|   290k|        WORD32 AB, CD;
 4064|       |
 4065|   290k|        __m128i src_r1_16x8b, src_r2_16x8b, src_r3_16x8b;
 4066|   290k|        __m128i res1_AB_8x16b, res1_CD_8x16b, res1_8x16b, res1_16x8b;
 4067|   290k|        __m128i res2_AB_8x16b, res2_CD_8x16b, res2_8x16b, res2_16x8b;
 4068|       |
 4069|   290k|        __m128i coeffAB_16x8b, coeffCD_16x8b, round_add32_8x16b;
 4070|   290k|        __m128i const_shuff_16x8b;
 4071|       |
 4072|   290k|        AB = (B << 8) + A;
 4073|   290k|        CD = (D << 8) + C;
 4074|       |
 4075|   290k|        coeffAB_16x8b = _mm_set1_epi16(AB);
 4076|   290k|        coeffCD_16x8b = _mm_set1_epi16(CD);
 4077|       |
 4078|   290k|        round_add32_8x16b = _mm_set1_epi16(32);
 4079|       |
 4080|   290k|        const_shuff_16x8b = _mm_setr_epi32(0x03010200, 0x05030402, 0x07050604, 0x09070806);
 4081|       |
 4082|   290k|        src_r1_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
 4083|   290k|        src_r1_16x8b = _mm_shuffle_epi8(src_r1_16x8b, const_shuff_16x8b);
 4084|   290k|        pu1_src += src_strd;
 4085|       |
 4086|   290k|        do
 4087|   707k|        {
 4088|   707k|            src_r2_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
 4089|   707k|            src_r3_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));
 4090|       |
 4091|   707k|            src_r2_16x8b = _mm_shuffle_epi8(src_r2_16x8b, const_shuff_16x8b);
 4092|   707k|            src_r3_16x8b = _mm_shuffle_epi8(src_r3_16x8b, const_shuff_16x8b);
 4093|       |
 4094|   707k|            res1_AB_8x16b = _mm_maddubs_epi16(src_r1_16x8b, coeffAB_16x8b);
 4095|   707k|            res1_CD_8x16b = _mm_maddubs_epi16(src_r2_16x8b, coeffCD_16x8b);
 4096|   707k|            res2_AB_8x16b = _mm_maddubs_epi16(src_r2_16x8b, coeffAB_16x8b);
 4097|   707k|            res2_CD_8x16b = _mm_maddubs_epi16(src_r3_16x8b, coeffCD_16x8b);
 4098|       |
 4099|   707k|            res1_8x16b = _mm_add_epi16(res1_AB_8x16b, res1_CD_8x16b);
 4100|   707k|            res2_8x16b = _mm_add_epi16(res2_AB_8x16b, res2_CD_8x16b);
 4101|   707k|            res1_8x16b = _mm_add_epi16(res1_8x16b, round_add32_8x16b);
 4102|   707k|            res2_8x16b = _mm_add_epi16(res2_8x16b, round_add32_8x16b);
 4103|       |
 4104|   707k|            res1_8x16b = _mm_srai_epi16(res1_8x16b, 6);
 4105|   707k|            res2_8x16b = _mm_srai_epi16(res2_8x16b, 6);
 4106|       |
 4107|   707k|            res1_16x8b = _mm_packus_epi16(res1_8x16b, res1_8x16b);
 4108|   707k|            res2_16x8b = _mm_packus_epi16(res2_8x16b, res2_8x16b);
 4109|       |
 4110|   707k|            _mm_storel_epi64((__m128i *)pu1_dst, res1_16x8b);
 4111|   707k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), res2_16x8b);
 4112|       |
 4113|   707k|            src_r1_16x8b = src_r3_16x8b;
 4114|       |
 4115|   707k|            ht -= 2;
 4116|   707k|            pu1_src += src_strd << 1;
 4117|   707k|            pu1_dst += dst_strd << 1;
 4118|   707k|        }
 4119|   707k|        while(ht > 0);
  ------------------
  |  Branch (4119:15): [True: 416k, False: 290k]
  ------------------
 4120|   290k|    }
 4121|  10.2M|    else // wd == 8
 4122|  10.2M|    {
 4123|  10.2M|        WORD32 AB, CD;
 4124|       |
 4125|  10.2M|        __m128i src_r1l_16x8b, src_r2l_16x8b;
 4126|  10.2M|        __m128i src_r1h_16x8b, src_r2h_16x8b;
 4127|       |
 4128|  10.2M|        __m128i res_l_AB_8x16b, res_l_CD_8x16b;
 4129|  10.2M|        __m128i res_h_AB_8x16b, res_h_CD_8x16b;
 4130|  10.2M|        __m128i res_l_8x16b, res_h_8x16b, res_16x8b;
 4131|       |
 4132|  10.2M|        __m128i coeffAB_16x8b, coeffCD_16x8b, round_add32_8x16b;
 4133|  10.2M|        __m128i const_shuff_16x8b;
 4134|       |
 4135|  10.2M|        AB = (B << 8) + A;
 4136|  10.2M|        CD = (D << 8) + C;
 4137|       |
 4138|  10.2M|        coeffAB_16x8b = _mm_set1_epi16(AB);
 4139|  10.2M|        coeffCD_16x8b = _mm_set1_epi16(CD);
 4140|       |
 4141|  10.2M|        round_add32_8x16b = _mm_set1_epi16(32);
 4142|       |
 4143|  10.2M|        const_shuff_16x8b = _mm_setr_epi32(0x03010200, 0x05030402, 0x07050604, 0x09070806);
 4144|       |
 4145|  10.2M|        src_r1l_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
 4146|  10.2M|        src_r1h_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 8));
 4147|       |
 4148|  10.2M|        src_r1l_16x8b = _mm_shuffle_epi8(src_r1l_16x8b, const_shuff_16x8b);
 4149|  10.2M|        src_r1h_16x8b = _mm_shuffle_epi8(src_r1h_16x8b, const_shuff_16x8b);
 4150|       |
 4151|  10.2M|        pu1_src += src_strd;
 4152|       |
 4153|  10.2M|        do
 4154|  20.4M|        {
 4155|       |            //row 1
 4156|  20.4M|            src_r2l_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
 4157|  20.4M|            src_r2h_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 8));
 4158|       |
 4159|  20.4M|            src_r2l_16x8b = _mm_shuffle_epi8(src_r2l_16x8b, const_shuff_16x8b);
 4160|  20.4M|            src_r2h_16x8b = _mm_shuffle_epi8(src_r2h_16x8b, const_shuff_16x8b);
 4161|       |
 4162|  20.4M|            res_l_AB_8x16b = _mm_maddubs_epi16(src_r1l_16x8b, coeffAB_16x8b);
 4163|  20.4M|            res_h_AB_8x16b = _mm_maddubs_epi16(src_r1h_16x8b, coeffAB_16x8b);
 4164|  20.4M|            res_l_CD_8x16b = _mm_maddubs_epi16(src_r2l_16x8b, coeffCD_16x8b);
 4165|  20.4M|            res_h_CD_8x16b = _mm_maddubs_epi16(src_r2h_16x8b, coeffCD_16x8b);
 4166|       |
 4167|  20.4M|            res_l_8x16b = _mm_add_epi16(res_l_AB_8x16b, round_add32_8x16b);
 4168|  20.4M|            res_h_8x16b = _mm_add_epi16(res_h_AB_8x16b, round_add32_8x16b);
 4169|  20.4M|            res_l_8x16b = _mm_add_epi16(res_l_8x16b, res_l_CD_8x16b);
 4170|  20.4M|            res_h_8x16b = _mm_add_epi16(res_h_8x16b, res_h_CD_8x16b);
 4171|       |
 4172|  20.4M|            res_l_8x16b = _mm_srai_epi16(res_l_8x16b, 6);
 4173|  20.4M|            res_h_8x16b = _mm_srai_epi16(res_h_8x16b, 6);
 4174|       |
 4175|  20.4M|            res_16x8b = _mm_packus_epi16(res_l_8x16b, res_h_8x16b);
 4176|       |
 4177|  20.4M|            _mm_storeu_si128((__m128i *)pu1_dst, res_16x8b);
 4178|       |
 4179|  20.4M|            pu1_src += src_strd;
 4180|  20.4M|            pu1_dst += dst_strd;
 4181|       |
 4182|       |            //row 2
 4183|  20.4M|            src_r1l_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
 4184|  20.4M|            src_r1h_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 8));
 4185|       |
 4186|  20.4M|            src_r1l_16x8b = _mm_shuffle_epi8(src_r1l_16x8b, const_shuff_16x8b);
 4187|  20.4M|            src_r1h_16x8b = _mm_shuffle_epi8(src_r1h_16x8b, const_shuff_16x8b);
 4188|       |
 4189|  20.4M|            res_l_AB_8x16b = _mm_maddubs_epi16(src_r2l_16x8b, coeffAB_16x8b);
 4190|  20.4M|            res_h_AB_8x16b = _mm_maddubs_epi16(src_r2h_16x8b, coeffAB_16x8b);
 4191|  20.4M|            res_l_CD_8x16b = _mm_maddubs_epi16(src_r1l_16x8b, coeffCD_16x8b);
 4192|  20.4M|            res_h_CD_8x16b = _mm_maddubs_epi16(src_r1h_16x8b, coeffCD_16x8b);
 4193|       |
 4194|  20.4M|            res_l_8x16b = _mm_add_epi16(res_l_AB_8x16b, round_add32_8x16b);
 4195|  20.4M|            res_h_8x16b = _mm_add_epi16(res_h_AB_8x16b, round_add32_8x16b);
 4196|  20.4M|            res_l_8x16b = _mm_add_epi16(res_l_8x16b, res_l_CD_8x16b);
 4197|  20.4M|            res_h_8x16b = _mm_add_epi16(res_h_8x16b, res_h_CD_8x16b);
 4198|       |
 4199|  20.4M|            res_l_8x16b = _mm_srai_epi16(res_l_8x16b, 6);
 4200|  20.4M|            res_h_8x16b = _mm_srai_epi16(res_h_8x16b, 6);
 4201|       |
 4202|  20.4M|            res_16x8b = _mm_packus_epi16(res_l_8x16b, res_h_8x16b);
 4203|       |
 4204|  20.4M|            _mm_storeu_si128((__m128i *)pu1_dst, res_16x8b);
 4205|       |
 4206|  20.4M|            pu1_src += src_strd;
 4207|  20.4M|            pu1_dst += dst_strd;
 4208|       |
 4209|       |            //row 3
 4210|  20.4M|            src_r2l_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
 4211|  20.4M|            src_r2h_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 8));
 4212|       |
 4213|  20.4M|            src_r2l_16x8b = _mm_shuffle_epi8(src_r2l_16x8b, const_shuff_16x8b);
 4214|  20.4M|            src_r2h_16x8b = _mm_shuffle_epi8(src_r2h_16x8b, const_shuff_16x8b);
 4215|       |
 4216|  20.4M|            res_l_AB_8x16b = _mm_maddubs_epi16(src_r1l_16x8b, coeffAB_16x8b);
 4217|  20.4M|            res_h_AB_8x16b = _mm_maddubs_epi16(src_r1h_16x8b, coeffAB_16x8b);
 4218|  20.4M|            res_l_CD_8x16b = _mm_maddubs_epi16(src_r2l_16x8b, coeffCD_16x8b);
 4219|  20.4M|            res_h_CD_8x16b = _mm_maddubs_epi16(src_r2h_16x8b, coeffCD_16x8b);
 4220|       |
 4221|  20.4M|            res_l_8x16b = _mm_add_epi16(res_l_AB_8x16b, round_add32_8x16b);
 4222|  20.4M|            res_h_8x16b = _mm_add_epi16(res_h_AB_8x16b, round_add32_8x16b);
 4223|  20.4M|            res_l_8x16b = _mm_add_epi16(res_l_8x16b, res_l_CD_8x16b);
 4224|  20.4M|            res_h_8x16b = _mm_add_epi16(res_h_8x16b, res_h_CD_8x16b);
 4225|       |
 4226|  20.4M|            res_l_8x16b = _mm_srai_epi16(res_l_8x16b, 6);
 4227|  20.4M|            res_h_8x16b = _mm_srai_epi16(res_h_8x16b, 6);
 4228|       |
 4229|  20.4M|            res_16x8b = _mm_packus_epi16(res_l_8x16b, res_h_8x16b);
 4230|       |
 4231|  20.4M|            _mm_storeu_si128((__m128i *)pu1_dst, res_16x8b);
 4232|       |
 4233|  20.4M|            pu1_src += src_strd;
 4234|  20.4M|            pu1_dst += dst_strd;
 4235|       |
 4236|       |            //row 1
 4237|  20.4M|            src_r1l_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
 4238|  20.4M|            src_r1h_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + 8));
 4239|       |
 4240|  20.4M|            src_r1l_16x8b = _mm_shuffle_epi8(src_r1l_16x8b, const_shuff_16x8b);
 4241|  20.4M|            src_r1h_16x8b = _mm_shuffle_epi8(src_r1h_16x8b, const_shuff_16x8b);
 4242|       |
 4243|  20.4M|            res_l_AB_8x16b = _mm_maddubs_epi16(src_r2l_16x8b, coeffAB_16x8b);
 4244|  20.4M|            res_h_AB_8x16b = _mm_maddubs_epi16(src_r2h_16x8b, coeffAB_16x8b);
 4245|  20.4M|            res_l_CD_8x16b = _mm_maddubs_epi16(src_r1l_16x8b, coeffCD_16x8b);
 4246|  20.4M|            res_h_CD_8x16b = _mm_maddubs_epi16(src_r1h_16x8b, coeffCD_16x8b);
 4247|       |
 4248|  20.4M|            res_l_8x16b = _mm_add_epi16(res_l_AB_8x16b, round_add32_8x16b);
 4249|  20.4M|            res_h_8x16b = _mm_add_epi16(res_h_AB_8x16b, round_add32_8x16b);
 4250|  20.4M|            res_l_8x16b = _mm_add_epi16(res_l_8x16b, res_l_CD_8x16b);
 4251|  20.4M|            res_h_8x16b = _mm_add_epi16(res_h_8x16b, res_h_CD_8x16b);
 4252|       |
 4253|  20.4M|            res_l_8x16b = _mm_srai_epi16(res_l_8x16b, 6);
 4254|  20.4M|            res_h_8x16b = _mm_srai_epi16(res_h_8x16b, 6);
 4255|       |
 4256|  20.4M|            res_16x8b = _mm_packus_epi16(res_l_8x16b, res_h_8x16b);
 4257|       |
 4258|  20.4M|            _mm_storeu_si128((__m128i *)pu1_dst, res_16x8b);
 4259|       |
 4260|  20.4M|            ht -= 4;
 4261|  20.4M|            pu1_src += src_strd;
 4262|  20.4M|            pu1_dst += dst_strd;
 4263|  20.4M|        }
 4264|  20.4M|        while(ht > 0);
  ------------------
  |  Branch (4264:15): [True: 10.1M, False: 10.2M]
  ------------------
 4265|  10.2M|    }
 4266|  10.6M|}

ih264_iquant_itrans_recon_4x4_dc_ssse3:
  112|   209k|{
  113|   209k|    UWORD32 *pu4_out = (UWORD32 *)pu1_out;
  114|   209k|    WORD32 q0 = pi2_src[0];
  115|   209k|    WORD16 i_macro, rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (115:32): [True: 83.1k, False: 126k]
  ------------------
  116|       |
  117|   209k|    __m128i predload_r,pred_r0, pred_r1, pred_r2, pred_r3;
  118|   209k|    __m128i sign_reg;
  119|   209k|    __m128i zero_8x16b = _mm_setzero_si128();          // all bits reset to zero
  120|   209k|    __m128i temp4, temp5, temp6, temp7;
  121|   209k|    __m128i value_add;
  122|       |
  123|   209k|    UNUSED (pi2_tmp);
  ------------------
  |  |   45|   209k|#define UNUSED(x) ((void)(x))
  ------------------
  124|       |
  125|   209k|    INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   209k|                {\
  |  |  104|   209k|                    i4_value *= quant_scale;\
  |  |  105|   209k|                    i4_value *= weight_scale;\
  |  |  106|   209k|                    i4_value += rndfactor;\
  |  |  107|   209k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   209k|                    i4_value >>= qbits;\
  |  |  109|   209k|                }
  ------------------
  126|       |
  127|   209k|    if (iq_start_idx != 0 )
  ------------------
  |  Branch (127:9): [True: 195k, False: 14.3k]
  ------------------
  128|   195k|        q0 = pi2_dc_ld_addr[0];     // Restoring dc value for intra case
  129|       |
  130|   209k|    i_macro = ((q0 + 32) >> 6);
  131|       |
  132|   209k|    value_add = _mm_set1_epi16(i_macro);
  133|       |
  134|   209k|    zero_8x16b = _mm_setzero_si128();                  // all bits reset to zero
  135|       |    //Load pred buffer
  136|   209k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[0])); //p00 p01 p02 p03 0 0 0 0 0 0 0 0 -- all 8 bits
  137|   209k|    pred_r0 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p00 p01 p02 p03 0 0 0 0 -- all 16 bits
  138|   209k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[pred_strd])); //p10 p11 p12 p13 0 0 0 0 0 0 0 0 -- all 8 bits
  139|   209k|    pred_r1 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p10 p11 p12 p13 0 0 0 0 -- all 16 bits
  140|   209k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[2*pred_strd])); //p20 p21 p22 p23 0 0 0 0 0 0 0 0 -- all 8 bits
  141|   209k|    pred_r2 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p20 p21 p22 p23 0 0 0 0 -- all 16 bits
  142|   209k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[3*pred_strd])); //p30 p31 p32 p33 0 0 0 0 0 0 0 0 -- all 8 bits
  143|   209k|    pred_r3 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p30 p31 p32 p33 0 0 0 0 -- all 16 bits
  144|       |
  145|   209k|    pred_r0 = _mm_unpacklo_epi64(pred_r0, pred_r1); //p00 p01 p02 p03 p10 p11 p12 p13
  146|   209k|    pred_r2 = _mm_unpacklo_epi64(pred_r2, pred_r3); //p20 p21 p22p p23 p30 p31 p32 p33
  147|       |
  148|   209k|    temp4 = _mm_add_epi16(value_add, pred_r0);
  149|   209k|    temp5 = _mm_add_epi16(value_add, pred_r2);
  150|       |    /*------------------------------------------------------------------*/
  151|       |    //Clipping the results to 8 bits
  152|   209k|    sign_reg = _mm_cmpgt_epi16(temp4, zero_8x16b);                 // sign check
  153|   209k|    temp4 = _mm_and_si128(temp4, sign_reg);
  154|   209k|    sign_reg = _mm_cmpgt_epi16(temp5, zero_8x16b);                 // sign check
  155|   209k|    temp5 = _mm_and_si128(temp5, sign_reg);
  156|       |
  157|   209k|    temp4 = _mm_packus_epi16(temp4,temp5);
  158|   209k|    temp5 = _mm_srli_si128(temp4,4);
  159|   209k|    temp6 = _mm_srli_si128(temp5,4);
  160|   209k|    temp7 = _mm_srli_si128(temp6,4);
  161|       |
  162|   209k|    *pu4_out = _mm_cvtsi128_si32(temp4);
  163|   209k|    pu1_out += out_strd;
  164|   209k|    pu4_out = (UWORD32 *)(pu1_out);
  165|   209k|    *(pu4_out) = _mm_cvtsi128_si32(temp5);
  166|   209k|    pu1_out += out_strd;
  167|   209k|    pu4_out = (UWORD32 *)(pu1_out);
  168|   209k|    *(pu4_out) = _mm_cvtsi128_si32(temp6);
  169|   209k|    pu1_out += out_strd;
  170|   209k|    pu4_out = (UWORD32 *)(pu1_out);
  171|   209k|    *(pu4_out) = _mm_cvtsi128_si32(temp7);
  172|   209k|}
ih264_iquant_itrans_recon_8x8_dc_ssse3:
  238|  9.88k|{
  239|  9.88k|    WORD32 q0 = pi2_src[0];
  240|  9.88k|    WORD16 i_macro, rnd_fact = (qp_div < 6) ? 1 << (5 - qp_div) : 0;
  ------------------
  |  Branch (240:32): [True: 6.55k, False: 3.33k]
  ------------------
  241|       |
  242|  9.88k|    __m128i predload_r,pred_r0, pred_r1, pred_r2, pred_r3,pred_r4,pred_r5,pred_r6,pred_r7;
  243|  9.88k|    __m128i sign_reg;
  244|  9.88k|    __m128i zero_8x16b = _mm_setzero_si128();          // all bits reset to zero
  245|  9.88k|    __m128i temp1,temp2,temp3,temp4, temp5, temp6, temp7,temp8;
  246|  9.88k|    __m128i value_add;
  247|       |
  248|  9.88k|    UNUSED (pi2_tmp);
  ------------------
  |  |   45|  9.88k|#define UNUSED(x) ((void)(x))
  ------------------
  249|  9.88k|    UNUSED (iq_start_idx);
  ------------------
  |  |   45|  9.88k|#define UNUSED(x) ((void)(x))
  ------------------
  250|  9.88k|    UNUSED (pi2_dc_ld_addr);
  ------------------
  |  |   45|  9.88k|#define UNUSED(x) ((void)(x))
  ------------------
  251|       |
  252|  9.88k|    INV_QUANT(q0, pu2_iscale_mat[0], pu2_weigh_mat[0], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  9.88k|                {\
  |  |  104|  9.88k|                    i4_value *= quant_scale;\
  |  |  105|  9.88k|                    i4_value *= weight_scale;\
  |  |  106|  9.88k|                    i4_value += rndfactor;\
  |  |  107|  9.88k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  9.88k|                    i4_value >>= qbits;\
  |  |  109|  9.88k|                }
  ------------------
  253|  9.88k|    i_macro = ((q0 + 32) >> 6);
  254|       |
  255|  9.88k|    value_add = _mm_set1_epi16(i_macro);
  256|       |
  257|       |    //Load pred buffer row 0
  258|  9.88k|    predload_r = _mm_loadl_epi64((__m128i *)(&pu1_pred[0])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  259|  9.88k|    pred_r0 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  260|       |    //Load pred buffer row 1
  261|  9.88k|    predload_r = _mm_loadl_epi64((__m128i *)(&pu1_pred[pred_strd])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  262|  9.88k|    pred_r1 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  263|       |    //Load pred buffer row 2
  264|  9.88k|    predload_r = _mm_loadl_epi64(
  265|  9.88k|                    (__m128i *)(&pu1_pred[2 * pred_strd])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  266|  9.88k|    pred_r2 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  267|       |    //Load pred buffer row 3
  268|  9.88k|    predload_r = _mm_loadl_epi64(
  269|  9.88k|                    (__m128i *)(&pu1_pred[3 * pred_strd])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  270|  9.88k|    pred_r3 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  271|       |    //Load pred buffer row 4
  272|  9.88k|    predload_r = _mm_loadl_epi64(
  273|  9.88k|                    (__m128i *)(&pu1_pred[4 * pred_strd])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  274|  9.88k|    pred_r4 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  275|       |    //Load pred buffer row 5
  276|  9.88k|    predload_r = _mm_loadl_epi64(
  277|  9.88k|                    (__m128i *)(&pu1_pred[5 * pred_strd])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bit
  278|  9.88k|    pred_r5 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  279|       |    //Load pred buffer row 6
  280|  9.88k|    predload_r = _mm_loadl_epi64(
  281|  9.88k|                    (__m128i *)(&pu1_pred[6 * pred_strd])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  282|  9.88k|    pred_r6 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  283|       |    //Load pred buffer row 7
  284|  9.88k|    predload_r = _mm_loadl_epi64(
  285|  9.88k|                    (__m128i *)(&pu1_pred[7 * pred_strd])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  286|  9.88k|    pred_r7 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  287|       |
  288|  9.88k|    temp1 = _mm_add_epi16(value_add, pred_r0);
  289|       |
  290|  9.88k|    temp2 = _mm_add_epi16(value_add, pred_r1);
  291|       |
  292|  9.88k|    temp3 = _mm_add_epi16(value_add, pred_r2);
  293|       |
  294|  9.88k|    temp4 = _mm_add_epi16(value_add, pred_r3);
  295|       |
  296|  9.88k|    temp5 = _mm_add_epi16(value_add, pred_r4);
  297|       |
  298|  9.88k|    temp6 = _mm_add_epi16(value_add, pred_r5);
  299|       |
  300|  9.88k|    temp7 = _mm_add_epi16(value_add, pred_r6);
  301|       |
  302|  9.88k|    temp8 = _mm_add_epi16(value_add, pred_r7);
  303|       |    /*------------------------------------------------------------------*/
  304|       |    //Clipping the results to 8 bits
  305|  9.88k|    sign_reg = _mm_cmpgt_epi16(temp1, zero_8x16b); // sign check
  306|  9.88k|    temp1 = _mm_and_si128(temp1, sign_reg);
  307|  9.88k|    sign_reg = _mm_cmpgt_epi16(temp2, zero_8x16b); // sign check
  308|  9.88k|    temp2 = _mm_and_si128(temp2, sign_reg);
  309|  9.88k|    sign_reg = _mm_cmpgt_epi16(temp3, zero_8x16b); // sign check
  310|  9.88k|    temp3 = _mm_and_si128(temp3, sign_reg);
  311|  9.88k|    sign_reg = _mm_cmpgt_epi16(temp4, zero_8x16b); // sign check
  312|  9.88k|    temp4 = _mm_and_si128(temp4, sign_reg);
  313|  9.88k|    sign_reg = _mm_cmpgt_epi16(temp5, zero_8x16b); // sign check
  314|  9.88k|    temp5 = _mm_and_si128(temp5, sign_reg);
  315|  9.88k|    sign_reg = _mm_cmpgt_epi16(temp6, zero_8x16b); // sign check
  316|  9.88k|    temp6 = _mm_and_si128(temp6, sign_reg);
  317|  9.88k|    sign_reg = _mm_cmpgt_epi16(temp7, zero_8x16b); // sign check
  318|  9.88k|    temp7 = _mm_and_si128(temp7, sign_reg);
  319|  9.88k|    sign_reg = _mm_cmpgt_epi16(temp8, zero_8x16b); // sign check
  320|  9.88k|    temp8 = _mm_and_si128(temp8, sign_reg);
  321|       |
  322|  9.88k|    temp1 = _mm_packus_epi16(temp1, zero_8x16b);
  323|  9.88k|    temp2 = _mm_packus_epi16(temp2, zero_8x16b);
  324|  9.88k|    temp3 = _mm_packus_epi16(temp3, zero_8x16b);
  325|  9.88k|    temp4 = _mm_packus_epi16(temp4, zero_8x16b);
  326|  9.88k|    temp5 = _mm_packus_epi16(temp5, zero_8x16b);
  327|  9.88k|    temp6 = _mm_packus_epi16(temp6, zero_8x16b);
  328|  9.88k|    temp7 = _mm_packus_epi16(temp7, zero_8x16b);
  329|  9.88k|    temp8 = _mm_packus_epi16(temp8, zero_8x16b);
  330|       |
  331|  9.88k|    _mm_storel_epi64((__m128i *)(&pu1_out[0]), temp1);
  332|  9.88k|    _mm_storel_epi64((__m128i *)(&pu1_out[out_strd]), temp2);
  333|  9.88k|    _mm_storel_epi64((__m128i *)(&pu1_out[2 * out_strd]), temp3);
  334|  9.88k|    _mm_storel_epi64((__m128i *)(&pu1_out[3 * out_strd]), temp4);
  335|  9.88k|    _mm_storel_epi64((__m128i *)(&pu1_out[4 * out_strd]), temp5);
  336|  9.88k|    _mm_storel_epi64((__m128i *)(&pu1_out[5 * out_strd]), temp6);
  337|  9.88k|    _mm_storel_epi64((__m128i *)(&pu1_out[6 * out_strd]), temp7);
  338|  9.88k|    _mm_storel_epi64((__m128i *)(&pu1_out[7 * out_strd]), temp8);
  339|  9.88k|}
ih264_iquant_itrans_recon_chroma_4x4_dc_ssse3:
  398|   185k| {
  399|   185k|    WORD16 q0 = pi2_dc_src[0];      // DC value won't be dequantized for chroma inverse transform
  400|   185k|    WORD16 i_macro = ((q0 + 32) >> 6);
  401|       |
  402|   185k|    __m128i pred_r0, pred_r1, pred_r2, pred_r3, sign_reg;
  403|   185k|    __m128i zero_8x16b = _mm_setzero_si128();          // all bits reset to zero
  404|   185k|    __m128i chroma_mask = _mm_set1_epi16 (0xFF);
  405|   185k|    __m128i value_add = _mm_set1_epi16(i_macro);
  406|   185k|    __m128i out_r0, out_r1, out_r2, out_r3;
  407|       |
  408|   185k|    UNUSED (pi2_src);
  ------------------
  |  |   45|   185k|#define UNUSED(x) ((void)(x))
  ------------------
  409|   185k|    UNUSED (pu2_iscal_mat);
  ------------------
  |  |   45|   185k|#define UNUSED(x) ((void)(x))
  ------------------
  410|   185k|    UNUSED (pu2_weigh_mat);
  ------------------
  |  |   45|   185k|#define UNUSED(x) ((void)(x))
  ------------------
  411|   185k|    UNUSED (u4_qp_div_6);
  ------------------
  |  |   45|   185k|#define UNUSED(x) ((void)(x))
  ------------------
  412|   185k|    UNUSED (pi2_tmp);
  ------------------
  |  |   45|   185k|#define UNUSED(x) ((void)(x))
  ------------------
  413|       |
  414|       |    //Load pred buffer
  415|   185k|    pred_r0 = _mm_loadl_epi64((__m128i *) (&pu1_pred[0])); //p00 p01 p02 p03 0 0 0 0 0 0 0 0 -- all 8 bits
  416|   185k|    pred_r1 = _mm_loadl_epi64((__m128i *) (&pu1_pred[pred_strd])); //p10 p11 p12 p13 0 0 0 0 0 0 0 0 -- all 8 bits
  417|   185k|    pred_r2 = _mm_loadl_epi64((__m128i *) (&pu1_pred[2 * pred_strd])); //p20 p21 p22 p23 0 0 0 0 0 0 0 0 -- all 8 bits
  418|   185k|    pred_r3 = _mm_loadl_epi64((__m128i *) (&pu1_pred[3 * pred_strd])); //p30 p31 p32 p33 0 0 0 0 0 0 0 0 -- all 8 bits
  419|       |
  420|   185k|    pred_r0 = _mm_and_si128(pred_r0, chroma_mask);
  421|   185k|    pred_r1 = _mm_and_si128(pred_r1, chroma_mask);
  422|   185k|    pred_r2 = _mm_and_si128(pred_r2, chroma_mask);
  423|   185k|    pred_r3 = _mm_and_si128(pred_r3, chroma_mask);
  424|       |
  425|   185k|    pred_r0 = _mm_unpacklo_epi64(pred_r0, pred_r1); //p00 p01 p02 p03 p10 p11 p12 p13
  426|   185k|    pred_r2 = _mm_unpacklo_epi64(pred_r2, pred_r3); //p20 p21 p22p p23 p30 p31 p32 p33
  427|       |
  428|   185k|    pred_r0 = _mm_add_epi16(value_add, pred_r0);
  429|   185k|    pred_r2 = _mm_add_epi16(value_add, pred_r2);
  430|       |
  431|       |    /*------------------------------------------------------------------*/
  432|       |    //Clipping the results to 8 bits
  433|   185k|    sign_reg = _mm_cmpgt_epi16(pred_r0, zero_8x16b);        // sign check
  434|   185k|    pred_r0 = _mm_and_si128(pred_r0, sign_reg);
  435|   185k|    sign_reg = _mm_cmpgt_epi16(pred_r2, zero_8x16b);
  436|   185k|    pred_r2 = _mm_and_si128(pred_r2, sign_reg);
  437|       |
  438|   185k|    pred_r0 = _mm_packus_epi16(pred_r0, pred_r2);
  439|   185k|    pred_r1 = _mm_srli_si128(pred_r0, 4);
  440|   185k|    pred_r2 = _mm_srli_si128(pred_r1, 4);
  441|   185k|    pred_r3 = _mm_srli_si128(pred_r2, 4);
  442|       |
  443|   185k|    pred_r0 = _mm_unpacklo_epi8(pred_r0, zero_8x16b); //p00 p01 p02 p03 -- all 16 bits
  444|   185k|    pred_r1 = _mm_unpacklo_epi8(pred_r1, zero_8x16b); //p10 p11 p12 p13 -- all 16 bits
  445|   185k|    pred_r2 = _mm_unpacklo_epi8(pred_r2, zero_8x16b); //p20 p21 p22 p23 -- all 16 bits
  446|   185k|    pred_r3 = _mm_unpacklo_epi8(pred_r3, zero_8x16b); //p30 p31 p32 p33 -- all 16 bits
  447|       |
  448|   185k|    chroma_mask = _mm_set1_epi16 (0xFF00);
  449|   185k|    out_r0 = _mm_loadl_epi64((__m128i *) (&pu1_out[0]));
  450|   185k|    out_r1 = _mm_loadl_epi64((__m128i *) (&pu1_out[out_strd]));
  451|   185k|    out_r2 = _mm_loadl_epi64((__m128i *) (&pu1_out[2 * out_strd]));
  452|   185k|    out_r3 = _mm_loadl_epi64((__m128i *) (&pu1_out[3 * out_strd]));
  453|       |
  454|   185k|    out_r0 = _mm_and_si128(out_r0, chroma_mask);
  455|   185k|    out_r1 = _mm_and_si128(out_r1, chroma_mask);
  456|   185k|    out_r2 = _mm_and_si128(out_r2, chroma_mask);
  457|   185k|    out_r3 = _mm_and_si128(out_r3, chroma_mask);
  458|       |
  459|   185k|    out_r0 = _mm_add_epi8(out_r0, pred_r0);
  460|   185k|    out_r1 = _mm_add_epi8(out_r1, pred_r1);
  461|   185k|    out_r2 = _mm_add_epi8(out_r2, pred_r2);
  462|   185k|    out_r3 = _mm_add_epi8(out_r3, pred_r3);
  463|       |
  464|   185k|    _mm_storel_epi64((__m128i *)(&pu1_out[0]), out_r0);
  465|   185k|    _mm_storel_epi64((__m128i *)(&pu1_out[out_strd]), out_r1);
  466|   185k|    _mm_storel_epi64((__m128i *)(&pu1_out[2 * out_strd]), out_r2);
  467|   185k|    _mm_storel_epi64((__m128i *)(&pu1_out[3 * out_strd]), out_r3);
  468|   185k|}

ih264_iquant_itrans_recon_4x4_sse42:
  111|  93.3k| {
  112|  93.3k|    UWORD32 *pu4_out = (UWORD32 *) pu1_out;
  113|  93.3k|    __m128i src_r0_r1, src_r2_r3;
  114|  93.3k|    __m128i src_r0, src_r1, src_r2, src_r3;
  115|  93.3k|    __m128i scalemat_r0_r1, scalemat_r2_r3;
  116|  93.3k|    __m128i pred_r0, pred_r1, pred_r2, pred_r3;
  117|  93.3k|    __m128i sign_reg, dequant_r0_r1, dequant_r2_r3;
  118|  93.3k|    __m128i zero_8x16b = _mm_setzero_si128();          // all bits reset to zero
  119|  93.3k|    __m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
  120|  93.3k|    __m128i resq_r0, resq_r1, resq_r2, resq_r3;
  121|  93.3k|    __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
  ------------------
  |  Branch (121:41): [True: 21.3k, False: 72.0k]
  ------------------
  122|  93.3k|    __m128i value_32 = _mm_set1_epi32(32);
  123|  93.3k|    UNUSED (pi2_tmp);
  ------------------
  |  |   45|  93.3k|#define UNUSED(x) ((void)(x))
  ------------------
  124|       |
  125|       |    /*************************************************************/
  126|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
  127|       |    /* operations on platform                                    */
  128|       |    /*************************************************************/
  129|  93.3k|    src_r0_r1 = _mm_loadu_si128((__m128i *) (pi2_src)); //a00 a01 a02 a03 a10 a11 a12 a13 -- the source matrix 0th,1st row
  130|  93.3k|    src_r2_r3 = _mm_loadu_si128((__m128i *) (pi2_src + 8)); //a20 a21 a22 a23 a30 a31 a32 a33 -- the source matrix 2nd,3rd row
  131|  93.3k|    scalemat_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat)); //b00 b01 b02 b03 b10 b11 b12 b13 -- the scaling matrix 0th,1st row
  132|  93.3k|    scalemat_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat + 8)); //b20 b21 b22 b23 b30 b31 b32 b33 -- the scaling matrix 2nd,3rd row
  133|  93.3k|    dequant_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat)); //q00 q01 q02 q03 q10 q11 q12 q13 -- all 16 bits
  134|  93.3k|    dequant_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat + 8)); //q20 q21 q22 q23 q30 q31 q32 q33 -- all 16 bits
  135|       |
  136|  93.3k|    temp0 = _mm_mullo_epi16(scalemat_r0_r1, dequant_r0_r1); //b00*q00 b01*q01 b02*q02 b03*q03 b10*q10 b11*q11 b12*q12 b13*q13 -- 16 bit result
  137|  93.3k|    temp1 = _mm_mullo_epi16(scalemat_r2_r3, dequant_r2_r3); //b00*q00 b01*q01 b02*q02 b03*q03 b10*q10 b11*q11 b12*q12 b13*q13 -- 16 bit result
  138|       |
  139|  93.3k|    temp4 = _mm_unpacklo_epi16(temp0, zero_8x16b); // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
  140|  93.3k|    temp5 = _mm_unpackhi_epi16(temp0, zero_8x16b); // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  141|  93.3k|    temp6 = _mm_unpacklo_epi16(temp1, zero_8x16b); // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
  142|  93.3k|    temp7 = _mm_unpackhi_epi16(temp1, zero_8x16b); // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  143|       |
  144|  93.3k|    src_r0 = _mm_unpacklo_epi16(src_r0_r1, zero_8x16b); // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  145|  93.3k|    src_r1 = _mm_unpackhi_epi16(src_r0_r1, zero_8x16b); // a10 0 a11 0 a12 0 a13 0 -- 16 bit long
  146|  93.3k|    src_r2 = _mm_unpacklo_epi16(src_r2_r3, zero_8x16b); // a20 0 a21 0 a22 0 a23 0 -- 16 bit long
  147|  93.3k|    src_r3 = _mm_unpackhi_epi16(src_r2_r3, zero_8x16b); // a30 0 a31 0 a32 0 a33 0 -- 16 bit long
  148|       |
  149|  93.3k|    temp4 = _mm_madd_epi16(src_r0, temp4); //a00*b00*q00 a10*b10*q10 a20*b20*q20 a30*b30 q30 -- 32 bits long
  150|  93.3k|    temp5 = _mm_madd_epi16(src_r1, temp5);
  151|  93.3k|    temp6 = _mm_madd_epi16(src_r2, temp6);
  152|  93.3k|    temp7 = _mm_madd_epi16(src_r3, temp7);
  153|       |
  154|  93.3k|    if (u4_qp_div_6 >= 4) {
  ------------------
  |  Branch (154:9): [True: 72.0k, False: 21.3k]
  ------------------
  155|  72.0k|        resq_r0 = _mm_slli_epi32(temp4, u4_qp_div_6 - 4);
  156|  72.0k|        resq_r1 = _mm_slli_epi32(temp5, u4_qp_div_6 - 4);
  157|  72.0k|        resq_r2 = _mm_slli_epi32(temp6, u4_qp_div_6 - 4);
  158|  72.0k|        resq_r3 = _mm_slli_epi32(temp7, u4_qp_div_6 - 4);
  159|  72.0k|    } else {
  160|  21.3k|        temp4 = _mm_add_epi32(temp4, add_rshift);
  161|  21.3k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  162|  21.3k|        temp6 = _mm_add_epi32(temp6, add_rshift);
  163|  21.3k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  164|  21.3k|        resq_r0 = _mm_srai_epi32(temp4, 4 - u4_qp_div_6);
  165|  21.3k|        resq_r1 = _mm_srai_epi32(temp5, 4 - u4_qp_div_6);
  166|  21.3k|        resq_r2 = _mm_srai_epi32(temp6, 4 - u4_qp_div_6);
  167|  21.3k|        resq_r3 = _mm_srai_epi32(temp7, 4 - u4_qp_div_6);
  168|  21.3k|    }
  169|       |
  170|  93.3k|    if (iq_start_idx == 1)
  ------------------
  |  Branch (170:9): [True: 3.54k, False: 89.7k]
  ------------------
  171|  3.54k|        resq_r0 = _mm_insert_epi32(resq_r0,(WORD32)pi2_dc_ld_addr[0],0);
  172|       |    /* Perform Inverse transform */
  173|       |    /*-------------------------------------------------------------*/
  174|       |    /* IDCT [ Horizontal transformation ]                          */
  175|       |    /*-------------------------------------------------------------*/
  176|       |    // Matrix transpose
  177|       |    /*
  178|       |     *  a0 a1 a2 a3
  179|       |     *  b0 b1 b2 b3
  180|       |     *  c0 c1 c2 c3
  181|       |     *  d0 d1 d2 d3
  182|       |     */
  183|  93.3k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);                  //a0 b0 a1 b1
  184|  93.3k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);                  //c0 d0 c1 d1
  185|  93.3k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);                  //a2 b2 a3 b3
  186|  93.3k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);                  //c2 d2 c3 d3
  187|  93.3k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);                    //a0 b0 c0 d0
  188|  93.3k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);                    //a1 b1 c1 d1
  189|  93.3k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);                    //a2 b2 c2 d2
  190|  93.3k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);                    //a3 b3 c3 d3
  191|       |    //Transform starts -- horizontal transform
  192|       |    /*------------------------------------------------------------------*/
  193|       |    /* z0 = w0 + w2                                             */
  194|  93.3k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  195|       |    /* z1 = w0 - w2                                             */
  196|  93.3k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  197|       |    /* z2 = (w1 >> 1) - w3                                      */
  198|  93.3k|    temp2 = _mm_srai_epi32(resq_r1, 1);                         //(w1>>1)
  199|  93.3k|    temp2 = _mm_sub_epi32(temp2, resq_r3);                      //(w1>>1) - w3
  200|       |    /* z3 = w1 + (w3 >> 1)                                      */
  201|  93.3k|    temp3 = _mm_srai_epi32(resq_r3, 1);                         //(w3>>1) + w1
  202|  93.3k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  203|       |    /*----------------------------------------------------------*/
  204|       |    /* x0 = z0 + z3                                             */
  205|  93.3k|    resq_r0 = _mm_add_epi32(temp0, temp3);
  206|       |    /* x1 = z1 + z2                                             */
  207|  93.3k|    resq_r1 = _mm_add_epi32(temp1, temp2);
  208|       |    /* x2 = z1 - z2                                             */
  209|  93.3k|    resq_r2 = _mm_sub_epi32(temp1, temp2);
  210|       |    /* x3 = z0 - z3                                             */
  211|  93.3k|    resq_r3 = _mm_sub_epi32(temp0, temp3);
  212|       |    // Matrix transpose
  213|       |    /*
  214|       |     *  a0 b0 c0 d0
  215|       |     *  a1 b1 c1 d1
  216|       |     *  a2 b2 c2 d2
  217|       |     *  a3 b3 c3 d3
  218|       |     */
  219|  93.3k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);                  //a0 a1 b0 b1
  220|  93.3k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);                  //a2 a3 b2 b3
  221|  93.3k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);                  //c0 c1 d0 d1
  222|  93.3k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);                  //c2 c3 d2 d3
  223|  93.3k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);                    //a0 a1 a2 a3
  224|  93.3k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);                    //b0 b1 b2 b3
  225|  93.3k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);                    //c0 c1 c2 c3
  226|  93.3k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);                    //d0 d1 d2 d3
  227|       |    //Transform ends -- horizontal transform
  228|       |
  229|       |    //Load pred buffer
  230|  93.3k|    pred_r0 = loadu_32(&pu1_pred[0]); //p00 p01 p02 p03 -- all 8 bits
  231|  93.3k|    pred_r1 = loadu_32(&pu1_pred[pred_strd]); //p10 p11 p12 p13 -- all 8 bits
  232|  93.3k|    pred_r2 = loadu_32(&pu1_pred[2 * pred_strd]); //p20 p21 p22 p23 -- all 8 bits
  233|  93.3k|    pred_r3 = loadu_32(&pu1_pred[3 * pred_strd]); //p30 p31 p32 p33 -- all 8 bits
  234|       |
  235|  93.3k|    pred_r0 = _mm_cvtepu8_epi32(pred_r0); //p00 p01 p02 p03 -- all 32 bits
  236|  93.3k|    pred_r1 = _mm_cvtepu8_epi32(pred_r1); //p10 p11 p12 p13 -- all 32 bits
  237|  93.3k|    pred_r2 = _mm_cvtepu8_epi32(pred_r2); //p20 p21 p22 p23 -- all 32 bits
  238|  93.3k|    pred_r3 = _mm_cvtepu8_epi32(pred_r3); //p30 p31 p32 p33 -- all 32 bits
  239|       |
  240|       |    /*--------------------------------------------------------------*/
  241|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6      */
  242|       |    /*                                                              */
  243|       |    /* Add the prediction and store it back to same buffer          */
  244|       |    /*--------------------------------------------------------------*/
  245|       |    /* z0j = y0j + y2j                                                        */
  246|  93.3k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  247|       |    /* z1j = y0j - y2j                                                        */
  248|  93.3k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  249|       |    /* z2j = (y1j>>1) - y3j                                                        */
  250|  93.3k|    temp2 = _mm_srai_epi32(resq_r1, 1);                             //(y1j>>1)
  251|  93.3k|    temp2 = _mm_sub_epi32(temp2, resq_r3);
  252|       |    /* z3j = y1j + (y3j>>1)                                                        */
  253|  93.3k|    temp3 = _mm_srai_epi32(resq_r3, 1);                             //(y3j>>1)
  254|  93.3k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  255|       |
  256|       |    /* x0j = z0j + z3j                                                        */
  257|  93.3k|    temp4 = _mm_add_epi32(temp0, temp3);
  258|  93.3k|    temp4 = _mm_add_epi32(temp4, value_32);
  259|  93.3k|    temp4 = _mm_srai_epi32(temp4, 6);
  260|  93.3k|    temp4 = _mm_add_epi32(temp4, pred_r0);
  261|       |    /* x1j = z1j + z2j                                                        */
  262|  93.3k|    temp5 = _mm_add_epi32(temp1, temp2);
  263|  93.3k|    temp5 = _mm_add_epi32(temp5, value_32);
  264|  93.3k|    temp5 = _mm_srai_epi32(temp5, 6);
  265|  93.3k|    temp5 = _mm_add_epi32(temp5, pred_r1);
  266|       |    /* x2j = z1j - z2j                                                        */
  267|  93.3k|    temp6 = _mm_sub_epi32(temp1, temp2);
  268|  93.3k|    temp6 = _mm_add_epi32(temp6, value_32);
  269|  93.3k|    temp6 = _mm_srai_epi32(temp6, 6);
  270|  93.3k|    temp6 = _mm_add_epi32(temp6, pred_r2);
  271|       |    /* x3j = z0j - z3j                                                        */
  272|  93.3k|    temp7 = _mm_sub_epi32(temp0, temp3);
  273|  93.3k|    temp7 = _mm_add_epi32(temp7, value_32);
  274|  93.3k|    temp7 = _mm_srai_epi32(temp7, 6);
  275|  93.3k|    temp7 = _mm_add_epi32(temp7, pred_r3);
  276|       |
  277|       |    // 32-bit to 16-bit conversion
  278|  93.3k|    temp0 = _mm_packs_epi32(temp4, temp5);
  279|  93.3k|    temp1 = _mm_packs_epi32(temp6, temp7);
  280|       |    /*------------------------------------------------------------------*/
  281|       |    //Clipping the results to 8 bits
  282|  93.3k|    sign_reg = _mm_cmpgt_epi16(temp0, zero_8x16b);      // sign check
  283|  93.3k|    temp0 = _mm_and_si128(temp0, sign_reg);
  284|  93.3k|    sign_reg = _mm_cmpgt_epi16(temp1, zero_8x16b);
  285|  93.3k|    temp1 = _mm_and_si128(temp1, sign_reg);
  286|       |
  287|  93.3k|    resq_r0 = _mm_packus_epi16(temp0, temp1);
  288|  93.3k|    resq_r1 = _mm_srli_si128(resq_r0, 4);
  289|  93.3k|    resq_r2 = _mm_srli_si128(resq_r1, 4);
  290|  93.3k|    resq_r3 = _mm_srli_si128(resq_r2, 4);
  291|       |
  292|  93.3k|    *pu4_out = _mm_cvtsi128_si32(resq_r0);
  293|  93.3k|    pu1_out += out_strd;
  294|  93.3k|    pu4_out = (UWORD32 *) (pu1_out);
  295|  93.3k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r1);
  296|  93.3k|    pu1_out += out_strd;
  297|  93.3k|    pu4_out = (UWORD32 *) (pu1_out);
  298|  93.3k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r2);
  299|  93.3k|    pu1_out += out_strd;
  300|  93.3k|    pu4_out = (UWORD32 *) (pu1_out);
  301|  93.3k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r3);
  302|  93.3k|}
ih264_iquant_itrans_recon_chroma_4x4_sse42:
  361|  18.3k| {
  362|  18.3k|    __m128i src_r0_r1, src_r2_r3;
  363|  18.3k|    __m128i src_r0, src_r1, src_r2, src_r3;
  364|  18.3k|    __m128i scalemat_r0_r1, scalemat_r2_r3;
  365|  18.3k|    __m128i pred_r0, pred_r1, pred_r2, pred_r3;
  366|  18.3k|    __m128i sign_reg, dequant_r0_r1, dequant_r2_r3;
  367|  18.3k|    __m128i zero_8x16b = _mm_setzero_si128();          // all bits reset to zero
  368|  18.3k|    __m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
  369|  18.3k|    __m128i resq_r0, resq_r1, resq_r2, resq_r3;
  370|  18.3k|    __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
  ------------------
  |  Branch (370:41): [True: 6.36k, False: 11.9k]
  ------------------
  371|  18.3k|    __m128i value_32 = _mm_set1_epi32(32);
  372|  18.3k|    __m128i chroma_mask = _mm_set1_epi16 (0xFF);
  373|  18.3k|    __m128i out_r0, out_r1, out_r2, out_r3;
  374|  18.3k|    UNUSED (pi2_tmp);
  ------------------
  |  |   45|  18.3k|#define UNUSED(x) ((void)(x))
  ------------------
  375|       |
  376|       |    /*************************************************************/
  377|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
  378|       |    /* operations on platform                                    */
  379|       |    /*************************************************************/
  380|  18.3k|    src_r0_r1 = _mm_loadu_si128((__m128i *) (pi2_src)); //a00 a01 a02 a03 a10 a11 a12 a13 -- the source matrix 0th,1st row
  381|  18.3k|    src_r2_r3 = _mm_loadu_si128((__m128i *) (pi2_src + 8)); //a20 a21 a22 a23 a30 a31 a32 a33 -- the source matrix 2nd,3rd row
  382|  18.3k|    scalemat_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat)); //b00 b01 b02 b03 b10 b11 b12 b13 -- the scaling matrix 0th,1st row
  383|  18.3k|    scalemat_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat + 8)); //b20 b21 b22 b23 b30 b31 b32 b33 -- the scaling matrix 2nd,3rd row
  384|  18.3k|    dequant_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat)); //q00 q01 q02 q03 q10 q11 q12 q13 -- all 16 bits
  385|  18.3k|    dequant_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat + 8)); //q20 q21 q22 q23 q30 q31 q32 q33 -- all 16 bits
  386|       |
  387|  18.3k|    temp0 = _mm_mullo_epi16(scalemat_r0_r1, dequant_r0_r1); //b00*q00 b01*q01 b02*q02 b03*q03 b10*q10 b11*q11 b12*q12 b13*q13 -- 16 bit result
  388|  18.3k|    temp1 = _mm_mullo_epi16(scalemat_r2_r3, dequant_r2_r3); //b00*q00 b01*q01 b02*q02 b03*q03 b10*q10 b11*q11 b12*q12 b13*q13 -- 16 bit result
  389|       |
  390|  18.3k|    temp4 = _mm_unpacklo_epi16(temp0, zero_8x16b); // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
  391|  18.3k|    temp5 = _mm_unpackhi_epi16(temp0, zero_8x16b); // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  392|  18.3k|    temp6 = _mm_unpacklo_epi16(temp1, zero_8x16b); // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
  393|  18.3k|    temp7 = _mm_unpackhi_epi16(temp1, zero_8x16b); // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  394|       |
  395|  18.3k|    src_r0 = _mm_unpacklo_epi16(src_r0_r1, zero_8x16b); // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  396|  18.3k|    src_r1 = _mm_unpackhi_epi16(src_r0_r1, zero_8x16b); // a10 0 a11 0 a12 0 a13 0 -- 16 bit long
  397|  18.3k|    src_r2 = _mm_unpacklo_epi16(src_r2_r3, zero_8x16b); // a20 0 a21 0 a22 0 a23 0 -- 16 bit long
  398|  18.3k|    src_r3 = _mm_unpackhi_epi16(src_r2_r3, zero_8x16b); // a30 0 a31 0 a32 0 a33 0 -- 16 bit long
  399|       |
  400|  18.3k|    temp4 = _mm_madd_epi16(src_r0, temp4); //a00*b00*q00 a10*b10*q10 a20*b20*q20 a30*b30 q30 -- 32 bits long
  401|  18.3k|    temp5 = _mm_madd_epi16(src_r1, temp5);
  402|  18.3k|    temp6 = _mm_madd_epi16(src_r2, temp6);
  403|  18.3k|    temp7 = _mm_madd_epi16(src_r3, temp7);
  404|       |
  405|  18.3k|    if (u4_qp_div_6 >= 4) {
  ------------------
  |  Branch (405:9): [True: 11.9k, False: 6.36k]
  ------------------
  406|  11.9k|        resq_r0 = _mm_slli_epi32(temp4, u4_qp_div_6 - 4);
  407|  11.9k|        resq_r1 = _mm_slli_epi32(temp5, u4_qp_div_6 - 4);
  408|  11.9k|        resq_r2 = _mm_slli_epi32(temp6, u4_qp_div_6 - 4);
  409|  11.9k|        resq_r3 = _mm_slli_epi32(temp7, u4_qp_div_6 - 4);
  410|  11.9k|    } else {
  411|  6.36k|        temp4 = _mm_add_epi32(temp4, add_rshift);
  412|  6.36k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  413|  6.36k|        temp6 = _mm_add_epi32(temp6, add_rshift);
  414|  6.36k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  415|  6.36k|        resq_r0 = _mm_srai_epi32(temp4, 4 - u4_qp_div_6);
  416|  6.36k|        resq_r1 = _mm_srai_epi32(temp5, 4 - u4_qp_div_6);
  417|  6.36k|        resq_r2 = _mm_srai_epi32(temp6, 4 - u4_qp_div_6);
  418|  6.36k|        resq_r3 = _mm_srai_epi32(temp7, 4 - u4_qp_div_6);
  419|  6.36k|    }
  420|       |
  421|  18.3k|    resq_r0 = _mm_insert_epi32(resq_r0,(WORD32)pi2_dc_ld_addr[0],0);
  422|       |    /* Perform Inverse transform */
  423|       |    /*-------------------------------------------------------------*/
  424|       |    /* IDCT [ Horizontal transformation ]                          */
  425|       |    /*-------------------------------------------------------------*/
  426|       |    // Matrix transpose
  427|       |    /*
  428|       |     *  a0 a1 a2 a3
  429|       |     *  b0 b1 b2 b3
  430|       |     *  c0 c1 c2 c3
  431|       |     *  d0 d1 d2 d3
  432|       |     */
  433|  18.3k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);                  //a0 b0 a1 b1
  434|  18.3k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);                  //c0 d0 c1 d1
  435|  18.3k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);                  //a2 b2 a3 b3
  436|  18.3k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);                  //c2 d2 c3 d3
  437|  18.3k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);                    //a0 b0 c0 d0
  438|  18.3k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);                    //a1 b1 c1 d1
  439|  18.3k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);                    //a2 b2 c2 d2
  440|  18.3k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);                    //a3 b3 c3 d3
  441|       |    //Transform starts -- horizontal transform
  442|       |    /*------------------------------------------------------------------*/
  443|       |    /* z0 = w0 + w2                                             */
  444|  18.3k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  445|       |    /* z1 = w0 - w2                                             */
  446|  18.3k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  447|       |    /* z2 = (w1 >> 1) - w3                                      */
  448|  18.3k|    temp2 = _mm_srai_epi32(resq_r1, 1);                         //(w1>>1)
  449|  18.3k|    temp2 = _mm_sub_epi32(temp2, resq_r3);                      //(w1>>1) - w3
  450|       |    /* z3 = w1 + (w3 >> 1)                                      */
  451|  18.3k|    temp3 = _mm_srai_epi32(resq_r3, 1);                         //(w3>>1) + w1
  452|  18.3k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  453|       |    /*----------------------------------------------------------*/
  454|       |    /* x0 = z0 + z3                                             */
  455|  18.3k|    resq_r0 = _mm_add_epi32(temp0, temp3);
  456|       |    /* x1 = z1 + z2                                             */
  457|  18.3k|    resq_r1 = _mm_add_epi32(temp1, temp2);
  458|       |    /* x2 = z1 - z2                                             */
  459|  18.3k|    resq_r2 = _mm_sub_epi32(temp1, temp2);
  460|       |    /* x3 = z0 - z3                                             */
  461|  18.3k|    resq_r3 = _mm_sub_epi32(temp0, temp3);
  462|       |    // Matrix transpose
  463|       |    /*
  464|       |     *  a0 b0 c0 d0
  465|       |     *  a1 b1 c1 d1
  466|       |     *  a2 b2 c2 d2
  467|       |     *  a3 b3 c3 d3
  468|       |     */
  469|  18.3k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);                  //a0 a1 b0 b1
  470|  18.3k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);                  //a2 a3 b2 b3
  471|  18.3k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);                  //c0 c1 d0 d1
  472|  18.3k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);                  //c2 c3 d2 d3
  473|  18.3k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);                    //a0 a1 a2 a3
  474|  18.3k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);                    //b0 b1 b2 b3
  475|  18.3k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);                    //c0 c1 c2 c3
  476|  18.3k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);                    //d0 d1 d2 d3
  477|       |    //Transform ends -- horizontal transform
  478|       |
  479|       |    //Load pred buffer
  480|  18.3k|    pred_r0 = _mm_loadl_epi64((__m128i *) (&pu1_pred[0])); //p00 p01 p02 p03 0 0 0 0 0 0 0 0 -- all 8 bits
  481|  18.3k|    pred_r1 = _mm_loadl_epi64((__m128i *) (&pu1_pred[pred_strd])); //p10 p11 p12 p13 0 0 0 0 0 0 0 0 -- all 8 bits
  482|  18.3k|    pred_r2 = _mm_loadl_epi64((__m128i *) (&pu1_pred[2 * pred_strd])); //p20 p21 p22 p23 0 0 0 0 0 0 0 0 -- all 8 bits
  483|  18.3k|    pred_r3 = _mm_loadl_epi64((__m128i *) (&pu1_pred[3 * pred_strd])); //p30 p31 p32 p33 0 0 0 0 0 0 0 0 -- all 8 bits
  484|       |
  485|  18.3k|    pred_r0 = _mm_and_si128(pred_r0, chroma_mask);
  486|  18.3k|    pred_r1 = _mm_and_si128(pred_r1, chroma_mask);
  487|  18.3k|    pred_r2 = _mm_and_si128(pred_r2, chroma_mask);
  488|  18.3k|    pred_r3 = _mm_and_si128(pred_r3, chroma_mask);
  489|       |
  490|  18.3k|    pred_r0 = _mm_cvtepu16_epi32(pred_r0); //p00 p01 p02 p03 -- all 32 bits
  491|  18.3k|    pred_r1 = _mm_cvtepu16_epi32(pred_r1); //p10 p11 p12 p13 -- all 32 bits
  492|  18.3k|    pred_r2 = _mm_cvtepu16_epi32(pred_r2); //p20 p21 p22 p23 -- all 32 bits
  493|  18.3k|    pred_r3 = _mm_cvtepu16_epi32(pred_r3); //p30 p31 p32 p33 -- all 32 bits
  494|       |
  495|       |    /*--------------------------------------------------------------*/
  496|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6      */
  497|       |    /*                                                              */
  498|       |    /* Add the prediction and store it back to same buffer          */
  499|       |    /*--------------------------------------------------------------*/
  500|       |    /* z0j = y0j + y2j                                                        */
  501|  18.3k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  502|       |    /* z1j = y0j - y2j                                                        */
  503|  18.3k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  504|       |    /* z2j = (y1j>>1) - y3j                                                        */
  505|  18.3k|    temp2 = _mm_srai_epi32(resq_r1, 1);                             //(y1j>>1)
  506|  18.3k|    temp2 = _mm_sub_epi32(temp2, resq_r3);
  507|       |    /* z3j = y1j + (y3j>>1)                                                        */
  508|  18.3k|    temp3 = _mm_srai_epi32(resq_r3, 1);                             //(y3j>>1)
  509|  18.3k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  510|       |
  511|       |    /* x0j = z0j + z3j                                                        */
  512|  18.3k|    temp4 = _mm_add_epi32(temp0, temp3);
  513|  18.3k|    temp4 = _mm_add_epi32(temp4, value_32);
  514|  18.3k|    temp4 = _mm_srai_epi32(temp4, 6);
  515|  18.3k|    temp4 = _mm_add_epi32(temp4, pred_r0);
  516|       |    /* x1j = z1j + z2j                                                        */
  517|  18.3k|    temp5 = _mm_add_epi32(temp1, temp2);
  518|  18.3k|    temp5 = _mm_add_epi32(temp5, value_32);
  519|  18.3k|    temp5 = _mm_srai_epi32(temp5, 6);
  520|  18.3k|    temp5 = _mm_add_epi32(temp5, pred_r1);
  521|       |    /* x2j = z1j - z2j                                                        */
  522|  18.3k|    temp6 = _mm_sub_epi32(temp1, temp2);
  523|  18.3k|    temp6 = _mm_add_epi32(temp6, value_32);
  524|  18.3k|    temp6 = _mm_srai_epi32(temp6, 6);
  525|  18.3k|    temp6 = _mm_add_epi32(temp6, pred_r2);
  526|       |    /* x3j = z0j - z3j                                                        */
  527|  18.3k|    temp7 = _mm_sub_epi32(temp0, temp3);
  528|  18.3k|    temp7 = _mm_add_epi32(temp7, value_32);
  529|  18.3k|    temp7 = _mm_srai_epi32(temp7, 6);
  530|  18.3k|    temp7 = _mm_add_epi32(temp7, pred_r3);
  531|       |
  532|       |    // 32-bit to 16-bit conversion
  533|  18.3k|    temp0 = _mm_packs_epi32(temp4, temp5);
  534|  18.3k|    temp1 = _mm_packs_epi32(temp6, temp7);
  535|       |    /*------------------------------------------------------------------*/
  536|       |    //Clipping the results to 8 bits
  537|  18.3k|    sign_reg = _mm_cmpgt_epi16(temp0, zero_8x16b);      // sign check
  538|  18.3k|    temp0 = _mm_and_si128(temp0, sign_reg);
  539|  18.3k|    sign_reg = _mm_cmpgt_epi16(temp1, zero_8x16b);
  540|  18.3k|    temp1 = _mm_and_si128(temp1, sign_reg);
  541|       |
  542|  18.3k|    resq_r0 = _mm_packus_epi16(temp0, temp1);
  543|  18.3k|    resq_r1 = _mm_srli_si128(resq_r0, 4);
  544|  18.3k|    resq_r2 = _mm_srli_si128(resq_r1, 4);
  545|  18.3k|    resq_r3 = _mm_srli_si128(resq_r2, 4);
  546|       |
  547|  18.3k|    resq_r0 = _mm_cvtepu8_epi16(resq_r0); //p00 p01 p02 p03 -- all 16 bits
  548|  18.3k|    resq_r1 = _mm_cvtepu8_epi16(resq_r1); //p10 p11 p12 p13 -- all 16 bits
  549|  18.3k|    resq_r2 = _mm_cvtepu8_epi16(resq_r2); //p20 p21 p22 p23 -- all 16 bits
  550|  18.3k|    resq_r3 = _mm_cvtepu8_epi16(resq_r3); //p30 p31 p32 p33 -- all 16 bits
  551|       |
  552|  18.3k|    chroma_mask = _mm_set1_epi16 (0xFF00);
  553|  18.3k|    out_r0 = _mm_loadl_epi64((__m128i *) (&pu1_out[0]));
  554|  18.3k|    out_r1 = _mm_loadl_epi64((__m128i *) (&pu1_out[out_strd]));
  555|  18.3k|    out_r2 = _mm_loadl_epi64((__m128i *) (&pu1_out[2 * out_strd]));
  556|  18.3k|    out_r3 = _mm_loadl_epi64((__m128i *) (&pu1_out[3 * out_strd]));
  557|       |
  558|  18.3k|    out_r0 = _mm_and_si128(out_r0, chroma_mask);
  559|  18.3k|    out_r1 = _mm_and_si128(out_r1, chroma_mask);
  560|  18.3k|    out_r2 = _mm_and_si128(out_r2, chroma_mask);
  561|  18.3k|    out_r3 = _mm_and_si128(out_r3, chroma_mask);
  562|       |
  563|  18.3k|    out_r0 = _mm_add_epi8(out_r0, resq_r0);
  564|  18.3k|    out_r1 = _mm_add_epi8(out_r1, resq_r1);
  565|  18.3k|    out_r2 = _mm_add_epi8(out_r2, resq_r2);
  566|  18.3k|    out_r3 = _mm_add_epi8(out_r3, resq_r3);
  567|       |
  568|  18.3k|    _mm_storel_epi64((__m128i *)(&pu1_out[0]), out_r0);
  569|  18.3k|    _mm_storel_epi64((__m128i *)(&pu1_out[out_strd]), out_r1);
  570|  18.3k|    _mm_storel_epi64((__m128i *)(&pu1_out[2 * out_strd]), out_r2);
  571|  18.3k|    _mm_storel_epi64((__m128i *)(&pu1_out[3 * out_strd]), out_r3);
  572|  18.3k|}

ih264_iquant_itrans_recon_4x4_ssse3:
  111|  11.4k|{
  112|  11.4k|    UWORD32 *pu4_out = (UWORD32 *) pu1_out;
  113|  11.4k|    __m128i src_r0_r1, src_r2_r3;
  114|  11.4k|    __m128i src_r0, src_r1, src_r2, src_r3;
  115|  11.4k|    __m128i scalemat_r0_r1, scalemat_r2_r3, predload_r;
  116|  11.4k|    __m128i pred_r0, pred_r1, pred_r2, pred_r3;
  117|  11.4k|    __m128i sign_reg, dequant_r0_r1, dequant_r2_r3;
  118|  11.4k|    __m128i zero_8x16b = _mm_setzero_si128();          // all bits reset to zero
  119|  11.4k|    __m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
  120|  11.4k|    __m128i resq_r0, resq_r1, resq_r2, resq_r3;
  121|  11.4k|    __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
  ------------------
  |  Branch (121:41): [True: 2.95k, False: 8.52k]
  ------------------
  122|  11.4k|    __m128i value_32 = _mm_set1_epi32(32);
  123|  11.4k|    UNUSED (pi2_tmp);
  ------------------
  |  |   45|  11.4k|#define UNUSED(x) ((void)(x))
  ------------------
  124|  11.4k|    UNUSED (pi2_dc_ld_addr);
  ------------------
  |  |   45|  11.4k|#define UNUSED(x) ((void)(x))
  ------------------
  125|       |
  126|       |    /*************************************************************/
  127|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
  128|       |    /* operations on platform                                    */
  129|       |    /*************************************************************/
  130|  11.4k|    src_r0_r1 = _mm_loadu_si128((__m128i *) (pi2_src)); //a00 a01 a02 a03 a10 a11 a12 a13 -- the source matrix 0th,1st row
  131|  11.4k|    src_r2_r3 = _mm_loadu_si128((__m128i *) (pi2_src + 8)); //a20 a21 a22 a23 a30 a31 a32 a33 -- the source matrix 2nd,3rd row
  132|  11.4k|    scalemat_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat)); //b00 b01 b02 b03 b10 b11 b12 b13 -- the scaling matrix 0th,1st row
  133|  11.4k|    scalemat_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat + 8)); //b20 b21 b22 b23 b30 b31 b32 b33 -- the scaling matrix 2nd,3rd row
  134|  11.4k|    dequant_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat)); //q00 q01 q02 q03 q10 q11 q12 q13 -- all 16 bits
  135|  11.4k|    dequant_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat + 8)); //q20 q21 q22 q23 q30 q31 q32 q33 -- all 16 bits
  136|       |
  137|  11.4k|    temp0 = _mm_mullo_epi16(scalemat_r0_r1, dequant_r0_r1); //b00*q00 b01*q01 b02*q02 b03*q03 b10*q10 b11*q11 b12*q12 b13*q13 -- 16 bit result
  138|  11.4k|    temp1 = _mm_mullo_epi16(scalemat_r2_r3, dequant_r2_r3); //b00*q00 b01*q01 b02*q02 b03*q03 b10*q10 b11*q11 b12*q12 b13*q13 -- 16 bit result
  139|       |
  140|  11.4k|    temp4 = _mm_unpacklo_epi16(temp0, zero_8x16b); // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
  141|  11.4k|    temp5 = _mm_unpackhi_epi16(temp0, zero_8x16b); // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  142|  11.4k|    temp6 = _mm_unpacklo_epi16(temp1, zero_8x16b); // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
  143|  11.4k|    temp7 = _mm_unpackhi_epi16(temp1, zero_8x16b); // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  144|       |
  145|  11.4k|    src_r0 = _mm_unpacklo_epi16(src_r0_r1, zero_8x16b); // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  146|  11.4k|    src_r1 = _mm_unpackhi_epi16(src_r0_r1, zero_8x16b); // a10 0 a11 0 a12 0 a13 0 -- 16 bit long
  147|  11.4k|    src_r2 = _mm_unpacklo_epi16(src_r2_r3, zero_8x16b); // a20 0 a21 0 a22 0 a23 0 -- 16 bit long
  148|  11.4k|    src_r3 = _mm_unpackhi_epi16(src_r2_r3, zero_8x16b); // a30 0 a31 0 a32 0 a33 0 -- 16 bit long
  149|       |
  150|  11.4k|    temp4 = _mm_madd_epi16(src_r0, temp4); //a00*b00*q00 a10*b10*q10 a20*b20*q20 a30*b30 q30 -- 32 bits long
  151|  11.4k|    temp5 = _mm_madd_epi16(src_r1, temp5);
  152|  11.4k|    temp6 = _mm_madd_epi16(src_r2, temp6);
  153|  11.4k|    temp7 = _mm_madd_epi16(src_r3, temp7);
  154|       |
  155|  11.4k|    if (u4_qp_div_6 >= 4) {
  ------------------
  |  Branch (155:9): [True: 8.52k, False: 2.95k]
  ------------------
  156|  8.52k|        resq_r0 = _mm_slli_epi32(temp4, u4_qp_div_6 - 4);
  157|  8.52k|        resq_r1 = _mm_slli_epi32(temp5, u4_qp_div_6 - 4);
  158|  8.52k|        resq_r2 = _mm_slli_epi32(temp6, u4_qp_div_6 - 4);
  159|  8.52k|        resq_r3 = _mm_slli_epi32(temp7, u4_qp_div_6 - 4);
  160|  8.52k|    } else {
  161|  2.95k|        temp4 = _mm_add_epi32(temp4, add_rshift);
  162|  2.95k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  163|  2.95k|        temp6 = _mm_add_epi32(temp6, add_rshift);
  164|  2.95k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  165|  2.95k|        resq_r0 = _mm_srai_epi32(temp4, 4 - u4_qp_div_6);
  166|  2.95k|        resq_r1 = _mm_srai_epi32(temp5, 4 - u4_qp_div_6);
  167|  2.95k|        resq_r2 = _mm_srai_epi32(temp6, 4 - u4_qp_div_6);
  168|  2.95k|        resq_r3 = _mm_srai_epi32(temp7, 4 - u4_qp_div_6);
  169|  2.95k|    }
  170|       |
  171|  11.4k|    if (iq_start_idx == 1)
  ------------------
  |  Branch (171:9): [True: 1.42k, False: 10.0k]
  ------------------
  172|  1.42k|    {
  173|  1.42k|        resq_r0 = _mm_insert_epi16(resq_r0,(WORD32)pi2_src[0],0);
  174|  1.42k|        if (pi2_src[0] >= 0)
  ------------------
  |  Branch (174:13): [True: 966, False: 460]
  ------------------
  175|    966|            resq_r0 = _mm_insert_epi16(resq_r0,0,1);
  176|    460|        else
  177|    460|            resq_r0 = _mm_insert_epi16(resq_r0,-1,1);
  178|  1.42k|    }
  179|       |    /* Perform Inverse transform */
  180|       |    /*-------------------------------------------------------------*/
  181|       |    /* IDCT [ Horizontal transformation ]                          */
  182|       |    /*-------------------------------------------------------------*/
  183|       |    // Matrix transpose
  184|       |    /*
  185|       |     *  a0 a1 a2 a3
  186|       |     *  b0 b1 b2 b3
  187|       |     *  c0 c1 c2 c3
  188|       |     *  d0 d1 d2 d3
  189|       |     */
  190|  11.4k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);                  //a0 b0 a1 b1
  191|  11.4k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);                  //c0 d0 c1 d1
  192|  11.4k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);                  //a2 b2 a3 b3
  193|  11.4k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);                  //c2 d2 c3 d3
  194|  11.4k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);                    //a0 b0 c0 d0
  195|  11.4k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);                    //a1 b1 c1 d1
  196|  11.4k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);                    //a2 b2 c2 d2
  197|  11.4k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);                    //a3 b3 c3 d3
  198|       |    //Transform starts -- horizontal transform
  199|       |    /*------------------------------------------------------------------*/
  200|       |    /* z0 = w0 + w2                                             */
  201|  11.4k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  202|       |    /* z1 = w0 - w2                                             */
  203|  11.4k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  204|       |    /* z2 = (w1 >> 1) - w3                                      */
  205|  11.4k|    temp2 = _mm_srai_epi32(resq_r1, 1);                         //(w1>>1)
  206|  11.4k|    temp2 = _mm_sub_epi32(temp2, resq_r3);                      //(w1>>1) - w3
  207|       |    /* z3 = w1 + (w3 >> 1)                                      */
  208|  11.4k|    temp3 = _mm_srai_epi32(resq_r3, 1);                         //(w3>>1) + w1
  209|  11.4k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  210|       |    /*----------------------------------------------------------*/
  211|       |    /* x0 = z0 + z3                                             */
  212|  11.4k|    resq_r0 = _mm_add_epi32(temp0, temp3);
  213|       |    /* x1 = z1 + z2                                             */
  214|  11.4k|    resq_r1 = _mm_add_epi32(temp1, temp2);
  215|       |    /* x2 = z1 - z2                                             */
  216|  11.4k|    resq_r2 = _mm_sub_epi32(temp1, temp2);
  217|       |    /* x3 = z0 - z3                                             */
  218|  11.4k|    resq_r3 = _mm_sub_epi32(temp0, temp3);
  219|       |    // Matrix transpose
  220|       |    /*
  221|       |     *  a0 b0 c0 d0
  222|       |     *  a1 b1 c1 d1
  223|       |     *  a2 b2 c2 d2
  224|       |     *  a3 b3 c3 d3
  225|       |     */
  226|  11.4k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);                  //a0 a1 b0 b1
  227|  11.4k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);                  //a2 a3 b2 b3
  228|  11.4k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);                  //c0 c1 d0 d1
  229|  11.4k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);                  //c2 c3 d2 d3
  230|  11.4k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);                    //a0 a1 a2 a3
  231|  11.4k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);                    //b0 b1 b2 b3
  232|  11.4k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);                    //c0 c1 c2 c3
  233|  11.4k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);                    //d0 d1 d2 d3
  234|       |    //Transform ends -- horizontal transform
  235|       |
  236|  11.4k|    zero_8x16b = _mm_setzero_si128();                  // all bits reset to zero
  237|       |    //Load pred buffer
  238|  11.4k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[0])); //p00 p01 p02 p03 0 0 0 0 0 0 0 0 -- all 8 bits
  239|  11.4k|    pred_r0 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p00 p01 p02 p03 0 0 0 0 -- all 16 bits
  240|       |
  241|  11.4k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[pred_strd])); //p10 p11 p12 p13 0 0 0 0 0 0 0 0 -- all 8 bits
  242|  11.4k|    pred_r1 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p10 p11 p12 p13 0 0 0 0 -- all 16 bits
  243|       |
  244|  11.4k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[2 * pred_strd])); //p20 p21 p22 p23 0 0 0 0 0 0 0 0 -- all 8 bits
  245|  11.4k|    pred_r2 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p20 p21 p22 p23 0 0 0 0 -- all 16 bits
  246|       |
  247|  11.4k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[3 * pred_strd])); //p30 p31 p32 p33 0 0 0 0 0 0 0 0 -- all 8 bits
  248|  11.4k|    pred_r3 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p30 p31 p32 p33 0 0 0 0 -- all 16 bits
  249|  11.4k|    pred_r0 = _mm_unpacklo_epi16(pred_r0, zero_8x16b); //p00 p01 p02 p03 -- 32 bits sign extended
  250|  11.4k|    pred_r1 = _mm_unpacklo_epi16(pred_r1, zero_8x16b); //p10 p11 p12 p13 -- 32 bits sign extended
  251|  11.4k|    pred_r2 = _mm_unpacklo_epi16(pred_r2, zero_8x16b); //p20 p21 p22 p23 -- 32 bits sign extended
  252|  11.4k|    pred_r3 = _mm_unpacklo_epi16(pred_r3, zero_8x16b); //p30 p31 p32 p33 -- 32 bits sign extended
  253|       |
  254|       |    /*--------------------------------------------------------------*/
  255|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6      */
  256|       |    /*                                                              */
  257|       |    /* Add the prediction and store it back to same buffer          */
  258|       |    /*--------------------------------------------------------------*/
  259|       |    /* z0j = y0j + y2j                                                        */
  260|  11.4k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  261|       |    /* z1j = y0j - y2j                                                        */
  262|  11.4k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  263|       |    /* z2j = (y1j>>1) - y3j                                                        */
  264|  11.4k|    temp2 = _mm_srai_epi32(resq_r1, 1);                             //(y1j>>1)
  265|  11.4k|    temp2 = _mm_sub_epi32(temp2, resq_r3);
  266|       |    /* z3j = y1j + (y3j>>1)                                                        */
  267|  11.4k|    temp3 = _mm_srai_epi32(resq_r3, 1);                             //(y3j>>1)
  268|  11.4k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  269|       |
  270|       |    /* x0j = z0j + z3j                                                        */
  271|  11.4k|    temp4 = _mm_add_epi32(temp0, temp3);
  272|  11.4k|    temp4 = _mm_add_epi32(temp4, value_32);
  273|  11.4k|    temp4 = _mm_srai_epi32(temp4, 6);
  274|  11.4k|    temp4 = _mm_add_epi32(temp4, pred_r0);
  275|       |    /* x1j = z1j + z2j                                                        */
  276|  11.4k|    temp5 = _mm_add_epi32(temp1, temp2);
  277|  11.4k|    temp5 = _mm_add_epi32(temp5, value_32);
  278|  11.4k|    temp5 = _mm_srai_epi32(temp5, 6);
  279|  11.4k|    temp5 = _mm_add_epi32(temp5, pred_r1);
  280|       |    /* x2j = z1j - z2j                                                        */
  281|  11.4k|    temp6 = _mm_sub_epi32(temp1, temp2);
  282|  11.4k|    temp6 = _mm_add_epi32(temp6, value_32);
  283|  11.4k|    temp6 = _mm_srai_epi32(temp6, 6);
  284|  11.4k|    temp6 = _mm_add_epi32(temp6, pred_r2);
  285|       |    /* x3j = z0j - z3j                                                        */
  286|  11.4k|    temp7 = _mm_sub_epi32(temp0, temp3);
  287|  11.4k|    temp7 = _mm_add_epi32(temp7, value_32);
  288|  11.4k|    temp7 = _mm_srai_epi32(temp7, 6);
  289|  11.4k|    temp7 = _mm_add_epi32(temp7, pred_r3);
  290|       |
  291|       |    // 32-bit to 16-bit conversion
  292|  11.4k|    temp0 = _mm_packs_epi32(temp4, temp5);
  293|  11.4k|    temp1 = _mm_packs_epi32(temp6, temp7);
  294|       |    /*------------------------------------------------------------------*/
  295|       |    //Clipping the results to 8 bits
  296|  11.4k|    sign_reg = _mm_cmpgt_epi16(temp0, zero_8x16b);      // sign check
  297|  11.4k|    temp0 = _mm_and_si128(temp0, sign_reg);
  298|  11.4k|    sign_reg = _mm_cmpgt_epi16(temp1, zero_8x16b);
  299|  11.4k|    temp1 = _mm_and_si128(temp1, sign_reg);
  300|       |
  301|  11.4k|    resq_r0 = _mm_packus_epi16(temp0, temp1);
  302|  11.4k|    resq_r1 = _mm_srli_si128(resq_r0, 4);
  303|  11.4k|    resq_r2 = _mm_srli_si128(resq_r1, 4);
  304|  11.4k|    resq_r3 = _mm_srli_si128(resq_r2, 4);
  305|       |
  306|  11.4k|    *pu4_out = _mm_cvtsi128_si32(resq_r0);
  307|  11.4k|    pu1_out += out_strd;
  308|  11.4k|    pu4_out = (UWORD32 *) (pu1_out);
  309|  11.4k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r1);
  310|  11.4k|    pu1_out += out_strd;
  311|  11.4k|    pu4_out = (UWORD32 *) (pu1_out);
  312|  11.4k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r2);
  313|  11.4k|    pu1_out += out_strd;
  314|  11.4k|    pu4_out = (UWORD32 *) (pu1_out);
  315|  11.4k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r3);
  316|  11.4k|}
ih264_iquant_itrans_recon_8x8_ssse3:
  380|  62.6k|{
  381|  62.6k|    __m128i src_r0;
  382|  62.6k|    __m128i scalemat_r0;
  383|  62.6k|    __m128i zero_8x16b = _mm_setzero_si128(); // all bits reset to zero
  384|       |    // __m128i one_8x16b = _mm_set1_epi8(255); // all bits set to 1
  385|       |    // __m128i one_zero_mask = _mm_unpacklo_epi16(one_8x16b, zero_8x16b); // 1 0 1 0 1 0 1 0 --- 16 bits size
  386|  62.6k|    __m128i value_32 = _mm_set1_epi32(32);
  387|  62.6k|    __m128i add_rshift = _mm_set1_epi32((qp_div < 6) ? (1 << (5 - qp_div)) : 0);
  ------------------
  |  Branch (387:41): [True: 54.0k, False: 8.55k]
  ------------------
  388|  62.6k|    __m128i dequant_r0;
  389|  62.6k|    __m128i predload_r;
  390|  62.6k|    __m128i pred_r0_1, pred_r1_1, pred_r2_1, pred_r3_1, pred_r4_1, pred_r5_1,
  391|  62.6k|            pred_r6_1, pred_r7_1;
  392|  62.6k|    __m128i sign_reg;
  393|  62.6k|    __m128i src_r0_1, src_r0_2;
  394|  62.6k|    __m128i scalemat_r0_1, scalemat_r0_2;
  395|  62.6k|    __m128i temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8;
  396|  62.6k|    __m128i temp10, temp11, temp12, temp13, temp14, temp15, temp16, temp17,
  397|  62.6k|            temp18, temp19, temp20;
  398|       |    // To store dequantization results
  399|  62.6k|    __m128i resq_r0_1, resq_r0_2, resq_r1_1, resq_r1_2, resq_r2_1, resq_r2_2,
  400|  62.6k|            resq_r3_1, resq_r3_2, resq_r4_1, resq_r4_2, resq_r5_1, resq_r5_2,
  401|  62.6k|            resq_r6_1, resq_r6_2, resq_r7_1, resq_r7_2;
  402|  62.6k|    UNUSED (pi2_tmp);
  ------------------
  |  |   45|  62.6k|#define UNUSED(x) ((void)(x))
  ------------------
  403|  62.6k|    UNUSED (iq_start_idx);
  ------------------
  |  |   45|  62.6k|#define UNUSED(x) ((void)(x))
  ------------------
  404|  62.6k|    UNUSED (pi2_dc_ld_addr);
  ------------------
  |  |   45|  62.6k|#define UNUSED(x) ((void)(x))
  ------------------
  405|       |
  406|       |    /*************************************************************/
  407|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
  408|       |    /* operations on platform. Note : DC coeff is not scaled     */
  409|       |    /*************************************************************/
  410|       |
  411|       |    // Row 0 processing
  412|  62.6k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src)); //a00 a01 a02 a03 a04 a05 a06 a07 -- the source matrix 0th row
  413|  62.6k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat)); //b00 b01 b02 b03 b04 b05 b06 b07 -- the scaling matrix 0th row
  414|  62.6k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[0])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  415|  62.6k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  416|  62.6k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  417|  62.6k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0); //b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  418|  62.6k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b); // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  419|  62.6k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b); // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  420|       |
  421|  62.6k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1); // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  422|  62.6k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2); // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  423|       |
  424|  62.6k|    if (qp_div >= 6) {
  ------------------
  |  Branch (424:9): [True: 8.55k, False: 54.0k]
  ------------------
  425|  8.55k|        resq_r0_1 = _mm_slli_epi32(temp5, qp_div - 6);
  426|  8.55k|        resq_r0_2 = _mm_slli_epi32(temp7, qp_div - 6);
  427|  54.0k|    } else {
  428|  54.0k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  429|  54.0k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  430|  54.0k|        resq_r0_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  431|  54.0k|        resq_r0_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  432|  54.0k|    }
  433|  62.6k|    resq_r0_1 = _mm_packs_epi32(resq_r0_1, resq_r0_2); //a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 16 bit long
  434|       |    // Row 1 processing
  435|  62.6k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 8)); //a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 1st row
  436|  62.6k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 8)); //b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 1st row
  437|  62.6k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[8])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  438|  62.6k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  439|  62.6k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  440|  62.6k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0); //b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  441|  62.6k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b); // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  442|  62.6k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b); // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  443|  62.6k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1); // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  444|  62.6k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2); // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  445|  62.6k|    if (qp_div >= 6) {
  ------------------
  |  Branch (445:9): [True: 8.55k, False: 54.0k]
  ------------------
  446|  8.55k|        resq_r1_1 = _mm_slli_epi32(temp5, qp_div - 6);
  447|  8.55k|        resq_r1_2 = _mm_slli_epi32(temp7, qp_div - 6);
  448|  54.0k|    } else {
  449|  54.0k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  450|  54.0k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  451|  54.0k|        resq_r1_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  452|  54.0k|        resq_r1_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  453|  54.0k|    }
  454|  62.6k|    resq_r1_1 = _mm_packs_epi32(resq_r1_1, resq_r1_2); //a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 16 bit long
  455|       |    // Row 2 processing
  456|  62.6k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 16)); //a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 2nd row
  457|  62.6k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 16)); //b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 2nd row
  458|  62.6k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[16])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  459|  62.6k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  460|  62.6k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  461|  62.6k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0); //b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  462|  62.6k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b); // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  463|  62.6k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b); // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  464|  62.6k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1); // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  465|  62.6k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2); // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  466|  62.6k|    if (qp_div >= 6) {
  ------------------
  |  Branch (466:9): [True: 8.55k, False: 54.0k]
  ------------------
  467|  8.55k|        resq_r2_1 = _mm_slli_epi32(temp5, qp_div - 6);
  468|  8.55k|        resq_r2_2 = _mm_slli_epi32(temp7, qp_div - 6);
  469|  54.0k|    } else {
  470|  54.0k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  471|  54.0k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  472|  54.0k|        resq_r2_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  473|  54.0k|        resq_r2_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  474|  54.0k|    }
  475|  62.6k|    resq_r2_1 = _mm_packs_epi32(resq_r2_1, resq_r2_2); //a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 16 bit long
  476|       |    // Row 3 processing
  477|  62.6k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 24)); //a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 3rd row
  478|  62.6k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 24)); //b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 3rd row
  479|  62.6k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[24])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  480|  62.6k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  481|  62.6k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  482|  62.6k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0); //b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  483|  62.6k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b); // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  484|  62.6k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b); // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  485|  62.6k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1); // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 - 32 bits long
  486|  62.6k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2); // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  487|  62.6k|    if (qp_div >= 6) {
  ------------------
  |  Branch (487:9): [True: 8.55k, False: 54.0k]
  ------------------
  488|  8.55k|        resq_r3_1 = _mm_slli_epi32(temp5, qp_div - 6);
  489|  8.55k|        resq_r3_2 = _mm_slli_epi32(temp7, qp_div - 6);
  490|  54.0k|    } else {
  491|  54.0k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  492|  54.0k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  493|  54.0k|        resq_r3_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  494|  54.0k|        resq_r3_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  495|  54.0k|    }
  496|  62.6k|    resq_r3_1 = _mm_packs_epi32(resq_r3_1, resq_r3_2); //a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 16 bit long
  497|       |    // Row 4 processing
  498|  62.6k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 32)); //a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 4th row
  499|  62.6k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 32)); //b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 4th row
  500|  62.6k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[32])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  501|  62.6k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  502|  62.6k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  503|  62.6k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0); //b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  504|  62.6k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b); // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  505|  62.6k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b); // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  506|  62.6k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1); // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  507|  62.6k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2); // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  508|  62.6k|    if (qp_div >= 6) {
  ------------------
  |  Branch (508:9): [True: 8.55k, False: 54.0k]
  ------------------
  509|  8.55k|        resq_r4_1 = _mm_slli_epi32(temp5, qp_div - 6);
  510|  8.55k|        resq_r4_2 = _mm_slli_epi32(temp7, qp_div - 6);
  511|       |
  512|  54.0k|    } else {
  513|  54.0k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  514|  54.0k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  515|  54.0k|        resq_r4_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  516|  54.0k|        resq_r4_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  517|  54.0k|    }
  518|  62.6k|    resq_r4_1 = _mm_packs_epi32(resq_r4_1, resq_r4_2); //a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 16 bit long
  519|       |    // Row 5 processing
  520|  62.6k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 40)); //a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 5th row
  521|  62.6k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 40)); //b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 5th row
  522|  62.6k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[40])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  523|  62.6k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  524|  62.6k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  525|  62.6k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0); //b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  526|  62.6k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b); // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  527|  62.6k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b); // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  528|  62.6k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1); // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  529|  62.6k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2); // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  530|  62.6k|    if (qp_div >= 6) {
  ------------------
  |  Branch (530:9): [True: 8.55k, False: 54.0k]
  ------------------
  531|  8.55k|        resq_r5_1 = _mm_slli_epi32(temp5, qp_div - 6);
  532|  8.55k|        resq_r5_2 = _mm_slli_epi32(temp7, qp_div - 6);
  533|       |        //resq_r5_1 = _mm_and_si128(resq_r5_1,one_zero_mask);
  534|       |        //resq_r5_2 = _mm_and_si128(resq_r5_2,one_zero_mask);
  535|  54.0k|    } else {
  536|  54.0k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  537|  54.0k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  538|  54.0k|        resq_r5_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  539|  54.0k|        resq_r5_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  540|  54.0k|    }
  541|  62.6k|    resq_r5_1 = _mm_packs_epi32(resq_r5_1, resq_r5_2); //a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 16 bit long
  542|       |    // Row 6 processing
  543|  62.6k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 48)); //a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 6th row
  544|  62.6k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 48)); //b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 6th row
  545|  62.6k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[48])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  546|  62.6k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  547|  62.6k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  548|  62.6k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0); //b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  549|  62.6k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b); // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  550|  62.6k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b); // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  551|  62.6k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1); // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  552|  62.6k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2); // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  553|  62.6k|    if (qp_div >= 6) {
  ------------------
  |  Branch (553:9): [True: 8.55k, False: 54.0k]
  ------------------
  554|  8.55k|        resq_r6_1 = _mm_slli_epi32(temp5, qp_div - 6);
  555|  8.55k|        resq_r6_2 = _mm_slli_epi32(temp7, qp_div - 6);
  556|       |        //resq_r6_1 = _mm_and_si128(resq_r6_1,one_zero_mask);
  557|       |        //resq_r6_2 = _mm_and_si128(resq_r6_2,one_zero_mask);
  558|  54.0k|    } else {
  559|  54.0k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  560|  54.0k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  561|  54.0k|        resq_r6_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  562|  54.0k|        resq_r6_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  563|       |        //resq_r6_1 = _mm_and_si128(resq_r6_1,one_zero_mask);
  564|       |        //resq_r6_2 = _mm_and_si128(resq_r6_2,one_zero_mask);
  565|  54.0k|    }
  566|  62.6k|    resq_r6_1 = _mm_packs_epi32(resq_r6_1, resq_r6_2); //a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 16 bit long
  567|       |    // Row 7 processing
  568|  62.6k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 56)); //a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 7th row
  569|  62.6k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 56)); //b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 7th row
  570|  62.6k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[56])); //q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  571|  62.6k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b); //a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  572|  62.6k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b); // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  573|  62.6k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0); //b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  574|  62.6k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b); // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  575|  62.6k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b); // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  576|  62.6k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1); // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  577|  62.6k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2); // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  578|  62.6k|    if (qp_div >= 6) {
  ------------------
  |  Branch (578:9): [True: 8.55k, False: 54.0k]
  ------------------
  579|  8.55k|        resq_r7_1 = _mm_slli_epi32(temp5, qp_div - 6);
  580|  8.55k|        resq_r7_2 = _mm_slli_epi32(temp7, qp_div - 6);
  581|  54.0k|    } else {
  582|  54.0k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  583|  54.0k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  584|  54.0k|        resq_r7_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  585|  54.0k|        resq_r7_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  586|  54.0k|    }
  587|  62.6k|    resq_r7_1 = _mm_packs_epi32(resq_r7_1, resq_r7_2); //a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 16 bit long
  588|       |    /* Perform Inverse transform */
  589|       |    /*--------------------------------------------------------------------*/
  590|       |    /* IDCT [ Horizontal transformation ]                                 */
  591|       |    /*--------------------------------------------------------------------*/
  592|       |    // Matrix transpose
  593|       |    /*
  594|       |     *  a0 a1 a2 a3 a4 a5 a6 a7
  595|       |     *  b0 b1 b2 b3 b4 b5 b6 b7
  596|       |     *  c0 c1 c2 c3 c4 c5 c6 c7
  597|       |     *  d0 d1 d2 d3 d4 d5 d6 d7
  598|       |     */
  599|  62.6k|    temp1 = _mm_unpacklo_epi16(resq_r0_1, resq_r1_1); //a0 b0 a1 b1 a2 b2 a3 b3
  600|  62.6k|    temp3 = _mm_unpacklo_epi16(resq_r2_1, resq_r3_1); //c0 d0 c1 d1 c2 d2 c3 d3
  601|  62.6k|    temp2 = _mm_unpackhi_epi16(resq_r0_1, resq_r1_1); //a4 b4 a5 b5 a6 b6 a7 b7
  602|  62.6k|    temp4 = _mm_unpackhi_epi16(resq_r2_1, resq_r3_1); //c4 d4 c5 d5 c6 d6 c7 d7
  603|  62.6k|    resq_r0_1 = _mm_unpacklo_epi32(temp1, temp3); //a0 b0 c0 d0 a1 b1 c1 d1
  604|  62.6k|    resq_r1_1 = _mm_unpackhi_epi32(temp1, temp3); //a2 b2 c2 d2 a3 b3 c3 d3
  605|  62.6k|    resq_r2_1 = _mm_unpacklo_epi32(temp2, temp4); //a4 b4 c4 d4 a5 b5 c5 d5
  606|  62.6k|    resq_r3_1 = _mm_unpackhi_epi32(temp2, temp4); //a6 b6 c6 d6 a7 b7 c7 d7
  607|       |    /*
  608|       |     * e0 e1 e2 e3 e4 e5 e6 e7
  609|       |     * f0 f1 f2 f3 f4 f5 f6 f7
  610|       |     * g0 g1 g2 g3 g4 g5 g6 g7
  611|       |     * h0 h1 h2 h3 h4 h5 h6 h7
  612|       |     */
  613|  62.6k|    temp1 = _mm_unpacklo_epi16(resq_r4_1, resq_r5_1); //e0 f0 e1 f1 e2 f2 e2 f3
  614|  62.6k|    temp3 = _mm_unpacklo_epi16(resq_r6_1, resq_r7_1); //g0 h0 g1 h1 g2 h2 g3 h3
  615|  62.6k|    temp2 = _mm_unpackhi_epi16(resq_r4_1, resq_r5_1); //e4 f4 e5 f5 e6 f6 e7 f7
  616|  62.6k|    temp4 = _mm_unpackhi_epi16(resq_r6_1, resq_r7_1); //g4 h4 g5 h5 g6 h6 g7 h7
  617|  62.6k|    resq_r4_1 = _mm_unpacklo_epi32(temp1, temp3); //e0 f0 g0 h0 e1 f1 g1 h1
  618|  62.6k|    resq_r5_1 = _mm_unpackhi_epi32(temp1, temp3); //e2 f2 g2 h2 e3 f3 g3 h3
  619|  62.6k|    resq_r6_1 = _mm_unpacklo_epi32(temp2, temp4); //e4 f4 g4 h4 e5 f5 g5 h5
  620|  62.6k|    resq_r7_1 = _mm_unpackhi_epi32(temp2, temp4); //e6 f6 g6 h6 e7 f7 g7 h7
  621|       |    /*
  622|       |     * a0 b0 c0 d0 a1 b1 c1 d1
  623|       |     * a2 b2 c2 d2 a3 b3 c3 d3
  624|       |     * a4 b4 c4 d4 a5 b5 c5 d5
  625|       |     * a6 b6 c6 d6 a7 b7 c7 d7
  626|       |     * e0 f0 g0 h0 e1 f1 g1 h1
  627|       |     * e2 f2 g2 h2 e3 f3 g3 h3
  628|       |     * e4 f4 g4 h4 e5 f5 g5 h5
  629|       |     * e6 f6 g6 h6 e7 f7 g7 h7
  630|       |     */
  631|  62.6k|    resq_r0_2 = _mm_unpacklo_epi64(resq_r0_1, resq_r4_1); //a0 b0 c0 d0 e0 f0 g0 h0
  632|  62.6k|    resq_r1_2 = _mm_unpackhi_epi64(resq_r0_1, resq_r4_1); //a1 b1 c1 d1 e1 f1 g1 h1
  633|  62.6k|    resq_r2_2 = _mm_unpacklo_epi64(resq_r1_1, resq_r5_1); //a2 b2 c2 d2 e2 f2 g2 h2
  634|  62.6k|    resq_r3_2 = _mm_unpackhi_epi64(resq_r1_1, resq_r5_1); //a3 b3 c3 d3 e3 f3 g3 h3
  635|  62.6k|    resq_r4_2 = _mm_unpacklo_epi64(resq_r2_1, resq_r6_1); //a4 b4 c4 d4 e4 f4 g4 h4
  636|  62.6k|    resq_r5_2 = _mm_unpackhi_epi64(resq_r2_1, resq_r6_1); //a5 b5 c5 d5 e5 f5 g5 h5
  637|  62.6k|    resq_r6_2 = _mm_unpacklo_epi64(resq_r3_1, resq_r7_1); //a6 b6 c6 d6 e6 f6 g6 h6
  638|  62.6k|    resq_r7_2 = _mm_unpackhi_epi64(resq_r3_1, resq_r7_1); //a7 b7 c7 d7 e7 f7 g7 h7
  639|       |
  640|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r1_2);
  641|  62.6k|    resq_r1_1 = _mm_unpacklo_epi16(resq_r1_2, sign_reg); //a1 b1 c1 d1 -- 32 bit
  642|  62.6k|    resq_r1_2 = _mm_unpackhi_epi16(resq_r1_2, sign_reg); //e1 f1 g1 h1 -- 32 bit
  643|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r3_2);
  644|  62.6k|    resq_r3_1 = _mm_unpacklo_epi16(resq_r3_2, sign_reg); //a3 b3 c3 d3 -- 32 bit
  645|  62.6k|    resq_r3_2 = _mm_unpackhi_epi16(resq_r3_2, sign_reg); //e3 f3 g3 h3 -- 32 bit
  646|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r5_2);
  647|  62.6k|    resq_r5_1 = _mm_unpacklo_epi16(resq_r5_2, sign_reg); //a5 b5 c5 d5 -- 32 bit
  648|  62.6k|    resq_r5_2 = _mm_unpackhi_epi16(resq_r5_2, sign_reg); //e5 f5 g5 h5 -- 32 bit
  649|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r7_2);
  650|  62.6k|    resq_r7_1 = _mm_unpacklo_epi16(resq_r7_2, sign_reg); //a7 b7 c7 d7 -- 32 bit
  651|  62.6k|    resq_r7_2 = _mm_unpackhi_epi16(resq_r7_2, sign_reg); //e7 f7 g7 h7 -- 32 bit
  652|       |    //Transform starts -- horizontal transform
  653|       |    /*------------------------------------------------------------------*/
  654|       |    /* y0 = w0 + w4                                                     */
  655|  62.6k|    temp1 = _mm_add_epi16(resq_r0_2, resq_r4_2);
  656|       |    /* y2 = w0 - w4                                                      */
  657|  62.6k|    temp3 = _mm_sub_epi16(resq_r0_2, resq_r4_2);
  658|       |    /* y1 = -w3 + w5 - w7 - (w7 >> 1)                                   */
  659|  62.6k|    temp2 = _mm_sub_epi32(resq_r5_1, resq_r3_1); //-w3+w5
  660|  62.6k|    temp10 = _mm_sub_epi32(resq_r5_2, resq_r3_2);
  661|  62.6k|    temp4 = _mm_sub_epi32(temp2, resq_r7_1); //-w3+w5-w7
  662|  62.6k|    temp12 = _mm_sub_epi32(temp10, resq_r7_2);
  663|  62.6k|    temp5 = _mm_srai_epi32(resq_r7_1, 1); //w7>>1
  664|  62.6k|    temp13 = _mm_srai_epi32(resq_r7_2, 1);
  665|  62.6k|    temp2 = _mm_sub_epi32(temp4, temp5); //-w3+w5-w7 -(w7>>1)
  666|  62.6k|    temp10 = _mm_sub_epi32(temp12, temp13);
  667|  62.6k|    temp2 = _mm_packs_epi32(temp2, temp10);
  668|       |    /* y3 = w1 + w7 - w3 - (w3 >> 1)                                    */
  669|  62.6k|    temp4 = _mm_add_epi32(resq_r1_1, resq_r7_1); //w1+w7
  670|  62.6k|    temp12 = _mm_add_epi32(resq_r1_2, resq_r7_2);
  671|  62.6k|    temp4 = _mm_sub_epi32(temp4, resq_r3_1); //w1+w7-w3
  672|  62.6k|    temp12 = _mm_sub_epi32(temp12, resq_r3_2);
  673|  62.6k|    temp5 = _mm_srai_epi32(resq_r3_1, 1); //w3>>1
  674|  62.6k|    temp13 = _mm_srai_epi32(resq_r3_2, 1);
  675|  62.6k|    temp4 = _mm_sub_epi32(temp4, temp5); //w1+w7-w3-(w3>>1)
  676|  62.6k|    temp12 = _mm_sub_epi32(temp12, temp13);
  677|  62.6k|    temp4 = _mm_packs_epi32(temp4, temp12);
  678|       |    /* y4 = (w2 >> 1) - w6                                              */
  679|  62.6k|    temp5 = _mm_srai_epi16(resq_r2_2, 1); //w2>>1
  680|  62.6k|    temp5 = _mm_sub_epi16(temp5, resq_r6_2); //(w2>>1)-w6
  681|       |    /* y5 = -w1 + w7 + w5 + (w5 >> 1)                                   */
  682|  62.6k|    temp6 = _mm_sub_epi32(resq_r7_1, resq_r1_1); //w7-w1
  683|  62.6k|    temp14 = _mm_sub_epi32(resq_r7_2, resq_r1_2);
  684|  62.6k|    temp6 = _mm_add_epi32(temp6, resq_r5_1); //w7-w1+w5
  685|  62.6k|    temp14 = _mm_add_epi32(temp14, resq_r5_2);
  686|  62.6k|    temp7 = _mm_srai_epi32(resq_r5_1, 1); //w5>>1
  687|  62.6k|    temp15 = _mm_srai_epi32(resq_r5_2, 1);
  688|  62.6k|    temp6 = _mm_add_epi32(temp6, temp7); //w7-w1_w5+(w5>>1)
  689|  62.6k|    temp14 = _mm_add_epi32(temp14, temp15);
  690|  62.6k|    temp6 = _mm_packs_epi32(temp6, temp14);
  691|       |    /* y6 = w2 + (w6 >> 1)                                              */
  692|  62.6k|    temp7 = _mm_srai_epi16(resq_r6_2, 1); //w6>>1
  693|  62.6k|    temp7 = _mm_add_epi16(temp7, resq_r2_2); //(w6>>1)+w2
  694|       |    /* y7 = w3 + w5 + w1 + (w1 >> 1)                                    */
  695|  62.6k|    temp8 = _mm_add_epi32(resq_r3_1, resq_r5_1); //w3+w5
  696|  62.6k|    temp16 = _mm_add_epi32(resq_r3_2, resq_r5_2);
  697|  62.6k|    temp8 = _mm_add_epi32(temp8, resq_r1_1); //w3+w5+w1
  698|  62.6k|    temp16 = _mm_add_epi32(temp16, resq_r1_2);
  699|  62.6k|    temp17 = _mm_srai_epi32(resq_r1_1, 1); //w1>>1
  700|  62.6k|    temp18 = _mm_srai_epi32(resq_r1_2, 1);
  701|  62.6k|    temp8 = _mm_add_epi32(temp8, temp17); //w3+w5+w1+(w1>>1)
  702|  62.6k|    temp16 = _mm_add_epi32(temp16, temp18);
  703|  62.6k|    temp8 = _mm_packs_epi32(temp8, temp16);
  704|       |    /*------------------------------------------------------------------*/
  705|       |    /*------------------------------------------------------------------*/
  706|       |    /* z0 = y0 + y6                                                        */
  707|  62.6k|    resq_r0_1 = _mm_add_epi16(temp1, temp7);
  708|       |    /* z1 = y1 + (y7 >> 2)                                                */
  709|  62.6k|    resq_r1_1 = _mm_srai_epi16(temp8, 2);
  710|  62.6k|    resq_r1_1 = _mm_add_epi16(resq_r1_1, temp2);
  711|       |    /* z2 = y2 + y4                                                        */
  712|  62.6k|    resq_r2_1 = _mm_add_epi16(temp3, temp5);
  713|       |    /* z3 = y3 + (y5 >> 2)                                                */
  714|  62.6k|    resq_r3_1 = _mm_srai_epi16(temp6, 2);
  715|  62.6k|    resq_r3_1 = _mm_add_epi16(resq_r3_1, temp4);
  716|       |    /* z4 = y2 - y4                                                        */
  717|  62.6k|    resq_r4_1 = _mm_sub_epi16(temp3, temp5);
  718|       |    /* z5 = (y3 >> 2) - y5                                                 */
  719|  62.6k|    resq_r5_1 = _mm_srai_epi16(temp4, 2);
  720|  62.6k|    resq_r5_1 = _mm_sub_epi16(resq_r5_1, temp6);
  721|       |    /* z6 = y0 - y6                                                     */
  722|  62.6k|    resq_r6_1 = _mm_sub_epi16(temp1, temp7);
  723|       |    /* z7 = y7 - (y1 >> 2)                                                 */
  724|  62.6k|    resq_r7_1 = _mm_srai_epi16(temp2, 2);
  725|  62.6k|    resq_r7_1 = _mm_sub_epi16(temp8, resq_r7_1);
  726|       |    /*------------------------------------------------------------------*/
  727|       |    /*------------------------------------------------------------------*/
  728|       |    /* x0 = z0 + z7                                                        */
  729|  62.6k|    temp1 = _mm_add_epi16(resq_r0_1, resq_r7_1);
  730|       |    /* x1 = z2 + z5                                                        */
  731|  62.6k|    temp2 = _mm_add_epi16(resq_r2_1, resq_r5_1);
  732|       |    /* x2 = z4 + z3                                                        */
  733|  62.6k|    temp3 = _mm_add_epi16(resq_r4_1, resq_r3_1);
  734|       |    /* x3 = z6 + z1                                                        */
  735|  62.6k|    temp4 = _mm_add_epi16(resq_r6_1, resq_r1_1);
  736|       |    /* x4 = z6 - z1                                                        */
  737|  62.6k|    temp5 = _mm_sub_epi16(resq_r6_1, resq_r1_1);
  738|       |    /* x5 = z4 - z3                                                        */
  739|  62.6k|    temp6 = _mm_sub_epi16(resq_r4_1, resq_r3_1);
  740|       |    /* x6 = z2 - z5                                                        */
  741|  62.6k|    temp7 = _mm_sub_epi16(resq_r2_1, resq_r5_1);
  742|       |    /* x7 = z0 - z7                                                        */
  743|  62.6k|    temp8 = _mm_sub_epi16(resq_r0_1, resq_r7_1);
  744|       |    /*------------------------------------------------------------------*/
  745|       |    // Matrix transpose
  746|       |    /*
  747|       |     *  a0 b0 c0 d0 e0 f0 g0 h0
  748|       |     *  a1 b1 c1 d1 e1 f1 g1 h1
  749|       |     *  a2 b2 c2 d2 e2 f2 g2 h2
  750|       |     *  a3 b3 c3 d3 e3 f3 g3 h3
  751|       |     */
  752|  62.6k|    temp17 = _mm_unpacklo_epi16(temp1, temp2); //a0 a1 b0 b1 c0 c1 d0 d1
  753|  62.6k|    temp19 = _mm_unpacklo_epi16(temp3, temp4); //a2 a3 b2 b3 c2 c3 d2 d3
  754|  62.6k|    temp18 = _mm_unpackhi_epi16(temp1, temp2); //e0 e1 f0 f1 g0 g1 h0 h1
  755|  62.6k|    temp20 = _mm_unpackhi_epi16(temp3, temp4); //e2 e3 f2 f3 g2 g3 h2 h3
  756|       |
  757|  62.6k|    resq_r0_1 = _mm_unpacklo_epi32(temp17, temp19); //a0 a1 a2 a3 b0 b1 b2 b3
  758|  62.6k|    resq_r1_1 = _mm_unpackhi_epi32(temp17, temp19); //c0 c1 c2 c3 d0 d1 d2 d3
  759|  62.6k|    resq_r2_1 = _mm_unpacklo_epi32(temp18, temp20); //e0 e1 e2 e3 f0 f1 f2 f3
  760|  62.6k|    resq_r3_1 = _mm_unpackhi_epi32(temp18, temp20); //g0 g2 g2 g3 h0 h1 h2 h3
  761|       |    /*
  762|       |     *  a4 b4 c4 d4 e4 f4 g4 h4
  763|       |     *  a5 b5 c5 d5 e5 f5 g5 h5
  764|       |     *  a6 b6 c6 d6 e6 f6 g6 h6
  765|       |     *  a7 b7 c7 d7 e7 f7 g7 h7
  766|       |     */
  767|  62.6k|    temp17 = _mm_unpacklo_epi16(temp5, temp6); //a4 a5 b4 b5 c4 c5 d4 d5
  768|  62.6k|    temp19 = _mm_unpacklo_epi16(temp7, temp8); //a6 a7 b6 b7 c6 c7 d6 d7
  769|  62.6k|    temp18 = _mm_unpackhi_epi16(temp5, temp6); //e4 e5 f4 f5 g4 g5 h4 h5
  770|  62.6k|    temp20 = _mm_unpackhi_epi16(temp7, temp8); //e6 e7 f6 f7 g6 g7 h6 h7
  771|       |
  772|  62.6k|    resq_r4_1 = _mm_unpacklo_epi32(temp17, temp19); //a4 a5 a6 a7 b4 b5 b6 b7
  773|  62.6k|    resq_r5_1 = _mm_unpackhi_epi32(temp17, temp19); //c4 c5 c6 c7 d4 d5 d6 d7
  774|  62.6k|    resq_r6_1 = _mm_unpacklo_epi32(temp18, temp20); //e4 e5 e6 e7 f4 f5 f6 f7
  775|  62.6k|    resq_r7_1 = _mm_unpackhi_epi32(temp18, temp20); //g4 g5 g6 g7 h4 h5 h6 h7
  776|       |    /*  a0 a1 a2 a3 b0 b1 b2 b3
  777|       |     *  c0 c1 c2 c3 d0 d1 d2 d3
  778|       |     *  e0 e1 e2 e3 f0 f1 f2 f3
  779|       |     *  g0 g2 g2 g3 h0 h1 h2 h3
  780|       |     *  a4 a5 a6 a7 b4 b5 b6 b7
  781|       |     *  c4 c5 c6 c7 d4 d5 d6 d7
  782|       |     *  e4 e5 e6 e7 f4 f5 f6 f7
  783|       |     *  g4 g5 g6 g7 h4 h5 h6 h7
  784|       |     */
  785|  62.6k|    resq_r0_2 = _mm_unpacklo_epi64(resq_r0_1, resq_r4_1); //a0 a1 a2 a3 a4 a5 a6 a7
  786|  62.6k|    resq_r1_2 = _mm_unpackhi_epi64(resq_r0_1, resq_r4_1); //b0 b1 b2 b3 b4 b5 b6 b7
  787|  62.6k|    resq_r2_2 = _mm_unpacklo_epi64(resq_r1_1, resq_r5_1); //c0 c1 c2 c3 c4 c5 c6 c7
  788|  62.6k|    resq_r3_2 = _mm_unpackhi_epi64(resq_r1_1, resq_r5_1); //d0 d1 d2 d3 d4 d5 d6 d7
  789|  62.6k|    resq_r4_2 = _mm_unpacklo_epi64(resq_r2_1, resq_r6_1); //e0 e1 e2 e3 e4 e5 e6 e7
  790|  62.6k|    resq_r5_2 = _mm_unpackhi_epi64(resq_r2_1, resq_r6_1); //f0 f1 f2 f3 f4 f5 f6 f7
  791|  62.6k|    resq_r6_2 = _mm_unpacklo_epi64(resq_r3_1, resq_r7_1); //g0 g1 g2 g3 g4 g5 g6 g7
  792|  62.6k|    resq_r7_2 = _mm_unpackhi_epi64(resq_r3_1, resq_r7_1); //h0 h1 h2 h3 h4 h5 h6 h7
  793|       |
  794|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r1_2);
  795|  62.6k|    resq_r1_1 = _mm_unpacklo_epi16(resq_r1_2, sign_reg); //a1 b1 c1 d1 -- 32 bit
  796|  62.6k|    resq_r1_2 = _mm_unpackhi_epi16(resq_r1_2, sign_reg); //e1 f1 g1 h1 -- 32 bit
  797|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r3_2);
  798|  62.6k|    resq_r3_1 = _mm_unpacklo_epi16(resq_r3_2, sign_reg); //a3 b3 c3 d3 -- 32 bit
  799|  62.6k|    resq_r3_2 = _mm_unpackhi_epi16(resq_r3_2, sign_reg); //e3 f3 g3 h3 -- 32 bit
  800|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r5_2);
  801|  62.6k|    resq_r5_1 = _mm_unpacklo_epi16(resq_r5_2, sign_reg); //a5 b5 c5 d5 -- 32 bit
  802|  62.6k|    resq_r5_2 = _mm_unpackhi_epi16(resq_r5_2, sign_reg); //e5 f5 g5 h5 -- 32 bit
  803|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r7_2);
  804|  62.6k|    resq_r7_1 = _mm_unpacklo_epi16(resq_r7_2, sign_reg); //a7 b7 c7 d7 -- 32 bit
  805|  62.6k|    resq_r7_2 = _mm_unpackhi_epi16(resq_r7_2, sign_reg); //e7 f7 g7 h7 -- 32 bit
  806|       |
  807|  62.6k|    zero_8x16b = _mm_setzero_si128(); // all bits reset to zero
  808|       |    //Load pred buffer row 0
  809|  62.6k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[0])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  810|  62.6k|    pred_r0_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  811|       |    //Load pred buffer row 1
  812|  62.6k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[pred_strd])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  813|  62.6k|    pred_r1_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  814|       |    //Load pred buffer row 2
  815|  62.6k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[2 * pred_strd])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  816|  62.6k|    pred_r2_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  817|       |    //Load pred buffer row 3
  818|  62.6k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[3 * pred_strd])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  819|  62.6k|    pred_r3_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  820|       |    //Load pred buffer row 4
  821|  62.6k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[4 * pred_strd])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  822|  62.6k|    pred_r4_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  823|       |    //Load pred buffer row 5
  824|  62.6k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[5 * pred_strd])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bit
  825|  62.6k|    pred_r5_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  826|       |    //Load pred buffer row 6
  827|  62.6k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[6 * pred_strd])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  828|  62.6k|    pred_r6_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  829|       |    //Load pred buffer row 7
  830|  62.6k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[7 * pred_strd])); //p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  831|  62.6k|    pred_r7_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b); //p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  832|       |
  833|       |    /*--------------------------------------------------------------------*/
  834|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6            */
  835|       |    /*                                                                    */
  836|       |    /* Add the prediction and store it back to reconstructed frame buffer */
  837|       |    /* [Prediction buffer itself in this case]                            */
  838|       |    /*--------------------------------------------------------------------*/
  839|       |
  840|       |    /* y0j = w0j + w4j                                                     */
  841|  62.6k|    temp1 = _mm_add_epi16(resq_r0_2, resq_r4_2);
  842|       |    /* y2j = w0j - w4j                                                      */
  843|  62.6k|    temp3 = _mm_sub_epi16(resq_r0_2, resq_r4_2);
  844|       |    /* y1j = -w3j + w5j - w7j - (w7j >> 1)                                   */
  845|  62.6k|    temp2 = _mm_sub_epi32(resq_r5_1, resq_r3_1); //-w3+w5
  846|  62.6k|    temp10 = _mm_sub_epi32(resq_r5_2, resq_r3_2);
  847|  62.6k|    temp4 = _mm_sub_epi32(temp2, resq_r7_1); //-w3+w5-w7
  848|  62.6k|    temp12 = _mm_sub_epi32(temp10, resq_r7_2);
  849|  62.6k|    temp5 = _mm_srai_epi32(resq_r7_1, 1); //w7>>1
  850|  62.6k|    temp13 = _mm_srai_epi32(resq_r7_2, 1);
  851|  62.6k|    temp2 = _mm_sub_epi32(temp4, temp5); //-w3+w5-w7 -(w7>>1)
  852|  62.6k|    temp10 = _mm_sub_epi32(temp12, temp13);
  853|  62.6k|    temp2 = _mm_packs_epi32(temp2, temp10);
  854|       |    /* y3j = w1j + w7j - w3j - (w3j >> 1)                                    */
  855|  62.6k|    temp4 = _mm_add_epi32(resq_r1_1, resq_r7_1); //w1+w7
  856|  62.6k|    temp12 = _mm_add_epi32(resq_r1_2, resq_r7_2);
  857|  62.6k|    temp4 = _mm_sub_epi32(temp4, resq_r3_1); //w1+w7-w3
  858|  62.6k|    temp12 = _mm_sub_epi32(temp12, resq_r3_2);
  859|  62.6k|    temp5 = _mm_srai_epi32(resq_r3_1, 1); //w3>>1
  860|  62.6k|    temp13 = _mm_srai_epi32(resq_r3_2, 1);
  861|  62.6k|    temp4 = _mm_sub_epi32(temp4, temp5); //w1+w7-w3-(w3>>1)
  862|  62.6k|    temp12 = _mm_sub_epi32(temp12, temp13);
  863|  62.6k|    temp4 = _mm_packs_epi32(temp4, temp12);
  864|       |    /* y4j = (w2j >> 1) - w6j                                              */
  865|  62.6k|    temp5 = _mm_srai_epi16(resq_r2_2, 1); //w2>>1
  866|  62.6k|    temp5 = _mm_sub_epi16(temp5, resq_r6_2); //(w2>>1)-w6
  867|       |    /* y5j = -w1j + w7j + w5j + (w5j >> 1)                                   */
  868|  62.6k|    temp6 = _mm_sub_epi32(resq_r7_1, resq_r1_1); //w7-w1
  869|  62.6k|    temp14 = _mm_sub_epi32(resq_r7_2, resq_r1_2);
  870|  62.6k|    temp6 = _mm_add_epi32(temp6, resq_r5_1); //w7-w1+w5
  871|  62.6k|    temp14 = _mm_add_epi32(temp14, resq_r5_2);
  872|  62.6k|    temp7 = _mm_srai_epi32(resq_r5_1, 1); //w5>>1
  873|  62.6k|    temp15 = _mm_srai_epi32(resq_r5_2, 1);
  874|  62.6k|    temp6 = _mm_add_epi32(temp6, temp7); //w7-w1_w5+(w5>>1)
  875|  62.6k|    temp14 = _mm_add_epi32(temp14, temp15);
  876|  62.6k|    temp6 = _mm_packs_epi32(temp6, temp14);
  877|       |    /* y6j = w2j + (w6j >> 1)                                              */
  878|  62.6k|    temp7 = _mm_srai_epi16(resq_r6_2, 1); //w6>>1
  879|  62.6k|    temp7 = _mm_add_epi16(temp7, resq_r2_2); //(w6>>1)+w2
  880|       |    /* y7j = w3j + w5j + w1j + (w1j >> 1)                                    */
  881|  62.6k|    temp8 = _mm_add_epi32(resq_r3_1, resq_r5_1); //w3+w5
  882|  62.6k|    temp16 = _mm_add_epi32(resq_r3_2, resq_r5_2);
  883|  62.6k|    temp8 = _mm_add_epi32(temp8, resq_r1_1); //w3+w5+w1
  884|  62.6k|    temp16 = _mm_add_epi32(temp16, resq_r1_2);
  885|  62.6k|    temp17 = _mm_srai_epi32(resq_r1_1, 1); //w1>>1
  886|  62.6k|    temp18 = _mm_srai_epi32(resq_r1_2, 1);
  887|  62.6k|    temp8 = _mm_add_epi32(temp8, temp17); //w3+w5+w1+(w1>>1)
  888|  62.6k|    temp16 = _mm_add_epi32(temp16, temp18);
  889|  62.6k|    temp8 = _mm_packs_epi32(temp8, temp16);
  890|       |    /*------------------------------------------------------------------*/
  891|       |    /*------------------------------------------------------------------*/
  892|       |    /* z0j = y0j + y6j                                                        */
  893|  62.6k|    resq_r0_1 = _mm_add_epi16(temp1, temp7);
  894|       |    /* z1j = y1j + (y7j >> 2)                                                */
  895|  62.6k|    resq_r1_1 = _mm_srai_epi16(temp8, 2);
  896|  62.6k|    resq_r1_1 = _mm_add_epi16(resq_r1_1, temp2);
  897|       |    /* z2j = y2j + y4j                                                        */
  898|  62.6k|    resq_r2_1 = _mm_add_epi16(temp3, temp5);
  899|       |    /* z3j = y3j + (y5j >> 2)                                                */
  900|  62.6k|    resq_r3_1 = _mm_srai_epi16(temp6, 2);
  901|  62.6k|    resq_r3_1 = _mm_add_epi16(resq_r3_1, temp4);
  902|       |    /* z4j = y2j - y4j                                                        */
  903|  62.6k|    resq_r4_1 = _mm_sub_epi16(temp3, temp5);
  904|       |    /* z5j = (y3j >> 2) - y5j                                                 */
  905|  62.6k|    resq_r5_1 = _mm_srai_epi16(temp4, 2);
  906|  62.6k|    resq_r5_1 = _mm_sub_epi16(resq_r5_1, temp6);
  907|       |    /* z6j = y0j - y6j                                                     */
  908|  62.6k|    resq_r6_1 = _mm_sub_epi16(temp1, temp7);
  909|       |    /* z7j = y7j - (y1j >> 2)                                                 */
  910|  62.6k|    resq_r7_1 = _mm_srai_epi16(temp2, 2);
  911|  62.6k|    resq_r7_1 = _mm_sub_epi16(temp8, resq_r7_1);
  912|       |    /*------------------------------------------------------------------*/
  913|       |
  914|       |    /*------------------------------------------------------------------*/
  915|       |    /* x0j = z0j + z7j                                                        */
  916|  62.6k|    temp1 = _mm_add_epi16(resq_r0_1, resq_r7_1);
  917|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp1);
  918|  62.6k|    temp10 = _mm_unpacklo_epi16(temp1, sign_reg);
  919|  62.6k|    temp11 = _mm_unpackhi_epi16(temp1, sign_reg);
  920|  62.6k|    temp10 = _mm_add_epi32(temp10, value_32);
  921|  62.6k|    temp11 = _mm_add_epi32(temp11, value_32);
  922|  62.6k|    temp10 = _mm_srai_epi32(temp10, 6);
  923|  62.6k|    temp11 = _mm_srai_epi32(temp11, 6);
  924|  62.6k|    temp10 = _mm_packs_epi32(temp10, temp11);
  925|  62.6k|    temp1 = _mm_add_epi16(temp10, pred_r0_1);
  926|       |    /* x1j = z2j + z5j                                                        */
  927|  62.6k|    temp2 = _mm_add_epi16(resq_r2_1, resq_r5_1);
  928|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp2);
  929|  62.6k|    temp10 = _mm_unpacklo_epi16(temp2, sign_reg);
  930|  62.6k|    temp11 = _mm_unpackhi_epi16(temp2, sign_reg);
  931|  62.6k|    temp10 = _mm_add_epi32(temp10, value_32);
  932|  62.6k|    temp11 = _mm_add_epi32(temp11, value_32);
  933|  62.6k|    temp10 = _mm_srai_epi32(temp10, 6);
  934|  62.6k|    temp11 = _mm_srai_epi32(temp11, 6);
  935|  62.6k|    temp10 = _mm_packs_epi32(temp10, temp11);
  936|  62.6k|    temp2 = _mm_add_epi16(temp10, pred_r1_1);
  937|       |    /* x2j = z4j + z3j                                                        */
  938|  62.6k|    temp3 = _mm_add_epi16(resq_r4_1, resq_r3_1);
  939|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp3);
  940|  62.6k|    temp10 = _mm_unpacklo_epi16(temp3, sign_reg);
  941|  62.6k|    temp11 = _mm_unpackhi_epi16(temp3, sign_reg);
  942|  62.6k|    temp10 = _mm_add_epi32(temp10, value_32);
  943|  62.6k|    temp11 = _mm_add_epi32(temp11, value_32);
  944|  62.6k|    temp10 = _mm_srai_epi32(temp10, 6);
  945|  62.6k|    temp11 = _mm_srai_epi32(temp11, 6);
  946|  62.6k|    temp10 = _mm_packs_epi32(temp10, temp11);
  947|  62.6k|    temp3 = _mm_add_epi16(temp10, pred_r2_1);
  948|       |    /* x3j = z6j + z1j                                                        */
  949|  62.6k|    temp4 = _mm_add_epi16(resq_r6_1, resq_r1_1);
  950|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp4);
  951|  62.6k|    temp10 = _mm_unpacklo_epi16(temp4, sign_reg);
  952|  62.6k|    temp11 = _mm_unpackhi_epi16(temp4, sign_reg);
  953|  62.6k|    temp10 = _mm_add_epi32(temp10, value_32);
  954|  62.6k|    temp11 = _mm_add_epi32(temp11, value_32);
  955|  62.6k|    temp10 = _mm_srai_epi32(temp10, 6);
  956|  62.6k|    temp11 = _mm_srai_epi32(temp11, 6);
  957|  62.6k|    temp10 = _mm_packs_epi32(temp10, temp11);
  958|  62.6k|    temp4 = _mm_add_epi16(temp10, pred_r3_1);
  959|       |    /* x4j = z6j - z1j                                                        */
  960|  62.6k|    temp5 = _mm_sub_epi16(resq_r6_1, resq_r1_1);
  961|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp5);
  962|  62.6k|    temp10 = _mm_unpacklo_epi16(temp5, sign_reg);
  963|  62.6k|    temp11 = _mm_unpackhi_epi16(temp5, sign_reg);
  964|  62.6k|    temp10 = _mm_add_epi32(temp10, value_32);
  965|  62.6k|    temp11 = _mm_add_epi32(temp11, value_32);
  966|  62.6k|    temp10 = _mm_srai_epi32(temp10, 6);
  967|  62.6k|    temp11 = _mm_srai_epi32(temp11, 6);
  968|  62.6k|    temp10 = _mm_packs_epi32(temp10, temp11);
  969|  62.6k|    temp5 = _mm_add_epi16(temp10, pred_r4_1);
  970|       |    /* x5j = z4j - z3j                                                        */
  971|  62.6k|    temp6 = _mm_sub_epi16(resq_r4_1, resq_r3_1);
  972|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp6);
  973|  62.6k|    temp10 = _mm_unpacklo_epi16(temp6, sign_reg);
  974|  62.6k|    temp11 = _mm_unpackhi_epi16(temp6, sign_reg);
  975|  62.6k|    temp10 = _mm_add_epi32(temp10, value_32);
  976|  62.6k|    temp11 = _mm_add_epi32(temp11, value_32);
  977|  62.6k|    temp10 = _mm_srai_epi32(temp10, 6);
  978|  62.6k|    temp11 = _mm_srai_epi32(temp11, 6);
  979|  62.6k|    temp10 = _mm_packs_epi32(temp10, temp11);
  980|  62.6k|    temp6 = _mm_add_epi16(temp10, pred_r5_1);
  981|       |    /* x6j = z2j - z5j                                                        */
  982|  62.6k|    temp7 = _mm_sub_epi16(resq_r2_1, resq_r5_1);
  983|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp7);
  984|  62.6k|    temp10 = _mm_unpacklo_epi16(temp7, sign_reg);
  985|  62.6k|    temp11 = _mm_unpackhi_epi16(temp7, sign_reg);
  986|  62.6k|    temp10 = _mm_add_epi32(temp10, value_32);
  987|  62.6k|    temp11 = _mm_add_epi32(temp11, value_32);
  988|  62.6k|    temp10 = _mm_srai_epi32(temp10, 6);
  989|  62.6k|    temp11 = _mm_srai_epi32(temp11, 6);
  990|  62.6k|    temp10 = _mm_packs_epi32(temp10, temp11);
  991|  62.6k|    temp7 = _mm_add_epi16(temp10, pred_r6_1);
  992|       |    /* x7j = z0j - z7j                                                        */
  993|  62.6k|    temp8 = _mm_sub_epi16(resq_r0_1, resq_r7_1);
  994|  62.6k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp8);
  995|  62.6k|    temp10 = _mm_unpacklo_epi16(temp8, sign_reg);
  996|  62.6k|    temp11 = _mm_unpackhi_epi16(temp8, sign_reg);
  997|  62.6k|    temp10 = _mm_add_epi32(temp10, value_32);
  998|  62.6k|    temp11 = _mm_add_epi32(temp11, value_32);
  999|  62.6k|    temp10 = _mm_srai_epi32(temp10, 6);
 1000|  62.6k|    temp11 = _mm_srai_epi32(temp11, 6);
 1001|  62.6k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1002|  62.6k|    temp8 = _mm_add_epi16(temp10, pred_r7_1);
 1003|       |    /*------------------------------------------------------------------*/
 1004|       |    //Clipping the results to 8 bits
 1005|  62.6k|    sign_reg = _mm_cmpgt_epi16(temp1, zero_8x16b); // sign check
 1006|  62.6k|    temp1 = _mm_and_si128(temp1, sign_reg);
 1007|  62.6k|    sign_reg = _mm_cmpgt_epi16(temp2, zero_8x16b); // sign check
 1008|  62.6k|    temp2 = _mm_and_si128(temp2, sign_reg);
 1009|  62.6k|    sign_reg = _mm_cmpgt_epi16(temp3, zero_8x16b); // sign check
 1010|  62.6k|    temp3 = _mm_and_si128(temp3, sign_reg);
 1011|  62.6k|    sign_reg = _mm_cmpgt_epi16(temp4, zero_8x16b); // sign check
 1012|  62.6k|    temp4 = _mm_and_si128(temp4, sign_reg);
 1013|  62.6k|    sign_reg = _mm_cmpgt_epi16(temp5, zero_8x16b); // sign check
 1014|  62.6k|    temp5 = _mm_and_si128(temp5, sign_reg);
 1015|  62.6k|    sign_reg = _mm_cmpgt_epi16(temp6, zero_8x16b); // sign check
 1016|  62.6k|    temp6 = _mm_and_si128(temp6, sign_reg);
 1017|  62.6k|    sign_reg = _mm_cmpgt_epi16(temp7, zero_8x16b); // sign check
 1018|  62.6k|    temp7 = _mm_and_si128(temp7, sign_reg);
 1019|  62.6k|    sign_reg = _mm_cmpgt_epi16(temp8, zero_8x16b); // sign check
 1020|  62.6k|    temp8 = _mm_and_si128(temp8, sign_reg);
 1021|       |
 1022|  62.6k|    resq_r0_2 = _mm_packus_epi16(temp1, zero_8x16b);
 1023|  62.6k|    resq_r1_2 = _mm_packus_epi16(temp2, zero_8x16b);
 1024|  62.6k|    resq_r2_2 = _mm_packus_epi16(temp3, zero_8x16b);
 1025|  62.6k|    resq_r3_2 = _mm_packus_epi16(temp4, zero_8x16b);
 1026|  62.6k|    resq_r4_2 = _mm_packus_epi16(temp5, zero_8x16b);
 1027|  62.6k|    resq_r5_2 = _mm_packus_epi16(temp6, zero_8x16b);
 1028|  62.6k|    resq_r6_2 = _mm_packus_epi16(temp7, zero_8x16b);
 1029|  62.6k|    resq_r7_2 = _mm_packus_epi16(temp8, zero_8x16b);
 1030|       |
 1031|  62.6k|    _mm_storel_epi64((__m128i *) (&pu1_out[0]), resq_r0_2);
 1032|  62.6k|    _mm_storel_epi64((__m128i *) (&pu1_out[out_strd]), resq_r1_2);
 1033|  62.6k|    _mm_storel_epi64((__m128i *) (&pu1_out[2 * out_strd]), resq_r2_2);
 1034|  62.6k|    _mm_storel_epi64((__m128i *) (&pu1_out[3 * out_strd]), resq_r3_2);
 1035|  62.6k|    _mm_storel_epi64((__m128i *) (&pu1_out[4 * out_strd]), resq_r4_2);
 1036|  62.6k|    _mm_storel_epi64((__m128i *) (&pu1_out[5 * out_strd]), resq_r5_2);
 1037|  62.6k|    _mm_storel_epi64((__m128i *) (&pu1_out[6 * out_strd]), resq_r6_2);
 1038|  62.6k|    _mm_storel_epi64((__m128i *) (&pu1_out[7 * out_strd]), resq_r7_2);
 1039|  62.6k|}

ih264_intra_pred_luma_4x4_mode_vert_ssse3:
  122|  35.7k|{
  123|  35.7k|    UWORD8 *pu1_top;
  124|  35.7k|    WORD32 dst_strd2, dst_strd3;
  125|  35.7k|    WORD32 i4_top;
  126|       |
  127|  35.7k|    UNUSED(src_strd);
  ------------------
  |  |   45|  35.7k|#define UNUSED(x) ((void)(x))
  ------------------
  128|  35.7k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  35.7k|#define UNUSED(x) ((void)(x))
  ------------------
  129|       |
  130|  35.7k|    pu1_top = pu1_src + BLK_SIZE + 1;
  ------------------
  |  |  511|  35.7k|#define BLK_SIZE            4
  ------------------
  131|       |
  132|  35.7k|    i4_top = *((WORD32 *)pu1_top);
  133|       |
  134|  35.7k|    dst_strd2 = dst_strd << 1;
  135|  35.7k|    dst_strd3 = dst_strd + dst_strd2;
  136|       |
  137|  35.7k|    *((WORD32 *)(pu1_dst)) = i4_top;
  138|  35.7k|    *((WORD32 *)(pu1_dst + dst_strd)) = i4_top;
  139|  35.7k|    *((WORD32 *)(pu1_dst + dst_strd2)) = i4_top;
  140|  35.7k|    *((WORD32 *)(pu1_dst + dst_strd3)) = i4_top;
  141|  35.7k|}
ih264_intra_pred_luma_4x4_mode_horz_ssse3:
  181|  7.39k|{
  182|  7.39k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
  183|  7.39k|    WORD32 row1,row2,row3,row4;
  184|  7.39k|    UWORD8 val;
  185|  7.39k|    WORD32 dst_strd2, dst_strd3;
  186|       |
  187|  7.39k|    UNUSED(src_strd);
  ------------------
  |  |   45|  7.39k|#define UNUSED(x) ((void)(x))
  ------------------
  188|  7.39k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  7.39k|#define UNUSED(x) ((void)(x))
  ------------------
  189|  7.39k|    pu1_left = pu1_src + BLK_SIZE - 1;
  ------------------
  |  |  511|  7.39k|#define BLK_SIZE            4
  ------------------
  190|       |
  191|  7.39k|    val  = *pu1_left;
  192|  7.39k|    row1 = val + (val << 8) + (val << 16) + (val << 24);
  193|  7.39k|    val  = *(pu1_left - 1);
  194|  7.39k|    row2 = val + (val << 8) + (val << 16) + (val << 24);
  195|  7.39k|    val  = *(pu1_left - 2);
  196|  7.39k|    row3 = val + (val << 8) + (val << 16) + (val << 24);
  197|  7.39k|    val  = *(pu1_left - 3);
  198|  7.39k|    row4 = val + (val << 8) + (val << 16) + (val << 24);
  199|       |
  200|  7.39k|    dst_strd2 = dst_strd << 1;
  201|  7.39k|    dst_strd3 = dst_strd + dst_strd2;
  202|       |
  203|  7.39k|    *((WORD32 *)(pu1_dst)) = row1;
  204|  7.39k|    *((WORD32 *)(pu1_dst + dst_strd)) = row2;
  205|  7.39k|    *((WORD32 *)(pu1_dst + dst_strd2)) = row3;
  206|  7.39k|    *((WORD32 *)(pu1_dst + dst_strd3)) = row4;
  207|  7.39k|}
ih264_intra_pred_luma_4x4_mode_dc_ssse3:
  246|  45.9k|{
  247|  45.9k|    UWORD8 u1_useleft; /* availability of left predictors (only for DC) */
  248|  45.9k|    UWORD8 u1_usetop; /* availability of top predictors (only for DC) */
  249|  45.9k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
  250|  45.9k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
  251|  45.9k|    WORD32 dst_strd2, dst_strd3;
  252|  45.9k|    WORD32 val = 0;
  253|  45.9k|    UNUSED(src_strd);
  ------------------
  |  |   45|  45.9k|#define UNUSED(x) ((void)(x))
  ------------------
  254|  45.9k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  45.9k|#define UNUSED(x) ((void)(x))
  ------------------
  255|  45.9k|    u1_useleft = BOOLEAN(ngbr_avail & LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|  45.9k|#define BOOLEAN(x) (!!(x))
  ------------------
  256|  45.9k|    u1_usetop = BOOLEAN(ngbr_avail & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|  45.9k|#define BOOLEAN(x) (!!(x))
  ------------------
  257|  45.9k|    pu1_top = pu1_src + BLK_SIZE + 1;
  ------------------
  |  |  511|  45.9k|#define BLK_SIZE            4
  ------------------
  258|  45.9k|    pu1_left = pu1_src + BLK_SIZE - 1;
  ------------------
  |  |  511|  45.9k|#define BLK_SIZE            4
  ------------------
  259|       |
  260|  45.9k|    if(u1_useleft)
  ------------------
  |  Branch (260:8): [True: 35.7k, False: 10.2k]
  ------------------
  261|  35.7k|    {
  262|  35.7k|        val += *pu1_left--;
  263|  35.7k|        val += *pu1_left--;
  264|  35.7k|        val += *pu1_left--;
  265|  35.7k|        val += *pu1_left + 2;
  266|  35.7k|    }
  267|  45.9k|    if(u1_usetop)
  ------------------
  |  Branch (267:8): [True: 36.9k, False: 8.99k]
  ------------------
  268|  36.9k|    {
  269|  36.9k|        val += *pu1_top + *(pu1_top + 1) + *(pu1_top + 2) + *(pu1_top + 3)
  270|  36.9k|                        + 2;
  271|  36.9k|    }
  272|       |    /* Since 2 is added if either left/top pred is there,
  273|       |     val still being zero implies both preds are not there */
  274|  45.9k|    val = (val) ? (val >> (1 + u1_useleft + u1_usetop)) : 128;
  ------------------
  |  Branch (274:11): [True: 44.5k, False: 1.41k]
  ------------------
  275|       |
  276|  45.9k|    val = val + (val << 8) + (val << 16) + (val << 24);
  277|       |
  278|  45.9k|    dst_strd2 = dst_strd << 1;
  279|  45.9k|    dst_strd3 = dst_strd + dst_strd2;
  280|       |
  281|  45.9k|    *((WORD32 *)(pu1_dst)) = val;
  282|  45.9k|    *((WORD32 *)(pu1_dst + dst_strd)) = val;
  283|  45.9k|    *((WORD32 *)(pu1_dst + dst_strd2)) = val;
  284|  45.9k|    *((WORD32 *)(pu1_dst + dst_strd3)) = val;
  285|  45.9k|}
ih264_intra_pred_luma_4x4_mode_diag_dl_ssse3:
  324|  5.73k|{
  325|  5.73k|    UWORD8 *pu1_top;
  326|  5.73k|    WORD32 dst_strd2, dst_strd3;
  327|       |
  328|  5.73k|    __m128i top_16x8b, top_8x16b, top_sh_8x16b;
  329|  5.73k|    __m128i res1_8x16b, res2_8x16b, res_16x8b;
  330|  5.73k|    __m128i zero_vector, const_2_8x16b;
  331|  5.73k|    WORD32 row1,row2,row3,row4;
  332|       |
  333|  5.73k|    UNUSED(src_strd);
  ------------------
  |  |   45|  5.73k|#define UNUSED(x) ((void)(x))
  ------------------
  334|  5.73k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  5.73k|#define UNUSED(x) ((void)(x))
  ------------------
  335|       |
  336|  5.73k|    pu1_top = pu1_src + BLK_SIZE + 1;
  ------------------
  |  |  511|  5.73k|#define BLK_SIZE            4
  ------------------
  337|       |
  338|  5.73k|    top_16x8b = _mm_loadl_epi64((__m128i *)pu1_top);
  339|  5.73k|    zero_vector = _mm_setzero_si128();
  340|  5.73k|    top_8x16b = _mm_unpacklo_epi8(top_16x8b, zero_vector);    //t0 t1 t2 t3 t4 t5 t6 t7
  341|       |
  342|  5.73k|    top_sh_8x16b = _mm_srli_si128(top_8x16b, 2);              //t1 t2 t3 t4 t5 t6 t7 0
  343|  5.73k|    const_2_8x16b = _mm_set1_epi16(2);
  344|       |
  345|  5.73k|    top_sh_8x16b = _mm_shufflehi_epi16(top_sh_8x16b, 0xa4);   //t1 t2 t3 t4 t5 t6 t7 t7
  346|  5.73k|    res1_8x16b = _mm_add_epi16(top_8x16b, top_sh_8x16b);
  347|  5.73k|    res2_8x16b = _mm_srli_si128(res1_8x16b, 2);
  348|       |
  349|  5.73k|    res1_8x16b = _mm_add_epi16(res1_8x16b, const_2_8x16b);
  350|  5.73k|    res1_8x16b = _mm_add_epi16(res2_8x16b, res1_8x16b);
  351|  5.73k|    res1_8x16b = _mm_srai_epi16(res1_8x16b, 2);
  352|       |
  353|  5.73k|    dst_strd2 = dst_strd << 1;
  354|  5.73k|    dst_strd3 = dst_strd + dst_strd2;
  355|       |
  356|  5.73k|    res_16x8b = _mm_packus_epi16(res1_8x16b, res1_8x16b);
  357|  5.73k|    row1 = _mm_cvtsi128_si32(res_16x8b);
  358|  5.73k|    res_16x8b = _mm_srli_si128(res_16x8b, 1);
  359|  5.73k|    row2 = _mm_cvtsi128_si32(res_16x8b);
  360|  5.73k|    res_16x8b = _mm_srli_si128(res_16x8b, 1);
  361|  5.73k|    row3 = _mm_cvtsi128_si32(res_16x8b);
  362|  5.73k|    res_16x8b = _mm_srli_si128(res_16x8b, 1);
  363|  5.73k|    row4 = _mm_cvtsi128_si32(res_16x8b);
  364|       |
  365|  5.73k|    *((WORD32 *)(pu1_dst)) = row1;
  366|  5.73k|    *((WORD32 *)(pu1_dst + dst_strd)) = row2;
  367|  5.73k|    *((WORD32 *)(pu1_dst + dst_strd2)) = row3;
  368|  5.73k|    *((WORD32 *)(pu1_dst + dst_strd3)) = row4;
  369|  5.73k|}
ih264_intra_pred_luma_4x4_mode_diag_dr_ssse3:
  408|  2.55k|{
  409|  2.55k|    UWORD8 *pu1_left;
  410|  2.55k|    WORD32 dst_strd2, dst_strd3;
  411|       |
  412|  2.55k|    __m128i top_left_16x8b, top_left_8x16b;
  413|  2.55k|    __m128i top_left_sh_16x8b, top_left_sh_8x16b;
  414|  2.55k|    __m128i res1_8x16b, res2_8x16b;
  415|  2.55k|    __m128i res1_16x8b, res2_16x8b;
  416|  2.55k|    __m128i zero_vector, const_2_8x16b;
  417|  2.55k|    WORD32 row1,row2,row3,row4;
  418|       |
  419|  2.55k|    UNUSED(src_strd);
  ------------------
  |  |   45|  2.55k|#define UNUSED(x) ((void)(x))
  ------------------
  420|  2.55k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  2.55k|#define UNUSED(x) ((void)(x))
  ------------------
  421|       |
  422|  2.55k|    pu1_left = pu1_src + BLK_SIZE - 1;
  ------------------
  |  |  511|  2.55k|#define BLK_SIZE            4
  ------------------
  423|       |
  424|  2.55k|    top_left_16x8b = _mm_loadu_si128((__m128i *)(pu1_left - 3));             //l3 l2 l1 l0 tl t0 t1 t2...
  425|  2.55k|    zero_vector = _mm_setzero_si128();
  426|  2.55k|    top_left_sh_16x8b = _mm_srli_si128(top_left_16x8b, 1);                   //l2 l1 l0 tl t0 t1 t2 t3...
  427|       |
  428|  2.55k|    top_left_8x16b = _mm_unpacklo_epi8(top_left_16x8b, zero_vector);
  429|  2.55k|    top_left_sh_8x16b = _mm_unpacklo_epi8(top_left_sh_16x8b, zero_vector);
  430|       |
  431|  2.55k|    res1_8x16b = _mm_add_epi16(top_left_8x16b, top_left_sh_8x16b);           //l3+l2 l2+l1 l1+l0 l0+tl tl+t0 t0+t1 t1+t2 t2+t3...
  432|  2.55k|    const_2_8x16b = _mm_set1_epi16(2);
  433|  2.55k|    res2_8x16b = _mm_srli_si128(res1_8x16b, 2);                              //l2+l1 l1+l0 l0+tl tl+t0 t0+t1 t1+t2 t2+t3...
  434|       |
  435|  2.55k|    res1_8x16b = _mm_add_epi16(res1_8x16b, const_2_8x16b);
  436|  2.55k|    res1_8x16b = _mm_add_epi16(res2_8x16b, res1_8x16b);                      //l3+2*l2+l1+2 l2+2*l1+l0+2...
  437|  2.55k|    res1_8x16b = _mm_srai_epi16(res1_8x16b, 2);
  438|  2.55k|    res1_16x8b = _mm_packus_epi16(res1_8x16b, res1_8x16b);
  439|       |
  440|  2.55k|    dst_strd2 = dst_strd << 1;
  441|  2.55k|    dst_strd3 = dst_strd + dst_strd2;
  442|       |
  443|  2.55k|    res2_16x8b = _mm_srli_si128(res1_16x8b, 3);
  444|       |
  445|  2.55k|    row1 = _mm_cvtsi128_si32(res2_16x8b);
  446|  2.55k|    res2_16x8b = _mm_srli_si128(res1_16x8b, 2);
  447|  2.55k|    row2 = _mm_cvtsi128_si32(res2_16x8b);
  448|  2.55k|    res2_16x8b = _mm_srli_si128(res1_16x8b, 1);
  449|  2.55k|    row3 = _mm_cvtsi128_si32(res2_16x8b);
  450|  2.55k|    row4 = _mm_cvtsi128_si32(res1_16x8b);
  451|       |
  452|  2.55k|    *((WORD32 *)(pu1_dst)) = row1;
  453|  2.55k|    *((WORD32 *)(pu1_dst + dst_strd)) = row2;
  454|  2.55k|    *((WORD32 *)(pu1_dst + dst_strd2)) = row3;
  455|  2.55k|    *((WORD32 *)(pu1_dst + dst_strd3)) = row4;
  456|  2.55k|}
ih264_intra_pred_luma_4x4_mode_vert_r_ssse3:
  495|  2.03k|{
  496|  2.03k|    UWORD8 *pu1_left;
  497|  2.03k|    WORD32 dst_strd2, dst_strd3;
  498|       |
  499|  2.03k|    __m128i val_16x8b, temp_16x8b;
  500|  2.03k|    __m128i w11_a1_16x8b, w11_a2_16x8b;
  501|  2.03k|    __m128i w121_a1_8x16b, w121_a2_8x16b, w121_sh_8x16b;
  502|  2.03k|    __m128i row1_16x8b, row2_16x8b, row3_16x8b, row4_16x8b;
  503|  2.03k|    __m128i zero_vector, const_2_8x16b;
  504|  2.03k|    WORD32 row1,row2,row3,row4;
  505|       |
  506|  2.03k|    UNUSED(src_strd);
  ------------------
  |  |   45|  2.03k|#define UNUSED(x) ((void)(x))
  ------------------
  507|  2.03k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  2.03k|#define UNUSED(x) ((void)(x))
  ------------------
  508|       |
  509|  2.03k|    pu1_left = pu1_src + BLK_SIZE - 1;
  ------------------
  |  |  511|  2.03k|#define BLK_SIZE            4
  ------------------
  510|       |
  511|  2.03k|    val_16x8b = _mm_loadl_epi64((__m128i *)(pu1_left - 2));
  512|  2.03k|    zero_vector = _mm_setzero_si128();
  513|       |
  514|  2.03k|    w121_a1_8x16b = _mm_unpacklo_epi8(val_16x8b, zero_vector);        //l2 l1 l0 tl t0 t1 t2 t3
  515|  2.03k|    w11_a1_16x8b = _mm_srli_si128(val_16x8b, 3);
  516|  2.03k|    w121_a2_8x16b = _mm_srli_si128(w121_a1_8x16b, 2);                 //l1 l0 tl t0 t1 t2 t3 0
  517|  2.03k|    w11_a2_16x8b = _mm_srli_si128(val_16x8b, 4);
  518|       |
  519|  2.03k|    w121_a1_8x16b = _mm_add_epi16(w121_a1_8x16b, w121_a2_8x16b);      //l2+l1 l1+l0 l0+tl tl+t0 t0+t1 t1+t2 t2+t3 t3
  520|  2.03k|    row1_16x8b = _mm_avg_epu8(w11_a1_16x8b, w11_a2_16x8b);
  521|  2.03k|    w121_a2_8x16b = _mm_srli_si128(w121_a1_8x16b, 2);                 //l1+l0 l0+tl tl+t0 t0+t1 t1+t2 t2+t3 t3    0
  522|       |
  523|  2.03k|    const_2_8x16b = _mm_set1_epi16(2);
  524|  2.03k|    w121_a1_8x16b = _mm_add_epi16(w121_a1_8x16b, w121_a2_8x16b);      //l2+2*l1+l0 l1+2*l0+tl ...
  525|  2.03k|    w121_a1_8x16b = _mm_add_epi16(w121_a1_8x16b, const_2_8x16b);
  526|  2.03k|    w121_a1_8x16b = _mm_srai_epi16(w121_a1_8x16b, 2);
  527|       |
  528|  2.03k|    w121_sh_8x16b = _mm_shufflelo_epi16(w121_a1_8x16b, 0xe1);
  529|  2.03k|    w121_sh_8x16b = _mm_srli_si128(w121_sh_8x16b, 2);
  530|       |
  531|  2.03k|    row4_16x8b = _mm_packus_epi16(w121_sh_8x16b, w121_sh_8x16b);
  532|  2.03k|    temp_16x8b = _mm_slli_si128(w121_a1_8x16b, 13);
  533|  2.03k|    row2_16x8b = _mm_srli_si128(row4_16x8b, 1);
  534|  2.03k|    row3_16x8b = _mm_alignr_epi8(row1_16x8b, temp_16x8b, 15);
  535|       |
  536|  2.03k|    dst_strd2 = dst_strd << 1;
  537|  2.03k|    dst_strd3 = dst_strd + dst_strd2;
  538|       |
  539|  2.03k|    row1 = _mm_cvtsi128_si32(row1_16x8b);
  540|  2.03k|    row2 = _mm_cvtsi128_si32(row2_16x8b);
  541|  2.03k|    row3 = _mm_cvtsi128_si32(row3_16x8b);
  542|  2.03k|    row4 = _mm_cvtsi128_si32(row4_16x8b);
  543|       |
  544|  2.03k|    *((WORD32 *)(pu1_dst)) = row1;
  545|  2.03k|    *((WORD32 *)(pu1_dst + dst_strd)) = row2;
  546|  2.03k|    *((WORD32 *)(pu1_dst + dst_strd2)) = row3;
  547|  2.03k|    *((WORD32 *)(pu1_dst + dst_strd3)) = row4;
  548|  2.03k|}
ih264_intra_pred_luma_4x4_mode_horz_d_ssse3:
  587|  4.05k|{
  588|  4.05k|    UWORD8 *pu1_left;
  589|  4.05k|    WORD32 dst_strd2, dst_strd3;
  590|  4.05k|    WORD32 val_121_t0t1;
  591|       |
  592|  4.05k|    __m128i val_16x8b, val_sh_16x8b;
  593|  4.05k|    __m128i w11_16x8b;
  594|  4.05k|    __m128i w121_a1_8x16b, w121_a2_8x16b, w121_16x8b;
  595|  4.05k|    __m128i row1_16x8b, row2_16x8b, row3_16x8b, row4_16x8b;
  596|       |
  597|  4.05k|    __m128i zero_vector, const_2_8x16b;
  598|  4.05k|    WORD32 row1,row2,row3,row4;
  599|       |
  600|  4.05k|    UNUSED(src_strd);
  ------------------
  |  |   45|  4.05k|#define UNUSED(x) ((void)(x))
  ------------------
  601|  4.05k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  4.05k|#define UNUSED(x) ((void)(x))
  ------------------
  602|       |
  603|  4.05k|    pu1_left = pu1_src + BLK_SIZE - 1;
  ------------------
  |  |  511|  4.05k|#define BLK_SIZE            4
  ------------------
  604|       |
  605|  4.05k|    val_16x8b = _mm_loadl_epi64((__m128i *)(pu1_left - 3));
  606|  4.05k|    zero_vector = _mm_setzero_si128();
  607|  4.05k|    val_sh_16x8b = _mm_srli_si128(val_16x8b, 1);
  608|  4.05k|    w11_16x8b = _mm_avg_epu8(val_16x8b, val_sh_16x8b);
  609|       |
  610|  4.05k|    w121_a1_8x16b = _mm_unpacklo_epi8(val_16x8b, zero_vector);        //l3 l2 l1 l0 tl t0 t1 t2
  611|  4.05k|    w121_a2_8x16b = _mm_srli_si128(w121_a1_8x16b, 2);                 //l2 l1 l0 tl t0 t1 t2 0
  612|  4.05k|    w121_a1_8x16b = _mm_add_epi16(w121_a1_8x16b, w121_a2_8x16b);      //l3+l2 l2+l1 l1+l0 l0+tl tl+t0 t0+t1 t1+t2 t2
  613|  4.05k|    w121_a2_8x16b = _mm_srli_si128(w121_a1_8x16b, 2);                 //l2+l1 l1+l0 l0+tl tl+t0 t0+t1 t1+t2 t2    0
  614|       |
  615|  4.05k|    zero_vector = _mm_setzero_si128();
  616|  4.05k|    const_2_8x16b = _mm_set1_epi16(2);
  617|       |
  618|  4.05k|    w121_a1_8x16b = _mm_add_epi16(w121_a1_8x16b, w121_a2_8x16b);      //l3+2*l2+l1 l2+2*l1+l0 l1+2*l0+tl ...
  619|  4.05k|    w121_a1_8x16b = _mm_add_epi16(w121_a1_8x16b, const_2_8x16b);
  620|  4.05k|    w121_a1_8x16b = _mm_srai_epi16(w121_a1_8x16b, 2);
  621|       |
  622|  4.05k|    w121_16x8b = _mm_packus_epi16(w121_a1_8x16b, w121_a1_8x16b);
  623|       |
  624|  4.05k|    row4_16x8b = _mm_unpacklo_epi8(w11_16x8b, w121_16x8b);
  625|  4.05k|    val_121_t0t1 = _mm_extract_epi16(w121_16x8b, 2);
  626|  4.05k|    row4_16x8b = _mm_insert_epi16(row4_16x8b, val_121_t0t1, 4);
  627|       |
  628|  4.05k|    dst_strd2 = dst_strd << 1;
  629|  4.05k|    dst_strd3 = dst_strd + dst_strd2;
  630|       |
  631|  4.05k|    row1_16x8b = _mm_srli_si128(row4_16x8b, 6);
  632|  4.05k|    row2_16x8b = _mm_srli_si128(row4_16x8b, 4);
  633|  4.05k|    row3_16x8b = _mm_srli_si128(row4_16x8b, 2);
  634|       |
  635|  4.05k|    row1 = _mm_cvtsi128_si32(row1_16x8b);
  636|  4.05k|    row2 = _mm_cvtsi128_si32(row2_16x8b);
  637|  4.05k|    row3 = _mm_cvtsi128_si32(row3_16x8b);
  638|  4.05k|    row4 = _mm_cvtsi128_si32(row4_16x8b);
  639|       |
  640|  4.05k|    *((WORD32 *)(pu1_dst)) = row1;
  641|  4.05k|    *((WORD32 *)(pu1_dst + dst_strd)) = row2;
  642|  4.05k|    *((WORD32 *)(pu1_dst + dst_strd2)) = row3;
  643|  4.05k|    *((WORD32 *)(pu1_dst + dst_strd3)) = row4;
  644|  4.05k|}
ih264_intra_pred_luma_4x4_mode_vert_l_ssse3:
  683|  4.85k|{
  684|  4.85k|    UWORD8 *pu1_top;
  685|  4.85k|    WORD32 dst_strd2, dst_strd3;
  686|       |
  687|  4.85k|    __m128i val_16x8b, val_sh_16x8b;
  688|  4.85k|    __m128i w121_a1_8x16b, w121_a2_8x16b;
  689|  4.85k|    __m128i row1_16x8b, row2_16x8b, row3_16x8b, row4_16x8b;
  690|       |
  691|  4.85k|    __m128i zero_vector, const_2_8x16b;
  692|  4.85k|    WORD32 row1,row2,row3,row4;
  693|       |
  694|  4.85k|    UNUSED(src_strd);
  ------------------
  |  |   45|  4.85k|#define UNUSED(x) ((void)(x))
  ------------------
  695|  4.85k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  4.85k|#define UNUSED(x) ((void)(x))
  ------------------
  696|       |
  697|  4.85k|    pu1_top = pu1_src +BLK_SIZE + 1;
  ------------------
  |  |  511|  4.85k|#define BLK_SIZE            4
  ------------------
  698|       |
  699|  4.85k|    val_16x8b = _mm_loadl_epi64((__m128i *)pu1_top);
  700|  4.85k|    zero_vector = _mm_setzero_si128();
  701|  4.85k|    val_sh_16x8b = _mm_srli_si128(val_16x8b, 1);
  702|  4.85k|    row1_16x8b = _mm_avg_epu8(val_16x8b, val_sh_16x8b);
  703|       |
  704|  4.85k|    w121_a1_8x16b = _mm_unpacklo_epi8(val_16x8b, zero_vector);        //t0 t1 t2 t3 t4 t5...
  705|  4.85k|    w121_a2_8x16b = _mm_srli_si128(w121_a1_8x16b, 2);                 //t1 t2 t3 t4 t5 t6...
  706|  4.85k|    w121_a1_8x16b = _mm_add_epi16(w121_a1_8x16b, w121_a2_8x16b);      //t0+t1 t1+t2 t2+t3 t3+t4 t4+t5...
  707|  4.85k|    w121_a2_8x16b = _mm_srli_si128(w121_a1_8x16b, 2);                 //t1+t2 t2+t3 t3+t4 t4+t5 t5+t6...
  708|       |
  709|  4.85k|    zero_vector = _mm_setzero_si128();
  710|  4.85k|    const_2_8x16b = _mm_set1_epi16(2);
  711|       |
  712|  4.85k|    w121_a1_8x16b = _mm_add_epi16(w121_a1_8x16b, w121_a2_8x16b);      //t0+2*t1+t2 t1+2*t2+t3 t2+2*t3+t4...
  713|  4.85k|    w121_a1_8x16b = _mm_add_epi16(w121_a1_8x16b, const_2_8x16b);
  714|  4.85k|    w121_a1_8x16b = _mm_srai_epi16(w121_a1_8x16b, 2);
  715|       |
  716|  4.85k|    row2_16x8b = _mm_packus_epi16(w121_a1_8x16b, w121_a1_8x16b);
  717|       |
  718|  4.85k|    dst_strd2 = dst_strd << 1;
  719|  4.85k|    dst_strd3 = dst_strd + dst_strd2;
  720|       |
  721|  4.85k|    row3_16x8b = _mm_srli_si128(row1_16x8b, 1);
  722|  4.85k|    row4_16x8b = _mm_srli_si128(row2_16x8b, 1);
  723|       |
  724|  4.85k|    row1 = _mm_cvtsi128_si32(row1_16x8b);
  725|  4.85k|    row2 = _mm_cvtsi128_si32(row2_16x8b);
  726|  4.85k|    row3 = _mm_cvtsi128_si32(row3_16x8b);
  727|  4.85k|    row4 = _mm_cvtsi128_si32(row4_16x8b);
  728|       |
  729|  4.85k|    *((WORD32 *)(pu1_dst)) = row1;
  730|  4.85k|    *((WORD32 *)(pu1_dst + dst_strd)) = row2;
  731|  4.85k|    *((WORD32 *)(pu1_dst + dst_strd2)) = row3;
  732|  4.85k|    *((WORD32 *)(pu1_dst + dst_strd3)) = row4;
  733|  4.85k|}
ih264_intra_pred_luma_4x4_mode_horz_u_ssse3:
  772|  8.43k|{
  773|  8.43k|    UWORD8 *pu1_left;
  774|  8.43k|    WORD32 dst_strd2, dst_strd3;
  775|       |
  776|  8.43k|    __m128i val_16x8b, val_sh_16x8b;
  777|  8.43k|    __m128i w11_16x8b;
  778|  8.43k|    __m128i w121_a1_8x16b, w121_a2_8x16b, w121_16x8b;
  779|  8.43k|    __m128i row1_16x8b, row2_16x8b, row3_16x8b, row4_16x8b;
  780|       |
  781|  8.43k|    __m128i zero_vector, const_2_8x16b, rev_16x8b;
  782|  8.43k|    WORD32 row1,row2,row3,row4;
  783|       |
  784|  8.43k|    UNUSED(src_strd);
  ------------------
  |  |   45|  8.43k|#define UNUSED(x) ((void)(x))
  ------------------
  785|  8.43k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  8.43k|#define UNUSED(x) ((void)(x))
  ------------------
  786|       |
  787|  8.43k|    pu1_left = pu1_src + BLK_SIZE - 1;
  ------------------
  |  |  511|  8.43k|#define BLK_SIZE            4
  ------------------
  788|       |
  789|  8.43k|    zero_vector = _mm_setzero_si128();
  790|  8.43k|    rev_16x8b = _mm_setr_epi8(3, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
  791|       |
  792|  8.43k|    val_16x8b = _mm_loadl_epi64((__m128i *)(pu1_left - 3));           //l3 l2 l1 l0 0  0  0...
  793|  8.43k|    val_16x8b = _mm_shuffle_epi8(val_16x8b, rev_16x8b);                //l0 l1 l2 l3 l3 l3 l3...
  794|       |
  795|  8.43k|    val_sh_16x8b = _mm_srli_si128(val_16x8b, 1);
  796|  8.43k|    w11_16x8b = _mm_avg_epu8(val_16x8b, val_sh_16x8b);
  797|       |
  798|  8.43k|    w121_a1_8x16b = _mm_unpacklo_epi8(val_16x8b, zero_vector);        //l0 l1 l2 l3 l3 l3...
  799|  8.43k|    w121_a2_8x16b = _mm_srli_si128(w121_a1_8x16b, 2);                 //l1 l2 l3 l3 l3 l3...
  800|       |
  801|  8.43k|    w121_a1_8x16b = _mm_add_epi16(w121_a1_8x16b, w121_a2_8x16b);      //l0+t1 l1+l2 l2+l3 2*l3 2*l3...
  802|  8.43k|    w121_a2_8x16b = _mm_srli_si128(w121_a1_8x16b, 2);                 //l1+t2 l2+l3 2*l3  2*l3 2*l3...
  803|       |
  804|  8.43k|    zero_vector = _mm_setzero_si128();
  805|  8.43k|    const_2_8x16b = _mm_set1_epi16(2);
  806|       |
  807|  8.43k|    w121_a1_8x16b = _mm_add_epi16(w121_a1_8x16b, w121_a2_8x16b);      //l0+2*l1+l2 l1+2*l2+l3 l2+3*l3 4*l3 4*l3...
  808|  8.43k|    w121_a1_8x16b = _mm_add_epi16(w121_a1_8x16b, const_2_8x16b);
  809|  8.43k|    w121_a1_8x16b = _mm_srai_epi16(w121_a1_8x16b, 2);
  810|       |
  811|  8.43k|    w121_16x8b = _mm_packus_epi16(w121_a1_8x16b, w121_a1_8x16b);
  812|       |
  813|  8.43k|    dst_strd2 = dst_strd << 1;
  814|  8.43k|    dst_strd3 = dst_strd + dst_strd2;
  815|       |
  816|  8.43k|    row1_16x8b = _mm_unpacklo_epi8(w11_16x8b, w121_16x8b);
  817|  8.43k|    row2_16x8b = _mm_srli_si128(row1_16x8b, 2);
  818|  8.43k|    row3_16x8b = _mm_srli_si128(row1_16x8b, 4);
  819|  8.43k|    row4_16x8b = _mm_srli_si128(row1_16x8b, 6);
  820|       |
  821|  8.43k|    row1 = _mm_cvtsi128_si32(row1_16x8b);
  822|  8.43k|    row2 = _mm_cvtsi128_si32(row2_16x8b);
  823|  8.43k|    row3 = _mm_cvtsi128_si32(row3_16x8b);
  824|  8.43k|    row4 = _mm_cvtsi128_si32(row4_16x8b);
  825|       |
  826|  8.43k|    *((WORD32 *)(pu1_dst)) = row1;
  827|  8.43k|    *((WORD32 *)(pu1_dst + dst_strd)) = row2;
  828|  8.43k|    *((WORD32 *)(pu1_dst + dst_strd2)) = row3;
  829|  8.43k|    *((WORD32 *)(pu1_dst + dst_strd3)) = row4;
  830|  8.43k|}
ih264_intra_pred_luma_8x8_mode_vert_ssse3:
  872|  20.1k|{
  873|  20.1k|    UWORD8 *pu1_top = NULL;
  874|  20.1k|    __m128i top_8x8b;
  875|  20.1k|    UNUSED(src_strd);
  ------------------
  |  |   45|  20.1k|#define UNUSED(x) ((void)(x))
  ------------------
  876|  20.1k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  20.1k|#define UNUSED(x) ((void)(x))
  ------------------
  877|  20.1k|    pu1_top = pu1_src + BLK8x8SIZE + 1;
  ------------------
  |  |  510|  20.1k|#define BLK8x8SIZE          8
  ------------------
  878|       |
  879|  20.1k|    top_8x8b = _mm_loadl_epi64((__m128i *)pu1_top);
  880|       |
  881|  20.1k|    _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), top_8x8b);
  882|  20.1k|    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), top_8x8b);
  883|  20.1k|    _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), top_8x8b);
  884|  20.1k|    _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), top_8x8b);
  885|  20.1k|    _mm_storel_epi64((__m128i *)(pu1_dst + 4 * dst_strd), top_8x8b);
  886|  20.1k|    _mm_storel_epi64((__m128i *)(pu1_dst + 5 * dst_strd), top_8x8b);
  887|  20.1k|    _mm_storel_epi64((__m128i *)(pu1_dst + 6 * dst_strd), top_8x8b);
  888|  20.1k|    _mm_storel_epi64((__m128i *)(pu1_dst + 7 * dst_strd), top_8x8b);
  889|  20.1k|}
ih264_intra_pred_luma_8x8_mode_horz_ssse3:
  929|  3.32k|{
  930|  3.32k|    UWORD8 *pu1_left = pu1_src + BLK8x8SIZE - 1;
  ------------------
  |  |  510|  3.32k|#define BLK8x8SIZE          8
  ------------------
  931|  3.32k|    __m128i row1_8x8b, row2_8x8b, row3_8x8b, row4_8x8b;
  932|  3.32k|    __m128i row5_8x8b, row6_8x8b, row7_8x8b, row8_8x8b;
  933|       |
  934|  3.32k|    UNUSED(src_strd);
  ------------------
  |  |   45|  3.32k|#define UNUSED(x) ((void)(x))
  ------------------
  935|  3.32k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  3.32k|#define UNUSED(x) ((void)(x))
  ------------------
  936|       |
  937|  3.32k|    row1_8x8b = _mm_set1_epi8(pu1_left[0]);
  938|  3.32k|    row2_8x8b = _mm_set1_epi8(pu1_left[-1]);
  939|  3.32k|    row3_8x8b = _mm_set1_epi8(pu1_left[-2]);
  940|  3.32k|    row4_8x8b = _mm_set1_epi8(pu1_left[-3]);
  941|  3.32k|    row5_8x8b = _mm_set1_epi8(pu1_left[-4]);
  942|  3.32k|    row6_8x8b = _mm_set1_epi8(pu1_left[-5]);
  943|  3.32k|    row7_8x8b = _mm_set1_epi8(pu1_left[-6]);
  944|  3.32k|    row8_8x8b = _mm_set1_epi8(pu1_left[-7]);
  945|       |
  946|  3.32k|    _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), row1_8x8b);
  947|  3.32k|    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), row2_8x8b);
  948|  3.32k|    _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), row3_8x8b);
  949|  3.32k|    _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), row4_8x8b);
  950|  3.32k|    _mm_storel_epi64((__m128i *)(pu1_dst + 4 * dst_strd), row5_8x8b);
  951|  3.32k|    _mm_storel_epi64((__m128i *)(pu1_dst + 5 * dst_strd), row6_8x8b);
  952|  3.32k|    _mm_storel_epi64((__m128i *)(pu1_dst + 6 * dst_strd), row7_8x8b);
  953|  3.32k|    _mm_storel_epi64((__m128i *)(pu1_dst + 7 * dst_strd), row8_8x8b);
  954|  3.32k|}
ih264_intra_pred_luma_8x8_mode_dc_ssse3:
  993|  43.7k|{
  994|  43.7k|    UWORD8 u1_useleft; /* availability of left predictors (only for DC) */
  995|  43.7k|    UWORD8 u1_usetop; /* availability of top predictors (only for DC) */
  996|  43.7k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
  997|  43.7k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
  998|  43.7k|    __m128i dc_val_8x8b;
  999|  43.7k|    WORD32 dc_val = 0;
 1000|  43.7k|    UNUSED(src_strd);
  ------------------
  |  |   45|  43.7k|#define UNUSED(x) ((void)(x))
  ------------------
 1001|       |
 1002|  43.7k|    u1_useleft = BOOLEAN(ngbr_avail & LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|  43.7k|#define BOOLEAN(x) (!!(x))
  ------------------
 1003|  43.7k|    u1_usetop = BOOLEAN(ngbr_avail & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|  43.7k|#define BOOLEAN(x) (!!(x))
  ------------------
 1004|  43.7k|    pu1_top = pu1_src + BLK8x8SIZE + 1;
  ------------------
  |  |  510|  43.7k|#define BLK8x8SIZE          8
  ------------------
 1005|  43.7k|    pu1_left = pu1_src + BLK8x8SIZE - 1;
  ------------------
  |  |  510|  43.7k|#define BLK8x8SIZE          8
  ------------------
 1006|       |
 1007|  43.7k|    if(u1_useleft || u1_usetop)
  ------------------
  |  Branch (1007:8): [True: 33.0k, False: 10.7k]
  |  Branch (1007:22): [True: 8.71k, False: 2.02k]
  ------------------
 1008|  41.7k|    {
 1009|  41.7k|        WORD32 shft = 2;
 1010|  41.7k|        __m128i val_8x8b, zero_8x8b, sum_8x16b;
 1011|       |
 1012|  41.7k|        zero_8x8b = _mm_setzero_si128();
 1013|       |
 1014|  41.7k|        if(u1_useleft)
  ------------------
  |  Branch (1014:12): [True: 33.0k, False: 8.71k]
  ------------------
 1015|  33.0k|        {
 1016|  33.0k|            val_8x8b = _mm_loadl_epi64((__m128i *)(pu1_left - 7));
 1017|  33.0k|            sum_8x16b = _mm_sad_epu8(zero_8x8b, val_8x8b);
 1018|       |
 1019|  33.0k|            shft++;
 1020|  33.0k|            dc_val += 4;
 1021|  33.0k|            dc_val += _mm_extract_epi16(sum_8x16b, 0);
 1022|  33.0k|        }
 1023|  41.7k|        if(u1_usetop)
  ------------------
  |  Branch (1023:12): [True: 31.5k, False: 10.1k]
  ------------------
 1024|  31.5k|        {
 1025|  31.5k|            val_8x8b = _mm_loadl_epi64((__m128i *)pu1_top);
 1026|  31.5k|            sum_8x16b = _mm_sad_epu8(zero_8x8b, val_8x8b);
 1027|       |
 1028|  31.5k|            shft++;
 1029|  31.5k|            dc_val += 4;
 1030|  31.5k|            dc_val += _mm_extract_epi16(sum_8x16b, 0);
 1031|  31.5k|        }
 1032|  41.7k|        dc_val = dc_val >> shft;
 1033|  41.7k|    }
 1034|  2.02k|    else
 1035|  2.02k|        dc_val = 128;
 1036|       |
 1037|  43.7k|    dc_val_8x8b = _mm_set1_epi8(dc_val);
 1038|       |
 1039|  43.7k|    _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), dc_val_8x8b);
 1040|  43.7k|    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), dc_val_8x8b);
 1041|  43.7k|    _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), dc_val_8x8b);
 1042|  43.7k|    _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), dc_val_8x8b);
 1043|  43.7k|    _mm_storel_epi64((__m128i *)(pu1_dst + 4 * dst_strd), dc_val_8x8b);
 1044|  43.7k|    _mm_storel_epi64((__m128i *)(pu1_dst + 5 * dst_strd), dc_val_8x8b);
 1045|  43.7k|    _mm_storel_epi64((__m128i *)(pu1_dst + 6 * dst_strd), dc_val_8x8b);
 1046|  43.7k|    _mm_storel_epi64((__m128i *)(pu1_dst + 7 * dst_strd), dc_val_8x8b);
 1047|  43.7k|}
ih264_intra_pred_luma_8x8_mode_diag_dl_ssse3:
 1086|    550|{
 1087|    550|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
 1088|    550|    __m128i top_16x8;
 1089|    550|    __m128i out_15x16;
 1090|    550|    __m128i a0_8x16, a1_8x16, a2_8x16;
 1091|    550|    __m128i temp1, temp2;
 1092|    550|    __m128i res1_8x16, res2_8x16;
 1093|    550|    __m128i zero = _mm_setzero_si128();
 1094|    550|    __m128i const_val2_8x16 = _mm_set1_epi16(2);
 1095|       |
 1096|    550|    UNUSED(src_strd);
  ------------------
  |  |   45|    550|#define UNUSED(x) ((void)(x))
  ------------------
 1097|    550|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|    550|#define UNUSED(x) ((void)(x))
  ------------------
 1098|       |
 1099|    550|    pu1_top = pu1_src + BLK8x8SIZE + 1;
  ------------------
  |  |  510|    550|#define BLK8x8SIZE          8
  ------------------
 1100|       |
 1101|    550|    top_16x8 = _mm_loadu_si128((__m128i *)(pu1_top));
 1102|       |
 1103|    550|    temp1 = _mm_srli_si128(top_16x8, 1);
 1104|    550|    temp2 = _mm_srli_si128(top_16x8, 2);
 1105|    550|    a0_8x16 = _mm_unpacklo_epi8(top_16x8, zero);
 1106|    550|    a1_8x16 = _mm_unpacklo_epi8(temp1, zero);
 1107|    550|    a2_8x16 = _mm_unpacklo_epi8(temp2, zero);
 1108|       |
 1109|    550|    a0_8x16 = _mm_add_epi16(a0_8x16, a2_8x16);
 1110|    550|    a1_8x16 = _mm_add_epi16(a1_8x16, a1_8x16);
 1111|    550|    a0_8x16 = _mm_add_epi16(a0_8x16, const_val2_8x16);
 1112|    550|    a0_8x16 = _mm_add_epi16(a0_8x16, a1_8x16);
 1113|    550|    res1_8x16 = _mm_srai_epi16(a0_8x16, 2);
 1114|       |
 1115|    550|    temp2 = _mm_srli_si128(top_16x8, 2);
 1116|    550|    temp1 = _mm_srli_si128(top_16x8, 1);
 1117|    550|    a2_8x16 = _mm_unpackhi_epi8(temp2, zero);
 1118|    550|    a0_8x16 = _mm_unpackhi_epi8(top_16x8, zero);
 1119|    550|    a2_8x16 = _mm_shufflehi_epi16(a2_8x16, 0x14);
 1120|    550|    a1_8x16 = _mm_unpackhi_epi8(temp1, zero);
 1121|       |
 1122|    550|    a0_8x16 = _mm_add_epi16(a0_8x16, a2_8x16);
 1123|    550|    a1_8x16 = _mm_add_epi16(a1_8x16, a1_8x16);
 1124|    550|    a0_8x16 = _mm_add_epi16(a0_8x16, const_val2_8x16);
 1125|    550|    a0_8x16 = _mm_add_epi16(a0_8x16, a1_8x16);
 1126|    550|    res2_8x16 = _mm_srai_epi16(a0_8x16, 2);
 1127|       |
 1128|    550|    out_15x16 = _mm_packus_epi16(res1_8x16, res2_8x16);
 1129|       |
 1130|    550|    _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), out_15x16);
 1131|    550|    out_15x16 = _mm_srli_si128(out_15x16, 1);
 1132|    550|    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), out_15x16);
 1133|    550|    out_15x16 = _mm_srli_si128(out_15x16, 1);
 1134|    550|    _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), out_15x16);
 1135|    550|    out_15x16 = _mm_srli_si128(out_15x16, 1);
 1136|    550|    _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), out_15x16);
 1137|    550|    out_15x16 = _mm_srli_si128(out_15x16, 1);
 1138|    550|    _mm_storel_epi64((__m128i *)(pu1_dst + 4 * dst_strd), out_15x16);
 1139|    550|    out_15x16 = _mm_srli_si128(out_15x16, 1);
 1140|    550|    _mm_storel_epi64((__m128i *)(pu1_dst + 5 * dst_strd), out_15x16);
 1141|    550|    out_15x16 = _mm_srli_si128(out_15x16, 1);
 1142|    550|    _mm_storel_epi64((__m128i *)(pu1_dst + 6 * dst_strd), out_15x16);
 1143|       |    out_15x16 = _mm_srli_si128(out_15x16, 1);
 1144|    550|    _mm_storel_epi64((__m128i *)(pu1_dst + 7 * dst_strd), out_15x16);
 1145|    550|}
ih264_intra_pred_luma_8x8_mode_diag_dr_ssse3:
 1184|    786|{
 1185|    786|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
 1186|    786|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
 1187|    786|    __m128i top_8x8, left_16x8;
 1188|    786|    __m128i out_15x16;
 1189|    786|    __m128i a0_8x16, a1_8x16, a2_8x16;
 1190|    786|    __m128i temp1, temp2;
 1191|    786|    __m128i res1_8x16, res2_8x16;
 1192|    786|    __m128i zero = _mm_setzero_si128();
 1193|    786|    __m128i const_val2_8x16 = _mm_set1_epi16(2);
 1194|    786|    __m128i str_8x8;
 1195|       |
 1196|    786|    UNUSED(src_strd);
  ------------------
  |  |   45|    786|#define UNUSED(x) ((void)(x))
  ------------------
 1197|    786|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|    786|#define UNUSED(x) ((void)(x))
  ------------------
 1198|       |
 1199|    786|    pu1_left = pu1_src + BLK8x8SIZE - 1;
  ------------------
  |  |  510|    786|#define BLK8x8SIZE          8
  ------------------
 1200|    786|    pu1_top = pu1_src + BLK8x8SIZE + 1;
  ------------------
  |  |  510|    786|#define BLK8x8SIZE          8
  ------------------
 1201|       |
 1202|    786|    left_16x8 = _mm_loadu_si128((__m128i *)(pu1_left - 7));
 1203|       |
 1204|    786|    temp1 = _mm_srli_si128(left_16x8, 1);
 1205|    786|    temp2 = _mm_srli_si128(left_16x8, 2);
 1206|    786|    a0_8x16 = _mm_unpacklo_epi8(left_16x8, zero);
 1207|    786|    a1_8x16 = _mm_unpacklo_epi8(temp1, zero);
 1208|    786|    a2_8x16 = _mm_unpacklo_epi8(temp2, zero);
 1209|       |
 1210|    786|    a0_8x16 = _mm_add_epi16(a0_8x16, a2_8x16);
 1211|    786|    a1_8x16 = _mm_add_epi16(a1_8x16, a1_8x16);
 1212|    786|    a0_8x16 = _mm_add_epi16(a0_8x16, const_val2_8x16);
 1213|    786|    a0_8x16 = _mm_add_epi16(a0_8x16, a1_8x16);
 1214|    786|    res1_8x16 = _mm_srai_epi16(a0_8x16, 2);
 1215|       |
 1216|    786|    top_8x8 = _mm_loadu_si128((__m128i *)(pu1_top - 1));
 1217|       |
 1218|    786|    temp1 = _mm_srli_si128(top_8x8, 1);
 1219|    786|    temp2 = _mm_srli_si128(top_8x8, 2);
 1220|    786|    a0_8x16 = _mm_unpacklo_epi8(top_8x8, zero);
 1221|    786|    a1_8x16 = _mm_unpacklo_epi8(temp1, zero);
 1222|    786|    a2_8x16 = _mm_unpacklo_epi8(temp2, zero);
 1223|       |
 1224|    786|    a0_8x16 = _mm_add_epi16(a0_8x16, a2_8x16);
 1225|    786|    a1_8x16 = _mm_add_epi16(a1_8x16, a1_8x16);
 1226|    786|    a0_8x16 = _mm_add_epi16(a0_8x16, const_val2_8x16);
 1227|    786|    a0_8x16 = _mm_add_epi16(a0_8x16, a1_8x16);
 1228|    786|    res2_8x16 = _mm_srai_epi16(a0_8x16, 2);
 1229|       |
 1230|    786|    out_15x16 = _mm_packus_epi16(res1_8x16, res2_8x16);
 1231|       |
 1232|    786|    str_8x8 = _mm_srli_si128(out_15x16, 7);
 1233|    786|    _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), str_8x8);
 1234|    786|    str_8x8 = _mm_srli_si128(out_15x16, 6);
 1235|    786|    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), str_8x8);
 1236|    786|    str_8x8 = _mm_srli_si128(out_15x16, 5);
 1237|    786|    _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), str_8x8);
 1238|    786|    str_8x8 = _mm_srli_si128(out_15x16, 4);
 1239|    786|    _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), str_8x8);
 1240|    786|    str_8x8 = _mm_srli_si128(out_15x16, 3);
 1241|    786|    _mm_storel_epi64((__m128i *)(pu1_dst + 4 * dst_strd), str_8x8);
 1242|    786|    str_8x8 = _mm_srli_si128(out_15x16, 2);
 1243|    786|    _mm_storel_epi64((__m128i *)(pu1_dst + 5 * dst_strd), str_8x8);
 1244|       |    str_8x8 = _mm_srli_si128(out_15x16, 1);
 1245|    786|    _mm_storel_epi64((__m128i *)(pu1_dst + 6 * dst_strd), str_8x8);
 1246|    786|    _mm_storel_epi64((__m128i *)(pu1_dst + 7 * dst_strd), out_15x16);
 1247|    786|}
ih264_intra_pred_luma_8x8_mode_vert_r_ssse3:
 1286|    549|{
 1287|    549|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
 1288|    549|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
 1289|    549|    __m128i top_8x8, left_16x8;
 1290|    549|    __m128i out1_16x16, out2_16x16;
 1291|    549|    __m128i a0_8x16, a1_8x16, a2_8x16;
 1292|    549|    __m128i temp1, temp2;
 1293|    549|    __m128i res1_8x16, res2_8x16, res3_8x16;
 1294|    549|    __m128i zero = _mm_setzero_si128();
 1295|    549|    __m128i const_val2_8x16 = _mm_set1_epi16(2);
 1296|    549|    __m128i str_8x8;
 1297|    549|    __m128i mask = _mm_set1_epi32(0xFFFF);
 1298|       |
 1299|    549|    UNUSED(src_strd);
  ------------------
  |  |   45|    549|#define UNUSED(x) ((void)(x))
  ------------------
 1300|    549|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|    549|#define UNUSED(x) ((void)(x))
  ------------------
 1301|       |
 1302|    549|    pu1_left = pu1_src + BLK8x8SIZE - 1;
  ------------------
  |  |  510|    549|#define BLK8x8SIZE          8
  ------------------
 1303|    549|    pu1_top = pu1_src + BLK8x8SIZE + 1;
  ------------------
  |  |  510|    549|#define BLK8x8SIZE          8
  ------------------
 1304|       |
 1305|    549|    left_16x8 = _mm_loadu_si128((__m128i *)(pu1_left - 6));
 1306|       |
 1307|    549|    temp1 = _mm_srli_si128(left_16x8, 1);
 1308|    549|    temp2 = _mm_srli_si128(left_16x8, 2);
 1309|    549|    a0_8x16 = _mm_unpacklo_epi8(left_16x8, zero);
 1310|    549|    a1_8x16 = _mm_unpacklo_epi8(temp1, zero);
 1311|    549|    a2_8x16 = _mm_unpacklo_epi8(temp2, zero);
 1312|       |
 1313|    549|    a0_8x16 = _mm_add_epi16(a0_8x16, a2_8x16);
 1314|    549|    a1_8x16 = _mm_add_epi16(a1_8x16, a1_8x16);
 1315|    549|    a0_8x16 = _mm_add_epi16(a0_8x16, const_val2_8x16);
 1316|    549|    a0_8x16 = _mm_add_epi16(a0_8x16, a1_8x16);
 1317|    549|    res1_8x16 = _mm_srai_epi16(a0_8x16, 2);
 1318|       |
 1319|    549|    top_8x8 = _mm_loadu_si128((__m128i *)(pu1_top - 1));
 1320|       |
 1321|    549|    temp1 = _mm_srli_si128(top_8x8, 1);
 1322|    549|    temp2 = _mm_srli_si128(top_8x8, 2);
 1323|    549|    a0_8x16 = _mm_unpacklo_epi8(top_8x8, zero);
 1324|    549|    a1_8x16 = _mm_unpacklo_epi8(temp1, zero);
 1325|    549|    a2_8x16 = _mm_unpacklo_epi8(temp2, zero);
 1326|       |
 1327|    549|    res3_8x16 = _mm_avg_epu16(a0_8x16, a1_8x16);
 1328|       |
 1329|    549|    a0_8x16 = _mm_add_epi16(a0_8x16, a2_8x16);
 1330|    549|    a1_8x16 = _mm_add_epi16(a1_8x16, a1_8x16);
 1331|    549|    a0_8x16 = _mm_add_epi16(a0_8x16, const_val2_8x16);
 1332|    549|    a0_8x16 = _mm_add_epi16(a0_8x16, a1_8x16);
 1333|    549|    res2_8x16 = _mm_srai_epi16(a0_8x16, 2);
 1334|       |
 1335|    549|    str_8x8 = _mm_packus_epi16(res3_8x16, zero);
 1336|    549|    _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), str_8x8);
 1337|       |
 1338|    549|    temp1 = _mm_and_si128(res1_8x16, mask);
 1339|    549|    temp1 = _mm_packs_epi32(temp1, temp1);
 1340|    549|    out1_16x16 = _mm_packus_epi16(temp1, res2_8x16);
 1341|       |
 1342|    549|    res1_8x16 = _mm_slli_si128(res1_8x16, 2);
 1343|    549|    temp1 = _mm_and_si128(res1_8x16, mask);
 1344|    549|    temp1 = _mm_packs_epi32(temp1, temp1);
 1345|    549|    out2_16x16 = _mm_packus_epi16(temp1, res3_8x16);
 1346|       |
 1347|    549|    str_8x8 = _mm_srli_si128(out1_16x16, 7);
 1348|    549|    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), str_8x8);
 1349|       |
 1350|    549|    str_8x8 = _mm_srli_si128(out2_16x16, 7);
 1351|    549|    _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), str_8x8);
 1352|       |
 1353|    549|    str_8x8 = _mm_srli_si128(out1_16x16, 6);
 1354|    549|    _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), str_8x8);
 1355|       |
 1356|    549|    str_8x8 = _mm_srli_si128(out2_16x16, 6);
 1357|    549|    _mm_storel_epi64((__m128i *)(pu1_dst + 4 * dst_strd), str_8x8);
 1358|       |
 1359|    549|    str_8x8 = _mm_srli_si128(out1_16x16, 5);
 1360|    549|    _mm_storel_epi64((__m128i *)(pu1_dst + 5 * dst_strd), str_8x8);
 1361|       |
 1362|    549|    str_8x8 = _mm_srli_si128(out2_16x16, 5);
 1363|    549|    _mm_storel_epi64((__m128i *)(pu1_dst + 6 * dst_strd), str_8x8);
 1364|       |
 1365|       |    str_8x8 = _mm_srli_si128(out1_16x16, 4);
 1366|    549|    _mm_storel_epi64((__m128i *)(pu1_dst + 7 * dst_strd), str_8x8);
 1367|    549|}
ih264_intra_pred_luma_8x8_mode_horz_d_ssse3:
 1406|  2.23k|{
 1407|  2.23k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
 1408|  2.23k|    __m128i pels_16x16;
 1409|  2.23k|    __m128i temp1, temp2, temp3, temp4;
 1410|  2.23k|    __m128i a0_8x16, a1_8x16, a2_8x16;
 1411|  2.23k|    __m128i zero = _mm_setzero_si128();
 1412|  2.23k|    __m128i const_val2_8x16 = _mm_set1_epi16(2);
 1413|  2.23k|    __m128i res1_8x16, res2_8x16;
 1414|  2.23k|    __m128i out1_16x16, out2_16x16;
 1415|  2.23k|    __m128i str_8x8;
 1416|  2.23k|    UNUSED(src_strd);
  ------------------
  |  |   45|  2.23k|#define UNUSED(x) ((void)(x))
  ------------------
 1417|  2.23k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  2.23k|#define UNUSED(x) ((void)(x))
  ------------------
 1418|       |
 1419|  2.23k|    pu1_left = pu1_src + BLK8x8SIZE - 1;
  ------------------
  |  |  510|  2.23k|#define BLK8x8SIZE          8
  ------------------
 1420|       |
 1421|  2.23k|    pels_16x16 = _mm_loadu_si128((__m128i *)(pu1_left - 7));
 1422|       |
 1423|  2.23k|    temp1 = _mm_srli_si128(pels_16x16, 1);
 1424|  2.23k|    temp2 = _mm_srli_si128(pels_16x16, 2);
 1425|  2.23k|    a0_8x16 = _mm_unpacklo_epi8(pels_16x16, zero);
 1426|  2.23k|    a1_8x16 = _mm_unpacklo_epi8(temp1, zero);
 1427|  2.23k|    a2_8x16 = _mm_unpacklo_epi8(temp2, zero);
 1428|       |
 1429|  2.23k|    res1_8x16 = _mm_avg_epu16(a0_8x16, a1_8x16);
 1430|       |
 1431|  2.23k|    a0_8x16 = _mm_add_epi16(a0_8x16, a2_8x16);
 1432|  2.23k|    a1_8x16 = _mm_add_epi16(a1_8x16, a1_8x16);
 1433|  2.23k|    a0_8x16 = _mm_add_epi16(a0_8x16, const_val2_8x16);
 1434|  2.23k|    a0_8x16 = _mm_add_epi16(a0_8x16, a1_8x16);
 1435|  2.23k|    res2_8x16 = _mm_srai_epi16(a0_8x16, 2);
 1436|       |
 1437|  2.23k|    temp3 = _mm_unpacklo_epi16(res1_8x16, res2_8x16);
 1438|  2.23k|    temp4 = _mm_unpackhi_epi16(res1_8x16, res2_8x16);
 1439|  2.23k|    out2_16x16 = _mm_packus_epi16(temp3, temp4);
 1440|       |
 1441|  2.23k|    a0_8x16 = _mm_unpackhi_epi8(pels_16x16, zero);
 1442|  2.23k|    a1_8x16 = _mm_unpackhi_epi8(temp1, zero);
 1443|  2.23k|    a2_8x16 = _mm_unpackhi_epi8(temp2, zero);
 1444|       |
 1445|  2.23k|    a0_8x16 = _mm_add_epi16(a0_8x16, a2_8x16);
 1446|  2.23k|    a1_8x16 = _mm_add_epi16(a1_8x16, a1_8x16);
 1447|  2.23k|    a0_8x16 = _mm_add_epi16(a0_8x16, const_val2_8x16);
 1448|  2.23k|    a0_8x16 = _mm_add_epi16(a0_8x16, a1_8x16);
 1449|  2.23k|    res2_8x16 = _mm_srai_epi16(a0_8x16, 2);
 1450|       |
 1451|  2.23k|    out1_16x16 = _mm_packus_epi16(res2_8x16, zero);
 1452|  2.23k|    temp1 = _mm_srli_si128(out2_16x16, 8);
 1453|  2.23k|    out1_16x16 = _mm_unpacklo_epi64(temp1, out1_16x16);
 1454|       |
 1455|  2.23k|    str_8x8 = _mm_srli_si128(out1_16x16, 6);
 1456|  2.23k|    _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), str_8x8);
 1457|  2.23k|    str_8x8 = _mm_srli_si128(out1_16x16, 4);
 1458|  2.23k|    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), str_8x8);
 1459|  2.23k|    str_8x8 = _mm_srli_si128(out1_16x16, 2);
 1460|  2.23k|    _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), str_8x8);
 1461|  2.23k|    _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), out1_16x16);
 1462|       |
 1463|  2.23k|    str_8x8 = _mm_srli_si128(out2_16x16, 6);
 1464|  2.23k|    _mm_storel_epi64((__m128i *)(pu1_dst + 4 * dst_strd), str_8x8);
 1465|  2.23k|    str_8x8 = _mm_srli_si128(out2_16x16, 4);
 1466|  2.23k|    _mm_storel_epi64((__m128i *)(pu1_dst + 5 * dst_strd), str_8x8);
 1467|       |    str_8x8 = _mm_srli_si128(out2_16x16, 2);
 1468|  2.23k|    _mm_storel_epi64((__m128i *)(pu1_dst + 6 * dst_strd), str_8x8);
 1469|  2.23k|    _mm_storel_epi64((__m128i *)(pu1_dst + 7 * dst_strd), out2_16x16);
 1470|  2.23k|}
ih264_intra_pred_luma_8x8_mode_vert_l_ssse3:
 1510|  2.10k|{
 1511|  2.10k|    UWORD8 *pu1_top = NULL; /* Pointer to start of top predictors */
 1512|  2.10k|    __m128i top_16x16;
 1513|  2.10k|    __m128i temp1, temp2;
 1514|  2.10k|    __m128i a0_8x16, a1_8x16, a2_8x16;
 1515|  2.10k|    __m128i zero = _mm_setzero_si128();
 1516|  2.10k|    __m128i const_val2_8x16 = _mm_set1_epi16(2);
 1517|  2.10k|    __m128i res1_8x16, res2_8x16, res3_8x16, res4_8x16;
 1518|  2.10k|    __m128i out1_16x16, out2_16x16;
 1519|  2.10k|    UNUSED(src_strd);
  ------------------
  |  |   45|  2.10k|#define UNUSED(x) ((void)(x))
  ------------------
 1520|  2.10k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  2.10k|#define UNUSED(x) ((void)(x))
  ------------------
 1521|  2.10k|    pu1_top = pu1_src + BLK8x8SIZE + 1;
  ------------------
  |  |  510|  2.10k|#define BLK8x8SIZE          8
  ------------------
 1522|       |
 1523|  2.10k|    top_16x16 = _mm_loadu_si128((__m128i *)(pu1_top));
 1524|  2.10k|    temp1 = _mm_srli_si128(top_16x16, 1);
 1525|  2.10k|    temp2 = _mm_srli_si128(top_16x16, 2);
 1526|  2.10k|    a0_8x16 = _mm_unpacklo_epi8(top_16x16, zero);
 1527|  2.10k|    a1_8x16 = _mm_unpacklo_epi8(temp1, zero);
 1528|  2.10k|    a2_8x16 = _mm_unpacklo_epi8(temp2, zero);
 1529|       |
 1530|  2.10k|    res1_8x16 = _mm_avg_epu16(a0_8x16, a1_8x16);
 1531|       |
 1532|  2.10k|    a0_8x16 = _mm_add_epi16(a0_8x16, a2_8x16);
 1533|  2.10k|    a1_8x16 = _mm_add_epi16(a1_8x16, a1_8x16);
 1534|  2.10k|    a0_8x16 = _mm_add_epi16(a0_8x16, const_val2_8x16);
 1535|  2.10k|    a0_8x16 = _mm_add_epi16(a0_8x16, a1_8x16);
 1536|  2.10k|    res2_8x16 = _mm_srai_epi16(a0_8x16, 2);
 1537|       |
 1538|  2.10k|    a0_8x16 = _mm_unpackhi_epi8(top_16x16, zero);
 1539|  2.10k|    a1_8x16 = _mm_unpackhi_epi8(temp1, zero);
 1540|  2.10k|    a2_8x16 = _mm_unpackhi_epi8(temp2, zero);
 1541|       |
 1542|  2.10k|    res3_8x16 = _mm_avg_epu16(a0_8x16, a1_8x16);
 1543|       |
 1544|  2.10k|    a0_8x16 = _mm_add_epi16(a0_8x16, a2_8x16);
 1545|  2.10k|    a1_8x16 = _mm_add_epi16(a1_8x16, a1_8x16);
 1546|  2.10k|    a0_8x16 = _mm_add_epi16(a0_8x16, const_val2_8x16);
 1547|  2.10k|    a0_8x16 = _mm_add_epi16(a0_8x16, a1_8x16);
 1548|  2.10k|    res4_8x16 = _mm_srai_epi16(a0_8x16, 2);
 1549|       |
 1550|  2.10k|    out1_16x16 = _mm_packus_epi16(res1_8x16, res3_8x16);
 1551|  2.10k|    out2_16x16 = _mm_packus_epi16(res2_8x16, res4_8x16);
 1552|       |
 1553|  2.10k|    _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), out1_16x16);
 1554|  2.10k|    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), out2_16x16);
 1555|  2.10k|    out1_16x16 = _mm_srli_si128(out1_16x16, 1);
 1556|  2.10k|    out2_16x16 = _mm_srli_si128(out2_16x16, 1);
 1557|  2.10k|    _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), out1_16x16);
 1558|  2.10k|    _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), out2_16x16);
 1559|  2.10k|    out1_16x16 = _mm_srli_si128(out1_16x16, 1);
 1560|  2.10k|    out2_16x16 = _mm_srli_si128(out2_16x16, 1);
 1561|  2.10k|    _mm_storel_epi64((__m128i *)(pu1_dst + 4 * dst_strd), out1_16x16);
 1562|  2.10k|    _mm_storel_epi64((__m128i *)(pu1_dst + 5 * dst_strd), out2_16x16);
 1563|  2.10k|    out1_16x16 = _mm_srli_si128(out1_16x16, 1);
 1564|       |    out2_16x16 = _mm_srli_si128(out2_16x16, 1);
 1565|  2.10k|    _mm_storel_epi64((__m128i *)(pu1_dst + 6 * dst_strd), out1_16x16);
 1566|  2.10k|    _mm_storel_epi64((__m128i *)(pu1_dst + 7 * dst_strd), out2_16x16);
 1567|  2.10k|}
ih264_intra_pred_luma_8x8_mode_horz_u_ssse3:
 1606|  5.59k|{
 1607|  5.59k|    UWORD8 *pu1_left = NULL; /* Pointer to start of left predictors */
 1608|  5.59k|    __m128i left_16x16;
 1609|  5.59k|    __m128i temp1, temp2;
 1610|  5.59k|    __m128i a0_8x16, a1_8x16, a2_8x16;
 1611|  5.59k|    __m128i zero = _mm_setzero_si128();
 1612|  5.59k|    __m128i const_val2_8x16 = _mm_set1_epi16(2);
 1613|  5.59k|    __m128i res1_8x16, res2_8x16;
 1614|  5.59k|    __m128i out1_16x16;
 1615|  5.59k|    __m128i str_8x8;
 1616|  5.59k|    __m128i shuffle_16x16;
 1617|  5.59k|    UNUSED(src_strd);
  ------------------
  |  |   45|  5.59k|#define UNUSED(x) ((void)(x))
  ------------------
 1618|  5.59k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  5.59k|#define UNUSED(x) ((void)(x))
  ------------------
 1619|       |
 1620|  5.59k|    pu1_left = pu1_src + BLK8x8SIZE - 1;
  ------------------
  |  |  510|  5.59k|#define BLK8x8SIZE          8
  ------------------
 1621|  5.59k|    shuffle_16x16 = _mm_set_epi8(0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
 1622|  5.59k|                                 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E,
 1623|  5.59k|                                 0x0F);
 1624|       |
 1625|  5.59k|    left_16x16 = _mm_loadu_si128((__m128i *)(pu1_left - 7));
 1626|  5.59k|    temp1 = _mm_srli_si128(left_16x16, 1);
 1627|  5.59k|    a0_8x16 = _mm_unpacklo_epi8(left_16x16, zero);
 1628|  5.59k|    a0_8x16 = _mm_slli_si128(a0_8x16, 2);
 1629|  5.59k|    a1_8x16 = _mm_unpacklo_epi8(left_16x16, zero);
 1630|  5.59k|    a0_8x16 = _mm_shufflelo_epi16(a0_8x16, 0xE5);
 1631|  5.59k|    a2_8x16 = _mm_unpacklo_epi8(temp1, zero);
 1632|       |
 1633|  5.59k|    res1_8x16 = _mm_avg_epu16(a0_8x16, a1_8x16);
 1634|       |
 1635|  5.59k|    a0_8x16 = _mm_add_epi16(a0_8x16, a2_8x16);
 1636|  5.59k|    a1_8x16 = _mm_add_epi16(a1_8x16, a1_8x16);
 1637|  5.59k|    a0_8x16 = _mm_add_epi16(a0_8x16, const_val2_8x16);
 1638|  5.59k|    a0_8x16 = _mm_add_epi16(a0_8x16, a1_8x16);
 1639|  5.59k|    res2_8x16 = _mm_srai_epi16(a0_8x16, 2);
 1640|       |
 1641|  5.59k|    temp1 = _mm_unpacklo_epi16(res1_8x16, res2_8x16);
 1642|  5.59k|    temp2 = _mm_unpackhi_epi16(res1_8x16, res2_8x16);
 1643|  5.59k|    out1_16x16 = _mm_packus_epi16(temp1, temp2);
 1644|  5.59k|    out1_16x16 = _mm_shuffle_epi8(out1_16x16, shuffle_16x16);
 1645|       |
 1646|  5.59k|    str_8x8 = _mm_srli_si128(out1_16x16, 1);
 1647|  5.59k|    _mm_storel_epi64((__m128i *)(pu1_dst + 0 * dst_strd), str_8x8);
 1648|  5.59k|    str_8x8 = _mm_srli_si128(out1_16x16, 3);
 1649|  5.59k|    _mm_storel_epi64((__m128i *)(pu1_dst + 1 * dst_strd), str_8x8);
 1650|  5.59k|    str_8x8 = _mm_srli_si128(out1_16x16, 5);
 1651|  5.59k|    _mm_storel_epi64((__m128i *)(pu1_dst + 2 * dst_strd), str_8x8);
 1652|  5.59k|    str_8x8 = _mm_srli_si128(out1_16x16, 7);
 1653|  5.59k|    _mm_storel_epi64((__m128i *)(pu1_dst + 3 * dst_strd), str_8x8);
 1654|  5.59k|    temp1 = _mm_set1_epi8(pu1_left[-7]);
 1655|  5.59k|    str_8x8 = _mm_unpacklo_epi64(str_8x8, temp1);
 1656|  5.59k|    str_8x8 = _mm_srli_si128(str_8x8, 2);
 1657|  5.59k|    _mm_storel_epi64((__m128i *)(pu1_dst + 4 * dst_strd), str_8x8);
 1658|  5.59k|    str_8x8 = _mm_srli_si128(str_8x8, 2);
 1659|  5.59k|    _mm_storel_epi64((__m128i *)(pu1_dst + 5 * dst_strd), str_8x8);
 1660|  5.59k|    str_8x8 = _mm_srli_si128(str_8x8, 2);
 1661|  5.59k|    _mm_storel_epi64((__m128i *)(pu1_dst + 6 * dst_strd), str_8x8);
 1662|  5.59k|    str_8x8 = _mm_srli_si128(str_8x8, 2);
 1663|  5.59k|    _mm_storel_epi64((__m128i *)(pu1_dst + 7 * dst_strd), str_8x8);
 1664|       |
 1665|  5.59k|}
ih264_intra_pred_luma_16x16_mode_vert_ssse3:
 1707|  14.0k|{
 1708|  14.0k|    UWORD8 *pu1_top;
 1709|  14.0k|    WORD32 dst_strd2, dst_strd3, dst_strd4;
 1710|       |
 1711|  14.0k|    __m128i top_16x8b;
 1712|       |
 1713|  14.0k|    UNUSED(src_strd);
  ------------------
  |  |   45|  14.0k|#define UNUSED(x) ((void)(x))
  ------------------
 1714|  14.0k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  14.0k|#define UNUSED(x) ((void)(x))
  ------------------
 1715|       |
 1716|  14.0k|    pu1_top = pu1_src + MB_SIZE + 1;
  ------------------
  |  |  509|  14.0k|#define MB_SIZE             16
  ------------------
 1717|       |
 1718|  14.0k|    dst_strd2 = dst_strd << 1;
 1719|  14.0k|    dst_strd4 = dst_strd << 2;
 1720|       |
 1721|  14.0k|    top_16x8b = _mm_loadu_si128((__m128i *)pu1_top);
 1722|       |
 1723|  14.0k|    dst_strd3 = dst_strd + dst_strd2;
 1724|       |
 1725|  14.0k|    _mm_storeu_si128((__m128i *)pu1_dst, top_16x8b);
 1726|  14.0k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), top_16x8b);
 1727|  14.0k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd2), top_16x8b);
 1728|  14.0k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd3), top_16x8b);
 1729|  14.0k|    pu1_dst += dst_strd4;
 1730|       |
 1731|  14.0k|    _mm_storeu_si128((__m128i *)pu1_dst, top_16x8b);
 1732|  14.0k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), top_16x8b);
 1733|  14.0k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd2), top_16x8b);
 1734|  14.0k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd3), top_16x8b);
 1735|  14.0k|    pu1_dst += dst_strd4;
 1736|       |
 1737|  14.0k|    _mm_storeu_si128((__m128i *)pu1_dst, top_16x8b);
 1738|  14.0k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), top_16x8b);
 1739|  14.0k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd2), top_16x8b);
 1740|  14.0k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd3), top_16x8b);
 1741|  14.0k|    pu1_dst += dst_strd4;
 1742|       |
 1743|  14.0k|    _mm_storeu_si128((__m128i *)pu1_dst, top_16x8b);
 1744|  14.0k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), top_16x8b);
 1745|  14.0k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd2), top_16x8b);
 1746|  14.0k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd3), top_16x8b);
 1747|  14.0k|}
ih264_intra_pred_luma_16x16_mode_horz_ssse3:
 1786|  11.6k|{
 1787|  11.6k|    UWORD8 *pu1_left;
 1788|  11.6k|    WORD32 dst_strd2, dst_strd3, dst_strd4;
 1789|       |
 1790|  11.6k|    __m128i row1_16x8b, row2_16x8b, row3_16x8b, row4_16x8b;
 1791|       |
 1792|  11.6k|    UNUSED(src_strd);
  ------------------
  |  |   45|  11.6k|#define UNUSED(x) ((void)(x))
  ------------------
 1793|  11.6k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  11.6k|#define UNUSED(x) ((void)(x))
  ------------------
 1794|       |
 1795|  11.6k|    pu1_left = pu1_src + MB_SIZE - 1;
  ------------------
  |  |  509|  11.6k|#define MB_SIZE             16
  ------------------
 1796|       |
 1797|  11.6k|    dst_strd4 = dst_strd << 2;
 1798|       |
 1799|  11.6k|    dst_strd2 = dst_strd << 1;
 1800|  11.6k|    dst_strd3 = dst_strd4 - dst_strd;
 1801|       |
 1802|  11.6k|    row1_16x8b = _mm_set1_epi8(*(pu1_left));
 1803|  11.6k|    row2_16x8b = _mm_set1_epi8(*(pu1_left - 1));
 1804|  11.6k|    row3_16x8b = _mm_set1_epi8(*(pu1_left - 2));
 1805|  11.6k|    row4_16x8b = _mm_set1_epi8(*(pu1_left - 3));
 1806|       |
 1807|  11.6k|    _mm_storeu_si128((__m128i *)pu1_dst, row1_16x8b);
 1808|  11.6k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), row2_16x8b);
 1809|  11.6k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd2), row3_16x8b);
 1810|  11.6k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd3), row4_16x8b);
 1811|       |
 1812|  11.6k|    pu1_dst += dst_strd4;
 1813|  11.6k|    row1_16x8b = _mm_set1_epi8(*(pu1_left - 4));
 1814|  11.6k|    row2_16x8b = _mm_set1_epi8(*(pu1_left - 5));
 1815|  11.6k|    row3_16x8b = _mm_set1_epi8(*(pu1_left - 6));
 1816|  11.6k|    row4_16x8b = _mm_set1_epi8(*(pu1_left - 7));
 1817|       |
 1818|  11.6k|    _mm_storeu_si128((__m128i *)pu1_dst, row1_16x8b);
 1819|  11.6k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), row2_16x8b);
 1820|  11.6k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd2), row3_16x8b);
 1821|  11.6k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd3), row4_16x8b);
 1822|       |
 1823|  11.6k|    pu1_dst += dst_strd4;
 1824|  11.6k|    row1_16x8b = _mm_set1_epi8(*(pu1_left - 8));
 1825|  11.6k|    row2_16x8b = _mm_set1_epi8(*(pu1_left - 9));
 1826|  11.6k|    row3_16x8b = _mm_set1_epi8(*(pu1_left - 10));
 1827|  11.6k|    row4_16x8b = _mm_set1_epi8(*(pu1_left - 11));
 1828|       |
 1829|  11.6k|    _mm_storeu_si128((__m128i *)pu1_dst, row1_16x8b);
 1830|  11.6k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), row2_16x8b);
 1831|  11.6k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd2), row3_16x8b);
 1832|  11.6k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd3), row4_16x8b);
 1833|       |
 1834|  11.6k|    pu1_dst += dst_strd4;
 1835|  11.6k|    row1_16x8b = _mm_set1_epi8(*(pu1_left - 12));
 1836|  11.6k|    row2_16x8b = _mm_set1_epi8(*(pu1_left - 13));
 1837|  11.6k|    row3_16x8b = _mm_set1_epi8(*(pu1_left - 14));
 1838|  11.6k|    row4_16x8b = _mm_set1_epi8(*(pu1_left - 15));
 1839|       |
 1840|  11.6k|    _mm_storeu_si128((__m128i *)pu1_dst, row1_16x8b);
 1841|  11.6k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), row2_16x8b);
 1842|  11.6k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd2), row3_16x8b);
 1843|  11.6k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd3), row4_16x8b);
 1844|  11.6k|}
ih264_intra_pred_luma_16x16_mode_dc_ssse3:
 1883|  12.7k|{
 1884|  12.7k|    WORD8 u1_useleft, u1_usetop;
 1885|  12.7k|    WORD32 dc_val;
 1886|       |
 1887|  12.7k|    WORD32 dst_strd2, dst_strd3, dst_strd4;
 1888|       |
 1889|  12.7k|    __m128i dc_val_16x8b;
 1890|       |
 1891|  12.7k|    UNUSED(src_strd);
  ------------------
  |  |   45|  12.7k|#define UNUSED(x) ((void)(x))
  ------------------
 1892|       |
 1893|  12.7k|    u1_useleft = BOOLEAN(ngbr_avail & LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|  12.7k|#define BOOLEAN(x) (!!(x))
  ------------------
 1894|  12.7k|    u1_usetop = BOOLEAN(ngbr_avail & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   84|  12.7k|#define BOOLEAN(x) (!!(x))
  ------------------
 1895|       |
 1896|  12.7k|    if(u1_useleft || u1_usetop)
  ------------------
  |  Branch (1896:8): [True: 5.93k, False: 6.79k]
  |  Branch (1896:22): [True: 2.45k, False: 4.34k]
  ------------------
 1897|  8.38k|    {
 1898|  8.38k|        WORD32 shft;
 1899|  8.38k|        __m128i val_16x8b, zero_16x8b, sum_8x16b;
 1900|       |
 1901|  8.38k|        dc_val = 0;
 1902|  8.38k|        shft = 3;
 1903|       |
 1904|  8.38k|        zero_16x8b = _mm_setzero_si128();
 1905|       |
 1906|  8.38k|        if(u1_useleft)
  ------------------
  |  Branch (1906:12): [True: 5.93k, False: 2.45k]
  ------------------
 1907|  5.93k|        {
 1908|  5.93k|            UWORD8 *pu1_left;
 1909|       |
 1910|  5.93k|            pu1_left = pu1_src + MB_SIZE - 1;
  ------------------
  |  |  509|  5.93k|#define MB_SIZE             16
  ------------------
 1911|       |
 1912|  5.93k|            val_16x8b = _mm_loadu_si128((__m128i *)(pu1_left - 15));
 1913|  5.93k|            sum_8x16b = _mm_sad_epu8(zero_16x8b, val_16x8b);
 1914|       |
 1915|  5.93k|            shft++;
 1916|  5.93k|            dc_val += 8;
 1917|  5.93k|            dc_val += _mm_extract_epi16(sum_8x16b, 0);
 1918|  5.93k|            dc_val += _mm_extract_epi16(sum_8x16b, 4);
 1919|  5.93k|        }
 1920|  8.38k|        if(u1_usetop)
  ------------------
  |  Branch (1920:12): [True: 6.80k, False: 1.58k]
  ------------------
 1921|  6.80k|        {
 1922|  6.80k|            UWORD8 *pu1_top;
 1923|       |
 1924|  6.80k|            pu1_top = pu1_src + MB_SIZE + 1;
  ------------------
  |  |  509|  6.80k|#define MB_SIZE             16
  ------------------
 1925|       |
 1926|  6.80k|            val_16x8b = _mm_loadu_si128((__m128i *)pu1_top);
 1927|  6.80k|            sum_8x16b = _mm_sad_epu8(zero_16x8b, val_16x8b);
 1928|       |
 1929|  6.80k|            shft++;
 1930|  6.80k|            dc_val += 8;
 1931|  6.80k|            dc_val += _mm_extract_epi16(sum_8x16b, 0);
 1932|  6.80k|            dc_val += _mm_extract_epi16(sum_8x16b, 4);
 1933|  6.80k|        }
 1934|  8.38k|        dc_val = dc_val >> shft;
 1935|  8.38k|    }
 1936|  4.34k|    else
 1937|  4.34k|        dc_val = 128;
 1938|       |
 1939|  12.7k|    dc_val_16x8b =  _mm_set1_epi8(dc_val);
 1940|       |
 1941|  12.7k|    dst_strd2 = dst_strd << 1;
 1942|  12.7k|    dst_strd4 = dst_strd << 2;
 1943|  12.7k|    dst_strd3 = dst_strd + dst_strd2;
 1944|       |
 1945|  12.7k|    _mm_storeu_si128((__m128i *)pu1_dst, dc_val_16x8b);
 1946|  12.7k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), dc_val_16x8b);
 1947|  12.7k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd2), dc_val_16x8b);
 1948|  12.7k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd3), dc_val_16x8b);
 1949|  12.7k|    pu1_dst += dst_strd4;
 1950|       |
 1951|  12.7k|    _mm_storeu_si128((__m128i *)pu1_dst, dc_val_16x8b);
 1952|  12.7k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), dc_val_16x8b);
 1953|  12.7k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd2), dc_val_16x8b);
 1954|  12.7k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd3), dc_val_16x8b);
 1955|  12.7k|    pu1_dst += dst_strd4;
 1956|       |
 1957|  12.7k|    _mm_storeu_si128((__m128i *)pu1_dst, dc_val_16x8b);
 1958|  12.7k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), dc_val_16x8b);
 1959|  12.7k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd2), dc_val_16x8b);
 1960|  12.7k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd3), dc_val_16x8b);
 1961|  12.7k|    pu1_dst += dst_strd4;
 1962|       |
 1963|  12.7k|    _mm_storeu_si128((__m128i *)pu1_dst, dc_val_16x8b);
 1964|  12.7k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), dc_val_16x8b);
 1965|  12.7k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd2), dc_val_16x8b);
 1966|  12.7k|    _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd3), dc_val_16x8b);
 1967|  12.7k|}
ih264_intra_pred_luma_16x16_mode_plane_ssse3:
 2006|  1.33k|{
 2007|  1.33k|    UWORD8 *pu1_left, *pu1_top;
 2008|  1.33k|    WORD32 a, b, c;
 2009|       |
 2010|  1.33k|    __m128i rev_8x16b, mul_8x16b, zero_16x8b;
 2011|       |
 2012|  1.33k|    UNUSED(src_strd);
  ------------------
  |  |   45|  1.33k|#define UNUSED(x) ((void)(x))
  ------------------
 2013|  1.33k|    UNUSED(ngbr_avail);
  ------------------
  |  |   45|  1.33k|#define UNUSED(x) ((void)(x))
  ------------------
 2014|       |
 2015|  1.33k|    pu1_top = pu1_src + MB_SIZE + 1;
  ------------------
  |  |  509|  1.33k|#define MB_SIZE             16
  ------------------
 2016|  1.33k|    pu1_left = pu1_src + MB_SIZE - 1;
  ------------------
  |  |  509|  1.33k|#define MB_SIZE             16
  ------------------
 2017|       |
 2018|  1.33k|    rev_8x16b = _mm_setr_epi16(0x0f0e, 0x0d0c, 0x0b0a, 0x0908, 0x0706, 0x0504, 0x0302, 0x0100);
 2019|       |    //used to reverse the order of 16-bit values in a vector
 2020|       |
 2021|  1.33k|    mul_8x16b = _mm_setr_epi16(1, 2, 3, 4, 5, 6, 7, 8);
 2022|  1.33k|    zero_16x8b = _mm_setzero_si128();
 2023|       |
 2024|       |    //calculating a, b and c
 2025|  1.33k|    {
 2026|  1.33k|        WORD32 h, v;
 2027|       |
 2028|  1.33k|        __m128i h_val1_16x8b, h_val2_16x8b;
 2029|  1.33k|        __m128i h_val1_8x16b, h_val2_8x16b, h_val_4x32b;
 2030|  1.33k|        __m128i v_val1_16x8b, v_val2_16x8b;
 2031|  1.33k|        __m128i v_val1_8x16b, v_val2_8x16b, v_val_4x32b;
 2032|  1.33k|        __m128i hv_val_4x32b;
 2033|       |
 2034|  1.33k|        a = (pu1_top[15] + pu1_left[-15]) << 4;
 2035|       |
 2036|  1.33k|        h_val1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_top + 8));
 2037|  1.33k|        h_val2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_top - 1));
 2038|  1.33k|        v_val1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_left - 15));
 2039|  1.33k|        v_val2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_left - 6));
 2040|       |
 2041|  1.33k|        h_val1_8x16b = _mm_unpacklo_epi8(h_val1_16x8b, zero_16x8b);
 2042|  1.33k|        h_val2_8x16b = _mm_unpacklo_epi8(h_val2_16x8b, zero_16x8b);
 2043|  1.33k|        v_val1_8x16b = _mm_unpacklo_epi8(v_val1_16x8b, zero_16x8b);
 2044|  1.33k|        v_val2_8x16b = _mm_unpacklo_epi8(v_val2_16x8b, zero_16x8b);
 2045|       |
 2046|  1.33k|        h_val2_8x16b = _mm_shuffle_epi8(h_val2_8x16b, rev_8x16b);
 2047|  1.33k|        v_val1_8x16b = _mm_shuffle_epi8(v_val1_8x16b, rev_8x16b);
 2048|       |
 2049|  1.33k|        h_val1_8x16b = _mm_sub_epi16(h_val1_8x16b, h_val2_8x16b);
 2050|  1.33k|        v_val1_8x16b = _mm_sub_epi16(v_val1_8x16b, v_val2_8x16b);
 2051|       |
 2052|  1.33k|        h_val_4x32b = _mm_madd_epi16(mul_8x16b, h_val1_8x16b);
 2053|  1.33k|        v_val_4x32b = _mm_madd_epi16(mul_8x16b, v_val1_8x16b);
 2054|       |
 2055|  1.33k|        hv_val_4x32b = _mm_hadd_epi32(h_val_4x32b, v_val_4x32b);
 2056|  1.33k|        hv_val_4x32b = _mm_hadd_epi32(hv_val_4x32b, hv_val_4x32b);
 2057|       |
 2058|  1.33k|        h = _mm_extract_epi16(hv_val_4x32b, 0);
 2059|  1.33k|        v = _mm_extract_epi16(hv_val_4x32b, 2);
 2060|  1.33k|        h = (h << 16) >> 16;
 2061|  1.33k|        v = (v << 16) >> 16;
 2062|       |
 2063|  1.33k|        b = ((h << 2) + h + 32) >> 6;
 2064|  1.33k|        c = ((v << 2) + v + 32) >> 6;
 2065|  1.33k|    }
 2066|       |
 2067|       |    //using a, b and c to compute the fitted plane values
 2068|  1.33k|    {
 2069|  1.33k|        __m128i const_8x16b, b_8x16b, c_8x16b, c2_8x16b;
 2070|  1.33k|        __m128i res1_l_8x16b, res1_h_8x16b;
 2071|  1.33k|        __m128i res2_l_8x16b, res2_h_8x16b;
 2072|  1.33k|        __m128i res1_sh_l_8x16b, res1_sh_h_8x16b, res1_16x8b;
 2073|  1.33k|        __m128i res2_sh_l_8x16b, res2_sh_h_8x16b, res2_16x8b;
 2074|       |
 2075|  1.33k|        b_8x16b = _mm_set1_epi16(b);
 2076|  1.33k|        c_8x16b = _mm_set1_epi16(c);
 2077|  1.33k|        c2_8x16b = _mm_set1_epi16(c << 1);
 2078|  1.33k|        const_8x16b = _mm_set1_epi16(a - c*7 + 16);
 2079|       |
 2080|  1.33k|        res1_h_8x16b = _mm_mullo_epi16(mul_8x16b, b_8x16b);
 2081|       |        //contains {b*1, b*2, b*3,... b*8}
 2082|       |
 2083|  1.33k|        res1_l_8x16b = _mm_shuffle_epi8(res1_h_8x16b, rev_8x16b);
 2084|  1.33k|        res1_l_8x16b = _mm_srli_si128(res1_l_8x16b, 2);
 2085|  1.33k|        res1_l_8x16b = _mm_sub_epi16(zero_16x8b, res1_l_8x16b);
 2086|       |        //contains {-b*7, -b*6,... -b*1, b*0}
 2087|       |
 2088|       |        // rows 1, 2
 2089|  1.33k|        res1_h_8x16b = _mm_add_epi16(res1_h_8x16b, const_8x16b);
 2090|  1.33k|        res1_l_8x16b = _mm_add_epi16(res1_l_8x16b, const_8x16b);
 2091|  1.33k|        res2_h_8x16b = _mm_add_epi16(res1_h_8x16b, c_8x16b);
 2092|  1.33k|        res2_l_8x16b = _mm_add_epi16(res1_l_8x16b, c_8x16b);
 2093|       |
 2094|  1.33k|        res1_sh_h_8x16b = _mm_srai_epi16(res1_h_8x16b, 5);
 2095|  1.33k|        res1_sh_l_8x16b = _mm_srai_epi16(res1_l_8x16b, 5);
 2096|  1.33k|        res2_sh_h_8x16b = _mm_srai_epi16(res2_h_8x16b, 5);
 2097|  1.33k|        res2_sh_l_8x16b = _mm_srai_epi16(res2_l_8x16b, 5);
 2098|       |
 2099|  1.33k|        res1_16x8b = _mm_packus_epi16(res1_sh_l_8x16b, res1_sh_h_8x16b);
 2100|  1.33k|        res2_16x8b = _mm_packus_epi16(res2_sh_l_8x16b, res2_sh_h_8x16b);
 2101|       |
 2102|  1.33k|        _mm_storeu_si128((__m128i *)pu1_dst, res1_16x8b);
 2103|  1.33k|        _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), res2_16x8b);
 2104|       |
 2105|       |        // rows 3, 4
 2106|  1.33k|        res1_h_8x16b = _mm_add_epi16(res1_h_8x16b, c2_8x16b);
 2107|  1.33k|        res1_l_8x16b = _mm_add_epi16(res1_l_8x16b, c2_8x16b);
 2108|  1.33k|        res2_h_8x16b = _mm_add_epi16(res2_h_8x16b, c2_8x16b);
 2109|  1.33k|        res2_l_8x16b = _mm_add_epi16(res2_l_8x16b, c2_8x16b);
 2110|       |
 2111|  1.33k|        res1_sh_h_8x16b = _mm_srai_epi16(res1_h_8x16b, 5);
 2112|  1.33k|        res1_sh_l_8x16b = _mm_srai_epi16(res1_l_8x16b, 5);
 2113|  1.33k|        res2_sh_h_8x16b = _mm_srai_epi16(res2_h_8x16b, 5);
 2114|  1.33k|        res2_sh_l_8x16b = _mm_srai_epi16(res2_l_8x16b, 5);
 2115|       |
 2116|  1.33k|        pu1_dst += dst_strd << 1;
 2117|       |
 2118|  1.33k|        res1_16x8b = _mm_packus_epi16(res1_sh_l_8x16b, res1_sh_h_8x16b);
 2119|  1.33k|        res2_16x8b = _mm_packus_epi16(res2_sh_l_8x16b, res2_sh_h_8x16b);
 2120|       |
 2121|  1.33k|        _mm_storeu_si128((__m128i *)pu1_dst, res1_16x8b);
 2122|  1.33k|        _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), res2_16x8b);
 2123|       |
 2124|       |        // rows 5, 6
 2125|  1.33k|        res1_h_8x16b = _mm_add_epi16(res1_h_8x16b, c2_8x16b);
 2126|  1.33k|        res1_l_8x16b = _mm_add_epi16(res1_l_8x16b, c2_8x16b);
 2127|  1.33k|        res2_h_8x16b = _mm_add_epi16(res2_h_8x16b, c2_8x16b);
 2128|  1.33k|        res2_l_8x16b = _mm_add_epi16(res2_l_8x16b, c2_8x16b);
 2129|       |
 2130|  1.33k|        res1_sh_h_8x16b = _mm_srai_epi16(res1_h_8x16b, 5);
 2131|  1.33k|        res1_sh_l_8x16b = _mm_srai_epi16(res1_l_8x16b, 5);
 2132|  1.33k|        res2_sh_h_8x16b = _mm_srai_epi16(res2_h_8x16b, 5);
 2133|  1.33k|        res2_sh_l_8x16b = _mm_srai_epi16(res2_l_8x16b, 5);
 2134|       |
 2135|  1.33k|        pu1_dst += dst_strd << 1;
 2136|       |
 2137|  1.33k|        res1_16x8b = _mm_packus_epi16(res1_sh_l_8x16b, res1_sh_h_8x16b);
 2138|  1.33k|        res2_16x8b = _mm_packus_epi16(res2_sh_l_8x16b, res2_sh_h_8x16b);
 2139|       |
 2140|  1.33k|        _mm_storeu_si128((__m128i *)pu1_dst, res1_16x8b);
 2141|  1.33k|        _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), res2_16x8b);
 2142|       |
 2143|       |        // rows 7, 8
 2144|  1.33k|        res1_h_8x16b = _mm_add_epi16(res1_h_8x16b, c2_8x16b);
 2145|  1.33k|        res1_l_8x16b = _mm_add_epi16(res1_l_8x16b, c2_8x16b);
 2146|  1.33k|        res2_h_8x16b = _mm_add_epi16(res2_h_8x16b, c2_8x16b);
 2147|  1.33k|        res2_l_8x16b = _mm_add_epi16(res2_l_8x16b, c2_8x16b);
 2148|       |
 2149|  1.33k|        res1_sh_h_8x16b = _mm_srai_epi16(res1_h_8x16b, 5);
 2150|  1.33k|        res1_sh_l_8x16b = _mm_srai_epi16(res1_l_8x16b, 5);
 2151|  1.33k|        res2_sh_h_8x16b = _mm_srai_epi16(res2_h_8x16b, 5);
 2152|  1.33k|        res2_sh_l_8x16b = _mm_srai_epi16(res2_l_8x16b, 5);
 2153|       |
 2154|  1.33k|        pu1_dst += dst_strd << 1;
 2155|       |
 2156|  1.33k|        res1_16x8b = _mm_packus_epi16(res1_sh_l_8x16b, res1_sh_h_8x16b);
 2157|  1.33k|        res2_16x8b = _mm_packus_epi16(res2_sh_l_8x16b, res2_sh_h_8x16b);
 2158|       |
 2159|  1.33k|        _mm_storeu_si128((__m128i *)pu1_dst, res1_16x8b);
 2160|  1.33k|        _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), res2_16x8b);
 2161|       |
 2162|       |        // rows 9, 10
 2163|  1.33k|        res1_h_8x16b = _mm_add_epi16(res1_h_8x16b, c2_8x16b);
 2164|  1.33k|        res1_l_8x16b = _mm_add_epi16(res1_l_8x16b, c2_8x16b);
 2165|  1.33k|        res2_h_8x16b = _mm_add_epi16(res2_h_8x16b, c2_8x16b);
 2166|  1.33k|        res2_l_8x16b = _mm_add_epi16(res2_l_8x16b, c2_8x16b);
 2167|       |
 2168|  1.33k|        res1_sh_h_8x16b = _mm_srai_epi16(res1_h_8x16b, 5);
 2169|  1.33k|        res1_sh_l_8x16b = _mm_srai_epi16(res1_l_8x16b, 5);
 2170|  1.33k|        res2_sh_h_8x16b = _mm_srai_epi16(res2_h_8x16b, 5);
 2171|  1.33k|        res2_sh_l_8x16b = _mm_srai_epi16(res2_l_8x16b, 5);
 2172|       |
 2173|  1.33k|        pu1_dst += dst_strd << 1;
 2174|       |
 2175|  1.33k|        res1_16x8b = _mm_packus_epi16(res1_sh_l_8x16b, res1_sh_h_8x16b);
 2176|  1.33k|        res2_16x8b = _mm_packus_epi16(res2_sh_l_8x16b, res2_sh_h_8x16b);
 2177|       |
 2178|  1.33k|        _mm_storeu_si128((__m128i *)pu1_dst, res1_16x8b);
 2179|  1.33k|        _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), res2_16x8b);
 2180|       |
 2181|       |        // rows 11, 12
 2182|  1.33k|        res1_h_8x16b = _mm_add_epi16(res1_h_8x16b, c2_8x16b);
 2183|  1.33k|        res1_l_8x16b = _mm_add_epi16(res1_l_8x16b, c2_8x16b);
 2184|  1.33k|        res2_h_8x16b = _mm_add_epi16(res2_h_8x16b, c2_8x16b);
 2185|  1.33k|        res2_l_8x16b = _mm_add_epi16(res2_l_8x16b, c2_8x16b);
 2186|       |
 2187|  1.33k|        res1_sh_h_8x16b = _mm_srai_epi16(res1_h_8x16b, 5);
 2188|  1.33k|        res1_sh_l_8x16b = _mm_srai_epi16(res1_l_8x16b, 5);
 2189|  1.33k|        res2_sh_h_8x16b = _mm_srai_epi16(res2_h_8x16b, 5);
 2190|  1.33k|        res2_sh_l_8x16b = _mm_srai_epi16(res2_l_8x16b, 5);
 2191|       |
 2192|  1.33k|        pu1_dst += dst_strd << 1;
 2193|       |
 2194|  1.33k|        res1_16x8b = _mm_packus_epi16(res1_sh_l_8x16b, res1_sh_h_8x16b);
 2195|  1.33k|        res2_16x8b = _mm_packus_epi16(res2_sh_l_8x16b, res2_sh_h_8x16b);
 2196|       |
 2197|  1.33k|        _mm_storeu_si128((__m128i *)pu1_dst, res1_16x8b);
 2198|  1.33k|        _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), res2_16x8b);
 2199|       |
 2200|       |        // rows 13, 14
 2201|  1.33k|        res1_h_8x16b = _mm_add_epi16(res1_h_8x16b, c2_8x16b);
 2202|  1.33k|        res1_l_8x16b = _mm_add_epi16(res1_l_8x16b, c2_8x16b);
 2203|  1.33k|        res2_h_8x16b = _mm_add_epi16(res2_h_8x16b, c2_8x16b);
 2204|  1.33k|        res2_l_8x16b = _mm_add_epi16(res2_l_8x16b, c2_8x16b);
 2205|       |
 2206|  1.33k|        res1_sh_h_8x16b = _mm_srai_epi16(res1_h_8x16b, 5);
 2207|  1.33k|        res1_sh_l_8x16b = _mm_srai_epi16(res1_l_8x16b, 5);
 2208|  1.33k|        res2_sh_h_8x16b = _mm_srai_epi16(res2_h_8x16b, 5);
 2209|  1.33k|        res2_sh_l_8x16b = _mm_srai_epi16(res2_l_8x16b, 5);
 2210|       |
 2211|  1.33k|        pu1_dst += dst_strd << 1;
 2212|       |
 2213|  1.33k|        res1_16x8b = _mm_packus_epi16(res1_sh_l_8x16b, res1_sh_h_8x16b);
 2214|  1.33k|        res2_16x8b = _mm_packus_epi16(res2_sh_l_8x16b, res2_sh_h_8x16b);
 2215|       |
 2216|  1.33k|        _mm_storeu_si128((__m128i *)pu1_dst, res1_16x8b);
 2217|  1.33k|        _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), res2_16x8b);
 2218|       |
 2219|       |        // rows 15, 16
 2220|  1.33k|        res1_h_8x16b = _mm_add_epi16(res1_h_8x16b, c2_8x16b);
 2221|  1.33k|        res1_l_8x16b = _mm_add_epi16(res1_l_8x16b, c2_8x16b);
 2222|  1.33k|        res2_h_8x16b = _mm_add_epi16(res2_h_8x16b, c2_8x16b);
 2223|  1.33k|        res2_l_8x16b = _mm_add_epi16(res2_l_8x16b, c2_8x16b);
 2224|       |
 2225|  1.33k|        res1_sh_h_8x16b = _mm_srai_epi16(res1_h_8x16b, 5);
 2226|  1.33k|        res1_sh_l_8x16b = _mm_srai_epi16(res1_l_8x16b, 5);
 2227|  1.33k|        res2_sh_h_8x16b = _mm_srai_epi16(res2_h_8x16b, 5);
 2228|  1.33k|        res2_sh_l_8x16b = _mm_srai_epi16(res2_l_8x16b, 5);
 2229|       |
 2230|  1.33k|        pu1_dst += dst_strd << 1;
 2231|       |
 2232|  1.33k|        res1_16x8b = _mm_packus_epi16(res1_sh_l_8x16b, res1_sh_h_8x16b);
 2233|  1.33k|        res2_16x8b = _mm_packus_epi16(res2_sh_l_8x16b, res2_sh_h_8x16b);
 2234|       |
 2235|  1.33k|        _mm_storeu_si128((__m128i *)pu1_dst, res1_16x8b);
 2236|  1.33k|        _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), res2_16x8b);
 2237|  1.33k|    }
 2238|  1.33k|}

ih264_pad_left_luma_ssse3:
   96|  72.1k|{
   97|  72.1k|    WORD32 row;
   98|  72.1k|    WORD32 i;
   99|  72.1k|    UWORD8 *pu1_dst;
  100|       |
  101|  72.1k|    ASSERT(pad_size % 8 == 0);
  ------------------
  |  |   56|  72.1k|#define ASSERT(x) assert((x))
  ------------------
  |  Branch (101:5): [True: 0, False: 72.1k]
  |  Branch (101:5): [True: 72.1k, False: 0]
  ------------------
  102|       |
  103|  19.5M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (103:18): [True: 19.4M, False: 72.1k]
  ------------------
  104|  19.4M|    {
  105|  19.4M|        __m128i src_temp0_16x8b;
  106|       |
  107|  19.4M|        pu1_dst = pu1_src - pad_size;
  108|  19.4M|        src_temp0_16x8b = _mm_set1_epi8(*pu1_src);
  109|  97.3M|        for(i = 0; i < pad_size; i += 8)
  ------------------
  |  Branch (109:20): [True: 77.8M, False: 19.4M]
  ------------------
  110|  77.8M|        {
  111|  77.8M|            _mm_storel_epi64((__m128i *)(pu1_dst + i), src_temp0_16x8b);
  112|  77.8M|        }
  113|  19.4M|        pu1_src += src_strd;
  114|  19.4M|    }
  115|       |
  116|  72.1k|}
ih264_pad_left_chroma_ssse3:
  163|  72.1k|{
  164|  72.1k|    WORD32 row;
  165|  72.1k|    WORD32 col;
  166|  72.1k|    UWORD8 *pu1_dst;
  167|       |
  168|  72.1k|    ASSERT(pad_size % 8 == 0);
  ------------------
  |  |   56|  72.1k|#define ASSERT(x) assert((x))
  ------------------
  |  Branch (168:5): [True: 0, False: 72.1k]
  |  Branch (168:5): [True: 72.1k, False: 0]
  ------------------
  169|  9.80M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (169:18): [True: 9.73M, False: 72.1k]
  ------------------
  170|  9.73M|    {
  171|  9.73M|        __m128i src_temp0_16x8b;
  172|       |
  173|  9.73M|        pu1_dst = pu1_src - pad_size;
  174|  9.73M|        src_temp0_16x8b = _mm_set1_epi16(*((UWORD16 *)pu1_src));
  175|  48.6M|        for(col = 0; col < pad_size; col += 8)
  ------------------
  |  Branch (175:22): [True: 38.9M, False: 9.73M]
  ------------------
  176|  38.9M|        {
  177|  38.9M|            _mm_storel_epi64((__m128i *)(pu1_dst + col), src_temp0_16x8b);
  178|  38.9M|        }
  179|  9.73M|        pu1_src += src_strd;
  180|  9.73M|    }
  181|       |
  182|  72.1k|}
ih264_pad_right_luma_ssse3:
  229|  72.1k|{
  230|  72.1k|    WORD32 row;
  231|  72.1k|    WORD32 col;
  232|  72.1k|    UWORD8 *pu1_dst;
  233|       |
  234|  72.1k|    ASSERT(pad_size % 8 == 0);
  ------------------
  |  |   56|  72.1k|#define ASSERT(x) assert((x))
  ------------------
  |  Branch (234:5): [True: 0, False: 72.1k]
  |  Branch (234:5): [True: 72.1k, False: 0]
  ------------------
  235|       |
  236|  19.5M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (236:18): [True: 19.4M, False: 72.1k]
  ------------------
  237|  19.4M|    {
  238|  19.4M|        __m128i src_temp0_16x8b;
  239|       |
  240|  19.4M|        pu1_dst = pu1_src;
  241|  19.4M|        src_temp0_16x8b = _mm_set1_epi8(*(pu1_src - 1));
  242|  97.3M|        for(col = 0; col < pad_size; col += 8)
  ------------------
  |  Branch (242:22): [True: 77.8M, False: 19.4M]
  ------------------
  243|  77.8M|        {
  244|  77.8M|            _mm_storel_epi64((__m128i *)(pu1_dst + col), src_temp0_16x8b);
  245|  77.8M|        }
  246|  19.4M|        pu1_src += src_strd;
  247|  19.4M|    }
  248|       |
  249|  72.1k|}
ih264_pad_right_chroma_ssse3:
  296|  72.1k|{
  297|  72.1k|    WORD32 row;
  298|  72.1k|    WORD32 col;
  299|  72.1k|    UWORD8 *pu1_dst;
  300|       |
  301|  72.1k|    ASSERT(pad_size % 8 == 0);
  ------------------
  |  |   56|  72.1k|#define ASSERT(x) assert((x))
  ------------------
  |  Branch (301:5): [True: 0, False: 72.1k]
  |  Branch (301:5): [True: 72.1k, False: 0]
  ------------------
  302|       |
  303|  9.80M|    for(row = 0; row < ht; row++)
  ------------------
  |  Branch (303:18): [True: 9.73M, False: 72.1k]
  ------------------
  304|  9.73M|    {
  305|  9.73M|        __m128i src_temp0_16x8b;
  306|       |
  307|  9.73M|        pu1_dst = pu1_src;
  308|  9.73M|        src_temp0_16x8b = _mm_set1_epi16(*((UWORD16 *)(pu1_src - 2)));
  309|  48.6M|        for(col = 0; col < pad_size; col += 8)
  ------------------
  |  Branch (309:22): [True: 38.9M, False: 9.73M]
  ------------------
  310|  38.9M|        {
  311|  38.9M|            _mm_storel_epi64((__m128i *)(pu1_dst + col), src_temp0_16x8b);
  312|  38.9M|        }
  313|       |
  314|  9.73M|        pu1_src += src_strd;
  315|  9.73M|    }
  316|  72.1k|}

isvcd_parse_epslice.c:CLZ:
   97|   672k|{
   98|   672k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 661k, False: 11.1k]
  ------------------
   99|   661k|    return(__builtin_clz(u4_word));
  100|  11.1k|    else
  101|  11.1k|        return 31;
  102|   672k|}
ih264_iquant_itrans_recon_sse42.c:loadu_32:
   47|   373k|{
   48|   373k|  struct __loadu_si32 {
   49|   373k|    int __v;
   50|   373k|  } __attribute__((__packed__, __may_alias__));
   51|   373k|  int __u = ((struct __loadu_si32*)__a)->__v;
   52|   373k|  return __extension__ (__m128i)(__v4si){__u, 0, 0, 0};
   53|   373k|}
ih264d_cabac.c:CLZ:
   97|  6.43M|{
   98|  6.43M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 6.43M, False: 0]
  ------------------
   99|  6.43M|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|  6.43M|}
ih264d_parse_cabac.c:CLZ:
   97|  13.1M|{
   98|  13.1M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 13.1M, False: 0]
  ------------------
   99|  13.1M|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|  13.1M|}
ih264d_parse_cavlc.c:CLZ:
   97|  8.43M|{
   98|  8.43M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 8.14M, False: 294k]
  ------------------
   99|  8.14M|    return(__builtin_clz(u4_word));
  100|   294k|    else
  101|   294k|        return 31;
  102|  8.43M|}
ih264d_parse_islice.c:CLZ:
   97|   123k|{
   98|   123k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 121k, False: 1.33k]
  ------------------
   99|   121k|    return(__builtin_clz(u4_word));
  100|  1.33k|    else
  101|  1.33k|        return 31;
  102|   123k|}
ih264d_parse_mb_header.c:CLZ:
   97|  5.98M|{
   98|  5.98M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 5.98M, False: 0]
  ------------------
   99|  5.98M|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|  5.98M|}
ih264d_parse_pslice.c:CLZ:
   97|   164k|{
   98|   164k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 158k, False: 6.69k]
  ------------------
   99|   158k|    return(__builtin_clz(u4_word));
  100|  6.69k|    else
  101|  6.69k|        return 31;
  102|   164k|}
ih264d_process_intra_mb.c:CLZ:
   97|  1.38M|{
   98|  1.38M|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 1.38M, False: 0]
  ------------------
   99|  1.38M|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|  1.38M|}
ih264d_utils.c:CLZ:
   97|   276k|{
   98|   276k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 276k, False: 0]
  ------------------
   99|   276k|    return(__builtin_clz(u4_word));
  100|      0|    else
  101|      0|        return 31;
  102|   276k|}
isvcd_parse_cavlc.c:CLZ:
   97|  17.5k|{
   98|  17.5k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 17.3k, False: 184]
  ------------------
   99|  17.3k|    return(__builtin_clz(u4_word));
  100|    184|    else
  101|    184|        return 31;
  102|  17.5k|}
isvcd_parse_ebslice.c:CLZ:
   97|  97.1k|{
   98|  97.1k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 95.4k, False: 1.76k]
  ------------------
   99|  95.4k|    return(__builtin_clz(u4_word));
  100|  1.76k|    else
  101|  1.76k|        return 31;
  102|  97.1k|}
isvcd_parse_eislice.c:CLZ:
   97|   307k|{
   98|   307k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 305k, False: 1.95k]
  ------------------
   99|   305k|    return(__builtin_clz(u4_word));
  100|  1.95k|    else
  101|  1.95k|        return 31;
  102|   307k|}
ih264d_parse_bslice.c:CLZ:
   97|   178k|{
   98|   178k|    if(u4_word)
  ------------------
  |  Branch (98:8): [True: 172k, False: 5.06k]
  ------------------
   99|   172k|    return(__builtin_clz(u4_word));
  100|  5.06k|    else
  101|  5.06k|        return 31;
  102|   178k|}

ih264_default_weighted_pred_luma_sse42:
   93|   213k|{
   94|   213k|    __m128i y0_0_16x8b, y0_1_16x8b, y0_2_16x8b, y0_3_16x8b;
   95|   213k|    __m128i y1_0_16x8b, y1_1_16x8b, y1_2_16x8b, y1_3_16x8b;
   96|       |
   97|   213k|    if(wd == 4)
  ------------------
  |  Branch (97:8): [True: 3.18k, False: 210k]
  ------------------
   98|  3.18k|    {
   99|  3.18k|        do
  100|  4.71k|        {
  101|  4.71k|            y0_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src1);
  102|  4.71k|            y0_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src1 + src_strd1));
  103|  4.71k|            y0_2_16x8b = _mm_loadl_epi64(
  104|  4.71k|                            (__m128i *)(pu1_src1 + (src_strd1 << 1)));
  105|  4.71k|            y0_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src1 + src_strd1 * 3));
  106|       |
  107|  4.71k|            y1_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src2);
  108|  4.71k|            y1_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src2 + src_strd2));
  109|  4.71k|            y1_2_16x8b = _mm_loadl_epi64(
  110|  4.71k|                            (__m128i *)(pu1_src2 + (src_strd2 << 1)));
  111|  4.71k|            y1_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src2 + src_strd2 * 3));
  112|       |
  113|  4.71k|            y0_0_16x8b = _mm_avg_epu8(y0_0_16x8b, y1_0_16x8b);
  114|  4.71k|            y0_1_16x8b = _mm_avg_epu8(y0_1_16x8b, y1_1_16x8b);
  115|  4.71k|            y0_2_16x8b = _mm_avg_epu8(y0_2_16x8b, y1_2_16x8b);
  116|  4.71k|            y0_3_16x8b = _mm_avg_epu8(y0_3_16x8b, y1_3_16x8b);
  117|       |
  118|  4.71k|            *((WORD32 *)(pu1_dst)) = _mm_cvtsi128_si32(y0_0_16x8b);
  119|  4.71k|            *((WORD32 *)(pu1_dst + dst_strd)) = _mm_cvtsi128_si32(y0_1_16x8b);
  120|  4.71k|            *((WORD32 *)(pu1_dst + (dst_strd << 1))) = _mm_cvtsi128_si32(y0_2_16x8b);
  121|  4.71k|            *((WORD32 *)(pu1_dst + dst_strd * 3)) = _mm_cvtsi128_si32(y0_3_16x8b);
  122|       |
  123|  4.71k|            ht -= 4;
  124|  4.71k|            pu1_src1 += src_strd1 << 2;
  125|  4.71k|            pu1_src2 += src_strd2 << 2;
  126|  4.71k|            pu1_dst += dst_strd << 2;
  127|  4.71k|        }
  128|  4.71k|        while(ht > 0);
  ------------------
  |  Branch (128:15): [True: 1.53k, False: 3.18k]
  ------------------
  129|  3.18k|    }
  130|   210k|    else if(wd == 8)
  ------------------
  |  Branch (130:13): [True: 23.9k, False: 186k]
  ------------------
  131|  23.9k|    {
  132|  23.9k|        do
  133|  58.0k|        {
  134|  58.0k|            y0_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src1);
  135|  58.0k|            y0_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src1 + src_strd1));
  136|  58.0k|            y0_2_16x8b = _mm_loadl_epi64(
  137|  58.0k|                            (__m128i *)(pu1_src1 + (src_strd1 << 1)));
  138|  58.0k|            y0_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src1 + src_strd1 * 3));
  139|       |
  140|  58.0k|            y1_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src2);
  141|  58.0k|            y1_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src2 + src_strd2));
  142|  58.0k|            y1_2_16x8b = _mm_loadl_epi64(
  143|  58.0k|                            (__m128i *)(pu1_src2 + (src_strd2 << 1)));
  144|  58.0k|            y1_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src2 + src_strd2 * 3));
  145|       |
  146|  58.0k|            y0_0_16x8b = _mm_avg_epu8(y0_0_16x8b, y1_0_16x8b);
  147|  58.0k|            y0_1_16x8b = _mm_avg_epu8(y0_1_16x8b, y1_1_16x8b);
  148|  58.0k|            y0_2_16x8b = _mm_avg_epu8(y0_2_16x8b, y1_2_16x8b);
  149|  58.0k|            y0_3_16x8b = _mm_avg_epu8(y0_3_16x8b, y1_3_16x8b);
  150|       |
  151|  58.0k|            _mm_storel_epi64((__m128i *)pu1_dst, y0_0_16x8b);
  152|  58.0k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), y0_1_16x8b);
  153|  58.0k|            _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd << 1)), y0_2_16x8b);
  154|  58.0k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd * 3), y0_3_16x8b);
  155|       |
  156|  58.0k|            ht -= 4;
  157|  58.0k|            pu1_src1 += src_strd1 << 2;
  158|  58.0k|            pu1_src2 += src_strd2 << 2;
  159|  58.0k|            pu1_dst += dst_strd << 2;
  160|  58.0k|        }
  161|  58.0k|        while(ht > 0);
  ------------------
  |  Branch (161:15): [True: 34.0k, False: 23.9k]
  ------------------
  162|  23.9k|    }
  163|   186k|    else // wd == 16
  164|   186k|    {
  165|   186k|        __m128i y0_4_16x8b, y0_5_16x8b, y0_6_16x8b, y0_7_16x8b;
  166|   186k|        __m128i y1_4_16x8b, y1_5_16x8b, y1_6_16x8b, y1_7_16x8b;
  167|       |
  168|   186k|        do
  169|   361k|        {
  170|   361k|            y0_0_16x8b = _mm_loadu_si128((__m128i *)pu1_src1);
  171|   361k|            y0_1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src1 + src_strd1));
  172|   361k|            y0_2_16x8b = _mm_loadu_si128(
  173|   361k|                            (__m128i *)(pu1_src1 + (src_strd1 << 1)));
  174|   361k|            y0_3_16x8b = _mm_loadu_si128((__m128i *)(pu1_src1 + src_strd1 * 3));
  175|   361k|            y0_4_16x8b = _mm_loadu_si128(
  176|   361k|                            (__m128i *)(pu1_src1 + (src_strd1 << 2)));
  177|   361k|            y0_5_16x8b = _mm_loadu_si128((__m128i *)(pu1_src1 + src_strd1 * 5));
  178|   361k|            y0_6_16x8b = _mm_loadu_si128((__m128i *)(pu1_src1 + src_strd1 * 6));
  179|   361k|            y0_7_16x8b = _mm_loadu_si128((__m128i *)(pu1_src1 + src_strd1 * 7));
  180|       |
  181|   361k|            y1_0_16x8b = _mm_loadu_si128((__m128i *)pu1_src2);
  182|   361k|            y1_1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src2 + src_strd2));
  183|   361k|            y1_2_16x8b = _mm_loadu_si128(
  184|   361k|                            (__m128i *)(pu1_src2 + (src_strd2 << 1)));
  185|   361k|            y1_3_16x8b = _mm_loadu_si128((__m128i *)(pu1_src2 + src_strd2 * 3));
  186|   361k|            y1_4_16x8b = _mm_loadu_si128(
  187|   361k|                            (__m128i *)(pu1_src2 + (src_strd2 << 2)));
  188|   361k|            y1_5_16x8b = _mm_loadu_si128((__m128i *)(pu1_src2 + src_strd2 * 5));
  189|   361k|            y1_6_16x8b = _mm_loadu_si128((__m128i *)(pu1_src2 + src_strd2 * 6));
  190|   361k|            y1_7_16x8b = _mm_loadu_si128((__m128i *)(pu1_src2 + src_strd2 * 7));
  191|       |
  192|   361k|            y0_0_16x8b = _mm_avg_epu8(y0_0_16x8b, y1_0_16x8b);
  193|   361k|            y0_1_16x8b = _mm_avg_epu8(y0_1_16x8b, y1_1_16x8b);
  194|   361k|            y0_2_16x8b = _mm_avg_epu8(y0_2_16x8b, y1_2_16x8b);
  195|   361k|            y0_3_16x8b = _mm_avg_epu8(y0_3_16x8b, y1_3_16x8b);
  196|   361k|            y0_4_16x8b = _mm_avg_epu8(y0_4_16x8b, y1_4_16x8b);
  197|   361k|            y0_5_16x8b = _mm_avg_epu8(y0_5_16x8b, y1_5_16x8b);
  198|   361k|            y0_6_16x8b = _mm_avg_epu8(y0_6_16x8b, y1_6_16x8b);
  199|   361k|            y0_7_16x8b = _mm_avg_epu8(y0_7_16x8b, y1_7_16x8b);
  200|       |
  201|   361k|            _mm_storeu_si128((__m128i *)pu1_dst, y0_0_16x8b);
  202|   361k|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), y0_1_16x8b);
  203|   361k|            _mm_storeu_si128((__m128i *)(pu1_dst + (dst_strd << 1)), y0_2_16x8b);
  204|   361k|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd * 3), y0_3_16x8b);
  205|   361k|            _mm_storeu_si128((__m128i *)(pu1_dst + (dst_strd << 2)), y0_4_16x8b);
  206|   361k|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd * 5), y0_5_16x8b);
  207|   361k|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd * 6), y0_6_16x8b);
  208|   361k|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd * 7), y0_7_16x8b);
  209|       |
  210|   361k|            ht -= 8;
  211|   361k|            pu1_src1 += src_strd1 << 3;
  212|   361k|            pu1_src2 += src_strd2 << 3;
  213|   361k|            pu1_dst += dst_strd << 3;
  214|   361k|        }
  215|   361k|        while(ht > 0);
  ------------------
  |  Branch (215:15): [True: 174k, False: 186k]
  ------------------
  216|   186k|    }
  217|   213k|}
ih264_default_weighted_pred_chroma_sse42:
  256|   213k|{
  257|   213k|    __m128i uv0_0_16x8b, uv0_1_16x8b;
  258|   213k|    __m128i uv1_0_16x8b, uv1_1_16x8b;
  259|       |
  260|   213k|    if(wd == 2)
  ------------------
  |  Branch (260:8): [True: 3.18k, False: 210k]
  ------------------
  261|  3.18k|    {
  262|  3.18k|        do
  263|  4.71k|        {
  264|  4.71k|            uv0_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src1);
  265|  4.71k|            uv0_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src1 + src_strd1));
  266|       |
  267|  4.71k|            uv1_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src2);
  268|  4.71k|            uv1_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src2 + src_strd2));
  269|       |
  270|  4.71k|            uv0_0_16x8b = _mm_avg_epu8(uv0_0_16x8b, uv1_0_16x8b);
  271|  4.71k|            uv0_1_16x8b = _mm_avg_epu8(uv0_1_16x8b, uv1_1_16x8b);
  272|       |
  273|  4.71k|            *((WORD32 *)(pu1_dst)) = _mm_cvtsi128_si32(uv0_0_16x8b);
  274|  4.71k|            *((WORD32 *)(pu1_dst + dst_strd)) = _mm_cvtsi128_si32(uv0_1_16x8b);
  275|       |
  276|  4.71k|            ht -= 2;
  277|  4.71k|            pu1_src1 += src_strd1 << 1;
  278|  4.71k|            pu1_src2 += src_strd2 << 1;
  279|  4.71k|            pu1_dst += dst_strd << 1;
  280|  4.71k|        }
  281|  4.71k|        while(ht > 0);
  ------------------
  |  Branch (281:15): [True: 1.53k, False: 3.18k]
  ------------------
  282|  3.18k|    }
  283|   210k|    else if(wd == 4)
  ------------------
  |  Branch (283:13): [True: 23.9k, False: 186k]
  ------------------
  284|  23.9k|    {
  285|  23.9k|        do
  286|  58.0k|        {
  287|  58.0k|            uv0_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src1);
  288|  58.0k|            uv0_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src1 + src_strd1));
  289|       |
  290|  58.0k|            uv1_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src2);
  291|  58.0k|            uv1_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src2 + src_strd2));
  292|       |
  293|  58.0k|            uv0_0_16x8b = _mm_avg_epu8(uv0_0_16x8b, uv1_0_16x8b);
  294|  58.0k|            uv0_1_16x8b = _mm_avg_epu8(uv0_1_16x8b, uv1_1_16x8b);
  295|       |
  296|  58.0k|            _mm_storel_epi64((__m128i *)pu1_dst, uv0_0_16x8b);
  297|  58.0k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), uv0_1_16x8b);
  298|       |
  299|  58.0k|            ht -= 2;
  300|  58.0k|            pu1_src1 += src_strd1 << 1;
  301|  58.0k|            pu1_src2 += src_strd2 << 1;
  302|  58.0k|            pu1_dst += dst_strd << 1;
  303|  58.0k|        }
  304|  58.0k|        while(ht > 0);
  ------------------
  |  Branch (304:15): [True: 34.0k, False: 23.9k]
  ------------------
  305|  23.9k|    }
  306|   186k|    else // wd == 8
  307|   186k|    {
  308|   186k|        __m128i uv0_2_16x8b, uv0_3_16x8b;
  309|   186k|        __m128i uv1_2_16x8b, uv1_3_16x8b;
  310|       |
  311|   186k|        do
  312|   361k|        {
  313|   361k|            uv0_0_16x8b = _mm_loadu_si128((__m128i *)pu1_src1);
  314|   361k|            uv0_1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src1 + src_strd1));
  315|   361k|            uv0_2_16x8b = _mm_loadu_si128(
  316|   361k|                            (__m128i *)(pu1_src1 + (src_strd1 << 1)));
  317|   361k|            uv0_3_16x8b = _mm_loadu_si128(
  318|   361k|                            (__m128i *)(pu1_src1 + src_strd1 * 3));
  319|       |
  320|   361k|            uv1_0_16x8b = _mm_loadu_si128((__m128i *)pu1_src2);
  321|   361k|            uv1_1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src2 + src_strd2));
  322|   361k|            uv1_2_16x8b = _mm_loadu_si128(
  323|   361k|                            (__m128i *)(pu1_src2 + (src_strd2 << 1)));
  324|   361k|            uv1_3_16x8b = _mm_loadu_si128(
  325|   361k|                            (__m128i *)(pu1_src2 + src_strd2 * 3));
  326|       |
  327|   361k|            uv0_0_16x8b = _mm_avg_epu8(uv0_0_16x8b, uv1_0_16x8b);
  328|   361k|            uv0_1_16x8b = _mm_avg_epu8(uv0_1_16x8b, uv1_1_16x8b);
  329|   361k|            uv0_2_16x8b = _mm_avg_epu8(uv0_2_16x8b, uv1_2_16x8b);
  330|   361k|            uv0_3_16x8b = _mm_avg_epu8(uv0_3_16x8b, uv1_3_16x8b);
  331|       |
  332|   361k|            _mm_storeu_si128((__m128i *)pu1_dst, uv0_0_16x8b);
  333|   361k|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), uv0_1_16x8b);
  334|   361k|            _mm_storeu_si128(
  335|   361k|                            (__m128i *)(pu1_dst + (dst_strd << 1)), uv0_2_16x8b);
  336|   361k|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd * 3), uv0_3_16x8b);
  337|       |
  338|   361k|            ht -= 4;
  339|   361k|            pu1_src1 += src_strd1 << 2;
  340|   361k|            pu1_src2 += src_strd2 << 2;
  341|   361k|            pu1_dst += dst_strd << 2;
  342|   361k|        }
  343|   361k|        while(ht > 0);
  ------------------
  |  Branch (343:15): [True: 174k, False: 186k]
  ------------------
  344|   186k|    }
  345|   213k|}
ih264_weighted_pred_luma_sse42:
  387|  4.07M|{
  388|  4.07M|    __m128i y_0_16x8b, y_1_16x8b, y_2_16x8b, y_3_16x8b;
  389|       |
  390|  4.07M|    __m128i wt_8x16b, round_8x16b, ofst_8x16b;
  391|       |
  392|  4.07M|    WORD32 round_val;
  393|       |
  394|  4.07M|    wt = (WORD16)(wt & 0xffff);
  395|  4.07M|    round_val = 1 << (log_wd - 1);
  396|  4.07M|    ofst = (WORD8)(ofst & 0xff);
  397|       |
  398|  4.07M|    wt_8x16b = _mm_set1_epi16(wt);
  399|  4.07M|    round_8x16b = _mm_set1_epi16(round_val);
  400|  4.07M|    ofst_8x16b = _mm_set1_epi16(ofst);
  401|       |
  402|  4.07M|    if(wd == 4)
  ------------------
  |  Branch (402:8): [True: 32.7k, False: 4.03M]
  ------------------
  403|  32.7k|    {
  404|  32.7k|        __m128i y_0_8x16b, y_2_8x16b;
  405|       |
  406|  32.7k|        do
  407|  58.5k|        {
  408|  58.5k|            y_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  409|  58.5k|            y_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
  410|  58.5k|            y_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (src_strd << 1)));
  411|  58.5k|            y_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd * 3));
  412|       |
  413|  58.5k|            y_0_16x8b = _mm_unpacklo_epi32(y_0_16x8b, y_1_16x8b);
  414|  58.5k|            y_2_16x8b = _mm_unpacklo_epi32(y_2_16x8b, y_3_16x8b);
  415|       |
  416|  58.5k|            y_0_8x16b = _mm_cvtepu8_epi16(y_0_16x8b);
  417|  58.5k|            y_2_8x16b = _mm_cvtepu8_epi16(y_2_16x8b);
  418|       |
  419|  58.5k|            y_0_8x16b = _mm_mullo_epi16(y_0_8x16b, wt_8x16b);
  420|  58.5k|            y_2_8x16b = _mm_mullo_epi16(y_2_8x16b, wt_8x16b);
  421|       |
  422|  58.5k|            y_0_8x16b = _mm_adds_epi16(round_8x16b, y_0_8x16b);
  423|  58.5k|            y_2_8x16b = _mm_adds_epi16(round_8x16b, y_2_8x16b);
  424|       |
  425|  58.5k|            y_0_8x16b = _mm_srai_epi16(y_0_8x16b, log_wd);
  426|  58.5k|            y_2_8x16b = _mm_srai_epi16(y_2_8x16b, log_wd);
  427|       |
  428|  58.5k|            y_0_8x16b = _mm_adds_epi16(ofst_8x16b, y_0_8x16b);
  429|  58.5k|            y_2_8x16b = _mm_adds_epi16(ofst_8x16b, y_2_8x16b);
  430|       |
  431|  58.5k|            y_0_16x8b = _mm_packus_epi16(y_0_8x16b, y_2_8x16b);
  432|  58.5k|            y_1_16x8b = _mm_srli_si128(y_0_16x8b, 4);
  433|  58.5k|            y_2_16x8b = _mm_srli_si128(y_0_16x8b, 8);
  434|  58.5k|            y_3_16x8b = _mm_srli_si128(y_0_16x8b, 12);
  435|       |
  436|  58.5k|            *((WORD32 *)(pu1_dst)) = _mm_cvtsi128_si32(y_0_16x8b);
  437|  58.5k|            *((WORD32 *)(pu1_dst + dst_strd)) = _mm_cvtsi128_si32(y_1_16x8b);
  438|  58.5k|            *((WORD32 *)(pu1_dst + (dst_strd << 1))) = _mm_cvtsi128_si32(y_2_16x8b);
  439|  58.5k|            *((WORD32 *)(pu1_dst + dst_strd * 3)) = _mm_cvtsi128_si32(y_3_16x8b);
  440|       |
  441|  58.5k|            ht -= 4;
  442|  58.5k|            pu1_src += src_strd << 2;
  443|  58.5k|            pu1_dst += dst_strd << 2;
  444|  58.5k|        }
  445|  58.5k|        while(ht > 0);
  ------------------
  |  Branch (445:15): [True: 25.8k, False: 32.7k]
  ------------------
  446|  32.7k|    }
  447|  4.03M|    else if(wd == 8)
  ------------------
  |  Branch (447:13): [True: 21.8k, False: 4.01M]
  ------------------
  448|  21.8k|    {
  449|  21.8k|        __m128i y_0_8x16b, y_1_8x16b, y_2_8x16b, y_3_8x16b;
  450|       |
  451|  21.8k|        do
  452|  44.5k|        {
  453|  44.5k|            y_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  454|  44.5k|            y_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
  455|  44.5k|            y_2_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + (src_strd << 1)));
  456|  44.5k|            y_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd * 3));
  457|       |
  458|  44.5k|            y_0_8x16b = _mm_cvtepu8_epi16(y_0_16x8b);
  459|  44.5k|            y_1_8x16b = _mm_cvtepu8_epi16(y_1_16x8b);
  460|  44.5k|            y_2_8x16b = _mm_cvtepu8_epi16(y_2_16x8b);
  461|  44.5k|            y_3_8x16b = _mm_cvtepu8_epi16(y_3_16x8b);
  462|       |
  463|  44.5k|            y_0_8x16b = _mm_mullo_epi16(y_0_8x16b, wt_8x16b);
  464|  44.5k|            y_1_8x16b = _mm_mullo_epi16(y_1_8x16b, wt_8x16b);
  465|  44.5k|            y_2_8x16b = _mm_mullo_epi16(y_2_8x16b, wt_8x16b);
  466|  44.5k|            y_3_8x16b = _mm_mullo_epi16(y_3_8x16b, wt_8x16b);
  467|       |
  468|  44.5k|            y_0_8x16b = _mm_adds_epi16(round_8x16b, y_0_8x16b);
  469|  44.5k|            y_1_8x16b = _mm_adds_epi16(round_8x16b, y_1_8x16b);
  470|  44.5k|            y_2_8x16b = _mm_adds_epi16(round_8x16b, y_2_8x16b);
  471|  44.5k|            y_3_8x16b = _mm_adds_epi16(round_8x16b, y_3_8x16b);
  472|       |
  473|  44.5k|            y_0_8x16b = _mm_srai_epi16(y_0_8x16b, log_wd);
  474|  44.5k|            y_1_8x16b = _mm_srai_epi16(y_1_8x16b, log_wd);
  475|  44.5k|            y_2_8x16b = _mm_srai_epi16(y_2_8x16b, log_wd);
  476|  44.5k|            y_3_8x16b = _mm_srai_epi16(y_3_8x16b, log_wd);
  477|       |
  478|  44.5k|            y_0_8x16b = _mm_adds_epi16(ofst_8x16b, y_0_8x16b);
  479|  44.5k|            y_1_8x16b = _mm_adds_epi16(ofst_8x16b, y_1_8x16b);
  480|  44.5k|            y_2_8x16b = _mm_adds_epi16(ofst_8x16b, y_2_8x16b);
  481|  44.5k|            y_3_8x16b = _mm_adds_epi16(ofst_8x16b, y_3_8x16b);
  482|       |
  483|  44.5k|            y_0_16x8b = _mm_packus_epi16(y_0_8x16b, y_1_8x16b);
  484|  44.5k|            y_2_16x8b = _mm_packus_epi16(y_2_8x16b, y_3_8x16b);
  485|  44.5k|            y_1_16x8b = _mm_srli_si128(y_0_16x8b, 8);
  486|  44.5k|            y_3_16x8b = _mm_srli_si128(y_2_16x8b, 8);
  487|       |
  488|  44.5k|            _mm_storel_epi64((__m128i *)pu1_dst, y_0_16x8b);
  489|  44.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), y_1_16x8b);
  490|  44.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd << 1)), y_2_16x8b);
  491|  44.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd * 3), y_3_16x8b);
  492|       |
  493|  44.5k|            ht -= 4;
  494|  44.5k|            pu1_src += src_strd << 2;
  495|  44.5k|            pu1_dst += dst_strd << 2;
  496|  44.5k|        }
  497|  44.5k|        while(ht > 0);
  ------------------
  |  Branch (497:15): [True: 22.7k, False: 21.8k]
  ------------------
  498|  21.8k|    }
  499|  4.01M|    else // wd == 16
  500|  4.01M|    {
  501|  4.01M|        __m128i y_0L_8x16b, y_1L_8x16b, y_2L_8x16b, y_3L_8x16b;
  502|  4.01M|        __m128i y_0H_8x16b, y_1H_8x16b, y_2H_8x16b, y_3H_8x16b;
  503|       |
  504|  4.01M|        __m128i zero_16x8b;
  505|  4.01M|        zero_16x8b = _mm_set1_epi8(0);
  506|       |
  507|  4.01M|        do
  508|  16.0M|        {
  509|  16.0M|            y_0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
  510|  16.0M|            y_1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));
  511|  16.0M|            y_2_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + (src_strd << 1)));
  512|  16.0M|            y_3_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd * 3));
  513|       |
  514|  16.0M|            y_0L_8x16b = _mm_cvtepu8_epi16(y_0_16x8b);
  515|  16.0M|            y_0H_8x16b = _mm_unpackhi_epi8(y_0_16x8b, zero_16x8b);
  516|  16.0M|            y_1L_8x16b = _mm_cvtepu8_epi16(y_1_16x8b);
  517|  16.0M|            y_1H_8x16b = _mm_unpackhi_epi8(y_1_16x8b, zero_16x8b);
  518|  16.0M|            y_2L_8x16b = _mm_cvtepu8_epi16(y_2_16x8b);
  519|  16.0M|            y_2H_8x16b = _mm_unpackhi_epi8(y_2_16x8b, zero_16x8b);
  520|  16.0M|            y_3L_8x16b = _mm_cvtepu8_epi16(y_3_16x8b);
  521|  16.0M|            y_3H_8x16b = _mm_unpackhi_epi8(y_3_16x8b, zero_16x8b);
  522|       |
  523|  16.0M|            y_0L_8x16b = _mm_mullo_epi16(y_0L_8x16b, wt_8x16b);
  524|  16.0M|            y_0H_8x16b = _mm_mullo_epi16(y_0H_8x16b, wt_8x16b);
  525|  16.0M|            y_1L_8x16b = _mm_mullo_epi16(y_1L_8x16b, wt_8x16b);
  526|  16.0M|            y_1H_8x16b = _mm_mullo_epi16(y_1H_8x16b, wt_8x16b);
  527|  16.0M|            y_2L_8x16b = _mm_mullo_epi16(y_2L_8x16b, wt_8x16b);
  528|  16.0M|            y_2H_8x16b = _mm_mullo_epi16(y_2H_8x16b, wt_8x16b);
  529|  16.0M|            y_3L_8x16b = _mm_mullo_epi16(y_3L_8x16b, wt_8x16b);
  530|  16.0M|            y_3H_8x16b = _mm_mullo_epi16(y_3H_8x16b, wt_8x16b);
  531|       |
  532|  16.0M|            y_0L_8x16b = _mm_adds_epi16(round_8x16b, y_0L_8x16b);
  533|  16.0M|            y_0H_8x16b = _mm_adds_epi16(round_8x16b, y_0H_8x16b);
  534|  16.0M|            y_1L_8x16b = _mm_adds_epi16(round_8x16b, y_1L_8x16b);
  535|  16.0M|            y_1H_8x16b = _mm_adds_epi16(round_8x16b, y_1H_8x16b);
  536|  16.0M|            y_2L_8x16b = _mm_adds_epi16(round_8x16b, y_2L_8x16b);
  537|  16.0M|            y_2H_8x16b = _mm_adds_epi16(round_8x16b, y_2H_8x16b);
  538|  16.0M|            y_3L_8x16b = _mm_adds_epi16(round_8x16b, y_3L_8x16b);
  539|  16.0M|            y_3H_8x16b = _mm_adds_epi16(round_8x16b, y_3H_8x16b);
  540|       |
  541|  16.0M|            y_0L_8x16b = _mm_srai_epi16(y_0L_8x16b, log_wd);
  542|  16.0M|            y_0H_8x16b = _mm_srai_epi16(y_0H_8x16b, log_wd);
  543|  16.0M|            y_1L_8x16b = _mm_srai_epi16(y_1L_8x16b, log_wd);
  544|  16.0M|            y_1H_8x16b = _mm_srai_epi16(y_1H_8x16b, log_wd);
  545|  16.0M|            y_2L_8x16b = _mm_srai_epi16(y_2L_8x16b, log_wd);
  546|  16.0M|            y_2H_8x16b = _mm_srai_epi16(y_2H_8x16b, log_wd);
  547|  16.0M|            y_3L_8x16b = _mm_srai_epi16(y_3L_8x16b, log_wd);
  548|  16.0M|            y_3H_8x16b = _mm_srai_epi16(y_3H_8x16b, log_wd);
  549|       |
  550|  16.0M|            y_0L_8x16b = _mm_adds_epi16(ofst_8x16b, y_0L_8x16b);
  551|  16.0M|            y_0H_8x16b = _mm_adds_epi16(ofst_8x16b, y_0H_8x16b);
  552|  16.0M|            y_1L_8x16b = _mm_adds_epi16(ofst_8x16b, y_1L_8x16b);
  553|  16.0M|            y_1H_8x16b = _mm_adds_epi16(ofst_8x16b, y_1H_8x16b);
  554|  16.0M|            y_2L_8x16b = _mm_adds_epi16(ofst_8x16b, y_2L_8x16b);
  555|  16.0M|            y_2H_8x16b = _mm_adds_epi16(ofst_8x16b, y_2H_8x16b);
  556|  16.0M|            y_3L_8x16b = _mm_adds_epi16(ofst_8x16b, y_3L_8x16b);
  557|  16.0M|            y_3H_8x16b = _mm_adds_epi16(ofst_8x16b, y_3H_8x16b);
  558|       |
  559|  16.0M|            y_0_16x8b = _mm_packus_epi16(y_0L_8x16b, y_0H_8x16b);
  560|  16.0M|            y_1_16x8b = _mm_packus_epi16(y_1L_8x16b, y_1H_8x16b);
  561|  16.0M|            y_2_16x8b = _mm_packus_epi16(y_2L_8x16b, y_2H_8x16b);
  562|  16.0M|            y_3_16x8b = _mm_packus_epi16(y_3L_8x16b, y_3H_8x16b);
  563|       |
  564|  16.0M|            _mm_storeu_si128((__m128i *)pu1_dst, y_0_16x8b);
  565|  16.0M|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), y_1_16x8b);
  566|  16.0M|            _mm_storeu_si128((__m128i *)(pu1_dst + (dst_strd << 1)), y_2_16x8b);
  567|  16.0M|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd * 3), y_3_16x8b);
  568|       |
  569|  16.0M|            ht -= 4;
  570|  16.0M|            pu1_src += src_strd << 2;
  571|  16.0M|            pu1_dst += dst_strd << 2;
  572|  16.0M|        }
  573|  16.0M|        while(ht > 0);
  ------------------
  |  Branch (573:15): [True: 12.0M, False: 4.01M]
  ------------------
  574|  4.01M|    }
  575|  4.07M|}
ih264_weighted_pred_chroma_sse42:
  617|  4.07M|{
  618|  4.07M|    __m128i y_0_16x8b, y_1_16x8b;
  619|       |
  620|  4.07M|    __m128i wt_8x16b, round_8x16b, ofst_8x16b;
  621|       |
  622|  4.07M|    WORD32 ofst_u, ofst_v;
  623|  4.07M|    WORD32 round_val;
  624|       |
  625|  4.07M|    ofst_u = (WORD8)(ofst & 0xff);
  626|  4.07M|    ofst_v = (WORD8)(ofst >> 8);
  627|  4.07M|    round_val = 1 << (log_wd - 1);
  628|  4.07M|    ofst = (ofst_u & 0xffff) | (ofst_v << 16);
  629|       |
  630|  4.07M|    wt_8x16b = _mm_set1_epi32(wt);
  631|  4.07M|    round_8x16b = _mm_set1_epi16(round_val);
  632|  4.07M|    ofst_8x16b = _mm_set1_epi32(ofst);
  633|       |
  634|  4.07M|    if(wd == 2)
  ------------------
  |  Branch (634:8): [True: 32.7k, False: 4.03M]
  ------------------
  635|  32.7k|    {
  636|  32.7k|        __m128i y_0_8x16b;
  637|       |
  638|  32.7k|        do
  639|  58.5k|        {
  640|  58.5k|            y_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  641|  58.5k|            y_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
  642|       |
  643|  58.5k|            y_0_16x8b = _mm_unpacklo_epi32(y_0_16x8b, y_1_16x8b);
  644|       |
  645|  58.5k|            y_0_8x16b = _mm_cvtepu8_epi16(y_0_16x8b);
  646|       |
  647|  58.5k|            y_0_8x16b = _mm_mullo_epi16(y_0_8x16b, wt_8x16b);
  648|       |
  649|  58.5k|            y_0_8x16b = _mm_adds_epi16(round_8x16b, y_0_8x16b);
  650|       |
  651|  58.5k|            y_0_8x16b = _mm_srai_epi16(y_0_8x16b, log_wd);
  652|       |
  653|  58.5k|            y_0_8x16b = _mm_adds_epi16(ofst_8x16b, y_0_8x16b);
  654|       |
  655|  58.5k|            y_0_16x8b = _mm_packus_epi16(y_0_8x16b, y_0_8x16b);
  656|  58.5k|            y_1_16x8b = _mm_srli_si128(y_0_16x8b, 4);
  657|       |
  658|  58.5k|            *((WORD32 *)(pu1_dst)) = _mm_cvtsi128_si32(y_0_16x8b);
  659|  58.5k|            *((WORD32 *)(pu1_dst + dst_strd)) = _mm_cvtsi128_si32(y_1_16x8b);
  660|       |
  661|  58.5k|            ht -= 2;
  662|  58.5k|            pu1_src += src_strd << 1;
  663|  58.5k|            pu1_dst += dst_strd << 1;
  664|  58.5k|        }
  665|  58.5k|        while(ht > 0);
  ------------------
  |  Branch (665:15): [True: 25.8k, False: 32.7k]
  ------------------
  666|  32.7k|    }
  667|  4.03M|    else if(wd == 4)
  ------------------
  |  Branch (667:13): [True: 21.8k, False: 4.01M]
  ------------------
  668|  21.8k|    {
  669|  21.8k|        __m128i y_0_8x16b, y_1_8x16b;
  670|       |
  671|  21.8k|        do
  672|  44.5k|        {
  673|  44.5k|            y_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src);
  674|  44.5k|            y_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src + src_strd));
  675|       |
  676|  44.5k|            y_0_8x16b = _mm_cvtepu8_epi16(y_0_16x8b);
  677|  44.5k|            y_1_8x16b = _mm_cvtepu8_epi16(y_1_16x8b);
  678|       |
  679|  44.5k|            y_0_8x16b = _mm_mullo_epi16(y_0_8x16b, wt_8x16b);
  680|  44.5k|            y_1_8x16b = _mm_mullo_epi16(y_1_8x16b, wt_8x16b);
  681|       |
  682|  44.5k|            y_0_8x16b = _mm_adds_epi16(round_8x16b, y_0_8x16b);
  683|  44.5k|            y_1_8x16b = _mm_adds_epi16(round_8x16b, y_1_8x16b);
  684|       |
  685|  44.5k|            y_0_8x16b = _mm_srai_epi16(y_0_8x16b, log_wd);
  686|  44.5k|            y_1_8x16b = _mm_srai_epi16(y_1_8x16b, log_wd);
  687|       |
  688|  44.5k|            y_0_8x16b = _mm_adds_epi16(ofst_8x16b, y_0_8x16b);
  689|  44.5k|            y_1_8x16b = _mm_adds_epi16(ofst_8x16b, y_1_8x16b);
  690|       |
  691|  44.5k|            y_0_16x8b = _mm_packus_epi16(y_0_8x16b, y_1_8x16b);
  692|  44.5k|            y_1_16x8b = _mm_srli_si128(y_0_16x8b, 8);
  693|       |
  694|  44.5k|            _mm_storel_epi64((__m128i *)pu1_dst, y_0_16x8b);
  695|  44.5k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), y_1_16x8b);
  696|       |
  697|  44.5k|            ht -= 2;
  698|  44.5k|            pu1_src += src_strd << 1;
  699|  44.5k|            pu1_dst += dst_strd << 1;
  700|  44.5k|        }
  701|  44.5k|        while(ht > 0);
  ------------------
  |  Branch (701:15): [True: 22.7k, False: 21.8k]
  ------------------
  702|  21.8k|    }
  703|  4.01M|    else // wd == 16
  704|  4.01M|    {
  705|  4.01M|        __m128i y_2_16x8b, y_3_16x8b;
  706|  4.01M|        __m128i y_0L_8x16b, y_1L_8x16b, y_2L_8x16b, y_3L_8x16b;
  707|  4.01M|        __m128i y_0H_8x16b, y_1H_8x16b, y_2H_8x16b, y_3H_8x16b;
  708|       |
  709|  4.01M|        __m128i zero_16x8b;
  710|  4.01M|        zero_16x8b = _mm_set1_epi8(0);
  711|       |
  712|  4.01M|        do
  713|  8.02M|        {
  714|  8.02M|            y_0_16x8b = _mm_loadu_si128((__m128i *)pu1_src);
  715|  8.02M|            y_1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd));
  716|  8.02M|            y_2_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + (src_strd << 1)));
  717|  8.02M|            y_3_16x8b = _mm_loadu_si128((__m128i *)(pu1_src + src_strd * 3));
  718|       |
  719|  8.02M|            y_0L_8x16b = _mm_cvtepu8_epi16(y_0_16x8b);
  720|  8.02M|            y_0H_8x16b = _mm_unpackhi_epi8(y_0_16x8b, zero_16x8b);
  721|  8.02M|            y_1L_8x16b = _mm_cvtepu8_epi16(y_1_16x8b);
  722|  8.02M|            y_1H_8x16b = _mm_unpackhi_epi8(y_1_16x8b, zero_16x8b);
  723|  8.02M|            y_2L_8x16b = _mm_cvtepu8_epi16(y_2_16x8b);
  724|  8.02M|            y_2H_8x16b = _mm_unpackhi_epi8(y_2_16x8b, zero_16x8b);
  725|  8.02M|            y_3L_8x16b = _mm_cvtepu8_epi16(y_3_16x8b);
  726|  8.02M|            y_3H_8x16b = _mm_unpackhi_epi8(y_3_16x8b, zero_16x8b);
  727|       |
  728|  8.02M|            y_0L_8x16b = _mm_mullo_epi16(y_0L_8x16b, wt_8x16b);
  729|  8.02M|            y_0H_8x16b = _mm_mullo_epi16(y_0H_8x16b, wt_8x16b);
  730|  8.02M|            y_1L_8x16b = _mm_mullo_epi16(y_1L_8x16b, wt_8x16b);
  731|  8.02M|            y_1H_8x16b = _mm_mullo_epi16(y_1H_8x16b, wt_8x16b);
  732|  8.02M|            y_2L_8x16b = _mm_mullo_epi16(y_2L_8x16b, wt_8x16b);
  733|  8.02M|            y_2H_8x16b = _mm_mullo_epi16(y_2H_8x16b, wt_8x16b);
  734|  8.02M|            y_3L_8x16b = _mm_mullo_epi16(y_3L_8x16b, wt_8x16b);
  735|  8.02M|            y_3H_8x16b = _mm_mullo_epi16(y_3H_8x16b, wt_8x16b);
  736|       |
  737|  8.02M|            y_0L_8x16b = _mm_adds_epi16(round_8x16b, y_0L_8x16b);
  738|  8.02M|            y_0H_8x16b = _mm_adds_epi16(round_8x16b, y_0H_8x16b);
  739|  8.02M|            y_1L_8x16b = _mm_adds_epi16(round_8x16b, y_1L_8x16b);
  740|  8.02M|            y_1H_8x16b = _mm_adds_epi16(round_8x16b, y_1H_8x16b);
  741|  8.02M|            y_2L_8x16b = _mm_adds_epi16(round_8x16b, y_2L_8x16b);
  742|  8.02M|            y_2H_8x16b = _mm_adds_epi16(round_8x16b, y_2H_8x16b);
  743|  8.02M|            y_3L_8x16b = _mm_adds_epi16(round_8x16b, y_3L_8x16b);
  744|  8.02M|            y_3H_8x16b = _mm_adds_epi16(round_8x16b, y_3H_8x16b);
  745|       |
  746|  8.02M|            y_0L_8x16b = _mm_srai_epi16(y_0L_8x16b, log_wd);
  747|  8.02M|            y_0H_8x16b = _mm_srai_epi16(y_0H_8x16b, log_wd);
  748|  8.02M|            y_1L_8x16b = _mm_srai_epi16(y_1L_8x16b, log_wd);
  749|  8.02M|            y_1H_8x16b = _mm_srai_epi16(y_1H_8x16b, log_wd);
  750|  8.02M|            y_2L_8x16b = _mm_srai_epi16(y_2L_8x16b, log_wd);
  751|  8.02M|            y_2H_8x16b = _mm_srai_epi16(y_2H_8x16b, log_wd);
  752|  8.02M|            y_3L_8x16b = _mm_srai_epi16(y_3L_8x16b, log_wd);
  753|  8.02M|            y_3H_8x16b = _mm_srai_epi16(y_3H_8x16b, log_wd);
  754|       |
  755|  8.02M|            y_0L_8x16b = _mm_adds_epi16(ofst_8x16b, y_0L_8x16b);
  756|  8.02M|            y_0H_8x16b = _mm_adds_epi16(ofst_8x16b, y_0H_8x16b);
  757|  8.02M|            y_1L_8x16b = _mm_adds_epi16(ofst_8x16b, y_1L_8x16b);
  758|  8.02M|            y_1H_8x16b = _mm_adds_epi16(ofst_8x16b, y_1H_8x16b);
  759|  8.02M|            y_2L_8x16b = _mm_adds_epi16(ofst_8x16b, y_2L_8x16b);
  760|  8.02M|            y_2H_8x16b = _mm_adds_epi16(ofst_8x16b, y_2H_8x16b);
  761|  8.02M|            y_3L_8x16b = _mm_adds_epi16(ofst_8x16b, y_3L_8x16b);
  762|  8.02M|            y_3H_8x16b = _mm_adds_epi16(ofst_8x16b, y_3H_8x16b);
  763|       |
  764|  8.02M|            y_0_16x8b = _mm_packus_epi16(y_0L_8x16b, y_0H_8x16b);
  765|  8.02M|            y_1_16x8b = _mm_packus_epi16(y_1L_8x16b, y_1H_8x16b);
  766|  8.02M|            y_2_16x8b = _mm_packus_epi16(y_2L_8x16b, y_2H_8x16b);
  767|  8.02M|            y_3_16x8b = _mm_packus_epi16(y_3L_8x16b, y_3H_8x16b);
  768|       |
  769|  8.02M|            _mm_storeu_si128((__m128i *)pu1_dst, y_0_16x8b);
  770|  8.02M|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), y_1_16x8b);
  771|  8.02M|            _mm_storeu_si128((__m128i *)(pu1_dst + (dst_strd << 1)), y_2_16x8b);
  772|  8.02M|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd * 3), y_3_16x8b);
  773|       |
  774|  8.02M|            ht -= 4;
  775|  8.02M|            pu1_src += src_strd << 2;
  776|  8.02M|            pu1_dst += dst_strd << 2;
  777|  8.02M|        }
  778|  8.02M|        while(ht > 0);
  ------------------
  |  Branch (778:15): [True: 4.01M, False: 4.01M]
  ------------------
  779|  4.01M|    }
  780|  4.07M|}
ih264_weighted_bi_pred_luma_sse42:
  830|   267k|{
  831|   267k|    __m128i y1_0_16x8b, y1_1_16x8b;
  832|   267k|    __m128i y2_0_16x8b, y2_1_16x8b;
  833|       |
  834|   267k|    __m128i wt1_8x16b, wt2_8x16b;
  835|   267k|    __m128i ofst_8x16b, round_8x16b;
  836|       |
  837|   267k|    WORD32 ofst;
  838|   267k|    WORD32 round_val, shft;
  839|       |
  840|   267k|    wt1 = (WORD16)(wt1 & 0xffff);
  841|   267k|    wt2 = (WORD16)(wt2 & 0xffff);
  842|   267k|    round_val = 1 << log_wd;
  843|   267k|    shft = log_wd + 1;
  844|   267k|    ofst1 = (WORD8)(ofst1 & 0xff);
  845|   267k|    ofst2 = (WORD8)(ofst2 & 0xff);
  846|   267k|    ofst = (ofst1 + ofst2 + 1) >> 1;
  847|       |
  848|   267k|    wt1_8x16b = _mm_set1_epi16(wt1);
  849|   267k|    wt2_8x16b = _mm_set1_epi16(wt2);
  850|   267k|    round_8x16b = _mm_set1_epi16(round_val);
  851|   267k|    ofst_8x16b = _mm_set1_epi16(ofst);
  852|       |
  853|   267k|    if(wd == 4)
  ------------------
  |  Branch (853:8): [True: 1.19k, False: 266k]
  ------------------
  854|  1.19k|    {
  855|  1.19k|        __m128i y1_2_16x8b, y1_3_16x8b;
  856|  1.19k|        __m128i y2_2_16x8b, y2_3_16x8b;
  857|       |
  858|  1.19k|        __m128i y1_0_8x16b, y1_2_8x16b;
  859|  1.19k|        __m128i y2_0_8x16b, y2_2_8x16b;
  860|       |
  861|  1.19k|        do
  862|  1.56k|        {
  863|  1.56k|            y1_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src1);
  864|  1.56k|            y1_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src1 + src_strd1));
  865|  1.56k|            y1_2_16x8b = _mm_loadl_epi64(
  866|  1.56k|                            (__m128i *)(pu1_src1 + (src_strd1 << 1)));
  867|  1.56k|            y1_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src1 + src_strd1 * 3));
  868|       |
  869|  1.56k|            y2_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src2);
  870|  1.56k|            y2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src2 + src_strd2));
  871|  1.56k|            y2_2_16x8b = _mm_loadl_epi64(
  872|  1.56k|                            (__m128i *)(pu1_src2 + (src_strd2 << 1)));
  873|  1.56k|            y2_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src2 + src_strd2 * 3));
  874|       |
  875|  1.56k|            y1_0_16x8b = _mm_unpacklo_epi32(y1_0_16x8b, y1_1_16x8b);
  876|  1.56k|            y1_2_16x8b = _mm_unpacklo_epi32(y1_2_16x8b, y1_3_16x8b);
  877|  1.56k|            y2_0_16x8b = _mm_unpacklo_epi32(y2_0_16x8b, y2_1_16x8b);
  878|  1.56k|            y2_2_16x8b = _mm_unpacklo_epi32(y2_2_16x8b, y2_3_16x8b);
  879|       |
  880|  1.56k|            y1_0_8x16b = _mm_cvtepu8_epi16(y1_0_16x8b);
  881|  1.56k|            y1_2_8x16b = _mm_cvtepu8_epi16(y1_2_16x8b);
  882|  1.56k|            y2_0_8x16b = _mm_cvtepu8_epi16(y2_0_16x8b);
  883|  1.56k|            y2_2_8x16b = _mm_cvtepu8_epi16(y2_2_16x8b);
  884|       |
  885|  1.56k|            y1_0_8x16b = _mm_mullo_epi16(y1_0_8x16b, wt1_8x16b);
  886|  1.56k|            y2_0_8x16b = _mm_mullo_epi16(y2_0_8x16b, wt2_8x16b);
  887|  1.56k|            y1_2_8x16b = _mm_mullo_epi16(y1_2_8x16b, wt1_8x16b);
  888|  1.56k|            y2_2_8x16b = _mm_mullo_epi16(y2_2_8x16b, wt2_8x16b);
  889|       |
  890|  1.56k|            y1_0_8x16b = _mm_adds_epi16(y1_0_8x16b, y2_0_8x16b);
  891|  1.56k|            y1_2_8x16b = _mm_adds_epi16(y1_2_8x16b, y2_2_8x16b);
  892|       |
  893|  1.56k|            y1_0_8x16b = _mm_adds_epi16(round_8x16b, y1_0_8x16b);
  894|  1.56k|            y1_2_8x16b = _mm_adds_epi16(round_8x16b, y1_2_8x16b);
  895|       |
  896|  1.56k|            y1_0_8x16b = _mm_srai_epi16(y1_0_8x16b, shft);
  897|  1.56k|            y1_2_8x16b = _mm_srai_epi16(y1_2_8x16b, shft);
  898|       |
  899|  1.56k|            y1_0_8x16b = _mm_adds_epi16(ofst_8x16b, y1_0_8x16b);
  900|  1.56k|            y1_2_8x16b = _mm_adds_epi16(ofst_8x16b, y1_2_8x16b);
  901|       |
  902|  1.56k|            y1_0_16x8b = _mm_packus_epi16(y1_0_8x16b, y1_2_8x16b);
  903|  1.56k|            y1_1_16x8b = _mm_srli_si128(y1_0_16x8b, 4);
  904|  1.56k|            y1_2_16x8b = _mm_srli_si128(y1_0_16x8b, 8);
  905|  1.56k|            y1_3_16x8b = _mm_srli_si128(y1_0_16x8b, 12);
  906|       |
  907|  1.56k|            *((WORD32 *)(pu1_dst)) = _mm_cvtsi128_si32(y1_0_16x8b);
  908|  1.56k|            *((WORD32 *)(pu1_dst + dst_strd)) = _mm_cvtsi128_si32(y1_1_16x8b);
  909|  1.56k|            *((WORD32 *)(pu1_dst + (dst_strd << 1))) = _mm_cvtsi128_si32(y1_2_16x8b);
  910|  1.56k|            *((WORD32 *)(pu1_dst + dst_strd * 3)) = _mm_cvtsi128_si32(y1_3_16x8b);
  911|       |
  912|       |
  913|  1.56k|            ht -= 4;
  914|  1.56k|            pu1_src1 += src_strd1 << 2;
  915|  1.56k|            pu1_src2 += src_strd2 << 2;
  916|  1.56k|            pu1_dst += dst_strd << 2;
  917|  1.56k|        }
  918|  1.56k|        while(ht > 0);
  ------------------
  |  Branch (918:15): [True: 376, False: 1.19k]
  ------------------
  919|  1.19k|    }
  920|   266k|    else if(wd == 8)
  ------------------
  |  Branch (920:13): [True: 17.9k, False: 248k]
  ------------------
  921|  17.9k|    {
  922|  17.9k|        __m128i y1_2_16x8b, y1_3_16x8b;
  923|  17.9k|        __m128i y2_2_16x8b, y2_3_16x8b;
  924|       |
  925|  17.9k|        __m128i y1_0_8x16b, y1_1_8x16b, y1_2_8x16b, y1_3_8x16b;
  926|  17.9k|        __m128i y2_0_8x16b, y2_1_8x16b, y2_2_8x16b, y2_3_8x16b;
  927|       |
  928|  17.9k|        do
  929|  38.8k|        {
  930|  38.8k|            y1_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src1);
  931|  38.8k|            y1_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src1 + src_strd1));
  932|  38.8k|            y1_2_16x8b = _mm_loadl_epi64(
  933|  38.8k|                            (__m128i *)(pu1_src1 + (src_strd1 << 1)));
  934|  38.8k|            y1_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src1 + src_strd1 * 3));
  935|       |
  936|  38.8k|            y2_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src2);
  937|  38.8k|            y2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src2 + src_strd2));
  938|  38.8k|            y2_2_16x8b = _mm_loadl_epi64(
  939|  38.8k|                            (__m128i *)(pu1_src2 + (src_strd2 << 1)));
  940|  38.8k|            y2_3_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src2 + src_strd2 * 3));
  941|       |
  942|  38.8k|            y1_0_8x16b = _mm_cvtepu8_epi16(y1_0_16x8b);
  943|  38.8k|            y1_1_8x16b = _mm_cvtepu8_epi16(y1_1_16x8b);
  944|  38.8k|            y1_2_8x16b = _mm_cvtepu8_epi16(y1_2_16x8b);
  945|  38.8k|            y1_3_8x16b = _mm_cvtepu8_epi16(y1_3_16x8b);
  946|       |
  947|  38.8k|            y2_0_8x16b = _mm_cvtepu8_epi16(y2_0_16x8b);
  948|  38.8k|            y2_1_8x16b = _mm_cvtepu8_epi16(y2_1_16x8b);
  949|  38.8k|            y2_2_8x16b = _mm_cvtepu8_epi16(y2_2_16x8b);
  950|  38.8k|            y2_3_8x16b = _mm_cvtepu8_epi16(y2_3_16x8b);
  951|       |
  952|  38.8k|            y1_0_8x16b = _mm_mullo_epi16(y1_0_8x16b, wt1_8x16b);
  953|  38.8k|            y2_0_8x16b = _mm_mullo_epi16(y2_0_8x16b, wt2_8x16b);
  954|  38.8k|            y1_1_8x16b = _mm_mullo_epi16(y1_1_8x16b, wt1_8x16b);
  955|  38.8k|            y2_1_8x16b = _mm_mullo_epi16(y2_1_8x16b, wt2_8x16b);
  956|       |
  957|  38.8k|            y1_2_8x16b = _mm_mullo_epi16(y1_2_8x16b, wt1_8x16b);
  958|  38.8k|            y2_2_8x16b = _mm_mullo_epi16(y2_2_8x16b, wt2_8x16b);
  959|  38.8k|            y1_3_8x16b = _mm_mullo_epi16(y1_3_8x16b, wt1_8x16b);
  960|  38.8k|            y2_3_8x16b = _mm_mullo_epi16(y2_3_8x16b, wt2_8x16b);
  961|       |
  962|  38.8k|            y1_0_8x16b = _mm_adds_epi16(y1_0_8x16b, y2_0_8x16b);
  963|  38.8k|            y1_1_8x16b = _mm_adds_epi16(y1_1_8x16b, y2_1_8x16b);
  964|  38.8k|            y1_2_8x16b = _mm_adds_epi16(y1_2_8x16b, y2_2_8x16b);
  965|  38.8k|            y1_3_8x16b = _mm_adds_epi16(y1_3_8x16b, y2_3_8x16b);
  966|       |
  967|  38.8k|            y1_0_8x16b = _mm_adds_epi16(round_8x16b, y1_0_8x16b);
  968|  38.8k|            y1_1_8x16b = _mm_adds_epi16(round_8x16b, y1_1_8x16b);
  969|  38.8k|            y1_2_8x16b = _mm_adds_epi16(round_8x16b, y1_2_8x16b);
  970|  38.8k|            y1_3_8x16b = _mm_adds_epi16(round_8x16b, y1_3_8x16b);
  971|       |
  972|  38.8k|            y1_0_8x16b = _mm_srai_epi16(y1_0_8x16b, shft);
  973|  38.8k|            y1_1_8x16b = _mm_srai_epi16(y1_1_8x16b, shft);
  974|  38.8k|            y1_2_8x16b = _mm_srai_epi16(y1_2_8x16b, shft);
  975|  38.8k|            y1_3_8x16b = _mm_srai_epi16(y1_3_8x16b, shft);
  976|       |
  977|  38.8k|            y1_0_8x16b = _mm_adds_epi16(ofst_8x16b, y1_0_8x16b);
  978|  38.8k|            y1_1_8x16b = _mm_adds_epi16(ofst_8x16b, y1_1_8x16b);
  979|  38.8k|            y1_2_8x16b = _mm_adds_epi16(ofst_8x16b, y1_2_8x16b);
  980|  38.8k|            y1_3_8x16b = _mm_adds_epi16(ofst_8x16b, y1_3_8x16b);
  981|       |
  982|  38.8k|            y1_0_16x8b = _mm_packus_epi16(y1_0_8x16b, y1_1_8x16b);
  983|  38.8k|            y1_2_16x8b = _mm_packus_epi16(y1_2_8x16b, y1_3_8x16b);
  984|  38.8k|            y1_1_16x8b = _mm_srli_si128(y1_0_16x8b, 8);
  985|  38.8k|            y1_3_16x8b = _mm_srli_si128(y1_2_16x8b, 8);
  986|       |
  987|  38.8k|            _mm_storel_epi64((__m128i *)pu1_dst, y1_0_16x8b);
  988|  38.8k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), y1_1_16x8b);
  989|  38.8k|            _mm_storel_epi64((__m128i *)(pu1_dst + (dst_strd << 1)), y1_2_16x8b);
  990|  38.8k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd * 3), y1_3_16x8b);
  991|       |
  992|  38.8k|            ht -= 4;
  993|  38.8k|            pu1_src1 += src_strd1 << 2;
  994|  38.8k|            pu1_src2 += src_strd2 << 2;
  995|  38.8k|            pu1_dst += dst_strd << 2;
  996|  38.8k|        }
  997|  38.8k|        while(ht > 0);
  ------------------
  |  Branch (997:15): [True: 20.9k, False: 17.9k]
  ------------------
  998|  17.9k|    }
  999|   248k|    else // wd == 16
 1000|   248k|    {
 1001|   248k|        __m128i y1_0L_8x16b, y1_0H_8x16b, y1_1L_8x16b, y1_1H_8x16b;
 1002|   248k|        __m128i y2_0L_8x16b, y2_0H_8x16b, y2_1L_8x16b, y2_1H_8x16b;
 1003|       |
 1004|   248k|        __m128i zero_16x8b;
 1005|   248k|        zero_16x8b = _mm_set1_epi8(0);
 1006|       |
 1007|   248k|        do
 1008|  1.98M|        {
 1009|  1.98M|            y1_0_16x8b = _mm_loadu_si128((__m128i *)pu1_src1);
 1010|  1.98M|            y1_1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src1 + src_strd1));
 1011|  1.98M|            y2_0_16x8b = _mm_loadu_si128((__m128i *)pu1_src2);
 1012|  1.98M|            y2_1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src2 + src_strd2));
 1013|       |
 1014|  1.98M|            y1_0L_8x16b = _mm_cvtepu8_epi16(y1_0_16x8b);
 1015|  1.98M|            y1_0H_8x16b = _mm_unpackhi_epi8(y1_0_16x8b, zero_16x8b);
 1016|  1.98M|            y1_1L_8x16b = _mm_cvtepu8_epi16(y1_1_16x8b);
 1017|  1.98M|            y1_1H_8x16b = _mm_unpackhi_epi8(y1_1_16x8b, zero_16x8b);
 1018|       |
 1019|  1.98M|            y2_0L_8x16b = _mm_cvtepu8_epi16(y2_0_16x8b);
 1020|  1.98M|            y2_0H_8x16b = _mm_unpackhi_epi8(y2_0_16x8b, zero_16x8b);
 1021|  1.98M|            y2_1L_8x16b = _mm_cvtepu8_epi16(y2_1_16x8b);
 1022|  1.98M|            y2_1H_8x16b = _mm_unpackhi_epi8(y2_1_16x8b, zero_16x8b);
 1023|       |
 1024|  1.98M|            y1_0L_8x16b = _mm_mullo_epi16(y1_0L_8x16b, wt1_8x16b);
 1025|  1.98M|            y1_0H_8x16b = _mm_mullo_epi16(y1_0H_8x16b, wt1_8x16b);
 1026|  1.98M|            y1_1L_8x16b = _mm_mullo_epi16(y1_1L_8x16b, wt1_8x16b);
 1027|  1.98M|            y1_1H_8x16b = _mm_mullo_epi16(y1_1H_8x16b, wt1_8x16b);
 1028|       |
 1029|  1.98M|            y2_0L_8x16b = _mm_mullo_epi16(y2_0L_8x16b, wt2_8x16b);
 1030|  1.98M|            y2_0H_8x16b = _mm_mullo_epi16(y2_0H_8x16b, wt2_8x16b);
 1031|  1.98M|            y2_1L_8x16b = _mm_mullo_epi16(y2_1L_8x16b, wt2_8x16b);
 1032|  1.98M|            y2_1H_8x16b = _mm_mullo_epi16(y2_1H_8x16b, wt2_8x16b);
 1033|       |
 1034|  1.98M|            y1_0L_8x16b = _mm_adds_epi16(y1_0L_8x16b, y2_0L_8x16b);
 1035|  1.98M|            y1_0H_8x16b = _mm_adds_epi16(y1_0H_8x16b, y2_0H_8x16b);
 1036|  1.98M|            y1_1L_8x16b = _mm_adds_epi16(y1_1L_8x16b, y2_1L_8x16b);
 1037|  1.98M|            y1_1H_8x16b = _mm_adds_epi16(y1_1H_8x16b, y2_1H_8x16b);
 1038|       |
 1039|  1.98M|            y1_0L_8x16b = _mm_adds_epi16(round_8x16b, y1_0L_8x16b);
 1040|  1.98M|            y1_0H_8x16b = _mm_adds_epi16(round_8x16b, y1_0H_8x16b);
 1041|  1.98M|            y1_1L_8x16b = _mm_adds_epi16(round_8x16b, y1_1L_8x16b);
 1042|  1.98M|            y1_1H_8x16b = _mm_adds_epi16(round_8x16b, y1_1H_8x16b);
 1043|       |
 1044|  1.98M|            y1_0L_8x16b = _mm_srai_epi16(y1_0L_8x16b, shft);
 1045|  1.98M|            y1_0H_8x16b = _mm_srai_epi16(y1_0H_8x16b, shft);
 1046|  1.98M|            y1_1L_8x16b = _mm_srai_epi16(y1_1L_8x16b, shft);
 1047|  1.98M|            y1_1H_8x16b = _mm_srai_epi16(y1_1H_8x16b, shft);
 1048|       |
 1049|  1.98M|            y1_0L_8x16b = _mm_adds_epi16(ofst_8x16b, y1_0L_8x16b);
 1050|  1.98M|            y1_0H_8x16b = _mm_adds_epi16(ofst_8x16b, y1_0H_8x16b);
 1051|  1.98M|            y1_1L_8x16b = _mm_adds_epi16(ofst_8x16b, y1_1L_8x16b);
 1052|  1.98M|            y1_1H_8x16b = _mm_adds_epi16(ofst_8x16b, y1_1H_8x16b);
 1053|       |
 1054|  1.98M|            y1_0_16x8b = _mm_packus_epi16(y1_0L_8x16b, y1_0H_8x16b);
 1055|  1.98M|            y1_1_16x8b = _mm_packus_epi16(y1_1L_8x16b, y1_1H_8x16b);
 1056|       |
 1057|  1.98M|            _mm_storeu_si128((__m128i *)pu1_dst, y1_0_16x8b);
 1058|  1.98M|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), y1_1_16x8b);
 1059|       |
 1060|  1.98M|            ht -= 2;
 1061|  1.98M|            pu1_src1 += src_strd1 << 1;
 1062|  1.98M|            pu1_src2 += src_strd2 << 1;
 1063|  1.98M|            pu1_dst += dst_strd << 1;
 1064|  1.98M|        }
 1065|  1.98M|        while(ht > 0);
  ------------------
  |  Branch (1065:15): [True: 1.73M, False: 248k]
  ------------------
 1066|   248k|    }
 1067|   267k|}
ih264_weighted_bi_pred_chroma_sse42:
 1117|   267k|{
 1118|   267k|    __m128i y1_0_16x8b, y1_1_16x8b;
 1119|   267k|    __m128i y2_0_16x8b, y2_1_16x8b;
 1120|       |
 1121|   267k|    __m128i wt1_8x16b, wt2_8x16b;
 1122|   267k|    __m128i ofst_8x16b, round_8x16b;
 1123|       |
 1124|   267k|    WORD32 ofst1_u, ofst2_u, ofst_u;
 1125|   267k|    WORD32 ofst1_v, ofst2_v, ofst_v;
 1126|   267k|    WORD32 round_val, shft, ofst_val;
 1127|       |
 1128|   267k|    round_val = 1 << log_wd;
 1129|   267k|    shft = log_wd + 1;
 1130|       |
 1131|   267k|    ofst1_u = (WORD8)(ofst1 & 0xff);
 1132|   267k|    ofst1_v = (WORD8)(ofst1 >> 8);
 1133|   267k|    ofst2_u = (WORD8)(ofst2 & 0xff);
 1134|   267k|    ofst2_v = (WORD8)(ofst2 >> 8);
 1135|       |
 1136|   267k|    wt1_8x16b = _mm_set1_epi32(wt1);
 1137|   267k|    wt2_8x16b = _mm_set1_epi32(wt2);
 1138|       |
 1139|   267k|    ofst_u = (ofst1_u + ofst2_u + 1) >> 1;
 1140|   267k|    ofst_v = (ofst1_v + ofst2_v + 1) >> 1;
 1141|   267k|    ofst_val = (ofst_u & 0xffff) | (ofst_v << 16);
 1142|       |
 1143|   267k|    round_8x16b = _mm_set1_epi16(round_val);
 1144|   267k|    ofst_8x16b = _mm_set1_epi32(ofst_val);
 1145|       |
 1146|   267k|    if(wd == 2)
  ------------------
  |  Branch (1146:8): [True: 1.19k, False: 266k]
  ------------------
 1147|  1.19k|    {
 1148|  1.19k|        __m128i y1_0_8x16b, y2_0_8x16b;
 1149|       |
 1150|  1.19k|        do
 1151|  1.56k|        {
 1152|  1.56k|            y1_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src1);
 1153|  1.56k|            y1_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src1 + src_strd1));
 1154|       |
 1155|  1.56k|            y2_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src2);
 1156|  1.56k|            y2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src2 + src_strd2));
 1157|       |
 1158|  1.56k|            y1_0_16x8b = _mm_unpacklo_epi32(y1_0_16x8b, y1_1_16x8b);
 1159|  1.56k|            y2_0_16x8b = _mm_unpacklo_epi32(y2_0_16x8b, y2_1_16x8b);
 1160|       |
 1161|  1.56k|            y1_0_8x16b = _mm_cvtepu8_epi16(y1_0_16x8b);
 1162|  1.56k|            y2_0_8x16b = _mm_cvtepu8_epi16(y2_0_16x8b);
 1163|       |
 1164|  1.56k|            y1_0_8x16b = _mm_mullo_epi16(y1_0_8x16b, wt1_8x16b);
 1165|  1.56k|            y2_0_8x16b = _mm_mullo_epi16(y2_0_8x16b, wt2_8x16b);
 1166|       |
 1167|  1.56k|            y1_0_8x16b = _mm_adds_epi16(y1_0_8x16b, y2_0_8x16b);
 1168|  1.56k|            y1_0_8x16b = _mm_adds_epi16(round_8x16b, y1_0_8x16b);
 1169|       |
 1170|  1.56k|            y1_0_8x16b = _mm_srai_epi16(y1_0_8x16b, shft);
 1171|  1.56k|            y1_0_8x16b = _mm_adds_epi16(ofst_8x16b, y1_0_8x16b);
 1172|       |
 1173|  1.56k|            y1_0_16x8b = _mm_packus_epi16(y1_0_8x16b, y1_0_8x16b);
 1174|  1.56k|            y1_1_16x8b = _mm_srli_si128(y1_0_16x8b, 4);
 1175|       |
 1176|  1.56k|            *((WORD32 *)(pu1_dst)) = _mm_cvtsi128_si32(y1_0_16x8b);
 1177|  1.56k|            *((WORD32 *)(pu1_dst + dst_strd)) = _mm_cvtsi128_si32(y1_1_16x8b);
 1178|       |
 1179|  1.56k|            ht -= 2;
 1180|  1.56k|            pu1_src1 += src_strd1 << 1;
 1181|  1.56k|            pu1_src2 += src_strd2 << 1;
 1182|  1.56k|            pu1_dst += dst_strd << 1;
 1183|  1.56k|        }
 1184|  1.56k|        while(ht > 0);
  ------------------
  |  Branch (1184:15): [True: 376, False: 1.19k]
  ------------------
 1185|  1.19k|    }
 1186|   266k|    else if(wd == 4)
  ------------------
  |  Branch (1186:13): [True: 17.9k, False: 248k]
  ------------------
 1187|  17.9k|    {
 1188|  17.9k|        __m128i y1_0_8x16b, y1_1_8x16b;
 1189|  17.9k|        __m128i y2_0_8x16b, y2_1_8x16b;
 1190|       |
 1191|  17.9k|        do
 1192|  38.8k|        {
 1193|  38.8k|            y1_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src1);
 1194|  38.8k|            y1_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src1 + src_strd1));
 1195|       |
 1196|  38.8k|            y2_0_16x8b = _mm_loadl_epi64((__m128i *)pu1_src2);
 1197|  38.8k|            y2_1_16x8b = _mm_loadl_epi64((__m128i *)(pu1_src2 + src_strd2));
 1198|       |
 1199|  38.8k|            y1_0_8x16b = _mm_cvtepu8_epi16(y1_0_16x8b);
 1200|  38.8k|            y1_1_8x16b = _mm_cvtepu8_epi16(y1_1_16x8b);
 1201|       |
 1202|  38.8k|            y2_0_8x16b = _mm_cvtepu8_epi16(y2_0_16x8b);
 1203|  38.8k|            y2_1_8x16b = _mm_cvtepu8_epi16(y2_1_16x8b);
 1204|       |
 1205|  38.8k|            y1_0_8x16b = _mm_mullo_epi16(y1_0_8x16b, wt1_8x16b);
 1206|  38.8k|            y2_0_8x16b = _mm_mullo_epi16(y2_0_8x16b, wt2_8x16b);
 1207|  38.8k|            y1_1_8x16b = _mm_mullo_epi16(y1_1_8x16b, wt1_8x16b);
 1208|  38.8k|            y2_1_8x16b = _mm_mullo_epi16(y2_1_8x16b, wt2_8x16b);
 1209|       |
 1210|  38.8k|            y1_0_8x16b = _mm_adds_epi16(y1_0_8x16b, y2_0_8x16b);
 1211|  38.8k|            y1_1_8x16b = _mm_adds_epi16(y1_1_8x16b, y2_1_8x16b);
 1212|       |
 1213|  38.8k|            y1_0_8x16b = _mm_adds_epi16(round_8x16b, y1_0_8x16b);
 1214|  38.8k|            y1_1_8x16b = _mm_adds_epi16(round_8x16b, y1_1_8x16b);
 1215|       |
 1216|  38.8k|            y1_0_8x16b = _mm_srai_epi16(y1_0_8x16b, shft);
 1217|  38.8k|            y1_1_8x16b = _mm_srai_epi16(y1_1_8x16b, shft);
 1218|       |
 1219|  38.8k|            y1_0_8x16b = _mm_adds_epi16(ofst_8x16b, y1_0_8x16b);
 1220|  38.8k|            y1_1_8x16b = _mm_adds_epi16(ofst_8x16b, y1_1_8x16b);
 1221|       |
 1222|  38.8k|            y1_0_16x8b = _mm_packus_epi16(y1_0_8x16b, y1_1_8x16b);
 1223|  38.8k|            y1_1_16x8b = _mm_srli_si128(y1_0_16x8b, 8);
 1224|       |
 1225|  38.8k|            _mm_storel_epi64((__m128i *)pu1_dst, y1_0_16x8b);
 1226|  38.8k|            _mm_storel_epi64((__m128i *)(pu1_dst + dst_strd), y1_1_16x8b);
 1227|       |
 1228|  38.8k|            ht -= 2;
 1229|  38.8k|            pu1_src1 += src_strd1 << 1;
 1230|  38.8k|            pu1_src2 += src_strd2 << 1;
 1231|  38.8k|            pu1_dst += dst_strd << 1;
 1232|  38.8k|        }
 1233|  38.8k|        while(ht > 0);
  ------------------
  |  Branch (1233:15): [True: 20.9k, False: 17.9k]
  ------------------
 1234|  17.9k|    }
 1235|   248k|    else // wd == 8
 1236|   248k|    {
 1237|   248k|        __m128i y1_0L_8x16b, y1_0H_8x16b, y1_1L_8x16b, y1_1H_8x16b;
 1238|   248k|        __m128i y2_0L_8x16b, y2_0H_8x16b, y2_1L_8x16b, y2_1H_8x16b;
 1239|       |
 1240|   248k|        __m128i zero_16x8b;
 1241|   248k|        zero_16x8b = _mm_set1_epi8(0);
 1242|       |
 1243|   248k|        do
 1244|   990k|        {
 1245|   990k|            y1_0_16x8b = _mm_loadu_si128((__m128i *)pu1_src1);
 1246|   990k|            y1_1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src1 + src_strd1));
 1247|   990k|            y2_0_16x8b = _mm_loadu_si128((__m128i *)pu1_src2);
 1248|   990k|            y2_1_16x8b = _mm_loadu_si128((__m128i *)(pu1_src2 + src_strd2));
 1249|       |
 1250|   990k|            y1_0L_8x16b = _mm_cvtepu8_epi16(y1_0_16x8b);
 1251|   990k|            y1_0H_8x16b = _mm_unpackhi_epi8(y1_0_16x8b, zero_16x8b);
 1252|   990k|            y1_1L_8x16b = _mm_cvtepu8_epi16(y1_1_16x8b);
 1253|   990k|            y1_1H_8x16b = _mm_unpackhi_epi8(y1_1_16x8b, zero_16x8b);
 1254|       |
 1255|   990k|            y2_0L_8x16b = _mm_cvtepu8_epi16(y2_0_16x8b);
 1256|   990k|            y2_0H_8x16b = _mm_unpackhi_epi8(y2_0_16x8b, zero_16x8b);
 1257|   990k|            y2_1L_8x16b = _mm_cvtepu8_epi16(y2_1_16x8b);
 1258|   990k|            y2_1H_8x16b = _mm_unpackhi_epi8(y2_1_16x8b, zero_16x8b);
 1259|       |
 1260|   990k|            y1_0L_8x16b = _mm_mullo_epi16(y1_0L_8x16b, wt1_8x16b);
 1261|   990k|            y1_0H_8x16b = _mm_mullo_epi16(y1_0H_8x16b, wt1_8x16b);
 1262|   990k|            y1_1L_8x16b = _mm_mullo_epi16(y1_1L_8x16b, wt1_8x16b);
 1263|   990k|            y1_1H_8x16b = _mm_mullo_epi16(y1_1H_8x16b, wt1_8x16b);
 1264|       |
 1265|   990k|            y2_0L_8x16b = _mm_mullo_epi16(y2_0L_8x16b, wt2_8x16b);
 1266|   990k|            y2_0H_8x16b = _mm_mullo_epi16(y2_0H_8x16b, wt2_8x16b);
 1267|   990k|            y2_1L_8x16b = _mm_mullo_epi16(y2_1L_8x16b, wt2_8x16b);
 1268|   990k|            y2_1H_8x16b = _mm_mullo_epi16(y2_1H_8x16b, wt2_8x16b);
 1269|       |
 1270|   990k|            y1_0L_8x16b = _mm_adds_epi16(y1_0L_8x16b, y2_0L_8x16b);
 1271|   990k|            y1_0H_8x16b = _mm_adds_epi16(y1_0H_8x16b, y2_0H_8x16b);
 1272|   990k|            y1_1L_8x16b = _mm_adds_epi16(y1_1L_8x16b, y2_1L_8x16b);
 1273|   990k|            y1_1H_8x16b = _mm_adds_epi16(y1_1H_8x16b, y2_1H_8x16b);
 1274|       |
 1275|   990k|            y1_0L_8x16b = _mm_adds_epi16(round_8x16b, y1_0L_8x16b);
 1276|   990k|            y1_0H_8x16b = _mm_adds_epi16(round_8x16b, y1_0H_8x16b);
 1277|   990k|            y1_1L_8x16b = _mm_adds_epi16(round_8x16b, y1_1L_8x16b);
 1278|   990k|            y1_1H_8x16b = _mm_adds_epi16(round_8x16b, y1_1H_8x16b);
 1279|       |
 1280|   990k|            y1_0L_8x16b = _mm_srai_epi16(y1_0L_8x16b, shft);
 1281|   990k|            y1_0H_8x16b = _mm_srai_epi16(y1_0H_8x16b, shft);
 1282|   990k|            y1_1L_8x16b = _mm_srai_epi16(y1_1L_8x16b, shft);
 1283|   990k|            y1_1H_8x16b = _mm_srai_epi16(y1_1H_8x16b, shft);
 1284|       |
 1285|   990k|            y1_0L_8x16b = _mm_adds_epi16(ofst_8x16b, y1_0L_8x16b);
 1286|   990k|            y1_0H_8x16b = _mm_adds_epi16(ofst_8x16b, y1_0H_8x16b);
 1287|   990k|            y1_1L_8x16b = _mm_adds_epi16(ofst_8x16b, y1_1L_8x16b);
 1288|   990k|            y1_1H_8x16b = _mm_adds_epi16(ofst_8x16b, y1_1H_8x16b);
 1289|       |
 1290|   990k|            y1_0_16x8b = _mm_packus_epi16(y1_0L_8x16b, y1_0H_8x16b);
 1291|   990k|            y1_1_16x8b = _mm_packus_epi16(y1_1L_8x16b, y1_1H_8x16b);
 1292|       |
 1293|   990k|            _mm_storeu_si128((__m128i *)pu1_dst, y1_0_16x8b);
 1294|   990k|            _mm_storeu_si128((__m128i *)(pu1_dst + dst_strd), y1_1_16x8b);
 1295|       |
 1296|   990k|            ht -= 2;
 1297|   990k|            pu1_src1 += src_strd1 << 1;
 1298|   990k|            pu1_src2 += src_strd2 << 1;
 1299|   990k|            pu1_dst += dst_strd << 1;
 1300|   990k|        }
 1301|   990k|        while(ht > 0);
  ------------------
  |  Branch (1301:15): [True: 742k, False: 248k]
  ------------------
 1302|   248k|    }
 1303|   267k|}

ih264d_export_sei_params:
  191|   198k|{
  192|   198k|    WORD32 i4_status = IV_SUCCESS;
  193|   198k|    sei *ps_sei = (sei *)ps_dec->pv_disp_sei_params;
  194|       |
  195|   198k|    i4_status = ih264d_export_sei_mdcv_params(ps_sei_decode_op, ps_sei, &ps_dec->s_sei_export);
  196|   198k|    i4_status = ih264d_export_sei_cll_params(ps_sei_decode_op, ps_sei, &ps_dec->s_sei_export);
  197|   198k|    i4_status = ih264d_export_sei_ave_params(ps_sei_decode_op, ps_sei, &ps_dec->s_sei_export);
  198|   198k|    i4_status = ih264d_export_sei_ccv_params(ps_sei_decode_op, ps_sei, &ps_dec->s_sei_export);
  199|   198k|    i4_status = ih264d_export_sei_sii_params(ps_sei_decode_op, ps_sei, &ps_dec->s_sei_export);
  200|   198k|    i4_status = ih264d_export_sei_fgc_params(ps_sei_decode_op, ps_sei, &ps_dec->s_sei_export);
  201|       |
  202|   198k|    UNUSED(i4_status);
  ------------------
  |  |   45|   198k|#define UNUSED(x) ((void)(x))
  ------------------
  203|   198k|}
ih264d_map_error:
 1928|  85.6k|{
 1929|  85.6k|    UWORD32 temp = 0;
 1930|       |
 1931|  85.6k|    switch(i4_err_status)
  ------------------
  |  Branch (1931:12): [True: 3.10k, False: 82.5k]
  ------------------
 1932|  85.6k|    {
 1933|      0|        case ERROR_MEM_ALLOC_ISRAM_T:
  ------------------
  |  Branch (1933:9): [True: 0, False: 85.6k]
  ------------------
 1934|      0|        case ERROR_MEM_ALLOC_SDRAM_T:
  ------------------
  |  Branch (1934:9): [True: 0, False: 85.6k]
  ------------------
 1935|      0|        case ERROR_BUF_MGR:
  ------------------
  |  Branch (1935:9): [True: 0, False: 85.6k]
  ------------------
 1936|      0|        case ERROR_MB_GROUP_ASSGN_T:
  ------------------
  |  Branch (1936:9): [True: 0, False: 85.6k]
  ------------------
 1937|      0|        case ERROR_FRAME_LIMIT_OVER:
  ------------------
  |  Branch (1937:9): [True: 0, False: 85.6k]
  ------------------
 1938|      0|        case ERROR_ACTUAL_RESOLUTION_GREATER_THAN_INIT:
  ------------------
  |  Branch (1938:9): [True: 0, False: 85.6k]
  ------------------
 1939|      0|        case ERROR_PROFILE_NOT_SUPPORTED:
  ------------------
  |  Branch (1939:9): [True: 0, False: 85.6k]
  ------------------
 1940|      0|        case ERROR_INIT_NOT_DONE:
  ------------------
  |  Branch (1940:9): [True: 0, False: 85.6k]
  ------------------
 1941|      0|        case IVD_MEM_ALLOC_FAILED:
  ------------------
  |  Branch (1941:9): [True: 0, False: 85.6k]
  ------------------
 1942|    605|        case ERROR_FEATURE_UNAVAIL:
  ------------------
  |  Branch (1942:9): [True: 605, False: 85.0k]
  ------------------
 1943|  1.09k|        case IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED:
  ------------------
  |  Branch (1943:9): [True: 494, False: 85.1k]
  ------------------
 1944|  1.09k|            temp = 1 << IVD_FATALERROR;
 1945|  1.09k|            H264_DEC_DEBUG_PRINT("\nFatal Error\n");
  ------------------
  |  |   39|  1.09k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 1946|  1.09k|            break;
 1947|       |
 1948|      0|        case ERROR_DBP_MANAGER_T:
  ------------------
  |  Branch (1948:9): [True: 0, False: 85.6k]
  ------------------
 1949|      0|        case ERROR_GAPS_IN_FRM_NUM:
  ------------------
  |  Branch (1949:9): [True: 0, False: 85.6k]
  ------------------
 1950|      0|        case ERROR_UNKNOWN_NAL:
  ------------------
  |  Branch (1950:9): [True: 0, False: 85.6k]
  ------------------
 1951|      0|        case ERROR_INV_MB_SLC_GRP_T:
  ------------------
  |  Branch (1951:9): [True: 0, False: 85.6k]
  ------------------
 1952|      0|        case ERROR_MULTIPLE_SLC_GRP_T:
  ------------------
  |  Branch (1952:9): [True: 0, False: 85.6k]
  ------------------
 1953|      0|        case ERROR_UNKNOWN_LEVEL:
  ------------------
  |  Branch (1953:9): [True: 0, False: 85.6k]
  ------------------
 1954|      0|        case ERROR_UNAVAIL_PICBUF_T:
  ------------------
  |  Branch (1954:9): [True: 0, False: 85.6k]
  ------------------
 1955|      0|        case ERROR_UNAVAIL_MVBUF_T:
  ------------------
  |  Branch (1955:9): [True: 0, False: 85.6k]
  ------------------
 1956|      0|        case ERROR_UNAVAIL_DISPBUF_T:
  ------------------
  |  Branch (1956:9): [True: 0, False: 85.6k]
  ------------------
 1957|    109|        case ERROR_NUM_REF:
  ------------------
  |  Branch (1957:9): [True: 109, False: 85.5k]
  ------------------
 1958|    109|        case ERROR_REFIDX_ORDER_T:
  ------------------
  |  Branch (1958:9): [True: 0, False: 85.6k]
  ------------------
 1959|    109|        case ERROR_PIC0_NOT_FOUND_T:
  ------------------
  |  Branch (1959:9): [True: 0, False: 85.6k]
  ------------------
 1960|    109|        case ERROR_MB_TYPE:
  ------------------
  |  Branch (1960:9): [True: 0, False: 85.6k]
  ------------------
 1961|    109|        case ERROR_SUB_MB_TYPE:
  ------------------
  |  Branch (1961:9): [True: 0, False: 85.6k]
  ------------------
 1962|    109|        case ERROR_CBP:
  ------------------
  |  Branch (1962:9): [True: 0, False: 85.6k]
  ------------------
 1963|    356|        case ERROR_REF_IDX:
  ------------------
  |  Branch (1963:9): [True: 247, False: 85.4k]
  ------------------
 1964|    356|        case ERROR_NUM_MV:
  ------------------
  |  Branch (1964:9): [True: 0, False: 85.6k]
  ------------------
 1965|    356|        case ERROR_CHROMA_PRED_MODE:
  ------------------
  |  Branch (1965:9): [True: 0, False: 85.6k]
  ------------------
 1966|    356|        case ERROR_INTRAPRED:
  ------------------
  |  Branch (1966:9): [True: 0, False: 85.6k]
  ------------------
 1967|    356|        case ERROR_NEXT_MB_ADDRESS_T:
  ------------------
  |  Branch (1967:9): [True: 0, False: 85.6k]
  ------------------
 1968|    356|        case ERROR_MB_ADDRESS_T:
  ------------------
  |  Branch (1968:9): [True: 0, False: 85.6k]
  ------------------
 1969|    356|        case ERROR_PIC1_NOT_FOUND_T:
  ------------------
  |  Branch (1969:9): [True: 0, False: 85.6k]
  ------------------
 1970|    356|        case ERROR_CAVLC_NUM_COEFF_T:
  ------------------
  |  Branch (1970:9): [True: 0, False: 85.6k]
  ------------------
 1971|    356|        case ERROR_CAVLC_SCAN_POS_T:
  ------------------
  |  Branch (1971:9): [True: 0, False: 85.6k]
  ------------------
 1972|    356|        case ERROR_PRED_WEIGHT_TABLE_T:
  ------------------
  |  Branch (1972:9): [True: 0, False: 85.6k]
  ------------------
 1973|    361|        case ERROR_CORRUPTED_SLICE:
  ------------------
  |  Branch (1973:9): [True: 5, False: 85.6k]
  ------------------
 1974|    361|            temp = 1 << IVD_CORRUPTEDDATA;
 1975|    361|            break;
 1976|       |
 1977|      0|        case ERROR_NOT_SUPP_RESOLUTION:
  ------------------
  |  Branch (1977:9): [True: 0, False: 85.6k]
  ------------------
 1978|      0|        case ERROR_ACTUAL_LEVEL_GREATER_THAN_INIT:
  ------------------
  |  Branch (1978:9): [True: 0, False: 85.6k]
  ------------------
 1979|      0|            temp = 1 << IVD_UNSUPPORTEDINPUT;
 1980|      0|            break;
 1981|       |
 1982|      0|        case ERROR_INVALID_PIC_PARAM:
  ------------------
  |  Branch (1982:9): [True: 0, False: 85.6k]
  ------------------
 1983|      4|        case ERROR_INVALID_SEQ_PARAM:
  ------------------
  |  Branch (1983:9): [True: 4, False: 85.6k]
  ------------------
 1984|      4|        case ERROR_EGC_EXCEED_32_1_T:
  ------------------
  |  Branch (1984:9): [True: 0, False: 85.6k]
  ------------------
 1985|      4|        case ERROR_EGC_EXCEED_32_2_T:
  ------------------
  |  Branch (1985:9): [True: 0, False: 85.6k]
  ------------------
 1986|      4|        case ERROR_INV_RANGE_TEV_T:
  ------------------
  |  Branch (1986:9): [True: 0, False: 85.6k]
  ------------------
 1987|      4|        case ERROR_INV_SLC_TYPE_T:
  ------------------
  |  Branch (1987:9): [True: 0, False: 85.6k]
  ------------------
 1988|     76|        case ERROR_INV_POC_TYPE_T:
  ------------------
  |  Branch (1988:9): [True: 72, False: 85.6k]
  ------------------
 1989|    298|        case ERROR_INV_RANGE_QP_T:
  ------------------
  |  Branch (1989:9): [True: 222, False: 85.4k]
  ------------------
 1990|  1.19k|        case ERROR_INV_SPS_PPS_T:
  ------------------
  |  Branch (1990:9): [True: 892, False: 84.7k]
  ------------------
 1991|  1.19k|        case ERROR_INV_SLICE_HDR_T:
  ------------------
  |  Branch (1991:9): [True: 0, False: 85.6k]
  ------------------
 1992|  1.19k|        case ERROR_INV_SEI_MDCV_PARAMS:
  ------------------
  |  Branch (1992:9): [True: 7, False: 85.6k]
  ------------------
 1993|  1.19k|        case ERROR_INV_SEI_CLL_PARAMS:
  ------------------
  |  Branch (1993:9): [True: 0, False: 85.6k]
  ------------------
 1994|  1.20k|        case ERROR_INV_SEI_AVE_PARAMS:
  ------------------
  |  Branch (1994:9): [True: 4, False: 85.6k]
  ------------------
 1995|  1.22k|        case ERROR_INV_SEI_CCV_PARAMS:
  ------------------
  |  Branch (1995:9): [True: 22, False: 85.6k]
  ------------------
 1996|  1.22k|        case ERROR_INV_SEI_SII_PARAMS:
  ------------------
  |  Branch (1996:9): [True: 0, False: 85.6k]
  ------------------
 1997|       |
 1998|  1.22k|            temp = 1 << IVD_CORRUPTEDHEADER;
 1999|  1.22k|            break;
 2000|       |
 2001|      0|        case ERROR_EOB_FLUSHBITS_T:
  ------------------
  |  Branch (2001:9): [True: 0, False: 85.6k]
  ------------------
 2002|    422|        case ERROR_EOB_GETBITS_T:
  ------------------
  |  Branch (2002:9): [True: 422, False: 85.2k]
  ------------------
 2003|    422|        case ERROR_EOB_GETBIT_T:
  ------------------
  |  Branch (2003:9): [True: 0, False: 85.6k]
  ------------------
 2004|    422|        case ERROR_EOB_BYPASS_T:
  ------------------
  |  Branch (2004:9): [True: 0, False: 85.6k]
  ------------------
 2005|    422|        case ERROR_EOB_DECISION_T:
  ------------------
  |  Branch (2005:9): [True: 0, False: 85.6k]
  ------------------
 2006|    422|        case ERROR_EOB_TERMINATE_T:
  ------------------
  |  Branch (2006:9): [True: 0, False: 85.6k]
  ------------------
 2007|    422|        case ERROR_EOB_READCOEFF4X4CAB_T:
  ------------------
  |  Branch (2007:9): [True: 0, False: 85.6k]
  ------------------
 2008|    422|            temp = 1 << IVD_INSUFFICIENTDATA;
 2009|    422|            break;
 2010|      0|        case ERROR_DYNAMIC_RESOLUTION_NOT_SUPPORTED:
  ------------------
  |  Branch (2010:9): [True: 0, False: 85.6k]
  ------------------
 2011|      0|        case ERROR_DISP_WIDTH_RESET_TO_PIC_WIDTH:
  ------------------
  |  Branch (2011:9): [True: 0, False: 85.6k]
  ------------------
 2012|      0|            temp = 1 << IVD_UNSUPPORTEDPARAM | 1 << IVD_FATALERROR;
 2013|      0|            break;
 2014|       |
 2015|      0|        case ERROR_DANGLING_FIELD_IN_PIC:
  ------------------
  |  Branch (2015:9): [True: 0, False: 85.6k]
  ------------------
 2016|      0|            temp = 1 << IVD_APPLIEDCONCEALMENT;
 2017|      0|            break;
 2018|       |
 2019|  85.6k|    }
 2020|       |
 2021|  85.6k|    return temp;
 2022|       |
 2023|  85.6k|}
ih264d_get_outbuf_size:
 2029|   139k|{
 2030|   139k|    UWORD32 u4_min_num_out_bufs = 0;
 2031|       |
 2032|   139k|    if(u1_chroma_format == IV_YUV_420P)
  ------------------
  |  Branch (2032:8): [True: 71.2k, False: 68.5k]
  ------------------
 2033|  71.2k|        u4_min_num_out_bufs = MIN_OUT_BUFS_420;
  ------------------
  |  |  120|  71.2k|#define MIN_OUT_BUFS_420        3
  ------------------
 2034|  68.5k|    else if(u1_chroma_format == IV_YUV_422ILE)
  ------------------
  |  Branch (2034:13): [True: 0, False: 68.5k]
  ------------------
 2035|      0|        u4_min_num_out_bufs = MIN_OUT_BUFS_422ILE;
  ------------------
  |  |  121|      0|#define MIN_OUT_BUFS_422ILE     1
  ------------------
 2036|  68.5k|    else if(u1_chroma_format == IV_RGB_565)
  ------------------
  |  Branch (2036:13): [True: 0, False: 68.5k]
  ------------------
 2037|      0|        u4_min_num_out_bufs = MIN_OUT_BUFS_RGB565;
  ------------------
  |  |  122|      0|#define MIN_OUT_BUFS_RGB565     1
  ------------------
 2038|  68.5k|    else if((u1_chroma_format == IV_YUV_420SP_UV)
  ------------------
  |  Branch (2038:13): [True: 40.4k, False: 28.0k]
  ------------------
 2039|  28.0k|                    || (u1_chroma_format == IV_YUV_420SP_VU))
  ------------------
  |  Branch (2039:24): [True: 28.0k, False: 0]
  ------------------
 2040|  68.5k|        u4_min_num_out_bufs = MIN_OUT_BUFS_420SP;
  ------------------
  |  |  123|  68.5k|#define MIN_OUT_BUFS_420SP      2
  ------------------
 2041|       |
 2042|   139k|    if(u1_chroma_format == IV_YUV_420P)
  ------------------
  |  Branch (2042:8): [True: 71.2k, False: 68.5k]
  ------------------
 2043|  71.2k|    {
 2044|  71.2k|        p_buf_size[0] = (pic_wd * pic_ht);
 2045|  71.2k|        p_buf_size[1] = (pic_wd * pic_ht) >> 2;
 2046|  71.2k|        p_buf_size[2] = (pic_wd * pic_ht) >> 2;
 2047|  71.2k|    }
 2048|  68.5k|    else if(u1_chroma_format == IV_YUV_422ILE)
  ------------------
  |  Branch (2048:13): [True: 0, False: 68.5k]
  ------------------
 2049|      0|    {
 2050|      0|        p_buf_size[0] = (pic_wd * pic_ht) * 2;
 2051|      0|        p_buf_size[1] = p_buf_size[2] = 0;
 2052|      0|    }
 2053|  68.5k|    else if(u1_chroma_format == IV_RGB_565)
  ------------------
  |  Branch (2053:13): [True: 0, False: 68.5k]
  ------------------
 2054|      0|    {
 2055|      0|        p_buf_size[0] = (pic_wd * pic_ht) * 2;
 2056|      0|        p_buf_size[1] = p_buf_size[2] = 0;
 2057|      0|    }
 2058|  68.5k|    else if((u1_chroma_format == IV_YUV_420SP_UV)
  ------------------
  |  Branch (2058:13): [True: 40.4k, False: 28.0k]
  ------------------
 2059|  28.0k|                    || (u1_chroma_format == IV_YUV_420SP_VU))
  ------------------
  |  Branch (2059:24): [True: 28.0k, False: 0]
  ------------------
 2060|  68.5k|    {
 2061|  68.5k|        p_buf_size[0] = (pic_wd * pic_ht);
 2062|  68.5k|        p_buf_size[1] = (pic_wd * pic_ht) >> 1;
 2063|  68.5k|        p_buf_size[2] = 0;
 2064|  68.5k|    }
 2065|       |
 2066|   139k|    return u4_min_num_out_bufs;
 2067|   139k|}
check_app_out_buf_size:
 2070|   139k|{
 2071|   139k|    UWORD32 au4_min_out_buf_size[IVD_VIDDEC_MAX_IO_BUFFERS];
 2072|   139k|    UWORD32 u4_min_num_out_bufs, i;
 2073|   139k|    UWORD32 pic_wd, pic_ht;
 2074|       |
 2075|   139k|    if(0 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (2075:8): [True: 139k, False: 0]
  ------------------
 2076|   139k|    {
 2077|   139k|        pic_wd = ps_dec->u2_disp_width;
 2078|   139k|        pic_ht = ps_dec->u2_disp_height;
 2079|       |
 2080|   139k|    }
 2081|      0|    else
 2082|      0|    {
 2083|      0|        pic_wd = ps_dec->u2_frm_wd_y;
 2084|      0|        pic_ht = ps_dec->u2_frm_ht_y;
 2085|      0|    }
 2086|       |
 2087|   139k|    if(ps_dec->u4_app_disp_width > pic_wd)
  ------------------
  |  Branch (2087:8): [True: 0, False: 139k]
  ------------------
 2088|      0|        pic_wd = ps_dec->u4_app_disp_width;
 2089|       |
 2090|   139k|    u4_min_num_out_bufs = ih264d_get_outbuf_size(pic_wd, pic_ht,
 2091|   139k|                                                 ps_dec->u1_chroma_format,
 2092|   139k|                                                 &au4_min_out_buf_size[0]);
 2093|       |
 2094|       |
 2095|   139k|    if(0 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (2095:8): [True: 139k, False: 0]
  ------------------
 2096|   139k|    {
 2097|   139k|        if(ps_dec->ps_out_buffer->u4_num_bufs < u4_min_num_out_bufs)
  ------------------
  |  Branch (2097:12): [True: 0, False: 139k]
  ------------------
 2098|      0|            return IV_FAIL;
 2099|       |
 2100|   486k|        for(i = 0; i < u4_min_num_out_bufs; i++)
  ------------------
  |  Branch (2100:20): [True: 348k, False: 138k]
  ------------------
 2101|   348k|        {
 2102|   348k|            if(ps_dec->ps_out_buffer->u4_min_out_buf_size[i]
  ------------------
  |  Branch (2102:16): [True: 1.39k, False: 347k]
  ------------------
 2103|   348k|                            < au4_min_out_buf_size[i])
 2104|  1.39k|                return (IV_FAIL);
 2105|   348k|        }
 2106|   139k|    }
 2107|      0|    else
 2108|      0|    {
 2109|      0|        if(ps_dec->disp_bufs[0].u4_num_bufs < u4_min_num_out_bufs)
  ------------------
  |  Branch (2109:12): [True: 0, False: 0]
  ------------------
 2110|      0|            return IV_FAIL;
 2111|       |
 2112|      0|        for(i = 0; i < u4_min_num_out_bufs; i++)
  ------------------
  |  Branch (2112:20): [True: 0, False: 0]
  ------------------
 2113|      0|        {
 2114|       |            /* We need to check only with the disp_buffer[0], because we have
 2115|       |             * already ensured that all the buffers are of the same size in
 2116|       |             * ih264d_set_display_frame.
 2117|       |             */
 2118|      0|            if(ps_dec->disp_bufs[0].u4_bufsize[i] < au4_min_out_buf_size[i])
  ------------------
  |  Branch (2118:16): [True: 0, False: 0]
  ------------------
 2119|      0|                return (IV_FAIL);
 2120|      0|        }
 2121|       |
 2122|      0|    }
 2123|       |
 2124|   138k|    return (IV_SUCCESS);
 2125|   139k|}

ih264d_get_bit_h264:
   64|  7.49M|{
   65|  7.49M|    UWORD32 u4_code;
   66|       |
   67|  7.49M|    GETBIT(u4_code, ps_stream->u4_ofst, ps_stream->pu4_buffer);
  ------------------
  |  |  105|  7.49M|#define   GETBIT(u4_code, u4_offset, pu4_bitstream)                         \
  |  |  106|  7.49M|{                                                                           \
  |  |  107|  7.49M|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  108|  7.49M|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  109|  7.49M|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  110|  7.49M|    u4_code = pu4_buf[u4_word_off] << u4_bit_off;                           \
  |  |  111|  7.49M|    (u4_offset)++;                                                          \
  |  |  112|  7.49M|    u4_code = (u4_code >> 31);                                              \
  |  |  113|  7.49M|}
  ------------------
   68|  7.49M|    return (u4_code);
   69|  7.49M|}
ih264d_get_bits_h264:
   91|  10.0M|{
   92|  10.0M|    UWORD32 u4_code = 0;
   93|  10.0M|    if(u4_num_bits)
  ------------------
  |  Branch (93:8): [True: 10.0M, False: 0]
  ------------------
   94|  10.0M|        GETBITS(u4_code, ps_bitstrm->u4_ofst, ps_bitstrm->pu4_buffer, u4_num_bits);
  ------------------
  |  |  120|  10.0M|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  10.0M|{                                                                           \
  |  |  122|  10.0M|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  10.0M|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  10.0M|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  10.0M|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  10.0M|                                                                            \
  |  |  127|  10.0M|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 9.54M, False: 476k]
  |  |  ------------------
  |  |  128|  10.0M|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  9.54M|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  10.0M|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  10.0M|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  10.0M|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  10.0M|}                                                                           \
  ------------------
   95|  10.0M|    return (u4_code);
   96|  10.0M|}
ih264d_flush_bits_h264:
  151|  53.7k|{
  152|  53.7k|    ps_bitstrm->u4_ofst += u4_num_bits;
  153|       |
  154|  53.7k|    if(ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  ------------------
  |  Branch (154:8): [True: 0, False: 53.7k]
  ------------------
  155|      0|    {
  156|      0|        return ERROR_EOB_FLUSHBITS_T;
  157|      0|    }
  158|  53.7k|    return OK;
  ------------------
  |  |  114|  53.7k|#define OK        0
  ------------------
  159|  53.7k|}
ih264d_check_byte_aligned:
  176|   277k|{
  177|   277k|    if(ps_bitstrm->u4_ofst & 0x07)
  ------------------
  |  Branch (177:8): [True: 191k, False: 86.1k]
  ------------------
  178|   191k|        return (0);
  179|  86.1k|    else
  180|  86.1k|        return (1);
  181|   277k|}

ih264d_init_cabac_dec_envirnoment:
   64|  27.6k|{
   65|  27.6k|    UWORD32 u4_code_int_val_ofst;
   66|       |
   67|  27.6k|    ps_cab_env->u4_code_int_range = (HALF - 2) << 23;
  ------------------
  |  |   45|  27.6k|#define   HALF      (1 << (B_BITS-1))
  |  |  ------------------
  |  |  |  |   43|  27.6k|#define   B_BITS    10
  |  |  ------------------
  ------------------
   68|  27.6k|    NEXTBITS(u4_code_int_val_ofst, ps_bitstrm->u4_ofst, ps_bitstrm->pu4_buffer,
  ------------------
  |  |  137|  27.6k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  27.6k|{                                                                           \
  |  |  139|  27.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  27.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  27.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  27.6k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  27.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 18.7k, False: 8.91k]
  |  |  ------------------
  |  |  144|  27.6k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  18.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  27.6k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  27.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  27.6k|}
  ------------------
   69|  27.6k|             32);
   70|  27.6k|    FLUSHBITS(ps_bitstrm->u4_ofst, 9)
  ------------------
  |  |  193|  27.6k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  27.6k|{                                                                           \
  |  |  195|  27.6k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  27.6k|}
  ------------------
   71|       |
   72|  27.6k|    if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|  27.6k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 2.16k, False: 25.4k]
  |  |  ------------------
  ------------------
   73|  2.16k|        return ERROR_EOB_FLUSHBITS_T;
   74|       |
   75|  25.4k|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
   76|       |
   77|       |    /*brief description of the design adopted for CABAC*/
   78|       |    /*according to the standard the u4_code_int_range needs to be initialized 0x 1FE(10 bits) and
   79|       |     9 bits from the bit stream need to be read and into the u4_code_int_val_ofst.As and when the
   80|       |     u4_code_int_range becomes less than 10 bits we need to renormalize and read from the bitstream*
   81|       |
   82|       |     In the implemented design
   83|       |     initially
   84|       |
   85|       |     range_new = range <<23
   86|       |     valOffset_new = valOffset << 23 + 23 bits(read from the bit stream)
   87|       |
   88|       |     Thus we have read 23 more bits ahead of time.
   89|       |
   90|       |     It can be mathematical proved that even with the modified range and u4_ofst the operations
   91|       |     like comparison and subtraction needed for a bin decode are still valid(both in the regular case and the bypass case)
   92|       |
   93|       |     As bins are decoded..we consume the bits that we have already read into the valOffset.The clz of Range
   94|       |     gives us the number of bits we consumed of the 23 bits that we have read ahead of time.
   95|       |
   96|       |     when the number bits we have consumed exceeds 23 ,we renormalize..and  we read from the bitstream again*/
   97|       |
   98|  25.4k|RESET_BIN_COUNTS(ps_cab_env)
   99|       |
  100|  25.4k|    return OK;
  ------------------
  |  |  114|  25.4k|#define OK        0
  ------------------
  101|  27.6k|}
ih264d_init_cabac_contexts:
  124|  20.3k|{
  125|       |
  126|  20.3k|    bin_ctxt_model_t *p_cabac_ctxt_table_t = ps_dec->p_cabac_ctxt_table_t;
  127|  20.3k|    UWORD8 u1_qp_y = ps_dec->ps_cur_slice->u1_slice_qp;
  128|  20.3k|    UWORD8 u1_cabac_init_Idc = 0;
  129|       |
  130|  20.3k|    if(I_SLICE != u1_slice_type)
  ------------------
  |  |  370|  20.3k|#define I_SLICE  2
  ------------------
  |  Branch (130:8): [True: 16.8k, False: 3.49k]
  ------------------
  131|  16.8k|    {
  132|  16.8k|        u1_cabac_init_Idc = ps_dec->ps_cur_slice->u1_cabac_init_idc;
  133|  16.8k|    }
  134|       |
  135|  20.3k|    {
  136|       |        /* MAKING ps_dec->p_ctxt_inc_mb_map a scratch buffer */
  137|       |        /* 0th entry of CtxtIncMbMap will be always be containing default values
  138|       |         for CABAC context representing MB not available */
  139|  20.3k|        ctxt_inc_mb_info_t *p_DefCtxt = ps_dec->p_ctxt_inc_mb_map - 1;
  140|  20.3k|        UWORD8 *pu1_temp;
  141|  20.3k|        WORD8 i;
  142|  20.3k|        p_DefCtxt->u1_mb_type = CAB_SKIP;
  ------------------
  |  |  402|  20.3k|#define CAB_SKIP          0x10 /* 0001 0000 */
  ------------------
  143|       |
  144|  20.3k|        p_DefCtxt->u1_cbp = 0x0f;
  145|  20.3k|        p_DefCtxt->u1_intra_chroma_pred_mode = 0;
  146|       |
  147|  20.3k|        p_DefCtxt->u1_yuv_dc_csbp = 0x7;
  148|       |
  149|  20.3k|        p_DefCtxt->u1_transform8x8_ctxt = 0;
  150|       |
  151|  20.3k|        pu1_temp = (UWORD8*)p_DefCtxt->i1_ref_idx;
  152|   101k|        for(i = 0; i < 4; i++, pu1_temp++)
  ------------------
  |  Branch (152:20): [True: 81.2k, False: 20.3k]
  ------------------
  153|  81.2k|            (*pu1_temp) = 0;
  154|  20.3k|        pu1_temp = (UWORD8*)p_DefCtxt->u1_mv;
  155|   345k|        for(i = 0; i < 16; i++, pu1_temp++)
  ------------------
  |  Branch (155:20): [True: 324k, False: 20.3k]
  ------------------
  156|   324k|            (*pu1_temp) = 0;
  157|  20.3k|        ps_dec->ps_def_ctxt_mb_info = p_DefCtxt;
  158|  20.3k|    }
  159|       |
  160|  20.3k|    if(u1_slice_type == I_SLICE)
  ------------------
  |  |  370|  20.3k|#define I_SLICE  2
  ------------------
  |  Branch (160:8): [True: 3.49k, False: 16.8k]
  ------------------
  161|  3.49k|    {
  162|  3.49k|        u1_cabac_init_Idc = 3;
  163|  3.49k|        ps_dec->p_mb_type_t = p_cabac_ctxt_table_t + MB_TYPE_I_SLICE;
  164|  3.49k|    }
  165|  16.8k|    else if(u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  16.8k|#define P_SLICE  0
  ------------------
  |  Branch (165:13): [True: 7.64k, False: 9.17k]
  ------------------
  166|  7.64k|    {
  167|  7.64k|        ps_dec->p_mb_type_t = p_cabac_ctxt_table_t + MB_TYPE_P_SLICE;
  168|  7.64k|        ps_dec->p_mb_skip_flag_t = p_cabac_ctxt_table_t + MB_SKIP_FLAG_P_SLICE;
  169|  7.64k|        ps_dec->p_sub_mb_type_t = p_cabac_ctxt_table_t + SUB_MB_TYPE_P_SLICE;
  170|  7.64k|    }
  171|  9.17k|    else if(u1_slice_type == B_SLICE)
  ------------------
  |  |  369|  9.17k|#define B_SLICE  1
  ------------------
  |  Branch (171:13): [True: 9.17k, False: 0]
  ------------------
  172|  9.17k|    {
  173|  9.17k|        ps_dec->p_mb_type_t = p_cabac_ctxt_table_t + MB_TYPE_B_SLICE;
  174|  9.17k|        ps_dec->p_mb_skip_flag_t = p_cabac_ctxt_table_t + MB_SKIP_FLAG_B_SLICE;
  175|  9.17k|        ps_dec->p_sub_mb_type_t = p_cabac_ctxt_table_t + SUB_MB_TYPE_B_SLICE;
  176|  9.17k|    }
  177|  20.3k|    {
  178|  20.3k|        bin_ctxt_model_t *p_cabac_ctxt_table_t_tmp = p_cabac_ctxt_table_t;
  179|  20.3k|        if(ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (179:12): [True: 0, False: 20.3k]
  ------------------
  180|      0|        {
  181|      0|            p_cabac_ctxt_table_t_tmp += SIGNIFICANT_COEFF_FLAG_FLD;
  182|       |
  183|      0|        }
  184|  20.3k|        else
  185|  20.3k|        {
  186|  20.3k|            p_cabac_ctxt_table_t_tmp += SIGNIFICANT_COEFF_FLAG_FRAME;
  187|  20.3k|        }
  188|  20.3k|        {
  189|  20.3k|            bin_ctxt_model_t * * p_significant_coeff_flag_t =
  190|  20.3k|                            ps_dec->p_significant_coeff_flag_t;
  191|  20.3k|            p_significant_coeff_flag_t[0] = p_cabac_ctxt_table_t_tmp
  192|  20.3k|                            + SIG_COEFF_CTXT_CAT_0_OFFSET;
  193|  20.3k|            p_significant_coeff_flag_t[1] = p_cabac_ctxt_table_t_tmp
  194|  20.3k|                            + SIG_COEFF_CTXT_CAT_1_OFFSET;
  195|  20.3k|            p_significant_coeff_flag_t[2] = p_cabac_ctxt_table_t_tmp
  196|  20.3k|                            + SIG_COEFF_CTXT_CAT_2_OFFSET;
  197|  20.3k|            p_significant_coeff_flag_t[3] = p_cabac_ctxt_table_t_tmp
  198|  20.3k|                            + SIG_COEFF_CTXT_CAT_3_OFFSET;
  199|  20.3k|            p_significant_coeff_flag_t[4] = p_cabac_ctxt_table_t_tmp
  200|  20.3k|                            + SIG_COEFF_CTXT_CAT_4_OFFSET;
  201|       |
  202|  20.3k|            p_significant_coeff_flag_t[5] = p_cabac_ctxt_table_t_tmp
  203|  20.3k|                            + SIG_COEFF_CTXT_CAT_5_OFFSET;
  204|       |
  205|  20.3k|        }
  206|  20.3k|    }
  207|       |
  208|  20.3k|    memcpy(p_cabac_ctxt_table_t,
  209|  20.3k|           gau1_ih264d_cabac_ctxt_init_table[u1_cabac_init_Idc][u1_qp_y],
  210|  20.3k|           NUM_CABAC_CTXTS * sizeof(bin_ctxt_model_t));
  ------------------
  |  |   81|  20.3k|#define NUM_CABAC_CTXTS 460
  ------------------
  211|  20.3k|}
ih264d_decode_bin:
  237|  3.30M|{
  238|       |
  239|  3.30M|    UWORD32 u4_qnt_int_range, u4_code_int_range, u4_code_int_val_ofst,
  240|  3.30M|                    u4_int_range_lps;
  241|       |
  242|  3.30M|    UWORD32 u4_symbol, u4_mps_state;
  243|       |
  244|  3.30M|    bin_ctxt_model_t *ps_bin_ctxt;
  245|       |
  246|  3.30M|    UWORD32 table_lookup;
  247|  3.30M|    const UWORD32 *pu4_table = (const UWORD32 *)ps_cab_env->cabac_table;
  248|  3.30M|    UWORD32 u4_clz;
  249|       |
  250|  3.30M|    ps_bin_ctxt = ps_src_bin_ctxt + u4_ctx_inc;
  251|       |
  252|  3.30M|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  253|  3.30M|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  254|       |
  255|  3.30M|    u4_mps_state = (ps_bin_ctxt->u1_mps_state);
  256|  3.30M|    u4_clz = CLZ(u4_code_int_range);
  257|       |
  258|  3.30M|    u4_qnt_int_range = u4_code_int_range << u4_clz;
  259|  3.30M|    u4_qnt_int_range = (u4_qnt_int_range >> 29) & 0x3;
  260|       |
  261|  3.30M|    table_lookup = pu4_table[(u4_mps_state << 2) + u4_qnt_int_range];
  262|  3.30M|    u4_int_range_lps = table_lookup & 0xff;
  263|       |
  264|  3.30M|    u4_int_range_lps = u4_int_range_lps << (23 - u4_clz);
  265|  3.30M|    u4_code_int_range = u4_code_int_range - u4_int_range_lps;
  266|       |
  267|  3.30M|    u4_symbol = ((u4_mps_state >> 6) & 0x1);
  268|       |
  269|  3.30M|    u4_mps_state = (table_lookup >> 8) & 0x7F;
  270|       |
  271|  3.30M|    CHECK_IF_LPS(u4_code_int_range, u4_code_int_val_ofst, u4_symbol,
  ------------------
  |  |  184|  3.30M|                    u4_codeIntRangeLPS_m,u1_mps_state_m,table_lookup_m)                     \
  |  |  185|  3.30M|{                                                                                         \
  |  |  186|  3.30M|  if(u4_codeIntValOffset_m >= u4_codeIntRange_m)                                            \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 242k, False: 3.06M]
  |  |  ------------------
  |  |  187|  3.30M|  {                                                                                         \
  |  |  188|   242k|      u4_symbol_m = 1 - u4_symbol_m;                                                        \
  |  |  189|   242k|      u4_codeIntValOffset_m -= u4_codeIntRange_m;                                           \
  |  |  190|   242k|      u4_codeIntRange_m = u4_codeIntRangeLPS_m;                                             \
  |  |  191|   242k|      u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                       \
  |  |  192|   242k|  }                                                                                         \
  |  |  193|  3.30M|}
  ------------------
  272|  3.30M|                 u4_int_range_lps, u4_mps_state, table_lookup)
  273|       |
  274|  3.30M|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)
  ------------------
  |  |  113|  3.30M|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  ------------------
  |  Branch (274:8): [True: 9.35k, False: 3.29M]
  ------------------
  275|  9.35k|    {
  276|  9.35k|        UWORD32 *pu4_buffer, u4_offset;
  277|       |
  278|  9.35k|        pu4_buffer = ps_bitstrm->pu4_buffer;
  279|  9.35k|        u4_offset = ps_bitstrm->u4_ofst;
  280|       |
  281|  9.35k|        RENORM_RANGE_OFFSET(u4_code_int_range, u4_code_int_val_ofst, u4_offset,
  ------------------
  |  |  170|  9.35k|  {                                                                                         \
  |  |  171|  9.35k|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|  9.35k|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|  9.35k|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  9.35k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  9.35k|{                                                                           \
  |  |  |  |  139|  9.35k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  9.35k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  9.35k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  9.35k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  9.35k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 8.60k, False: 745]
  |  |  |  |  ------------------
  |  |  |  |  144|  9.35k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  8.60k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  9.35k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  9.35k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  9.35k|}
  |  |  ------------------
  |  |  174|  9.35k|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|  9.35k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  9.35k|{                                                                           \
  |  |  |  |  195|  9.35k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  9.35k|}
  |  |  ------------------
  |  |  175|  9.35k|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|  9.35k|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|  9.35k|  }
  ------------------
  282|  9.35k|                            pu4_buffer)
  283|       |
  284|  9.35k|        ps_bitstrm->u4_ofst = u4_offset;
  285|  9.35k|    }
  286|       |
  287|  3.30M|    INC_BIN_COUNT(ps_cab_env)
  288|       |
  289|  3.30M|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  290|  3.30M|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  291|  3.30M|    ps_bin_ctxt->u1_mps_state = u4_mps_state;
  292|       |
  293|  3.30M|    return (u4_symbol);
  294|  3.30M|}
ih264d_decode_terminate:
  315|  1.79M|{
  316|  1.79M|    UWORD32 u4_symbol;
  317|  1.79M|    UWORD32 u4_code_int_val_ofst, u4_code_int_range;
  318|  1.79M|    UWORD32 u4_clz;
  319|       |
  320|  1.79M|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  321|  1.79M|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  322|       |
  323|  1.79M|    u4_clz = CLZ(u4_code_int_range);
  324|  1.79M|    u4_code_int_range -= (2 << (23 - u4_clz));
  325|       |
  326|  1.79M|    if(u4_code_int_val_ofst >= u4_code_int_range)
  ------------------
  |  Branch (326:8): [True: 6.22k, False: 1.78M]
  ------------------
  327|  6.22k|    {
  328|       |        /* S=1 */
  329|  6.22k|        u4_symbol = 1;
  330|       |
  331|  6.22k|        {
  332|       |
  333|       |            /*the u4_ofst needs to be updated before termination*/
  334|  6.22k|            ps_stream->u4_ofst += u4_clz;
  335|       |
  336|  6.22k|        }
  337|       |
  338|  6.22k|    }
  339|  1.78M|    else
  340|  1.78M|    {
  341|       |        /* S=0 */
  342|  1.78M|        u4_symbol = 0;
  343|       |
  344|  1.78M|        if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)
  ------------------
  |  |  113|  1.78M|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  ------------------
  |  Branch (344:12): [True: 963, False: 1.78M]
  ------------------
  345|    963|        {
  346|    963|            UWORD32 *pu4_buffer, u4_offset;
  347|       |
  348|    963|            pu4_buffer = ps_stream->pu4_buffer;
  349|    963|            u4_offset = ps_stream->u4_ofst;
  350|       |
  351|    963|            RENORM_RANGE_OFFSET(u4_code_int_range, u4_code_int_val_ofst, u4_offset,
  ------------------
  |  |  170|    963|  {                                                                                         \
  |  |  171|    963|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|    963|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|    963|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|    963|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|    963|{                                                                           \
  |  |  |  |  139|    963|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|    963|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|    963|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|    963|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|    963|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 687, False: 276]
  |  |  |  |  ------------------
  |  |  |  |  144|    963|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    687|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|    963|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    963|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|    963|}
  |  |  ------------------
  |  |  174|    963|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|    963|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|    963|{                                                                           \
  |  |  |  |  195|    963|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|    963|}
  |  |  ------------------
  |  |  175|    963|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|    963|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|    963|  }
  ------------------
  352|    963|                                pu4_buffer)
  353|    963|            ps_stream->u4_ofst = u4_offset;
  354|    963|        }
  355|  1.78M|    }
  356|       |
  357|  1.79M|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  358|  1.79M|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  359|       |
  360|  1.79M|    INC_BIN_COUNT(ps_cab_env)
  361|       |
  362|  1.79M|    return (u4_symbol);
  363|  1.79M|}
ih264d_decode_bins_tunary:
  394|  88.3k|{
  395|  88.3k|    UWORD32 u4_value;
  396|  88.3k|    UWORD32 u4_symbol;
  397|  88.3k|    UWORD8 u4_ctx_Inc;
  398|  88.3k|    bin_ctxt_model_t *ps_bin_ctxt;
  399|  88.3k|    UWORD32 u4_code_int_range, u4_code_int_val_ofst;
  400|  88.3k|    const UWORD32 *pu4_table = (const UWORD32 *)ps_cab_env->cabac_table;
  401|       |
  402|  88.3k|    u4_value = 0;
  403|       |
  404|       |    /*u1_max_bins has to be less than or equal to 4, u1_max_bins <= 4 for  this function*/
  405|       |
  406|       |    /*here the valid length is assumed to be equal to 3 ,so the calling function is expected
  407|       |     to duplicate CtxInc if valid lenth is 2 and cmaxbin is greater than2*/
  408|  88.3k|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  409|  88.3k|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  410|       |
  411|  88.3k|    do
  412|   151k|    {
  413|   151k|        u4_ctx_Inc = u4_ctx_inc & 0xF;
  414|   151k|        u4_ctx_inc = u4_ctx_inc >> 4;
  415|       |
  416|   151k|        ps_bin_ctxt = ps_src_bin_ctxt + u4_ctx_Inc;
  417|       |
  418|   151k|        DECODE_ONE_BIN_MACRO(ps_bin_ctxt, u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  217|   151k|                     p_DecBitStream_arg,u4_symbol)                                           \
  |  |  218|   151k|{                                                                                       \
  |  |  219|   151k|    bin_ctxt_model_t *p_binCtxt_m = (bin_ctxt_model_t *) p_binCtxt_arg;                           \
  |  |  220|   151k|    dec_bit_stream_t *p_DecBitStream_m = (dec_bit_stream_t *) p_DecBitStream_arg;                 \
  |  |  221|   151k|    const UWORD32 *pu4_table_m = (const UWORD32 *) pu4_table_arg;                         \
  |  |  222|   151k|                                                                                        \
  |  |  223|   151k|    UWORD32 u4_quantCodeIntRange_m,u4_codeIntRangeLPS_m;                                    \
  |  |  224|   151k|    UWORD32 u1_mps_state_m;                                                               \
  |  |  225|   151k|    UWORD32 table_lookup_m;                                                               \
  |  |  226|   151k|    UWORD32 u4_clz_m;                                                                     \
  |  |  227|   151k|                                                                                        \
  |  |  228|   151k|    u1_mps_state_m = (p_binCtxt_m->u1_mps_state);                                           \
  |  |  229|   151k|    u4_clz_m = CLZ(u4_code_int_range);                                                  \
  |  |  230|   151k|    u4_quantCodeIntRange_m = u4_code_int_range << u4_clz_m;                                   \
  |  |  231|   151k|    u4_quantCodeIntRange_m = (u4_quantCodeIntRange_m >> 29) & 0x3;                          \
  |  |  232|   151k|    table_lookup_m = pu4_table_m[(u1_mps_state_m << 2)+u4_quantCodeIntRange_m];                 \
  |  |  233|   151k|    u4_codeIntRangeLPS_m = table_lookup_m & 0xff;                                           \
  |  |  234|   151k|                                                                                        \
  |  |  235|   151k|    u4_codeIntRangeLPS_m = u4_codeIntRangeLPS_m << (23 - u4_clz_m);                           \
  |  |  236|   151k|    u4_code_int_range = u4_code_int_range - u4_codeIntRangeLPS_m;                             \
  |  |  237|   151k|    u4_symbol = ((u1_mps_state_m>> 6) & 0x1);                                             \
  |  |  238|   151k|    /*if mps*/                                                                          \
  |  |  239|   151k|    u1_mps_state_m = (table_lookup_m >> 8) & 0x7F;                                          \
  |  |  240|   151k|    if(u4_code_int_val_ofst >= u4_code_int_range)                                          \
  |  |  ------------------
  |  |  |  Branch (240:8): [True: 17.6k, False: 134k]
  |  |  ------------------
  |  |  241|   151k|  {                                                                                     \
  |  |  242|  17.6k|                                                                                        \
  |  |  243|  17.6k|    u4_symbol = 1 - u4_symbol;                                                          \
  |  |  244|  17.6k|    u4_code_int_val_ofst -= u4_code_int_range;                                             \
  |  |  245|  17.6k|    u4_code_int_range = u4_codeIntRangeLPS_m;                                               \
  |  |  246|  17.6k|    u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                         \
  |  |  247|  17.6k|  }                                                                                     \
  |  |  248|   151k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)                                        \
  |  |  ------------------
  |  |  |  |  113|   303k|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  |  |  ------------------
  |  |  |  Branch (248:8): [True: 2.10k, False: 149k]
  |  |  ------------------
  |  |  249|   151k|    {                                                                                   \
  |  |  250|  2.10k|        UWORD32 *pu4_buffer,u4_offset;                                                  \
  |  |  251|  2.10k|        UWORD32 read_bits,u4_clz_m  ;                                                     \
  |  |  252|  2.10k|                                                                                        \
  |  |  253|  2.10k|        pu4_buffer = p_DecBitStream_m->pu4_buffer;                                         \
  |  |  254|  2.10k|        u4_offset = p_DecBitStream_m->u4_ofst;                                          \
  |  |  255|  2.10k|        u4_clz_m = CLZ(u4_code_int_range);                                              \
  |  |  256|  2.10k|        NEXTBITS(read_bits,(u4_offset+23),pu4_buffer,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  2.10k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  2.10k|{                                                                           \
  |  |  |  |  139|  2.10k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  2.10k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  2.10k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  2.10k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  2.10k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 1.77k, False: 325]
  |  |  |  |  ------------------
  |  |  |  |  144|  2.10k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  1.77k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  2.10k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.10k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  2.10k|}
  |  |  ------------------
  |  |  257|  2.10k|        FLUSHBITS(u4_offset,(u4_clz_m))                                                   \
  |  |  ------------------
  |  |  |  |  193|  2.10k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  2.10k|{                                                                           \
  |  |  |  |  195|  2.10k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  2.10k|}
  |  |  ------------------
  |  |  258|  2.10k|        u4_code_int_range = u4_code_int_range << u4_clz_m;                                    \
  |  |  259|  2.10k|        u4_code_int_val_ofst= (u4_code_int_val_ofst << u4_clz_m) | read_bits;               \
  |  |  260|  2.10k|                                                                                        \
  |  |  261|  2.10k|                                                                                        \
  |  |  262|  2.10k|        p_DecBitStream_m->u4_ofst = u4_offset;                                          \
  |  |  263|  2.10k|    }                                                                                   \
  |  |  264|   151k|    p_binCtxt_m->u1_mps_state = u1_mps_state_m;                                             \
  |  |  265|   151k|}
  ------------------
  419|   151k|                             pu4_table, ps_bitstrm, u4_symbol)
  420|       |
  421|   151k|        INC_BIN_COUNT(ps_cab_env);INC_DECISION_BINS(ps_cab_env);
  422|       |
  423|   151k|        u4_value++;
  424|   151k|    }
  425|   151k|    while((u4_value < u1_max_bins) & (u4_symbol));
  ------------------
  |  Branch (425:11): [True: 63.5k, False: 88.3k]
  ------------------
  426|       |
  427|  88.3k|    u4_value = u4_value - 1 + u4_symbol;
  428|       |
  429|  88.3k|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  430|  88.3k|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  431|       |
  432|  88.3k|    return (u4_value);
  433|       |
  434|  88.3k|}
ih264d_decode_bins:
  465|   181k|{
  466|   181k|    UWORD32 u4_value;
  467|   181k|    UWORD32 u4_symbol, i;
  468|   181k|    UWORD32 u4_ctxt_inc;
  469|   181k|    bin_ctxt_model_t *ps_bin_ctxt;
  470|   181k|    UWORD32 u4_code_int_range, u4_code_int_val_ofst;
  471|   181k|    const UWORD32 *pu4_table = (const UWORD32 *)ps_cab_env->cabac_table;
  472|       |
  473|   181k|    i = 0;
  474|       |
  475|   181k|    u4_value = 0;
  476|       |
  477|       |    /*u1_max_bins has to be less than or equal to 4, u1_max_bins <= 4 for  this fucntion*/
  478|   181k|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  479|   181k|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  480|       |
  481|   181k|    do
  482|   417k|    {
  483|   417k|        u4_ctxt_inc = u4_ctx_inc & 0xf;
  484|   417k|        u4_ctx_inc = u4_ctx_inc >> 4;
  485|       |
  486|   417k|        ps_bin_ctxt = ps_src_bin_ctxt + u4_ctxt_inc;
  487|       |
  488|   417k|        DECODE_ONE_BIN_MACRO(ps_bin_ctxt, u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  217|   417k|                     p_DecBitStream_arg,u4_symbol)                                           \
  |  |  218|   417k|{                                                                                       \
  |  |  219|   417k|    bin_ctxt_model_t *p_binCtxt_m = (bin_ctxt_model_t *) p_binCtxt_arg;                           \
  |  |  220|   417k|    dec_bit_stream_t *p_DecBitStream_m = (dec_bit_stream_t *) p_DecBitStream_arg;                 \
  |  |  221|   417k|    const UWORD32 *pu4_table_m = (const UWORD32 *) pu4_table_arg;                         \
  |  |  222|   417k|                                                                                        \
  |  |  223|   417k|    UWORD32 u4_quantCodeIntRange_m,u4_codeIntRangeLPS_m;                                    \
  |  |  224|   417k|    UWORD32 u1_mps_state_m;                                                               \
  |  |  225|   417k|    UWORD32 table_lookup_m;                                                               \
  |  |  226|   417k|    UWORD32 u4_clz_m;                                                                     \
  |  |  227|   417k|                                                                                        \
  |  |  228|   417k|    u1_mps_state_m = (p_binCtxt_m->u1_mps_state);                                           \
  |  |  229|   417k|    u4_clz_m = CLZ(u4_code_int_range);                                                  \
  |  |  230|   417k|    u4_quantCodeIntRange_m = u4_code_int_range << u4_clz_m;                                   \
  |  |  231|   417k|    u4_quantCodeIntRange_m = (u4_quantCodeIntRange_m >> 29) & 0x3;                          \
  |  |  232|   417k|    table_lookup_m = pu4_table_m[(u1_mps_state_m << 2)+u4_quantCodeIntRange_m];                 \
  |  |  233|   417k|    u4_codeIntRangeLPS_m = table_lookup_m & 0xff;                                           \
  |  |  234|   417k|                                                                                        \
  |  |  235|   417k|    u4_codeIntRangeLPS_m = u4_codeIntRangeLPS_m << (23 - u4_clz_m);                           \
  |  |  236|   417k|    u4_code_int_range = u4_code_int_range - u4_codeIntRangeLPS_m;                             \
  |  |  237|   417k|    u4_symbol = ((u1_mps_state_m>> 6) & 0x1);                                             \
  |  |  238|   417k|    /*if mps*/                                                                          \
  |  |  239|   417k|    u1_mps_state_m = (table_lookup_m >> 8) & 0x7F;                                          \
  |  |  240|   417k|    if(u4_code_int_val_ofst >= u4_code_int_range)                                          \
  |  |  ------------------
  |  |  |  Branch (240:8): [True: 67.3k, False: 350k]
  |  |  ------------------
  |  |  241|   417k|  {                                                                                     \
  |  |  242|  67.3k|                                                                                        \
  |  |  243|  67.3k|    u4_symbol = 1 - u4_symbol;                                                          \
  |  |  244|  67.3k|    u4_code_int_val_ofst -= u4_code_int_range;                                             \
  |  |  245|  67.3k|    u4_code_int_range = u4_codeIntRangeLPS_m;                                               \
  |  |  246|  67.3k|    u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                         \
  |  |  247|  67.3k|  }                                                                                     \
  |  |  248|   417k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)                                        \
  |  |  ------------------
  |  |  |  |  113|   835k|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  |  |  ------------------
  |  |  |  Branch (248:8): [True: 3.09k, False: 414k]
  |  |  ------------------
  |  |  249|   417k|    {                                                                                   \
  |  |  250|  3.09k|        UWORD32 *pu4_buffer,u4_offset;                                                  \
  |  |  251|  3.09k|        UWORD32 read_bits,u4_clz_m  ;                                                     \
  |  |  252|  3.09k|                                                                                        \
  |  |  253|  3.09k|        pu4_buffer = p_DecBitStream_m->pu4_buffer;                                         \
  |  |  254|  3.09k|        u4_offset = p_DecBitStream_m->u4_ofst;                                          \
  |  |  255|  3.09k|        u4_clz_m = CLZ(u4_code_int_range);                                              \
  |  |  256|  3.09k|        NEXTBITS(read_bits,(u4_offset+23),pu4_buffer,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  3.09k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  3.09k|{                                                                           \
  |  |  |  |  139|  3.09k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  3.09k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  3.09k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  3.09k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  3.09k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 2.92k, False: 169]
  |  |  |  |  ------------------
  |  |  |  |  144|  3.09k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.92k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  3.09k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  3.09k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  3.09k|}
  |  |  ------------------
  |  |  257|  3.09k|        FLUSHBITS(u4_offset,(u4_clz_m))                                                   \
  |  |  ------------------
  |  |  |  |  193|  3.09k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  3.09k|{                                                                           \
  |  |  |  |  195|  3.09k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  3.09k|}
  |  |  ------------------
  |  |  258|  3.09k|        u4_code_int_range = u4_code_int_range << u4_clz_m;                                    \
  |  |  259|  3.09k|        u4_code_int_val_ofst= (u4_code_int_val_ofst << u4_clz_m) | read_bits;               \
  |  |  260|  3.09k|                                                                                        \
  |  |  261|  3.09k|                                                                                        \
  |  |  262|  3.09k|        p_DecBitStream_m->u4_ofst = u4_offset;                                          \
  |  |  263|  3.09k|    }                                                                                   \
  |  |  264|   417k|    p_binCtxt_m->u1_mps_state = u1_mps_state_m;                                             \
  |  |  265|   417k|}
  ------------------
  489|   417k|                             pu4_table, ps_bitstrm, u4_symbol)
  490|       |
  491|   417k|        INC_BIN_COUNT(ps_cab_env);INC_DECISION_BINS(ps_cab_env);
  492|       |
  493|   417k|        u4_value = (u4_value << 1) | (u4_symbol);
  494|       |
  495|   417k|        i++;
  496|   417k|    }
  497|   417k|    while(i < u1_max_bins);
  ------------------
  |  Branch (497:11): [True: 235k, False: 181k]
  ------------------
  498|       |
  499|   181k|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  500|   181k|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  501|       |
  502|   181k|    return (u4_value);
  503|       |
  504|   181k|}
ih264d_decode_bins_unary:
  533|   466k|{
  534|   466k|    UWORD32 u4_value;
  535|   466k|    UWORD32 u4_symbol;
  536|   466k|    bin_ctxt_model_t *ps_bin_ctxt;
  537|   466k|    UWORD32 u4_ctx_Inc;
  538|   466k|    UWORD32 u4_code_int_range, u4_code_int_val_ofst;
  539|   466k|    const UWORD32 *pu4_table = (const UWORD32 *)ps_cab_env->cabac_table;
  540|       |
  541|       |    /* in this function the valid length for u4_ctx_inc is always taken to be,so if the
  542|       |     the valid length is lessthan 5 the caller need to duplicate accordingly*/
  543|       |
  544|       |    /*u1_max_bins is always greater or equal to 9 we have the check for u1_max_bins only after the 2 loop*/
  545|   466k|    u4_value = 0;
  546|   466k|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  547|   466k|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  548|       |
  549|   466k|    do
  550|   655k|    {
  551|   655k|        u4_ctx_Inc = u4_ctx_inc & 0xf;
  552|   655k|        u4_ctx_inc = u4_ctx_inc >> 4;
  553|       |
  554|   655k|        ps_bin_ctxt = ps_src_bin_ctxt + u4_ctx_Inc;
  555|       |
  556|   655k|        DECODE_ONE_BIN_MACRO(ps_bin_ctxt, u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  217|   655k|                     p_DecBitStream_arg,u4_symbol)                                           \
  |  |  218|   655k|{                                                                                       \
  |  |  219|   655k|    bin_ctxt_model_t *p_binCtxt_m = (bin_ctxt_model_t *) p_binCtxt_arg;                           \
  |  |  220|   655k|    dec_bit_stream_t *p_DecBitStream_m = (dec_bit_stream_t *) p_DecBitStream_arg;                 \
  |  |  221|   655k|    const UWORD32 *pu4_table_m = (const UWORD32 *) pu4_table_arg;                         \
  |  |  222|   655k|                                                                                        \
  |  |  223|   655k|    UWORD32 u4_quantCodeIntRange_m,u4_codeIntRangeLPS_m;                                    \
  |  |  224|   655k|    UWORD32 u1_mps_state_m;                                                               \
  |  |  225|   655k|    UWORD32 table_lookup_m;                                                               \
  |  |  226|   655k|    UWORD32 u4_clz_m;                                                                     \
  |  |  227|   655k|                                                                                        \
  |  |  228|   655k|    u1_mps_state_m = (p_binCtxt_m->u1_mps_state);                                           \
  |  |  229|   655k|    u4_clz_m = CLZ(u4_code_int_range);                                                  \
  |  |  230|   655k|    u4_quantCodeIntRange_m = u4_code_int_range << u4_clz_m;                                   \
  |  |  231|   655k|    u4_quantCodeIntRange_m = (u4_quantCodeIntRange_m >> 29) & 0x3;                          \
  |  |  232|   655k|    table_lookup_m = pu4_table_m[(u1_mps_state_m << 2)+u4_quantCodeIntRange_m];                 \
  |  |  233|   655k|    u4_codeIntRangeLPS_m = table_lookup_m & 0xff;                                           \
  |  |  234|   655k|                                                                                        \
  |  |  235|   655k|    u4_codeIntRangeLPS_m = u4_codeIntRangeLPS_m << (23 - u4_clz_m);                           \
  |  |  236|   655k|    u4_code_int_range = u4_code_int_range - u4_codeIntRangeLPS_m;                             \
  |  |  237|   655k|    u4_symbol = ((u1_mps_state_m>> 6) & 0x1);                                             \
  |  |  238|   655k|    /*if mps*/                                                                          \
  |  |  239|   655k|    u1_mps_state_m = (table_lookup_m >> 8) & 0x7F;                                          \
  |  |  240|   655k|    if(u4_code_int_val_ofst >= u4_code_int_range)                                          \
  |  |  ------------------
  |  |  |  Branch (240:8): [True: 94.5k, False: 561k]
  |  |  ------------------
  |  |  241|   655k|  {                                                                                     \
  |  |  242|  94.5k|                                                                                        \
  |  |  243|  94.5k|    u4_symbol = 1 - u4_symbol;                                                          \
  |  |  244|  94.5k|    u4_code_int_val_ofst -= u4_code_int_range;                                             \
  |  |  245|  94.5k|    u4_code_int_range = u4_codeIntRangeLPS_m;                                               \
  |  |  246|  94.5k|    u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                         \
  |  |  247|  94.5k|  }                                                                                     \
  |  |  248|   655k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)                                        \
  |  |  ------------------
  |  |  |  |  113|  1.31M|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  |  |  ------------------
  |  |  |  Branch (248:8): [True: 4.44k, False: 651k]
  |  |  ------------------
  |  |  249|   655k|    {                                                                                   \
  |  |  250|  4.44k|        UWORD32 *pu4_buffer,u4_offset;                                                  \
  |  |  251|  4.44k|        UWORD32 read_bits,u4_clz_m  ;                                                     \
  |  |  252|  4.44k|                                                                                        \
  |  |  253|  4.44k|        pu4_buffer = p_DecBitStream_m->pu4_buffer;                                         \
  |  |  254|  4.44k|        u4_offset = p_DecBitStream_m->u4_ofst;                                          \
  |  |  255|  4.44k|        u4_clz_m = CLZ(u4_code_int_range);                                              \
  |  |  256|  4.44k|        NEXTBITS(read_bits,(u4_offset+23),pu4_buffer,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  4.44k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  4.44k|{                                                                           \
  |  |  |  |  139|  4.44k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  4.44k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  4.44k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  4.44k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  4.44k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 4.19k, False: 248]
  |  |  |  |  ------------------
  |  |  |  |  144|  4.44k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  4.19k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  4.44k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  4.44k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  4.44k|}
  |  |  ------------------
  |  |  257|  4.44k|        FLUSHBITS(u4_offset,(u4_clz_m))                                                   \
  |  |  ------------------
  |  |  |  |  193|  4.44k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  4.44k|{                                                                           \
  |  |  |  |  195|  4.44k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  4.44k|}
  |  |  ------------------
  |  |  258|  4.44k|        u4_code_int_range = u4_code_int_range << u4_clz_m;                                    \
  |  |  259|  4.44k|        u4_code_int_val_ofst= (u4_code_int_val_ofst << u4_clz_m) | read_bits;               \
  |  |  260|  4.44k|                                                                                        \
  |  |  261|  4.44k|                                                                                        \
  |  |  262|  4.44k|        p_DecBitStream_m->u4_ofst = u4_offset;                                          \
  |  |  263|  4.44k|    }                                                                                   \
  |  |  264|   655k|    p_binCtxt_m->u1_mps_state = u1_mps_state_m;                                             \
  |  |  265|   655k|}
  ------------------
  557|   655k|                             pu4_table, ps_bitstrm, u4_symbol)
  558|       |
  559|   655k|        INC_BIN_COUNT(ps_cab_env);INC_DECISION_BINS(ps_cab_env);
  560|       |
  561|   655k|        u4_value++;
  562|       |
  563|   655k|    }
  564|   655k|    while(u4_symbol && u4_value < 4);
  ------------------
  |  Branch (564:11): [True: 196k, False: 459k]
  |  Branch (564:24): [True: 189k, False: 7.19k]
  ------------------
  565|       |
  566|   466k|    if(u4_symbol && (u4_value < u1_max_bins))
  ------------------
  |  Branch (566:8): [True: 7.19k, False: 459k]
  |  Branch (566:21): [True: 7.19k, False: 0]
  ------------------
  567|  7.19k|    {
  568|       |
  569|  7.19k|        u4_ctx_Inc = u4_ctx_inc & 0xf;
  570|       |
  571|  7.19k|        ps_bin_ctxt = ps_src_bin_ctxt + u4_ctx_Inc;
  572|       |
  573|  7.19k|        do
  574|  57.6k|        {
  575|       |
  576|  57.6k|            DECODE_ONE_BIN_MACRO(ps_bin_ctxt, u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  217|  57.6k|                     p_DecBitStream_arg,u4_symbol)                                           \
  |  |  218|  57.6k|{                                                                                       \
  |  |  219|  57.6k|    bin_ctxt_model_t *p_binCtxt_m = (bin_ctxt_model_t *) p_binCtxt_arg;                           \
  |  |  220|  57.6k|    dec_bit_stream_t *p_DecBitStream_m = (dec_bit_stream_t *) p_DecBitStream_arg;                 \
  |  |  221|  57.6k|    const UWORD32 *pu4_table_m = (const UWORD32 *) pu4_table_arg;                         \
  |  |  222|  57.6k|                                                                                        \
  |  |  223|  57.6k|    UWORD32 u4_quantCodeIntRange_m,u4_codeIntRangeLPS_m;                                    \
  |  |  224|  57.6k|    UWORD32 u1_mps_state_m;                                                               \
  |  |  225|  57.6k|    UWORD32 table_lookup_m;                                                               \
  |  |  226|  57.6k|    UWORD32 u4_clz_m;                                                                     \
  |  |  227|  57.6k|                                                                                        \
  |  |  228|  57.6k|    u1_mps_state_m = (p_binCtxt_m->u1_mps_state);                                           \
  |  |  229|  57.6k|    u4_clz_m = CLZ(u4_code_int_range);                                                  \
  |  |  230|  57.6k|    u4_quantCodeIntRange_m = u4_code_int_range << u4_clz_m;                                   \
  |  |  231|  57.6k|    u4_quantCodeIntRange_m = (u4_quantCodeIntRange_m >> 29) & 0x3;                          \
  |  |  232|  57.6k|    table_lookup_m = pu4_table_m[(u1_mps_state_m << 2)+u4_quantCodeIntRange_m];                 \
  |  |  233|  57.6k|    u4_codeIntRangeLPS_m = table_lookup_m & 0xff;                                           \
  |  |  234|  57.6k|                                                                                        \
  |  |  235|  57.6k|    u4_codeIntRangeLPS_m = u4_codeIntRangeLPS_m << (23 - u4_clz_m);                           \
  |  |  236|  57.6k|    u4_code_int_range = u4_code_int_range - u4_codeIntRangeLPS_m;                             \
  |  |  237|  57.6k|    u4_symbol = ((u1_mps_state_m>> 6) & 0x1);                                             \
  |  |  238|  57.6k|    /*if mps*/                                                                          \
  |  |  239|  57.6k|    u1_mps_state_m = (table_lookup_m >> 8) & 0x7F;                                          \
  |  |  240|  57.6k|    if(u4_code_int_val_ofst >= u4_code_int_range)                                          \
  |  |  ------------------
  |  |  |  Branch (240:8): [True: 5.96k, False: 51.6k]
  |  |  ------------------
  |  |  241|  57.6k|  {                                                                                     \
  |  |  242|  5.96k|                                                                                        \
  |  |  243|  5.96k|    u4_symbol = 1 - u4_symbol;                                                          \
  |  |  244|  5.96k|    u4_code_int_val_ofst -= u4_code_int_range;                                             \
  |  |  245|  5.96k|    u4_code_int_range = u4_codeIntRangeLPS_m;                                               \
  |  |  246|  5.96k|    u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                         \
  |  |  247|  5.96k|  }                                                                                     \
  |  |  248|  57.6k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)                                        \
  |  |  ------------------
  |  |  |  |  113|   115k|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  |  |  ------------------
  |  |  |  Branch (248:8): [True: 1.04k, False: 56.5k]
  |  |  ------------------
  |  |  249|  57.6k|    {                                                                                   \
  |  |  250|  1.04k|        UWORD32 *pu4_buffer,u4_offset;                                                  \
  |  |  251|  1.04k|        UWORD32 read_bits,u4_clz_m  ;                                                     \
  |  |  252|  1.04k|                                                                                        \
  |  |  253|  1.04k|        pu4_buffer = p_DecBitStream_m->pu4_buffer;                                         \
  |  |  254|  1.04k|        u4_offset = p_DecBitStream_m->u4_ofst;                                          \
  |  |  255|  1.04k|        u4_clz_m = CLZ(u4_code_int_range);                                              \
  |  |  256|  1.04k|        NEXTBITS(read_bits,(u4_offset+23),pu4_buffer,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  1.04k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  1.04k|{                                                                           \
  |  |  |  |  139|  1.04k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  1.04k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  1.04k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  1.04k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  1.04k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 665, False: 379]
  |  |  |  |  ------------------
  |  |  |  |  144|  1.04k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    665|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  1.04k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  1.04k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  1.04k|}
  |  |  ------------------
  |  |  257|  1.04k|        FLUSHBITS(u4_offset,(u4_clz_m))                                                   \
  |  |  ------------------
  |  |  |  |  193|  1.04k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  1.04k|{                                                                           \
  |  |  |  |  195|  1.04k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  1.04k|}
  |  |  ------------------
  |  |  258|  1.04k|        u4_code_int_range = u4_code_int_range << u4_clz_m;                                    \
  |  |  259|  1.04k|        u4_code_int_val_ofst= (u4_code_int_val_ofst << u4_clz_m) | read_bits;               \
  |  |  260|  1.04k|                                                                                        \
  |  |  261|  1.04k|                                                                                        \
  |  |  262|  1.04k|        p_DecBitStream_m->u4_ofst = u4_offset;                                          \
  |  |  263|  1.04k|    }                                                                                   \
  |  |  264|  57.6k|    p_binCtxt_m->u1_mps_state = u1_mps_state_m;                                             \
  |  |  265|  57.6k|}
  ------------------
  577|  57.6k|                                 pu4_table, ps_bitstrm, u4_symbol)
  578|       |
  579|  57.6k|            INC_BIN_COUNT(ps_cab_env);INC_DECISION_BINS(ps_cab_env);
  580|       |
  581|  57.6k|            u4_value++;
  582|       |
  583|  57.6k|        }
  584|  57.6k|        while(u4_symbol && (u4_value < u1_max_bins));
  ------------------
  |  Branch (584:15): [True: 52.2k, False: 5.34k]
  |  Branch (584:28): [True: 50.4k, False: 1.85k]
  ------------------
  585|       |
  586|  7.19k|    }
  587|       |
  588|   466k|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  589|   466k|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  590|       |
  591|   466k|    u4_value = u4_value - 1 + u4_symbol;
  592|       |
  593|   466k|    return (u4_value);
  594|       |
  595|   466k|}
ih264d_decode_bypass_bins_unary:
  622|   171k|{
  623|   171k|    UWORD32 u4_value;
  624|   171k|    UWORD32 u4_bin;
  625|   171k|    UWORD32 u4_code_int_val_ofst, u4_code_int_range;
  626|       |
  627|   171k|    UWORD32 u1_max_bins;
  628|       |
  629|   171k|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  630|   171k|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  631|       |
  632|   171k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_9)
  ------------------
  |  |  114|   171k|#define ONE_RIGHT_SHIFTED_BY_9    1<<9
  ------------------
  |  Branch (632:8): [True: 2.67k, False: 168k]
  ------------------
  633|  2.67k|    {
  634|  2.67k|        UWORD32 *pu4_buffer, u4_offset;
  635|       |
  636|  2.67k|        pu4_buffer = ps_bitstrm->pu4_buffer;
  637|  2.67k|        u4_offset = ps_bitstrm->u4_ofst;
  638|       |
  639|  2.67k|        RENORM_RANGE_OFFSET(u4_code_int_range, u4_code_int_val_ofst, u4_offset,
  ------------------
  |  |  170|  2.67k|  {                                                                                         \
  |  |  171|  2.67k|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|  2.67k|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|  2.67k|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  2.67k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  2.67k|{                                                                           \
  |  |  |  |  139|  2.67k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  2.67k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  2.67k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  2.67k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  2.67k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 2.52k, False: 153]
  |  |  |  |  ------------------
  |  |  |  |  144|  2.67k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.52k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  2.67k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.67k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  2.67k|}
  |  |  ------------------
  |  |  174|  2.67k|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|  2.67k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  2.67k|{                                                                           \
  |  |  |  |  195|  2.67k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  2.67k|}
  |  |  ------------------
  |  |  175|  2.67k|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|  2.67k|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|  2.67k|  }
  ------------------
  640|  2.67k|                            pu4_buffer)
  641|  2.67k|        ps_bitstrm->u4_ofst = u4_offset;
  642|  2.67k|    }
  643|       |
  644|       |    /*as it is called only form mvd*/
  645|   171k|    u1_max_bins = 32;
  646|   171k|    u4_value = 0;
  647|       |
  648|   171k|    do
  649|   218k|    {
  650|   218k|        u4_value++;
  651|       |
  652|   218k|        u4_code_int_range = u4_code_int_range >> 1;
  653|   218k|        if(u4_code_int_val_ofst >= u4_code_int_range)
  ------------------
  |  Branch (653:12): [True: 46.9k, False: 171k]
  ------------------
  654|  46.9k|        {
  655|       |            /* S=1 */
  656|  46.9k|            u4_bin = 1;
  657|  46.9k|            u4_code_int_val_ofst -= u4_code_int_range;
  658|  46.9k|        }
  659|   171k|        else
  660|   171k|        {
  661|       |            /* S=0 */
  662|   171k|            u4_bin = 0;
  663|   171k|        }
  664|       |
  665|   218k|        INC_BIN_COUNT(ps_cab_env);INC_BYPASS_BINS(ps_cab_env);
  666|       |
  667|   218k|        if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_9)
  ------------------
  |  |  114|   218k|#define ONE_RIGHT_SHIFTED_BY_9    1<<9
  ------------------
  |  Branch (667:12): [True: 12.9k, False: 205k]
  ------------------
  668|  12.9k|        {
  669|  12.9k|            UWORD32 *pu4_buffer, u4_offset;
  670|       |
  671|  12.9k|            pu4_buffer = ps_bitstrm->pu4_buffer;
  672|  12.9k|            u4_offset = ps_bitstrm->u4_ofst;
  673|       |
  674|  12.9k|            RENORM_RANGE_OFFSET(u4_code_int_range, u4_code_int_val_ofst, u4_offset,
  ------------------
  |  |  170|  12.9k|  {                                                                                         \
  |  |  171|  12.9k|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|  12.9k|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|  12.9k|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  12.9k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  12.9k|{                                                                           \
  |  |  |  |  139|  12.9k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  12.9k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  12.9k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  12.9k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  12.9k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 12.1k, False: 886]
  |  |  |  |  ------------------
  |  |  |  |  144|  12.9k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  12.1k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  12.9k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  12.9k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  12.9k|}
  |  |  ------------------
  |  |  174|  12.9k|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|  12.9k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  12.9k|{                                                                           \
  |  |  |  |  195|  12.9k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  12.9k|}
  |  |  ------------------
  |  |  175|  12.9k|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|  12.9k|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|  12.9k|  }
  ------------------
  675|  12.9k|                                pu4_buffer)
  676|       |
  677|  12.9k|            ps_bitstrm->u4_ofst = u4_offset;
  678|  12.9k|        }
  679|       |
  680|   218k|    }
  681|   218k|    while(u4_bin && (u4_value < u1_max_bins));
  ------------------
  |  Branch (681:11): [True: 46.9k, False: 171k]
  |  Branch (681:21): [True: 46.8k, False: 49]
  ------------------
  682|       |
  683|   171k|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  684|   171k|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  685|   171k|    u4_value = (u4_value - 1 + u4_bin);
  686|       |
  687|   171k|return (u4_value);
  688|   171k|}
ih264d_decode_bypass_bins:
  716|   171k|{
  717|   171k|    UWORD32 u4_bins;
  718|   171k|    UWORD32 u4_bin;
  719|   171k|    UWORD32 u4_code_int_val_ofst, u4_code_int_range;
  720|       |
  721|   171k|    u4_bins = 0;
  722|   171k|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  723|   171k|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  724|       |
  725|   171k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_9)
  ------------------
  |  |  114|   171k|#define ONE_RIGHT_SHIFTED_BY_9    1<<9
  ------------------
  |  Branch (725:8): [True: 0, False: 171k]
  ------------------
  726|      0|    {
  727|      0|        UWORD32 *pu4_buffer, u4_offset;
  728|       |
  729|      0|        pu4_buffer = ps_bitstrm->pu4_buffer;
  730|      0|        u4_offset = ps_bitstrm->u4_ofst;
  731|       |
  732|      0|        RENORM_RANGE_OFFSET(u4_code_int_range, u4_code_int_val_ofst, u4_offset,
  ------------------
  |  |  170|      0|  {                                                                                         \
  |  |  171|      0|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|      0|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|      0|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|      0|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|      0|{                                                                           \
  |  |  |  |  139|      0|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|      0|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|      0|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|      0|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|      0|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  144|      0|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|      0|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|      0|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|      0|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|      0|}
  |  |  ------------------
  |  |  174|      0|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|      0|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|      0|{                                                                           \
  |  |  |  |  195|      0|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|      0|}
  |  |  ------------------
  |  |  175|      0|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|      0|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|      0|  }
  ------------------
  733|      0|                            pu4_buffer)
  734|      0|        ps_bitstrm->u4_ofst = u4_offset;
  735|      0|    }
  736|       |
  737|   171k|    do
  738|   560k|    {
  739|       |
  740|   560k|        u4_code_int_range = u4_code_int_range >> 1;
  741|       |
  742|   560k|        if(u4_code_int_val_ofst >= u4_code_int_range)
  ------------------
  |  Branch (742:12): [True: 93.5k, False: 466k]
  ------------------
  743|  93.5k|        {
  744|       |            /* S=1 */
  745|  93.5k|            u4_bin = 1;
  746|  93.5k|            u4_code_int_val_ofst -= u4_code_int_range;
  747|  93.5k|        }
  748|   466k|        else
  749|   466k|        {
  750|       |            /* S=0 */
  751|   466k|            u4_bin = 0;
  752|   466k|        }
  753|       |
  754|   560k|        INC_BIN_COUNT(ps_cab_env);INC_BYPASS_BINS(ps_cab_env);
  755|       |
  756|   560k|        u4_bins = ((u4_bins << 1) | u4_bin);
  757|   560k|        u1_max_bins--;
  758|       |
  759|   560k|        if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_9)
  ------------------
  |  |  114|   560k|#define ONE_RIGHT_SHIFTED_BY_9    1<<9
  ------------------
  |  Branch (759:12): [True: 17.9k, False: 542k]
  ------------------
  760|  17.9k|        {
  761|  17.9k|            UWORD32 *pu4_buffer, u4_offset;
  762|       |
  763|  17.9k|            pu4_buffer = ps_bitstrm->pu4_buffer;
  764|  17.9k|            u4_offset = ps_bitstrm->u4_ofst;
  765|       |
  766|  17.9k|            RENORM_RANGE_OFFSET(u4_code_int_range, u4_code_int_val_ofst, u4_offset,
  ------------------
  |  |  170|  17.9k|  {                                                                                         \
  |  |  171|  17.9k|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|  17.9k|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|  17.9k|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  17.9k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  17.9k|{                                                                           \
  |  |  |  |  139|  17.9k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  17.9k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  17.9k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  17.9k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  17.9k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 17.0k, False: 868]
  |  |  |  |  ------------------
  |  |  |  |  144|  17.9k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  17.0k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  17.9k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  17.9k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  17.9k|}
  |  |  ------------------
  |  |  174|  17.9k|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|  17.9k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  17.9k|{                                                                           \
  |  |  |  |  195|  17.9k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  17.9k|}
  |  |  ------------------
  |  |  175|  17.9k|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|  17.9k|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|  17.9k|  }
  ------------------
  767|  17.9k|                                pu4_buffer)
  768|  17.9k|            ps_bitstrm->u4_ofst = u4_offset;
  769|  17.9k|        }
  770|       |
  771|   560k|    }
  772|   560k|    while(u1_max_bins);
  ------------------
  |  Branch (772:11): [True: 389k, False: 171k]
  ------------------
  773|       |
  774|   171k|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  775|   171k|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  776|       |
  777|   171k|    return (u4_bins);
  778|   171k|}

ih264d_update_csbp_8x8:
   32|   343k|{
   33|   343k|    UWORD16 u2_mod_csbp;
   34|       |
   35|   343k|    u2_mod_csbp = u2_luma_csbp;
   36|       |
   37|   343k|    if(u2_mod_csbp & 0x0033)
  ------------------
  |  Branch (37:8): [True: 47.4k, False: 296k]
  ------------------
   38|  47.4k|    {
   39|  47.4k|        u2_mod_csbp |= 0x0033;
   40|  47.4k|    }
   41|       |
   42|   343k|    if(u2_mod_csbp & 0x00CC)
  ------------------
  |  Branch (42:8): [True: 49.8k, False: 293k]
  ------------------
   43|  49.8k|    {
   44|  49.8k|        u2_mod_csbp |= 0x00CC;
   45|  49.8k|    }
   46|       |
   47|   343k|    if(u2_mod_csbp & 0x3300)
  ------------------
  |  Branch (47:8): [True: 53.1k, False: 290k]
  ------------------
   48|  53.1k|    {
   49|  53.1k|        u2_mod_csbp |= 0x3300;
   50|  53.1k|    }
   51|       |
   52|   343k|    if(u2_mod_csbp & 0xCC00)
  ------------------
  |  Branch (52:8): [True: 51.2k, False: 292k]
  ------------------
   53|  51.2k|    {
   54|  51.2k|        u2_mod_csbp |= 0xCC00;
   55|  51.2k|    }
   56|       |
   57|   343k|    return u2_mod_csbp;
   58|   343k|}
ih264d_fill_bs2_horz_vert:
  115|  6.45M|{
  116|       |    /*************************************************************************/
  117|       |    /*u4_nbr_horz_csbp=11C|10C|9C|8C|7C|6C|5C|4C|3C|2C|1C|0C|15T|14T|13T|12T */
  118|       |    /*************************************************************************/
  119|  6.45M|    UWORD32 u4_nbr_horz_csbp = (u4_cur_mb_csbp << 4) | (u4_top_mb_csbp >> 12);
  120|  6.45M|    UWORD32 u4_horz_bs2_dec = u4_cur_mb_csbp | u4_nbr_horz_csbp;
  121|       |
  122|       |    /*************************************************************************/
  123|       |    /*u4_left_mb_masked_csbp = 15L|0|0|0|11L|0|0|0|7L|0|0|0|3L|0|0|0         */
  124|       |    /*************************************************************************/
  125|  6.45M|    UWORD32 u4_left_mb_masked_csbp = u4_left_mb_csbp & CSBP_RIGHT_BLOCK_MASK;
  ------------------
  |  |  108|  6.45M|#define CSBP_RIGHT_BLOCK_MASK 0x8888
  ------------------
  126|       |
  127|       |    /*************************************************************************/
  128|       |    /*u4_cur_mb_masked_csbp =14C|13C|12C|x|10C|9C|8C|x|6C|5C|4C|x|2C|1C|0C|x */
  129|       |    /*************************************************************************/
  130|  6.45M|    UWORD32 u4_cur_mb_masked_csbp = (u4_cur_mb_csbp << 1)
  131|  6.45M|                    & (~CSBP_LEFT_BLOCK_MASK);
  ------------------
  |  |  107|  6.45M|#define CSBP_LEFT_BLOCK_MASK 0x1111
  ------------------
  132|       |
  133|       |    /*************************************************************************/
  134|       |    /*u4_nbr_vert_csbp=14C|13C|12C|15L|10C|9C|8C|11L|6C|5C|4C|7L|2C|1C|0C|3L */
  135|       |    /*************************************************************************/
  136|  6.45M|    UWORD32 u4_nbr_vert_csbp = (u4_cur_mb_masked_csbp)
  137|  6.45M|                    | (u4_left_mb_masked_csbp >> 3);
  138|       |
  139|  6.45M|    UWORD32 u4_vert_bs2_dec = u4_cur_mb_csbp | u4_nbr_vert_csbp;
  140|       |
  141|  6.45M|    UWORD32 u4_reordered_vert_bs2_dec, u4_temp;
  142|       |
  143|  6.45M|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  6.45M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  144|       |
  145|       |    /*************************************************************************/
  146|       |    /* Fill horz edges (0,1,2,3) boundary strengths 2 using look up table    */
  147|       |    /*************************************************************************/
  148|  6.45M|    pu4_bs[0] = pu4_packed_bs2[u4_horz_bs2_dec & 0xF];
  149|  6.45M|    pu4_bs[1] = pu4_packed_bs2[(u4_horz_bs2_dec >> 4) & 0xF];
  150|  6.45M|    pu4_bs[2] = pu4_packed_bs2[(u4_horz_bs2_dec >> 8) & 0xF];
  151|  6.45M|    pu4_bs[3] = pu4_packed_bs2[(u4_horz_bs2_dec >> 12) & 0xF];
  152|       |
  153|       |    /*************************************************************************/
  154|       |    /* Do 4x4 tranpose of u4_vert_bs2_dec by using look up table for reorder */
  155|       |    /*************************************************************************/
  156|  6.45M|    u4_reordered_vert_bs2_dec = pu2_4x4_v2h_reorder[u4_vert_bs2_dec & 0xF];
  157|  6.45M|    u4_temp = pu2_4x4_v2h_reorder[(u4_vert_bs2_dec >> 4) & 0xF];
  158|  6.45M|    u4_reordered_vert_bs2_dec |= (u4_temp << 1);
  159|  6.45M|    u4_temp = pu2_4x4_v2h_reorder[(u4_vert_bs2_dec >> 8) & 0xF];
  160|  6.45M|    u4_reordered_vert_bs2_dec |= (u4_temp << 2);
  161|  6.45M|    u4_temp = pu2_4x4_v2h_reorder[(u4_vert_bs2_dec >> 12) & 0xF];
  162|  6.45M|    u4_reordered_vert_bs2_dec |= (u4_temp << 3);
  163|       |
  164|       |    /*************************************************************************/
  165|       |    /* Fill vert edges (4,5,6,7) boundary strengths 2 using look up table    */
  166|       |    /*************************************************************************/
  167|  6.45M|    pu4_bs[4] = pu4_packed_bs2[u4_reordered_vert_bs2_dec & 0xF];
  168|  6.45M|    pu4_bs[5] = pu4_packed_bs2[(u4_reordered_vert_bs2_dec >> 4) & 0xF];
  169|  6.45M|    pu4_bs[6] = pu4_packed_bs2[(u4_reordered_vert_bs2_dec >> 8) & 0xF];
  170|  6.45M|    pu4_bs[7] = pu4_packed_bs2[(u4_reordered_vert_bs2_dec >> 12) & 0xF];
  171|  6.45M|}
ih264d_fill_bs1_16x16mb_pslice:
  206|  3.00M|{
  207|  3.00M|    WORD16 i2_q_mv0, i2_q_mv1;
  208|  3.00M|    WORD16 i2_p_mv0, i2_p_mv1;
  209|  3.00M|    void *pv_cur_pic_addr0, *pv_cur_pic_addr1;
  210|  3.00M|    void *pv_nbr_pic_addr0, *pv_nbr_pic_addr1;
  211|  3.00M|    void **ppv_map_ref_idx_to_poc_l0; //,*ppv_map_ref_idx_to_poc_l1;
  212|  3.00M|    UWORD32 i;
  213|  3.00M|    UWORD32 u4_bs_horz = pu4_bs_table[0];
  214|  3.00M|    UWORD32 u4_bs_vert = pu4_bs_table[4];
  215|       |
  216|  3.00M|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  3.00M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  217|       |
  218|  3.00M|    ppv_map_ref_idx_to_poc_l0 = ppv_map_ref_idx_to_poc;
  219|       |
  220|  3.00M|    i2_q_mv0 = ps_cur_mv_pred->i2_mv[0];
  221|  3.00M|    i2_q_mv1 = ps_cur_mv_pred->i2_mv[1];
  222|  3.00M|    pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[ps_cur_mv_pred->i1_ref_frame[0]];
  223|  3.00M|    pv_cur_pic_addr1 = 0;
  224|       |
  225|       |    /*********************************/
  226|       |    /* Computing Bs for the top edge */
  227|       |    /*********************************/
  228|  15.0M|    for(i = 0; i < 4; i++, ps_top_mv_pred++)
  ------------------
  |  Branch (228:16): [True: 12.0M, False: 3.00M]
  ------------------
  229|  12.0M|    {
  230|  12.0M|        UWORD32 u4_idx = 24 - (i << 3);
  231|       |
  232|       |        /*********************************/
  233|       |        /* check if Bs is already set    */
  234|       |        /*********************************/
  235|  12.0M|        if(!((u4_bs_horz >> u4_idx) & 0xf))
  ------------------
  |  Branch (235:12): [True: 11.8M, False: 193k]
  ------------------
  236|  11.8M|        {
  237|       |            /************************************************************/
  238|       |            /* If Bs is not set, use left edge and current edge mvs and */
  239|       |            /* reference pictures addresses to evaluate Bs==1           */
  240|       |            /************************************************************/
  241|  11.8M|            UWORD32 u4_bs_temp1;
  242|  11.8M|            UWORD32 u4_bs;
  243|       |
  244|       |            /*********************************************************/
  245|       |            /* If any motion vector component differs by more than 1 */
  246|       |            /* integer pel or if reference pictures are different Bs */
  247|       |            /* is set to 1. Note that this condition shall be met for*/
  248|       |            /* both (fwd-fwd,bwd-bwd) and (fwd-bwd,bwd-fwd) direction*/
  249|       |            /*********************************************************/
  250|  11.8M|            i2_p_mv0 = ps_top_mv_pred->i2_mv[0];
  251|  11.8M|            i2_p_mv1 = ps_top_mv_pred->i2_mv[1];
  252|  11.8M|            pv_nbr_pic_addr0 = u4_pic_addrress[i & 2];
  253|  11.8M|            pv_nbr_pic_addr1 = u4_pic_addrress[1 + (i & 2)];
  254|       |
  255|  11.8M|            u4_bs_temp1 = ((ABS((i2_p_mv0 - i2_q_mv0)) >= 4) ||
  ------------------
  |  |  100|  11.8M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 65.6k, False: 11.7M]
  |  |  ------------------
  ------------------
  |  Branch (255:28): [True: 51.1k, False: 11.7M]
  ------------------
  256|  11.7M|                           (ABS((i2_p_mv1 - i2_q_mv1)) >= i4_ver_mvlimit));
  ------------------
  |  |  100|  11.7M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 44.6k, False: 11.7M]
  |  |  ------------------
  ------------------
  |  Branch (256:28): [True: 30.1k, False: 11.7M]
  ------------------
  257|       |
  258|  11.8M|            u4_bs = ((pv_cur_pic_addr0 != pv_nbr_pic_addr0)
  ------------------
  |  Branch (258:22): [True: 488k, False: 11.3M]
  ------------------
  259|  11.3M|                            || (pv_cur_pic_addr1 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (259:32): [True: 5.53k, False: 11.3M]
  ------------------
  260|  11.3M|                            || u4_bs_temp1);
  ------------------
  |  Branch (260:32): [True: 71.6k, False: 11.2M]
  ------------------
  261|       |
  262|  11.8M|            u4_bs_horz |= (u4_bs << u4_idx);
  263|  11.8M|        }
  264|  12.0M|    }
  265|  3.00M|    pu4_bs_table[0] = u4_bs_horz;
  266|       |
  267|       |    /***********************************/
  268|       |    /* Computing Bs for the left edge  */
  269|       |    /***********************************/
  270|  15.0M|    for(i = 0; i < 4; i++, ps_leftmost_mv_pred += 4)
  ------------------
  |  Branch (270:16): [True: 12.0M, False: 3.00M]
  ------------------
  271|  12.0M|    {
  272|  12.0M|        UWORD32 u4_idx = 24 - (i << 3);
  273|       |
  274|       |        /*********************************/
  275|       |        /* check if Bs is already set    */
  276|       |        /*********************************/
  277|  12.0M|        if(!((u4_bs_vert >> u4_idx) & 0xf))
  ------------------
  |  Branch (277:12): [True: 11.9M, False: 91.3k]
  ------------------
  278|  11.9M|        {
  279|       |            /****************************************************/
  280|       |            /* If Bs is not set, evalaute conditions for Bs=1   */
  281|       |            /****************************************************/
  282|  11.9M|            UWORD32 u4_bs_temp1;
  283|  11.9M|            UWORD32 u4_bs;
  284|       |            /*********************************************************/
  285|       |            /* If any motion vector component differs by more than 1 */
  286|       |            /* integer pel or if reference pictures are different Bs */
  287|       |            /* is set to 1. Note that this condition shall be met for*/
  288|       |            /* both (fwd-fwd,bwd-bwd) and (fwd-bwd,bwd-fwd) direction*/
  289|       |            /*********************************************************/
  290|       |
  291|  11.9M|            i2_p_mv0 = ps_leftmost_mv_pred->i2_mv[0];
  292|  11.9M|            i2_p_mv1 = ps_leftmost_mv_pred->i2_mv[1];
  293|  11.9M|            pv_nbr_pic_addr0 = ps_left_addr->u4_add[i & 2];
  294|  11.9M|            pv_nbr_pic_addr1 = ps_left_addr->u4_add[1 + (i & 2)];
  295|       |
  296|  11.9M|            u4_bs_temp1 =
  297|  11.9M|                            ((ABS((i2_p_mv0 - i2_q_mv0))
  ------------------
  |  |  100|  11.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 41.0k, False: 11.8M]
  |  |  ------------------
  ------------------
  298|  11.9M|                                            >= 4)
  299|  11.9M|                                            | (ABS((i2_p_mv1 - i2_q_mv1))
  ------------------
  |  |  100|  11.9M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 40.7k, False: 11.8M]
  |  |  ------------------
  ------------------
  300|  11.9M|                                                            >= i4_ver_mvlimit));
  301|       |
  302|  11.9M|            u4_bs = ((pv_cur_pic_addr0 != pv_nbr_pic_addr0)
  ------------------
  |  Branch (302:22): [True: 45.6k, False: 11.8M]
  ------------------
  303|  11.8M|                            || (pv_cur_pic_addr1 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (303:32): [True: 2.03k, False: 11.8M]
  ------------------
  304|  11.8M|                            || u4_bs_temp1);
  ------------------
  |  Branch (304:32): [True: 56.6k, False: 11.8M]
  ------------------
  305|       |
  306|  11.9M|            u4_bs_vert |= (u4_bs << u4_idx);
  307|  11.9M|        }
  308|  12.0M|    }
  309|  3.00M|    pu4_bs_table[4] = u4_bs_vert;
  310|       |
  311|  3.00M|    return;
  312|  3.00M|}
ih264d_fill_bs1_non16x16mb_pslice:
  347|  70.6k|{
  348|  70.6k|    UWORD32 edge;
  349|  70.6k|    void **ppv_map_ref_idx_to_poc_l0; //,*ppv_map_ref_idx_to_poc_l1;
  350|       |
  351|  70.6k|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  70.6k|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  352|       |
  353|  70.6k|    ppv_map_ref_idx_to_poc_l0 = ppv_map_ref_idx_to_poc;
  354|       |
  355|       |
  356|   353k|    for(edge = 0; edge < 4; edge++, ps_top_mv_pred = ps_cur_mv_pred - 4)
  ------------------
  |  Branch (356:19): [True: 282k, False: 70.6k]
  ------------------
  357|   282k|    {
  358|       |        /*********************************************************************/
  359|       |        /* Each iteration of this loop fills the four BS values of one HORIZ */
  360|       |        /* edge and one BS value for each of the four VERT edges.            */
  361|       |        /*********************************************************************/
  362|   282k|        WORD32 i;
  363|   282k|        UWORD32 u4_vert_idx = 24 - (edge << 3);
  364|   282k|        UWORD32 u4_bs_horz = pu4_bs_table[edge];
  365|   282k|        mv_pred_t *ps_left_mv_pred = ps_leftmost_mv_pred + (edge << 2);
  366|       |
  367|  1.41M|        for(i = 0; i < 4; i++, ps_top_mv_pred++, ps_cur_mv_pred++)
  ------------------
  |  Branch (367:20): [True: 1.12M, False: 282k]
  ------------------
  368|  1.12M|        {
  369|  1.12M|            WORD16 i2_cur_mv0, i2_cur_mv1;
  370|  1.12M|            WORD8 i1_cur_ref0;
  371|  1.12M|            void *pv_cur_pic_addr0, *pv_cur_pic_addr1 = 0;
  372|  1.12M|            void *pv_nbr_pic_addr0, *pv_nbr_pic_addr1;
  373|       |
  374|       |            /******************************************************/
  375|       |            /* Each iteration of this inner loop computes a HORIZ */
  376|       |            /* and a VERT BS value for a 4x4 block                */
  377|       |            /******************************************************/
  378|  1.12M|            UWORD32 u4_bs_vert = (pu4_bs_table[i + 4] >> u4_vert_idx) & 0xf;
  379|  1.12M|            UWORD32 u4_horz_idx = 24 - (i << 3);
  380|       |
  381|       |            /*****************************************************/
  382|       |            /* check if vert Bs for this block is already set    */
  383|       |            /*****************************************************/
  384|  1.12M|            if(!u4_bs_vert)
  ------------------
  |  Branch (384:16): [True: 1.03M, False: 90.9k]
  ------------------
  385|  1.03M|            {
  386|  1.03M|                WORD16 i2_left_mv0, i2_left_mv1;
  387|       |                /************************************************************/
  388|       |                /* If Bs is not set, use left edge and current edge mvs and */
  389|       |                /* reference pictures addresses to evaluate Bs==1           */
  390|       |                /************************************************************/
  391|  1.03M|                i2_left_mv0 = ps_left_mv_pred->i2_mv[0];
  392|  1.03M|                i2_left_mv1 = ps_left_mv_pred->i2_mv[1];
  393|       |
  394|  1.03M|                i2_cur_mv0 = ps_cur_mv_pred->i2_mv[0];
  395|  1.03M|                i2_cur_mv1 = ps_cur_mv_pred->i2_mv[1];
  396|       |
  397|  1.03M|                i1_cur_ref0 = ps_cur_mv_pred->i1_ref_frame[0];
  398|       |
  399|  1.03M|                pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_cur_ref0];
  400|  1.03M|                if(i)
  ------------------
  |  Branch (400:20): [True: 782k, False: 257k]
  ------------------
  401|   782k|                {
  402|   782k|                    WORD8 i1_left_ref0 = ps_left_mv_pred->i1_ref_frame[0];
  403|   782k|                    pv_nbr_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_left_ref0];
  404|   782k|                    pv_nbr_pic_addr1 = 0;
  405|   782k|                }
  406|   257k|                else
  407|   257k|                {
  408|   257k|                    pv_nbr_pic_addr0 = ps_left_addr->u4_add[edge & 2];
  409|   257k|                    pv_nbr_pic_addr1 = ps_left_addr->u4_add[1 + (edge & 2)];
  410|   257k|                }
  411|       |
  412|  1.03M|                {
  413|  1.03M|                    UWORD32 u4_bs_temp1;
  414|       |                    /*********************************************************/
  415|       |                    /* If any motion vector component differs by more than 1 */
  416|       |                    /* integer pel or if reference pictures are different Bs */
  417|       |                    /* is set to 1. Note that this condition shall be met for*/
  418|       |                    /* both (fwd-fwd,bwd-bwd) and (fwd-bwd,bwd-fwd) direction*/
  419|       |                    /*********************************************************/
  420|       |
  421|  1.03M|                    u4_bs_temp1 =
  422|  1.03M|                                    ((ABS((i2_left_mv0 - i2_cur_mv0))
  ------------------
  |  |  100|  1.03M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 97.1k, False: 941k]
  |  |  ------------------
  ------------------
  423|  1.03M|                                                    >= 4)
  424|  1.03M|                                                    | (ABS((i2_left_mv1
  ------------------
  |  |  100|  1.03M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 103k, False: 935k]
  |  |  ------------------
  ------------------
  425|  1.03M|                                                                    - i2_cur_mv1))
  426|  1.03M|                                                                    >= i4_ver_mvlimit));
  427|       |
  428|  1.03M|                    u4_bs_vert = ((pv_nbr_pic_addr0 != pv_cur_pic_addr0)
  ------------------
  |  Branch (428:35): [True: 5.33k, False: 1.03M]
  ------------------
  429|  1.03M|                                    || (pv_nbr_pic_addr1 != pv_cur_pic_addr1)
  ------------------
  |  Branch (429:40): [True: 84, False: 1.03M]
  ------------------
  430|  1.03M|                                    || u4_bs_temp1);
  ------------------
  |  Branch (430:40): [True: 85.9k, False: 947k]
  ------------------
  431|       |
  432|  1.03M|                    pu4_bs_table[i + 4] |= (u4_bs_vert << u4_vert_idx);
  433|  1.03M|                }
  434|  1.03M|            }
  435|       |
  436|       |            /*****************************************************/
  437|       |            /* check if horz Bs for this block is already set    */
  438|       |            /*****************************************************/
  439|  1.12M|            if(!((u4_bs_horz >> u4_horz_idx) & 0xf))
  ------------------
  |  Branch (439:16): [True: 1.03M, False: 92.9k]
  ------------------
  440|  1.03M|            {
  441|  1.03M|                WORD16 i2_top_mv0, i2_top_mv1;
  442|       |                /************************************************************/
  443|       |                /* If Bs is not set, use top edge and current edge mvs and  */
  444|       |                /* reference pictures addresses to evaluate Bs==1           */
  445|       |                /************************************************************/
  446|  1.03M|                i2_cur_mv0 = ps_cur_mv_pred->i2_mv[0];
  447|  1.03M|                i2_cur_mv1 = ps_cur_mv_pred->i2_mv[1];
  448|       |
  449|  1.03M|                i1_cur_ref0 = ps_cur_mv_pred->i1_ref_frame[0];
  450|       |
  451|  1.03M|                i2_top_mv0 = ps_top_mv_pred->i2_mv[0];
  452|  1.03M|                i2_top_mv1 = ps_top_mv_pred->i2_mv[1];
  453|       |
  454|  1.03M|                pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_cur_ref0];
  455|  1.03M|                if(edge)
  ------------------
  |  Branch (455:20): [True: 779k, False: 257k]
  ------------------
  456|   779k|                {
  457|   779k|                    WORD8 i1_top_ref0 = ps_top_mv_pred->i1_ref_frame[0];
  458|   779k|                    pv_nbr_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_top_ref0];
  459|   779k|                    pv_nbr_pic_addr1 = 0;
  460|   779k|                }
  461|   257k|                else
  462|   257k|                {
  463|   257k|                    pv_nbr_pic_addr0 = u4_pic_addrress[i & 2];
  464|   257k|                    pv_nbr_pic_addr1 = u4_pic_addrress[1 + (i & 2)];
  465|   257k|                }
  466|       |
  467|  1.03M|                {
  468|  1.03M|                    UWORD32 u4_bs_temp1;
  469|  1.03M|                    UWORD32 u4_bs;
  470|       |                    /*********************************************************/
  471|       |                    /* If any motion vector component differs by more than 1 */
  472|       |                    /* integer pel or if reference pictures are different Bs */
  473|       |                    /* is set to 1. Note that this condition shall be met for*/
  474|       |                    /* both (fwd-fwd,bwd-bwd) and (fwd-bwd,bwd-fwd) direction*/
  475|       |                    /*********************************************************/
  476|       |
  477|  1.03M|                    u4_bs_temp1 =
  478|  1.03M|                                    ((ABS((i2_top_mv0 - i2_cur_mv0))
  ------------------
  |  |  100|  1.03M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 112k, False: 924k]
  |  |  ------------------
  ------------------
  479|  1.03M|                                                    >= 4)
  480|  1.03M|                                                    | (ABS((i2_top_mv1
  ------------------
  |  |  100|  1.03M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 106k, False: 930k]
  |  |  ------------------
  ------------------
  481|  1.03M|                                                                    - i2_cur_mv1))
  482|  1.03M|                                                                    >= i4_ver_mvlimit));
  483|       |
  484|  1.03M|                    u4_bs = ((pv_nbr_pic_addr0 != pv_cur_pic_addr0)
  ------------------
  |  Branch (484:30): [True: 11.5k, False: 1.02M]
  ------------------
  485|  1.02M|                                    || (pv_nbr_pic_addr1 != pv_cur_pic_addr1)
  ------------------
  |  Branch (485:40): [True: 379, False: 1.02M]
  ------------------
  486|  1.02M|                                    || u4_bs_temp1);
  ------------------
  |  Branch (486:40): [True: 66.8k, False: 958k]
  ------------------
  487|       |
  488|  1.03M|                    u4_bs_horz |= (u4_bs << u4_horz_idx);
  489|  1.03M|                }
  490|  1.03M|            }
  491|       |
  492|  1.12M|            ps_left_mv_pred = ps_cur_mv_pred;
  493|  1.12M|        }
  494|       |
  495|   282k|        pu4_bs_table[edge] = u4_bs_horz;
  496|   282k|    }
  497|  70.6k|}
ih264d_fill_bs1_16x16mb_bslice:
  532|  3.27M|{
  533|  3.27M|    WORD16 i2_q_mv0, i2_q_mv1, i2_q_mv2, i2_q_mv3;
  534|  3.27M|    WORD16 i2_p_mv0, i2_p_mv1, i2_p_mv2, i2_p_mv3;
  535|  3.27M|    void *pv_cur_pic_addr0, *pv_cur_pic_addr1;
  536|  3.27M|    void *pv_nbr_pic_addr0, *pv_nbr_pic_addr1;
  537|  3.27M|    void **ppv_map_ref_idx_to_poc_l0, **ppv_map_ref_idx_to_poc_l1;
  538|  3.27M|    UWORD32 i;
  539|  3.27M|    UWORD32 u4_bs_horz = pu4_bs_table[0];
  540|  3.27M|    UWORD32 u4_bs_vert = pu4_bs_table[4];
  541|       |
  542|  3.27M|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  3.27M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  543|       |
  544|  3.27M|    ppv_map_ref_idx_to_poc_l0 = ppv_map_ref_idx_to_poc;
  545|  3.27M|    ppv_map_ref_idx_to_poc_l1 = ppv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  3.27M|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  3.27M|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  546|  3.27M|    i2_q_mv0 = ps_cur_mv_pred->i2_mv[0];
  547|  3.27M|    i2_q_mv1 = ps_cur_mv_pred->i2_mv[1];
  548|  3.27M|    i2_q_mv2 = ps_cur_mv_pred->i2_mv[2];
  549|  3.27M|    i2_q_mv3 = ps_cur_mv_pred->i2_mv[3];
  550|  3.27M|    pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[ps_cur_mv_pred->i1_ref_frame[0]];
  551|  3.27M|    pv_cur_pic_addr1 = ppv_map_ref_idx_to_poc_l1[ps_cur_mv_pred->i1_ref_frame[1]];
  552|       |
  553|       |    /*********************************/
  554|       |    /* Computing Bs for the top edge */
  555|       |    /*********************************/
  556|  16.3M|    for(i = 0; i < 4; i++, ps_top_mv_pred++)
  ------------------
  |  Branch (556:16): [True: 13.0M, False: 3.27M]
  ------------------
  557|  13.0M|    {
  558|  13.0M|        UWORD32 u4_idx = 24 - (i << 3);
  559|       |
  560|       |        /*********************************/
  561|       |        /* check if Bs is already set    */
  562|       |        /*********************************/
  563|  13.0M|        if(!((u4_bs_horz >> u4_idx) & 0xf))
  ------------------
  |  Branch (563:12): [True: 13.0M, False: 48.8k]
  ------------------
  564|  13.0M|        {
  565|       |            /************************************************************/
  566|       |            /* If Bs is not set, use left edge and current edge mvs and */
  567|       |            /* reference pictures addresses to evaluate Bs==1           */
  568|       |            /************************************************************/
  569|  13.0M|            UWORD32 u4_bs_temp1, u4_bs_temp2;
  570|  13.0M|            UWORD32 u4_bs;
  571|       |
  572|       |            /*********************************************************/
  573|       |            /* If any motion vector component differs by more than 1 */
  574|       |            /* integer pel or if reference pictures are different Bs */
  575|       |            /* is set to 1. Note that this condition shall be met for*/
  576|       |            /* both (fwd-fwd,bwd-bwd) and (fwd-bwd,bwd-fwd) direction*/
  577|       |            /*********************************************************/
  578|  13.0M|            i2_p_mv0 = ps_top_mv_pred->i2_mv[0];
  579|  13.0M|            i2_p_mv1 = ps_top_mv_pred->i2_mv[1];
  580|  13.0M|            i2_p_mv2 = ps_top_mv_pred->i2_mv[2];
  581|  13.0M|            i2_p_mv3 = ps_top_mv_pred->i2_mv[3];
  582|  13.0M|            pv_nbr_pic_addr0 = u4_pic_addrress[i & 2];
  583|  13.0M|            pv_nbr_pic_addr1 = u4_pic_addrress[1 + (i & 2)];
  584|       |
  585|  13.0M|            u4_bs_temp1 =
  586|  13.0M|                            ((ABS((i2_p_mv0 - i2_q_mv0))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 58.5k, False: 12.9M]
  |  |  ------------------
  ------------------
  587|  13.0M|                                            >= 4)
  588|  13.0M|                                            | (ABS((i2_p_mv1 - i2_q_mv1))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 74.7k, False: 12.9M]
  |  |  ------------------
  ------------------
  589|  13.0M|                                                            >= i4_ver_mvlimit)
  590|  13.0M|                                            | (ABS((i2_p_mv2 - i2_q_mv2))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 84.6k, False: 12.9M]
  |  |  ------------------
  ------------------
  591|  13.0M|                                                            >= 4)
  592|  13.0M|                                            | (ABS((i2_p_mv3 - i2_q_mv3))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 53.5k, False: 12.9M]
  |  |  ------------------
  ------------------
  593|  13.0M|                                                            >= i4_ver_mvlimit));
  594|       |
  595|  13.0M|            u4_bs_temp2 =
  596|  13.0M|                            ((ABS((i2_p_mv0 - i2_q_mv2))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 437k, False: 12.6M]
  |  |  ------------------
  ------------------
  597|  13.0M|                                            >= 4)
  598|  13.0M|                                            | (ABS((i2_p_mv1 - i2_q_mv3))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 416k, False: 12.6M]
  |  |  ------------------
  ------------------
  599|  13.0M|                                                            >= i4_ver_mvlimit)
  600|  13.0M|                                            | (ABS((i2_p_mv2 - i2_q_mv0))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 9.09M, False: 3.94M]
  |  |  ------------------
  ------------------
  601|  13.0M|                                                            >= 4)
  602|  13.0M|                                            | (ABS((i2_p_mv3 - i2_q_mv1))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 9.14M, False: 3.89M]
  |  |  ------------------
  ------------------
  603|  13.0M|                                                            >= i4_ver_mvlimit));
  604|       |
  605|  13.0M|            u4_bs = ((pv_cur_pic_addr0 != pv_nbr_pic_addr0)
  ------------------
  |  Branch (605:22): [True: 379k, False: 12.6M]
  ------------------
  606|  12.6M|                            || (pv_cur_pic_addr1 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (606:32): [True: 288k, False: 12.3M]
  ------------------
  607|  12.3M|                            || u4_bs_temp1)
  ------------------
  |  Branch (607:32): [True: 51.0k, False: 12.3M]
  ------------------
  608|   719k|                            && ((pv_cur_pic_addr0 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (608:33): [True: 446k, False: 272k]
  ------------------
  609|   272k|                                            || (pv_cur_pic_addr1
  ------------------
  |  Branch (609:48): [True: 221k, False: 51.2k]
  ------------------
  610|   272k|                                                            != pv_nbr_pic_addr0)
  611|  51.2k|                                            || u4_bs_temp2);
  ------------------
  |  Branch (611:48): [True: 28.5k, False: 22.6k]
  ------------------
  612|       |
  613|  13.0M|            u4_bs_horz |= (u4_bs << u4_idx);
  614|  13.0M|        }
  615|  13.0M|    }
  616|  3.27M|    pu4_bs_table[0] = u4_bs_horz;
  617|       |
  618|       |    /***********************************/
  619|       |    /* Computing Bs for the left edge  */
  620|       |    /***********************************/
  621|  16.3M|    for(i = 0; i < 4; i++, ps_leftmost_mv_pred += 4)
  ------------------
  |  Branch (621:16): [True: 13.0M, False: 3.27M]
  ------------------
  622|  13.0M|    {
  623|  13.0M|        UWORD32 u4_idx = 24 - (i << 3);
  624|       |
  625|       |        /*********************************/
  626|       |        /* check if Bs is already set    */
  627|       |        /*********************************/
  628|  13.0M|        if(!((u4_bs_vert >> u4_idx) & 0xf))
  ------------------
  |  Branch (628:12): [True: 13.0M, False: 45.5k]
  ------------------
  629|  13.0M|        {
  630|       |            /****************************************************/
  631|       |            /* If Bs is not set, evalaute conditions for Bs=1   */
  632|       |            /****************************************************/
  633|  13.0M|            UWORD32 u4_bs_temp1, u4_bs_temp2;
  634|  13.0M|            UWORD32 u4_bs;
  635|       |            /*********************************************************/
  636|       |            /* If any motion vector component differs by more than 1 */
  637|       |            /* integer pel or if reference pictures are different Bs */
  638|       |            /* is set to 1. Note that this condition shall be met for*/
  639|       |            /* both (fwd-fwd,bwd-bwd) and (fwd-bwd,bwd-fwd) direction*/
  640|       |            /*********************************************************/
  641|       |
  642|  13.0M|            i2_p_mv0 = ps_leftmost_mv_pred->i2_mv[0];
  643|  13.0M|            i2_p_mv1 = ps_leftmost_mv_pred->i2_mv[1];
  644|  13.0M|            i2_p_mv2 = ps_leftmost_mv_pred->i2_mv[2];
  645|  13.0M|            i2_p_mv3 = ps_leftmost_mv_pred->i2_mv[3];
  646|  13.0M|            pv_nbr_pic_addr0 = ps_left_addr->u4_add[i & 2];
  647|  13.0M|            pv_nbr_pic_addr1 = ps_left_addr->u4_add[1 + (i & 2)];
  648|       |
  649|  13.0M|            u4_bs_temp1 =
  650|  13.0M|                            ((ABS((i2_p_mv0 - i2_q_mv0))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 39.1k, False: 13.0M]
  |  |  ------------------
  ------------------
  651|  13.0M|                                            >= 4)
  652|  13.0M|                                            | (ABS((i2_p_mv1 - i2_q_mv1))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 55.7k, False: 12.9M]
  |  |  ------------------
  ------------------
  653|  13.0M|                                                            >= i4_ver_mvlimit)
  654|  13.0M|                                            | (ABS((i2_p_mv2 - i2_q_mv2))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 48.5k, False: 12.9M]
  |  |  ------------------
  ------------------
  655|  13.0M|                                                            >= 4)
  656|  13.0M|                                            | (ABS((i2_p_mv3 - i2_q_mv3))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 39.7k, False: 13.0M]
  |  |  ------------------
  ------------------
  657|  13.0M|                                                            >= i4_ver_mvlimit));
  658|       |
  659|  13.0M|            u4_bs_temp2 =
  660|  13.0M|                            ((ABS((i2_p_mv0 - i2_q_mv2))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 434k, False: 12.6M]
  |  |  ------------------
  ------------------
  661|  13.0M|                                            >= 4)
  662|  13.0M|                                            | (ABS((i2_p_mv1 - i2_q_mv3))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 413k, False: 12.6M]
  |  |  ------------------
  ------------------
  663|  13.0M|                                                            >= i4_ver_mvlimit)
  664|  13.0M|                                            | (ABS((i2_p_mv2 - i2_q_mv0))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 9.38M, False: 3.65M]
  |  |  ------------------
  ------------------
  665|  13.0M|                                                            >= 4)
  666|  13.0M|                                            | (ABS((i2_p_mv3 - i2_q_mv1))
  ------------------
  |  |  100|  13.0M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 9.43M, False: 3.60M]
  |  |  ------------------
  ------------------
  667|  13.0M|                                                            >= i4_ver_mvlimit));
  668|       |
  669|  13.0M|            u4_bs = ((pv_cur_pic_addr0 != pv_nbr_pic_addr0)
  ------------------
  |  Branch (669:22): [True: 138k, False: 12.9M]
  ------------------
  670|  12.9M|                            || (pv_cur_pic_addr1 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (670:32): [True: 115k, False: 12.7M]
  ------------------
  671|  12.7M|                            || u4_bs_temp1)
  ------------------
  |  Branch (671:32): [True: 49.8k, False: 12.7M]
  ------------------
  672|   303k|                            && ((pv_cur_pic_addr0 != pv_nbr_pic_addr1)
  ------------------
  |  Branch (672:33): [True: 170k, False: 133k]
  ------------------
  673|   133k|                                            || (pv_cur_pic_addr1
  ------------------
  |  Branch (673:48): [True: 87.0k, False: 45.9k]
  ------------------
  674|   133k|                                                            != pv_nbr_pic_addr0)
  675|  45.9k|                                            || u4_bs_temp2);
  ------------------
  |  Branch (675:48): [True: 37.7k, False: 8.21k]
  ------------------
  676|       |
  677|  13.0M|            u4_bs_vert |= (u4_bs << u4_idx);
  678|  13.0M|        }
  679|  13.0M|    }
  680|  3.27M|    pu4_bs_table[4] = u4_bs_vert;
  681|       |
  682|  3.27M|    return;
  683|  3.27M|}
ih264d_fill_bs1_non16x16mb_bslice:
  718|   104k|{
  719|   104k|    UWORD32 edge;
  720|   104k|    void **ppv_map_ref_idx_to_poc_l0, **ppv_map_ref_idx_to_poc_l1;
  721|   104k|    ppv_map_ref_idx_to_poc_l0 = ppv_map_ref_idx_to_poc;
  722|   104k|    ppv_map_ref_idx_to_poc_l1 = ppv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|   104k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|   104k|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  723|       |
  724|   104k|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|   104k|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  725|       |
  726|   523k|    for(edge = 0; edge < 4; edge++, ps_top_mv_pred = ps_cur_mv_pred - 4)
  ------------------
  |  Branch (726:19): [True: 418k, False: 104k]
  ------------------
  727|   418k|    {
  728|       |        /*********************************************************************/
  729|       |        /* Each iteration of this loop fills the four BS values of one HORIZ */
  730|       |        /* edge and one BS value for each of the four VERT edges.            */
  731|       |        /*********************************************************************/
  732|   418k|        WORD32 i;
  733|   418k|        UWORD32 u4_vert_idx = 24 - (edge << 3);
  734|   418k|        UWORD32 u4_bs_horz = pu4_bs_table[edge];
  735|   418k|        mv_pred_t *ps_left_mv_pred = ps_leftmost_mv_pred + (edge << 2);
  736|       |
  737|  2.09M|        for(i = 0; i < 4; i++, ps_top_mv_pred++, ps_cur_mv_pred++)
  ------------------
  |  Branch (737:20): [True: 1.67M, False: 418k]
  ------------------
  738|  1.67M|        {
  739|  1.67M|            WORD16 i2_cur_mv0, i2_cur_mv1, i16_curMv2, i16_curMv3;
  740|  1.67M|            WORD8 i1_cur_ref0, i1_cur_ref1;
  741|  1.67M|            void *pv_cur_pic_addr0, *pv_cur_pic_addr1;
  742|  1.67M|            void *pv_nbr_pic_addr0, *pv_nbr_pic_addr1;
  743|       |
  744|       |            /******************************************************/
  745|       |            /* Each iteration of this inner loop computes a HORIZ */
  746|       |            /* and a VERT BS value for a 4x4 block                */
  747|       |            /******************************************************/
  748|  1.67M|            UWORD32 u4_bs_vert = (pu4_bs_table[i + 4] >> u4_vert_idx) & 0xf;
  749|  1.67M|            UWORD32 u4_horz_idx = 24 - (i << 3);
  750|       |
  751|       |            /*****************************************************/
  752|       |            /* check if vert Bs for this block is already set    */
  753|       |            /*****************************************************/
  754|  1.67M|            if(!u4_bs_vert)
  ------------------
  |  Branch (754:16): [True: 1.59M, False: 83.6k]
  ------------------
  755|  1.59M|            {
  756|  1.59M|                WORD16 i2_left_mv0, i2_left_mv1, i2_left_mv2, i2_left_mv3;
  757|       |                /************************************************************/
  758|       |                /* If Bs is not set, use left edge and current edge mvs and */
  759|       |                /* reference pictures addresses to evaluate Bs==1           */
  760|       |                /************************************************************/
  761|  1.59M|                i2_left_mv0 = ps_left_mv_pred->i2_mv[0];
  762|  1.59M|                i2_left_mv1 = ps_left_mv_pred->i2_mv[1];
  763|  1.59M|                i2_left_mv2 = ps_left_mv_pred->i2_mv[2];
  764|  1.59M|                i2_left_mv3 = ps_left_mv_pred->i2_mv[3];
  765|       |
  766|  1.59M|                i2_cur_mv0 = ps_cur_mv_pred->i2_mv[0];
  767|  1.59M|                i2_cur_mv1 = ps_cur_mv_pred->i2_mv[1];
  768|  1.59M|                i16_curMv2 = ps_cur_mv_pred->i2_mv[2];
  769|  1.59M|                i16_curMv3 = ps_cur_mv_pred->i2_mv[3];
  770|  1.59M|                i1_cur_ref0 = ps_cur_mv_pred->i1_ref_frame[0];
  771|  1.59M|                i1_cur_ref1 = ps_cur_mv_pred->i1_ref_frame[1];
  772|  1.59M|                pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_cur_ref0];
  773|  1.59M|                pv_cur_pic_addr1 = ppv_map_ref_idx_to_poc_l1[i1_cur_ref1];
  774|       |
  775|  1.59M|                if(i)
  ------------------
  |  Branch (775:20): [True: 1.19M, False: 395k]
  ------------------
  776|  1.19M|                {
  777|  1.19M|                    WORD8 i1_left_ref0, i1_left_ref1;
  778|  1.19M|                    i1_left_ref0 = ps_left_mv_pred->i1_ref_frame[0];
  779|  1.19M|                    i1_left_ref1 = ps_left_mv_pred->i1_ref_frame[1];
  780|  1.19M|                    pv_nbr_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_left_ref0];
  781|  1.19M|                    pv_nbr_pic_addr1 = ppv_map_ref_idx_to_poc_l1[i1_left_ref1];
  782|  1.19M|                }
  783|   395k|                else
  784|   395k|                {
  785|   395k|                    pv_nbr_pic_addr0 = ps_left_addr->u4_add[edge & 2];
  786|   395k|                    pv_nbr_pic_addr1 = ps_left_addr->u4_add[1 + (edge & 2)];
  787|   395k|                }
  788|       |
  789|  1.59M|                {
  790|  1.59M|                    UWORD32 u4_bs_temp1, u4_bs_temp2;
  791|       |                    /*********************************************************/
  792|       |                    /* If any motion vector component differs by more than 1 */
  793|       |                    /* integer pel or if reference pictures are different Bs */
  794|       |                    /* is set to 1. Note that this condition shall be met for*/
  795|       |                    /* both (fwd-fwd,bwd-bwd) and (fwd-bwd,bwd-fwd) direction*/
  796|       |                    /*********************************************************/
  797|       |
  798|  1.59M|                    u4_bs_temp1 =
  799|  1.59M|                                    ((ABS((i2_left_mv0 - i2_cur_mv0))
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 194k, False: 1.39M]
  |  |  ------------------
  ------------------
  800|  1.59M|                                                    >= 4)
  801|  1.59M|                                                    | (ABS((i2_left_mv1
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 173k, False: 1.41M]
  |  |  ------------------
  ------------------
  802|  1.59M|                                                                    - i2_cur_mv1))
  803|  1.59M|                                                                    >= i4_ver_mvlimit)
  804|  1.59M|                                                    | (ABS((i2_left_mv2
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 72.1k, False: 1.51M]
  |  |  ------------------
  ------------------
  805|  1.59M|                                                                    - i16_curMv2))
  806|  1.59M|                                                                    >= 4)
  807|  1.59M|                                                    | (ABS((i2_left_mv3
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 51.5k, False: 1.53M]
  |  |  ------------------
  ------------------
  808|  1.59M|                                                                    - i16_curMv3))
  809|  1.59M|                                                                    >= i4_ver_mvlimit));
  810|       |
  811|  1.59M|                    u4_bs_temp2 =
  812|  1.59M|                                    ((ABS((i2_left_mv0 - i16_curMv2))
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 269k, False: 1.32M]
  |  |  ------------------
  ------------------
  813|  1.59M|                                                    >= 4)
  814|  1.59M|                                                    | (ABS((i2_left_mv1
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 303k, False: 1.28M]
  |  |  ------------------
  ------------------
  815|  1.59M|                                                                    - i16_curMv3))
  816|  1.59M|                                                                    >= i4_ver_mvlimit)
  817|  1.59M|                                                    | (ABS((i2_left_mv2
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 765k, False: 825k]
  |  |  ------------------
  ------------------
  818|  1.59M|                                                                    - i2_cur_mv0))
  819|  1.59M|                                                                    >= 4)
  820|  1.59M|                                                    | (ABS((i2_left_mv3
  ------------------
  |  |  100|  1.59M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 647k, False: 942k]
  |  |  ------------------
  ------------------
  821|  1.59M|                                                                    - i2_cur_mv1))
  822|  1.59M|                                                                    >= i4_ver_mvlimit));
  823|       |
  824|  1.59M|                    u4_bs_vert =
  825|  1.59M|                                    ((pv_nbr_pic_addr0 != pv_cur_pic_addr0)
  ------------------
  |  Branch (825:38): [True: 111k, False: 1.47M]
  ------------------
  826|  1.47M|                                                    || (pv_nbr_pic_addr1
  ------------------
  |  Branch (826:56): [True: 74.8k, False: 1.40M]
  ------------------
  827|  1.47M|                                                                    != pv_cur_pic_addr1)
  828|  1.40M|                                                    || u4_bs_temp1)
  ------------------
  |  Branch (828:56): [True: 181k, False: 1.22M]
  ------------------
  829|   367k|                                                    && ((pv_nbr_pic_addr0
  ------------------
  |  Branch (829:57): [True: 204k, False: 163k]
  ------------------
  830|   367k|                                                                    != pv_cur_pic_addr1)
  831|   163k|                                                                    || (pv_nbr_pic_addr1
  ------------------
  |  Branch (831:72): [True: 66.2k, False: 97.3k]
  ------------------
  832|   163k|                                                                                    != pv_cur_pic_addr0)
  833|  97.3k|                                                                    || u4_bs_temp2);
  ------------------
  |  Branch (833:72): [True: 84.1k, False: 13.1k]
  ------------------
  834|       |
  835|  1.59M|                    pu4_bs_table[i + 4] |= (u4_bs_vert << u4_vert_idx);
  836|  1.59M|                }
  837|  1.59M|            }
  838|       |
  839|       |            /*****************************************************/
  840|       |            /* check if horz Bs for this block is already set    */
  841|       |            /*****************************************************/
  842|  1.67M|            if(!((u4_bs_horz >> u4_horz_idx) & 0xf))
  ------------------
  |  Branch (842:16): [True: 1.58M, False: 89.8k]
  ------------------
  843|  1.58M|            {
  844|  1.58M|                WORD16 i2_top_mv0, i2_top_mv1, i16_topMv2, i16_topMv3;
  845|       |                /************************************************************/
  846|       |                /* If Bs is not set, use top edge and current edge mvs and  */
  847|       |                /* reference pictures addresses to evaluate Bs==1           */
  848|       |                /************************************************************/
  849|  1.58M|                i2_cur_mv0 = ps_cur_mv_pred->i2_mv[0];
  850|  1.58M|                i2_cur_mv1 = ps_cur_mv_pred->i2_mv[1];
  851|  1.58M|                i16_curMv2 = ps_cur_mv_pred->i2_mv[2];
  852|  1.58M|                i16_curMv3 = ps_cur_mv_pred->i2_mv[3];
  853|  1.58M|                i1_cur_ref0 = ps_cur_mv_pred->i1_ref_frame[0];
  854|  1.58M|                i1_cur_ref1 = ps_cur_mv_pred->i1_ref_frame[1];
  855|       |
  856|  1.58M|                i2_top_mv0 = ps_top_mv_pred->i2_mv[0];
  857|  1.58M|                i2_top_mv1 = ps_top_mv_pred->i2_mv[1];
  858|  1.58M|                i16_topMv2 = ps_top_mv_pred->i2_mv[2];
  859|  1.58M|                i16_topMv3 = ps_top_mv_pred->i2_mv[3];
  860|  1.58M|                pv_cur_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_cur_ref0];
  861|  1.58M|                pv_cur_pic_addr1 = ppv_map_ref_idx_to_poc_l1[i1_cur_ref1];
  862|  1.58M|                if(edge)
  ------------------
  |  Branch (862:20): [True: 1.19M, False: 391k]
  ------------------
  863|  1.19M|                {
  864|  1.19M|                    WORD8 i1_top_ref0, i1_top_ref1;
  865|  1.19M|                    i1_top_ref0 = ps_top_mv_pred->i1_ref_frame[0];
  866|  1.19M|                    i1_top_ref1 = ps_top_mv_pred->i1_ref_frame[1];
  867|  1.19M|                    pv_nbr_pic_addr0 = ppv_map_ref_idx_to_poc_l0[i1_top_ref0];
  868|  1.19M|                    pv_nbr_pic_addr1 = ppv_map_ref_idx_to_poc_l1[i1_top_ref1];
  869|  1.19M|                }
  870|   391k|                else
  871|   391k|                {
  872|   391k|                    pv_nbr_pic_addr0 = u4_pic_addrress[i & 2];
  873|   391k|                    pv_nbr_pic_addr1 = u4_pic_addrress[1 + (i & 2)];
  874|   391k|                }
  875|       |
  876|  1.58M|                {
  877|  1.58M|                    UWORD32 u4_bs_temp1, u4_bs_temp2;
  878|  1.58M|                    UWORD32 u4_bs;
  879|       |                    /*********************************************************/
  880|       |                    /* If any motion vector component differs by more than 1 */
  881|       |                    /* integer pel or if reference pictures are different Bs */
  882|       |                    /* is set to 1. Note that this condition shall be met for*/
  883|       |                    /* both (fwd-fwd,bwd-bwd) and (fwd-bwd,bwd-fwd) direction*/
  884|       |                    /*********************************************************/
  885|       |
  886|  1.58M|                    u4_bs_temp1 =
  887|  1.58M|                                    ((ABS((i2_top_mv0 - i2_cur_mv0))
  ------------------
  |  |  100|  1.58M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 283k, False: 1.30M]
  |  |  ------------------
  ------------------
  888|  1.58M|                                                    >= 4)
  889|  1.58M|                                                    | (ABS((i2_top_mv1
  ------------------
  |  |  100|  1.58M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 248k, False: 1.33M]
  |  |  ------------------
  ------------------
  890|  1.58M|                                                                    - i2_cur_mv1))
  891|  1.58M|                                                                    >= i4_ver_mvlimit)
  892|  1.58M|                                                    | (ABS((i16_topMv2
  ------------------
  |  |  100|  1.58M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 84.7k, False: 1.49M]
  |  |  ------------------
  ------------------
  893|  1.58M|                                                                    - i16_curMv2))
  894|  1.58M|                                                                    >= 4)
  895|  1.58M|                                                    | (ABS((i16_topMv3
  ------------------
  |  |  100|  1.58M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 60.9k, False: 1.52M]
  |  |  ------------------
  ------------------
  896|  1.58M|                                                                    - i16_curMv3))
  897|  1.58M|                                                                    >= i4_ver_mvlimit));
  898|       |
  899|  1.58M|                    u4_bs_temp2 =
  900|  1.58M|                                    ((ABS((i2_top_mv0 - i16_curMv2))
  ------------------
  |  |  100|  1.58M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 263k, False: 1.32M]
  |  |  ------------------
  ------------------
  901|  1.58M|                                                    >= 4)
  902|  1.58M|                                                    | (ABS((i2_top_mv1
  ------------------
  |  |  100|  1.58M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 300k, False: 1.28M]
  |  |  ------------------
  ------------------
  903|  1.58M|                                                                    - i16_curMv3))
  904|  1.58M|                                                                    >= i4_ver_mvlimit)
  905|  1.58M|                                                    | (ABS((i16_topMv2
  ------------------
  |  |  100|  1.58M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 757k, False: 827k]
  |  |  ------------------
  ------------------
  906|  1.58M|                                                                    - i2_cur_mv0))
  907|  1.58M|                                                                    >= 4)
  908|  1.58M|                                                    | (ABS((i16_topMv3
  ------------------
  |  |  100|  1.58M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 643k, False: 941k]
  |  |  ------------------
  ------------------
  909|  1.58M|                                                                    - i2_cur_mv1))
  910|  1.58M|                                                                    >= i4_ver_mvlimit));
  911|       |
  912|  1.58M|                    u4_bs =
  913|  1.58M|                                    ((pv_nbr_pic_addr0 != pv_cur_pic_addr0)
  ------------------
  |  Branch (913:38): [True: 114k, False: 1.47M]
  ------------------
  914|  1.47M|                                                    || (pv_nbr_pic_addr1
  ------------------
  |  Branch (914:56): [True: 96.4k, False: 1.37M]
  ------------------
  915|  1.47M|                                                                    != pv_cur_pic_addr1)
  916|  1.37M|                                                    || u4_bs_temp1)
  ------------------
  |  Branch (916:56): [True: 224k, False: 1.14M]
  ------------------
  917|   435k|                                                    && ((pv_nbr_pic_addr0
  ------------------
  |  Branch (917:57): [True: 237k, False: 197k]
  ------------------
  918|   435k|                                                                    != pv_cur_pic_addr1)
  919|   197k|                                                                    || (pv_nbr_pic_addr1
  ------------------
  |  Branch (919:72): [True: 87.7k, False: 110k]
  ------------------
  920|   197k|                                                                                    != pv_cur_pic_addr0)
  921|   110k|                                                                    || u4_bs_temp2);
  ------------------
  |  Branch (921:72): [True: 91.9k, False: 18.1k]
  ------------------
  922|       |
  923|  1.58M|                    u4_bs_horz |= (u4_bs << u4_horz_idx);
  924|  1.58M|                }
  925|  1.58M|            }
  926|       |
  927|  1.67M|            ps_left_mv_pred = ps_cur_mv_pred;
  928|  1.67M|        }
  929|       |
  930|   418k|        pu4_bs_table[edge] = u4_bs_horz;
  931|   418k|    }
  932|   104k|}
ih264d_compute_bs_non_mbaff:
 1146|  6.72M|{
 1147|       |    /* Mvpred and Nnz for top and Courrent */
 1148|  6.72M|    mv_pred_t *ps_cur_mv_pred, *ps_top_mv_pred = NULL, *ps_left_mv_pred;
 1149|       |    /* deblk_mb_t Params */
 1150|  6.72M|    deblk_mb_t *ps_cur_mb_params; /*< Parameters of current MacroBlock */
 1151|  6.72M|    deblkmb_neighbour_t *ps_deblk_top_mb;
 1152|       |
 1153|       |    /* Reference Index to POC mapping*/
 1154|  6.72M|    void ** apv_map_ref_idx_to_poc;
 1155|  6.72M|    UWORD32 u4_leftmbtype;
 1156|       |
 1157|  6.72M|    UWORD16 u2_left_csbp, u2_top_csbp, u2_cur_csbp;
 1158|       |
 1159|       |    /* Set of flags */
 1160|  6.72M|    UWORD32 u4_cur_mb_intra, u1_top_mb_typ, u4_cur_mb_fld;
 1161|  6.72M|    UWORD32 u1_cur_mb_type;
 1162|  6.72M|    UWORD32 * pu4_bs_table;
 1163|       |
 1164|       |    /* Neighbour availability */
 1165|       |    /* Initialization */
 1166|  6.72M|    const UWORD32 u2_mbx = ps_cur_mb_info->u2_mbx;
 1167|  6.72M|    const UWORD32 u2_mby = ps_cur_mb_info->u2_mby;
 1168|  6.72M|    const UWORD32 u1_pingpong = u2_mbx & 0x01;
 1169|       |
 1170|  6.72M|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  6.72M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
 1171|       |
 1172|  6.72M|    ps_deblk_top_mb = ps_dec->ps_deblk_top_mb + u2_mbx;
 1173|       |
 1174|       |
 1175|       |    /* Pointer assignment for Current DeblkMB, Current Mv Pred  */
 1176|  6.72M|    ps_cur_mb_params = ps_dec->ps_deblk_mbn + u2_mbxn_mb;
 1177|  6.72M|    ps_cur_mv_pred = ps_dec->ps_mv_cur + (u2_mbxn_mb << 4);
 1178|       |
 1179|  6.72M|    apv_map_ref_idx_to_poc = ps_dec->ppv_map_ref_idx_to_poc + 1;
 1180|  6.72M|    u1_cur_mb_type = ps_cur_mb_params->u1_mb_type;
 1181|  6.72M|    u1_top_mb_typ = ps_deblk_top_mb->u1_mb_type;
 1182|  6.72M|    ps_deblk_top_mb->u1_mb_type = u1_cur_mb_type;
 1183|       |
 1184|  6.72M|    {
 1185|  6.72M|        UWORD8 mb_qp_temp;
 1186|       |
 1187|  6.72M|        ps_cur_mb_params->u1_topmb_qp = ps_deblk_top_mb->u1_mb_qp;
 1188|  6.72M|        ps_deblk_top_mb->u1_mb_qp = ps_cur_mb_params->u1_mb_qp;
 1189|       |
 1190|  6.72M|        ps_cur_mb_params->u1_left_mb_qp = ps_dec->deblk_left_mb[1].u1_mb_qp;
 1191|  6.72M|        ps_dec->deblk_left_mb[1].u1_mb_qp = ps_cur_mb_params->u1_mb_qp;
 1192|       |
 1193|  6.72M|    }
 1194|       |
 1195|       |    /* if no deblocking required for current Mb then continue */
 1196|       |    /* Check next Mbs   in Mb group                           */
 1197|  6.72M|    if(ps_cur_mb_params->u1_deblocking_mode & MB_DISABLE_FILTERING)
  ------------------
  |  |   70|  6.72M|#define MB_DISABLE_FILTERING          0x01
  ------------------
  |  Branch (1197:8): [True: 1.33M, False: 5.39M]
  ------------------
 1198|  1.33M|    {
 1199|  1.33M|        void ** pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc +
 1200|  1.33M|        POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  1.33M|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  1.33M|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
 1201|  1.33M|        {
 1202|       |            /* Store Parameter for Top MvPred refernce frame Address */
 1203|       |
 1204|  1.33M|            void ** ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
 1205|  1.33M|            WORD8 * p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
 1206|  1.33M|            WORD8 * p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
 1207|       |
 1208|       |            /* Store Left addresses for Next Mb   */
 1209|  1.33M|            void ** ppv_left_mv_pred_addr =
 1210|  1.33M|                            ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
 1211|  1.33M|            WORD8 * p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
 1212|       |
 1213|       |
 1214|  1.33M|            ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
 1215|  1.33M|            ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
 1216|       |
 1217|  1.33M|            ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
 1218|  1.33M|            ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
 1219|  1.33M|            ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
 1220|  1.33M|            ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
 1221|       |
 1222|  1.33M|            ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
 1223|  1.33M|            ppv_left_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refleft0[1]];
 1224|       |            //}
 1225|       |            /* Storing the leftMbtype for next Mb */
 1226|  1.33M|            ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
 1227|  1.33M|        }
 1228|       |
 1229|  1.33M|        return;
 1230|  1.33M|    }
 1231|       |
 1232|       |    /* Flag for extra left Edge */
 1233|  5.39M|    ps_cur_mb_params->u1_single_call = 1;
 1234|       |
 1235|       |    /* Update the Left deblk_mb_t and Left MvPred Parameters           */
 1236|  5.39M|    if(!u2_mbx)
  ------------------
  |  Branch (1236:8): [True: 695k, False: 4.69M]
  ------------------
 1237|   695k|    {
 1238|   695k|        u4_leftmbtype = 0;
 1239|       |
 1240|       |        /* Initialize the ps_left_mv_pred with Junk but Valid Location */
 1241|       |        /* to avoid invalid memory access                           */
 1242|       |        /* this is read only pointer                                */
 1243|   695k|        ps_left_mv_pred = ps_dec->ps_mv_cur + 3;
 1244|   695k|    }
 1245|  4.69M|    else
 1246|  4.69M|    {
 1247|  4.69M|        u4_leftmbtype = ps_dec->deblk_left_mb[1].u1_mb_type;
 1248|       |
 1249|       |        /* Come to Left Most Edge of the MB */
 1250|  4.69M|        ps_left_mv_pred = (u2_mbxn_mb) ?
  ------------------
  |  Branch (1250:27): [True: 4.67M, False: 22.4k]
  ------------------
 1251|  4.67M|                        ps_dec->ps_mv_cur + ((u2_mbxn_mb - 1) << 4) + 3 :
 1252|  4.69M|                        ps_dec->ps_mv_left + 3;
 1253|  4.69M|    }
 1254|       |
 1255|  5.39M|    if(!u2_mby)
  ------------------
  |  Branch (1255:8): [True: 188k, False: 5.20M]
  ------------------
 1256|   188k|        u1_top_mb_typ = 0;
 1257|       |
 1258|       |    /* MvPred Pointer Calculation */
 1259|       |    /* CHANGED CODE */
 1260|  5.39M|    ps_top_mv_pred = ps_cur_mv_pred - (ps_dec->u2_frm_wd_in_mbs << 4) + 12;
 1261|       |
 1262|  5.39M|    u4_cur_mb_intra = u1_cur_mb_type & D_INTRA_MB;
  ------------------
  |  |  382|  5.39M|#define D_INTRA_MB        1
  ------------------
 1263|  5.39M|    u4_cur_mb_fld = !!(u1_cur_mb_type & D_FLD_MB);
  ------------------
  |  |  386|  5.39M|#define D_FLD_MB          0x80
  ------------------
 1264|       |    /* Compute BS function */
 1265|  5.39M|    pu4_bs_table = ps_cur_mb_params->u4_bs_table;
 1266|       |
 1267|  5.39M|    u2_cur_csbp = ps_cur_mb_info->ps_curmb->u2_luma_csbp;
 1268|  5.39M|    u2_left_csbp = ps_cur_mb_info->ps_left_mb->u2_luma_csbp;
 1269|  5.39M|    u2_top_csbp = ps_cur_mb_info->ps_top_mb->u2_luma_csbp;
 1270|       |    /* Compute BS function */
 1271|  5.39M|    if(ps_dec->ps_cur_sps->u1_profile_idc == HIGH_PROFILE_IDC)
  ------------------
  |  |  278|  5.39M|#define HIGH_PROFILE_IDC   100
  ------------------
  |  Branch (1271:8): [True: 1.24M, False: 4.14M]
  ------------------
 1272|  1.24M|    {
 1273|  1.24M|        if(ps_cur_mb_info->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (1273:12): [True: 108k, False: 1.13M]
  ------------------
 1274|   108k|        {
 1275|   108k|            u2_cur_csbp = ih264d_update_csbp_8x8(
 1276|   108k|                            ps_cur_mb_info->ps_curmb->u2_luma_csbp);
 1277|   108k|        }
 1278|       |
 1279|  1.24M|        if(ps_cur_mb_info->ps_left_mb->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (1279:12): [True: 70.2k, False: 1.17M]
  ------------------
 1280|  70.2k|        {
 1281|  70.2k|            u2_left_csbp = ih264d_update_csbp_8x8(
 1282|  70.2k|                            ps_cur_mb_info->ps_left_mb->u2_luma_csbp);
 1283|  70.2k|        }
 1284|       |
 1285|  1.24M|        if(ps_cur_mb_info->ps_top_mb->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (1285:12): [True: 89.3k, False: 1.15M]
  ------------------
 1286|  89.3k|        {
 1287|  89.3k|            u2_top_csbp = ih264d_update_csbp_8x8(
 1288|  89.3k|                            ps_cur_mb_info->ps_top_mb->u2_luma_csbp);
 1289|  89.3k|        }
 1290|  1.24M|    }
 1291|  5.39M|    if(u4_cur_mb_intra)
  ------------------
  |  Branch (1291:8): [True: 35.0k, False: 5.35M]
  ------------------
 1292|  35.0k|    {
 1293|       |
 1294|  35.0k|        pu4_bs_table[4] = 0x04040404;
 1295|  35.0k|        pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  Branch (1295:27): [True: 0, False: 35.0k]
  ------------------
 1296|  35.0k|        pu4_bs_table[1] = 0x03030303;
 1297|  35.0k|        pu4_bs_table[2] = 0x03030303;
 1298|  35.0k|        pu4_bs_table[3] = 0x03030303;
 1299|  35.0k|        pu4_bs_table[5] = 0x03030303;
 1300|  35.0k|        pu4_bs_table[6] = 0x03030303;
 1301|  35.0k|        pu4_bs_table[7] = 0x03030303;
 1302|  35.0k|    }
 1303|  5.35M|    else
 1304|  5.35M|    {
 1305|  5.35M|        UWORD32 u4_is_non16x16 = !!(u1_cur_mb_type & D_PRED_NON_16x16);
  ------------------
  |  |  383|  5.35M|#define D_PRED_NON_16x16  2
  ------------------
 1306|  5.35M|        UWORD32 u4_is_b = ps_dec->u1_B;
 1307|       |
 1308|  5.35M|        ih264d_fill_bs2_horz_vert(
 1309|  5.35M|                        pu4_bs_table, u2_left_csbp, u2_top_csbp, u2_cur_csbp,
 1310|  5.35M|                        (const UWORD32 *)(gau4_ih264d_packed_bs2),
 1311|  5.35M|                        (const UWORD16 *)(gau2_ih264d_4x4_v2h_reorder));
 1312|       |
 1313|  5.35M|        if(u4_leftmbtype & D_INTRA_MB)
  ------------------
  |  |  382|  5.35M|#define D_INTRA_MB        1
  ------------------
  |  Branch (1313:12): [True: 6.01k, False: 5.35M]
  ------------------
 1314|  6.01k|            pu4_bs_table[4] = 0x04040404;
 1315|       |
 1316|  5.35M|        if(u1_top_mb_typ & D_INTRA_MB)
  ------------------
  |  |  382|  5.35M|#define D_INTRA_MB        1
  ------------------
  |  Branch (1316:12): [True: 25.4k, False: 5.33M]
  ------------------
 1317|  25.4k|            pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  Branch (1317:31): [True: 0, False: 25.4k]
  ------------------
 1318|       |
 1319|  5.35M|        ps_dec->pf_fill_bs1[u4_is_b][u4_is_non16x16](
 1320|  5.35M|                        ps_cur_mv_pred, ps_top_mv_pred, apv_map_ref_idx_to_poc,
 1321|  5.35M|                        pu4_bs_table, ps_left_mv_pred,
 1322|  5.35M|                        &(ps_dec->ps_left_mvpred_addr[u1_pingpong][1]),
 1323|  5.35M|                        ps_cur_mb_info->ps_top_mb->u4_pic_addrress,
 1324|  5.35M|                        (4 >> u4_cur_mb_fld));
 1325|  5.35M|    }
 1326|       |
 1327|  5.39M|    {
 1328|  5.39M|        void ** pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc +
 1329|  5.39M|        POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  5.39M|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  5.39M|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
 1330|  5.39M|        {
 1331|       |            /* Store Parameter for Top MvPred refernce frame Address */
 1332|       |
 1333|  5.39M|            void ** ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
 1334|  5.39M|            WORD8 * p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
 1335|  5.39M|            WORD8 * p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
 1336|       |
 1337|       |            /* Store Left addresses for Next Mb   */
 1338|  5.39M|            void ** ppv_left_mv_pred_addr =
 1339|  5.39M|                            ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
 1340|  5.39M|            WORD8 * p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
 1341|       |
 1342|  5.39M|            ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
 1343|  5.39M|            ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
 1344|       |
 1345|  5.39M|            ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
 1346|  5.39M|            ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
 1347|  5.39M|            ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
 1348|  5.39M|            ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
 1349|       |
 1350|  5.39M|            ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
 1351|  5.39M|            ppv_left_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refleft0[1]];
 1352|       |
 1353|       |            /* Storing the leftMbtype for next Mb */
 1354|  5.39M|            ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
 1355|       |
 1356|  5.39M|        }
 1357|  5.39M|    }
 1358|       |
 1359|       |    /* For transform 8x8 disable deblocking of the intrernal edges of a 8x8 block */
 1360|  5.39M|    if(ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (1360:8): [True: 117k, False: 5.27M]
  ------------------
 1361|   117k|    {
 1362|   117k|        pu4_bs_table[1] = 0;
 1363|   117k|        pu4_bs_table[3] = 0;
 1364|   117k|        pu4_bs_table[5] = 0;
 1365|   117k|        pu4_bs_table[7] = 0;
 1366|   117k|    }
 1367|  5.39M|}

ih264d_filter_boundary_left_nonmbaff:
   87|  4.73M|{
   88|  4.73M|    UWORD8 *pu1_y, *pu1_u, *pu1_v;
   89|  4.73M|    WORD32 uc_tmp, qp_avg;
   90|  4.73M|    WORD32 alpha_u = 0, beta_u = 0, alpha_v = 0, beta_v = 0;
   91|  4.73M|    WORD32 alpha_y = 0, beta_y = 0;
   92|       |
   93|  4.73M|    WORD32 idx_b_u, idx_a_u, idx_b_v, idx_a_v;
   94|  4.73M|    WORD32 idx_b_y, idx_a_y;
   95|       |
   96|  4.73M|    UWORD32 u4_bs_val;
   97|       |
   98|  4.73M|    UWORD8 *pu1_cliptab_u, *pu1_cliptab_v, *pu1_cliptab_y;
   99|       |
  100|  4.73M|    UWORD8 u1_double_cl = !ps_cur_mb->u1_single_call;
  101|  4.73M|    WORD32 ofst_a = ps_cur_mb->i1_slice_alpha_c0_offset;
  102|  4.73M|    WORD32 ofst_b = ps_cur_mb->i1_slice_beta_offset;
  103|       |
  104|  4.73M|    PROFILE_DISABLE_DEBLK()
  ------------------
  |  |   91|  4.73M|#define PROFILE_DISABLE_DEBLK() ;
  ------------------
  105|       |
  106|  4.73M|    pu1_y = ps_tfr_cxt->pu1_mb_y;
  107|  4.73M|    pu1_u = ps_tfr_cxt->pu1_mb_u;
  108|  4.73M|    pu1_v = ps_tfr_cxt->pu1_mb_v;
  109|       |
  110|       |    /* LUMA values */
  111|       |    /* Deblock rounding change */
  112|  4.73M|    qp_avg =
  113|  4.73M|                    (UWORD8)((ps_cur_mb->u1_left_mb_qp + ps_cur_mb->u1_mb_qp + 1)
  114|  4.73M|                                    >> 1);
  115|       |
  116|  4.73M|    idx_a_y = qp_avg + ofst_a;
  117|  4.73M|    alpha_y = gau1_ih264d_alpha_table[12 + idx_a_y];
  118|  4.73M|    idx_b_y = qp_avg + ofst_b;
  119|  4.73M|    beta_y = gau1_ih264d_beta_table[12 + idx_b_y];
  120|       |
  121|       |    /* Chroma cb values */
  122|  4.73M|    {
  123|  4.73M|        WORD32 mb_qp1, mb_qp2;
  124|  4.73M|        mb_qp1 = (ps_cur_mb->u1_left_mb_qp + i1_cb_qp_idx_ofst);
  125|  4.73M|        mb_qp2 = (ps_cur_mb->u1_mb_qp + i1_cb_qp_idx_ofst);
  126|  4.73M|        qp_avg = (UWORD8)((gau1_ih264d_qp_scale_cr[12 + mb_qp1]
  127|  4.73M|                        + gau1_ih264d_qp_scale_cr[12 + mb_qp2] + 1) >> 1);
  128|  4.73M|    }
  129|  4.73M|    idx_a_u = qp_avg + ofst_a;
  130|  4.73M|    alpha_u = gau1_ih264d_alpha_table[12 + idx_a_u];
  131|  4.73M|    idx_b_u = qp_avg + ofst_b;
  132|  4.73M|    beta_u = gau1_ih264d_beta_table[12 + idx_b_u];
  133|       |    /* Chroma cr values */
  134|  4.73M|    {
  135|  4.73M|        WORD32 mb_qp1, mb_qp2;
  136|  4.73M|        mb_qp1 = (ps_cur_mb->u1_left_mb_qp + i1_cr_qp_idx_ofst);
  137|  4.73M|        mb_qp2 = (ps_cur_mb->u1_mb_qp + i1_cr_qp_idx_ofst);
  138|  4.73M|        qp_avg = (UWORD8)((gau1_ih264d_qp_scale_cr[12 + mb_qp1]
  139|  4.73M|                        + gau1_ih264d_qp_scale_cr[12 + mb_qp2] + 1) >> 1);
  140|  4.73M|    }
  141|  4.73M|    idx_a_v = qp_avg + ofst_a;
  142|  4.73M|    alpha_v = gau1_ih264d_alpha_table[12 + idx_a_v];
  143|  4.73M|    idx_b_v = qp_avg + ofst_b;
  144|  4.73M|    beta_v = gau1_ih264d_beta_table[12 + idx_b_v];
  145|       |
  146|  4.73M|    if(u1_double_cl == 0)
  ------------------
  |  Branch (146:8): [True: 3.63M, False: 1.09M]
  ------------------
  147|  3.63M|    {
  148|  3.63M|        u4_bs_val = pu4_bs_tab[4];
  149|       |
  150|  3.63M|        if(0x04040404 == u4_bs_val)
  ------------------
  |  Branch (150:12): [True: 79.9k, False: 3.55M]
  ------------------
  151|  79.9k|        {
  152|  79.9k|            ps_dec->pf_deblk_luma_vert_bs4(pu1_y, i4_strd_y, alpha_y, beta_y);
  153|  79.9k|            ps_dec->pf_deblk_chroma_vert_bs4(pu1_u, i4_strd_uv, alpha_u,
  154|  79.9k|                                             beta_u, alpha_v, beta_v);
  155|  79.9k|        }
  156|  3.55M|        else
  157|  3.55M|        {
  158|  3.55M|            if(u4_bs_val)
  ------------------
  |  Branch (158:16): [True: 136k, False: 3.42M]
  ------------------
  159|   136k|            {
  160|       |
  161|   136k|                pu1_cliptab_y = (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_y];
  162|   136k|                pu1_cliptab_u = (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_u];
  163|   136k|                pu1_cliptab_v = (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_v];
  164|   136k|                ps_dec->pf_deblk_luma_vert_bslt4(pu1_y, i4_strd_y, alpha_y,
  165|   136k|                                                 beta_y, u4_bs_val,
  166|   136k|                                                 pu1_cliptab_y);
  167|   136k|                ps_dec->pf_deblk_chroma_vert_bslt4(pu1_u, i4_strd_uv, alpha_u,
  168|   136k|                                                   beta_u, alpha_v, beta_v,
  169|   136k|                                                   u4_bs_val, pu1_cliptab_u,
  170|   136k|                                                   pu1_cliptab_v);
  171|       |
  172|   136k|            }
  173|  3.55M|        }
  174|       |
  175|  3.63M|    }
  176|  1.09M|    else
  177|  1.09M|    {
  178|       |
  179|  1.09M|        i4_strd_y <<= (!u1_cur_fld);
  180|  1.09M|        u4_bs_val = pu4_bs_tab[4];
  181|  1.09M|        i4_strd_uv <<= (!u1_cur_fld);
  182|       |
  183|  1.09M|        if(0x04040404 == u4_bs_val)
  ------------------
  |  Branch (183:12): [True: 0, False: 1.09M]
  ------------------
  184|      0|        {
  185|       |
  186|      0|            ps_dec->pf_deblk_luma_vert_bs4_mbaff(pu1_y, i4_strd_y, alpha_y,
  187|      0|                                                 beta_y);
  188|      0|            ps_dec->pf_deblk_chroma_vert_bs4_mbaff(pu1_u, i4_strd_uv, alpha_u,
  189|      0|                                                   beta_u, alpha_v, beta_v);
  190|       |
  191|      0|        }
  192|  1.09M|        else
  193|  1.09M|        {
  194|  1.09M|            if(u4_bs_val)
  ------------------
  |  Branch (194:16): [True: 0, False: 1.09M]
  ------------------
  195|      0|            {
  196|       |
  197|      0|                pu1_cliptab_y = (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_y];
  198|      0|                pu1_cliptab_u = (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_u];
  199|      0|                pu1_cliptab_v = (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_v];
  200|       |
  201|      0|                ps_dec->pf_deblk_luma_vert_bslt4_mbaff(pu1_y, i4_strd_y,
  202|      0|                                                       alpha_y, beta_y,
  203|      0|                                                       u4_bs_val,
  204|      0|                                                       pu1_cliptab_y);
  205|      0|                ps_dec->pf_deblk_chroma_vert_bslt4_mbaff(pu1_u, i4_strd_uv,
  206|      0|                                                         alpha_u, beta_u,
  207|      0|                                                         alpha_v, beta_v,
  208|      0|                                                         u4_bs_val,
  209|      0|                                                         pu1_cliptab_u,
  210|      0|                                                         pu1_cliptab_v);
  211|      0|            }
  212|  1.09M|        }
  213|       |
  214|  1.09M|        {
  215|       |
  216|  1.09M|            UWORD16 u2_shift = (i4_strd_y >> 1) << (u1_cur_fld ? 4 : 0);
  ------------------
  |  Branch (216:53): [True: 0, False: 1.09M]
  ------------------
  217|  1.09M|            pu1_y += u2_shift;
  218|  1.09M|            u2_shift = (i4_strd_uv >> 1) << (u1_cur_fld ? 3 : 0);
  ------------------
  |  Branch (218:46): [True: 0, False: 1.09M]
  ------------------
  219|  1.09M|            pu1_u += u2_shift;
  220|  1.09M|            pu1_v += u2_shift;
  221|  1.09M|        }
  222|       |
  223|  1.09M|        qp_avg = (((ps_left_mb + 1)->u1_mb_qp + ps_cur_mb->u1_mb_qp + 1) >> 1);
  224|       |
  225|  1.09M|        idx_a_y = qp_avg + ofst_a;
  226|  1.09M|        alpha_y = gau1_ih264d_alpha_table[12 + idx_a_y];
  227|  1.09M|        idx_b_y = qp_avg + ofst_b;
  228|  1.09M|        beta_y = gau1_ih264d_beta_table[12 + idx_b_y];
  229|  1.09M|        u4_bs_val = pu4_bs_tab[9];
  230|       |
  231|  1.09M|        {
  232|  1.09M|            WORD32 mb_qp1, mb_qp2;
  233|  1.09M|            mb_qp1 = ((ps_left_mb + 1)->u1_mb_qp + i1_cb_qp_idx_ofst);
  234|  1.09M|            mb_qp2 = (ps_cur_mb->u1_mb_qp + i1_cb_qp_idx_ofst);
  235|  1.09M|            qp_avg = (UWORD8)((gau1_ih264d_qp_scale_cr[12 + mb_qp1]
  236|  1.09M|                            + gau1_ih264d_qp_scale_cr[12 + mb_qp2] + 1) >> 1);
  237|  1.09M|        }
  238|  1.09M|        idx_a_u = qp_avg + ofst_a;
  239|  1.09M|        alpha_u = gau1_ih264d_alpha_table[12 + idx_a_u];
  240|  1.09M|        idx_b_u = qp_avg + ofst_b;
  241|  1.09M|        beta_u = gau1_ih264d_beta_table[12 + idx_b_u];
  242|  1.09M|        u4_bs_val = pu4_bs_tab[9];
  243|  1.09M|        {
  244|  1.09M|            WORD32 mb_qp1, mb_qp2;
  245|  1.09M|            mb_qp1 = ((ps_left_mb + 1)->u1_mb_qp + i1_cr_qp_idx_ofst);
  246|  1.09M|            mb_qp2 = (ps_cur_mb->u1_mb_qp + i1_cr_qp_idx_ofst);
  247|  1.09M|            qp_avg = (UWORD8)((gau1_ih264d_qp_scale_cr[12 + mb_qp1]
  248|  1.09M|                            + gau1_ih264d_qp_scale_cr[12 + mb_qp2] + 1) >> 1);
  249|  1.09M|        }
  250|  1.09M|        idx_a_v = qp_avg + ofst_a;
  251|  1.09M|        alpha_v = gau1_ih264d_alpha_table[12 + idx_a_v];
  252|  1.09M|        idx_b_v = qp_avg + ofst_b;
  253|  1.09M|        beta_v = gau1_ih264d_beta_table[12 + idx_b_v];
  254|       |
  255|  1.09M|        if(0x04040404 == u4_bs_val)
  ------------------
  |  Branch (255:12): [True: 0, False: 1.09M]
  ------------------
  256|      0|        {
  257|      0|            ps_dec->pf_deblk_luma_vert_bs4_mbaff(pu1_y, i4_strd_y, alpha_y,
  258|      0|                                                 beta_y);
  259|      0|            ps_dec->pf_deblk_chroma_vert_bs4_mbaff(pu1_u, i4_strd_uv, alpha_u,
  260|      0|                                                   beta_u, alpha_v, beta_v);
  261|       |
  262|      0|        }
  263|  1.09M|        else
  264|  1.09M|        {
  265|  1.09M|            if(u4_bs_val)
  ------------------
  |  Branch (265:16): [True: 0, False: 1.09M]
  ------------------
  266|      0|            {
  267|       |
  268|      0|                pu1_cliptab_y = (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_y];
  269|      0|                pu1_cliptab_u = (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_u];
  270|      0|                pu1_cliptab_v = (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_v];
  271|       |
  272|      0|                ps_dec->pf_deblk_luma_vert_bslt4_mbaff(pu1_y, i4_strd_y,
  273|      0|                                                       alpha_y, beta_y,
  274|      0|                                                       u4_bs_val,
  275|      0|                                                       pu1_cliptab_y);
  276|      0|                ps_dec->pf_deblk_chroma_vert_bslt4_mbaff(pu1_u, i4_strd_uv,
  277|      0|                                                         alpha_u, beta_u,
  278|      0|                                                         alpha_v, beta_v,
  279|      0|                                                         u4_bs_val,
  280|      0|                                                         pu1_cliptab_u,
  281|      0|                                                         pu1_cliptab_v);
  282|       |
  283|      0|            }
  284|  1.09M|        }
  285|  1.09M|    }
  286|       |
  287|  4.73M|}
ih264d_filter_boundary_top_nonmbaff:
  310|  5.41M|{
  311|  5.41M|    UWORD8 *pu1_y, *pu1_u;
  312|  5.41M|    WORD32 alpha_u = 0, beta_u = 0, alpha_v = 0, beta_v = 0;
  313|  5.41M|    WORD32 alpha_y = 0, beta_y = 0;
  314|  5.41M|    WORD32 qp_avg;
  315|  5.41M|    WORD32 idx_b_u, idx_a_u, idx_b_v, idx_a_v;
  316|  5.41M|    WORD32 idx_b_y, idx_a_y;
  317|  5.41M|    UWORD16 uc_tmp;
  318|       |
  319|  5.41M|    UWORD8 *pu1_cliptab_u, *pu1_cliptab_v, *pu1_cliptab_y;
  320|  5.41M|    WORD32 ofst_a = ps_cur_mb->i1_slice_alpha_c0_offset;
  321|  5.41M|    WORD32 ofst_b = ps_cur_mb->i1_slice_beta_offset;
  322|       |
  323|  5.41M|    UNUSED(ps_top_mb);
  ------------------
  |  |   45|  5.41M|#define UNUSED(x) ((void)(x))
  ------------------
  324|       |    /* LUMA values */
  325|       |    /* Deblock rounding change */
  326|  5.41M|    uc_tmp = ((ps_cur_mb->u1_topmb_qp + ps_cur_mb->u1_mb_qp + 1) >> 1);
  327|  5.41M|    qp_avg = (UWORD8)uc_tmp;
  328|  5.41M|    idx_a_y = qp_avg + ofst_a;
  329|  5.41M|    alpha_y = gau1_ih264d_alpha_table[12 + idx_a_y];
  330|  5.41M|    idx_b_y = qp_avg + ofst_b;
  331|  5.41M|    beta_y = gau1_ih264d_beta_table[12 + idx_b_y];
  332|  5.41M|    pu1_y = ps_tfr_cxt->pu1_mb_y;
  333|       |
  334|       |    /* CHROMA cb values */
  335|  5.41M|    {
  336|  5.41M|        WORD32 mb_qp1, mb_qp2;
  337|  5.41M|        mb_qp1 = (ps_cur_mb->u1_topmb_qp + i1_cb_qp_idx_ofst);
  338|  5.41M|        mb_qp2 = (ps_cur_mb->u1_mb_qp + i1_cb_qp_idx_ofst);
  339|  5.41M|        qp_avg = (UWORD8)((gau1_ih264d_qp_scale_cr[12 + mb_qp1]
  340|  5.41M|                        + gau1_ih264d_qp_scale_cr[12 + mb_qp2] + 1) >> 1);
  341|  5.41M|    }
  342|       |
  343|  5.41M|    idx_a_u = qp_avg + ofst_a;
  344|  5.41M|    alpha_u = gau1_ih264d_alpha_table[12 + idx_a_u];
  345|  5.41M|    idx_b_u = qp_avg + ofst_b;
  346|  5.41M|    beta_u = gau1_ih264d_beta_table[12 + idx_b_u];
  347|       |    /* CHROMA cr values */
  348|  5.41M|    {
  349|  5.41M|        WORD32 mb_qp1, mb_qp2;
  350|  5.41M|        mb_qp1 = (ps_cur_mb->u1_topmb_qp + i1_cr_qp_idx_ofst);
  351|  5.41M|        mb_qp2 = (ps_cur_mb->u1_mb_qp + i1_cr_qp_idx_ofst);
  352|  5.41M|        qp_avg = (UWORD8)((gau1_ih264d_qp_scale_cr[12 + mb_qp1]
  353|  5.41M|                        + gau1_ih264d_qp_scale_cr[12 + mb_qp2] + 1) >> 1);
  354|  5.41M|    }
  355|       |
  356|  5.41M|    idx_a_v = qp_avg + ofst_a;
  357|  5.41M|    alpha_v = gau1_ih264d_alpha_table[12 + idx_a_v];
  358|  5.41M|    idx_b_v = qp_avg + ofst_b;
  359|  5.41M|    beta_v = gau1_ih264d_beta_table[12 + idx_b_v];
  360|  5.41M|    pu1_u = ps_tfr_cxt->pu1_mb_u;
  361|       |
  362|  5.41M|    if(u4_bs == 0x04040404)
  ------------------
  |  Branch (362:8): [True: 91.7k, False: 5.32M]
  ------------------
  363|  91.7k|    {
  364|       |        /* Code specific to the assembly module */
  365|       |
  366|  91.7k|        ps_dec->pf_deblk_luma_horz_bs4(pu1_y, i4_strd_y, alpha_y, beta_y);
  367|  91.7k|        ps_dec->pf_deblk_chroma_horz_bs4(pu1_u, i4_strd_uv, alpha_u, beta_u,
  368|  91.7k|                                         alpha_v, beta_v);
  369|  91.7k|    }
  370|  5.32M|    else
  371|  5.32M|    {
  372|  5.32M|        if(u4_bs)
  ------------------
  |  Branch (372:12): [True: 179k, False: 5.14M]
  ------------------
  373|   179k|        {
  374|       |
  375|   179k|            pu1_cliptab_y = (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_y];
  376|   179k|            pu1_cliptab_u =
  377|   179k|                            (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_u];
  378|   179k|            pu1_cliptab_v =
  379|   179k|                            (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_v];
  380|       |
  381|   179k|            ps_dec->pf_deblk_luma_horz_bslt4(pu1_y, i4_strd_y, alpha_y, beta_y,
  382|   179k|                                             u4_bs, pu1_cliptab_y);
  383|   179k|            ps_dec->pf_deblk_chroma_horz_bslt4(pu1_u, i4_strd_uv, alpha_u,
  384|   179k|                                               beta_u, alpha_v, beta_v,
  385|   179k|                                               u4_bs, pu1_cliptab_u,
  386|   179k|                                               pu1_cliptab_v);
  387|       |
  388|   179k|        }
  389|  5.32M|    }
  390|       |
  391|  5.41M|}
ih264d_deblock_mb_nonmbaff:
  399|  7.06M|{
  400|  7.06M|    UWORD8 *pu1_y, *pu1_u;
  401|  7.06M|    UWORD32 u4_bs;
  402|       |
  403|  7.06M|    WORD32 alpha, beta, alpha_u, beta_u, alpha_v, beta_v;
  404|       |
  405|  7.06M|    UWORD8 *pu1_cliptab_u;
  406|  7.06M|    UWORD8 *pu1_cliptab_v;
  407|  7.06M|    UWORD8 *pu1_cliptab_y;
  408|       |
  409|  7.06M|    UWORD32 * pu4_bs_tab;
  410|  7.06M|    WORD32 idx_a_y, idx_a_u, idx_a_v;
  411|  7.06M|    UWORD32 u4_deb_mode, u4_mbs_next;
  412|  7.06M|    UWORD32 u4_image_wd_mb;
  413|  7.06M|    deblk_mb_t *ps_top_mb,*ps_left_mb,*ps_cur_mb;
  414|       |
  415|  7.06M|    PROFILE_DISABLE_DEBLK()
  ------------------
  |  |   91|  7.06M|#define PROFILE_DISABLE_DEBLK() ;
  ------------------
  416|       |    /* Return from here to switch off deblocking */
  417|       |
  418|  7.06M|    u4_image_wd_mb = ps_dec->u2_frm_wd_in_mbs;
  419|       |
  420|  7.06M|    ps_cur_mb = ps_dec->ps_cur_deblk_mb;
  421|  7.06M|    pu4_bs_tab = ps_cur_mb->u4_bs_table;
  422|  7.06M|    u4_deb_mode = ps_cur_mb->u1_deblocking_mode;
  423|  7.06M|     if(!(u4_deb_mode & MB_DISABLE_FILTERING))
  ------------------
  |  |   70|  7.06M|#define MB_DISABLE_FILTERING          0x01
  ------------------
  |  Branch (423:9): [True: 5.71M, False: 1.34M]
  ------------------
  424|  5.71M|     {
  425|       |
  426|  5.71M|         if(ps_dec->u4_deblk_mb_x)
  ------------------
  |  Branch (426:13): [True: 4.73M, False: 985k]
  ------------------
  427|  4.73M|         {
  428|  4.73M|             ps_left_mb = ps_cur_mb - 1;
  429|       |
  430|  4.73M|         }
  431|   985k|         else
  432|   985k|         {
  433|   985k|             ps_left_mb = NULL;
  434|       |
  435|   985k|         }
  436|  5.71M|         if(ps_dec->u4_deblk_mb_y != 0)
  ------------------
  |  Branch (436:13): [True: 5.42M, False: 291k]
  ------------------
  437|  5.42M|         {
  438|  5.42M|             ps_top_mb = ps_cur_mb - (u4_image_wd_mb);
  439|  5.42M|         }
  440|   291k|         else
  441|   291k|         {
  442|   291k|             ps_top_mb = NULL;
  443|   291k|         }
  444|       |
  445|  5.71M|         if(u4_deb_mode & MB_DISABLE_LEFT_EDGE)
  ------------------
  |  |   72|  5.71M|#define MB_DISABLE_LEFT_EDGE          0x04
  ------------------
  |  Branch (445:13): [True: 103k, False: 5.61M]
  ------------------
  446|   103k|             ps_left_mb = NULL;
  447|  5.71M|         if(u4_deb_mode & MB_DISABLE_TOP_EDGE)
  ------------------
  |  |   71|  5.71M|#define MB_DISABLE_TOP_EDGE           0x02
  ------------------
  |  Branch (447:13): [True: 40.9k, False: 5.67M]
  ------------------
  448|  40.9k|             ps_top_mb = NULL;
  449|       |
  450|       |        /*---------------------------------------------------------------------*/
  451|       |        /* Filter wrt Left edge                                                */
  452|       |        /* except                                                              */
  453|       |        /*      - Left Egde is Picture Boundary                                */
  454|       |        /*      - Left Egde is part of Slice Boundary and Deblocking           */
  455|       |        /*        parameters of slice disable Filtering of Slice Boundary Edges*/
  456|       |        /*---------------------------------------------------------------------*/
  457|  5.71M|        if(ps_left_mb)
  ------------------
  |  Branch (457:12): [True: 4.73M, False: 986k]
  ------------------
  458|  4.73M|            ih264d_filter_boundary_left_nonmbaff(ps_dec, ps_tfr_cxt,
  459|  4.73M|                                                 i1_cb_qp_idx_ofst,
  460|  4.73M|                                                 i1_cr_qp_idx_ofst, ps_cur_mb,
  461|  4.73M|                                                 i4_strd_y, i4_strd_uv, ps_left_mb,
  462|  4.73M|                                                 pu4_bs_tab, 0);
  463|       |
  464|       |        /*--------------------------------------------------------------------*/
  465|       |        /* Filter wrt Other Vertical Edges                                    */
  466|       |        /*--------------------------------------------------------------------*/
  467|  5.71M|        {
  468|  5.71M|            WORD32 ofst_a, ofst_b, idx_b_y, idx_b_u,
  469|  5.71M|                            idx_b_v;
  470|  5.71M|            WORD32 qp_avg, qp_avg_u, qp_avg_v;
  471|  5.71M|            ofst_a = ps_cur_mb->i1_slice_alpha_c0_offset;
  472|  5.71M|            ofst_b = ps_cur_mb->i1_slice_beta_offset;
  473|       |
  474|  5.71M|            qp_avg = ps_cur_mb->u1_mb_qp;
  475|       |
  476|  5.71M|            idx_a_y = qp_avg + ofst_a;
  477|  5.71M|            alpha = gau1_ih264d_alpha_table[12 + idx_a_y];
  478|  5.71M|            idx_b_y = qp_avg + ofst_b;
  479|  5.71M|            beta = gau1_ih264d_beta_table[12 + idx_b_y];
  480|       |
  481|       |            /* CHROMA values */
  482|       |            /* CHROMA Cb values */
  483|  5.71M|            qp_avg_u = (qp_avg + i1_cb_qp_idx_ofst);
  484|  5.71M|            qp_avg_u = gau1_ih264d_qp_scale_cr[12 + qp_avg_u];
  485|  5.71M|            idx_a_u = qp_avg_u + ofst_a;
  486|  5.71M|            alpha_u = gau1_ih264d_alpha_table[12 + idx_a_u];
  487|  5.71M|            idx_b_u = qp_avg_u + ofst_b;
  488|  5.71M|            beta_u = gau1_ih264d_beta_table[12 + idx_b_u];
  489|       |            /* CHROMA Cr values */
  490|  5.71M|            qp_avg_v = (qp_avg + i1_cr_qp_idx_ofst);
  491|  5.71M|            qp_avg_v = gau1_ih264d_qp_scale_cr[12 + qp_avg_v];
  492|  5.71M|            idx_a_v = qp_avg_v + ofst_a;
  493|  5.71M|            alpha_v = gau1_ih264d_alpha_table[12 + idx_a_v];
  494|  5.71M|            idx_b_v = qp_avg_v + ofst_b;
  495|  5.71M|            beta_v = gau1_ih264d_beta_table[12 + idx_b_v];
  496|  5.71M|        }
  497|       |
  498|  5.71M|        pu1_cliptab_y = (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_y]; //this for Luma
  499|  5.71M|        pu1_cliptab_u = (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_u]; //this for chroma
  500|  5.71M|        pu1_cliptab_v = (UWORD8 *)&gau1_ih264d_clip_table[12 + idx_a_v]; //this for chroma
  501|       |
  502|       |        //edge=1
  503|       |
  504|       |
  505|  5.71M|        u4_bs = pu4_bs_tab[5];
  506|  5.71M|        pu1_y = ps_tfr_cxt->pu1_mb_y;
  507|  5.71M|        pu1_u = ps_tfr_cxt->pu1_mb_u;
  508|       |
  509|  5.71M|        if(u4_bs)
  ------------------
  |  Branch (509:12): [True: 116k, False: 5.60M]
  ------------------
  510|   116k|        {
  511|       |
  512|   116k|            ps_dec->pf_deblk_luma_vert_bslt4(pu1_y + 4, i4_strd_y, alpha, beta,
  513|   116k|                                             u4_bs, pu1_cliptab_y);
  514|       |
  515|   116k|        }
  516|       |        //edge=2
  517|       |
  518|  5.71M|        u4_bs = pu4_bs_tab[6];
  519|  5.71M|        if(u4_bs)
  ------------------
  |  Branch (519:12): [True: 189k, False: 5.53M]
  ------------------
  520|   189k|        {
  521|   189k|            ps_dec->pf_deblk_luma_vert_bslt4(pu1_y + 8, i4_strd_y, alpha, beta,
  522|   189k|                                             u4_bs, pu1_cliptab_y);
  523|   189k|            ps_dec->pf_deblk_chroma_vert_bslt4(pu1_u + 4 * YUV420SP_FACTOR,
  ------------------
  |  |  119|   189k|#define YUV420SP_FACTOR 2
  ------------------
  524|   189k|                                               i4_strd_uv, alpha_u, beta_u,
  525|   189k|                                               alpha_v, beta_v, u4_bs,
  526|   189k|                                               pu1_cliptab_u, pu1_cliptab_v);
  527|       |
  528|   189k|        }
  529|       |        //edge=3
  530|       |
  531|  5.71M|        u4_bs = pu4_bs_tab[7];
  532|  5.71M|        if(u4_bs)
  ------------------
  |  Branch (532:12): [True: 105k, False: 5.61M]
  ------------------
  533|   105k|        {
  534|   105k|            ps_dec->pf_deblk_luma_vert_bslt4(pu1_y + 12, i4_strd_y, alpha, beta,
  535|   105k|                                             u4_bs, pu1_cliptab_y);
  536|       |
  537|   105k|        }
  538|       |
  539|       |        /*--------------------------------------------------------------------*/
  540|       |        /* Filter wrt Top edge                                                */
  541|       |        /* except                                                             */
  542|       |        /*      - Top Egde is Picture Boundary                                */
  543|       |        /*      - Top Egde is part of Slice Boundary and Deblocking           */
  544|       |        /*        parameters of slice disable Filtering of Slice Boundary Edges*/
  545|       |        /*--------------------------------------------------------------------*/
  546|  5.71M|        if(ps_top_mb)
  ------------------
  |  Branch (546:12): [True: 5.41M, False: 299k]
  ------------------
  547|  5.41M|        {
  548|       |            /** if top MB and MB AFF and cur MB is frame and top is field then  */
  549|       |            /*  one extra top edge needs to be deblocked                        */
  550|       |
  551|  5.41M|            ih264d_filter_boundary_top_nonmbaff(ps_dec, ps_tfr_cxt,
  552|  5.41M|                                                i1_cb_qp_idx_ofst,
  553|  5.41M|                                                i1_cr_qp_idx_ofst, ps_cur_mb,
  554|  5.41M|                                                i4_strd_y, i4_strd_uv, ps_top_mb,
  555|  5.41M|                                                pu4_bs_tab[0]);
  556|       |
  557|  5.41M|        }
  558|       |
  559|       |        /*--------------------------------------------------------------------*/
  560|       |        /* Filter wrt Other Horizontal Edges                                  */
  561|       |        /*--------------------------------------------------------------------*/
  562|       |
  563|       |        //edge1
  564|  5.71M|        u4_bs = pu4_bs_tab[1];
  565|       |
  566|  5.71M|        if(u4_bs)
  ------------------
  |  Branch (566:12): [True: 112k, False: 5.60M]
  ------------------
  567|   112k|        {
  568|   112k|            ps_dec->pf_deblk_luma_horz_bslt4(pu1_y + (i4_strd_y << 2), i4_strd_y,
  569|   112k|                                             alpha, beta, u4_bs, pu1_cliptab_y);
  570|       |
  571|   112k|        }
  572|       |        //edge2
  573|  5.71M|        u4_bs = pu4_bs_tab[2];
  574|       |
  575|  5.71M|        if(u4_bs)
  ------------------
  |  Branch (575:12): [True: 193k, False: 5.52M]
  ------------------
  576|   193k|        {
  577|       |
  578|   193k|            ps_dec->pf_deblk_luma_horz_bslt4(pu1_y + (i4_strd_y << 3), i4_strd_y,
  579|   193k|                                             alpha, beta, u4_bs, pu1_cliptab_y);
  580|   193k|            ps_dec->pf_deblk_chroma_horz_bslt4(pu1_u + (i4_strd_uv << 2),
  581|   193k|                                               i4_strd_uv, alpha_u, beta_u,
  582|   193k|                                               alpha_v, beta_v, u4_bs,
  583|   193k|                                               pu1_cliptab_u, pu1_cliptab_v);
  584|       |
  585|   193k|        }
  586|       |        //edge3
  587|  5.71M|        u4_bs = pu4_bs_tab[3];
  588|  5.71M|        if(u4_bs)
  ------------------
  |  Branch (588:12): [True: 106k, False: 5.61M]
  ------------------
  589|   106k|        {
  590|   106k|            ps_dec->pf_deblk_luma_horz_bslt4(
  591|   106k|                            (pu1_y + (i4_strd_y << 3) + (i4_strd_y << 2)),
  592|   106k|                            i4_strd_y, alpha, beta, u4_bs, pu1_cliptab_y);
  593|       |
  594|   106k|        }
  595|  5.71M|     }
  596|       |
  597|  7.06M|     ps_dec->u4_deblk_mb_x++;
  598|  7.06M|     ps_dec->ps_cur_deblk_mb++;
  599|  7.06M|     ps_dec->u4_cur_deblk_mb_num++;
  600|  7.06M|     u4_mbs_next = u4_image_wd_mb - ps_dec->u4_deblk_mb_x;
  601|       |
  602|  7.06M|     ps_tfr_cxt->pu1_mb_y += 16;
  603|  7.06M|     ps_tfr_cxt->pu1_mb_u += 8 * YUV420SP_FACTOR;
  ------------------
  |  |  119|  7.06M|#define YUV420SP_FACTOR 2
  ------------------
  604|  7.06M|     ps_tfr_cxt->pu1_mb_v += 8;
  605|       |
  606|  7.06M|     if(!u4_mbs_next)
  ------------------
  |  Branch (606:9): [True: 1.27M, False: 5.79M]
  ------------------
  607|  1.27M|     {
  608|  1.27M|         ps_tfr_cxt->pu1_mb_y += ps_tfr_cxt->u4_y_inc;
  609|  1.27M|         ps_tfr_cxt->pu1_mb_u += ps_tfr_cxt->u4_uv_inc;
  610|  1.27M|         ps_tfr_cxt->pu1_mb_v += ps_tfr_cxt->u4_uv_inc;
  611|  1.27M|         ps_dec->u4_deblk_mb_y++;
  612|  1.27M|         ps_dec->u4_deblk_mb_x = 0;
  613|  1.27M|     }
  614|       |
  615|  7.06M|}
ih264d_init_deblk_tfr_ctxt:
  634|   274k|{
  635|       |
  636|   274k|    UWORD32 i4_wd_y;
  637|   274k|    UWORD32 i4_wd_uv;
  638|   274k|    UWORD8 u1_field_pic_flag = ps_dec->ps_cur_slice->u1_field_pic_flag; /*< Field u4_flag  */
  639|   274k|    UNUSED(u2_image_wd_mb);
  ------------------
  |  |   45|   274k|#define UNUSED(x) ((void)(x))
  ------------------
  640|   274k|    ps_tfr_cxt->pu1_src_y = ps_dec->s_cur_pic.pu1_buf1 - 4;
  641|   274k|    ps_tfr_cxt->pu1_src_u = ps_dec->s_cur_pic.pu1_buf2 - 4;
  642|   274k|    ps_tfr_cxt->pu1_src_v = ps_dec->s_cur_pic.pu1_buf3 - 4;
  643|   274k|    ps_tfr_cxt->pu1_dest_y = ps_tfr_cxt->pu1_src_y;
  644|   274k|    ps_tfr_cxt->pu1_dest_u = ps_tfr_cxt->pu1_src_u;
  645|   274k|    ps_tfr_cxt->pu1_dest_v = ps_tfr_cxt->pu1_src_v;
  646|       |
  647|   274k|    ps_tfr_cxt->pu1_mb_y = ps_tfr_cxt->pu1_src_y + 4;
  648|   274k|    ps_tfr_cxt->pu1_mb_u = ps_tfr_cxt->pu1_src_u + 4;
  649|   274k|    ps_tfr_cxt->pu1_mb_v = ps_tfr_cxt->pu1_src_v + 4;
  650|       |
  651|   274k|    i4_wd_y = ps_dec->u2_frm_wd_y << u1_field_pic_flag;
  652|   274k|    i4_wd_uv = ps_dec->u2_frm_wd_uv << u1_field_pic_flag;
  653|   274k|    ps_tfr_cxt->u4_y_inc = ((i4_wd_y << u1_mbaff) * 16
  654|   274k|                    - (ps_dec->u2_frm_wd_in_mbs << 4));
  655|       |
  656|   274k|    ps_tfr_cxt->u4_uv_inc = (i4_wd_uv << u1_mbaff) * 8
  657|   274k|                    - (ps_dec->u2_frm_wd_in_mbs << 4);
  658|       |
  659|       |    /* padding related initialisations */
  660|   274k|    if(ps_dec->ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (660:8): [True: 238k, False: 35.8k]
  ------------------
  661|   238k|    {
  662|   238k|        ps_pad_mgr->u1_vert_pad_top = !(ps_dec->ps_cur_slice->u1_field_pic_flag
  ------------------
  |  Branch (662:41): [True: 0, False: 238k]
  ------------------
  663|      0|                        && ps_dec->ps_cur_slice->u1_bottom_field_flag);
  ------------------
  |  Branch (663:28): [True: 0, False: 0]
  ------------------
  664|   238k|        ps_pad_mgr->u1_vert_pad_bot =
  665|   238k|                        ((!ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (665:26): [True: 238k, False: 0]
  ------------------
  666|      0|                                        || ps_dec->ps_cur_slice->u1_bottom_field_flag);
  ------------------
  |  Branch (666:44): [True: 0, False: 0]
  ------------------
  667|   238k|        ps_pad_mgr->u1_horz_pad = 1;
  668|   238k|    }
  669|  35.8k|    else
  670|  35.8k|    {
  671|  35.8k|        ps_pad_mgr->u1_horz_pad = 0;
  672|  35.8k|        ps_pad_mgr->u1_vert_pad_top = 0;
  673|  35.8k|        ps_pad_mgr->u1_vert_pad_bot = 0;
  674|  35.8k|    }
  675|   274k|}
ih264d_deblock_picture_progressive:
 1103|   129k|{
 1104|   129k|    deblk_mb_t *ps_cur_mb;
 1105|       |
 1106|   129k|    UWORD8 u1_vert_pad_top = 1;
 1107|   129k|    UWORD8 u1_mbs_next;
 1108|   129k|    UWORD8 u1_deb_mode;
 1109|   129k|    WORD32 i4_wd_y, i4_wd_uv;
 1110|       |
 1111|       |
 1112|       |    /**************************************************/
 1113|       |    /* one time loads from ps_dec which will be used  */
 1114|       |    /* frequently throughout the deblocking procedure */
 1115|       |    /**************************************************/
 1116|   129k|    pad_mgr_t * ps_pad_mgr = &ps_dec->s_pad_mgr;
 1117|       |
 1118|   129k|    tfr_ctxt_t s_tfr_ctxt;
 1119|   129k|    tfr_ctxt_t * ps_tfr_cxt = &s_tfr_ctxt; // = &ps_dec->s_tran_addrecon;
 1120|   129k|    UWORD16 u2_image_wd_mb = ps_dec->u2_frm_wd_in_mbs;
 1121|   129k|    UWORD16 u2_image_ht_mb = ps_dec->u2_frm_ht_in_mbs;
 1122|   129k|    UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 1123|       |
 1124|   129k|    WORD8 i1_cb_qp_idx_ofst = ps_dec->ps_cur_pps->i1_chroma_qp_index_offset;
 1125|   129k|    WORD8 i1_cr_qp_idx_ofst =
 1126|   129k|                    ps_dec->ps_cur_pps->i1_second_chroma_qp_index_offset;
 1127|       |
 1128|       |    /* Set up Parameter for  deblocking */
 1129|   129k|    ih264d_init_deblk_tfr_ctxt(ps_dec, ps_pad_mgr, ps_tfr_cxt, u2_image_wd_mb,
 1130|   129k|                               0);
 1131|       |
 1132|       |    /* Pic level Initialisations */
 1133|       |
 1134|   129k|    i4_wd_y = ps_dec->u2_frm_wd_y;
 1135|   129k|    i4_wd_uv = ps_dec->u2_frm_wd_uv;
 1136|       |    /* Initial filling of the buffers with deblocking data */
 1137|   129k|    ps_cur_mb = ps_dec->ps_deblk_pic;
 1138|       |
 1139|   129k|    if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (1139:8): [True: 129k, False: 0]
  ------------------
 1140|   129k|    {
 1141|   129k|        if(ps_dec->ps_cur_sps->u1_mb_aff_flag == 1)
  ------------------
  |  Branch (1141:12): [True: 0, False: 129k]
  ------------------
 1142|      0|        {
 1143|      0|            while( ps_dec->u4_deblk_mb_y < u2_image_ht_mb)
  ------------------
  |  Branch (1143:20): [True: 0, False: 0]
  ------------------
 1144|      0|            {
 1145|      0|                ih264d_deblock_mb_nonmbaff(ps_dec, ps_tfr_cxt,
 1146|      0|                                           i1_cb_qp_idx_ofst,
 1147|      0|                                           i1_cr_qp_idx_ofst,
 1148|      0|                                           i4_wd_y, i4_wd_uv);
 1149|      0|                ps_cur_mb++;
 1150|      0|            }
 1151|      0|        }
 1152|       |
 1153|   129k|    }
 1154|       |
 1155|       |    //Padd the Picture
 1156|       |    //Horizontal Padd
 1157|   129k|    if(ps_pad_mgr->u1_horz_pad)
  ------------------
  |  Branch (1157:8): [True: 112k, False: 17.0k]
  ------------------
 1158|   112k|    {
 1159|   112k|        UWORD32 u1_field_pic_flag = ps_dec->ps_cur_slice->u1_field_pic_flag;
 1160|   112k|        ps_dec->pf_pad_left_luma(ps_tfr_cxt->pu1_src_y + 4,
 1161|   112k|                                 ps_dec->u2_frm_wd_y << u1_field_pic_flag,
 1162|   112k|                                 ps_dec->u2_pic_ht >> u1_field_pic_flag,
 1163|   112k|                                 PAD_LEN_Y_H);
  ------------------
  |  |  571|   112k|#define PAD_LEN_Y_H                   32
  ------------------
 1164|   112k|        ps_dec->pf_pad_right_luma(
 1165|   112k|                        ps_tfr_cxt->pu1_src_y + 4
 1166|   112k|                                        + (ps_dec->u2_frm_wd_in_mbs << 4),
 1167|   112k|                        ps_dec->u2_frm_wd_y << u1_field_pic_flag,
 1168|   112k|                        ps_dec->u2_pic_ht >> u1_field_pic_flag, PAD_LEN_Y_H);
  ------------------
  |  |  571|   112k|#define PAD_LEN_Y_H                   32
  ------------------
 1169|       |
 1170|   112k|        ps_dec->pf_pad_left_chroma(ps_tfr_cxt->pu1_src_u + 4,
 1171|   112k|                                   ps_dec->u2_frm_wd_uv << u1_field_pic_flag,
 1172|   112k|                                   (ps_dec->u2_pic_ht / 2) >> u1_field_pic_flag,
 1173|   112k|                                   PAD_LEN_UV_H * YUV420SP_FACTOR);
  ------------------
  |  |  573|   112k|#define PAD_LEN_UV_H                  16
  ------------------
                                                 PAD_LEN_UV_H * YUV420SP_FACTOR);
  ------------------
  |  |  119|   112k|#define YUV420SP_FACTOR 2
  ------------------
 1174|   112k|        ps_dec->pf_pad_right_chroma(
 1175|   112k|                        ps_tfr_cxt->pu1_src_u + 4
 1176|   112k|                                        + (ps_dec->u2_frm_wd_in_mbs << 4),
 1177|   112k|                        ps_dec->u2_frm_wd_uv << u1_field_pic_flag,
 1178|   112k|                        (ps_dec->u2_pic_ht / 2) >> u1_field_pic_flag,
 1179|   112k|                        PAD_LEN_UV_H * YUV420SP_FACTOR);
  ------------------
  |  |  573|   112k|#define PAD_LEN_UV_H                  16
  ------------------
                                      PAD_LEN_UV_H * YUV420SP_FACTOR);
  ------------------
  |  |  119|   112k|#define YUV420SP_FACTOR 2
  ------------------
 1180|       |
 1181|   112k|    }
 1182|       |
 1183|       |//Vertical Padd Top
 1184|   129k|    if(ps_pad_mgr->u1_vert_pad_top)
  ------------------
  |  Branch (1184:8): [True: 112k, False: 17.0k]
  ------------------
 1185|   112k|    {
 1186|   112k|        ps_dec->pf_pad_top(ps_dec->ps_cur_pic->pu1_buf1 - PAD_LEN_Y_H,
  ------------------
  |  |  571|   112k|#define PAD_LEN_Y_H                   32
  ------------------
 1187|   112k|                           ps_dec->u2_frm_wd_y, ps_dec->u2_frm_wd_y,
 1188|   112k|                           ps_pad_mgr->u1_pad_len_y_v);
 1189|   112k|        ps_dec->pf_pad_top(
 1190|   112k|                        ps_dec->ps_cur_pic->pu1_buf2
 1191|   112k|                                        - PAD_LEN_UV_H * YUV420SP_FACTOR,
  ------------------
  |  |  573|   112k|#define PAD_LEN_UV_H                  16
  ------------------
                                                      - PAD_LEN_UV_H * YUV420SP_FACTOR,
  ------------------
  |  |  119|   112k|#define YUV420SP_FACTOR 2
  ------------------
 1192|   112k|                        ps_dec->u2_frm_wd_uv, ps_dec->u2_frm_wd_uv,
 1193|   112k|                        ps_pad_mgr->u1_pad_len_cr_v);
 1194|       |
 1195|   112k|    }
 1196|       |
 1197|       |//Vertical Padd Bottom
 1198|   129k|    if(ps_pad_mgr->u1_vert_pad_bot)
  ------------------
  |  Branch (1198:8): [True: 112k, False: 17.0k]
  ------------------
 1199|   112k|    {
 1200|       |
 1201|   112k|        UWORD8 *pu1_buf;
 1202|   112k|        pu1_buf = ps_dec->ps_cur_pic->pu1_buf1 - PAD_LEN_Y_H;
  ------------------
  |  |  571|   112k|#define PAD_LEN_Y_H                   32
  ------------------
 1203|   112k|        pu1_buf += ps_dec->u2_pic_ht * ps_dec->u2_frm_wd_y;
 1204|   112k|        ps_dec->pf_pad_bottom(pu1_buf, ps_dec->u2_frm_wd_y, ps_dec->u2_frm_wd_y,
 1205|   112k|                              ps_pad_mgr->u1_pad_len_y_v);
 1206|   112k|        pu1_buf = ps_dec->ps_cur_pic->pu1_buf2 - PAD_LEN_UV_H * YUV420SP_FACTOR;
  ------------------
  |  |  573|   112k|#define PAD_LEN_UV_H                  16
  ------------------
                      pu1_buf = ps_dec->ps_cur_pic->pu1_buf2 - PAD_LEN_UV_H * YUV420SP_FACTOR;
  ------------------
  |  |  119|   112k|#define YUV420SP_FACTOR 2
  ------------------
 1207|   112k|        pu1_buf += (ps_dec->u2_pic_ht >> 1) * ps_dec->u2_frm_wd_uv;
 1208|       |
 1209|   112k|        ps_dec->pf_pad_bottom(pu1_buf, ps_dec->u2_frm_wd_uv,
 1210|   112k|                              ps_dec->u2_frm_wd_uv,
 1211|   112k|                              ps_pad_mgr->u1_pad_len_cr_v);
 1212|       |
 1213|   112k|    }
 1214|   129k|}
ih264d_set_deblocking_parameters:
 1237|  13.9M|{
 1238|       |    /*------------------------------------------------------------------*/
 1239|       |    /* Set the deblocking parameters                                  */
 1240|       |    /*------------------------------------------------------------------*/
 1241|  13.9M|    ps_cur_mb->i1_slice_alpha_c0_offset = ps_slice->i1_slice_alpha_c0_offset;
 1242|  13.9M|    ps_cur_mb->i1_slice_beta_offset = ps_slice->i1_slice_beta_offset;
 1243|  13.9M|    ps_cur_mb->u1_mb_type = (u1_mb_field_decoding_flag << 7);
 1244|       |
 1245|  13.9M|    switch(ps_slice->u1_disable_dblk_filter_idc)
  ------------------
  |  Branch (1245:12): [True: 13.9M, False: 1.09k]
  ------------------
 1246|  13.9M|    {
 1247|  11.9M|        case DBLK_ENABLED:
  ------------------
  |  |  549|  11.9M|#define DBLK_ENABLED                  0
  ------------------
  |  Branch (1247:9): [True: 11.9M, False: 1.99M]
  ------------------
 1248|  11.9M|            ps_cur_mb->u1_deblocking_mode = MB_ENABLE_FILTERING;
  ------------------
  |  |   69|  11.9M|#define MB_ENABLE_FILTERING           0x00
  ------------------
 1249|  11.9M|            break;
 1250|   578k|        case DBLK_DISABLED:
  ------------------
  |  |  548|   578k|#define DBLK_DISABLED                 1
  ------------------
  |  Branch (1250:9): [True: 578k, False: 13.4M]
  ------------------
 1251|   578k|            ps_cur_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|   578k|#define MB_DISABLE_FILTERING          0x01
  ------------------
 1252|   578k|            break;
 1253|  1.41M|        case SLICE_BOUNDARY_DBLK_DISABLED:
  ------------------
  |  |  547|  1.41M|#define SLICE_BOUNDARY_DBLK_DISABLED  2
  ------------------
  |  Branch (1253:9): [True: 1.41M, False: 12.5M]
  ------------------
 1254|  1.41M|        {
 1255|  1.41M|            ps_cur_mb->u1_deblocking_mode = MB_ENABLE_FILTERING;
  ------------------
  |  |   69|  1.41M|#define MB_ENABLE_FILTERING           0x00
  ------------------
 1256|  1.41M|            if(!(u1_mb_ngbr_availablity & LEFT_MB_AVAILABLE_MASK))
  ------------------
  |  |   53|  1.41M|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  |  Branch (1256:16): [True: 179k, False: 1.23M]
  ------------------
 1257|   179k|                ps_cur_mb->u1_deblocking_mode |= MB_DISABLE_LEFT_EDGE;
  ------------------
  |  |   72|   179k|#define MB_DISABLE_LEFT_EDGE          0x04
  ------------------
 1258|  1.41M|            if(!(u1_mb_ngbr_availablity & TOP_MB_AVAILABLE_MASK))
  ------------------
  |  |   55|  1.41M|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  |  Branch (1258:16): [True: 106k, False: 1.30M]
  ------------------
 1259|   106k|                ps_cur_mb->u1_deblocking_mode |= MB_DISABLE_TOP_EDGE;
  ------------------
  |  |   71|   106k|#define MB_DISABLE_TOP_EDGE           0x02
  ------------------
 1260|  1.41M|            break;
 1261|      0|        }
 1262|  13.9M|    }
 1263|       |
 1264|  13.9M|    return (0);
 1265|  13.9M|}
ih264d_copy_intra_pred_line:
 1270|  13.8M|{
 1271|  13.8M|    UWORD8 *pu1_mb_last_row, u1_mb_field_decoding_flag;
 1272|  13.8M|    UWORD32 u4_recWidth, u4_recwidth_cr;
 1273|       |
 1274|  13.8M|    u1_mb_field_decoding_flag = ps_cur_mb_info->u1_mb_field_decodingflag;
 1275|       |
 1276|  13.8M|    u4_recWidth = ps_dec->u2_frm_wd_y << u1_mb_field_decoding_flag;
 1277|  13.8M|    u4_recwidth_cr = ps_dec->u2_frm_wd_uv << u1_mb_field_decoding_flag;
 1278|       |
 1279|  13.8M|    pu1_mb_last_row = ps_dec->ps_frame_buf_ip_recon->pu1_dest_y
 1280|  13.8M|                    + (u4_recWidth * (MB_SIZE - 1));
  ------------------
  |  |  554|  13.8M|#define MB_SIZE             16
  ------------------
 1281|  13.8M|    pu1_mb_last_row += MB_SIZE * nmb_index;
  ------------------
  |  |  554|  13.8M|#define MB_SIZE             16
  ------------------
 1282|  13.8M|    MEMCPY_16BYTES(ps_dec->pu1_cur_y_intra_pred_line, pu1_mb_last_row);
  ------------------
  |  |  657|  13.8M|#define MEMCPY_16BYTES(dst,src)                                 \
  |  |  658|  13.8M|{                                                               \
  |  |  659|  13.8M|    memcpy(dst,src,16);                                         \
  |  |  660|  13.8M|}
  ------------------
 1283|       |
 1284|  13.8M|    pu1_mb_last_row = ps_dec->ps_frame_buf_ip_recon->pu1_dest_u
 1285|  13.8M|                    + (u4_recwidth_cr * (BLK8x8SIZE - 1));
  ------------------
  |  |  555|  13.8M|#define BLK8x8SIZE          8
  ------------------
 1286|  13.8M|    pu1_mb_last_row += BLK8x8SIZE * nmb_index * YUV420SP_FACTOR;
  ------------------
  |  |  555|  13.8M|#define BLK8x8SIZE          8
  ------------------
                  pu1_mb_last_row += BLK8x8SIZE * nmb_index * YUV420SP_FACTOR;
  ------------------
  |  |  119|  13.8M|#define YUV420SP_FACTOR 2
  ------------------
 1287|       |
 1288|  13.8M|    MEMCPY_16BYTES(ps_dec->pu1_cur_u_intra_pred_line, pu1_mb_last_row);
  ------------------
  |  |  657|  13.8M|#define MEMCPY_16BYTES(dst,src)                                 \
  |  |  658|  13.8M|{                                                               \
  |  |  659|  13.8M|    memcpy(dst,src,16);                                         \
  |  |  660|  13.8M|}
  ------------------
 1289|       |
 1290|  13.8M|    ps_dec->pu1_cur_y_intra_pred_line = ps_dec->pu1_cur_y_intra_pred_line_base
 1291|  13.8M|                    + (MB_SIZE * (ps_cur_mb_info->u2_mbx + 1));
  ------------------
  |  |  554|  13.8M|#define MB_SIZE             16
  ------------------
 1292|  13.8M|    ps_dec->pu1_cur_u_intra_pred_line = ps_dec->pu1_cur_u_intra_pred_line_base
 1293|  13.8M|                    + (BLK8x8SIZE * (ps_cur_mb_info->u2_mbx + 1))
  ------------------
  |  |  555|  13.8M|#define BLK8x8SIZE          8
  ------------------
 1294|  13.8M|                                    * YUV420SP_FACTOR;
  ------------------
  |  |  119|  13.8M|#define YUV420SP_FACTOR 2
  ------------------
 1295|  13.8M|    ps_dec->pu1_cur_v_intra_pred_line = ps_dec->pu1_cur_v_intra_pred_line_base
 1296|  13.8M|                    + (BLK8x8SIZE * (ps_cur_mb_info->u2_mbx + 1));
  ------------------
  |  |  555|  13.8M|#define BLK8x8SIZE          8
  ------------------
 1297|       |
 1298|  13.8M|    if(ps_cur_mb_info->u2_mbx == (ps_dec->u2_frm_wd_in_mbs - 1))
  ------------------
  |  Branch (1298:8): [True: 2.31M, False: 11.5M]
  ------------------
 1299|  2.31M|    {
 1300|  2.31M|        UWORD8* pu1_temp;
 1301|       |
 1302|  2.31M|        ps_dec->pu1_cur_y_intra_pred_line =
 1303|  2.31M|                        ps_dec->pu1_cur_y_intra_pred_line_base;
 1304|  2.31M|        ps_dec->pu1_cur_u_intra_pred_line =
 1305|  2.31M|                        ps_dec->pu1_cur_u_intra_pred_line_base;
 1306|  2.31M|        ps_dec->pu1_cur_v_intra_pred_line =
 1307|  2.31M|                        ps_dec->pu1_cur_v_intra_pred_line_base;
 1308|       |
 1309|       |        /*swap current and previous rows*/
 1310|  2.31M|        pu1_temp = ps_dec->pu1_cur_y_intra_pred_line;
 1311|  2.31M|        ps_dec->pu1_cur_y_intra_pred_line = ps_dec->pu1_prev_y_intra_pred_line;
 1312|  2.31M|        ps_dec->pu1_prev_y_intra_pred_line = pu1_temp;
 1313|       |
 1314|  2.31M|        pu1_temp = ps_dec->pu1_cur_u_intra_pred_line;
 1315|  2.31M|        ps_dec->pu1_cur_u_intra_pred_line = ps_dec->pu1_prev_u_intra_pred_line;
 1316|  2.31M|        ps_dec->pu1_prev_u_intra_pred_line = pu1_temp;
 1317|       |
 1318|  2.31M|        pu1_temp = ps_dec->pu1_cur_v_intra_pred_line;
 1319|  2.31M|        ps_dec->pu1_cur_v_intra_pred_line = ps_dec->pu1_prev_v_intra_pred_line;
 1320|  2.31M|        ps_dec->pu1_prev_v_intra_pred_line = pu1_temp;
 1321|       |
 1322|  2.31M|        ps_dec->pu1_cur_y_intra_pred_line_base =
 1323|  2.31M|                        ps_dec->pu1_cur_y_intra_pred_line;
 1324|  2.31M|        ps_dec->pu1_cur_u_intra_pred_line_base =
 1325|  2.31M|                        ps_dec->pu1_cur_u_intra_pred_line;
 1326|  2.31M|        ps_dec->pu1_cur_v_intra_pred_line_base =
 1327|  2.31M|                        ps_dec->pu1_cur_v_intra_pred_line;
 1328|       |
 1329|       |
 1330|       |
 1331|       |
 1332|       |
 1333|  2.31M|    }
 1334|       |
 1335|  13.8M|}

ih264d_init_ref_bufs:
   81|   103k|{
   82|   103k|    UWORD32 i;
   83|   103k|    struct dpb_info_t *ps_dpb_info = ps_dpb_mgr->as_dpb_info;
   84|  3.42M|    for(i = 0; i < MAX_REF_BUFS; i++)
  ------------------
  |  |   75|  3.42M|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (84:16): [True: 3.31M, False: 103k]
  ------------------
   85|  3.31M|    {
   86|  3.31M|        ps_dpb_info[i].u1_used_as_ref = UNUSED_FOR_REF;
  ------------------
  |  |  595|  3.31M|#define UNUSED_FOR_REF 0
  ------------------
   87|  3.31M|        ps_dpb_info[i].u1_lt_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  3.31M|#define MAX_REF_BUFS    32
  ------------------
   88|  3.31M|        ps_dpb_info[i].ps_prev_short = NULL;
   89|  3.31M|        ps_dpb_info[i].ps_prev_long = NULL;
   90|  3.31M|        ps_dpb_info[i].ps_pic_buf = NULL;
   91|  3.31M|        ps_dpb_info[i].s_top_field.u1_reference_info = UNUSED_FOR_REF;
  ------------------
  |  |  595|  3.31M|#define UNUSED_FOR_REF 0
  ------------------
   92|  3.31M|        ps_dpb_info[i].s_bot_field.u1_reference_info = UNUSED_FOR_REF;
  ------------------
  |  |  595|  3.31M|#define UNUSED_FOR_REF 0
  ------------------
   93|  3.31M|        ps_dpb_info[i].s_top_field.u1_long_term_frame_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  3.31M|#define MAX_REF_BUFS    32
  ------------------
   94|  3.31M|        ps_dpb_info[i].s_bot_field.u1_long_term_frame_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  3.31M|#define MAX_REF_BUFS    32
  ------------------
   95|       |
   96|  3.31M|    }
   97|   103k|    ps_dpb_mgr->u1_num_st_ref_bufs = ps_dpb_mgr->u1_num_lt_ref_bufs = 0;
   98|   103k|    ps_dpb_mgr->ps_dpb_st_head = NULL;
   99|   103k|    ps_dpb_mgr->ps_dpb_ht_head = NULL;
  100|   103k|    ps_dpb_mgr->i1_gaps_deleted = 0;
  101|   103k|    ps_dpb_mgr->i1_poc_buf_id_entries = 0;
  102|   103k|    ps_dpb_mgr->u1_mmco_error_in_seq = 0;
  103|       |
  104|   103k|    ps_dpb_mgr->u1_num_gaps = 0;
  105|  1.76M|    for(i = 0; i < MAX_FRAMES; i++)
  ------------------
  |  |  600|  1.76M|#define MAX_FRAMES              16
  ------------------
  |  Branch (105:16): [True: 1.65M, False: 103k]
  ------------------
  106|  1.65M|    {
  107|  1.65M|        ps_dpb_mgr->ai4_gaps_start_frm_num[i] = INVALID_FRAME_NUM;
  ------------------
  |  |  601|  1.65M|#define INVALID_FRAME_NUM       0x0fffffff
  ------------------
  108|  1.65M|        ps_dpb_mgr->ai4_gaps_end_frm_num[i] = 0;
  109|  1.65M|        ps_dpb_mgr->ai1_gaps_per_seq[i] = 0;
  110|  1.65M|        ps_dpb_mgr->ai4_poc_buf_id_map[i][0] = -1;
  111|  1.65M|        ps_dpb_mgr->ai4_poc_buf_id_map[i][1] = 0x7fffffff;
  112|  1.65M|        ps_dpb_mgr->ai4_poc_buf_id_map[i][2] = 0;
  113|  1.65M|    }
  114|       |
  115|   103k|}
ih264d_free_ref_pic_mv_bufs:
  118|  87.8k|{
  119|  87.8k|    dec_struct_t *ps_dec = (dec_struct_t *)pv_dec;
  120|       |
  121|  87.8k|    if((pic_buf_id == ps_dec->u1_pic_buf_id) &&
  ------------------
  |  Branch (121:8): [True: 40.1k, False: 47.7k]
  ------------------
  122|  40.1k|                    ps_dec->ps_cur_slice->u1_field_pic_flag &&
  ------------------
  |  Branch (122:21): [True: 0, False: 40.1k]
  ------------------
  123|      0|                    (ps_dec->u1_top_bottom_decoded == 0))
  ------------------
  |  Branch (123:21): [True: 0, False: 0]
  ------------------
  124|      0|    {
  125|      0|        return;
  126|      0|    }
  127|       |
  128|  87.8k|    ih264_buf_mgr_release((buf_mgr_t *)ps_dec->pv_pic_buf_mgr,
  129|  87.8k|                          pic_buf_id,
  130|  87.8k|                          BUF_MGR_REF);
  ------------------
  |  |   50|  87.8k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  131|  87.8k|    ih264_buf_mgr_release((buf_mgr_t *)ps_dec->pv_mv_buf_mgr,
  132|  87.8k|                          ps_dec->as_buf_id_info_map[pic_buf_id].mv_buf_id,
  133|  87.8k|                          BUF_MGR_REF);
  ------------------
  |  |   50|  87.8k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  134|  87.8k|}
ih264d_delete_lt_node:
  151|  19.6k|{
  152|  19.6k|    *pi4_status = 0;
  153|  19.6k|    if(ps_dpb_mgr->u1_num_lt_ref_bufs > 0)
  ------------------
  |  Branch (153:8): [True: 2.97k, False: 16.6k]
  ------------------
  154|  2.97k|    {
  155|  2.97k|        WORD32 i;
  156|  2.97k|        struct dpb_info_t *ps_next_dpb;
  157|       |        /* ps_unmark_node points to the node to be removed */
  158|       |        /* from long term list.                            */
  159|  2.97k|        struct dpb_info_t *ps_unmark_node;
  160|       |        //Find the node with matching LTIndex
  161|  2.97k|        ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
  162|  2.97k|        if(ps_next_dpb->u1_lt_idx == u4_lt_idx)
  ------------------
  |  Branch (162:12): [True: 1.34k, False: 1.62k]
  ------------------
  163|  1.34k|        {
  164|  1.34k|            ps_unmark_node = ps_next_dpb;
  165|  1.34k|        }
  166|  1.62k|        else
  167|  1.62k|        {
  168|  2.11k|            for(i = 1; i < ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
  ------------------
  |  Branch (168:24): [True: 839, False: 1.27k]
  ------------------
  169|    839|            {
  170|    839|                if(ps_next_dpb->ps_prev_long->u1_lt_idx == u4_lt_idx)
  ------------------
  |  Branch (170:20): [True: 350, False: 489]
  ------------------
  171|    350|                    break;
  172|    489|                ps_next_dpb = ps_next_dpb->ps_prev_long;
  173|    489|            }
  174|  1.62k|            if(i == ps_dpb_mgr->u1_num_lt_ref_bufs)
  ------------------
  |  Branch (174:16): [True: 1.27k, False: 350]
  ------------------
  175|  1.27k|                *pi4_status = 1;
  176|    350|            else
  177|    350|                ps_unmark_node = ps_next_dpb->ps_prev_long;
  178|  1.62k|        }
  179|       |
  180|  2.97k|        if(*pi4_status == 0)
  ------------------
  |  Branch (180:12): [True: 1.69k, False: 1.27k]
  ------------------
  181|  1.69k|        {
  182|  1.69k|            if(u1_fld_pic_flag)
  ------------------
  |  Branch (182:16): [True: 0, False: 1.69k]
  ------------------
  183|      0|            {
  184|      0|                if(ps_lt_node_to_insert != ps_unmark_node)
  ------------------
  |  Branch (184:20): [True: 0, False: 0]
  ------------------
  185|      0|                {
  186|      0|                    UWORD8 u1_deleted = 0;
  187|       |                    /* for the ps_unmark_node mark the corresponding field */
  188|       |                    /* field as unused for reference                       */
  189|       |
  190|      0|                    if(ps_unmark_node->s_top_field.u1_long_term_frame_idx
  ------------------
  |  Branch (190:24): [True: 0, False: 0]
  ------------------
  191|      0|                                    == u4_lt_idx)
  192|      0|                    {
  193|      0|                        ps_unmark_node->s_top_field.u1_reference_info =
  194|      0|                                        UNUSED_FOR_REF;
  ------------------
  |  |  595|      0|#define UNUSED_FOR_REF 0
  ------------------
  195|      0|                        ps_unmark_node->s_top_field.u1_long_term_frame_idx =
  196|      0|                        MAX_REF_BUFS + 1;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  197|      0|                        u1_deleted = 1;
  198|      0|                    }
  199|      0|                    if(ps_unmark_node->s_bot_field.u1_long_term_frame_idx
  ------------------
  |  Branch (199:24): [True: 0, False: 0]
  ------------------
  200|      0|                                    == u4_lt_idx)
  201|      0|                    {
  202|      0|                        ps_unmark_node->s_bot_field.u1_reference_info =
  203|      0|                                        UNUSED_FOR_REF;
  ------------------
  |  |  595|      0|#define UNUSED_FOR_REF 0
  ------------------
  204|      0|                        ps_unmark_node->s_bot_field.u1_long_term_frame_idx =
  205|      0|                        MAX_REF_BUFS + 1;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  206|      0|                        u1_deleted = 1;
  207|      0|                    }
  208|       |
  209|      0|                    if(!u1_deleted)
  ------------------
  |  Branch (209:24): [True: 0, False: 0]
  ------------------
  210|      0|                    {
  211|       |
  212|      0|                        UWORD32 i4_error_code;
  213|      0|                        i4_error_code = ERROR_DBP_MANAGER_T;
  214|       |
  215|      0|                        return i4_error_code;
  216|      0|                    }
  217|      0|                }
  218|       |
  219|      0|                ps_unmark_node->u1_used_as_ref =
  220|      0|                                ps_unmark_node->s_top_field.u1_reference_info
  221|      0|                                                | ps_unmark_node->s_bot_field.u1_reference_info;
  222|      0|            }
  223|  1.69k|            else
  224|  1.69k|                ps_unmark_node->u1_used_as_ref = UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.69k|#define UNUSED_FOR_REF 0
  ------------------
  225|       |
  226|  1.69k|            if(UNUSED_FOR_REF == ps_unmark_node->u1_used_as_ref)
  ------------------
  |  |  595|  1.69k|#define UNUSED_FOR_REF 0
  ------------------
  |  Branch (226:16): [True: 1.69k, False: 0]
  ------------------
  227|  1.69k|            {
  228|  1.69k|                if(ps_unmark_node == ps_dpb_mgr->ps_dpb_ht_head)
  ------------------
  |  Branch (228:20): [True: 1.34k, False: 350]
  ------------------
  229|  1.34k|                    ps_dpb_mgr->ps_dpb_ht_head = ps_next_dpb->ps_prev_long;
  230|       |
  231|  1.69k|                ps_unmark_node->u1_lt_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  1.69k|#define MAX_REF_BUFS    32
  ------------------
  232|  1.69k|                ps_unmark_node->s_top_field.u1_reference_info =
  233|  1.69k|                UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.69k|#define UNUSED_FOR_REF 0
  ------------------
  234|  1.69k|                ps_unmark_node->s_bot_field.u1_reference_info =
  235|  1.69k|                UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.69k|#define UNUSED_FOR_REF 0
  ------------------
  236|       |                // Release the physical buffer
  237|  1.69k|                ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
  238|  1.69k|                                            ps_unmark_node->u1_buf_id);
  239|  1.69k|                ps_next_dpb->ps_prev_long = ps_unmark_node->ps_prev_long; //update link
  240|  1.69k|                ps_unmark_node->ps_prev_long = NULL;
  241|  1.69k|                ps_dpb_mgr->u1_num_lt_ref_bufs--; //decrement LT buf count
  242|  1.69k|            }
  243|  1.69k|        }
  244|  2.97k|    }
  245|  19.6k|    return OK;
  ------------------
  |  |  114|  19.6k|#define OK        0
  ------------------
  246|  19.6k|}
ih264d_insert_lt_node:
  263|  17.7k|{
  264|  17.7k|    UWORD8 u1_mark_top_field_long_term = 0;
  265|  17.7k|    UWORD8 u1_mark_bot_field_long_term = 0;
  266|       |
  267|  17.7k|    {
  268|  17.7k|        if(u1_fld_pic_flag)
  ------------------
  |  Branch (268:12): [True: 0, False: 17.7k]
  ------------------
  269|      0|        {
  270|       |            /* Assign corresponding field (top or bottom) long_term_frame_idx */
  271|       |
  272|      0|            if((ps_mov_node->s_top_field.u1_reference_info == IS_LONG_TERM)
  ------------------
  |  |  597|      0|#define IS_LONG_TERM   2
  ------------------
  |  Branch (272:16): [True: 0, False: 0]
  ------------------
  273|      0|                            && (ps_mov_node->s_bot_field.u1_reference_info
  ------------------
  |  Branch (273:32): [True: 0, False: 0]
  ------------------
  274|      0|                                            == IS_LONG_TERM))
  ------------------
  |  |  597|      0|#define IS_LONG_TERM   2
  ------------------
  275|      0|            {
  276|      0|                if(ps_mov_node->u1_lt_idx == u4_lt_idx)
  ------------------
  |  Branch (276:20): [True: 0, False: 0]
  ------------------
  277|      0|                    u1_mark_bot_field_long_term = 1;
  278|      0|                else
  279|      0|                {
  280|       |
  281|      0|                    UWORD32 i4_error_code;
  282|      0|                    i4_error_code = ERROR_DBP_MANAGER_T;
  283|       |
  284|      0|                    return i4_error_code;
  285|       |
  286|      0|                }
  287|      0|            }
  288|      0|            else if(ps_mov_node->s_top_field.u1_reference_info == IS_LONG_TERM)
  ------------------
  |  |  597|      0|#define IS_LONG_TERM   2
  ------------------
  |  Branch (288:21): [True: 0, False: 0]
  ------------------
  289|      0|            {
  290|      0|                u1_mark_top_field_long_term = 1;
  291|      0|            }
  292|       |
  293|      0|            if(!(u1_mark_top_field_long_term || u1_mark_bot_field_long_term))
  ------------------
  |  Branch (293:18): [True: 0, False: 0]
  |  Branch (293:49): [True: 0, False: 0]
  ------------------
  294|      0|            {
  295|      0|                UWORD32 i4_error_code;
  296|      0|                i4_error_code = ERROR_DBP_MANAGER_T;
  297|      0|                return i4_error_code;
  298|      0|            }
  299|      0|        }
  300|  17.7k|        else
  301|  17.7k|        {
  302|  17.7k|            ps_mov_node->s_top_field.u1_reference_info = IS_LONG_TERM;
  ------------------
  |  |  597|  17.7k|#define IS_LONG_TERM   2
  ------------------
  303|  17.7k|            ps_mov_node->s_bot_field.u1_reference_info = IS_LONG_TERM;
  ------------------
  |  |  597|  17.7k|#define IS_LONG_TERM   2
  ------------------
  304|  17.7k|            ps_mov_node->s_top_field.u1_long_term_frame_idx = u4_lt_idx;
  305|  17.7k|            ps_mov_node->s_bot_field.u1_long_term_frame_idx = u4_lt_idx;
  306|  17.7k|            u1_mark_bot_field_long_term = 1;
  307|  17.7k|            u1_mark_top_field_long_term = 1;
  308|  17.7k|        }
  309|       |
  310|  17.7k|        ps_mov_node->u1_lt_idx = u4_lt_idx; //Assign the LT index to the node
  311|  17.7k|        ps_mov_node->ps_pic_buf->u1_long_term_frm_idx = u4_lt_idx;
  312|  17.7k|        ps_mov_node->u1_used_as_ref = IS_LONG_TERM;
  ------------------
  |  |  597|  17.7k|#define IS_LONG_TERM   2
  ------------------
  313|       |
  314|       |        /* Insert the new long term in the LT list with  u4_lt_idx    */
  315|       |        /* in ascending order.                                         */
  316|  17.7k|        if(ps_dpb_mgr->u1_num_lt_ref_bufs > 0)
  ------------------
  |  Branch (316:12): [True: 1.63k, False: 16.1k]
  ------------------
  317|  1.63k|        {
  318|  1.63k|            struct dpb_info_t *ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
  319|  1.63k|            if(u4_lt_idx < ps_next_dpb->u1_lt_idx)
  ------------------
  |  Branch (319:16): [True: 450, False: 1.18k]
  ------------------
  320|    450|            {
  321|       |                //LTIndex to be inserted is the smallest LT index
  322|       |                //Update head and point prev to the next higher index
  323|    450|                ps_mov_node->ps_prev_long = ps_next_dpb;
  324|    450|                ps_dpb_mgr->ps_dpb_ht_head = ps_mov_node;
  325|    450|            }
  326|  1.18k|            else
  327|  1.18k|            {
  328|  1.18k|                WORD32 i;
  329|  1.18k|                struct dpb_info_t *ps_nxtDPB = ps_next_dpb;
  330|  1.18k|                ps_next_dpb = ps_next_dpb->ps_prev_long;
  331|  1.51k|                for(i = 1; i < ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
  ------------------
  |  Branch (331:28): [True: 640, False: 876]
  ------------------
  332|    640|                {
  333|    640|                    if(ps_next_dpb->u1_lt_idx > u4_lt_idx)
  ------------------
  |  Branch (333:24): [True: 306, False: 334]
  ------------------
  334|    306|                        break;
  335|    334|                    ps_nxtDPB = ps_next_dpb;
  336|    334|                    ps_next_dpb = ps_next_dpb->ps_prev_long;
  337|    334|                }
  338|       |
  339|  1.18k|                ps_nxtDPB->ps_prev_long = ps_mov_node;
  340|  1.18k|                ps_mov_node->ps_prev_long = ps_next_dpb;
  341|  1.18k|            }
  342|  1.63k|        }
  343|  16.1k|        else
  344|  16.1k|        {
  345|  16.1k|            ps_dpb_mgr->ps_dpb_ht_head = ps_mov_node;
  346|  16.1k|            ps_mov_node->ps_prev_long = NULL;
  347|  16.1k|        }
  348|       |        /* Identify the picture buffer as a long term picture buffer */
  349|  17.7k|        ps_mov_node->ps_pic_buf->u1_is_short = 0;
  350|       |
  351|       |        /* Increment LT buf count only if new LT node inserted    */
  352|       |        /* If Increment during top_field is done, don't increment */
  353|       |        /* for bottom field, as both them are part of same pic.   */
  354|  17.7k|        if(u1_mark_bot_field_long_term)
  ------------------
  |  Branch (354:12): [True: 17.7k, False: 0]
  ------------------
  355|  17.7k|            ps_dpb_mgr->u1_num_lt_ref_bufs++;
  356|       |
  357|  17.7k|    }
  358|  17.7k|    return OK;
  ------------------
  |  |  114|  17.7k|#define OK        0
  ------------------
  359|  17.7k|}
ih264d_insert_st_node:
  379|   111k|{
  380|   111k|    WORD32 i;
  381|   111k|    struct dpb_info_t *ps_dpb_info = ps_dpb_mgr->as_dpb_info;
  382|   111k|    UWORD8 u1_picture_type = ps_pic_buf->u1_picturetype;
  383|       |    /* Find an unused dpb location */
  384|   128k|    for(i = 0; i < MAX_REF_BUFS; i++)
  ------------------
  |  |   75|   128k|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (384:16): [True: 128k, False: 0]
  ------------------
  385|   128k|    {
  386|   128k|        if((ps_dpb_info[i].ps_pic_buf == ps_pic_buf)
  ------------------
  |  Branch (386:12): [True: 845, False: 127k]
  ------------------
  387|    845|                        && ps_dpb_info[i].u1_used_as_ref)
  ------------------
  |  Branch (387:28): [True: 245, False: 600]
  ------------------
  388|    245|        {
  389|       |            /*signal an error in the case of frame pic*/
  390|    245|            if(ps_dpb_info[i].ps_pic_buf->u1_pic_type == FRM_PIC)
  ------------------
  |  |  352|    245|#define FRM_PIC         0x00
  ------------------
  |  Branch (390:16): [True: 245, False: 0]
  ------------------
  391|    245|            {
  392|    245|                return ERROR_DBP_MANAGER_T;
  393|    245|            }
  394|      0|            else
  395|      0|            {
  396|       |                /* Can occur only for field bottom pictures */
  397|      0|                ps_dpb_info[i].s_bot_field.u1_reference_info = IS_SHORT_TERM;
  ------------------
  |  |  596|      0|#define IS_SHORT_TERM  1
  ------------------
  398|      0|                return OK;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  399|      0|            }
  400|    245|        }
  401|       |
  402|   127k|        if((ps_dpb_info[i].u1_used_as_ref == UNUSED_FOR_REF)
  ------------------
  |  |  595|   127k|#define UNUSED_FOR_REF 0
  ------------------
  |  Branch (402:12): [True: 111k, False: 16.1k]
  ------------------
  403|   111k|                        && (ps_dpb_info[i].s_top_field.u1_reference_info
  ------------------
  |  Branch (403:28): [True: 111k, False: 0]
  ------------------
  404|   111k|                                        == UNUSED_FOR_REF)
  ------------------
  |  |  595|   111k|#define UNUSED_FOR_REF 0
  ------------------
  405|   111k|                        && (ps_dpb_info[i].s_bot_field.u1_reference_info
  ------------------
  |  Branch (405:28): [True: 111k, False: 0]
  ------------------
  406|   111k|                                        == UNUSED_FOR_REF))
  ------------------
  |  |  595|   111k|#define UNUSED_FOR_REF 0
  ------------------
  407|   111k|            break;
  408|   127k|    }
  409|   111k|    if(i == MAX_REF_BUFS)
  ------------------
  |  |   75|   111k|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (409:8): [True: 0, False: 111k]
  ------------------
  410|      0|    {
  411|      0|        UWORD32 i4_error_code;
  412|      0|        i4_error_code = ERROR_DBP_MANAGER_T;
  413|      0|        return i4_error_code;
  414|      0|    }
  415|       |
  416|       |    /* Create dpb info */
  417|   111k|    ps_dpb_info[i].ps_pic_buf = ps_pic_buf;
  418|   111k|    ps_dpb_info[i].ps_prev_short = ps_dpb_mgr->ps_dpb_st_head;
  419|   111k|    ps_dpb_info[i].u1_buf_id = u1_buf_id;
  420|   111k|    ps_dpb_info[i].u1_used_as_ref = TRUE;
  ------------------
  |  |  591|   111k|#define TRUE    1
  ------------------
  421|   111k|    ps_dpb_info[i].u1_lt_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|   111k|#define MAX_REF_BUFS    32
  ------------------
  422|   111k|    ps_dpb_info[i].i4_frame_num = u4_cur_pic_num;
  423|   111k|    ps_dpb_info[i].ps_pic_buf->i4_frame_num = u4_cur_pic_num;
  424|       |
  425|       |    /* update the head node of linked list to point to the cur Pic */
  426|   111k|    ps_dpb_mgr->ps_dpb_st_head = ps_dpb_info + i;
  427|       |
  428|       |    // Increment Short term bufCount
  429|   111k|    ps_dpb_mgr->u1_num_st_ref_bufs++;
  430|       |    /* Identify the picture as a short term picture buffer */
  431|   111k|    ps_pic_buf->u1_is_short = IS_SHORT_TERM;
  ------------------
  |  |  596|   111k|#define IS_SHORT_TERM  1
  ------------------
  432|       |
  433|   111k|    if((u1_picture_type & 0x03) == FRM_PIC)
  ------------------
  |  |  352|   111k|#define FRM_PIC         0x00
  ------------------
  |  Branch (433:8): [True: 111k, False: 0]
  ------------------
  434|   111k|    {
  435|   111k|        ps_dpb_info[i].u1_used_as_ref = IS_SHORT_TERM;
  ------------------
  |  |  596|   111k|#define IS_SHORT_TERM  1
  ------------------
  436|   111k|        ps_dpb_info[i].s_top_field.u1_reference_info = IS_SHORT_TERM;
  ------------------
  |  |  596|   111k|#define IS_SHORT_TERM  1
  ------------------
  437|   111k|        ps_dpb_info[i].s_bot_field.u1_reference_info = IS_SHORT_TERM;
  ------------------
  |  |  596|   111k|#define IS_SHORT_TERM  1
  ------------------
  438|   111k|    }
  439|       |
  440|   111k|    if((u1_picture_type & 0x03) == TOP_FLD)
  ------------------
  |  |  353|   111k|#define TOP_FLD         0x01
  ------------------
  |  Branch (440:8): [True: 0, False: 111k]
  ------------------
  441|      0|        ps_dpb_info[i].s_top_field.u1_reference_info = IS_SHORT_TERM;
  ------------------
  |  |  596|      0|#define IS_SHORT_TERM  1
  ------------------
  442|       |
  443|   111k|    if((u1_picture_type & 0x03) == BOT_FLD)
  ------------------
  |  |  354|   111k|#define BOT_FLD         0x02
  ------------------
  |  Branch (443:8): [True: 0, False: 111k]
  ------------------
  444|      0|        ps_dpb_info[i].s_bot_field.u1_reference_info = IS_SHORT_TERM;
  ------------------
  |  |  596|      0|#define IS_SHORT_TERM  1
  ------------------
  445|       |
  446|   111k|    return OK;
  ------------------
  |  |  114|   111k|#define OK        0
  ------------------
  447|   111k|}
ih264d_delete_st_node_or_make_lt:
  468|  18.4k|{
  469|  18.4k|    WORD32 i;
  470|  18.4k|    struct dpb_info_t *ps_next_dpb;
  471|  18.4k|    WORD32 i4_frame_num = i4_pic_num;
  472|  18.4k|    struct dpb_info_t *ps_unmark_node = NULL;
  473|  18.4k|    UWORD8 u1_del_node = 0, u1_del_st = 0;
  474|  18.4k|    UWORD8 u1_reference_type = UNUSED_FOR_REF;
  ------------------
  |  |  595|  18.4k|#define UNUSED_FOR_REF 0
  ------------------
  475|  18.4k|    WORD32 ret;
  476|       |
  477|  18.4k|    if(u1_fld_pic_flag)
  ------------------
  |  Branch (477:8): [True: 0, False: 18.4k]
  ------------------
  478|      0|    {
  479|      0|        i4_frame_num = i4_frame_num >> 1;
  480|       |
  481|      0|        if(u4_lt_idx == (MAX_REF_BUFS + 1))
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (481:12): [True: 0, False: 0]
  ------------------
  482|      0|            u1_reference_type = UNUSED_FOR_REF;
  ------------------
  |  |  595|      0|#define UNUSED_FOR_REF 0
  ------------------
  483|      0|        else
  484|      0|            u1_reference_type = IS_LONG_TERM;
  ------------------
  |  |  597|      0|#define IS_LONG_TERM   2
  ------------------
  485|      0|    }
  486|       |
  487|       |    //Find the node with matching picNum
  488|  18.4k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_st_head;
  489|  18.4k|    if((WORD32)ps_next_dpb->i4_frame_num == i4_frame_num)
  ------------------
  |  Branch (489:8): [True: 17.9k, False: 533]
  ------------------
  490|  17.9k|    {
  491|  17.9k|        ps_unmark_node = ps_next_dpb;
  492|  17.9k|    }
  493|    533|    else
  494|    533|    {
  495|    805|        for(i = 1; i < ps_dpb_mgr->u1_num_st_ref_bufs; i++)
  ------------------
  |  Branch (495:20): [True: 349, False: 456]
  ------------------
  496|    349|        {
  497|    349|            if((WORD32)ps_next_dpb->ps_prev_short->i4_frame_num == i4_frame_num)
  ------------------
  |  Branch (497:16): [True: 77, False: 272]
  ------------------
  498|     77|                break;
  499|    272|            ps_next_dpb = ps_next_dpb->ps_prev_short;
  500|    272|        }
  501|       |
  502|    533|        if(i == ps_dpb_mgr->u1_num_st_ref_bufs)
  ------------------
  |  Branch (502:12): [True: 456, False: 77]
  ------------------
  503|    456|        {
  504|    456|            if(ps_dpb_mgr->u1_num_gaps)
  ------------------
  |  Branch (504:16): [True: 0, False: 456]
  ------------------
  505|      0|            {
  506|      0|                ret = ih264d_delete_gap_frm_mmco(ps_dpb_mgr, i4_frame_num, &u1_del_st);
  507|      0|                if(ret != OK)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (507:20): [True: 0, False: 0]
  ------------------
  508|      0|                    return ret;
  509|      0|            }
  510|    456|            else
  511|    456|            {
  512|    456|                UWORD32 i4_error_code;
  513|    456|                i4_error_code = ERROR_DBP_MANAGER_T;
  514|       |
  515|    456|                return i4_error_code;
  516|    456|            }
  517|       |
  518|      0|            if(u1_del_st)
  ------------------
  |  Branch (518:16): [True: 0, False: 0]
  ------------------
  519|      0|            {
  520|      0|                UWORD32 i4_error_code;
  521|      0|                i4_error_code = ERROR_DBP_MANAGER_T;
  522|      0|                return i4_error_code;
  523|      0|            }
  524|      0|            else
  525|      0|            {
  526|      0|                return 0;
  527|      0|            }
  528|      0|        }
  529|     77|        else
  530|     77|            ps_unmark_node = ps_next_dpb->ps_prev_short;
  531|    533|    }
  532|       |
  533|  17.9k|    if(u1_fld_pic_flag)
  ------------------
  |  Branch (533:8): [True: 0, False: 17.9k]
  ------------------
  534|      0|    {
  535|       |        /* Mark the corresponding field ( top or bot) as  */
  536|       |        /* UNUSED_FOR_REF or IS_LONG_TERM depending on    */
  537|       |        /* u1_reference_type.                             */
  538|      0|        if(ps_unmark_node->s_top_field.i4_pic_num == i4_pic_num)
  ------------------
  |  Branch (538:12): [True: 0, False: 0]
  ------------------
  539|      0|        {
  540|      0|            ps_unmark_node->s_top_field.u1_reference_info = u1_reference_type;
  541|      0|            ps_unmark_node->s_top_field.u1_long_term_frame_idx = u4_lt_idx;
  542|      0|            {
  543|      0|                UWORD8 *pu1_src = ps_unmark_node->ps_pic_buf->pu1_col_zero_flag;
  544|      0|                WORD32 i4_size = ((ps_dpb_mgr->u2_pic_wd
  545|      0|                                * ps_dpb_mgr->u2_pic_ht) >> 5);
  546|       |                /* memset the colocated zero u4_flag buffer */
  547|      0|                memset(pu1_src, 0, i4_size);
  548|      0|            }
  549|      0|        }
  550|       |
  551|      0|        else if(ps_unmark_node->s_bot_field.i4_pic_num == i4_pic_num)
  ------------------
  |  Branch (551:17): [True: 0, False: 0]
  ------------------
  552|      0|        {
  553|       |
  554|      0|            ps_unmark_node->s_bot_field.u1_reference_info = u1_reference_type;
  555|      0|            ps_unmark_node->s_bot_field.u1_long_term_frame_idx = u4_lt_idx;
  556|      0|            {
  557|      0|                UWORD8 *pu1_src =
  558|      0|                                ps_unmark_node->ps_pic_buf->pu1_col_zero_flag
  559|      0|                                                + ((ps_dpb_mgr->u2_pic_wd
  560|      0|                                                                * ps_dpb_mgr->u2_pic_ht)
  561|      0|                                                                >> 5);
  562|      0|                WORD32 i4_size = ((ps_dpb_mgr->u2_pic_wd
  563|      0|                                * ps_dpb_mgr->u2_pic_ht) >> 5);
  564|       |                /* memset the colocated zero u4_flag buffer */
  565|      0|                memset(pu1_src, 0, i4_size);
  566|      0|            }
  567|      0|        }
  568|      0|        ps_unmark_node->u1_used_as_ref =
  569|      0|                        ps_unmark_node->s_top_field.u1_reference_info
  570|      0|                                        | ps_unmark_node->s_bot_field.u1_reference_info;
  571|      0|    }
  572|  17.9k|    else
  573|  17.9k|    {
  574|  17.9k|        ps_unmark_node->u1_used_as_ref = UNUSED_FOR_REF;
  ------------------
  |  |  595|  17.9k|#define UNUSED_FOR_REF 0
  ------------------
  575|  17.9k|        ps_unmark_node->s_top_field.u1_reference_info = UNUSED_FOR_REF;
  ------------------
  |  |  595|  17.9k|#define UNUSED_FOR_REF 0
  ------------------
  576|  17.9k|        ps_unmark_node->s_bot_field.u1_reference_info = UNUSED_FOR_REF;
  ------------------
  |  |  595|  17.9k|#define UNUSED_FOR_REF 0
  ------------------
  577|       |
  578|  17.9k|        {
  579|  17.9k|            UWORD8 *pu1_src = ps_unmark_node->ps_pic_buf->pu1_col_zero_flag;
  580|       |
  581|  17.9k|            WORD32 i4_size = ((ps_dpb_mgr->u2_pic_wd
  582|  17.9k|                            * ps_dpb_mgr->u2_pic_ht) >> 4);
  583|       |            /* memset the colocated zero u4_flag buffer */
  584|  17.9k|            memset(pu1_src, 0, i4_size);
  585|  17.9k|        }
  586|  17.9k|    }
  587|       |
  588|  17.9k|    if(!(ps_unmark_node->u1_used_as_ref & IS_SHORT_TERM))
  ------------------
  |  |  596|  17.9k|#define IS_SHORT_TERM  1
  ------------------
  |  Branch (588:8): [True: 17.9k, False: 0]
  ------------------
  589|  17.9k|    {
  590|  17.9k|        if(ps_unmark_node == ps_dpb_mgr->ps_dpb_st_head)
  ------------------
  |  Branch (590:12): [True: 17.9k, False: 77]
  ------------------
  591|  17.9k|            ps_dpb_mgr->ps_dpb_st_head = ps_next_dpb->ps_prev_short;
  592|     77|        else
  593|     77|            ps_next_dpb->ps_prev_short = ps_unmark_node->ps_prev_short; //update link
  594|  17.9k|        ps_dpb_mgr->u1_num_st_ref_bufs--; //decrement ST buf count
  595|  17.9k|        u1_del_node = 1;
  596|  17.9k|    }
  597|       |
  598|  17.9k|    if(u4_lt_idx == MAX_REF_BUFS + 1)
  ------------------
  |  |   75|  17.9k|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (598:8): [True: 244, False: 17.7k]
  ------------------
  599|    244|    {
  600|    244|        if(u1_del_node)
  ------------------
  |  Branch (600:12): [True: 244, False: 0]
  ------------------
  601|    244|        {
  602|       |            // Release the physical buffer
  603|    244|            ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
  604|    244|                                        ps_unmark_node->u1_buf_id);
  605|    244|            ps_unmark_node->ps_prev_short = NULL;
  606|    244|        }
  607|    244|    }
  608|  17.7k|    else
  609|  17.7k|    {
  610|  17.7k|        WORD32 i4_status;
  611|       |        //If another node has the same LT index, delete that node
  612|  17.7k|        ret = ih264d_delete_lt_node(ps_dpb_mgr, u4_lt_idx,
  613|  17.7k|                              u1_fld_pic_flag, ps_unmark_node, &i4_status);
  614|  17.7k|        if(ret != OK)
  ------------------
  |  |  114|  17.7k|#define OK        0
  ------------------
  |  Branch (614:12): [True: 0, False: 17.7k]
  ------------------
  615|      0|            return ret;
  616|       |        // Now insert the short term node as a long term node
  617|  17.7k|        ret = ih264d_insert_lt_node(ps_dpb_mgr, ps_unmark_node, u4_lt_idx,
  618|  17.7k|                              u1_fld_pic_flag);
  619|  17.7k|        if(ret != OK)
  ------------------
  |  |  114|  17.7k|#define OK        0
  ------------------
  |  Branch (619:12): [True: 0, False: 17.7k]
  ------------------
  620|      0|            return ret;
  621|  17.7k|    }
  622|  17.9k|    return OK;
  ------------------
  |  |  114|  17.9k|#define OK        0
  ------------------
  623|  17.9k|}
ih264d_reset_ref_bufs:
  636|   197k|{
  637|   197k|    WORD32 i;
  638|   197k|    struct dpb_info_t *ps_dpb_info = ps_dpb_mgr->as_dpb_info;
  639|       |
  640|  6.51M|    for(i = 0; i < MAX_REF_BUFS; i++)
  ------------------
  |  |   75|  6.51M|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (640:16): [True: 6.31M, False: 197k]
  ------------------
  641|  6.31M|    {
  642|  6.31M|        if(ps_dpb_info[i].u1_used_as_ref)
  ------------------
  |  Branch (642:12): [True: 81.9k, False: 6.23M]
  ------------------
  643|  81.9k|        {
  644|  81.9k|            ps_dpb_info[i].u1_used_as_ref = UNUSED_FOR_REF;
  ------------------
  |  |  595|  81.9k|#define UNUSED_FOR_REF 0
  ------------------
  645|  81.9k|            ps_dpb_info[i].u1_lt_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  81.9k|#define MAX_REF_BUFS    32
  ------------------
  646|  81.9k|            ps_dpb_info[i].ps_prev_short = NULL;
  647|  81.9k|            ps_dpb_info[i].ps_prev_long = NULL;
  648|  81.9k|            ps_dpb_info[i].ps_pic_buf = NULL;
  649|  81.9k|            ps_dpb_info[i].s_top_field.u1_reference_info = UNUSED_FOR_REF;
  ------------------
  |  |  595|  81.9k|#define UNUSED_FOR_REF 0
  ------------------
  650|  81.9k|            ps_dpb_info[i].s_bot_field.u1_reference_info = UNUSED_FOR_REF;
  ------------------
  |  |  595|  81.9k|#define UNUSED_FOR_REF 0
  ------------------
  651|  81.9k|            ps_dpb_info[i].s_top_field.u1_long_term_frame_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  81.9k|#define MAX_REF_BUFS    32
  ------------------
  652|  81.9k|            ps_dpb_info[i].s_bot_field.u1_long_term_frame_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  81.9k|#define MAX_REF_BUFS    32
  ------------------
  653|       |
  654|       |            //Release physical buffer
  655|  81.9k|            ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
  656|  81.9k|                                        ps_dpb_info[i].u1_buf_id);
  657|  81.9k|        }
  658|  6.31M|    }
  659|   197k|    ps_dpb_mgr->u1_num_st_ref_bufs = ps_dpb_mgr->u1_num_lt_ref_bufs = 0;
  660|   197k|    ps_dpb_mgr->ps_dpb_st_head = NULL;
  661|   197k|    ps_dpb_mgr->ps_dpb_ht_head = NULL;
  662|   197k|    ps_dpb_mgr->u1_mmco_error_in_seq = 0;
  663|       |
  664|       |    /* release all gaps */
  665|   197k|    ps_dpb_mgr->u1_num_gaps = 0;
  666|  3.35M|    for(i = 0; i < MAX_FRAMES; i++)
  ------------------
  |  |  600|  3.35M|#define MAX_FRAMES              16
  ------------------
  |  Branch (666:16): [True: 3.15M, False: 197k]
  ------------------
  667|  3.15M|    {
  668|  3.15M|        ps_dpb_mgr->ai4_gaps_start_frm_num[i] = INVALID_FRAME_NUM;
  ------------------
  |  |  601|  3.15M|#define INVALID_FRAME_NUM       0x0fffffff
  ------------------
  669|  3.15M|        ps_dpb_mgr->ai4_gaps_end_frm_num[i] = 0;
  670|  3.15M|        ps_dpb_mgr->ai1_gaps_per_seq[i] = 0;
  671|  3.15M|    }
  672|   197k|}
ih264d_update_default_index_list:
  687|   112k|{
  688|   112k|    WORD32 i;
  689|   112k|    struct dpb_info_t *ps_next_dpb = ps_dpb_mgr->ps_dpb_st_head;
  690|       |
  691|   223k|    for(i = 0; i < ps_dpb_mgr->u1_num_st_ref_bufs; i++)
  ------------------
  |  Branch (691:16): [True: 110k, False: 112k]
  ------------------
  692|   110k|    {
  693|   110k|        ps_dpb_mgr->ps_def_dpb[i] = ps_next_dpb->ps_pic_buf;
  694|   110k|        ps_next_dpb = ps_next_dpb->ps_prev_short;
  695|   110k|    }
  696|       |
  697|   112k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
  698|   130k|    for(;i< ps_dpb_mgr->u1_num_st_ref_bufs + ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
  ------------------
  |  Branch (698:10): [True: 18.1k, False: 112k]
  ------------------
  699|  18.1k|    {
  700|  18.1k|        ps_dpb_mgr->ps_def_dpb[i] = ps_next_dpb->ps_pic_buf;
  701|  18.1k|        ps_next_dpb = ps_next_dpb->ps_prev_long;
  702|  18.1k|    }
  703|   112k|    return 0;
  704|   112k|}
ih264d_ref_idx_reordering:
  729|  68.1k|{
  730|  68.1k|    dpb_manager_t *ps_dpb_mgr = ps_dec->ps_dpb_mgr;
  731|  68.1k|    UWORD16 u4_cur_pic_num = ps_dec->ps_cur_slice->u2_frame_num;
  732|       |    /*< Maximum Picture Number Minus 1 */
  733|  68.1k|    UWORD32 ui_max_frame_num =
  734|  68.1k|                    ps_dec->ps_cur_sps->u2_u4_max_pic_num_minus1 + 1;
  735|       |
  736|  68.1k|    WORD32 i, count = 0;
  737|  68.1k|    UWORD32 ui_remapIdc, ui_nextUev;
  738|  68.1k|    WORD16 u2_pred_frame_num = u4_cur_pic_num;
  739|  68.1k|    WORD32 i_temp;
  740|  68.1k|    UWORD16 u2_def_mod_flag = 0; /* Flag to keep track of which indices have been remapped */
  741|  68.1k|    UWORD8 modCount = 0;
  742|  68.1k|    UWORD32 *pu4_bitstrm_buf = ps_dec->ps_bitstrm->pu4_buffer;
  743|  68.1k|    UWORD32 *pu4_bitstrm_ofst = &ps_dec->ps_bitstrm->u4_ofst;
  744|  68.1k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
  745|  68.1k|    UWORD8 u1_field_pic_flag = ps_cur_slice->u1_field_pic_flag;
  746|       |
  747|  68.1k|    if(u1_field_pic_flag)
  ------------------
  |  Branch (747:8): [True: 0, False: 68.1k]
  ------------------
  748|      0|    {
  749|      0|        u4_cur_pic_num = u4_cur_pic_num * 2 + 1;
  750|      0|        ui_max_frame_num = ui_max_frame_num * 2;
  751|      0|    }
  752|       |
  753|  68.1k|    u2_pred_frame_num = u4_cur_pic_num;
  754|       |
  755|  68.1k|    ui_remapIdc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  756|       |
  757|  70.0k|    while((ui_remapIdc != 3)
  ------------------
  |  Branch (757:11): [True: 68.7k, False: 1.26k]
  ------------------
  758|  68.7k|                    && (count < ps_cur_slice->u1_num_ref_idx_lx_active[uc_lx]))
  ------------------
  |  Branch (758:24): [True: 67.8k, False: 918]
  ------------------
  759|  67.8k|    {
  760|  67.8k|        ui_nextUev = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  761|  67.8k|        if(ui_remapIdc != 2)
  ------------------
  |  Branch (761:12): [True: 63.0k, False: 4.85k]
  ------------------
  762|  63.0k|        {
  763|  63.0k|            if(ui_nextUev > ui_max_frame_num)
  ------------------
  |  Branch (763:16): [True: 3.93k, False: 59.0k]
  ------------------
  764|  3.93k|                return ERROR_DBP_MANAGER_T;
  765|       |
  766|  59.0k|            ui_nextUev = ui_nextUev + 1;
  767|       |
  768|  59.0k|            if(ui_remapIdc == 0)
  ------------------
  |  Branch (768:16): [True: 43.4k, False: 15.6k]
  ------------------
  769|  43.4k|            {
  770|       |                // diffPicNum is -ve
  771|  43.4k|                i_temp = (WORD32)u2_pred_frame_num - (WORD32)ui_nextUev;
  772|  43.4k|                if(i_temp < 0)
  ------------------
  |  Branch (772:20): [True: 7.33k, False: 36.1k]
  ------------------
  773|  7.33k|                    i_temp += ui_max_frame_num;
  774|  43.4k|            }
  775|  15.6k|            else
  776|  15.6k|            {
  777|       |                // diffPicNum is +ve
  778|  15.6k|                i_temp = (WORD32)u2_pred_frame_num + (WORD32)ui_nextUev;
  779|  15.6k|                if(i_temp >= (WORD32)ui_max_frame_num)
  ------------------
  |  Branch (779:20): [True: 2.54k, False: 13.0k]
  ------------------
  780|  2.54k|                    i_temp -= ui_max_frame_num;
  781|  15.6k|            }
  782|       |            /* Find the dpb with the matching picNum (picNum==frameNum for framePic) */
  783|       |
  784|  59.0k|            if(i_temp > u4_cur_pic_num)
  ------------------
  |  Branch (784:16): [True: 20.1k, False: 38.9k]
  ------------------
  785|  20.1k|                i_temp = i_temp - ui_max_frame_num;
  786|       |
  787|   111k|            for(i = 0; i < (ps_cur_slice->u1_initial_list_size[uc_lx]); i++)
  ------------------
  |  Branch (787:24): [True: 53.8k, False: 57.8k]
  ------------------
  788|  53.8k|            {
  789|  53.8k|                if(ps_dpb_mgr->ps_init_dpb[uc_lx][i]->i4_pic_num == i_temp)
  ------------------
  |  Branch (789:20): [True: 1.19k, False: 52.6k]
  ------------------
  790|  1.19k|                    break;
  791|  53.8k|            }
  792|  59.0k|            if(i == (ps_cur_slice->u1_initial_list_size[uc_lx]))
  ------------------
  |  Branch (792:16): [True: 57.8k, False: 1.19k]
  ------------------
  793|  57.8k|            {
  794|  57.8k|                UWORD32 i4_error_code;
  795|  57.8k|                i4_error_code = ERROR_DBP_MANAGER_T;
  796|  57.8k|                return i4_error_code;
  797|  57.8k|            }
  798|       |
  799|  1.19k|            u2_def_mod_flag |= (1 << i);
  800|  1.19k|            ps_dpb_mgr->ps_mod_dpb[uc_lx][modCount++] =
  801|  1.19k|                            ps_dpb_mgr->ps_init_dpb[uc_lx][i];
  802|  1.19k|            u2_pred_frame_num = i_temp; //update predictor to be the picNum just obtained
  803|  1.19k|        }
  804|  4.85k|        else //2
  805|  4.85k|        {
  806|  4.85k|            UWORD8 u1_lt_idx;
  807|       |
  808|  4.85k|            if(ui_nextUev > (MAX_REF_BUFS + 1))
  ------------------
  |  |   75|  4.85k|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (808:16): [True: 310, False: 4.54k]
  ------------------
  809|    310|                return ERROR_DBP_MANAGER_T;
  810|       |
  811|  4.54k|            u1_lt_idx = (UWORD8)ui_nextUev;
  812|       |
  813|  8.73k|            for(i = 0; i < (ps_cur_slice->u1_initial_list_size[uc_lx]); i++)
  ------------------
  |  Branch (813:24): [True: 4.88k, False: 3.85k]
  ------------------
  814|  4.88k|            {
  815|  4.88k|                if(!ps_dpb_mgr->ps_init_dpb[uc_lx][i]->u1_is_short)
  ------------------
  |  Branch (815:20): [True: 1.14k, False: 3.74k]
  ------------------
  816|  1.14k|                {
  817|  1.14k|                    if(ps_dpb_mgr->ps_init_dpb[uc_lx][i]->u1_long_term_pic_num
  ------------------
  |  Branch (817:24): [True: 690, False: 456]
  ------------------
  818|  1.14k|                                    == u1_lt_idx)
  819|    690|                        break;
  820|  1.14k|                }
  821|  4.88k|            }
  822|  4.54k|            if(i == (ps_cur_slice->u1_initial_list_size[uc_lx]))
  ------------------
  |  Branch (822:16): [True: 3.85k, False: 690]
  ------------------
  823|  3.85k|            {
  824|  3.85k|                UWORD32 i4_error_code;
  825|  3.85k|                i4_error_code = ERROR_DBP_MANAGER_T;
  826|  3.85k|                return i4_error_code;
  827|  3.85k|            }
  828|       |
  829|    690|            u2_def_mod_flag |= (1 << i);
  830|    690|            ps_dpb_mgr->ps_mod_dpb[uc_lx][modCount++] =
  831|    690|                            ps_dpb_mgr->ps_init_dpb[uc_lx][i];
  832|    690|        }
  833|       |
  834|  1.88k|        ui_remapIdc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  835|       |        /* Get the remapping_idc - 0/1/2/3 */
  836|  1.88k|        count++;
  837|  1.88k|    }
  838|       |
  839|       |    //Handle the ref indices that were not remapped
  840|  7.59k|    for(i = 0; i < (ps_cur_slice->u1_num_ref_idx_lx_active[uc_lx]); i++)
  ------------------
  |  Branch (840:16): [True: 5.41k, False: 2.18k]
  ------------------
  841|  5.41k|    {
  842|  5.41k|        if(!(u2_def_mod_flag & (1 << i)))
  ------------------
  |  Branch (842:12): [True: 4.51k, False: 895]
  ------------------
  843|  4.51k|            ps_dpb_mgr->ps_mod_dpb[uc_lx][modCount++] =
  844|  4.51k|                            ps_dpb_mgr->ps_init_dpb[uc_lx][i];
  845|  5.41k|    }
  846|  2.18k|    return OK;
  ------------------
  |  |  114|  2.18k|#define OK        0
  ------------------
  847|  68.1k|}
ih264d_read_mmco_commands:
  866|   139k|{
  867|   139k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
  868|   139k|    dec_seq_params_t *ps_sps = ps_pps->ps_sps;
  869|   139k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
  870|   139k|    dpb_commands_t *ps_dpb_cmds = &(ps_dec->s_dpb_cmds_scratch);
  871|   139k|    dec_slice_params_t * ps_slice = ps_dec->ps_cur_slice;
  872|   139k|    WORD32 j;
  873|   139k|    UWORD8 u1_buf_mode;
  874|   139k|    struct MMCParams *ps_mmc_params;
  875|   139k|    UWORD32 *pu4_bitstrm_buf = ps_dec->ps_bitstrm->pu4_buffer;
  876|   139k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  877|   139k|    UWORD32 u4_bit_ofst = ps_dec->ps_bitstrm->u4_ofst;
  878|       |
  879|   139k|    ps_slice->u1_mmco_equalto5 = 0;
  880|   139k|    {
  881|   139k|        if(ps_dec->u1_nal_unit_type == IDR_SLICE_NAL)
  ------------------
  |  |  328|   139k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (881:12): [True: 121k, False: 17.7k]
  ------------------
  882|   121k|        {
  883|   121k|            ps_slice->u1_no_output_of_prior_pics_flag =
  884|   121k|                            ih264d_get_bit_h264(ps_bitstrm);
  885|   121k|            COPYTHECONTEXT("SH: no_output_of_prior_pics_flag",
  886|   121k|                            ps_slice->u1_no_output_of_prior_pics_flag);
  887|   121k|            ps_slice->u1_long_term_reference_flag = ih264d_get_bit_h264(
  888|   121k|                            ps_bitstrm);
  889|   121k|            COPYTHECONTEXT("SH: long_term_reference_flag",
  890|   121k|                            ps_slice->u1_long_term_reference_flag);
  891|   121k|            ps_dpb_cmds->u1_idr_pic = 1;
  892|   121k|            ps_dpb_cmds->u1_no_output_of_prior_pics_flag =
  893|   121k|                            ps_slice->u1_no_output_of_prior_pics_flag;
  894|   121k|            ps_dpb_cmds->u1_long_term_reference_flag =
  895|   121k|                            ps_slice->u1_long_term_reference_flag;
  896|   121k|        }
  897|  17.7k|        else
  898|  17.7k|        {
  899|  17.7k|            u1_buf_mode = ih264d_get_bit_h264(ps_bitstrm); //0 - sliding window; 1 - arbitrary
  900|  17.7k|            COPYTHECONTEXT("SH: adaptive_ref_pic_buffering_flag", u1_buf_mode);
  901|  17.7k|            ps_dpb_cmds->u1_buf_mode = u1_buf_mode;
  902|  17.7k|            j = 0;
  903|       |
  904|  17.7k|            if(u1_buf_mode == 1)
  ------------------
  |  Branch (904:16): [True: 8.46k, False: 9.30k]
  ------------------
  905|  8.46k|            {
  906|  8.46k|                UWORD32 u4_mmco;
  907|  8.46k|                UWORD32 u4_diff_pic_num;
  908|  8.46k|                UWORD32 u4_lt_idx, u4_max_lt_idx_plus1;
  909|       |
  910|  8.46k|                u4_mmco = ih264d_uev(pu4_bitstrm_ofst,
  911|  8.46k|                                     pu4_bitstrm_buf);
  912|  63.4k|                while(u4_mmco != END_OF_MMCO)
  ------------------
  |  |   43|  63.4k|#define END_OF_MMCO                 0
  ------------------
  |  Branch (912:23): [True: 56.0k, False: 7.38k]
  ------------------
  913|  56.0k|                {
  914|  56.0k|                    if (j >= MAX_REF_BUFS)
  ------------------
  |  |   75|  56.0k|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (914:25): [True: 949, False: 55.0k]
  ------------------
  915|    949|                    {
  916|       |#ifdef __ANDROID__
  917|       |                        ALOGE("b/25818142");
  918|       |                        android_errorWriteLog(0x534e4554, "25818142");
  919|       |#endif
  920|    949|                        ps_dpb_cmds->u1_num_of_commands = 0;
  921|    949|                        return -1;
  922|    949|                    }
  923|  55.0k|                    ps_mmc_params = &ps_dpb_cmds->as_mmc_params[j];
  924|  55.0k|                    ps_mmc_params->u4_mmco = u4_mmco;
  925|  55.0k|                    switch(u4_mmco)
  926|  55.0k|                    {
  927|  4.29k|                        case MARK_ST_PICNUM_AS_NONREF:
  ------------------
  |  |   44|  4.29k|#define MARK_ST_PICNUM_AS_NONREF    1
  ------------------
  |  Branch (927:25): [True: 4.29k, False: 50.7k]
  ------------------
  928|  4.29k|                            u4_diff_pic_num = ih264d_uev(pu4_bitstrm_ofst,
  929|  4.29k|                                                         pu4_bitstrm_buf);
  930|       |                            //Get absDiffPicnumMinus1
  931|  4.29k|                            ps_mmc_params->u4_diff_pic_num = u4_diff_pic_num;
  932|  4.29k|                            break;
  933|       |
  934|  3.21k|                        case MARK_LT_INDEX_AS_NONREF:
  ------------------
  |  |   45|  3.21k|#define MARK_LT_INDEX_AS_NONREF     2
  ------------------
  |  Branch (934:25): [True: 3.21k, False: 51.8k]
  ------------------
  935|  3.21k|                            u4_lt_idx = ih264d_uev(pu4_bitstrm_ofst,
  936|  3.21k|                                                   pu4_bitstrm_buf);
  937|  3.21k|                            ps_mmc_params->u4_lt_idx = u4_lt_idx;
  938|  3.21k|                            break;
  939|       |
  940|  2.14k|                        case MARK_ST_PICNUM_AS_LT_INDEX:
  ------------------
  |  |   46|  2.14k|#define MARK_ST_PICNUM_AS_LT_INDEX  3
  ------------------
  |  Branch (940:25): [True: 2.14k, False: 52.9k]
  ------------------
  941|  2.14k|                            u4_diff_pic_num = ih264d_uev(pu4_bitstrm_ofst,
  942|  2.14k|                                                         pu4_bitstrm_buf);
  943|  2.14k|                            ps_mmc_params->u4_diff_pic_num = u4_diff_pic_num;
  944|  2.14k|                            u4_lt_idx = ih264d_uev(pu4_bitstrm_ofst,
  945|  2.14k|                                                   pu4_bitstrm_buf);
  946|  2.14k|                            ps_mmc_params->u4_lt_idx = u4_lt_idx;
  947|  2.14k|                            break;
  948|       |
  949|  3.45k|                        case SET_MAX_LT_INDEX:
  ------------------
  |  |   47|  3.45k|#define SET_MAX_LT_INDEX            4
  ------------------
  |  Branch (949:25): [True: 3.45k, False: 51.6k]
  ------------------
  950|  3.45k|                        {
  951|  3.45k|                            u4_max_lt_idx_plus1 = ih264d_uev(pu4_bitstrm_ofst,
  952|  3.45k|                                                             pu4_bitstrm_buf);
  953|  3.45k|                            if (u4_max_lt_idx_plus1 > ps_sps->u1_num_ref_frames)
  ------------------
  |  Branch (953:33): [True: 133, False: 3.31k]
  ------------------
  954|    133|                            {
  955|       |                                /* Invalid max LT ref index */
  956|    133|                                return -1;
  957|    133|                            }
  958|  3.31k|                            ps_mmc_params->u4_max_lt_idx_plus1 = u4_max_lt_idx_plus1;
  959|  3.31k|                            break;
  960|  3.45k|                        }
  961|  2.79k|                        case RESET_REF_PICTURES:
  ------------------
  |  |   48|  2.79k|#define RESET_REF_PICTURES          5
  ------------------
  |  Branch (961:25): [True: 2.79k, False: 52.2k]
  ------------------
  962|  2.79k|                        {
  963|  2.79k|                            ps_slice->u1_mmco_equalto5 = 1;
  964|  2.79k|                            break;
  965|  3.45k|                        }
  966|       |
  967|  1.73k|                        case SET_LT_INDEX:
  ------------------
  |  |   49|  1.73k|#define SET_LT_INDEX                6
  ------------------
  |  Branch (967:25): [True: 1.73k, False: 53.3k]
  ------------------
  968|  1.73k|                            u4_lt_idx = ih264d_uev(pu4_bitstrm_ofst,
  969|  1.73k|                                                   pu4_bitstrm_buf);
  970|  1.73k|                            ps_mmc_params->u4_lt_idx = u4_lt_idx;
  971|  1.73k|                            break;
  972|       |
  973|  37.4k|                        default:
  ------------------
  |  Branch (973:25): [True: 37.4k, False: 17.6k]
  ------------------
  974|  37.4k|                            break;
  975|  55.0k|                    }
  976|  54.9k|                    u4_mmco = ih264d_uev(pu4_bitstrm_ofst,
  977|  54.9k|                                         pu4_bitstrm_buf);
  978|       |
  979|  54.9k|                    j++;
  980|  54.9k|                }
  981|  7.38k|                ps_dpb_cmds->u1_num_of_commands = j;
  982|  7.38k|            }
  983|  17.7k|        }
  984|   138k|        ps_dpb_cmds->u1_dpb_commands_read = 1;
  985|   138k|        ps_dpb_cmds->u1_dpb_commands_read_slc = 1;
  986|       |
  987|   138k|    }
  988|      0|    u4_bit_ofst = ps_dec->ps_bitstrm->u4_ofst - u4_bit_ofst;
  989|   138k|    return u4_bit_ofst;
  990|   139k|}
ih264d_do_mmco_buffer:
 1017|  12.0k|{
 1018|  12.0k|    WORD32 i;
 1019|  12.0k|    UWORD8 u1_buf_mode, u1_marked_lt;
 1020|  12.0k|    struct dpb_info_t *ps_next_dpb;
 1021|  12.0k|    UWORD8 u1_num_gaps;
 1022|  12.0k|    UWORD8 u1_del_node = 1;
 1023|  12.0k|    UWORD8 u1_insert_st_pic = 1;
 1024|  12.0k|    WORD32 ret;
 1025|  12.0k|    UNUSED(u1_nal_unit_type);
  ------------------
  |  |   45|  12.0k|#define UNUSED(x) ((void)(x))
  ------------------
 1026|  12.0k|    UNUSED(u2_u4_max_pic_num_minus1);
  ------------------
  |  |   45|  12.0k|#define UNUSED(x) ((void)(x))
  ------------------
 1027|  12.0k|    u1_buf_mode = ps_dpb_cmds->u1_buf_mode; //0 - sliding window; 1 - Adaptive
 1028|  12.0k|    u1_marked_lt = 0;
 1029|  12.0k|    u1_num_gaps = ps_dpb_mgr->u1_num_gaps;
 1030|       |
 1031|  12.0k|    if(!u1_buf_mode)
  ------------------
  |  Branch (1031:8): [True: 7.19k, False: 4.81k]
  ------------------
 1032|  7.19k|    {
 1033|       |        //Sliding window - implements 8.2.5.3
 1034|  7.19k|        if((ps_dpb_mgr->u1_num_st_ref_bufs
  ------------------
  |  Branch (1034:12): [True: 2.82k, False: 4.36k]
  ------------------
 1035|  7.19k|                        + ps_dpb_mgr->u1_num_lt_ref_bufs + u1_num_gaps)
 1036|  7.19k|                        == u1_numRef_frames_for_seq)
 1037|  2.82k|        {
 1038|  2.82k|            UWORD8 u1_new_node_flag = 1;
 1039|  2.82k|            if((0 == ps_dpb_mgr->u1_num_st_ref_bufs) && (0 == u1_num_gaps))
  ------------------
  |  Branch (1039:16): [True: 229, False: 2.59k]
  |  Branch (1039:57): [True: 229, False: 0]
  ------------------
 1040|    229|            {
 1041|    229|                UWORD32 i4_error_code;
 1042|    229|                i4_error_code = ERROR_DBP_MANAGER_T;
 1043|    229|                return i4_error_code;
 1044|    229|            }
 1045|       |
 1046|       |            // Chase the links to reach the last but one picNum, if available
 1047|  2.59k|            ps_next_dpb = ps_dpb_mgr->ps_dpb_st_head;
 1048|       |
 1049|  2.59k|            if(ps_dpb_mgr->u1_num_st_ref_bufs > 1)
  ------------------
  |  Branch (1049:16): [True: 661, False: 1.93k]
  ------------------
 1050|    661|            {
 1051|    661|                if(ps_next_dpb->i4_frame_num == (WORD32)u4_cur_pic_num)
  ------------------
  |  Branch (1051:20): [True: 62, False: 599]
  ------------------
 1052|     62|                {
 1053|       |                    /* Incase of  filed pictures top_field has been allocated   */
 1054|       |                    /* picture buffer and complementary bottom field pair comes */
 1055|       |                    /* then the sliding window mechanism should not allocate a  */
 1056|       |                    /* new node                                                 */
 1057|     62|                    u1_new_node_flag = 0;
 1058|     62|                }
 1059|       |
 1060|  1.69k|                for(i = 1; i < (ps_dpb_mgr->u1_num_st_ref_bufs - 1); i++)
  ------------------
  |  Branch (1060:28): [True: 1.03k, False: 661]
  ------------------
 1061|  1.03k|                {
 1062|  1.03k|                    if(ps_next_dpb == NULL)
  ------------------
  |  Branch (1062:24): [True: 0, False: 1.03k]
  ------------------
 1063|      0|                    {
 1064|      0|                        UWORD32 i4_error_code;
 1065|      0|                        i4_error_code = ERROR_DBP_MANAGER_T;
 1066|      0|                        return i4_error_code;
 1067|      0|                    }
 1068|  1.03k|                    if(ps_next_dpb->i4_frame_num == (WORD32)u4_cur_pic_num)
  ------------------
  |  Branch (1068:24): [True: 233, False: 802]
  ------------------
 1069|    233|                    {
 1070|       |                        /* Incase of  field pictures top_field has been allocated   */
 1071|       |                        /* picture buffer and complementary bottom field pair comes */
 1072|       |                        /* then the sliding window mechanism should not allocate a  */
 1073|       |                        /* new node                                                 */
 1074|    233|                        u1_new_node_flag = 0;
 1075|    233|                    }
 1076|  1.03k|                    ps_next_dpb = ps_next_dpb->ps_prev_short;
 1077|  1.03k|                }
 1078|       |
 1079|    661|                if(ps_next_dpb->ps_prev_short->ps_prev_short != NULL)
  ------------------
  |  Branch (1079:20): [True: 23, False: 638]
  ------------------
 1080|     23|                {
 1081|     23|                    UWORD32 i4_error_code;
 1082|     23|                    i4_error_code = ERROR_DBP_MANAGER_T;
 1083|     23|                    return i4_error_code;
 1084|     23|                }
 1085|       |
 1086|    638|                if(u1_new_node_flag)
  ------------------
  |  Branch (1086:20): [True: 546, False: 92]
  ------------------
 1087|    546|                {
 1088|    546|                    if(u1_num_gaps)
  ------------------
  |  Branch (1088:24): [True: 0, False: 546]
  ------------------
 1089|      0|                    {
 1090|      0|                        ret = ih264d_delete_gap_frm_sliding(ps_dpb_mgr,
 1091|      0|                                                            ps_next_dpb->ps_prev_short->i4_frame_num,
 1092|      0|                                                            &u1_del_node);
 1093|      0|                        if(ret != OK)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (1093:28): [True: 0, False: 0]
  ------------------
 1094|      0|                            return ret;
 1095|      0|                    }
 1096|       |
 1097|    546|                    if(u1_del_node)
  ------------------
  |  Branch (1097:24): [True: 546, False: 0]
  ------------------
 1098|    546|                    {
 1099|    546|                        ps_dpb_mgr->u1_num_st_ref_bufs--;
 1100|    546|                        ps_next_dpb->ps_prev_short->u1_used_as_ref =
 1101|    546|                                        UNUSED_FOR_REF;
  ------------------
  |  |  595|    546|#define UNUSED_FOR_REF 0
  ------------------
 1102|    546|                        ps_next_dpb->ps_prev_short->s_top_field.u1_reference_info =
 1103|    546|                                        UNUSED_FOR_REF;
  ------------------
  |  |  595|    546|#define UNUSED_FOR_REF 0
  ------------------
 1104|    546|                        ps_next_dpb->ps_prev_short->s_bot_field.u1_reference_info =
 1105|    546|                                        UNUSED_FOR_REF;
  ------------------
  |  |  595|    546|#define UNUSED_FOR_REF 0
  ------------------
 1106|    546|                        ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
 1107|    546|                                                    ps_next_dpb->ps_prev_short->u1_buf_id);
 1108|    546|                        ps_next_dpb->ps_prev_short->ps_pic_buf = NULL;
 1109|    546|                        ps_next_dpb->ps_prev_short = NULL;
 1110|    546|                    }
 1111|    546|                }
 1112|    638|            }
 1113|  1.93k|            else
 1114|  1.93k|            {
 1115|  1.93k|                if(ps_dpb_mgr->u1_num_st_ref_bufs)
  ------------------
  |  Branch (1115:20): [True: 1.93k, False: 0]
  ------------------
 1116|  1.93k|                {
 1117|  1.93k|                    ret = ih264d_delete_gap_frm_sliding(ps_dpb_mgr,
 1118|  1.93k|                                                       ps_next_dpb->i4_frame_num,
 1119|  1.93k|                                                       &u1_del_node);
 1120|  1.93k|                    if(ret != OK)
  ------------------
  |  |  114|  1.93k|#define OK        0
  ------------------
  |  Branch (1120:24): [True: 0, False: 1.93k]
  ------------------
 1121|      0|                        return ret;
 1122|  1.93k|                    if((ps_next_dpb->i4_frame_num != (WORD32)u4_cur_pic_num)
  ------------------
  |  Branch (1122:24): [True: 433, False: 1.50k]
  ------------------
 1123|    433|                                    && u1_del_node)
  ------------------
  |  Branch (1123:40): [True: 433, False: 0]
  ------------------
 1124|    433|                    {
 1125|    433|                        ps_dpb_mgr->u1_num_st_ref_bufs--;
 1126|    433|                        ps_next_dpb->u1_used_as_ref = FALSE;
  ------------------
  |  |  592|    433|#define FALSE   0
  ------------------
 1127|    433|                        ps_next_dpb->s_top_field.u1_reference_info =
 1128|    433|                                        UNUSED_FOR_REF;
  ------------------
  |  |  595|    433|#define UNUSED_FOR_REF 0
  ------------------
 1129|    433|                        ps_next_dpb->s_bot_field.u1_reference_info =
 1130|    433|                                        UNUSED_FOR_REF;
  ------------------
  |  |  595|    433|#define UNUSED_FOR_REF 0
  ------------------
 1131|    433|                        ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
 1132|    433|                                                    ps_next_dpb->u1_buf_id);
 1133|    433|                        ps_next_dpb->ps_pic_buf = NULL;
 1134|    433|                        ps_next_dpb->ps_prev_short = NULL;
 1135|    433|                        ps_dpb_mgr->ps_dpb_st_head = NULL;
 1136|    433|                        ps_next_dpb = NULL;
 1137|    433|                    }
 1138|  1.50k|                    else if(ps_next_dpb->i4_frame_num == (WORD32)u4_cur_pic_num)
  ------------------
  |  Branch (1138:29): [True: 1.50k, False: 0]
  ------------------
 1139|  1.50k|                    {
 1140|  1.50k|                        if(u1_curr_pic_in_err)
  ------------------
  |  Branch (1140:28): [True: 0, False: 1.50k]
  ------------------
 1141|      0|                        {
 1142|      0|                            u1_insert_st_pic = 0;
 1143|      0|                        }
 1144|  1.50k|                        else if(ps_dpb_mgr->u1_num_st_ref_bufs > 0)
  ------------------
  |  Branch (1144:33): [True: 1.50k, False: 0]
  ------------------
 1145|  1.50k|                        {
 1146|  1.50k|                            ps_dpb_mgr->u1_num_st_ref_bufs--;
 1147|  1.50k|                            ps_next_dpb->u1_used_as_ref = FALSE;
  ------------------
  |  |  592|  1.50k|#define FALSE   0
  ------------------
 1148|  1.50k|                            ps_next_dpb->s_top_field.u1_reference_info =
 1149|  1.50k|                                            UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.50k|#define UNUSED_FOR_REF 0
  ------------------
 1150|  1.50k|                            ps_next_dpb->s_bot_field.u1_reference_info =
 1151|  1.50k|                                            UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.50k|#define UNUSED_FOR_REF 0
  ------------------
 1152|  1.50k|                            ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
 1153|  1.50k|                                                        ps_next_dpb->u1_buf_id);
 1154|  1.50k|                            ps_next_dpb->ps_pic_buf = NULL;
 1155|  1.50k|                            ps_next_dpb = NULL;
 1156|  1.50k|                        }
 1157|  1.50k|                    }
 1158|  1.93k|                }
 1159|      0|                else
 1160|      0|                {
 1161|      0|                    ret = ih264d_delete_gap_frm_sliding(ps_dpb_mgr,
 1162|      0|                                                        INVALID_FRAME_NUM,
  ------------------
  |  |  601|      0|#define INVALID_FRAME_NUM       0x0fffffff
  ------------------
 1163|      0|                                                        &u1_del_node);
 1164|      0|                    if(ret != OK)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (1164:24): [True: 0, False: 0]
  ------------------
 1165|      0|                        return ret;
 1166|      0|                    if(u1_del_node)
  ------------------
  |  Branch (1166:24): [True: 0, False: 0]
  ------------------
 1167|      0|                    {
 1168|      0|                        UWORD32 i4_error_code;
 1169|      0|                        i4_error_code = ERROR_DBP_MANAGER_T;
 1170|      0|                        return i4_error_code;
 1171|      0|                    }
 1172|      0|                }
 1173|  1.93k|            }
 1174|  2.59k|        }
 1175|  7.19k|    }
 1176|  4.81k|    else
 1177|  4.81k|    {
 1178|       |        //Adaptive memory control - implements 8.2.5.4
 1179|  4.81k|        UWORD32 u4_mmco;
 1180|  4.81k|        UWORD32 u4_diff_pic_num;
 1181|  4.81k|        WORD32 i4_pic_num;
 1182|  4.81k|        UWORD32 u4_lt_idx;
 1183|  4.81k|        WORD32 j;
 1184|  4.81k|        struct MMCParams *ps_mmc_params;
 1185|       |
 1186|  32.9k|        for(j = 0; j < ps_dpb_cmds->u1_num_of_commands; j++)
  ------------------
  |  Branch (1186:20): [True: 29.6k, False: 3.28k]
  ------------------
 1187|  29.6k|        {
 1188|  29.6k|            ps_mmc_params = &ps_dpb_cmds->as_mmc_params[j];
 1189|  29.6k|            u4_mmco = ps_mmc_params->u4_mmco; //Get MMCO
 1190|       |
 1191|  29.6k|            switch(u4_mmco)
 1192|  29.6k|            {
 1193|  2.39k|                case MARK_ST_PICNUM_AS_NONREF:
  ------------------
  |  |   44|  2.39k|#define MARK_ST_PICNUM_AS_NONREF    1
  ------------------
  |  Branch (1193:17): [True: 2.39k, False: 27.2k]
  ------------------
 1194|  2.39k|                {
 1195|       |
 1196|  2.39k|                    {
 1197|  2.39k|                        UWORD32 i4_cur_pic_num = u4_cur_pic_num;
 1198|  2.39k|                        WORD64 i8_pic_num;
 1199|  2.39k|                        u4_diff_pic_num = ps_mmc_params->u4_diff_pic_num; //Get absDiffPicnumMinus1
 1200|  2.39k|                        if(u1_fld_pic_flag)
  ------------------
  |  Branch (1200:28): [True: 0, False: 2.39k]
  ------------------
 1201|      0|                            i4_cur_pic_num = i4_cur_pic_num * 2 + 1;
 1202|  2.39k|                        i8_pic_num = ((WORD64)i4_cur_pic_num - ((WORD64)u4_diff_pic_num + 1));
 1203|  2.39k|                        if(IS_OUT_OF_RANGE_S32(i8_pic_num))
  ------------------
  |  |   58|  2.39k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 174, False: 2.22k]
  |  |  |  Branch (58:54): [True: 0, False: 2.22k]
  |  |  ------------------
  ------------------
 1204|    174|                        {
 1205|    174|                            return ERROR_DBP_MANAGER_T;
 1206|    174|                        }
 1207|  2.22k|                        i4_pic_num = i8_pic_num;
 1208|  2.22k|                    }
 1209|       |
 1210|  2.22k|                    if(ps_dpb_mgr->u1_num_st_ref_bufs > 0)
  ------------------
  |  Branch (1210:24): [True: 638, False: 1.58k]
  ------------------
 1211|    638|                    {
 1212|    638|                        ret = ih264d_delete_st_node_or_make_lt(ps_dpb_mgr,
 1213|    638|                                                               i4_pic_num,
 1214|    638|                                                               MAX_REF_BUFS + 1,
  ------------------
  |  |   75|    638|#define MAX_REF_BUFS    32
  ------------------
 1215|    638|                                                               u1_fld_pic_flag);
 1216|    638|                        if(ret != OK)
  ------------------
  |  |  114|    638|#define OK        0
  ------------------
  |  Branch (1216:28): [True: 394, False: 244]
  ------------------
 1217|    394|                            return ret;
 1218|    638|                    }
 1219|  1.58k|                    else
 1220|  1.58k|                    {
 1221|  1.58k|                        UWORD8 u1_dummy;
 1222|  1.58k|                        ret = ih264d_delete_gap_frm_mmco(ps_dpb_mgr, i4_pic_num, &u1_dummy);
 1223|  1.58k|                        if(ret != OK)
  ------------------
  |  |  114|  1.58k|#define OK        0
  ------------------
  |  Branch (1223:28): [True: 0, False: 1.58k]
  ------------------
 1224|      0|                            return ret;
 1225|  1.58k|                    }
 1226|  1.82k|                    break;
 1227|  2.22k|                }
 1228|  1.86k|                case MARK_LT_INDEX_AS_NONREF:
  ------------------
  |  |   45|  1.86k|#define MARK_LT_INDEX_AS_NONREF     2
  ------------------
  |  Branch (1228:17): [True: 1.86k, False: 27.7k]
  ------------------
 1229|  1.86k|                {
 1230|  1.86k|                    WORD32 i4_status;
 1231|  1.86k|                    u4_lt_idx = ps_mmc_params->u4_lt_idx; //Get long term index
 1232|  1.86k|                    ret = ih264d_delete_lt_node(ps_dpb_mgr,
 1233|  1.86k|                                                u4_lt_idx,
 1234|  1.86k|                                                u1_fld_pic_flag,
 1235|  1.86k|                                                0, &i4_status);
 1236|  1.86k|                    if(ret != OK)
  ------------------
  |  |  114|  1.86k|#define OK        0
  ------------------
  |  Branch (1236:24): [True: 0, False: 1.86k]
  ------------------
 1237|      0|                        return ret;
 1238|  1.86k|                    if(i4_status)
  ------------------
  |  Branch (1238:24): [True: 169, False: 1.70k]
  ------------------
 1239|    169|                    {
 1240|    169|                        UWORD32 i4_error_code;
 1241|    169|                        i4_error_code = ERROR_DBP_MANAGER_T;
 1242|    169|                        return i4_error_code;
 1243|    169|                    }
 1244|  1.70k|                    break;
 1245|  1.86k|                }
 1246|       |
 1247|  1.70k|                case MARK_ST_PICNUM_AS_LT_INDEX:
  ------------------
  |  |   46|  1.55k|#define MARK_ST_PICNUM_AS_LT_INDEX  3
  ------------------
  |  Branch (1247:17): [True: 1.55k, False: 28.0k]
  ------------------
 1248|  1.55k|                {
 1249|  1.55k|                    {
 1250|  1.55k|                        UWORD32 i4_cur_pic_num = u4_cur_pic_num;
 1251|  1.55k|                        WORD64 i8_pic_num;
 1252|  1.55k|                        u4_diff_pic_num = ps_mmc_params->u4_diff_pic_num; //Get absDiffPicnumMinus1
 1253|  1.55k|                        if(u1_fld_pic_flag)
  ------------------
  |  Branch (1253:28): [True: 0, False: 1.55k]
  ------------------
 1254|      0|                            i4_cur_pic_num = i4_cur_pic_num * 2 + 1;
 1255|       |
 1256|  1.55k|                        i8_pic_num = (WORD64)i4_cur_pic_num - ((WORD64)u4_diff_pic_num + 1);
 1257|  1.55k|                        if(IS_OUT_OF_RANGE_S32(i8_pic_num))
  ------------------
  |  |   58|  1.55k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 242, False: 1.31k]
  |  |  |  Branch (58:54): [True: 0, False: 1.31k]
  |  |  ------------------
  ------------------
 1258|    242|                        {
 1259|    242|                            return ERROR_DBP_MANAGER_T;
 1260|    242|                        }
 1261|  1.31k|                        i4_pic_num = i8_pic_num;
 1262|  1.31k|                    }
 1263|       |
 1264|      0|                    u4_lt_idx = ps_mmc_params->u4_lt_idx; //Get long term index
 1265|       |
 1266|  1.31k|                    if((ps_dpb_mgr->u1_max_lt_frame_idx == NO_LONG_TERM_INDICIES) ||
  ------------------
  |  |   53|  1.31k|#define NO_LONG_TERM_INDICIES      255
  ------------------
  |  Branch (1266:24): [True: 126, False: 1.18k]
  ------------------
 1267|  1.18k|                        (u4_lt_idx > ps_dpb_mgr->u1_max_lt_frame_idx))
  ------------------
  |  Branch (1267:25): [True: 112, False: 1.07k]
  ------------------
 1268|    238|                    {
 1269|    238|                        return ERROR_DBP_MANAGER_T;
 1270|    238|                    }
 1271|       |
 1272|  1.07k|                    if(ps_dpb_mgr->u1_num_st_ref_bufs > 0)
  ------------------
  |  Branch (1272:24): [True: 289, False: 785]
  ------------------
 1273|    289|                    {
 1274|    289|                        ret = ih264d_delete_st_node_or_make_lt(ps_dpb_mgr,
 1275|    289|                                                               i4_pic_num, u4_lt_idx,
 1276|    289|                                                               u1_fld_pic_flag);
 1277|    289|                        if(ret != OK)
  ------------------
  |  |  114|    289|#define OK        0
  ------------------
  |  Branch (1277:28): [True: 62, False: 227]
  ------------------
 1278|     62|                            return ret;
 1279|    289|                    }
 1280|  1.01k|                    break;
 1281|  1.07k|                }
 1282|  10.3k|                case SET_MAX_LT_INDEX:
  ------------------
  |  |   47|  10.3k|#define SET_MAX_LT_INDEX            4
  ------------------
  |  Branch (1282:17): [True: 10.3k, False: 19.2k]
  ------------------
 1283|  10.3k|                {
 1284|  10.3k|                    UWORD8 uc_numLT = ps_dpb_mgr->u1_num_lt_ref_bufs;
 1285|  10.3k|                    u4_lt_idx = ps_mmc_params->u4_max_lt_idx_plus1; //Get Max_long_term_index_plus1
 1286|  10.3k|                    if(u4_lt_idx <= ps_dpb_mgr->u1_max_lt_frame_idx
  ------------------
  |  Branch (1286:24): [True: 5.20k, False: 5.17k]
  ------------------
 1287|  5.20k|                                    && uc_numLT > 0)
  ------------------
  |  Branch (1287:40): [True: 2.65k, False: 2.55k]
  ------------------
 1288|  2.65k|                    {
 1289|  2.65k|                        struct dpb_info_t *ps_nxtDPB;
 1290|       |                        //Set all LT buffers with index >= u4_lt_idx to nonreference
 1291|  2.65k|                        ps_nxtDPB = ps_dpb_mgr->ps_dpb_ht_head;
 1292|  2.65k|                        ps_next_dpb = ps_nxtDPB->ps_prev_long;
 1293|  2.65k|                        if(ps_nxtDPB->u1_lt_idx >= u4_lt_idx)
  ------------------
  |  Branch (1293:28): [True: 677, False: 1.97k]
  ------------------
 1294|    677|                        {
 1295|    677|                            i = 0;
 1296|    677|                            ps_dpb_mgr->ps_dpb_ht_head = NULL;
 1297|    677|                        }
 1298|  1.97k|                        else
 1299|  1.97k|                        {
 1300|  2.76k|                            for(i = 1; i < uc_numLT; i++)
  ------------------
  |  Branch (1300:40): [True: 1.51k, False: 1.24k]
  ------------------
 1301|  1.51k|                            {
 1302|  1.51k|                                if(ps_next_dpb->u1_lt_idx >= u4_lt_idx)
  ------------------
  |  Branch (1302:36): [True: 732, False: 787]
  ------------------
 1303|    732|                                    break;
 1304|    787|                                ps_nxtDPB = ps_next_dpb;
 1305|    787|                                ps_next_dpb = ps_next_dpb->ps_prev_long;
 1306|    787|                            }
 1307|  1.97k|                            ps_nxtDPB->ps_prev_long = NULL; //Terminate the link of the closest LTIndex that is <=Max
 1308|  1.97k|                        }
 1309|  2.65k|                        ps_dpb_mgr->u1_num_lt_ref_bufs = i;
 1310|  2.65k|                        if(i == 0)
  ------------------
  |  Branch (1310:28): [True: 677, False: 1.97k]
  ------------------
 1311|    677|                            ps_next_dpb = ps_nxtDPB;
 1312|       |
 1313|  4.16k|                        for(; i < uc_numLT; i++)
  ------------------
  |  Branch (1313:31): [True: 1.51k, False: 2.65k]
  ------------------
 1314|  1.51k|                        {
 1315|  1.51k|                            ps_nxtDPB = ps_next_dpb;
 1316|  1.51k|                            ps_nxtDPB->u1_lt_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  1.51k|#define MAX_REF_BUFS    32
  ------------------
 1317|  1.51k|                            ps_nxtDPB->u1_used_as_ref = UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.51k|#define UNUSED_FOR_REF 0
  ------------------
 1318|  1.51k|                            ps_nxtDPB->s_top_field.u1_reference_info =
 1319|  1.51k|                                            UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.51k|#define UNUSED_FOR_REF 0
  ------------------
 1320|  1.51k|                            ps_nxtDPB->s_bot_field.u1_reference_info =
 1321|  1.51k|                                            UNUSED_FOR_REF;
  ------------------
  |  |  595|  1.51k|#define UNUSED_FOR_REF 0
  ------------------
 1322|       |
 1323|  1.51k|                            ps_nxtDPB->ps_pic_buf = NULL;
 1324|       |                            //Release buffer
 1325|  1.51k|                            ih264d_free_ref_pic_mv_bufs(ps_dpb_mgr->pv_codec_handle,
 1326|  1.51k|                                                        ps_nxtDPB->u1_buf_id);
 1327|  1.51k|                            ps_next_dpb = ps_nxtDPB->ps_prev_long;
 1328|  1.51k|                            ps_nxtDPB->ps_prev_long = NULL;
 1329|  1.51k|                        }
 1330|  2.65k|                    }
 1331|  10.3k|                    if(u4_lt_idx == 0)
  ------------------
  |  Branch (1331:24): [True: 1.07k, False: 9.30k]
  ------------------
 1332|  1.07k|                    {
 1333|  1.07k|                        ps_dpb_mgr->u1_max_lt_frame_idx = NO_LONG_TERM_INDICIES;
  ------------------
  |  |   53|  1.07k|#define NO_LONG_TERM_INDICIES      255
  ------------------
 1334|  1.07k|                    }
 1335|  9.30k|                    else
 1336|  9.30k|                    {
 1337|  9.30k|                        ps_dpb_mgr->u1_max_lt_frame_idx = u4_lt_idx - 1;
 1338|  9.30k|                    }
 1339|       |
 1340|  10.3k|                    break;
 1341|  1.07k|                }
 1342|  3.87k|                case SET_LT_INDEX:
  ------------------
  |  |   49|  3.87k|#define SET_LT_INDEX                6
  ------------------
  |  Branch (1342:17): [True: 3.87k, False: 25.7k]
  ------------------
 1343|  3.87k|                {
 1344|  3.87k|                    u4_lt_idx = ps_mmc_params->u4_lt_idx; //Get long term index
 1345|  3.87k|                    if((ps_dpb_mgr->u1_max_lt_frame_idx == NO_LONG_TERM_INDICIES) ||
  ------------------
  |  |   53|  3.87k|#define NO_LONG_TERM_INDICIES      255
  ------------------
  |  Branch (1345:24): [True: 92, False: 3.77k]
  ------------------
 1346|  3.77k|                        (u4_lt_idx > ps_dpb_mgr->u1_max_lt_frame_idx))
  ------------------
  |  Branch (1346:25): [True: 80, False: 3.69k]
  ------------------
 1347|    172|                    {
 1348|    172|                        return ERROR_DBP_MANAGER_T;
 1349|    172|                    }
 1350|  3.69k|                    ret = ih264d_insert_st_node(ps_dpb_mgr, ps_pic_buf, u1_buf_id,
 1351|  3.69k|                                          u4_cur_pic_num);
 1352|  3.69k|                    if(ret != OK)
  ------------------
  |  |  114|  3.69k|#define OK        0
  ------------------
  |  Branch (1352:24): [True: 84, False: 3.61k]
  ------------------
 1353|     84|                        return ret;
 1354|       |
 1355|  3.61k|                    if(ps_dpb_mgr->u1_num_st_ref_bufs > 0)
  ------------------
  |  Branch (1355:24): [True: 3.61k, False: 0]
  ------------------
 1356|       |
 1357|  3.61k|                    {
 1358|  3.61k|                        ret = ih264d_delete_st_node_or_make_lt(ps_dpb_mgr,
 1359|  3.61k|                                                               u4_cur_pic_num,
 1360|  3.61k|                                                               u4_lt_idx,
 1361|  3.61k|                                                               u1_fld_pic_flag);
 1362|  3.61k|                        if(ret != OK)
  ------------------
  |  |  114|  3.61k|#define OK        0
  ------------------
  |  Branch (1362:28): [True: 0, False: 3.61k]
  ------------------
 1363|      0|                            return ret;
 1364|  3.61k|                    }
 1365|      0|                    else
 1366|      0|                    {
 1367|      0|                        return ERROR_DBP_MANAGER_T;
 1368|      0|                    }
 1369|       |
 1370|  3.61k|                    u1_marked_lt = 1;
 1371|  3.61k|                    break;
 1372|  3.61k|                }
 1373|       |
 1374|  9.56k|                default:
  ------------------
  |  Branch (1374:17): [True: 9.56k, False: 20.0k]
  ------------------
 1375|  9.56k|                    break;
 1376|  29.6k|            }
 1377|  28.1k|            if(u4_mmco == RESET_REF_PICTURES || u4_mmco == RESET_ALL_PICTURES)
  ------------------
  |  |   48|  56.2k|#define RESET_REF_PICTURES          5
  ------------------
                          if(u4_mmco == RESET_REF_PICTURES || u4_mmco == RESET_ALL_PICTURES)
  ------------------
  |  |   51|  26.1k|#define RESET_ALL_PICTURES          8
  ------------------
  |  Branch (1377:16): [True: 1.94k, False: 26.1k]
  |  Branch (1377:49): [True: 218, False: 25.9k]
  ------------------
 1378|  2.16k|            {
 1379|  2.16k|                ih264d_reset_ref_bufs(ps_dpb_mgr);
 1380|  2.16k|                u4_cur_pic_num = 0;
 1381|  2.16k|            }
 1382|  28.1k|        }
 1383|  4.81k|    }
 1384|  10.2k|    if(!u1_marked_lt && u1_insert_st_pic)
  ------------------
  |  Branch (1384:8): [True: 8.65k, False: 1.56k]
  |  Branch (1384:25): [True: 8.65k, False: 0]
  ------------------
 1385|  8.65k|    {
 1386|  8.65k|        ret = ih264d_insert_st_node(ps_dpb_mgr, ps_pic_buf, u1_buf_id,
 1387|  8.65k|                              u4_cur_pic_num);
 1388|  8.65k|        if(ret != OK)
  ------------------
  |  |  114|  8.65k|#define OK        0
  ------------------
  |  Branch (1388:12): [True: 161, False: 8.49k]
  ------------------
 1389|    161|            return ret;
 1390|  8.65k|    }
 1391|  10.0k|    return OK;
  ------------------
  |  |  114|  10.0k|#define OK        0
  ------------------
 1392|  10.2k|}
ih264d_release_pics_in_dpb:
 1417|      3|{
 1418|      3|    WORD8 i;
 1419|      3|    dec_struct_t *ps_dec = (dec_struct_t *)pv_dec;
 1420|       |
 1421|     39|    for(i = 0; i < u1_disp_bufs; i++)
  ------------------
  |  Branch (1421:16): [True: 36, False: 3]
  ------------------
 1422|     36|    {
 1423|     36|        ih264_buf_mgr_release((buf_mgr_t *)ps_dec->pv_pic_buf_mgr,
 1424|     36|                              i,
 1425|     36|                              BUF_MGR_REF);
  ------------------
  |  |   50|     36|#define BUF_MGR_REF          (1 << 2)
  ------------------
 1426|     36|        ih264_buf_mgr_release((buf_mgr_t *)ps_dec->pv_mv_buf_mgr,
 1427|     36|                              ps_dec->as_buf_id_info_map[i].mv_buf_id,
 1428|     36|                              BUF_MGR_REF);
  ------------------
  |  |   50|     36|#define BUF_MGR_REF          (1 << 2)
  ------------------
 1429|     36|    }
 1430|      3|}
ih264d_delete_gap_frm_sliding:
 1460|  1.93k|{
 1461|  1.93k|    WORD8 i1_gap_idx, i, j, j_min;
 1462|  1.93k|    WORD32 *pi4_gaps_start_frm_num, *pi4_gaps_end_frm_num, i4_gap_frame_num;
 1463|  1.93k|    WORD32 i4_start_frm_num, i4_end_frm_num;
 1464|  1.93k|    WORD32 i4_max_frm_num;
 1465|  1.93k|    WORD32 i4_frm_num, i4_gap_frm_num_min;
 1466|       |
 1467|       |    /* find the least frame num from gaps and current DPB node    */
 1468|       |    /* Delete the least one                                       */
 1469|  1.93k|    *pu1_del_node = 1;
 1470|  1.93k|    if(0 == ps_dpb_mgr->u1_num_gaps)
  ------------------
  |  Branch (1470:8): [True: 1.93k, False: 0]
  ------------------
 1471|  1.93k|        return OK;
  ------------------
  |  |  114|  1.93k|#define OK        0
  ------------------
 1472|      0|    pi4_gaps_start_frm_num = ps_dpb_mgr->ai4_gaps_start_frm_num;
 1473|      0|    pi4_gaps_end_frm_num = ps_dpb_mgr->ai4_gaps_end_frm_num;
 1474|      0|    i4_gap_frame_num = INVALID_FRAME_NUM;
  ------------------
  |  |  601|      0|#define INVALID_FRAME_NUM       0x0fffffff
  ------------------
 1475|      0|    i4_max_frm_num = ps_dpb_mgr->i4_max_frm_num;
 1476|       |
 1477|      0|    i1_gap_idx = -1;
 1478|      0|    if(INVALID_FRAME_NUM != i4_frame_num)
  ------------------
  |  |  601|      0|#define INVALID_FRAME_NUM       0x0fffffff
  ------------------
  |  Branch (1478:8): [True: 0, False: 0]
  ------------------
 1479|      0|    {
 1480|      0|        i4_gap_frame_num = i4_frame_num;
 1481|      0|        for(i = 0; i < MAX_FRAMES; i++)
  ------------------
  |  |  600|      0|#define MAX_FRAMES              16
  ------------------
  |  Branch (1481:20): [True: 0, False: 0]
  ------------------
 1482|      0|        {
 1483|      0|            i4_start_frm_num = pi4_gaps_start_frm_num[i];
 1484|      0|            if(INVALID_FRAME_NUM != i4_start_frm_num)
  ------------------
  |  |  601|      0|#define INVALID_FRAME_NUM       0x0fffffff
  ------------------
  |  Branch (1484:16): [True: 0, False: 0]
  ------------------
 1485|      0|            {
 1486|      0|                i4_end_frm_num = pi4_gaps_end_frm_num[i];
 1487|      0|                if(i4_end_frm_num < i4_max_frm_num)
  ------------------
  |  Branch (1487:20): [True: 0, False: 0]
  ------------------
 1488|      0|                {
 1489|      0|                    if(i4_start_frm_num <= i4_gap_frame_num)
  ------------------
  |  Branch (1489:24): [True: 0, False: 0]
  ------------------
 1490|      0|                    {
 1491|      0|                        i4_gap_frame_num = i4_start_frm_num;
 1492|      0|                        i1_gap_idx = i;
 1493|      0|                    }
 1494|      0|                }
 1495|      0|                else
 1496|      0|                {
 1497|      0|                    if(((i4_start_frm_num <= i4_gap_frame_num)
  ------------------
  |  Branch (1497:25): [True: 0, False: 0]
  ------------------
 1498|      0|                                    && (i4_gap_frame_num <= i4_max_frm_num))
  ------------------
  |  Branch (1498:40): [True: 0, False: 0]
  ------------------
 1499|      0|                                    || ((i4_start_frm_num >= i4_gap_frame_num)
  ------------------
  |  Branch (1499:41): [True: 0, False: 0]
  ------------------
 1500|      0|                                                    && ((i4_gap_frame_num
  ------------------
  |  Branch (1500:56): [True: 0, False: 0]
  ------------------
 1501|      0|                                                                    + i4_max_frm_num)
 1502|      0|                                                                    >= i4_end_frm_num)))
 1503|      0|                    {
 1504|      0|                        i4_gap_frame_num = i4_start_frm_num;
 1505|      0|                        i1_gap_idx = i;
 1506|      0|                    }
 1507|      0|                }
 1508|      0|            }
 1509|      0|        }
 1510|      0|    }
 1511|      0|    else
 1512|      0|    {
 1513|       |        /* no valid short term buffers, delete one gap from the least start */
 1514|       |        /* of gap sequence                                                  */
 1515|      0|        i4_gap_frame_num = pi4_gaps_start_frm_num[0];
 1516|      0|        i1_gap_idx = 0;
 1517|      0|        for(i = 1; i < MAX_FRAMES; i++)
  ------------------
  |  |  600|      0|#define MAX_FRAMES              16
  ------------------
  |  Branch (1517:20): [True: 0, False: 0]
  ------------------
 1518|      0|        {
 1519|      0|            if(INVALID_FRAME_NUM != pi4_gaps_start_frm_num[i])
  ------------------
  |  |  601|      0|#define INVALID_FRAME_NUM       0x0fffffff
  ------------------
  |  Branch (1519:16): [True: 0, False: 0]
  ------------------
 1520|      0|            {
 1521|      0|                if(pi4_gaps_start_frm_num[i] < i4_gap_frame_num)
  ------------------
  |  Branch (1521:20): [True: 0, False: 0]
  ------------------
 1522|      0|                {
 1523|      0|                    i4_gap_frame_num = pi4_gaps_start_frm_num[i];
 1524|      0|                    i1_gap_idx = i;
 1525|      0|                }
 1526|      0|            }
 1527|      0|        }
 1528|      0|        if(INVALID_FRAME_NUM == i4_gap_frame_num)
  ------------------
  |  |  601|      0|#define INVALID_FRAME_NUM       0x0fffffff
  ------------------
  |  Branch (1528:12): [True: 0, False: 0]
  ------------------
 1529|      0|        {
 1530|      0|            UWORD32 i4_error_code;
 1531|      0|            i4_error_code = ERROR_DBP_MANAGER_T;
 1532|      0|            return i4_error_code;
 1533|      0|        }
 1534|      0|    }
 1535|       |
 1536|      0|    if(-1 != i1_gap_idx)
  ------------------
  |  Branch (1536:8): [True: 0, False: 0]
  ------------------
 1537|      0|    {
 1538|       |        /* find least frame_num in the poc_map, which is in this range */
 1539|      0|        i4_start_frm_num = pi4_gaps_start_frm_num[i1_gap_idx];
 1540|      0|        if(i4_start_frm_num < 0)
  ------------------
  |  Branch (1540:12): [True: 0, False: 0]
  ------------------
 1541|      0|            i4_start_frm_num += i4_max_frm_num;
 1542|      0|        i4_end_frm_num = pi4_gaps_end_frm_num[i1_gap_idx];
 1543|      0|        if(i4_end_frm_num < 0)
  ------------------
  |  Branch (1543:12): [True: 0, False: 0]
  ------------------
 1544|      0|            i4_end_frm_num += i4_max_frm_num;
 1545|       |
 1546|      0|        i4_gap_frm_num_min = 0xfffffff;
 1547|      0|        j_min = MAX_FRAMES;
  ------------------
  |  |  600|      0|#define MAX_FRAMES              16
  ------------------
 1548|      0|        for(j = 0; j < MAX_FRAMES; j++)
  ------------------
  |  |  600|      0|#define MAX_FRAMES              16
  ------------------
  |  Branch (1548:20): [True: 0, False: 0]
  ------------------
 1549|      0|        {
 1550|      0|            i4_frm_num = ps_dpb_mgr->ai4_poc_buf_id_map[j][2];
 1551|      0|            if((i4_start_frm_num <= i4_frm_num)
  ------------------
  |  Branch (1551:16): [True: 0, False: 0]
  ------------------
 1552|      0|                            && (i4_end_frm_num >= i4_frm_num))
  ------------------
  |  Branch (1552:32): [True: 0, False: 0]
  ------------------
 1553|      0|            {
 1554|      0|                if(i4_frm_num < i4_gap_frm_num_min)
  ------------------
  |  Branch (1554:20): [True: 0, False: 0]
  ------------------
 1555|      0|                {
 1556|      0|                    j_min = j;
 1557|      0|                    i4_gap_frm_num_min = i4_frm_num;
 1558|      0|                }
 1559|      0|            }
 1560|      0|        }
 1561|       |
 1562|      0|        if(j_min != MAX_FRAMES)
  ------------------
  |  |  600|      0|#define MAX_FRAMES              16
  ------------------
  |  Branch (1562:12): [True: 0, False: 0]
  ------------------
 1563|      0|        {
 1564|       |
 1565|      0|            ps_dpb_mgr->ai4_poc_buf_id_map[j_min][0] = -1;
 1566|      0|            ps_dpb_mgr->ai4_poc_buf_id_map[j_min][1] = 0x7fffffff;
 1567|      0|            ps_dpb_mgr->ai4_poc_buf_id_map[j_min][2] = GAP_FRAME_NUM;
  ------------------
  |  |   80|      0|#define GAP_FRAME_NUM           0x1fffffff
  ------------------
 1568|      0|            ps_dpb_mgr->i1_gaps_deleted++;
 1569|       |
 1570|      0|            ps_dpb_mgr->ai1_gaps_per_seq[i1_gap_idx]--;
 1571|      0|            ps_dpb_mgr->u1_num_gaps--;
 1572|      0|            *pu1_del_node = 0;
 1573|      0|            if(0 == ps_dpb_mgr->ai1_gaps_per_seq[i1_gap_idx])
  ------------------
  |  Branch (1573:16): [True: 0, False: 0]
  ------------------
 1574|      0|            {
 1575|      0|                ps_dpb_mgr->ai4_gaps_start_frm_num[i1_gap_idx] =
 1576|      0|                INVALID_FRAME_NUM;
  ------------------
  |  |  601|      0|#define INVALID_FRAME_NUM       0x0fffffff
  ------------------
 1577|      0|                ps_dpb_mgr->ai4_gaps_end_frm_num[i1_gap_idx] = 0;
 1578|      0|            }
 1579|      0|        }
 1580|      0|    }
 1581|       |
 1582|      0|    return OK;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
 1583|      0|}
ih264d_delete_gap_frm_mmco:
 1614|  1.58k|{
 1615|  1.58k|    WORD8 i, j;
 1616|  1.58k|    WORD32 *pi4_start, *pi4_end;
 1617|  1.58k|    WORD32 i4_start_frm_num, i4_end_frm_num, i4_max_frm_num;
 1618|       |
 1619|       |    /* find the least frame num from gaps and current DPB node    */
 1620|       |    /* Delete the gaps                                            */
 1621|  1.58k|    *pu1_del_node = 1;
 1622|  1.58k|    pi4_start = ps_dpb_mgr->ai4_gaps_start_frm_num;
 1623|  1.58k|    pi4_end = ps_dpb_mgr->ai4_gaps_end_frm_num;
 1624|  1.58k|    i4_max_frm_num = ps_dpb_mgr->i4_max_frm_num;
 1625|       |
 1626|  1.58k|    if(0 == ps_dpb_mgr->u1_num_gaps)
  ------------------
  |  Branch (1626:8): [True: 1.58k, False: 0]
  ------------------
 1627|  1.58k|        return OK;
  ------------------
  |  |  114|  1.58k|#define OK        0
  ------------------
 1628|       |
 1629|      0|    if(i4_frame_num < 0)
  ------------------
  |  Branch (1629:8): [True: 0, False: 0]
  ------------------
 1630|      0|        i4_frame_num += i4_max_frm_num;
 1631|      0|    for(i = 0; i < MAX_FRAMES; i++)
  ------------------
  |  |  600|      0|#define MAX_FRAMES              16
  ------------------
  |  Branch (1631:16): [True: 0, False: 0]
  ------------------
 1632|      0|    {
 1633|      0|        i4_start_frm_num = pi4_start[i];
 1634|      0|        if(i4_start_frm_num < 0)
  ------------------
  |  Branch (1634:12): [True: 0, False: 0]
  ------------------
 1635|      0|            i4_start_frm_num += i4_max_frm_num;
 1636|      0|        if(INVALID_FRAME_NUM != i4_start_frm_num)
  ------------------
  |  |  601|      0|#define INVALID_FRAME_NUM       0x0fffffff
  ------------------
  |  Branch (1636:12): [True: 0, False: 0]
  ------------------
 1637|      0|        {
 1638|      0|            i4_end_frm_num = pi4_end[i];
 1639|      0|            if(i4_end_frm_num < 0)
  ------------------
  |  Branch (1639:16): [True: 0, False: 0]
  ------------------
 1640|      0|                i4_end_frm_num += i4_max_frm_num;
 1641|       |
 1642|      0|            if((i4_frame_num >= i4_start_frm_num)
  ------------------
  |  Branch (1642:16): [True: 0, False: 0]
  ------------------
 1643|      0|                            && (i4_frame_num <= i4_end_frm_num))
  ------------------
  |  Branch (1643:32): [True: 0, False: 0]
  ------------------
 1644|      0|            {
 1645|      0|                break;
 1646|      0|            }
 1647|      0|            else
 1648|      0|            {
 1649|      0|                if(((i4_frame_num + i4_max_frm_num) >= i4_start_frm_num)
  ------------------
  |  Branch (1649:20): [True: 0, False: 0]
  ------------------
 1650|      0|                                && ((i4_frame_num + i4_max_frm_num)
  ------------------
  |  Branch (1650:36): [True: 0, False: 0]
  ------------------
 1651|      0|                                                <= i4_end_frm_num))
 1652|      0|                {
 1653|      0|                    UWORD32 i4_error_code;
 1654|      0|                    i4_error_code = ERROR_DBP_MANAGER_T;
 1655|      0|                    return i4_error_code;
 1656|      0|                }
 1657|      0|            }
 1658|      0|        }
 1659|      0|    }
 1660|       |
 1661|       |    /* find frame_num index, in the poc_map which needs to be deleted */
 1662|      0|    for(j = 0; j < MAX_FRAMES; j++)
  ------------------
  |  |  600|      0|#define MAX_FRAMES              16
  ------------------
  |  Branch (1662:16): [True: 0, False: 0]
  ------------------
 1663|      0|    {
 1664|      0|        if(i4_frame_num == ps_dpb_mgr->ai4_poc_buf_id_map[j][2])
  ------------------
  |  Branch (1664:12): [True: 0, False: 0]
  ------------------
 1665|      0|            break;
 1666|      0|    }
 1667|       |
 1668|      0|    if(MAX_FRAMES != i)
  ------------------
  |  |  600|      0|#define MAX_FRAMES              16
  ------------------
  |  Branch (1668:8): [True: 0, False: 0]
  ------------------
 1669|      0|    {
 1670|      0|        if(j == MAX_FRAMES)
  ------------------
  |  |  600|      0|#define MAX_FRAMES              16
  ------------------
  |  Branch (1670:12): [True: 0, False: 0]
  ------------------
 1671|      0|        {
 1672|      0|            UWORD32 i4_error_code;
 1673|      0|            i4_error_code = ERROR_DBP_MANAGER_T;
 1674|      0|            return i4_error_code;
 1675|      0|        }
 1676|       |
 1677|      0|        ps_dpb_mgr->ai4_poc_buf_id_map[j][0] = -1;
 1678|      0|        ps_dpb_mgr->ai4_poc_buf_id_map[j][1] = 0x7fffffff;
 1679|      0|        ps_dpb_mgr->ai4_poc_buf_id_map[j][2] = GAP_FRAME_NUM;
  ------------------
  |  |   80|      0|#define GAP_FRAME_NUM           0x1fffffff
  ------------------
 1680|      0|        ps_dpb_mgr->i1_gaps_deleted++;
 1681|       |
 1682|      0|        ps_dpb_mgr->ai1_gaps_per_seq[i]--;
 1683|      0|        ps_dpb_mgr->u1_num_gaps--;
 1684|      0|        *pu1_del_node = 0;
 1685|      0|        if(0 == ps_dpb_mgr->ai1_gaps_per_seq[i])
  ------------------
  |  Branch (1685:12): [True: 0, False: 0]
  ------------------
 1686|      0|        {
 1687|      0|            ps_dpb_mgr->ai4_gaps_start_frm_num[i] = INVALID_FRAME_NUM;
  ------------------
  |  |  601|      0|#define INVALID_FRAME_NUM       0x0fffffff
  ------------------
 1688|      0|            ps_dpb_mgr->ai4_gaps_end_frm_num[i] = 0;
 1689|      0|        }
 1690|      0|    }
 1691|      0|    else
 1692|      0|    {
 1693|      0|        UWORD32 i4_error_code;
 1694|      0|        i4_error_code = ERROR_DBP_MANAGER_T;
 1695|      0|        return i4_error_code;
 1696|      0|    }
 1697|       |
 1698|      0|    return OK;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
 1699|      0|}
ih264d_delete_nonref_nondisplay_pics:
 2006|   239k|{
 2007|   239k|    WORD8 i;
 2008|   239k|    WORD32 (*i4_poc_buf_id_map)[3] = ps_dpb_mgr->ai4_poc_buf_id_map;
 2009|       |
 2010|       |    /* remove all gaps marked as unused for ref */
 2011|   239k|    for(i = 0; (i < MAX_FRAMES) && ps_dpb_mgr->i1_gaps_deleted; i++)
  ------------------
  |  |  600|   239k|#define MAX_FRAMES              16
  ------------------
  |  Branch (2011:16): [True: 239k, False: 0]
  |  Branch (2011:36): [True: 0, False: 239k]
  ------------------
 2012|      0|    {
 2013|      0|        if(GAP_FRAME_NUM == i4_poc_buf_id_map[i][2])
  ------------------
  |  |   80|      0|#define GAP_FRAME_NUM           0x1fffffff
  ------------------
  |  Branch (2013:12): [True: 0, False: 0]
  ------------------
 2014|      0|        {
 2015|      0|            ps_dpb_mgr->i1_gaps_deleted--;
 2016|      0|            ps_dpb_mgr->i1_poc_buf_id_entries--;
 2017|      0|            i4_poc_buf_id_map[i][0] = -1;
 2018|      0|            i4_poc_buf_id_map[i][1] = 0x7fffffff;
 2019|      0|            i4_poc_buf_id_map[i][2] = 0;
 2020|      0|        }
 2021|      0|    }
 2022|   239k|}
ih264d_insert_pic_in_display_list:
 2050|   129k|{
 2051|   129k|    WORD8 i;
 2052|   129k|    WORD32 (*i4_poc_buf_id_map)[3] = ps_dpb_mgr->ai4_poc_buf_id_map;
 2053|       |
 2054|   222k|    for(i = 0; i < MAX_FRAMES; i++)
  ------------------
  |  |  600|   222k|#define MAX_FRAMES              16
  ------------------
  |  Branch (2054:16): [True: 222k, False: 0]
  ------------------
 2055|   222k|    {
 2056|       |        /* Find an empty slot */
 2057|   222k|        if(i4_poc_buf_id_map[i][0] == -1)
  ------------------
  |  Branch (2057:12): [True: 129k, False: 93.1k]
  ------------------
 2058|   129k|        {
 2059|   129k|            if(GAP_FRAME_NUM == i4_poc_buf_id_map[i][2])
  ------------------
  |  |   80|   129k|#define GAP_FRAME_NUM           0x1fffffff
  ------------------
  |  Branch (2059:16): [True: 0, False: 129k]
  ------------------
 2060|      0|                ps_dpb_mgr->i1_gaps_deleted--;
 2061|   129k|            else
 2062|   129k|                ps_dpb_mgr->i1_poc_buf_id_entries++;
 2063|       |
 2064|   129k|            i4_poc_buf_id_map[i][0] = u1_buf_id;
 2065|   129k|            i4_poc_buf_id_map[i][1] = i4_display_poc;
 2066|   129k|            i4_poc_buf_id_map[i][2] = u4_frame_num;
 2067|       |
 2068|   129k|            break;
 2069|   129k|        }
 2070|   222k|    }
 2071|       |
 2072|   129k|    if(MAX_FRAMES == i)
  ------------------
  |  |  600|   129k|#define MAX_FRAMES              16
  ------------------
  |  Branch (2072:8): [True: 0, False: 129k]
  ------------------
 2073|      0|    {
 2074|       |
 2075|      0|        UWORD32 i4_error_code;
 2076|      0|        i4_error_code = ERROR_GAPS_IN_FRM_NUM;
 2077|      0|        return i4_error_code;
 2078|      0|    }
 2079|   129k|    return OK;
  ------------------
  |  |  114|   129k|#define OK        0
  ------------------
 2080|   129k|}

ih264d_fmt_conv_420sp_to_420sp:
  383|  33.6k|{
  384|  33.6k|    UWORD8 *pu1_src, *pu1_dst;
  385|  33.6k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
  386|  33.6k|    WORD32 i;
  387|       |
  388|       |    /* copy luma */
  389|  33.6k|    pu1_src = (UWORD8 *)pu1_y_src;
  390|  33.6k|    pu1_dst = (UWORD8 *)pu1_y_dst;
  391|       |
  392|  33.6k|    num_rows = ht;
  393|  33.6k|    num_cols = wd;
  394|       |
  395|  33.6k|    src_strd = src_y_strd;
  396|  33.6k|    dst_strd = dst_y_strd;
  397|       |
  398|  1.78M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (398:16): [True: 1.75M, False: 33.6k]
  ------------------
  399|  1.75M|    {
  400|  1.75M|        memcpy(pu1_dst, pu1_src, num_cols);
  401|  1.75M|        pu1_dst += dst_strd;
  402|  1.75M|        pu1_src += src_strd;
  403|  1.75M|    }
  404|       |
  405|       |    /* copy U and V */
  406|  33.6k|    pu1_src = (UWORD8 *)pu1_uv_src;
  407|  33.6k|    pu1_dst = (UWORD8 *)pu1_uv_dst;
  408|       |
  409|  33.6k|    num_rows = ht >> 1;
  410|  33.6k|    num_cols = wd;
  411|       |
  412|  33.6k|    src_strd = src_uv_strd;
  413|  33.6k|    dst_strd = dst_uv_strd;
  414|       |
  415|   909k|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (415:16): [True: 875k, False: 33.6k]
  ------------------
  416|   875k|    {
  417|   875k|        memcpy(pu1_dst, pu1_src, num_cols);
  418|   875k|        pu1_dst += dst_strd;
  419|   875k|        pu1_src += src_strd;
  420|   875k|    }
  421|  33.6k|    return;
  422|  33.6k|}
ih264d_fmt_conv_420sp_to_420sp_swap_uv:
  480|  12.8k|{
  481|  12.8k|    UWORD8 *pu1_src, *pu1_dst;
  482|  12.8k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
  483|  12.8k|    WORD32 i;
  484|       |
  485|       |    /* copy luma */
  486|  12.8k|    pu1_src = (UWORD8 *)pu1_y_src;
  487|  12.8k|    pu1_dst = (UWORD8 *)pu1_y_dst;
  488|       |
  489|  12.8k|    num_rows = ht;
  490|  12.8k|    num_cols = wd;
  491|       |
  492|  12.8k|    src_strd = src_y_strd;
  493|  12.8k|    dst_strd = dst_y_strd;
  494|       |
  495|  1.21M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (495:16): [True: 1.20M, False: 12.8k]
  ------------------
  496|  1.20M|    {
  497|  1.20M|        memcpy(pu1_dst, pu1_src, num_cols);
  498|  1.20M|        pu1_dst += dst_strd;
  499|  1.20M|        pu1_src += src_strd;
  500|  1.20M|    }
  501|       |
  502|       |    /* copy U and V */
  503|  12.8k|    pu1_src = (UWORD8 *)pu1_uv_src;
  504|  12.8k|    pu1_dst = (UWORD8 *)pu1_uv_dst;
  505|       |
  506|  12.8k|    num_rows = ht >> 1;
  507|  12.8k|    num_cols = wd;
  508|       |
  509|  12.8k|    src_strd = src_uv_strd;
  510|  12.8k|    dst_strd = dst_uv_strd;
  511|       |
  512|   616k|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (512:16): [True: 603k, False: 12.8k]
  ------------------
  513|   603k|    {
  514|   603k|        WORD32 j;
  515|  68.2M|        for(j = 0; j < num_cols; j += 2)
  ------------------
  |  Branch (515:20): [True: 67.6M, False: 603k]
  ------------------
  516|  67.6M|        {
  517|  67.6M|            pu1_dst[j + 0] = pu1_src[j + 1];
  518|  67.6M|            pu1_dst[j + 1] = pu1_src[j + 0];
  519|  67.6M|        }
  520|   603k|        pu1_dst += dst_strd;
  521|   603k|        pu1_src += src_strd;
  522|   603k|    }
  523|  12.8k|    return;
  524|  12.8k|}
ih264d_fmt_conv_420sp_to_420p:
  591|  54.1k|{
  592|  54.1k|    UWORD8 *pu1_src, *pu1_dst;
  593|  54.1k|    UWORD8 *pu1_u_src, *pu1_v_src;
  594|  54.1k|    WORD32 num_rows, num_cols, src_strd, dst_strd;
  595|  54.1k|    WORD32 i, j;
  596|       |
  597|  54.1k|    if(0 == disable_luma_copy)
  ------------------
  |  Branch (597:8): [True: 54.1k, False: 0]
  ------------------
  598|  54.1k|    {
  599|       |        /* copy luma */
  600|  54.1k|        pu1_src = (UWORD8 *)pu1_y_src;
  601|  54.1k|        pu1_dst = (UWORD8 *)pu1_y_dst;
  602|       |
  603|  54.1k|        num_rows = ht;
  604|  54.1k|        num_cols = wd;
  605|       |
  606|  54.1k|        src_strd = src_y_strd;
  607|  54.1k|        dst_strd = dst_y_strd;
  608|       |
  609|  3.72M|        for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (609:20): [True: 3.66M, False: 54.1k]
  ------------------
  610|  3.66M|        {
  611|  3.66M|            memcpy(pu1_dst, pu1_src, num_cols);
  612|  3.66M|            pu1_dst += dst_strd;
  613|  3.66M|            pu1_src += src_strd;
  614|  3.66M|        }
  615|  54.1k|    }
  616|       |    /* de-interleave U and V and copy to destination */
  617|  54.1k|    if(is_u_first)
  ------------------
  |  Branch (617:8): [True: 54.1k, False: 0]
  ------------------
  618|  54.1k|    {
  619|  54.1k|        pu1_u_src = (UWORD8 *)pu1_uv_src;
  620|  54.1k|        pu1_v_src = (UWORD8 *)pu1_uv_src + 1;
  621|  54.1k|    }
  622|      0|    else
  623|      0|    {
  624|      0|        pu1_u_src = (UWORD8 *)pu1_uv_src + 1;
  625|      0|        pu1_v_src = (UWORD8 *)pu1_uv_src;
  626|      0|    }
  627|       |
  628|  54.1k|    num_rows = ht >> 1;
  629|  54.1k|    num_cols = wd >> 1;
  630|       |
  631|  54.1k|    src_strd = src_uv_strd;
  632|  54.1k|    dst_strd = dst_uv_strd;
  633|       |
  634|  1.88M|    for(i = 0; i < num_rows; i++)
  ------------------
  |  Branch (634:16): [True: 1.83M, False: 54.1k]
  ------------------
  635|  1.83M|    {
  636|  86.8M|        for(j = 0; j < num_cols; j++)
  ------------------
  |  Branch (636:20): [True: 84.9M, False: 1.83M]
  ------------------
  637|  84.9M|        {
  638|  84.9M|            pu1_u_dst[j] = pu1_u_src[j * 2];
  639|  84.9M|            pu1_v_dst[j] = pu1_v_src[j * 2];
  640|  84.9M|        }
  641|       |
  642|  1.83M|        pu1_u_dst += dst_strd;
  643|  1.83M|        pu1_v_dst += dst_strd;
  644|  1.83M|        pu1_u_src += src_strd;
  645|  1.83M|        pu1_v_src += src_strd;
  646|  1.83M|    }
  647|  54.1k|    return;
  648|  54.1k|}
ih264d_format_convert:
  672|   100k|{
  673|   100k|    UWORD32 convert_uv_only = 0;
  674|   100k|    iv_yuv_buf_t *ps_op_frm;
  675|   100k|    UWORD8 *pu1_y_src, *pu1_uv_src;
  676|   100k|    UWORD32 start_uv = u4_start_y >> 1;
  677|       |
  678|   100k|    if(1 == pv_disp_op->u4_error_code)
  ------------------
  |  Branch (678:8): [True: 2, False: 100k]
  ------------------
  679|      2|        return;
  680|       |
  681|   100k|    ps_op_frm = &(ps_dec->s_disp_frame_info);
  682|       |
  683|       |    /* Requires u4_start_y and u4_num_rows_y to be even */
  684|   100k|    if(u4_start_y & 1)
  ------------------
  |  Branch (684:8): [True: 0, False: 100k]
  ------------------
  685|      0|    {
  686|      0|        return;
  687|      0|    }
  688|       |
  689|   100k|    if((1 == ps_dec->u4_share_disp_buf) &&
  ------------------
  |  Branch (689:8): [True: 0, False: 100k]
  ------------------
  690|      0|       (pv_disp_op->e_output_format == IV_YUV_420SP_UV))
  ------------------
  |  Branch (690:8): [True: 0, False: 0]
  ------------------
  691|      0|    {
  692|      0|        return;
  693|      0|    }
  694|       |
  695|   100k|    pu1_y_src = (UWORD8 *)ps_op_frm->pv_y_buf;
  696|   100k|    pu1_y_src += u4_start_y * ps_op_frm->u4_y_strd,
  697|       |
  698|   100k|    pu1_uv_src = (UWORD8 *)ps_op_frm->pv_u_buf;
  699|   100k|    pu1_uv_src += start_uv * ps_op_frm->u4_u_strd;
  700|       |
  701|   100k|    if(pv_disp_op->e_output_format == IV_YUV_420P)
  ------------------
  |  Branch (701:8): [True: 54.1k, False: 46.5k]
  ------------------
  702|  54.1k|    {
  703|  54.1k|        UWORD8 *pu1_y_dst, *pu1_u_dst, *pu1_v_dst;
  704|  54.1k|        IV_COLOR_FORMAT_T e_output_format = pv_disp_op->e_output_format;
  705|       |
  706|  54.1k|        if(0 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (706:12): [True: 54.1k, False: 0]
  ------------------
  707|  54.1k|        {
  708|  54.1k|            convert_uv_only = 0;
  709|  54.1k|        }
  710|      0|        else
  711|      0|        {
  712|      0|            convert_uv_only = 1;
  713|      0|        }
  714|       |
  715|  54.1k|        pu1_y_dst = (UWORD8 *)pv_disp_op->s_disp_frm_buf.pv_y_buf;
  716|  54.1k|        pu1_y_dst += u4_start_y * pv_disp_op->s_disp_frm_buf.u4_y_strd;
  717|       |
  718|  54.1k|        pu1_u_dst = (UWORD8 *)pv_disp_op->s_disp_frm_buf.pv_u_buf;
  719|  54.1k|        pu1_u_dst += start_uv * pv_disp_op->s_disp_frm_buf.u4_u_strd;
  720|       |
  721|  54.1k|        pu1_v_dst = (UWORD8 *)pv_disp_op->s_disp_frm_buf.pv_v_buf;
  722|  54.1k|        pu1_v_dst += start_uv * pv_disp_op->s_disp_frm_buf.u4_v_strd;
  723|       |
  724|  54.1k|        ih264d_fmt_conv_420sp_to_420p(pu1_y_src,
  725|  54.1k|                                      pu1_uv_src,
  726|  54.1k|                                      pu1_y_dst,
  727|  54.1k|                                      pu1_u_dst,
  728|  54.1k|                                      pu1_v_dst,
  729|  54.1k|                                      ps_op_frm->u4_y_wd,
  730|  54.1k|                                      u4_num_rows_y,
  731|  54.1k|                                      ps_op_frm->u4_y_strd,
  732|  54.1k|                                      ps_op_frm->u4_u_strd,
  733|  54.1k|                                      pv_disp_op->s_disp_frm_buf.u4_y_strd,
  734|  54.1k|                                      pv_disp_op->s_disp_frm_buf.u4_u_strd,
  735|  54.1k|                                      1,
  736|  54.1k|                                      convert_uv_only);
  737|       |
  738|  54.1k|    }
  739|  46.5k|    else if((pv_disp_op->e_output_format == IV_YUV_420SP_UV) ||
  ------------------
  |  Branch (739:13): [True: 33.6k, False: 12.8k]
  ------------------
  740|  12.8k|            (pv_disp_op->e_output_format == IV_YUV_420SP_VU))
  ------------------
  |  Branch (740:13): [True: 12.8k, False: 0]
  ------------------
  741|  46.5k|    {
  742|  46.5k|        UWORD8* pu1_y_dst, *pu1_uv_dst;
  743|       |
  744|  46.5k|        pu1_y_dst = (UWORD8 *)pv_disp_op->s_disp_frm_buf.pv_y_buf;
  745|  46.5k|        pu1_y_dst +=  u4_start_y * pv_disp_op->s_disp_frm_buf.u4_y_strd;
  746|       |
  747|  46.5k|        pu1_uv_dst = (UWORD8 *)pv_disp_op->s_disp_frm_buf.pv_u_buf;
  748|  46.5k|        pu1_uv_dst += start_uv * pv_disp_op->s_disp_frm_buf.u4_u_strd;
  749|       |
  750|  46.5k|        if(pv_disp_op->e_output_format == IV_YUV_420SP_UV)
  ------------------
  |  Branch (750:12): [True: 33.6k, False: 12.8k]
  ------------------
  751|  33.6k|        {
  752|  33.6k|            ih264d_fmt_conv_420sp_to_420sp(pu1_y_src,
  753|  33.6k|                                           pu1_uv_src,
  754|  33.6k|                                           pu1_y_dst,
  755|  33.6k|                                           pu1_uv_dst,
  756|  33.6k|                                           ps_op_frm->u4_y_wd,
  757|  33.6k|                                           u4_num_rows_y,
  758|  33.6k|                                           ps_op_frm->u4_y_strd,
  759|  33.6k|                                           ps_op_frm->u4_u_strd,
  760|  33.6k|                                           pv_disp_op->s_disp_frm_buf.u4_y_strd,
  761|  33.6k|                                           pv_disp_op->s_disp_frm_buf.u4_u_strd);
  762|  33.6k|        }
  763|  12.8k|        else
  764|  12.8k|        {
  765|  12.8k|            ih264d_fmt_conv_420sp_to_420sp_swap_uv(pu1_y_src,
  766|  12.8k|                                                   pu1_uv_src,
  767|  12.8k|                                                   pu1_y_dst,
  768|  12.8k|                                                   pu1_uv_dst,
  769|  12.8k|                                                   ps_op_frm->u4_y_wd,
  770|  12.8k|                                                   u4_num_rows_y,
  771|  12.8k|                                                   ps_op_frm->u4_y_strd,
  772|  12.8k|                                                   ps_op_frm->u4_u_strd,
  773|  12.8k|                                                   pv_disp_op->s_disp_frm_buf.u4_y_strd,
  774|  12.8k|                                                   pv_disp_op->s_disp_frm_buf.u4_u_strd);
  775|  12.8k|        }
  776|  46.5k|    }
  777|      0|    else if(pv_disp_op->e_output_format == IV_RGB_565)
  ------------------
  |  Branch (777:13): [True: 0, False: 0]
  ------------------
  778|      0|    {
  779|      0|        UWORD16 *pu2_rgb_dst;
  780|       |
  781|      0|        pu2_rgb_dst = (UWORD16 *)pv_disp_op->s_disp_frm_buf.pv_y_buf;
  782|      0|        pu2_rgb_dst += u4_start_y * pv_disp_op->s_disp_frm_buf.u4_y_strd;
  783|       |
  784|      0|        ih264d_fmt_conv_420sp_to_rgb565(pu1_y_src,
  785|      0|                                        pu1_uv_src,
  786|      0|                                        pu2_rgb_dst,
  787|      0|                                        ps_op_frm->u4_y_wd,
  788|      0|                                        u4_num_rows_y,
  789|      0|                                        ps_op_frm->u4_y_strd,
  790|      0|                                        ps_op_frm->u4_u_strd,
  791|      0|                                        pv_disp_op->s_disp_frm_buf.u4_y_strd,
  792|      0|                                        1);
  793|      0|    }
  794|       |
  795|   100k|    if((u4_start_y + u4_num_rows_y) >= ps_dec->s_disp_frame_info.u4_y_ht)
  ------------------
  |  Branch (795:8): [True: 24.9k, False: 75.7k]
  ------------------
  796|  24.9k|    {
  797|       |
  798|  24.9k|        INSERT_LOGO(pv_disp_op->s_disp_frm_buf.pv_y_buf,
  799|  24.9k|                        pv_disp_op->s_disp_frm_buf.pv_u_buf,
  800|  24.9k|                        pv_disp_op->s_disp_frm_buf.pv_v_buf,
  801|  24.9k|                        pv_disp_op->s_disp_frm_buf.u4_y_strd,
  802|  24.9k|                        ps_dec->u2_disp_width,
  803|  24.9k|                        ps_dec->u2_disp_height,
  804|  24.9k|                        pv_disp_op->e_output_format,
  805|  24.9k|                        ps_op_frm->u4_y_wd,
  806|  24.9k|                        ps_op_frm->u4_y_ht);
  807|  24.9k|    }
  808|       |
  809|   100k|    return;
  810|   100k|}

ih264d_init_function_ptr_generic:
   82|   168k|{
   83|       |
   84|   168k|    WORD32 i = 0;
   85|       |
   86|       |    /* Init function pointers for intra pred leaf level functions luma
   87|       |     * Intra 16x16 */
   88|   168k|    ps_codec->apf_intra_pred_luma_16x16[0] =
   89|   168k|                    ih264_intra_pred_luma_16x16_mode_vert;
   90|   168k|    ps_codec->apf_intra_pred_luma_16x16[1] =
   91|   168k|                    ih264_intra_pred_luma_16x16_mode_horz;
   92|   168k|    ps_codec->apf_intra_pred_luma_16x16[2] =
   93|   168k|                    ih264_intra_pred_luma_16x16_mode_dc;
   94|   168k|    ps_codec->apf_intra_pred_luma_16x16[3] =
   95|   168k|                    ih264_intra_pred_luma_16x16_mode_plane;
   96|       |
   97|       |    /* Init function pointers for intra pred leaf level functions luma
   98|       |     * Intra 4x4 */
   99|   168k|    ps_codec->apf_intra_pred_luma_4x4[0] = ih264_intra_pred_luma_4x4_mode_vert;
  100|   168k|    ps_codec->apf_intra_pred_luma_4x4[1] = ih264_intra_pred_luma_4x4_mode_horz;
  101|   168k|    ps_codec->apf_intra_pred_luma_4x4[2] = ih264_intra_pred_luma_4x4_mode_dc;
  102|   168k|    ps_codec->apf_intra_pred_luma_4x4[3] =
  103|   168k|                    ih264_intra_pred_luma_4x4_mode_diag_dl;
  104|   168k|    ps_codec->apf_intra_pred_luma_4x4[4] =
  105|   168k|                    ih264_intra_pred_luma_4x4_mode_diag_dr;
  106|   168k|    ps_codec->apf_intra_pred_luma_4x4[5] =
  107|   168k|                    ih264_intra_pred_luma_4x4_mode_vert_r;
  108|   168k|    ps_codec->apf_intra_pred_luma_4x4[6] =
  109|   168k|                    ih264_intra_pred_luma_4x4_mode_horz_d;
  110|   168k|    ps_codec->apf_intra_pred_luma_4x4[7] =
  111|   168k|                    ih264_intra_pred_luma_4x4_mode_vert_l;
  112|   168k|    ps_codec->apf_intra_pred_luma_4x4[8] =
  113|   168k|                    ih264_intra_pred_luma_4x4_mode_horz_u;
  114|       |
  115|       |    /* Init function pointers for intra pred leaf level functions luma
  116|       |     * Intra 8x8 */
  117|   168k|    ps_codec->apf_intra_pred_luma_8x8[0] = ih264_intra_pred_luma_8x8_mode_vert;
  118|   168k|    ps_codec->apf_intra_pred_luma_8x8[1] = ih264_intra_pred_luma_8x8_mode_horz;
  119|   168k|    ps_codec->apf_intra_pred_luma_8x8[2] = ih264_intra_pred_luma_8x8_mode_dc;
  120|   168k|    ps_codec->apf_intra_pred_luma_8x8[3] =
  121|   168k|                    ih264_intra_pred_luma_8x8_mode_diag_dl;
  122|   168k|    ps_codec->apf_intra_pred_luma_8x8[4] =
  123|   168k|                    ih264_intra_pred_luma_8x8_mode_diag_dr;
  124|   168k|    ps_codec->apf_intra_pred_luma_8x8[5] =
  125|   168k|                    ih264_intra_pred_luma_8x8_mode_vert_r;
  126|   168k|    ps_codec->apf_intra_pred_luma_8x8[6] =
  127|   168k|                    ih264_intra_pred_luma_8x8_mode_horz_d;
  128|   168k|    ps_codec->apf_intra_pred_luma_8x8[7] =
  129|   168k|                    ih264_intra_pred_luma_8x8_mode_vert_l;
  130|   168k|    ps_codec->apf_intra_pred_luma_8x8[8] =
  131|   168k|                    ih264_intra_pred_luma_8x8_mode_horz_u;
  132|       |
  133|   168k|    ps_codec->pf_intra_pred_ref_filtering =
  134|   168k|                    ih264_intra_pred_luma_8x8_mode_ref_filtering;
  135|       |
  136|       |    /* Init function pointers for intra pred leaf level functions chroma
  137|       |     * Intra 8x8 */
  138|   168k|    ps_codec->apf_intra_pred_chroma[0] = ih264_intra_pred_chroma_8x8_mode_vert;
  139|   168k|    ps_codec->apf_intra_pred_chroma[1] = ih264_intra_pred_chroma_8x8_mode_horz;
  140|   168k|    ps_codec->apf_intra_pred_chroma[2] = ih264_intra_pred_chroma_8x8_mode_dc;
  141|   168k|    ps_codec->apf_intra_pred_chroma[3] = ih264_intra_pred_chroma_8x8_mode_plane;
  142|       |
  143|   168k|    ps_codec->pf_default_weighted_pred_luma = ih264_default_weighted_pred_luma;
  144|   168k|    ps_codec->pf_default_weighted_pred_chroma =
  145|   168k|                    ih264_default_weighted_pred_chroma;
  146|   168k|    ps_codec->pf_weighted_pred_luma = ih264_weighted_pred_luma;
  147|   168k|    ps_codec->pf_weighted_pred_chroma = ih264_weighted_pred_chroma;
  148|   168k|    ps_codec->pf_weighted_bi_pred_luma = ih264_weighted_bi_pred_luma;
  149|   168k|    ps_codec->pf_weighted_bi_pred_chroma = ih264_weighted_bi_pred_chroma;
  150|       |
  151|       |    /* Padding Functions */
  152|   168k|    ps_codec->pf_pad_top = ih264_pad_top;
  153|   168k|    ps_codec->pf_pad_bottom = ih264_pad_bottom;
  154|   168k|    ps_codec->pf_pad_left_luma = ih264_pad_left_luma;
  155|   168k|    ps_codec->pf_pad_left_chroma = ih264_pad_left_chroma;
  156|   168k|    ps_codec->pf_pad_right_luma = ih264_pad_right_luma;
  157|   168k|    ps_codec->pf_pad_right_chroma = ih264_pad_right_chroma;
  158|       |
  159|   168k|    ps_codec->pf_iquant_itrans_recon_luma_4x4 = ih264_iquant_itrans_recon_4x4;
  160|   168k|    ps_codec->pf_iquant_itrans_recon_luma_4x4_dc =
  161|   168k|                    ih264_iquant_itrans_recon_4x4_dc;
  162|   168k|    ps_codec->pf_iquant_itrans_recon_luma_8x8 = ih264_iquant_itrans_recon_8x8;
  163|   168k|    ps_codec->pf_iquant_itrans_recon_luma_8x8_dc =
  164|   168k|                    ih264_iquant_itrans_recon_8x8_dc;
  165|   168k|    ps_codec->pf_iquant_itrans_recon_chroma_4x4 =
  166|   168k|                    ih264_iquant_itrans_recon_chroma_4x4;
  167|   168k|    ps_codec->pf_iquant_itrans_recon_chroma_4x4_dc =
  168|   168k|                    ih264_iquant_itrans_recon_chroma_4x4_dc;
  169|   168k|    ps_codec->pf_ihadamard_scaling_4x4 = ih264_ihadamard_scaling_4x4;
  170|       |
  171|       |    /* Init fn ptr luma deblocking */
  172|   168k|    ps_codec->pf_deblk_luma_vert_bs4 = ih264_deblk_luma_vert_bs4;
  173|   168k|    ps_codec->pf_deblk_luma_vert_bslt4 = ih264_deblk_luma_vert_bslt4;
  174|   168k|    ps_codec->pf_deblk_luma_vert_bs4_mbaff = ih264_deblk_luma_vert_bs4_mbaff;
  175|   168k|    ps_codec->pf_deblk_luma_vert_bslt4_mbaff =
  176|   168k|                    ih264_deblk_luma_vert_bslt4_mbaff;
  177|       |
  178|   168k|    ps_codec->pf_deblk_luma_horz_bs4 = ih264_deblk_luma_horz_bs4;
  179|   168k|    ps_codec->pf_deblk_luma_horz_bslt4 = ih264_deblk_luma_horz_bslt4;
  180|       |
  181|       |    /* Init fn ptr chroma deblocking */
  182|   168k|    ps_codec->pf_deblk_chroma_vert_bs4 = ih264_deblk_chroma_vert_bs4;
  183|   168k|    ps_codec->pf_deblk_chroma_vert_bslt4 = ih264_deblk_chroma_vert_bslt4;
  184|   168k|    ps_codec->pf_deblk_chroma_vert_bs4_mbaff =
  185|   168k|                    ih264_deblk_chroma_vert_bs4_mbaff;
  186|   168k|    ps_codec->pf_deblk_chroma_vert_bslt4_mbaff =
  187|   168k|                    ih264_deblk_chroma_vert_bslt4_mbaff;
  188|       |
  189|   168k|    ps_codec->pf_deblk_chroma_horz_bs4 = ih264_deblk_chroma_horz_bs4;
  190|   168k|    ps_codec->pf_deblk_chroma_horz_bslt4 = ih264_deblk_chroma_horz_bslt4;
  191|       |
  192|       |    /* Inter pred leaf level functions */
  193|   168k|    ps_codec->apf_inter_pred_luma[0] = ih264_inter_pred_luma_copy;
  194|   168k|    ps_codec->apf_inter_pred_luma[1] = ih264_inter_pred_luma_horz_qpel;
  195|   168k|    ps_codec->apf_inter_pred_luma[2] = ih264_inter_pred_luma_horz;
  196|   168k|    ps_codec->apf_inter_pred_luma[3] = ih264_inter_pred_luma_horz_qpel;
  197|   168k|    ps_codec->apf_inter_pred_luma[4] = ih264_inter_pred_luma_vert_qpel;
  198|   168k|    ps_codec->apf_inter_pred_luma[5] =
  199|   168k|                    ih264_inter_pred_luma_horz_qpel_vert_qpel;
  200|   168k|    ps_codec->apf_inter_pred_luma[6] =
  201|   168k|                    ih264_inter_pred_luma_horz_hpel_vert_qpel;
  202|   168k|    ps_codec->apf_inter_pred_luma[7] =
  203|   168k|                    ih264_inter_pred_luma_horz_qpel_vert_qpel;
  204|   168k|    ps_codec->apf_inter_pred_luma[8] = ih264_inter_pred_luma_vert;
  205|   168k|    ps_codec->apf_inter_pred_luma[9] =
  206|   168k|                    ih264_inter_pred_luma_horz_qpel_vert_hpel;
  207|   168k|    ps_codec->apf_inter_pred_luma[10] =
  208|   168k|                    ih264_inter_pred_luma_horz_hpel_vert_hpel;
  209|   168k|    ps_codec->apf_inter_pred_luma[11] =
  210|   168k|                    ih264_inter_pred_luma_horz_qpel_vert_hpel;
  211|   168k|    ps_codec->apf_inter_pred_luma[12] = ih264_inter_pred_luma_vert_qpel;
  212|   168k|    ps_codec->apf_inter_pred_luma[13] =
  213|   168k|                    ih264_inter_pred_luma_horz_qpel_vert_qpel;
  214|   168k|    ps_codec->apf_inter_pred_luma[14] =
  215|   168k|                    ih264_inter_pred_luma_horz_hpel_vert_qpel;
  216|   168k|    ps_codec->apf_inter_pred_luma[15] =
  217|   168k|                    ih264_inter_pred_luma_horz_qpel_vert_qpel;
  218|       |
  219|   168k|    ps_codec->pf_inter_pred_chroma = ih264_inter_pred_chroma;
  220|       |
  221|   168k|    return;
  222|   168k|}

ih264d_fill_pred_info:
  113|  15.0M|{
  114|  15.0M|    WORD32 insert_bits;
  115|       |
  116|  15.0M|    ps_pred_pkd->i2_mv[0] = pi2_mv[0];
  117|  15.0M|    ps_pred_pkd->i2_mv[1] = pi2_mv[1];
  118|       |
  119|  15.0M|    insert_bits = sub_mb_num & 3; /*sub mb x*/
  120|  15.0M|    ps_pred_pkd->i1_size_pos_info = insert_bits;
  121|  15.0M|    insert_bits = sub_mb_num >> 2;/*sub mb y*/
  122|  15.0M|    ps_pred_pkd->i1_size_pos_info |= insert_bits << 2;
  123|  15.0M|    insert_bits = part_width >> 1;
  124|  15.0M|    ps_pred_pkd->i1_size_pos_info |= insert_bits << 4;
  125|  15.0M|    insert_bits = part_height >> 1;
  126|  15.0M|    ps_pred_pkd->i1_size_pos_info |= insert_bits << 6;
  127|       |
  128|  15.0M|    ps_pred_pkd->i1_ref_idx_info = i1_ref_idx;
  129|  15.0M|    ps_pred_pkd->i1_ref_idx_info |= (pred_dir << 6);
  130|  15.0M|    ps_pred_pkd->i1_buf_id = i1_buf_id;
  131|  15.0M|    ps_pred_pkd->pu4_wt_offst = pu4_wt_offset;
  132|  15.0M|    ps_pred_pkd->u1_pic_type = u1_pic_type;
  133|       |
  134|       |
  135|  15.0M|}
ih264d_form_mb_part_info_bp:
  178|  5.74M|{
  179|       |    /* The reference buffer pointer */
  180|  5.74M|    WORD32 i2_frm_x, i2_frm_y;
  181|  5.74M|    WORD32 i2_tmp_mv_x, i2_tmp_mv_y;
  182|  5.74M|    WORD32 i2_rec_x, i2_rec_y;
  183|       |
  184|  5.74M|    WORD32 u2_pic_ht;
  185|  5.74M|    WORD32 u2_frm_wd;
  186|  5.74M|    WORD32 u2_rec_wd;
  187|  5.74M|    UWORD8 u1_sub_x = 0,u1_sub_y=0 ;
  188|  5.74M|    UWORD8  u1_part_wd = 0,u1_part_ht = 0;
  189|  5.74M|    WORD16 i2_mv_x,i2_mv_y;
  190|       |
  191|       |    /********************************************/
  192|       |    /* i1_mc_wd       width reqd for mcomp      */
  193|       |    /* u1_dma_ht      height reqd for mcomp     */
  194|       |    /* u1_dma_wd      width aligned to 4 bytes  */
  195|       |    /* u1_dx          fractional part of width  */
  196|       |    /* u1_dx          fractional part of height */
  197|       |    /********************************************/
  198|  5.74M|    UWORD32 i1_mc_wd;
  199|       |
  200|  5.74M|    WORD32 u1_dma_ht;
  201|       |
  202|  5.74M|    UWORD32 u1_dma_wd;
  203|  5.74M|    UWORD32 u1_dx;
  204|  5.74M|    UWORD32 u1_dy;
  205|  5.74M|    pred_info_t * ps_pred = ps_dec->ps_pred + ps_dec->u4_pred_info_idx;
  206|  5.74M|    dec_slice_params_t * const ps_cur_slice = ps_dec->ps_cur_slice;
  207|  5.74M|    tfr_ctxt_t *ps_frame_buf;
  208|  5.74M|    struct pic_buffer_t *ps_ref_frm;
  209|  5.74M|    UWORD8 u1_scale_ref,u1_mbaff,u1_field;
  210|  5.74M|    pic_buffer_t  **pps_ref_frame;
  211|  5.74M|    WORD8 i1_size_pos_info,i1_buf_id;
  212|       |
  213|  5.74M|    PROFILE_DISABLE_MB_PART_INFO()
  ------------------
  |  |  131|  5.74M|#define PROFILE_DISABLE_MB_PART_INFO() ;
  ------------------
  214|       |
  215|  5.74M|     UNUSED(ps_cur_mb_info);
  ------------------
  |  |   45|  5.74M|#define UNUSED(x) ((void)(x))
  ------------------
  216|  5.74M|     i1_size_pos_info = ps_pred_pkd->i1_size_pos_info;
  217|  5.74M|     GET_XPOS_PRED(u1_sub_x,i1_size_pos_info);
  ------------------
  |  |  165|  5.74M|#define GET_XPOS_PRED(u1_out,pkd_info)                        \
  |  |  166|  5.74M|{                                                               \
  |  |  167|  5.74M|    WORD32 bit_field;                                           \
  |  |  168|  5.74M|    bit_field = pkd_info & 0x3;                                 \
  |  |  169|  5.74M|    u1_out = bit_field;                                       \
  |  |  170|  5.74M|}
  ------------------
  218|  5.74M|     GET_YPOS_PRED(u1_sub_y,i1_size_pos_info);
  ------------------
  |  |  173|  5.74M|#define GET_YPOS_PRED(u1_out,pkd_info)                        \
  |  |  174|  5.74M|{                                                               \
  |  |  175|  5.74M|    WORD32 bit_field;                                           \
  |  |  176|  5.74M|    bit_field = pkd_info >> 2;                                  \
  |  |  177|  5.74M|    u1_out = bit_field & 0x3;                                  \
  |  |  178|  5.74M|}
  ------------------
  219|  5.74M|     GET_WIDTH_PRED(u1_part_wd,i1_size_pos_info);
  ------------------
  |  |  182|  5.74M|#define GET_WIDTH_PRED(u1_out,pkd_info)                        \
  |  |  183|  5.74M|{                                                               \
  |  |  184|  5.74M|    WORD32 bit_field;                                           \
  |  |  185|  5.74M|    bit_field = pkd_info >> 4;                                  \
  |  |  186|  5.74M|    bit_field = (bit_field & 0x3) << 1 ;                        \
  |  |  187|  5.74M|    u1_out = (bit_field == 0)?1:bit_field;                       \
  |  |  ------------------
  |  |  |  Branch (187:14): [True: 32.1k, False: 5.71M]
  |  |  ------------------
  |  |  188|  5.74M|    }
  ------------------
  220|  5.74M|     GET_HEIGHT_PRED(u1_part_ht,i1_size_pos_info);
  ------------------
  |  |  190|  5.74M|#define GET_HEIGHT_PRED(u1_out,pkd_info)                        \
  |  |  191|  5.74M|{                                                               \
  |  |  192|  5.74M|    WORD32 bit_field;                                           \
  |  |  193|  5.74M|    bit_field = pkd_info >> 6;                                  \
  |  |  194|  5.74M|    bit_field = (bit_field & 0x3) << 1 ;                        \
  |  |  195|  5.74M|    u1_out = (bit_field == 0)?1:bit_field;                      \
  |  |  ------------------
  |  |  |  Branch (195:14): [True: 22.1k, False: 5.72M]
  |  |  ------------------
  |  |  196|  5.74M|}
  ------------------
  221|  5.74M|     i2_mv_x = ps_pred_pkd->i2_mv[0];
  222|  5.74M|     i2_mv_y = ps_pred_pkd->i2_mv[1];
  223|  5.74M|     i1_buf_id = ps_pred_pkd->i1_buf_id;
  224|       |
  225|       |
  226|  5.74M|     ps_ref_frm = ps_dec->apv_buf_id_pic_buf_map[i1_buf_id];
  227|       |
  228|       |
  229|  5.74M|    {
  230|  5.74M|        ps_frame_buf = &ps_dec->s_tran_addrecon;
  231|  5.74M|    }
  232|       |
  233|       |
  234|       |    /* Transfer Setup Y */
  235|  5.74M|    {
  236|  5.74M|        UWORD8 *pu1_pred, *pu1_rec;
  237|       |
  238|       |        /* calculating rounded motion vectors and fractional components */
  239|  5.74M|        i2_tmp_mv_x = i2_mv_x;
  240|  5.74M|        i2_tmp_mv_y = i2_mv_y;
  241|  5.74M|        u1_dx = i2_tmp_mv_x & 0x3;
  242|  5.74M|        u1_dy = i2_tmp_mv_y & 0x3;
  243|  5.74M|        i2_tmp_mv_x >>= 2;
  244|  5.74M|        i2_tmp_mv_y >>= 2;
  245|  5.74M|        i1_mc_wd = u1_part_wd << 2;
  246|  5.74M|        u1_dma_ht = u1_part_ht << 2;
  247|  5.74M|        if(u1_dx)
  ------------------
  |  Branch (247:12): [True: 134k, False: 5.60M]
  ------------------
  248|   134k|        {
  249|   134k|            i2_tmp_mv_x -= 2;
  250|   134k|            i1_mc_wd += 5;
  251|   134k|        }
  252|  5.74M|        if(u1_dy)
  ------------------
  |  Branch (252:12): [True: 120k, False: 5.62M]
  ------------------
  253|   120k|        {
  254|   120k|            i2_tmp_mv_y -= 2;
  255|   120k|            u1_dma_ht += 5;
  256|   120k|        }
  257|       |
  258|       |        /********************************************************************/
  259|       |        /* Calulating the horizontal and the vertical u4_ofst from top left  */
  260|       |        /* edge of the reference frame, and subsequent clipping             */
  261|       |        /********************************************************************/
  262|  5.74M|        u2_pic_ht = ps_dec->u2_pic_ht;
  263|  5.74M|        u2_frm_wd = ps_dec->u2_frm_wd_y;
  264|  5.74M|        i2_rec_x = u1_sub_x << 2;
  265|  5.74M|        i2_rec_y = u1_sub_y << 2;
  266|       |
  267|  5.74M|        i2_frm_x = (u2_mb_x << 4) + i2_rec_x + i2_tmp_mv_x;
  268|  5.74M|        i2_frm_y = (u2_mb_y << 4) + i2_rec_y + i2_tmp_mv_y;
  269|       |
  270|  5.74M|        i2_frm_x = CLIP3(MAX_OFFSET_OUTSIDE_X_FRM, (ps_dec->u2_pic_wd - 1),
  ------------------
  |  |   77|  5.74M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 933, False: 5.74M]
  |  |  |  Branch (77:54): [True: 9.86k, False: 5.73M]
  |  |  ------------------
  ------------------
  271|  5.74M|                         i2_frm_x);
  272|  5.74M|        i2_frm_y = CLIP3(((1 - u1_dma_ht)), (u2_pic_ht - (1)), i2_frm_y);
  ------------------
  |  |   77|  5.74M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 1.25k, False: 5.74M]
  |  |  |  Branch (77:54): [True: 726, False: 5.74M]
  |  |  ------------------
  ------------------
  273|       |
  274|  5.74M|        pu1_pred = ps_ref_frm->pu1_buf1 + i2_frm_y * u2_frm_wd + i2_frm_x;
  275|       |
  276|  5.74M|        u1_dma_wd = (i1_mc_wd + 3) & 0xFC;
  277|       |
  278|       |        /********************************************************************/
  279|       |        /* Calulating the horizontal and the vertical u4_ofst from top left  */
  280|       |        /* edge of the recon buffer                                         */
  281|       |        /********************************************************************/
  282|  5.74M|        u2_rec_wd = MB_SIZE;
  ------------------
  |  |  554|  5.74M|#define MB_SIZE             16
  ------------------
  283|  5.74M|        {
  284|  5.74M|            u2_rec_wd = ps_dec->u2_frm_wd_y;
  285|  5.74M|            i2_rec_x += (mb_index << 4);
  286|  5.74M|            pu1_rec = ps_frame_buf->pu1_dest_y + i2_rec_y * u2_rec_wd
  287|  5.74M|                            + i2_rec_x;
  288|  5.74M|        }
  289|       |
  290|       |        /* filling the pred and dma structures for Y */
  291|  5.74M|        u2_frm_wd = ps_dec->u2_frm_wd_y;
  292|       |
  293|  5.74M|        ps_pred->u2_u1_ref_buf_wd = u1_dma_wd;
  294|  5.74M|        ps_pred->i1_dma_ht = u1_dma_ht;
  295|  5.74M|        ps_pred->i1_mc_wd = i1_mc_wd;
  296|  5.74M|        ps_pred->u2_frm_wd = u2_frm_wd;
  297|  5.74M|        ps_pred->pu1_rec_y_u = pu1_rec;
  298|  5.74M|        ps_pred->u2_dst_stride = u2_rec_wd;
  299|       |
  300|  5.74M|        ps_pred->i1_mb_partwidth = u1_part_wd << 2;
  301|  5.74M|        ps_pred->i1_mb_partheight = u1_part_ht << 2;
  302|  5.74M|        ps_pred->u1_dydx = (u1_dy << 2) + u1_dx;
  303|       |
  304|  5.74M|        ps_pred->pu1_y_ref = pu1_pred;
  305|       |
  306|  5.74M|    }
  307|       |
  308|       |    /* Increment ps_pred index */
  309|  5.74M|    ps_pred++;
  310|       |
  311|       |    /* Transfer Setup U & V */
  312|  5.74M|    {
  313|  5.74M|        WORD32 i4_ref_offset, i4_rec_offset;
  314|  5.74M|        UWORD8 *pu1_pred_u, *pu1_pred_v;
  315|       |
  316|       |
  317|       |        /* calculating rounded motion vectors and fractional components */
  318|  5.74M|        i2_tmp_mv_x = i2_mv_x;
  319|  5.74M|        i2_tmp_mv_y = i2_mv_y;
  320|       |
  321|       |        /************************************************************************/
  322|       |        /* Table 8-9: Derivation of the vertical component of the chroma vector */
  323|       |        /* in field coding mode                                                 */
  324|       |        /************************************************************************/
  325|       |
  326|       |        /* Eighth sample of the chroma MV */
  327|  5.74M|        u1_dx = i2_tmp_mv_x & 0x7;
  328|  5.74M|        u1_dy = i2_tmp_mv_y & 0x7;
  329|       |
  330|       |        /********************************************************************/
  331|       |        /* Calculating the full pel MV for chroma which is 1/2 of the Luma  */
  332|       |        /* MV in full pel units                                             */
  333|       |        /********************************************************************/
  334|  5.74M|        i2_mv_x = i2_tmp_mv_x;
  335|  5.74M|        i2_mv_y = i2_tmp_mv_y;
  336|  5.74M|        i2_tmp_mv_x = SIGN_POW2_DIV(i2_tmp_mv_x, 3);
  ------------------
  |  |   67|  5.74M|#define SIGN_POW2_DIV(x, y) (((x) < 0) ? (-((-(x)) >> (y))) : ((x) >> (y)))
  |  |  ------------------
  |  |  |  Branch (67:30): [True: 52.2k, False: 5.69M]
  |  |  ------------------
  ------------------
  337|  5.74M|        i2_tmp_mv_y = SIGN_POW2_DIV(i2_tmp_mv_y, 3);
  ------------------
  |  |   67|  5.74M|#define SIGN_POW2_DIV(x, y) (((x) < 0) ? (-((-(x)) >> (y))) : ((x) >> (y)))
  |  |  ------------------
  |  |  |  Branch (67:30): [True: 51.4k, False: 5.69M]
  |  |  ------------------
  ------------------
  338|  5.74M|        i1_mc_wd = u1_part_wd << 1;
  339|  5.74M|        u1_dma_ht = u1_part_ht << 1;
  340|  5.74M|        if(u1_dx)
  ------------------
  |  Branch (340:12): [True: 147k, False: 5.59M]
  ------------------
  341|   147k|        {
  342|   147k|            i2_tmp_mv_x -= (i2_mv_x < 0);
  343|   147k|            i1_mc_wd++;
  344|   147k|        }
  345|  5.74M|        if(u1_dy != 0)
  ------------------
  |  Branch (345:12): [True: 133k, False: 5.60M]
  ------------------
  346|   133k|        {
  347|   133k|            i2_tmp_mv_y -= (i2_mv_y < 0);
  348|   133k|            u1_dma_ht++;
  349|   133k|        }
  350|       |
  351|       |        /********************************************************************/
  352|       |        /* Calulating the horizontal and the vertical u4_ofst from top left  */
  353|       |        /* edge of the reference frame, and subsequent clipping             */
  354|       |        /********************************************************************/
  355|  5.74M|        u2_pic_ht >>= 1;
  356|  5.74M|        u2_frm_wd = ps_dec->u2_frm_wd_uv;
  357|  5.74M|        i2_rec_x = u1_sub_x << 1;
  358|  5.74M|        i2_rec_y = u1_sub_y << 1;
  359|       |
  360|  5.74M|        i2_frm_x = (u2_mb_x << 3) + i2_rec_x + i2_tmp_mv_x;
  361|  5.74M|        i2_frm_y = (u2_mb_y << 3) + i2_rec_y + i2_tmp_mv_y;
  362|       |
  363|  5.74M|        i2_frm_x = CLIP3(MAX_OFFSET_OUTSIDE_UV_FRM,
  ------------------
  |  |   77|  5.74M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 950, False: 5.74M]
  |  |  |  Branch (77:54): [True: 10.3k, False: 5.73M]
  |  |  ------------------
  ------------------
  364|  5.74M|                         ((ps_dec->u2_pic_wd >> 1) - 1), i2_frm_x);
  365|  5.74M|        i2_frm_y = CLIP3(((1 - u1_dma_ht)), (u2_pic_ht - (1)), i2_frm_y);
  ------------------
  |  |   77|  5.74M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 1.28k, False: 5.74M]
  |  |  |  Branch (77:54): [True: 729, False: 5.74M]
  |  |  ------------------
  ------------------
  366|       |
  367|  5.74M|        i4_ref_offset = i2_frm_y * u2_frm_wd + i2_frm_x * YUV420SP_FACTOR;
  ------------------
  |  |  119|  5.74M|#define YUV420SP_FACTOR 2
  ------------------
  368|  5.74M|        u1_dma_wd = (i1_mc_wd + 3) & 0xFC;
  369|       |
  370|       |        /********************************************************************/
  371|       |        /* Calulating the horizontal and the vertical u4_ofst from top left  */
  372|       |        /* edge of the recon buffer                                         */
  373|       |        /********************************************************************/
  374|       |        /* CHANGED CODE */
  375|  5.74M|        u2_rec_wd = BLK8x8SIZE * YUV420SP_FACTOR;
  ------------------
  |  |  555|  5.74M|#define BLK8x8SIZE          8
  ------------------
                      u2_rec_wd = BLK8x8SIZE * YUV420SP_FACTOR;
  ------------------
  |  |  119|  5.74M|#define YUV420SP_FACTOR 2
  ------------------
  376|  5.74M|        i4_rec_offset = i2_rec_y * u2_rec_wd + i2_rec_x * YUV420SP_FACTOR;
  ------------------
  |  |  119|  5.74M|#define YUV420SP_FACTOR 2
  ------------------
  377|       |
  378|  5.74M|        {
  379|  5.74M|            u2_rec_wd = ps_dec->u2_frm_wd_uv;
  380|  5.74M|            i2_rec_x += (mb_index << 3);
  381|  5.74M|            i4_rec_offset = i2_rec_y * u2_rec_wd + i2_rec_x * YUV420SP_FACTOR;
  ------------------
  |  |  119|  5.74M|#define YUV420SP_FACTOR 2
  ------------------
  382|  5.74M|            ps_pred->pu1_rec_y_u = ps_frame_buf->pu1_dest_u + i4_rec_offset;
  383|  5.74M|            ps_pred->u1_pi1_wt_ofst_rec_v = ps_frame_buf->pu1_dest_v
  384|  5.74M|                            + i4_rec_offset;
  385|  5.74M|        }
  386|       |
  387|       |        /* CHANGED CODE */
  388|       |
  389|       |        /* filling the common pred structures for U */
  390|  5.74M|        u2_frm_wd = ps_dec->u2_frm_wd_uv;
  391|       |
  392|  5.74M|        ps_pred->u2_u1_ref_buf_wd = u1_dma_wd;
  393|  5.74M|        ps_pred->i1_dma_ht = u1_dma_ht;
  394|  5.74M|        ps_pred->i1_mc_wd = i1_mc_wd;
  395|       |
  396|  5.74M|        ps_pred->u2_frm_wd = u2_frm_wd;
  397|  5.74M|        ps_pred->u2_dst_stride = u2_rec_wd;
  398|       |
  399|  5.74M|        ps_pred->i1_mb_partwidth = u1_part_wd << 1;
  400|  5.74M|        ps_pred->i1_mb_partheight = u1_part_ht << 1;
  401|  5.74M|        ps_pred->u1_dydx = (u1_dy << 3) + u1_dx;
  402|       |
  403|  5.74M|        pu1_pred_u = ps_ref_frm->pu1_buf2 + i4_ref_offset;
  404|  5.74M|        pu1_pred_v = ps_ref_frm->pu1_buf3 + i4_ref_offset;
  405|       |
  406|       |        /* Copy U & V partitions */
  407|  5.74M|        ps_pred->pu1_u_ref = pu1_pred_u;
  408|       |
  409|       |        /* Increment the reference buffer Index */
  410|  5.74M|        ps_pred->pu1_v_ref = pu1_pred_v;
  411|  5.74M|    }
  412|       |
  413|       |    /* Increment ps_pred index */
  414|  5.74M|    ps_dec->u4_pred_info_idx += 2;
  415|       |
  416|  5.74M|    return OK;
  ------------------
  |  |  114|  5.74M|#define OK        0
  ------------------
  417|       |
  418|  5.74M|}
ih264d_form_mb_part_info_mp:
  455|  7.97M|{
  456|       |    /* The reference buffer pointer */
  457|  7.97M|    UWORD8 *pu1_ref_buf;
  458|  7.97M|    WORD16 i2_frm_x, i2_frm_y, i2_tmp_mv_x, i2_tmp_mv_y, i2_pod_ht;
  459|  7.97M|    WORD16 i2_rec_x, i2_rec_y;
  460|  7.97M|    UWORD16 u2_pic_ht, u2_frm_wd, u2_rec_wd;
  461|  7.97M|    UWORD8 u1_wght_pred_type, u1_wted_bipred_idc;
  462|  7.97M|    UWORD16 u2_tot_ref_scratch_size;
  463|  7.97M|    UWORD8 u1_sub_x = 0;
  464|  7.97M|    UWORD8 u1_sub_y = 0;
  465|  7.97M|    UWORD8 u1_is_bi_dir = 0;
  466|       |
  467|       |    /********************************************/
  468|       |    /* i1_mc_wd       width reqd for mcomp      */
  469|       |    /* u1_dma_ht      height reqd for mcomp     */
  470|       |    /* u1_dma_wd      width aligned to 4 bytes  */
  471|       |    /* u1_dx          fractional part of width  */
  472|       |    /* u1_dx          fractional part of height */
  473|       |    /********************************************/
  474|  7.97M|    UWORD8 i1_mc_wd, u1_dma_ht, u1_dma_wd, u1_dx, u1_dy;
  475|  7.97M|    pred_info_t * ps_pred ;
  476|  7.97M|    dec_slice_params_t * const ps_cur_slice = ps_dec->ps_cur_slice;
  477|  7.97M|    const UWORD8 u1_slice_type = ps_dec->ps_decode_cur_slice->slice_type;
  478|  7.97M|    UWORD8 u1_pod_bot, u1_pod_top;
  479|       |
  480|       |    /* load the pictype for pod u4_flag & chroma motion vector derivation */
  481|  7.97M|    UWORD8 u1_ref_pic_type ;
  482|       |
  483|       |    /* set default value to flags specifying field nature of picture & mb */
  484|  7.97M|    UWORD32 u1_mb_fld = 0, u1_mb_or_pic_fld;
  485|  7.97M|    UWORD32 u1_mb_bot = 0, u1_pic_bot = 0, u1_mb_or_pic_bot;
  486|  7.97M|    tfr_ctxt_t *ps_frame_buf;
  487|       |    /* calculate flags specifying field nature of picture & mb */
  488|  7.97M|    const UWORD32 u1_pic_fld = ps_cur_slice->u1_field_pic_flag;
  489|  7.97M|    WORD8 i1_pred;
  490|  7.97M|    WORD8 i1_size_pos_info,i1_buf_id,i1_ref_idx;
  491|  7.97M|    UWORD8 u1_part_wd,u1_part_ht;
  492|  7.97M|    WORD16 i2_mv_x,i2_mv_y;
  493|  7.97M|    struct pic_buffer_t *ps_ref_frm;
  494|  7.97M|    UWORD32 *pu4_wt_offset;
  495|  7.97M|    UWORD8 *pu1_buf1,*pu1_buf2,*pu1_buf3;
  496|       |
  497|       |
  498|  7.97M|    PROFILE_DISABLE_MB_PART_INFO()
  ------------------
  |  |  131|  7.97M|#define PROFILE_DISABLE_MB_PART_INFO() ;
  ------------------
  499|       |
  500|  7.97M|    ps_pred = ps_dec->ps_pred + ps_dec->u4_pred_info_idx;
  501|       |
  502|       |
  503|  7.97M|     i1_size_pos_info = ps_pred_pkd->i1_size_pos_info;
  504|  7.97M|     GET_XPOS_PRED(u1_sub_x,i1_size_pos_info);
  ------------------
  |  |  165|  7.97M|#define GET_XPOS_PRED(u1_out,pkd_info)                        \
  |  |  166|  7.97M|{                                                               \
  |  |  167|  7.97M|    WORD32 bit_field;                                           \
  |  |  168|  7.97M|    bit_field = pkd_info & 0x3;                                 \
  |  |  169|  7.97M|    u1_out = bit_field;                                       \
  |  |  170|  7.97M|}
  ------------------
  505|  7.97M|     GET_YPOS_PRED(u1_sub_y,i1_size_pos_info);
  ------------------
  |  |  173|  7.97M|#define GET_YPOS_PRED(u1_out,pkd_info)                        \
  |  |  174|  7.97M|{                                                               \
  |  |  175|  7.97M|    WORD32 bit_field;                                           \
  |  |  176|  7.97M|    bit_field = pkd_info >> 2;                                  \
  |  |  177|  7.97M|    u1_out = bit_field & 0x3;                                  \
  |  |  178|  7.97M|}
  ------------------
  506|  7.97M|     GET_WIDTH_PRED(u1_part_wd,i1_size_pos_info);
  ------------------
  |  |  182|  7.97M|#define GET_WIDTH_PRED(u1_out,pkd_info)                        \
  |  |  183|  7.97M|{                                                               \
  |  |  184|  7.97M|    WORD32 bit_field;                                           \
  |  |  185|  7.97M|    bit_field = pkd_info >> 4;                                  \
  |  |  186|  7.97M|    bit_field = (bit_field & 0x3) << 1 ;                        \
  |  |  187|  7.97M|    u1_out = (bit_field == 0)?1:bit_field;                       \
  |  |  ------------------
  |  |  |  Branch (187:14): [True: 81.8k, False: 7.89M]
  |  |  ------------------
  |  |  188|  7.97M|    }
  ------------------
  507|  7.97M|     GET_HEIGHT_PRED(u1_part_ht,i1_size_pos_info);
  ------------------
  |  |  190|  7.97M|#define GET_HEIGHT_PRED(u1_out,pkd_info)                        \
  |  |  191|  7.97M|{                                                               \
  |  |  192|  7.97M|    WORD32 bit_field;                                           \
  |  |  193|  7.97M|    bit_field = pkd_info >> 6;                                  \
  |  |  194|  7.97M|    bit_field = (bit_field & 0x3) << 1 ;                        \
  |  |  195|  7.97M|    u1_out = (bit_field == 0)?1:bit_field;                      \
  |  |  ------------------
  |  |  |  Branch (195:14): [True: 48.0k, False: 7.92M]
  |  |  ------------------
  |  |  196|  7.97M|}
  ------------------
  508|  7.97M|     i2_mv_x = ps_pred_pkd->i2_mv[0];
  509|  7.97M|     i2_mv_y = ps_pred_pkd->i2_mv[1];
  510|  7.97M|     i1_ref_idx = ps_pred_pkd->i1_ref_idx_info & 0x3f;
  511|  7.97M|     i1_buf_id = ps_pred_pkd->i1_buf_id;
  512|  7.97M|     ps_ref_frm = ps_dec->apv_buf_id_pic_buf_map[i1_buf_id];
  513|       |
  514|  7.97M|     i1_pred = (ps_pred_pkd->i1_ref_idx_info & 0xC0) >> 6;
  515|  7.97M|     u1_is_bi_dir = (i1_pred == BI_PRED);
  ------------------
  |  |  485|  7.97M|#define BI_PRED   3
  ------------------
  516|       |
  517|       |
  518|  7.97M|    u1_ref_pic_type = ps_pred_pkd->u1_pic_type & PIC_MASK;
  ------------------
  |  |  359|  7.97M|#define PIC_MASK        0x03
  ------------------
  519|       |
  520|  7.97M|    pu1_buf1  = ps_ref_frm->pu1_buf1;
  521|  7.97M|    pu1_buf2  = ps_ref_frm->pu1_buf2;
  522|  7.97M|    pu1_buf3  = ps_ref_frm->pu1_buf3;
  523|       |
  524|  7.97M|    if(u1_ref_pic_type == BOT_FLD)
  ------------------
  |  |  354|  7.97M|#define BOT_FLD         0x02
  ------------------
  |  Branch (524:8): [True: 0, False: 7.97M]
  ------------------
  525|      0|    {
  526|      0|        pu1_buf1 += ps_ref_frm->u2_frm_wd_y;
  527|      0|        pu1_buf2 += ps_ref_frm->u2_frm_wd_uv;
  528|      0|        pu1_buf3 += ps_ref_frm->u2_frm_wd_uv;
  529|       |
  530|      0|    }
  531|       |
  532|       |
  533|       |
  534|  7.97M|    if(ps_dec->ps_cur_pps->u1_wted_pred_flag)
  ------------------
  |  Branch (534:8): [True: 6.27M, False: 1.70M]
  ------------------
  535|  6.27M|    {
  536|  6.27M|            pu4_wt_offset = (UWORD32*)&ps_dec->pu4_wt_ofsts[2
  537|  6.27M|                            * X3(i1_ref_idx)];
  ------------------
  |  |   92|  6.27M|#define X3(a)   (((a) << 1) + (a))
  ------------------
  538|  6.27M|    }
  539|       |
  540|       |
  541|  7.97M|    pu4_wt_offset = ps_pred_pkd->pu4_wt_offst;
  542|       |
  543|       |
  544|       |    /* Pointer to the frame buffer */
  545|  7.97M|    {
  546|  7.97M|        ps_frame_buf = &ps_dec->s_tran_addrecon;
  547|       |        /* CHANGED CODE */
  548|  7.97M|    }
  549|       |
  550|  7.97M|    if(!u1_pic_fld)
  ------------------
  |  Branch (550:8): [True: 7.97M, False: 0]
  ------------------
  551|  7.97M|    {
  552|  7.97M|        u1_mb_fld = ps_cur_mb_info->u1_mb_field_decodingflag;
  553|  7.97M|        u1_mb_bot = 1 - ps_cur_mb_info->u1_topmb;
  554|  7.97M|    }
  555|      0|    else
  556|      0|        u1_pic_bot = ps_cur_slice->u1_bottom_field_flag;
  557|       |
  558|       |    /****************************************************************/
  559|       |    /* calculating the flags the tell whether to use frame-padding  */
  560|       |    /* or use software pad-on-demand                                */
  561|       |    /****************************************************************/
  562|  7.97M|    u1_mb_or_pic_bot = u1_mb_bot | u1_pic_bot;
  563|  7.97M|    u1_mb_or_pic_fld = u1_mb_fld | u1_pic_fld;
  564|  7.97M|    u1_pod_bot = u1_mb_or_pic_fld && (u1_ref_pic_type == TOP_FLD);
  ------------------
  |  |  353|      0|#define TOP_FLD         0x01
  ------------------
  |  Branch (564:18): [True: 0, False: 7.97M]
  |  Branch (564:38): [True: 0, False: 0]
  ------------------
  565|  7.97M|    u1_pod_top = u1_mb_or_pic_fld && (u1_ref_pic_type == BOT_FLD);
  ------------------
  |  |  354|      0|#define BOT_FLD         0x02
  ------------------
  |  Branch (565:18): [True: 0, False: 7.97M]
  |  Branch (565:38): [True: 0, False: 0]
  ------------------
  566|       |
  567|       |    /* Weighted Pred additions */
  568|  7.97M|    u1_wted_bipred_idc = ps_dec->ps_cur_pps->u1_wted_bipred_idc;
  569|       |
  570|  7.97M|    if((u1_slice_type == P_SLICE) || (u1_slice_type == SP_SLICE))
  ------------------
  |  |  368|  7.97M|#define P_SLICE  0
  ------------------
                  if((u1_slice_type == P_SLICE) || (u1_slice_type == SP_SLICE))
  ------------------
  |  |  371|  3.09M|#define SP_SLICE 3
  ------------------
  |  Branch (570:8): [True: 4.87M, False: 3.09M]
  |  Branch (570:38): [True: 0, False: 3.09M]
  ------------------
  571|  4.87M|    {
  572|       |        /* P Slice only */
  573|  4.87M|        u1_wght_pred_type = ps_dec->ps_cur_pps->u1_wted_pred_flag;
  574|       |
  575|  4.87M|    }
  576|  3.09M|    else
  577|  3.09M|    {
  578|       |        /* B Slice only */
  579|  3.09M|        u1_wght_pred_type = 1 + u1_is_bi_dir;
  580|  3.09M|        if(u1_wted_bipred_idc == 0)
  ------------------
  |  Branch (580:12): [True: 1.03M, False: 2.05M]
  ------------------
  581|  1.03M|            u1_wght_pred_type = 0;
  582|  3.09M|        if((u1_wted_bipred_idc == 2) && (!u1_is_bi_dir))
  ------------------
  |  Branch (582:12): [True: 1.20M, False: 1.89M]
  |  Branch (582:41): [True: 554k, False: 649k]
  ------------------
  583|   554k|            u1_wght_pred_type = 0;
  584|  3.09M|    }
  585|       |    /* load the scratch reference buffer index */
  586|  7.97M|    pu1_ref_buf = ps_dec->pu1_ref_buff + ps_dec->u4_dma_buf_idx;
  587|  7.97M|    u2_tot_ref_scratch_size = 0;
  588|       |
  589|       |
  590|       |    /* Transfer Setup Y */
  591|  7.97M|    {
  592|  7.97M|        UWORD8 *pu1_pred, *pu1_rec;
  593|       |        /* calculating rounded motion vectors and fractional components */
  594|  7.97M|        i2_tmp_mv_x = i2_mv_x;
  595|  7.97M|        i2_tmp_mv_y = i2_mv_y;
  596|       |
  597|  7.97M|        u1_dx = i2_tmp_mv_x & 0x3;
  598|  7.97M|        u1_dy = i2_tmp_mv_y & 0x3;
  599|  7.97M|        i2_tmp_mv_x >>= 2;
  600|  7.97M|        i2_tmp_mv_y >>= 2;
  601|  7.97M|        i1_mc_wd = u1_part_wd << 2;
  602|  7.97M|        u1_dma_ht = u1_part_ht << 2;
  603|  7.97M|        if(u1_dx)
  ------------------
  |  Branch (603:12): [True: 502k, False: 7.47M]
  ------------------
  604|   502k|        {
  605|   502k|            i2_tmp_mv_x -= 2;
  606|   502k|            i1_mc_wd += 5;
  607|   502k|        }
  608|  7.97M|        if(u1_dy)
  ------------------
  |  Branch (608:12): [True: 458k, False: 7.51M]
  ------------------
  609|   458k|        {
  610|   458k|            i2_tmp_mv_y -= 2;
  611|   458k|            u1_dma_ht += 5;
  612|   458k|        }
  613|       |
  614|       |        /********************************************************************/
  615|       |        /* Calulating the horizontal and the vertical u4_ofst from top left  */
  616|       |        /* edge of the reference frame, and subsequent clipping             */
  617|       |        /********************************************************************/
  618|  7.97M|        u2_pic_ht = ps_dec->u2_pic_ht >> u1_pic_fld;
  619|  7.97M|        u2_frm_wd = ps_dec->u2_frm_wd_y << u1_pic_fld;
  620|  7.97M|        i2_frm_x = (u2_mb_x << 4) + (u1_sub_x << 2) + i2_tmp_mv_x;
  621|  7.97M|        i2_frm_y = ((u2_mb_y + (u1_mb_bot && !u1_mb_fld)) << 4)
  ------------------
  |  Branch (621:33): [True: 0, False: 7.97M]
  |  Branch (621:46): [True: 0, False: 0]
  ------------------
  622|  7.97M|                        + (((u1_sub_y << 2) + i2_tmp_mv_y) << u1_mb_fld);
  623|       |
  624|  7.97M|        i2_frm_x = CLIP3(MAX_OFFSET_OUTSIDE_X_FRM, (ps_dec->u2_pic_wd - 1),
  ------------------
  |  |   77|  7.97M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 2.97k, False: 7.97M]
  |  |  |  Branch (77:54): [True: 60.2k, False: 7.91M]
  |  |  ------------------
  ------------------
  625|  7.97M|                         i2_frm_x);
  626|  7.97M|        i2_frm_y = CLIP3(((1 - u1_dma_ht) << u1_mb_fld),
  ------------------
  |  |   77|  7.97M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 10.3k, False: 7.96M]
  |  |  |  Branch (77:54): [True: 13.3k, False: 7.95M]
  |  |  ------------------
  ------------------
  627|  7.97M|                         (u2_pic_ht - (1 << u1_mb_fld)), i2_frm_y);
  628|       |
  629|  7.97M|        pu1_pred = pu1_buf1 + i2_frm_y * u2_frm_wd + i2_frm_x;
  630|  7.97M|        u1_dma_wd = (i1_mc_wd + 3) & 0xFC;
  631|       |        /********************************************************************/
  632|       |        /* Calulating the horizontal and the vertical u4_ofst from top left  */
  633|       |        /* edge of the recon buffer                                         */
  634|       |        /********************************************************************/
  635|       |        /* CHANGED CODE */
  636|  7.97M|        u2_rec_wd = MB_SIZE;
  ------------------
  |  |  554|  7.97M|#define MB_SIZE             16
  ------------------
  637|  7.97M|        i2_rec_x = u1_sub_x << 2;
  638|  7.97M|        i2_rec_y = u1_sub_y << 2;
  639|  7.97M|        {
  640|  7.97M|            u2_rec_wd = ps_dec->u2_frm_wd_y << u1_mb_or_pic_fld;
  641|  7.97M|            i2_rec_x += (mb_index << 4);
  642|  7.97M|            pu1_rec = ps_frame_buf->pu1_dest_y + i2_rec_y * u2_rec_wd
  643|  7.97M|                            + i2_rec_x;
  644|  7.97M|            if(u1_mb_bot)
  ------------------
  |  Branch (644:16): [True: 0, False: 7.97M]
  ------------------
  645|      0|                pu1_rec += ps_dec->u2_frm_wd_y << ((u1_mb_fld) ? 0 : 4);
  ------------------
  |  Branch (645:52): [True: 0, False: 0]
  ------------------
  646|  7.97M|        }
  647|       |
  648|       |        /* CHANGED CODE */
  649|       |
  650|       |        /* filling the pred and dma structures for Y */
  651|  7.97M|        u2_frm_wd = ps_dec->u2_frm_wd_y << u1_mb_or_pic_fld;
  652|       |
  653|  7.97M|        ps_pred->pu1_dma_dest_addr = pu1_ref_buf;
  654|  7.97M|        ps_pred->u2_u1_ref_buf_wd = u1_dma_wd;
  655|  7.97M|        ps_pred->u2_frm_wd = u2_frm_wd;
  656|  7.97M|        ps_pred->i1_dma_ht = u1_dma_ht;
  657|  7.97M|        ps_pred->i1_mc_wd = i1_mc_wd;
  658|  7.97M|        ps_pred->pu1_rec_y_u = pu1_rec;
  659|  7.97M|        ps_pred->u2_dst_stride = u2_rec_wd;
  660|       |
  661|  7.97M|        ps_pred->i1_mb_partwidth = u1_part_wd << 2;
  662|  7.97M|        ps_pred->i1_mb_partheight = u1_part_ht << 2;
  663|  7.97M|        ps_pred->u1_dydx = (u1_dy << 2) + u1_dx;
  664|  7.97M|        ps_pred->u1_is_bi_direct = u1_is_bi_dir;
  665|  7.97M|        ps_pred->u1_pi1_wt_ofst_rec_v = (UWORD8 *)pu4_wt_offset;
  666|  7.97M|        ps_pred->u1_wght_pred_type = u1_wght_pred_type;
  667|  7.97M|        ps_pred->i1_pod_ht = 0;
  668|       |
  669|       |        /* Increment the Reference buffer Indices */
  670|  7.97M|        pu1_ref_buf += u1_dma_wd * u1_dma_ht;
  671|  7.97M|        u2_tot_ref_scratch_size += u1_dma_wd * u1_dma_ht;
  672|       |
  673|       |        /* unrestricted field motion comp for top region outside frame */
  674|  7.97M|        i2_pod_ht = (-i2_frm_y) >> u1_mb_fld;
  675|  7.97M|        if((i2_pod_ht > 0) && u1_pod_top)
  ------------------
  |  Branch (675:12): [True: 33.5k, False: 7.94M]
  |  Branch (675:31): [True: 0, False: 33.5k]
  ------------------
  676|      0|        {
  677|      0|            ps_pred->i1_pod_ht = (WORD8)(-i2_pod_ht);
  678|      0|            u1_dma_ht -= i2_pod_ht;
  679|      0|            pu1_pred += i2_pod_ht * u2_frm_wd;
  680|      0|        }
  681|       |        /* unrestricted field motion comp for bottom region outside frame */
  682|  7.97M|        else if(u1_pod_bot)
  ------------------
  |  Branch (682:17): [True: 0, False: 7.97M]
  ------------------
  683|      0|        {
  684|      0|            i2_pod_ht = u1_dma_ht + ((i2_frm_y - u2_pic_ht) >> u1_mb_fld);
  685|      0|            if(i2_pod_ht > 0)
  ------------------
  |  Branch (685:16): [True: 0, False: 0]
  ------------------
  686|      0|            {
  687|      0|                u1_dma_ht -= i2_pod_ht;
  688|      0|                ps_pred->i1_pod_ht = (WORD8)i2_pod_ht;
  689|      0|            }
  690|      0|        }
  691|       |
  692|       |        /* Copy Y partition */
  693|       |
  694|       |        /*
  695|       |         * ps_pred->i1_pod_ht is non zero when MBAFF is present. In case of MBAFF the reference data
  696|       |         * is copied in the Scrath buffer so that the padding_on_demand doesnot corrupt the frame data
  697|       |         */
  698|  7.97M|        if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (698:12): [True: 0, False: 7.97M]
  ------------------
  699|      0|        {
  700|      0|            ps_pred->pu1_pred = pu1_pred;
  701|      0|            ps_pred->u1_dma_ht_y = u1_dma_ht;
  702|      0|            ps_pred->u1_dma_wd_y = u1_dma_wd;
  703|      0|        }
  704|  7.97M|        ps_pred->pu1_y_ref = pu1_pred;
  705|  7.97M|    }
  706|       |
  707|       |
  708|       |
  709|       |    /* Increment ps_pred index */
  710|  7.97M|    ps_pred++;
  711|       |
  712|       |    /* Transfer Setup U & V */
  713|  7.97M|    {
  714|  7.97M|        WORD32 i4_ref_offset, i4_rec_offset;
  715|  7.97M|        UWORD8 *pu1_pred_u, *pu1_pred_v, u1_tmp_dma_ht;
  716|       |        /* CHANGED CODE */
  717|  7.97M|        UWORD8 u1_chroma_cbp = (UWORD8)(ps_cur_mb_info->u1_cbp >> 4);
  718|       |        /* CHANGED CODE */
  719|       |
  720|       |        /* calculating rounded motion vectors and fractional components */
  721|  7.97M|        i2_tmp_mv_x = i2_mv_x;
  722|  7.97M|        i2_tmp_mv_y = i2_mv_y;
  723|       |
  724|       |        /************************************************************************/
  725|       |        /* Table 8-9: Derivation of the vertical component of the chroma vector */
  726|       |        /* in field coding mode                                                 */
  727|       |        /************************************************************************/
  728|  7.97M|        if(u1_pod_bot && u1_mb_or_pic_bot)
  ------------------
  |  Branch (728:12): [True: 0, False: 7.97M]
  |  Branch (728:26): [True: 0, False: 0]
  ------------------
  729|      0|            i2_tmp_mv_y += 2;
  730|  7.97M|        if(u1_pod_top && !u1_mb_or_pic_bot)
  ------------------
  |  Branch (730:12): [True: 0, False: 7.97M]
  |  Branch (730:26): [True: 0, False: 0]
  ------------------
  731|      0|            i2_tmp_mv_y -= 2;
  732|       |
  733|       |        /* Eighth sample of the chroma MV */
  734|  7.97M|        u1_dx = i2_tmp_mv_x & 0x7;
  735|  7.97M|        u1_dy = i2_tmp_mv_y & 0x7;
  736|       |
  737|       |        /********************************************************************/
  738|       |        /* Calculating the full pel MV for chroma which is 1/2 of the Luma  */
  739|       |        /* MV in full pel units                                             */
  740|       |        /********************************************************************/
  741|  7.97M|        i2_mv_x = i2_tmp_mv_x;
  742|  7.97M|        i2_mv_y = i2_tmp_mv_y;
  743|  7.97M|        i2_tmp_mv_x = SIGN_POW2_DIV(i2_tmp_mv_x, 3);
  ------------------
  |  |   67|  7.97M|#define SIGN_POW2_DIV(x, y) (((x) < 0) ? (-((-(x)) >> (y))) : ((x) >> (y)))
  |  |  ------------------
  |  |  |  Branch (67:30): [True: 270k, False: 7.70M]
  |  |  ------------------
  ------------------
  744|  7.97M|        i2_tmp_mv_y = SIGN_POW2_DIV(i2_tmp_mv_y, 3);
  ------------------
  |  |   67|  7.97M|#define SIGN_POW2_DIV(x, y) (((x) < 0) ? (-((-(x)) >> (y))) : ((x) >> (y)))
  |  |  ------------------
  |  |  |  Branch (67:30): [True: 261k, False: 7.71M]
  |  |  ------------------
  ------------------
  745|  7.97M|        i1_mc_wd = u1_part_wd << 1;
  746|  7.97M|        u1_dma_ht = u1_part_ht << 1;
  747|  7.97M|        if(u1_dx)
  ------------------
  |  Branch (747:12): [True: 549k, False: 7.42M]
  ------------------
  748|   549k|        {
  749|   549k|            if(i2_mv_x < 0)
  ------------------
  |  Branch (749:16): [True: 265k, False: 284k]
  ------------------
  750|   265k|                i2_tmp_mv_x -= 1;
  751|   549k|            i1_mc_wd++;
  752|   549k|        }
  753|  7.97M|        if(u1_dy != 0)
  ------------------
  |  Branch (753:12): [True: 498k, False: 7.47M]
  ------------------
  754|   498k|        {
  755|   498k|            if(i2_mv_y < 0)
  ------------------
  |  Branch (755:16): [True: 233k, False: 264k]
  ------------------
  756|   233k|                i2_tmp_mv_y -= 1;
  757|   498k|            u1_dma_ht++;
  758|   498k|        }
  759|       |
  760|       |        /********************************************************************/
  761|       |        /* Calulating the horizontal and the vertical u4_ofst from top left  */
  762|       |        /* edge of the reference frame, and subsequent clipping             */
  763|       |        /********************************************************************/
  764|  7.97M|        u2_pic_ht >>= 1;
  765|  7.97M|        u2_frm_wd = ps_dec->u2_frm_wd_uv << u1_pic_fld;
  766|  7.97M|        i2_frm_x = (u2_mb_x << 3) + (u1_sub_x << 1) + i2_tmp_mv_x;
  767|  7.97M|        i2_frm_y = ((u2_mb_y + (u1_mb_bot && !u1_mb_fld)) << 3)
  ------------------
  |  Branch (767:33): [True: 0, False: 7.97M]
  |  Branch (767:46): [True: 0, False: 0]
  ------------------
  768|  7.97M|                        + (((u1_sub_y << 1) + i2_tmp_mv_y) << u1_mb_fld);
  769|       |
  770|  7.97M|        i2_frm_x = CLIP3(MAX_OFFSET_OUTSIDE_UV_FRM,
  ------------------
  |  |   77|  7.97M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 3.04k, False: 7.97M]
  |  |  |  Branch (77:54): [True: 61.4k, False: 7.91M]
  |  |  ------------------
  ------------------
  771|  7.97M|                         ((ps_dec->u2_pic_wd >> 1) - 1), i2_frm_x);
  772|  7.97M|        i2_frm_y = CLIP3(((1 - u1_dma_ht) << u1_mb_fld),
  ------------------
  |  |   77|  7.97M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 10.5k, False: 7.96M]
  |  |  |  Branch (77:54): [True: 13.3k, False: 7.95M]
  |  |  ------------------
  ------------------
  773|  7.97M|                         (u2_pic_ht - (1 << u1_mb_fld)), i2_frm_y);
  774|       |
  775|  7.97M|        i4_ref_offset = i2_frm_y * u2_frm_wd + i2_frm_x * YUV420SP_FACTOR;
  ------------------
  |  |  119|  7.97M|#define YUV420SP_FACTOR 2
  ------------------
  776|  7.97M|        u1_dma_wd = (i1_mc_wd + 3) & 0xFC;
  777|       |
  778|       |        /********************************************************************/
  779|       |        /* Calulating the horizontal and the vertical u4_ofst from top left  */
  780|       |        /* edge of the recon buffer                                         */
  781|       |        /********************************************************************/
  782|       |        /* CHANGED CODE */
  783|  7.97M|        u2_rec_wd = BLK8x8SIZE * YUV420SP_FACTOR;
  ------------------
  |  |  555|  7.97M|#define BLK8x8SIZE          8
  ------------------
                      u2_rec_wd = BLK8x8SIZE * YUV420SP_FACTOR;
  ------------------
  |  |  119|  7.97M|#define YUV420SP_FACTOR 2
  ------------------
  784|  7.97M|        i2_rec_x = u1_sub_x << 1;
  785|  7.97M|        i2_rec_y = u1_sub_y << 1;
  786|  7.97M|        i4_rec_offset = i2_rec_y * u2_rec_wd + i2_rec_x * YUV420SP_FACTOR;
  ------------------
  |  |  119|  7.97M|#define YUV420SP_FACTOR 2
  ------------------
  787|  7.97M|        {
  788|  7.97M|            u2_rec_wd = ps_dec->u2_frm_wd_uv << u1_mb_or_pic_fld;
  789|       |
  790|  7.97M|            i2_rec_x += (mb_index << 3);
  791|  7.97M|            i4_rec_offset = i2_rec_y * u2_rec_wd + i2_rec_x * YUV420SP_FACTOR;
  ------------------
  |  |  119|  7.97M|#define YUV420SP_FACTOR 2
  ------------------
  792|  7.97M|            if(u1_mb_bot)
  ------------------
  |  Branch (792:16): [True: 0, False: 7.97M]
  ------------------
  793|      0|                i4_rec_offset += ps_dec->u2_frm_wd_uv << ((u1_mb_fld) ? 0 : 3);
  ------------------
  |  Branch (793:59): [True: 0, False: 0]
  ------------------
  794|  7.97M|            ps_pred->pu1_rec_y_u = ps_frame_buf->pu1_dest_u + i4_rec_offset;
  795|  7.97M|            ps_pred->u1_pi1_wt_ofst_rec_v = ps_frame_buf->pu1_dest_v
  796|  7.97M|                            + i4_rec_offset;
  797|       |
  798|  7.97M|        }
  799|       |
  800|       |        /* CHANGED CODE */
  801|       |
  802|       |        /* filling the common pred structures for U */
  803|  7.97M|        u2_frm_wd = ps_dec->u2_frm_wd_uv << u1_mb_or_pic_fld;
  804|  7.97M|        u1_tmp_dma_ht = u1_dma_ht;
  805|  7.97M|        ps_pred->u2_u1_ref_buf_wd = u1_dma_wd;
  806|  7.97M|        ps_pred->u2_frm_wd = u2_frm_wd;
  807|  7.97M|        ps_pred->i1_dma_ht = u1_dma_ht;
  808|  7.97M|        ps_pred->i1_mc_wd = i1_mc_wd;
  809|  7.97M|        ps_pred->u2_dst_stride = u2_rec_wd;
  810|       |
  811|  7.97M|        ps_pred->i1_mb_partwidth = u1_part_wd << 1;
  812|  7.97M|        ps_pred->i1_mb_partheight = u1_part_ht << 1;
  813|  7.97M|        ps_pred->u1_dydx = (u1_dy << 3) + u1_dx;
  814|  7.97M|        ps_pred->u1_is_bi_direct = u1_is_bi_dir;
  815|  7.97M|        ps_pred->u1_wght_pred_type = u1_wght_pred_type;
  816|  7.97M|        ps_pred->i1_pod_ht = 0;
  817|       |
  818|  7.97M|        ps_pred->pu1_dma_dest_addr = pu1_ref_buf;
  819|       |
  820|       |        /* unrestricted field motion comp for top region outside frame */
  821|  7.97M|        i2_pod_ht = (-i2_frm_y) >> u1_mb_fld;
  822|  7.97M|        if((i2_pod_ht > 0) && u1_pod_top)
  ------------------
  |  Branch (822:12): [True: 23.7k, False: 7.95M]
  |  Branch (822:31): [True: 0, False: 23.7k]
  ------------------
  823|      0|        {
  824|      0|            i4_ref_offset += i2_pod_ht * u2_frm_wd;
  825|      0|            u1_dma_ht -= i2_pod_ht;
  826|      0|            ps_pred->i1_pod_ht = (WORD8)(-i2_pod_ht);
  827|      0|        }
  828|       |        /* unrestricted field motion comp for bottom region outside frame */
  829|  7.97M|        else if(u1_pod_bot)
  ------------------
  |  Branch (829:17): [True: 0, False: 7.97M]
  ------------------
  830|      0|        {
  831|      0|            i2_pod_ht = u1_dma_ht + ((i2_frm_y - u2_pic_ht) >> u1_mb_fld);
  832|      0|            if(i2_pod_ht > 0)
  ------------------
  |  Branch (832:16): [True: 0, False: 0]
  ------------------
  833|      0|            {
  834|      0|                u1_dma_ht -= i2_pod_ht;
  835|      0|                ps_pred->i1_pod_ht = (WORD8)i2_pod_ht;
  836|      0|            }
  837|      0|        }
  838|       |
  839|  7.97M|        pu1_pred_u = pu1_buf2 + i4_ref_offset;
  840|  7.97M|        pu1_pred_v = pu1_buf3 + i4_ref_offset;
  841|       |
  842|       |        /* Copy U & V partitions */
  843|  7.97M|        if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (843:12): [True: 0, False: 7.97M]
  ------------------
  844|      0|        {
  845|      0|            ps_pred->pu1_pred_u = pu1_pred_u;
  846|      0|            ps_pred->u1_dma_ht_uv = u1_dma_ht;
  847|      0|            ps_pred->u1_dma_wd_uv = u1_dma_wd;
  848|       |
  849|      0|        }
  850|  7.97M|        ps_pred->pu1_u_ref = pu1_pred_u;
  851|       |
  852|       |        /* Increment the reference buffer Index */
  853|  7.97M|        u2_tot_ref_scratch_size += (u1_dma_wd * u1_tmp_dma_ht) << 1;
  854|       |
  855|  7.97M|        if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (855:12): [True: 0, False: 7.97M]
  ------------------
  856|      0|        {
  857|      0|            ps_pred->pu1_pred_v = pu1_pred_v;
  858|      0|            ps_pred->u1_dma_ht_uv = u1_dma_ht;
  859|      0|            ps_pred->u1_dma_wd_uv = u1_dma_wd;
  860|      0|        }
  861|       |
  862|  7.97M|        ps_pred->pu1_v_ref = pu1_pred_v;
  863|  7.97M|    }
  864|       |
  865|       |    /* Increment ps_pred index */
  866|  7.97M|    ps_dec->u4_pred_info_idx += 2;
  867|       |
  868|       |
  869|       |    /* Increment the reference buffer Index */
  870|  7.97M|    ps_dec->u4_dma_buf_idx += u2_tot_ref_scratch_size;
  871|       |
  872|  7.97M|    if(ps_dec->u4_dma_buf_idx > MAX_REF_BUF_SIZE)
  ------------------
  |  |   67|  7.97M|#define MAX_REF_BUF_SIZE       (3776*2*2)
  ------------------
  |  Branch (872:8): [True: 0, False: 7.97M]
  ------------------
  873|      0|        return ERROR_NUM_MV;
  874|       |
  875|  7.97M|    return OK;
  ------------------
  |  |  114|  7.97M|#define OK        0
  ------------------
  876|       |
  877|       |
  878|       |
  879|  7.97M|}
ih264d_motion_compensate_bp:
  904|  5.62M|{
  905|  5.62M|    pred_info_t *ps_pred ;
  906|  5.62M|    UWORD8 *puc_ref, *pu1_dest_y;
  907|  5.62M|    UWORD8 *pu1_dest_u;
  908|  5.62M|    UWORD32 u2_num_pels, u2_ref_wd_y, u2_ref_wd_uv, u2_dst_wd;
  909|       |
  910|  5.62M|    UWORD32 u4_wd_y, u4_ht_y, u4_wd_uv;
  911|  5.62M|    UWORD32 u4_ht_uv;
  912|  5.62M|    UWORD8 *puc_pred0 = (UWORD8 *)(ps_dec->pi2_pred1);
  913|       |
  914|       |
  915|  5.62M|    PROFILE_DISABLE_INTER_PRED()
  ------------------
  |  |  119|  5.62M|#define PROFILE_DISABLE_INTER_PRED() ;
  ------------------
  916|  5.62M|    UNUSED(ps_cur_mb_info);
  ------------------
  |  |   45|  5.62M|#define UNUSED(x) ((void)(x))
  ------------------
  917|  5.62M|    ps_pred = ps_dec->ps_pred ;
  918|       |
  919|  11.3M|    for(u2_num_pels = 0; u2_num_pels < 256;)
  ------------------
  |  Branch (919:26): [True: 5.74M, False: 5.62M]
  ------------------
  920|  5.74M|    {
  921|  5.74M|        UWORD32 uc_dx, uc_dy;
  922|       |        /* Pointer to the destination buffer. If the CBPs of all 8x8 blocks in
  923|       |         the MB partition are zero then it would be better to copy the
  924|       |         predictor valus directly to the current frame buffer */
  925|       |        /*
  926|       |         * ps_pred->i1_pod_ht is non zero when MBAFF is present. In case of MBAFF the reference data
  927|       |         * is copied in the Scrath buffer so that the padding_on_demand doesnot corrupt the frame data
  928|       |         */
  929|       |
  930|  5.74M|        u2_ref_wd_y = ps_pred->u2_frm_wd;
  931|  5.74M|        puc_ref = ps_pred->pu1_y_ref;
  932|  5.74M|        if(ps_pred->u1_dydx & 0x3)
  ------------------
  |  Branch (932:12): [True: 134k, False: 5.60M]
  ------------------
  933|   134k|            puc_ref += 2;
  934|  5.74M|        if(ps_pred->u1_dydx >> 2)
  ------------------
  |  Branch (934:12): [True: 120k, False: 5.62M]
  ------------------
  935|   120k|            puc_ref += 2 * u2_ref_wd_y;
  936|       |
  937|  5.74M|        u4_wd_y = ps_pred->i1_mb_partwidth;
  938|  5.74M|        u4_ht_y = ps_pred->i1_mb_partheight;
  939|  5.74M|        uc_dx = ps_pred->u1_dydx;
  940|  5.74M|        uc_dy = uc_dx >> 2;
  941|  5.74M|        uc_dx &= 0x3;
  942|       |
  943|  5.74M|        pu1_dest_y = ps_pred->pu1_rec_y_u;
  944|  5.74M|        u2_dst_wd = ps_pred->u2_dst_stride;
  945|       |
  946|  5.74M|        ps_dec->apf_inter_pred_luma[ps_pred->u1_dydx](puc_ref, pu1_dest_y,
  947|  5.74M|                                                      u2_ref_wd_y,
  948|  5.74M|                                                      u2_dst_wd,
  949|  5.74M|                                                      u4_ht_y,
  950|  5.74M|                                                      u4_wd_y, puc_pred0,
  951|  5.74M|                                                      ps_pred->u1_dydx);
  952|       |
  953|  5.74M|        ps_pred++;
  954|       |
  955|       |        /* Interpolate samples for the chroma components */
  956|  5.74M|        {
  957|  5.74M|            UWORD8 *pu1_ref_u;
  958|       |
  959|  5.74M|            u2_ref_wd_uv = ps_pred->u2_frm_wd;
  960|  5.74M|            pu1_ref_u = ps_pred->pu1_u_ref;
  961|       |
  962|  5.74M|            u4_wd_uv = ps_pred->i1_mb_partwidth;
  963|  5.74M|            u4_ht_uv = ps_pred->i1_mb_partheight;
  964|  5.74M|            uc_dx = ps_pred->u1_dydx; /* 8*dy + dx */
  965|  5.74M|            uc_dy = uc_dx >> 3;
  966|  5.74M|            uc_dx &= 0x7;
  967|       |
  968|  5.74M|            pu1_dest_u = ps_pred->pu1_rec_y_u;
  969|  5.74M|            u2_dst_wd = ps_pred->u2_dst_stride;
  970|       |
  971|  5.74M|            ps_pred++;
  972|  5.74M|            ps_dec->pf_inter_pred_chroma(pu1_ref_u, pu1_dest_u, u2_ref_wd_uv,
  973|  5.74M|                                         u2_dst_wd, uc_dx, uc_dy,
  974|  5.74M|                                         u4_ht_uv, u4_wd_uv);
  975|       |
  976|  5.74M|        }
  977|       |
  978|  5.74M|        u2_num_pels += (UWORD8)u4_wd_y * (UWORD8)u4_ht_y;
  979|       |
  980|  5.74M|    }
  981|  5.62M|}
ih264d_motion_compensate_mp:
 1006|  6.90M|{
 1007|  6.90M|    pred_info_t *ps_pred ;
 1008|  6.90M|    pred_info_t *ps_pred_y_forw, *ps_pred_y_back, *ps_pred_cr_forw;
 1009|  6.90M|    UWORD8 *puc_ref, *pu1_dest_y, *puc_pred0, *puc_pred1;
 1010|  6.90M|    UWORD8 *pu1_dest_u, *pu1_dest_v;
 1011|  6.90M|    WORD16 *pi16_intm;
 1012|  6.90M|    UWORD32 u2_num_pels, u2_ref_wd_y, u2_ref_wd_uv, u2_dst_wd;
 1013|  6.90M|    UWORD32 u2_dest_wd_y, u2_dest_wd_uv;
 1014|  6.90M|    UWORD32 u2_row_buf_wd_y = 0;
 1015|  6.90M|    UWORD32 u2_row_buf_wd_uv = 0;
 1016|  6.90M|    UWORD32 u2_log2Y_crwd;
 1017|  6.90M|    UWORD32 u4_wd_y, u4_ht_y, u1_dir, u4_wd_uv;
 1018|  6.90M|    UWORD32 u4_ht_uv;
 1019|  6.90M|    UWORD8 *pu1_temp_mc_buffer = ps_dec->pu1_temp_mc_buffer;
 1020|  6.90M|    WORD32 i2_pod_ht;
 1021|  6.90M|    UWORD32 u2_pic_ht, u2_frm_wd, u2_rec_wd;
 1022|  6.90M|    UWORD32 u1_pod_bot, u1_pod_top;
 1023|  6.90M|    UWORD8 *pu1_pred, *pu1_dma_dst;
 1024|  6.90M|    UWORD32 u1_dma_wd, u1_dma_ht;
 1025|       |
 1026|  6.90M|    dec_slice_params_t * const ps_cur_slice = ps_dec->ps_cur_slice;
 1027|       |
 1028|       |    /* set default value to flags specifying field nature of picture & mb */
 1029|  6.90M|    UWORD32 u1_mb_fld = 0, u1_mb_or_pic_fld;
 1030|  6.90M|    UWORD32 u1_mb_or_pic_bot;
 1031|       |    /* calculate flags specifying field nature of picture & mb */
 1032|  6.90M|    const UWORD8 u1_pic_fld = ps_cur_slice->u1_field_pic_flag;
 1033|       |
 1034|  6.90M|    PROFILE_DISABLE_INTER_PRED()
  ------------------
  |  |  119|  6.90M|#define PROFILE_DISABLE_INTER_PRED() ;
  ------------------
 1035|  6.90M|    ps_pred = ps_dec->ps_pred ;
 1036|       |    /* Initialize both ps_pred_y_forw, ps_pred_cr_forw and ps_pred_y_back
 1037|       |     * to avoid static analysis warnings */
 1038|  6.90M|    ps_pred_y_forw = ps_pred;
 1039|  6.90M|    ps_pred_y_back = ps_pred;
 1040|  6.90M|    ps_pred_cr_forw = ps_pred;
 1041|       |
 1042|  6.90M|    u2_log2Y_crwd = ps_dec->ps_decode_cur_slice->u2_log2Y_crwd;
 1043|       |
 1044|  6.90M|    if(!u1_pic_fld)
  ------------------
  |  Branch (1044:8): [True: 6.90M, False: 0]
  ------------------
 1045|  6.90M|    {
 1046|  6.90M|        u1_mb_fld = ps_cur_mb_info->u1_mb_field_decodingflag;
 1047|  6.90M|    }
 1048|       |
 1049|  6.90M|    u1_mb_or_pic_fld = u1_mb_fld | u1_pic_fld;
 1050|       |
 1051|  6.90M|    pi16_intm = ps_dec->pi2_pred1;
 1052|  6.90M|    puc_pred0 = (UWORD8 *)pi16_intm;
 1053|  6.90M|    puc_pred1 = puc_pred0 + PRED_BUFFER_WIDTH * PRED_BUFFER_HEIGHT * sizeof(WORD16);
  ------------------
  |  |   55|  6.90M|#define PRED_BUFFER_WIDTH   24*2
  ------------------
                  puc_pred1 = puc_pred0 + PRED_BUFFER_WIDTH * PRED_BUFFER_HEIGHT * sizeof(WORD16);
  ------------------
  |  |   56|  6.90M|#define PRED_BUFFER_HEIGHT  24*2
  ------------------
 1054|       |
 1055|  14.0M|    for(u2_num_pels = 0; u2_num_pels < 256;)
  ------------------
  |  Branch (1055:26): [True: 7.18M, False: 6.90M]
  ------------------
 1056|  7.18M|    {
 1057|  7.18M|        UWORD8 uc_dx, uc_dy;
 1058|  7.18M|        const UWORD8 u1_is_bi_direct = ps_pred->u1_is_bi_direct;
 1059|  15.1M|        for(u1_dir = 0; u1_dir <= u1_is_bi_direct; u1_dir++)
  ------------------
  |  Branch (1059:25): [True: 7.97M, False: 7.18M]
  ------------------
 1060|  7.97M|        {
 1061|       |            /* Pointer to the destination buffer. If the CBPs of all 8x8 blocks in
 1062|       |             the MB partition are zero then it would be better to copy the
 1063|       |             predictor valus directly to the current frame buffer */
 1064|       |            /*
 1065|       |             * ps_pred->i1_pod_ht is non zero when MBAFF is present. In case of MBAFF the reference data
 1066|       |             * is copied in the Scrath buffer so that the padding_on_demand doesnot corrupt the frame data
 1067|       |             */
 1068|       |
 1069|  7.97M|            if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (1069:16): [True: 0, False: 7.97M]
  ------------------
 1070|      0|            {
 1071|      0|                u2_ref_wd_y = ps_pred->u2_u1_ref_buf_wd;
 1072|      0|                puc_ref = ps_pred->pu1_dma_dest_addr;
 1073|      0|            }
 1074|  7.97M|            else
 1075|  7.97M|            {
 1076|  7.97M|                u2_ref_wd_y = ps_pred->u2_frm_wd;
 1077|  7.97M|                puc_ref = ps_pred->pu1_y_ref;
 1078|       |
 1079|  7.97M|            }
 1080|       |
 1081|  7.97M|            if(ps_pred->u1_dydx & 0x3)
  ------------------
  |  Branch (1081:16): [True: 502k, False: 7.46M]
  ------------------
 1082|   502k|                puc_ref += 2;
 1083|  7.97M|            if(ps_pred->u1_dydx >> 2)
  ------------------
  |  Branch (1083:16): [True: 458k, False: 7.51M]
  ------------------
 1084|   458k|                puc_ref += 2 * u2_ref_wd_y;
 1085|  7.97M|            u4_wd_y = ps_pred->i1_mb_partwidth;
 1086|  7.97M|            u4_ht_y = ps_pred->i1_mb_partheight;
 1087|       |
 1088|  7.97M|            uc_dx = ps_pred->u1_dydx;
 1089|  7.97M|            uc_dy = uc_dx >> 2;
 1090|  7.97M|            uc_dx &= 0x3;
 1091|  7.97M|            if(u1_dir == 0)
  ------------------
  |  Branch (1091:16): [True: 7.18M, False: 790k]
  ------------------
 1092|  7.18M|            {
 1093|  7.18M|                pu1_dest_y = ps_pred->pu1_rec_y_u;
 1094|  7.18M|                u2_row_buf_wd_y = ps_pred->u2_dst_stride;
 1095|  7.18M|                u2_dst_wd = ps_pred->u2_dst_stride;
 1096|  7.18M|                u2_dest_wd_y = u2_dst_wd;
 1097|  7.18M|                ps_pred_y_forw = ps_pred;
 1098|  7.18M|            }
 1099|   790k|            else
 1100|   790k|            {
 1101|   790k|                pu1_dest_y = pu1_temp_mc_buffer;
 1102|   790k|                u2_dst_wd = MB_SIZE;
  ------------------
  |  |  554|   790k|#define MB_SIZE             16
  ------------------
 1103|   790k|                u2_dest_wd_y = u2_dst_wd;
 1104|   790k|                ps_pred_y_back = ps_pred;
 1105|   790k|                ps_pred_y_back->pu1_rec_y_u = pu1_dest_y;
 1106|   790k|            }
 1107|       |
 1108|       |            /* padding on demand (POD) for y done here */
 1109|       |
 1110|  7.97M|            if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (1110:16): [True: 0, False: 7.97M]
  ------------------
 1111|      0|            {
 1112|      0|                pu1_pred = ps_pred->pu1_pred;
 1113|      0|                pu1_dma_dst = ps_pred->pu1_dma_dest_addr;
 1114|      0|                u1_dma_wd = ps_pred->u1_dma_wd_y;
 1115|      0|                u1_dma_ht = ps_pred->u1_dma_ht_y;
 1116|      0|                u2_frm_wd = ps_dec->u2_frm_wd_y << u1_mb_or_pic_fld;
 1117|      0|                if(ps_pred->i1_pod_ht < 0)
  ------------------
  |  Branch (1117:20): [True: 0, False: 0]
  ------------------
 1118|      0|                {
 1119|      0|                    pu1_dma_dst = pu1_dma_dst - (ps_pred->i1_pod_ht * ps_pred->u2_u1_ref_buf_wd);
 1120|      0|                }
 1121|      0|                ih264d_copy_2d1d(pu1_pred, pu1_dma_dst, u2_frm_wd, u1_dma_wd,
 1122|      0|                                 u1_dma_ht);
 1123|      0|                ih264d_pad_on_demand(ps_pred, LUM_BLK);
  ------------------
  |  |  286|      0|#define LUM_BLK              0
  ------------------
 1124|      0|            }
 1125|  7.97M|            ps_dec->apf_inter_pred_luma[ps_pred->u1_dydx](puc_ref, pu1_dest_y,
 1126|  7.97M|                                                          u2_ref_wd_y,
 1127|  7.97M|                                                          u2_dst_wd,
 1128|  7.97M|                                                          u4_ht_y,
 1129|  7.97M|                                                          u4_wd_y,
 1130|  7.97M|                                                          puc_pred0,
 1131|  7.97M|                                                          ps_pred->u1_dydx);
 1132|  7.97M|            ps_pred++;
 1133|       |
 1134|       |            /* Interpolate samples for the chroma components */
 1135|  7.97M|            {
 1136|  7.97M|                UWORD8 *pu1_ref_u;
 1137|  7.97M|                UWORD32 u1_dma_ht;
 1138|       |
 1139|       |                /* padding on demand (POD) for U and V done here */
 1140|  7.97M|                u1_dma_ht = ps_pred->i1_dma_ht;
 1141|       |
 1142|  7.97M|                if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (1142:20): [True: 0, False: 7.97M]
  ------------------
 1143|      0|                {
 1144|      0|                    pu1_pred = ps_pred->pu1_pred_u;
 1145|      0|                    pu1_dma_dst = ps_pred->pu1_dma_dest_addr;
 1146|      0|                    u1_dma_ht = ps_pred->u1_dma_ht_uv;
 1147|      0|                    u1_dma_wd = ps_pred->u1_dma_wd_uv * YUV420SP_FACTOR;
  ------------------
  |  |  119|      0|#define YUV420SP_FACTOR 2
  ------------------
 1148|      0|                    u2_frm_wd = ps_dec->u2_frm_wd_uv << u1_mb_or_pic_fld;
 1149|      0|                    if(ps_pred->i1_pod_ht < 0)
  ------------------
  |  Branch (1149:24): [True: 0, False: 0]
  ------------------
 1150|      0|                    {
 1151|       |                        /*Top POD*/
 1152|      0|                        pu1_dma_dst -= (ps_pred->i1_pod_ht
 1153|      0|                                        * ps_pred->u2_u1_ref_buf_wd
 1154|      0|                                        * YUV420SP_FACTOR);
  ------------------
  |  |  119|      0|#define YUV420SP_FACTOR 2
  ------------------
 1155|      0|                    }
 1156|       |
 1157|      0|                    ih264d_copy_2d1d(pu1_pred, pu1_dma_dst, u2_frm_wd,
 1158|      0|                                     u1_dma_wd, u1_dma_ht);
 1159|       |
 1160|      0|                    pu1_dma_dst += (ps_pred->i1_dma_ht
 1161|      0|                                    * ps_pred->u2_u1_ref_buf_wd);
 1162|      0|                    pu1_pred = ps_pred->pu1_pred_v;
 1163|       |
 1164|      0|                    ih264d_pad_on_demand(ps_pred, CHROM_BLK);
  ------------------
  |  |  287|      0|#define CHROM_BLK            1
  ------------------
 1165|      0|                }
 1166|       |
 1167|  7.97M|                if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (1167:20): [True: 0, False: 7.97M]
  ------------------
 1168|      0|                {
 1169|      0|                    pu1_ref_u = ps_pred->pu1_dma_dest_addr;
 1170|       |
 1171|      0|                    u2_ref_wd_uv = ps_pred->u2_u1_ref_buf_wd
 1172|      0|                                    * YUV420SP_FACTOR;
  ------------------
  |  |  119|      0|#define YUV420SP_FACTOR 2
  ------------------
 1173|      0|                }
 1174|  7.97M|                else
 1175|  7.97M|                {
 1176|  7.97M|                    u2_ref_wd_uv = ps_pred->u2_frm_wd;
 1177|  7.97M|                    pu1_ref_u = ps_pred->pu1_u_ref;
 1178|       |
 1179|  7.97M|                }
 1180|       |
 1181|  7.97M|                u4_wd_uv = ps_pred->i1_mb_partwidth;
 1182|  7.97M|                u4_ht_uv = ps_pred->i1_mb_partheight;
 1183|  7.97M|                uc_dx = ps_pred->u1_dydx; /* 8*dy + dx */
 1184|  7.97M|                uc_dy = uc_dx >> 3;
 1185|  7.97M|                uc_dx &= 0x7;
 1186|  7.97M|                if(u1_dir == 0)
  ------------------
  |  Branch (1186:20): [True: 7.18M, False: 790k]
  ------------------
 1187|  7.18M|                {
 1188|  7.18M|                    pu1_dest_u = ps_pred->pu1_rec_y_u;
 1189|       |
 1190|  7.18M|                    pu1_dest_v = ps_pred->u1_pi1_wt_ofst_rec_v;
 1191|  7.18M|                    u2_row_buf_wd_uv = ps_pred->u2_dst_stride;
 1192|  7.18M|                    u2_dst_wd = ps_pred->u2_dst_stride;
 1193|  7.18M|                    u2_dest_wd_uv = u2_dst_wd;
 1194|  7.18M|                    ps_pred_cr_forw = ps_pred;
 1195|  7.18M|                }
 1196|   790k|                else
 1197|   790k|                {
 1198|   790k|                    pu1_dest_u = puc_pred0;
 1199|       |
 1200|   790k|                    pu1_dest_v = puc_pred1;
 1201|   790k|                    u2_dest_wd_uv = BUFFER_WIDTH;
  ------------------
  |  |   42|   790k|#define BUFFER_WIDTH        16
  ------------------
 1202|   790k|                    u2_dst_wd = BUFFER_WIDTH;
  ------------------
  |  |   42|   790k|#define BUFFER_WIDTH        16
  ------------------
 1203|   790k|                    ps_pred->pu1_rec_y_u = pu1_dest_u;
 1204|   790k|                    ps_pred->u1_pi1_wt_ofst_rec_v = pu1_dest_v;
 1205|   790k|                }
 1206|       |
 1207|  7.97M|                ps_pred++;
 1208|  7.97M|                ps_dec->pf_inter_pred_chroma(pu1_ref_u, pu1_dest_u,
 1209|  7.97M|                                             u2_ref_wd_uv, u2_dst_wd,
 1210|  7.97M|                                             uc_dx, uc_dy, u4_ht_uv,
 1211|  7.97M|                                             u4_wd_uv);
 1212|       |
 1213|  7.97M|                if(ps_cur_mb_info->u1_Mux == 1)
  ------------------
  |  Branch (1213:20): [True: 6.74k, False: 7.96M]
  ------------------
 1214|  6.74k|                {
 1215|       |                    /******************************************************************/
 1216|       |                    /* padding on demand (POD) for U and V done here                  */
 1217|       |                    /* ps_pred now points to the Y entry of the 0,0 component         */
 1218|       |                    /* Y need not be checked for POD because Y lies within            */
 1219|       |                    /* the picture((0,0) mv for Y doesnot get changed. But (0,0) for  */
 1220|       |                    /* U and V can need POD beacause of cross-field mv adjustments    */
 1221|       |                    /* (Table 8-9 of standard)                                        */
 1222|       |                    /******************************************************************/
 1223|  6.74k|                    if((ps_pred + 1)->i1_pod_ht)
  ------------------
  |  Branch (1223:24): [True: 0, False: 6.74k]
  ------------------
 1224|      0|                    {
 1225|      0|                        pu1_pred = (ps_pred + 1)->pu1_pred_u;
 1226|      0|                        pu1_dma_dst = (ps_pred + 1)->pu1_dma_dest_addr;
 1227|      0|                        u1_dma_ht = (ps_pred + 1)->u1_dma_ht_uv;
 1228|      0|                        u1_dma_wd = (ps_pred + 1)->u1_dma_wd_uv
 1229|      0|                                        * YUV420SP_FACTOR;
  ------------------
  |  |  119|      0|#define YUV420SP_FACTOR 2
  ------------------
 1230|      0|                        u2_frm_wd = ps_dec->u2_frm_wd_uv << u1_mb_or_pic_fld;
 1231|      0|                        if((ps_pred + 1)->i1_pod_ht < 0)
  ------------------
  |  Branch (1231:28): [True: 0, False: 0]
  ------------------
 1232|      0|                        {
 1233|       |                            /*Top POD*/
 1234|      0|                            pu1_dma_dst -= ((ps_pred + 1)->i1_pod_ht
 1235|      0|                                            * (ps_pred + 1)->u2_u1_ref_buf_wd
 1236|      0|                                            * YUV420SP_FACTOR);
  ------------------
  |  |  119|      0|#define YUV420SP_FACTOR 2
  ------------------
 1237|      0|                        }
 1238|      0|                        ih264d_copy_2d1d(pu1_pred, pu1_dma_dst, u2_frm_wd,
 1239|      0|                                         u1_dma_wd, u1_dma_ht);
 1240|      0|                        pu1_dma_dst += ((ps_pred + 1)->i1_dma_ht
 1241|      0|                                        * (ps_pred + 1)->u2_u1_ref_buf_wd); //(u1_dma_ht * u1_dma_wd);//
 1242|      0|                        pu1_pred = (ps_pred + 1)->pu1_pred_v;
 1243|      0|                        ih264d_pad_on_demand(ps_pred + 1, CHROM_BLK);
  ------------------
  |  |  287|      0|#define CHROM_BLK            1
  ------------------
 1244|       |
 1245|      0|                    }
 1246|       |
 1247|  6.74k|                    ih264d_multiplex_ref_data(ps_dec, ps_pred, pu1_dest_y,
 1248|  6.74k|                                              pu1_dest_u, ps_cur_mb_info,
 1249|  6.74k|                                              u2_dest_wd_y, u2_dest_wd_uv,
 1250|  6.74k|                                              u1_dir);
 1251|  6.74k|                    ps_pred += 2;
 1252|  6.74k|                }
 1253|  7.97M|            }
 1254|  7.97M|        }
 1255|  7.18M|        if(u1_dir != 0)
  ------------------
  |  Branch (1255:12): [True: 7.18M, False: 0]
  ------------------
 1256|  7.18M|            u2_ref_wd_y = MB_SIZE;
  ------------------
  |  |  554|  7.18M|#define MB_SIZE             16
  ------------------
 1257|       |
 1258|  7.18M|        u2_num_pels += u4_wd_y * u4_ht_y;
 1259|       |        /* if BI_DIRECT, average the two pred's, and put in ..PredBuffer[0] */
 1260|  7.18M|        if((u1_is_bi_direct != 0) || (ps_pred_y_forw->u1_wght_pred_type != 0))
  ------------------
  |  Branch (1260:12): [True: 790k, False: 6.39M]
  |  Branch (1260:38): [True: 5.38M, False: 1.00M]
  ------------------
 1261|  6.17M|        {
 1262|       |
 1263|  6.17M|            switch(ps_pred_y_forw->u1_wght_pred_type)
  ------------------
  |  Branch (1263:20): [True: 6.17M, False: 0]
  ------------------
 1264|  6.17M|            {
 1265|   292k|                case 0:
  ------------------
  |  Branch (1265:17): [True: 292k, False: 5.88M]
  ------------------
 1266|   292k|                    ps_dec->pf_default_weighted_pred_luma(
 1267|   292k|                                    ps_pred_y_forw->pu1_rec_y_u, pu1_dest_y,
 1268|   292k|                                    ps_pred_y_forw->pu1_rec_y_u,
 1269|   292k|                                    u2_row_buf_wd_y, u2_ref_wd_y,
 1270|   292k|                                    u2_row_buf_wd_y, u4_ht_uv * 2,
 1271|   292k|                                    u4_wd_uv * 2);
 1272|       |
 1273|   292k|                    ps_dec->pf_default_weighted_pred_chroma(
 1274|   292k|                                    ps_pred_cr_forw->pu1_rec_y_u, pu1_dest_u,
 1275|   292k|                                    ps_pred_cr_forw->pu1_rec_y_u,
 1276|   292k|                                    u2_row_buf_wd_uv, u2_dst_wd,
 1277|   292k|                                    u2_row_buf_wd_uv, u4_ht_uv,
 1278|   292k|                                    u4_wd_uv);
 1279|       |
 1280|   292k|                    break;
 1281|  5.38M|                case 1:
  ------------------
  |  Branch (1281:17): [True: 5.38M, False: 790k]
  ------------------
 1282|  5.38M|                {
 1283|  5.38M|                    UWORD32 *pu4_weight_ofst =
 1284|  5.38M|                                    (UWORD32*)ps_pred_y_forw->u1_pi1_wt_ofst_rec_v;
 1285|  5.38M|                    UWORD32 u4_wt_ofst_u, u4_wt_ofst_v;
 1286|  5.38M|                    UWORD32 u4_wt_ofst_y =
 1287|  5.38M|                                    (UWORD32)(pu4_weight_ofst[0]);
 1288|  5.38M|                    WORD32 weight = (WORD16)(u4_wt_ofst_y & 0xffff);
 1289|  5.38M|                    WORD32 ofst = (WORD8)(u4_wt_ofst_y >> 16);
 1290|       |
 1291|  5.38M|                    ps_dec->pf_weighted_pred_luma(ps_pred_y_forw->pu1_rec_y_u,
 1292|  5.38M|                                                  ps_pred_y_forw->pu1_rec_y_u,
 1293|  5.38M|                                                  u2_row_buf_wd_y,
 1294|  5.38M|                                                  u2_row_buf_wd_y,
 1295|  5.38M|                                                  (u2_log2Y_crwd & 0x0ff),
 1296|  5.38M|                                                  weight, ofst, u4_ht_y,
 1297|  5.38M|                                                  u4_wd_y);
 1298|       |
 1299|  5.38M|                    u4_wt_ofst_u = (UWORD32)(pu4_weight_ofst[2]);
 1300|  5.38M|                    u4_wt_ofst_v = (UWORD32)(pu4_weight_ofst[4]);
 1301|  5.38M|                    weight = ((u4_wt_ofst_v & 0xffff) << 16)
 1302|  5.38M|                                    | (u4_wt_ofst_u & 0xffff);
 1303|  5.38M|                    ofst = ((u4_wt_ofst_v >> 16) << 8)
 1304|  5.38M|                                    | ((u4_wt_ofst_u >> 16) & 0xFF);
 1305|       |
 1306|  5.38M|                    ps_dec->pf_weighted_pred_chroma(
 1307|  5.38M|                                    ps_pred_cr_forw->pu1_rec_y_u,
 1308|  5.38M|                                    ps_pred_cr_forw->pu1_rec_y_u,
 1309|  5.38M|                                    u2_row_buf_wd_uv, u2_row_buf_wd_uv,
 1310|  5.38M|                                    (u2_log2Y_crwd >> 8), weight, ofst,
 1311|  5.38M|                                    u4_ht_y >> 1, u4_wd_y >> 1);
 1312|  5.38M|                }
 1313|       |
 1314|  5.38M|                    break;
 1315|   497k|                case 2:
  ------------------
  |  Branch (1315:17): [True: 497k, False: 5.67M]
  ------------------
 1316|   497k|                {
 1317|   497k|                    UWORD32 *pu4_weight_ofst =
 1318|   497k|                                    (UWORD32*)ps_pred_y_forw->u1_pi1_wt_ofst_rec_v;
 1319|   497k|                    UWORD32 u4_wt_ofst_u, u4_wt_ofst_v;
 1320|   497k|                    UWORD32 u4_wt_ofst_y;
 1321|   497k|                    WORD32 weight1, weight2;
 1322|   497k|                    WORD32 ofst1, ofst2;
 1323|       |
 1324|   497k|                    u4_wt_ofst_y = (UWORD32)(pu4_weight_ofst[0]);
 1325|       |
 1326|   497k|                    weight1 = (WORD16)(u4_wt_ofst_y & 0xffff);
 1327|   497k|                    ofst1 = (WORD8)(u4_wt_ofst_y >> 16);
 1328|       |
 1329|   497k|                    u4_wt_ofst_y = (UWORD32)(pu4_weight_ofst[1]);
 1330|   497k|                    weight2 = (WORD16)(u4_wt_ofst_y & 0xffff);
 1331|   497k|                    ofst2 = (WORD8)(u4_wt_ofst_y >> 16);
 1332|       |
 1333|   497k|                    ps_dec->pf_weighted_bi_pred_luma(ps_pred_y_forw->pu1_rec_y_u,
 1334|   497k|                                                     ps_pred_y_back->pu1_rec_y_u,
 1335|   497k|                                                     ps_pred_y_forw->pu1_rec_y_u,
 1336|   497k|                                                     u2_row_buf_wd_y,
 1337|   497k|                                                     u2_ref_wd_y,
 1338|   497k|                                                     u2_row_buf_wd_y,
 1339|   497k|                                                     (u2_log2Y_crwd & 0x0ff),
 1340|   497k|                                                     weight1, weight2, ofst1,
 1341|   497k|                                                     ofst2, u4_ht_y,
 1342|   497k|                                                     u4_wd_y);
 1343|       |
 1344|   497k|                    u4_wt_ofst_u = (UWORD32)(pu4_weight_ofst[2]);
 1345|   497k|                    u4_wt_ofst_v = (UWORD32)(pu4_weight_ofst[4]);
 1346|   497k|                    weight1 = ((u4_wt_ofst_v & 0xffff) << 16)
 1347|   497k|                                    | (u4_wt_ofst_u & 0xffff);
 1348|   497k|                    ofst1 = ((u4_wt_ofst_v >> 16) << 8)
 1349|   497k|                                    | ((u4_wt_ofst_u >> 16) & 0xFF);
 1350|       |
 1351|   497k|                    u4_wt_ofst_u = (UWORD32)(pu4_weight_ofst[3]);
 1352|   497k|                    u4_wt_ofst_v = (UWORD32)(pu4_weight_ofst[5]);
 1353|   497k|                    weight2 = ((u4_wt_ofst_v & 0xffff) << 16)
 1354|   497k|                                    | (u4_wt_ofst_u & 0xffff);
 1355|   497k|                    ofst2 = ((u4_wt_ofst_v >> 16) << 8)
 1356|   497k|                                    | ((u4_wt_ofst_u >> 16) & 0xFF);
 1357|       |
 1358|   497k|                    ps_dec->pf_weighted_bi_pred_chroma(
 1359|   497k|                                    (ps_pred_y_forw + 1)->pu1_rec_y_u,
 1360|   497k|                                    (ps_pred_y_back + 1)->pu1_rec_y_u,
 1361|   497k|                                    (ps_pred_y_forw + 1)->pu1_rec_y_u,
 1362|   497k|                                    u2_row_buf_wd_uv, u2_dst_wd,
 1363|   497k|                                    u2_row_buf_wd_uv, (u2_log2Y_crwd >> 8),
 1364|   497k|                                    weight1, weight2, ofst1, ofst2,
 1365|   497k|                                    u4_ht_y >> 1, u4_wd_y >> 1);
 1366|   497k|                }
 1367|       |
 1368|   497k|                    break;
 1369|  6.17M|            }
 1370|       |
 1371|  6.17M|        }
 1372|  7.18M|    }
 1373|  6.90M|}
ih264d_multiplex_ref_data:
 1397|  6.74k|{
 1398|  6.74k|    UWORD16 u2_mask = ps_cur_mb_info->u2_mask[u1_dir];
 1399|  6.74k|    UWORD8 *pu1_ref_y, *pu1_ref_u;
 1400|  6.74k|    UWORD8 uc_cond, i, j, u1_dydx;
 1401|  6.74k|    UWORD16 u2_ref_wd_y, u2_ref_wd_uv;
 1402|       |
 1403|  6.74k|    PROFILE_DISABLE_INTER_PRED()
  ------------------
  |  |  119|  6.74k|#define PROFILE_DISABLE_INTER_PRED() ;
  ------------------
 1404|       |
 1405|  6.74k|    if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (1405:8): [True: 0, False: 6.74k]
  ------------------
 1406|      0|    {
 1407|      0|        pu1_ref_y = ps_pred->pu1_dma_dest_addr;
 1408|       |
 1409|      0|        u2_ref_wd_y = ps_pred->u2_u1_ref_buf_wd;
 1410|      0|    }
 1411|  6.74k|    else
 1412|  6.74k|    {
 1413|  6.74k|        pu1_ref_y = ps_pred->pu1_y_ref;
 1414|  6.74k|        u2_ref_wd_y = ps_pred->u2_frm_wd;
 1415|  6.74k|    }
 1416|       |
 1417|  6.74k|    ps_pred++;
 1418|  6.74k|    if(ps_pred->i1_pod_ht)
  ------------------
  |  Branch (1418:8): [True: 0, False: 6.74k]
  ------------------
 1419|      0|    {
 1420|      0|        pu1_ref_u = ps_pred->pu1_dma_dest_addr;
 1421|      0|        u2_ref_wd_uv = ps_pred->u2_u1_ref_buf_wd * YUV420SP_FACTOR;
  ------------------
  |  |  119|      0|#define YUV420SP_FACTOR 2
  ------------------
 1422|       |
 1423|      0|    }
 1424|  6.74k|    else
 1425|  6.74k|    {
 1426|  6.74k|        pu1_ref_u = ps_pred->pu1_u_ref;
 1427|  6.74k|        u2_ref_wd_uv = ps_pred->u2_frm_wd;
 1428|       |
 1429|  6.74k|    }
 1430|       |
 1431|  6.74k|    u1_dydx = ps_pred->u1_dydx;
 1432|       |
 1433|  6.74k|    {
 1434|  6.74k|        UWORD8 uc_dx, uc_dy;
 1435|  6.74k|        UWORD8 *pu1_scratch_u;
 1436|       |
 1437|  6.74k|        uc_dx = u1_dydx & 0x3;
 1438|  6.74k|        uc_dy = u1_dydx >> 3;
 1439|  6.74k|        if(u1_dydx != 0)
  ------------------
  |  Branch (1439:12): [True: 0, False: 6.74k]
  ------------------
 1440|      0|        {
 1441|      0|            pred_info_t * ps_prv_pred = ps_pred - 2;
 1442|      0|            pu1_scratch_u = ps_prv_pred->pu1_dma_dest_addr;
 1443|      0|            ps_dec->pf_inter_pred_chroma(pu1_ref_u, pu1_scratch_u,
 1444|      0|                                         u2_ref_wd_uv, 16, uc_dx, uc_dy, 8,
 1445|      0|                                         8);
 1446|       |
 1447|       |            /* Modify ref pointer and refWidth to point to scratch    */
 1448|       |            /* buffer to be used below in ih264d_copy_multiplex_data functions */
 1449|       |            /* CHANGED CODE */
 1450|      0|            pu1_ref_u = pu1_scratch_u;
 1451|      0|            u2_ref_wd_uv = 8 * YUV420SP_FACTOR;
  ------------------
  |  |  119|      0|#define YUV420SP_FACTOR 2
  ------------------
 1452|      0|        }
 1453|  6.74k|    }
 1454|  6.74k|    {
 1455|  33.7k|        for(i = 0; i < 4; i++)
  ------------------
  |  Branch (1455:20): [True: 26.9k, False: 6.74k]
  ------------------
 1456|  26.9k|        {
 1457|   134k|            for(j = 0; j < 4; j++)
  ------------------
  |  Branch (1457:24): [True: 107k, False: 26.9k]
  ------------------
 1458|   107k|            {
 1459|   107k|                uc_cond = u2_mask & 1;
 1460|   107k|                u2_mask >>= 1;
 1461|   107k|                if(uc_cond)
  ------------------
  |  Branch (1461:20): [True: 12.7k, False: 95.2k]
  ------------------
 1462|  12.7k|                {
 1463|  12.7k|                    *(UWORD32 *)(pu1_dest_y + u2_dest_wd_y) =
 1464|  12.7k|                                    *(UWORD32 *)(pu1_ref_y + u2_ref_wd_y);
 1465|  12.7k|                    *(UWORD32 *)(pu1_dest_y + 2 * u2_dest_wd_y) =
 1466|  12.7k|                                    *(UWORD32 *)(pu1_ref_y + 2 * u2_ref_wd_y);
 1467|  12.7k|                    *(UWORD32 *)(pu1_dest_y + 3 * u2_dest_wd_y) =
 1468|  12.7k|                                    *(UWORD32 *)(pu1_ref_y + 3 * u2_ref_wd_y);
 1469|  12.7k|                    {
 1470|  12.7k|                        UWORD32 *dst, *src;
 1471|  12.7k|                        dst = (UWORD32 *)pu1_dest_y;
 1472|  12.7k|                        src = (UWORD32 *)pu1_ref_y;
 1473|  12.7k|                        *dst = *src;
 1474|  12.7k|                        dst++;
 1475|  12.7k|                        src++;
 1476|  12.7k|                        pu1_dest_y = (UWORD8 *)dst;
 1477|  12.7k|                        pu1_ref_y = (UWORD8 *)src;
 1478|  12.7k|                    }
 1479|  12.7k|                    *(UWORD32 *)(pu1_dest_u + u2_dest_wd_uv) =
 1480|  12.7k|                                    *(UWORD32 *)(pu1_ref_u + u2_ref_wd_uv);
 1481|  12.7k|                    {
 1482|  12.7k|                        UWORD32 *dst, *src;
 1483|  12.7k|                        dst = (UWORD32 *)pu1_dest_u;
 1484|  12.7k|                        src = (UWORD32 *)pu1_ref_u;
 1485|  12.7k|                        *dst = *src;
 1486|  12.7k|                        dst++;
 1487|  12.7k|                        src++;
 1488|  12.7k|                        pu1_dest_u = (UWORD8 *)dst;
 1489|  12.7k|                        pu1_ref_u = (UWORD8 *)src;
 1490|  12.7k|                    }
 1491|       |
 1492|  12.7k|                }
 1493|  95.2k|                else
 1494|  95.2k|                {
 1495|  95.2k|                    pu1_dest_y += 4;
 1496|  95.2k|                    pu1_ref_y += 4;
 1497|  95.2k|                    pu1_dest_u += 2 * YUV420SP_FACTOR;
  ------------------
  |  |  119|  95.2k|#define YUV420SP_FACTOR 2
  ------------------
 1498|  95.2k|                    pu1_ref_u += 2 * YUV420SP_FACTOR;
  ------------------
  |  |  119|  95.2k|#define YUV420SP_FACTOR 2
  ------------------
 1499|  95.2k|                }
 1500|   107k|            }
 1501|  26.9k|            pu1_ref_y += 4 * (u2_ref_wd_y - 4);
 1502|  26.9k|            pu1_ref_u += 2 * (u2_ref_wd_uv - 4 * YUV420SP_FACTOR);
  ------------------
  |  |  119|  26.9k|#define YUV420SP_FACTOR 2
  ------------------
 1503|  26.9k|            pu1_dest_y += 4 * (u2_dest_wd_y - 4);
 1504|  26.9k|            pu1_dest_u += 2 * (u2_dest_wd_uv - 4 * YUV420SP_FACTOR);
  ------------------
  |  |  119|  26.9k|#define YUV420SP_FACTOR 2
  ------------------
 1505|  26.9k|        }
 1506|  6.74k|    }
 1507|  6.74k|}

ih264d_transfer_mb_group_data:
 1396|  2.35M|{
 1397|  2.35M|    dec_mb_info_t *ps_cur_mb_info = ps_dec->ps_nmb_info;
 1398|  2.35M|    tfr_ctxt_t *ps_trns_addr = &ps_dec->s_tran_addrecon;
 1399|  2.35M|    UWORD16 u2_mb_y;
 1400|  2.35M|    UWORD32 y_offset;
 1401|  2.35M|    UWORD32 u4_frame_stride;
 1402|  2.35M|    mb_neigbour_params_t *ps_temp;
 1403|  2.35M|    const UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 1404|  2.35M|    UNUSED(u4_end_of_row_next);
  ------------------
  |  |   45|  2.35M|#define UNUSED(x) ((void)(x))
  ------------------
 1405|       |
 1406|  2.35M|    ps_trns_addr->pu1_dest_y += ps_trns_addr->u4_inc_y[u4_end_of_row];
 1407|  2.35M|    ps_trns_addr->pu1_dest_u += ps_trns_addr->u4_inc_uv[u4_end_of_row];
 1408|  2.35M|    ps_trns_addr->pu1_dest_v += ps_trns_addr->u4_inc_uv[u4_end_of_row];
 1409|       |
 1410|       |    /* Swap top and current pointers */
 1411|  2.35M|    if(u4_end_of_row)
  ------------------
  |  Branch (1411:8): [True: 2.31M, False: 43.1k]
  ------------------
 1412|  2.31M|    {
 1413|       |
 1414|  2.31M|        if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1414:12): [True: 1.13M, False: 1.18M]
  ------------------
 1415|  1.13M|        {
 1416|  1.13M|            u2_mb_y = ps_dec->i2_dec_thread_mb_y;
 1417|  1.13M|        }
 1418|  1.18M|        else
 1419|  1.18M|        {
 1420|  1.18M|            ps_temp = ps_dec->ps_cur_mb_row;
 1421|  1.18M|            ps_dec->ps_cur_mb_row = ps_dec->ps_top_mb_row;
 1422|  1.18M|            ps_dec->ps_top_mb_row = ps_temp;
 1423|       |
 1424|  1.18M|            u2_mb_y = ps_dec->u2_mby + (1 + u1_mbaff);
 1425|  1.18M|        }
 1426|       |
 1427|  2.31M|        u4_frame_stride = ps_dec->u2_frm_wd_y
 1428|  2.31M|                        << ps_dec->ps_cur_slice->u1_field_pic_flag;
 1429|  2.31M|        y_offset = (u2_mb_y * u4_frame_stride) << 4;
 1430|  2.31M|        ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1 + y_offset;
 1431|       |
 1432|  2.31M|        u4_frame_stride = ps_dec->u2_frm_wd_uv
 1433|  2.31M|                        << ps_dec->ps_cur_slice->u1_field_pic_flag;
 1434|  2.31M|        y_offset = (u2_mb_y * u4_frame_stride) << 3;
 1435|  2.31M|        ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2 + y_offset;
 1436|  2.31M|        ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3 + y_offset;
 1437|       |
 1438|  2.31M|        ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 1439|  2.31M|        ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 1440|  2.31M|        ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
 1441|  2.31M|    }
 1442|       |
 1443|       |    /*
 1444|       |     * The Slice boundary is also a valid condition to transfer. So recalculate
 1445|       |     * the Left increment, in case the number of MBs is lesser than the
 1446|       |     * N MB value. u4_num_mbs will be equal to N of N MB if the entire N Mb is
 1447|       |     * decoded.
 1448|       |     */
 1449|  2.35M|    ps_dec->s_tran_addrecon.u2_mv_left_inc = ((WORD16)(u4_num_mbs >> u1_mbaff) - 1)
 1450|  2.35M|                    << (4 + u1_mbaff);
 1451|  2.35M|    ps_dec->s_tran_addrecon.u2_mv_top_left_inc = (WORD16)(u4_num_mbs << 2) - 1
 1452|  2.35M|                    - (u1_mbaff << 2);
 1453|       |
 1454|  2.35M|    if(ps_dec->u1_separate_parse == 0)
  ------------------
  |  Branch (1454:8): [True: 1.20M, False: 1.14M]
  ------------------
 1455|  1.20M|    {
 1456|       |        /* reassign left MV and cur MV pointers */
 1457|  1.20M|        ps_dec->ps_mv_left = ps_dec->ps_mv_cur
 1458|  1.20M|                        + ps_dec->s_tran_addrecon.u2_mv_left_inc;
 1459|       |
 1460|  1.20M|        ps_dec->ps_mv_cur += (u4_num_mbs << 4);
 1461|  1.20M|    }
 1462|       |
 1463|       |    /* Increment deblock parameters pointer in external memory */
 1464|       |
 1465|  2.35M|    if(ps_dec->u1_separate_parse == 0)
  ------------------
  |  Branch (1465:8): [True: 1.20M, False: 1.14M]
  ------------------
 1466|  1.20M|    {
 1467|  1.20M|        ps_dec->ps_deblk_mbn += u4_num_mbs;
 1468|  1.20M|    }
 1469|       |
 1470|  2.35M|}

ih264d_get_motion_vector_predictor:
   80|  1.82M|{
   81|  1.82M|    WORD8 c_temp;
   82|  1.82M|    UWORD8 uc_B2 = (u1_B << 1);
   83|       |
   84|       |    /* If only one of the candidate blocks has a reference frame equal to
   85|       |     the current block then use the same block as the final predictor */
   86|  1.82M|    c_temp =
   87|  1.82M|                    (ps_mv_pred[LEFT]->i1_ref_frame[u1_B] == u1_ref_idx)
  ------------------
  |  |  512|  1.82M|#define LEFT  0
  ------------------
   88|  1.82M|                                    | ((ps_mv_pred[TOP]->i1_ref_frame[u1_B]
  ------------------
  |  |  514|  1.82M|#define TOP   1
  ------------------
   89|  1.82M|                                                    == u1_ref_idx) << 1)
   90|  1.82M|                                    | ((ps_mv_pred[TOP_R]->i1_ref_frame[u1_B]
  ------------------
  |  |  516|  1.82M|#define TOP_R 2
  ------------------
   91|  1.82M|                                                    == u1_ref_idx) << 2);
   92|  1.82M|    c_temp = pu1_mv_pred_condition[c_temp];
   93|       |
   94|  1.82M|    if(c_temp != -1)
  ------------------
  |  Branch (94:8): [True: 90.3k, False: 1.73M]
  ------------------
   95|  90.3k|    {
   96|       |        /* Case when only when one of the cadidate block has the same
   97|       |         reference frame as the current block */
   98|  90.3k|        ps_result->i2_mv[uc_B2 + 0] = ps_mv_pred[c_temp]->i2_mv[uc_B2 + 0];
   99|  90.3k|        ps_result->i2_mv[uc_B2 + 1] = ps_mv_pred[c_temp]->i2_mv[uc_B2 + 1];
  100|  90.3k|    }
  101|  1.73M|    else
  102|  1.73M|    {
  103|  1.73M|        WORD32 D0, D1;
  104|  1.73M|        D0 = MIN(ps_mv_pred[0]->i2_mv[uc_B2 + 0],
  ------------------
  |  |   61|  1.73M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 114k, False: 1.62M]
  |  |  ------------------
  ------------------
  105|  1.73M|                 ps_mv_pred[1]->i2_mv[uc_B2 + 0]);
  106|  1.73M|        D1 = MAX(ps_mv_pred[0]->i2_mv[uc_B2 + 0],
  ------------------
  |  |   60|  1.73M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 144k, False: 1.59M]
  |  |  ------------------
  ------------------
  107|  1.73M|                 ps_mv_pred[1]->i2_mv[uc_B2 + 0]);
  108|  1.73M|        D1 = MIN(D1, ps_mv_pred[2]->i2_mv[uc_B2 + 0]);
  ------------------
  |  |   61|  1.73M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 83.9k, False: 1.65M]
  |  |  ------------------
  ------------------
  109|  1.73M|        ps_result->i2_mv[uc_B2 + 0] = (WORD16)(MAX(D0, D1));
  ------------------
  |  |   60|  1.73M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 67.6k, False: 1.67M]
  |  |  ------------------
  ------------------
  110|       |
  111|  1.73M|        D0 = MIN(ps_mv_pred[0]->i2_mv[uc_B2 + 1],
  ------------------
  |  |   61|  1.73M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 89.1k, False: 1.64M]
  |  |  ------------------
  ------------------
  112|  1.73M|                 ps_mv_pred[1]->i2_mv[uc_B2 + 1]);
  113|  1.73M|        D1 = MAX(ps_mv_pred[0]->i2_mv[uc_B2 + 1],
  ------------------
  |  |   60|  1.73M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 124k, False: 1.61M]
  |  |  ------------------
  ------------------
  114|  1.73M|                 ps_mv_pred[1]->i2_mv[uc_B2 + 1]);
  115|  1.73M|        D1 = MIN(D1, ps_mv_pred[2]->i2_mv[uc_B2 + 1]);
  ------------------
  |  |   61|  1.73M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 60.0k, False: 1.67M]
  |  |  ------------------
  ------------------
  116|  1.73M|        ps_result->i2_mv[uc_B2 + 1] = (WORD16)(MAX(D0, D1));
  ------------------
  |  |   60|  1.73M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 54.3k, False: 1.68M]
  |  |  ------------------
  ------------------
  117|       |
  118|  1.73M|    }
  119|  1.82M|}
ih264d_non_mbaff_mv_pred:
  342|  13.6M|{
  343|  13.6M|    UWORD16 u2_b_in = 0, u2_c_in = 0, u2_d_in = 0;
  344|  13.6M|    UWORD32 u4_sub_mb_x = (u4_sub_mb_num & 3), uc_sub_mb_y = (u4_sub_mb_num >> 2);
  345|       |
  346|       |    /* Checking in the subMB exists, calculating their motion vectors to be
  347|       |     used as predictors and the reference frames of those subMBs */
  348|       |
  349|  13.6M|    ps_mv_pred[LEFT] = &ps_dec->s_default_mv_pred;
  ------------------
  |  |  512|  13.6M|#define LEFT  0
  ------------------
  350|  13.6M|    ps_mv_pred[TOP] = &(ps_dec->s_default_mv_pred);
  ------------------
  |  |  514|  13.6M|#define TOP   1
  ------------------
  351|  13.6M|    ps_mv_pred[TOP_R] = &(ps_dec->s_default_mv_pred);
  ------------------
  |  |  516|  13.6M|#define TOP_R 2
  ------------------
  352|       |    /* Check if the left subMb is available */
  353|       |
  354|  13.6M|    if(u4_sub_mb_x)
  ------------------
  |  Branch (354:8): [True: 217k, False: 13.3M]
  ------------------
  355|   217k|    {
  356|   217k|        ps_mv_pred[LEFT] = (ps_mv_nmb - 1);
  ------------------
  |  |  512|   217k|#define LEFT  0
  ------------------
  357|   217k|    }
  358|  13.3M|    else
  359|  13.3M|    {
  360|  13.3M|        if(ps_cur_mb_info->u1_mb_ngbr_availablity & LEFT_MB_AVAILABLE_MASK)
  ------------------
  |  |   53|  13.3M|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  |  Branch (360:12): [True: 11.1M, False: 2.24M]
  ------------------
  361|  11.1M|        {
  362|  11.1M|            ps_mv_pred[LEFT] = (ps_mv_nmb - 13);
  ------------------
  |  |  512|  11.1M|#define LEFT  0
  ------------------
  363|  11.1M|        }
  364|  13.3M|    }
  365|       |
  366|       |    /* Check if the top subMB is available */
  367|  13.6M|    if(uc_sub_mb_y)
  ------------------
  |  Branch (367:8): [True: 231k, False: 13.3M]
  ------------------
  368|   231k|    {
  369|   231k|        u2_b_in = 1;
  370|   231k|        ps_mv_ntop = ps_mv_nmb - 4;
  371|   231k|        ps_mv_pred[TOP] = ps_mv_ntop;
  ------------------
  |  |  514|   231k|#define TOP   1
  ------------------
  372|       |
  373|   231k|    }
  374|  13.3M|    else
  375|  13.3M|    {
  376|  13.3M|        u2_b_in = (ps_cur_mb_info->u1_mb_ngbr_availablity & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   55|  13.3M|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  377|  13.3M|        if(u2_b_in)
  ------------------
  |  Branch (377:12): [True: 12.5M, False: 863k]
  ------------------
  378|  12.5M|        {
  379|  12.5M|            ps_mv_pred[TOP] = ps_mv_ntop;
  ------------------
  |  |  514|  12.5M|#define TOP   1
  ------------------
  380|  12.5M|        }
  381|  13.3M|    }
  382|       |
  383|       |    /* Check if the top right subMb is available. The top right subMb is
  384|       |     defined as the top right subMb at the top right corner of the MB
  385|       |     partition. The top right subMb index starting from the top left
  386|       |     corner of the MB partition is given by
  387|       |     TopRightSubMbIndx = TopLeftSubMbIndx + (WidthOfMbPartition - 6) / 2
  388|       |     */
  389|  13.6M|    u2_c_in = CHECKBIT(ps_cur_mb_info->u2_top_right_avail_mask,
  ------------------
  |  |   54|  13.6M|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
  390|  13.6M|                        (u4_sub_mb_num + uc_mb_part_width - 1));
  391|  13.6M|    if(u2_c_in)
  ------------------
  |  Branch (391:8): [True: 10.5M, False: 3.02M]
  ------------------
  392|  10.5M|    {
  393|  10.5M|        ps_mv_pred[TOP_R] = (ps_mv_ntop + uc_mb_part_width);
  ------------------
  |  |  516|  10.5M|#define TOP_R 2
  ------------------
  394|       |
  395|  10.5M|        if(uc_sub_mb_y == 0)
  ------------------
  |  Branch (395:12): [True: 10.5M, False: 82.6k]
  ------------------
  396|  10.5M|        {
  397|       |            /* CHANGED CODE */
  398|  10.5M|            if((u4_sub_mb_x + uc_mb_part_width) > 3)
  ------------------
  |  Branch (398:16): [True: 10.4M, False: 107k]
  ------------------
  399|  10.4M|                ps_mv_pred[TOP_R] += 12;
  ------------------
  |  |  516|  10.4M|#define TOP_R 2
  ------------------
  400|  10.5M|        }
  401|  10.5M|    }
  402|  3.02M|    else
  403|  3.02M|    {
  404|  3.02M|        u2_d_in = CHECKBIT(ps_cur_mb_info->u2_top_left_avail_mask, u4_sub_mb_num);
  ------------------
  |  |   54|  3.02M|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
  405|       |        /* Check if the the top left subMB is available */
  406|  3.02M|        if(u2_d_in)
  ------------------
  |  Branch (406:12): [True: 2.16M, False: 865k]
  ------------------
  407|  2.16M|        {
  408|       |            /* CHANGED CODE */
  409|  2.16M|            ps_mv_pred[TOP_R] = (ps_mv_ntop - 1);
  ------------------
  |  |  516|  2.16M|#define TOP_R 2
  ------------------
  410|  2.16M|            if(u4_sub_mb_x == 0)
  ------------------
  |  Branch (410:16): [True: 2.07M, False: 90.1k]
  ------------------
  411|  2.07M|            {
  412|  2.07M|                if(uc_sub_mb_y)
  ------------------
  |  Branch (412:20): [True: 62.7k, False: 2.00M]
  ------------------
  413|  62.7k|                {
  414|  62.7k|                    ps_mv_pred[TOP_R] = (ps_mv_nmb - 17);
  ------------------
  |  |  516|  62.7k|#define TOP_R 2
  ------------------
  415|  62.7k|                }
  416|  2.00M|                else
  417|  2.00M|                {
  418|       |                    /* CHANGED CODE */
  419|  2.00M|                    ps_mv_pred[TOP_R] -= 12;
  ------------------
  |  |  516|  2.00M|#define TOP_R 2
  ------------------
  420|  2.00M|                }
  421|  2.07M|            }
  422|  2.16M|        }
  423|   865k|        else if(u2_b_in == 0)
  ------------------
  |  Branch (423:17): [True: 827k, False: 38.6k]
  ------------------
  424|   827k|        {
  425|       |            /* If all the subMBs B, C, D are all out of the frame then their MV
  426|       |             and their reference picture is equal to that of A */
  427|   827k|            ps_mv_pred[TOP] = ps_mv_pred[LEFT];
  ------------------
  |  |  514|   827k|#define TOP   1
  ------------------
                          ps_mv_pred[TOP] = ps_mv_pred[LEFT];
  ------------------
  |  |  512|   827k|#define LEFT  0
  ------------------
  428|   827k|            ps_mv_pred[TOP_R] = ps_mv_pred[LEFT];
  ------------------
  |  |  516|   827k|#define TOP_R 2
  ------------------
                          ps_mv_pred[TOP_R] = ps_mv_pred[LEFT];
  ------------------
  |  |  512|   827k|#define LEFT  0
  ------------------
  429|   827k|        }
  430|  3.02M|    }
  431|  13.6M|}
ih264d_mvpred_nonmbaffB:
  468|  3.34M|{
  469|  3.34M|    UWORD8 u1_a_in, u1_b_in, uc_temp1, uc_temp2, uc_temp3;
  470|  3.34M|    mv_pred_t *ps_mv_pred[3];
  471|  3.34M|    UWORD8 uc_B2, uc_lx, u1_ref_idx;
  472|  3.34M|    UWORD8 u1_direct_zero_pred_flag = 0;
  473|       |
  474|  3.34M|    ih264d_non_mbaff_mv_pred(ps_mv_pred, u4_sub_mb_num, ps_mv_nmb, ps_mv_ntop,
  475|  3.34M|                             ps_dec, uc_mb_part_width, ps_cur_mb_info);
  476|       |
  477|  6.74M|    for(uc_lx = u1_lx_start; uc_lx < u1_lxend; uc_lx++)
  ------------------
  |  Branch (477:30): [True: 3.40M, False: 3.34M]
  ------------------
  478|  3.40M|    {
  479|  3.40M|        u1_ref_idx = ps_mv_final_pred->i1_ref_frame[uc_lx];
  480|  3.40M|        uc_B2 = (uc_lx << 1);
  481|  3.40M|        switch(u1_mb_mc_mode)
  482|  3.40M|        {
  483|   110k|            case PRED_16x8:
  ------------------
  |  |  451|   110k|#define PRED_16x8   1
  ------------------
  |  Branch (483:13): [True: 110k, False: 3.29M]
  ------------------
  484|       |                /* Directional prediction for a 16x8 MB partition */
  485|   110k|                if(u4_sub_mb_num == 0)
  ------------------
  |  Branch (485:20): [True: 44.8k, False: 65.8k]
  ------------------
  486|  44.8k|                {
  487|       |                    /* Calculating the MV pred for the top 16x8 block */
  488|  44.8k|                    if(ps_mv_pred[TOP]->i1_ref_frame[uc_lx] == u1_ref_idx)
  ------------------
  |  |  514|  44.8k|#define TOP   1
  ------------------
  |  Branch (488:24): [True: 21.9k, False: 22.9k]
  ------------------
  489|  21.9k|                    {
  490|       |                        /* If the reference frame used by the top subMB is same as the
  491|       |                         reference frame used by the current block then MV predictor to
  492|       |                         be used for the current block is same as the MV of the top
  493|       |                         subMB */
  494|  21.9k|                        ps_mv_final_pred->i2_mv[uc_B2 + 0] =
  495|  21.9k|                                        ps_mv_pred[TOP]->i2_mv[uc_B2 + 0];
  ------------------
  |  |  514|  21.9k|#define TOP   1
  ------------------
  496|  21.9k|                        ps_mv_final_pred->i2_mv[uc_B2 + 1] =
  497|  21.9k|                                        ps_mv_pred[TOP]->i2_mv[uc_B2 + 1];
  ------------------
  |  |  514|  21.9k|#define TOP   1
  ------------------
  498|  21.9k|                    }
  499|  22.9k|                    else
  500|  22.9k|                    {
  501|       |                        /* The MV predictor is calculated according to the process
  502|       |                         defined in 8.4.1.2.1 */
  503|  22.9k|                        ih264d_get_motion_vector_predictor(
  504|  22.9k|                                        ps_mv_final_pred,
  505|  22.9k|                                        ps_mv_pred,
  506|  22.9k|                                        u1_ref_idx,
  507|  22.9k|                                        uc_lx,
  508|  22.9k|                                        (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  509|  22.9k|                    }
  510|  44.8k|                }
  511|  65.8k|                else
  512|  65.8k|                {
  513|  65.8k|                    if(ps_mv_pred[LEFT]->i1_ref_frame[uc_lx] == u1_ref_idx)
  ------------------
  |  |  512|  65.8k|#define LEFT  0
  ------------------
  |  Branch (513:24): [True: 30.1k, False: 35.7k]
  ------------------
  514|  30.1k|                    {
  515|       |                        /* If the reference frame used by the left subMB is same as the
  516|       |                         reference frame used by the current block then MV predictor to
  517|       |                         be used for the current block is same as the MV of the left
  518|       |                         subMB */
  519|  30.1k|                        ps_mv_final_pred->i2_mv[uc_B2 + 0] =
  520|  30.1k|                                        ps_mv_pred[LEFT]->i2_mv[uc_B2 + 0];
  ------------------
  |  |  512|  30.1k|#define LEFT  0
  ------------------
  521|  30.1k|                        ps_mv_final_pred->i2_mv[uc_B2 + 1] =
  522|  30.1k|                                        ps_mv_pred[LEFT]->i2_mv[uc_B2 + 1];
  ------------------
  |  |  512|  30.1k|#define LEFT  0
  ------------------
  523|  30.1k|                    }
  524|  35.7k|                    else
  525|  35.7k|                    {
  526|       |                        /* The MV predictor is calculated according to the process
  527|       |                         defined in 8.4.1.2.1 */
  528|  35.7k|                        ih264d_get_motion_vector_predictor(
  529|  35.7k|                                        ps_mv_final_pred,
  530|  35.7k|                                        ps_mv_pred,
  531|  35.7k|                                        u1_ref_idx,
  532|  35.7k|                                        uc_lx,
  533|  35.7k|                                        (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  534|  35.7k|                    }
  535|  65.8k|                }
  536|   110k|                break;
  537|  54.2k|            case PRED_8x16:
  ------------------
  |  |  452|  54.2k|#define PRED_8x16   2
  ------------------
  |  Branch (537:13): [True: 54.2k, False: 3.34M]
  ------------------
  538|       |                /* Directional prediction for a 8x16 MB partition */
  539|  54.2k|                if(u4_sub_mb_num == 0)
  ------------------
  |  Branch (539:20): [True: 27.0k, False: 27.2k]
  ------------------
  540|  27.0k|                {
  541|  27.0k|                    if(ps_mv_pred[LEFT]->i1_ref_frame[uc_lx] == u1_ref_idx)
  ------------------
  |  |  512|  27.0k|#define LEFT  0
  ------------------
  |  Branch (541:24): [True: 14.5k, False: 12.4k]
  ------------------
  542|  14.5k|                    {
  543|       |                        /* If the reference frame used by the left subMB is same as the
  544|       |                         reference frame used by the current block then MV predictor to
  545|       |                         be used for the current block is same as the MV of the left
  546|       |                         subMB */
  547|  14.5k|                        ps_mv_final_pred->i2_mv[uc_B2 + 0] =
  548|  14.5k|                                        ps_mv_pred[LEFT]->i2_mv[uc_B2 + 0];
  ------------------
  |  |  512|  14.5k|#define LEFT  0
  ------------------
  549|  14.5k|                        ps_mv_final_pred->i2_mv[uc_B2 + 1] =
  550|  14.5k|                                        ps_mv_pred[LEFT]->i2_mv[uc_B2 + 1];
  ------------------
  |  |  512|  14.5k|#define LEFT  0
  ------------------
  551|  14.5k|                    }
  552|  12.4k|                    else
  553|  12.4k|                    {
  554|       |                        /* The MV predictor is calculated according to the process
  555|       |                         defined in 8.4.1.2.1 */
  556|  12.4k|                        ih264d_get_motion_vector_predictor(
  557|  12.4k|                                        ps_mv_final_pred,
  558|  12.4k|                                        ps_mv_pred,
  559|  12.4k|                                        u1_ref_idx,
  560|  12.4k|                                        uc_lx,
  561|  12.4k|                                        (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  562|  12.4k|                    }
  563|  27.0k|                }
  564|  27.2k|                else
  565|  27.2k|                {
  566|  27.2k|                    if(ps_mv_pred[TOP_R]->i1_ref_frame[uc_lx] == u1_ref_idx)
  ------------------
  |  |  516|  27.2k|#define TOP_R 2
  ------------------
  |  Branch (566:24): [True: 15.9k, False: 11.3k]
  ------------------
  567|  15.9k|                    {
  568|       |                        /* If the reference frame used by the top right subMB is same as
  569|       |                         the reference frame used by the current block then MV
  570|       |                         predictor to be used for the current block is same as the MV
  571|       |                         of the left subMB */
  572|  15.9k|                        ps_mv_final_pred->i2_mv[uc_B2 + 0] =
  573|  15.9k|                                        ps_mv_pred[TOP_R]->i2_mv[uc_B2 + 0];
  ------------------
  |  |  516|  15.9k|#define TOP_R 2
  ------------------
  574|  15.9k|                        ps_mv_final_pred->i2_mv[uc_B2 + 1] =
  575|  15.9k|                                        ps_mv_pred[TOP_R]->i2_mv[uc_B2 + 1];
  ------------------
  |  |  516|  15.9k|#define TOP_R 2
  ------------------
  576|  15.9k|                    }
  577|  11.3k|                    else
  578|  11.3k|                    {
  579|       |                        /* The MV predictor is calculated according to the process
  580|       |                         defined in 8.4.1.2.1 */
  581|  11.3k|                        ih264d_get_motion_vector_predictor(
  582|  11.3k|                                        ps_mv_final_pred,
  583|  11.3k|                                        ps_mv_pred,
  584|  11.3k|                                        u1_ref_idx,
  585|  11.3k|                                        uc_lx,
  586|  11.3k|                                        (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  587|  11.3k|                    }
  588|  27.2k|                }
  589|  54.2k|                break;
  590|   612k|            case B_DIRECT_SPATIAL:
  ------------------
  |  |  489|   612k|#define B_DIRECT_SPATIAL  26
  ------------------
  |  Branch (590:13): [True: 612k, False: 2.78M]
  ------------------
  591|       |                /* Case when the MB has been skipped */
  592|       |                /* If either of left or the top subMB is not present
  593|       |                 OR
  594|       |                 If both the MV components of either the left or the top subMB are
  595|       |                 zero and their reference frame pointer pointing to 0
  596|       |                 then MV for the skipped MB is zero
  597|       |                 else the Median of the mv_pred_t is used */
  598|   612k|                uc_temp1 = (UWORD8)ps_mv_pred[LEFT]->i1_ref_frame[0];
  ------------------
  |  |  512|   612k|#define LEFT  0
  ------------------
  599|   612k|                uc_temp2 = (UWORD8)ps_mv_pred[TOP]->i1_ref_frame[0];
  ------------------
  |  |  514|   612k|#define TOP   1
  ------------------
  600|   612k|                uc_temp3 = (UWORD8)ps_mv_pred[TOP_R]->i1_ref_frame[0];
  ------------------
  |  |  516|   612k|#define TOP_R 2
  ------------------
  601|       |
  602|   612k|                ps_mv_final_pred->i1_ref_frame[0] = MIN(uc_temp1,
  ------------------
  |  |   61|  1.22M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 4.47k, False: 607k]
  |  |  |  Branch (61:24): [True: 6.64k, False: 605k]
  |  |  |  Branch (61:32): [True: 6.62k, False: 601k]
  |  |  ------------------
  ------------------
  603|   612k|                                                      MIN(uc_temp2, uc_temp3));
  604|       |
  605|   612k|                uc_temp1 = (UWORD8)ps_mv_pred[LEFT]->i1_ref_frame[1];
  ------------------
  |  |  512|   612k|#define LEFT  0
  ------------------
  606|   612k|                uc_temp2 = (UWORD8)ps_mv_pred[TOP]->i1_ref_frame[1];
  ------------------
  |  |  514|   612k|#define TOP   1
  ------------------
  607|   612k|                uc_temp3 = (UWORD8)ps_mv_pred[TOP_R]->i1_ref_frame[1];
  ------------------
  |  |  516|   612k|#define TOP_R 2
  ------------------
  608|       |
  609|   612k|                ps_mv_final_pred->i1_ref_frame[1] = MIN(uc_temp1,
  ------------------
  |  |   61|  1.22M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 4.25k, False: 607k]
  |  |  |  Branch (61:24): [True: 8.28k, False: 603k]
  |  |  |  Branch (61:32): [True: 8.27k, False: 599k]
  |  |  ------------------
  ------------------
  610|   612k|                                                      MIN(uc_temp2, uc_temp3));
  611|       |
  612|   612k|                if((ps_mv_final_pred->i1_ref_frame[0] < 0)
  ------------------
  |  Branch (612:20): [True: 68.9k, False: 543k]
  ------------------
  613|  68.9k|                                && (ps_mv_final_pred->i1_ref_frame[1] < 0))
  ------------------
  |  Branch (613:36): [True: 14.5k, False: 54.3k]
  ------------------
  614|  14.5k|                {
  615|  14.5k|                    u1_direct_zero_pred_flag = 1;
  616|  14.5k|                    ps_mv_final_pred->i1_ref_frame[0] = 0;
  617|  14.5k|                    ps_mv_final_pred->i1_ref_frame[1] = 0;
  618|  14.5k|                }
  619|   612k|                ih264d_get_motion_vector_predictor(
  620|   612k|                                ps_mv_final_pred, ps_mv_pred,
  621|   612k|                                ps_mv_final_pred->i1_ref_frame[0], 0,
  622|   612k|                                (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  623|       |
  624|   612k|                ih264d_get_motion_vector_predictor(
  625|   612k|                                ps_mv_final_pred, ps_mv_pred,
  626|   612k|                                ps_mv_final_pred->i1_ref_frame[1], 1,
  627|   612k|                                (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  628|       |
  629|   612k|                break;
  630|  2.40M|            case MB_SKIP:
  ------------------
  |  |  456|  2.40M|#define MB_SKIP     255
  ------------------
  |  Branch (630:13): [True: 2.40M, False: 1.00M]
  ------------------
  631|       |                /* Case when the MB has been skipped */
  632|       |                /* If either of left or the top subMB is not present
  633|       |                 OR
  634|       |                 If both the MV components of either the left or the top subMB are
  635|       |                 zero and their reference frame pointer pointing to 0
  636|       |                 then MV for the skipped MB is zero
  637|       |                 else the Median of the mv_pred_t is used */
  638|  2.40M|                u1_a_in = (ps_cur_mb_info->u1_mb_ngbr_availablity &
  639|  2.40M|                LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   53|  2.40M|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  640|  2.40M|                u1_b_in = (ps_cur_mb_info->u1_mb_ngbr_availablity &
  641|  2.40M|                TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   55|  2.40M|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  642|  2.40M|                if(((u1_a_in * u1_b_in) == 0)
  ------------------
  |  Branch (642:20): [True: 374k, False: 2.02M]
  ------------------
  643|  2.02M|                                || ((ps_mv_pred[LEFT]->i2_mv[0]
  ------------------
  |  |  512|  2.02M|#define LEFT  0
  ------------------
  |  Branch (643:36): [True: 2.02M, False: 804]
  ------------------
  644|  2.02M|                                                | ps_mv_pred[LEFT]->i2_mv[1]
  ------------------
  |  |  512|  2.02M|#define LEFT  0
  ------------------
  645|  2.02M|                                                | ps_mv_pred[LEFT]->i1_ref_frame[0])
  ------------------
  |  |  512|  2.02M|#define LEFT  0
  ------------------
  646|  2.02M|                                                == 0)
  647|    804|                                || ((ps_mv_pred[TOP]->i2_mv[0]
  ------------------
  |  |  514|    804|#define TOP   1
  ------------------
  |  Branch (647:36): [True: 12, False: 792]
  ------------------
  648|    804|                                                | ps_mv_pred[TOP]->i2_mv[1]
  ------------------
  |  |  514|    804|#define TOP   1
  ------------------
  649|    804|                                                | ps_mv_pred[TOP]->i1_ref_frame[0])
  ------------------
  |  |  514|    804|#define TOP   1
  ------------------
  650|    804|                                                == 0))
  651|  2.40M|                {
  652|  2.40M|                    ps_mv_final_pred->i2_mv[0] = 0;
  653|  2.40M|                    ps_mv_final_pred->i2_mv[1] = 0;
  654|  2.40M|                    break;
  655|  2.40M|                }
  656|       |                /* If the condition above is not true calculate the MV predictor
  657|       |                 according to the process defined in sec 8.4.1.2.1 */
  658|   224k|            default:
  ------------------
  |  Branch (658:13): [True: 223k, False: 3.17M]
  ------------------
  659|   224k|                ih264d_get_motion_vector_predictor(
  660|   224k|                                ps_mv_final_pred, ps_mv_pred, u1_ref_idx, uc_lx,
  661|   224k|                                (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  662|   224k|                break;
  663|  3.40M|        }
  664|  3.40M|    }
  665|  3.34M|    return (u1_direct_zero_pred_flag);
  666|  3.34M|}
ih264d_mvpred_nonmbaff:
  703|  10.2M|{
  704|  10.2M|    UWORD8 u1_a_in, u1_b_in, uc_temp1, uc_temp2, uc_temp3;
  705|  10.2M|    mv_pred_t *ps_mv_pred[3];
  706|  10.2M|    UWORD8 u1_ref_idx;
  707|  10.2M|    UWORD8 u1_direct_zero_pred_flag = 0;
  708|  10.2M|    UNUSED(u1_lx_start);
  ------------------
  |  |   45|  10.2M|#define UNUSED(x) ((void)(x))
  ------------------
  709|  10.2M|    UNUSED(u1_lxend);
  ------------------
  |  |   45|  10.2M|#define UNUSED(x) ((void)(x))
  ------------------
  710|  10.2M|    ih264d_non_mbaff_mv_pred(ps_mv_pred, u4_sub_mb_num, ps_mv_nmb, ps_mv_ntop,
  711|  10.2M|                             ps_dec, uc_mb_part_width, ps_cur_mb_info);
  712|       |
  713|  10.2M|    u1_ref_idx = ps_mv_final_pred->i1_ref_frame[0];
  714|       |
  715|  10.2M|    switch(u1_mb_mc_mode)
  716|  10.2M|    {
  717|  57.3k|        case PRED_16x8:
  ------------------
  |  |  451|  57.3k|#define PRED_16x8   1
  ------------------
  |  Branch (717:9): [True: 57.3k, False: 10.2M]
  ------------------
  718|       |            /* Directional prediction for a 16x8 MB partition */
  719|  57.3k|            if(u4_sub_mb_num == 0)
  ------------------
  |  Branch (719:16): [True: 28.6k, False: 28.7k]
  ------------------
  720|  28.6k|            {
  721|       |                /* Calculating the MV pred for the top 16x8 block */
  722|  28.6k|                if(ps_mv_pred[TOP]->i1_ref_frame[0] == u1_ref_idx)
  ------------------
  |  |  514|  28.6k|#define TOP   1
  ------------------
  |  Branch (722:20): [True: 15.7k, False: 12.8k]
  ------------------
  723|  15.7k|                {
  724|       |                    /* If the reference frame used by the top subMB is same as the
  725|       |                     reference frame used by the current block then MV predictor to
  726|       |                     be used for the current block is same as the MV of the top
  727|       |                     subMB */
  728|       |
  729|  15.7k|                    ps_mv_final_pred->i2_mv[0] = ps_mv_pred[TOP]->i2_mv[0];
  ------------------
  |  |  514|  15.7k|#define TOP   1
  ------------------
  730|  15.7k|                    ps_mv_final_pred->i2_mv[1] = ps_mv_pred[TOP]->i2_mv[1];
  ------------------
  |  |  514|  15.7k|#define TOP   1
  ------------------
  731|  15.7k|                }
  732|  12.8k|                else
  733|  12.8k|                {
  734|       |                    /* The MV predictor is calculated according to the process
  735|       |                     defined in 8.4.1.2.1 */
  736|  12.8k|                    ih264d_get_motion_vector_predictor(
  737|  12.8k|                                    ps_mv_final_pred,
  738|  12.8k|                                    ps_mv_pred,
  739|  12.8k|                                    u1_ref_idx,
  740|  12.8k|                                    0,
  741|  12.8k|                                    (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  742|  12.8k|                }
  743|  28.6k|            }
  744|  28.7k|            else
  745|  28.7k|            {
  746|  28.7k|                if(ps_mv_pred[LEFT]->i1_ref_frame[0] == u1_ref_idx)
  ------------------
  |  |  512|  28.7k|#define LEFT  0
  ------------------
  |  Branch (746:20): [True: 11.4k, False: 17.3k]
  ------------------
  747|  11.4k|                {
  748|       |                    /* If the reference frame used by the left subMB is same as the
  749|       |                     reference frame used by the current block then MV predictor to
  750|       |                     be used for the current block is same as the MV of the left
  751|       |                     subMB */
  752|       |
  753|  11.4k|                    ps_mv_final_pred->i2_mv[0] = ps_mv_pred[LEFT]->i2_mv[0];
  ------------------
  |  |  512|  11.4k|#define LEFT  0
  ------------------
  754|  11.4k|                    ps_mv_final_pred->i2_mv[1] = ps_mv_pred[LEFT]->i2_mv[1];
  ------------------
  |  |  512|  11.4k|#define LEFT  0
  ------------------
  755|  11.4k|                }
  756|  17.3k|                else
  757|  17.3k|                {
  758|       |                    /* The MV predictor is calculated according to the process
  759|       |                     defined in 8.4.1.2.1 */
  760|  17.3k|                    ih264d_get_motion_vector_predictor(
  761|  17.3k|                                    ps_mv_final_pred,
  762|  17.3k|                                    ps_mv_pred,
  763|  17.3k|                                    u1_ref_idx,
  764|  17.3k|                                    0,
  765|  17.3k|                                    (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  766|  17.3k|                }
  767|  28.7k|            }
  768|  57.3k|            break;
  769|  53.1k|        case PRED_8x16:
  ------------------
  |  |  452|  53.1k|#define PRED_8x16   2
  ------------------
  |  Branch (769:9): [True: 53.1k, False: 10.2M]
  ------------------
  770|       |            /* Directional prediction for a 8x16 MB partition */
  771|  53.1k|            if(u4_sub_mb_num == 0)
  ------------------
  |  Branch (771:16): [True: 27.7k, False: 25.3k]
  ------------------
  772|  27.7k|            {
  773|  27.7k|                if(ps_mv_pred[LEFT]->i1_ref_frame[0] == u1_ref_idx)
  ------------------
  |  |  512|  27.7k|#define LEFT  0
  ------------------
  |  Branch (773:20): [True: 9.19k, False: 18.5k]
  ------------------
  774|  9.19k|                {
  775|       |                    /* If the reference frame used by the left subMB is same as the
  776|       |                     reference frame used by the current block then MV predictor to
  777|       |                     be used for the current block is same as the MV of the left
  778|       |                     subMB */
  779|       |
  780|  9.19k|                    ps_mv_final_pred->i2_mv[0] = ps_mv_pred[LEFT]->i2_mv[0];
  ------------------
  |  |  512|  9.19k|#define LEFT  0
  ------------------
  781|  9.19k|                    ps_mv_final_pred->i2_mv[1] = ps_mv_pred[LEFT]->i2_mv[1];
  ------------------
  |  |  512|  9.19k|#define LEFT  0
  ------------------
  782|  9.19k|                }
  783|  18.5k|                else
  784|  18.5k|                {
  785|       |                    /* The MV predictor is calculated according to the process
  786|       |                     defined in 8.4.1.2.1 */
  787|  18.5k|                    ih264d_get_motion_vector_predictor(
  788|  18.5k|                                    ps_mv_final_pred,
  789|  18.5k|                                    ps_mv_pred,
  790|  18.5k|                                    u1_ref_idx,
  791|  18.5k|                                    0,
  792|  18.5k|                                    (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  793|  18.5k|                }
  794|  27.7k|            }
  795|  25.3k|            else
  796|  25.3k|            {
  797|  25.3k|                if(ps_mv_pred[TOP_R]->i1_ref_frame[0] == u1_ref_idx)
  ------------------
  |  |  516|  25.3k|#define TOP_R 2
  ------------------
  |  Branch (797:20): [True: 16.2k, False: 9.09k]
  ------------------
  798|  16.2k|                {
  799|       |                    /* If the reference frame used by the top right subMB is same as
  800|       |                     the reference frame used by the current block then MV
  801|       |                     predictor to be used for the current block is same as the MV
  802|       |                     of the left subMB */
  803|       |
  804|  16.2k|                    ps_mv_final_pred->i2_mv[0] = ps_mv_pred[TOP_R]->i2_mv[0];
  ------------------
  |  |  516|  16.2k|#define TOP_R 2
  ------------------
  805|  16.2k|                    ps_mv_final_pred->i2_mv[1] = ps_mv_pred[TOP_R]->i2_mv[1];
  ------------------
  |  |  516|  16.2k|#define TOP_R 2
  ------------------
  806|  16.2k|                }
  807|  9.09k|                else
  808|  9.09k|                {
  809|       |                    /* The MV predictor is calculated according to the process
  810|       |                     defined in 8.4.1.2.1 */
  811|  9.09k|                    ih264d_get_motion_vector_predictor(
  812|  9.09k|                                    ps_mv_final_pred,
  813|  9.09k|                                    ps_mv_pred,
  814|  9.09k|                                    u1_ref_idx,
  815|  9.09k|                                    0,
  816|  9.09k|                                    (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  817|  9.09k|                }
  818|  25.3k|            }
  819|  53.1k|            break;
  820|      0|        case B_DIRECT_SPATIAL:
  ------------------
  |  |  489|      0|#define B_DIRECT_SPATIAL  26
  ------------------
  |  Branch (820:9): [True: 0, False: 10.2M]
  ------------------
  821|       |            /* Case when the MB has been skipped */
  822|       |            /* If either of left or the top subMB is not present
  823|       |             OR
  824|       |             If both the MV components of either the left or the top subMB are
  825|       |             zero and their reference frame pointer pointing to 0
  826|       |             then MV for the skipped MB is zero
  827|       |             else the Median of the mv_pred_t is used */
  828|      0|            uc_temp1 = (UWORD8)ps_mv_pred[LEFT]->i1_ref_frame[0];
  ------------------
  |  |  512|      0|#define LEFT  0
  ------------------
  829|      0|            uc_temp2 = (UWORD8)ps_mv_pred[TOP]->i1_ref_frame[0];
  ------------------
  |  |  514|      0|#define TOP   1
  ------------------
  830|      0|            uc_temp3 = (UWORD8)ps_mv_pred[TOP_R]->i1_ref_frame[0];
  ------------------
  |  |  516|      0|#define TOP_R 2
  ------------------
  831|       |
  832|      0|            ps_mv_final_pred->i1_ref_frame[0] = MIN(uc_temp1,
  ------------------
  |  |   61|      0|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 0, False: 0]
  |  |  |  Branch (61:24): [True: 0, False: 0]
  |  |  |  Branch (61:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  833|      0|                                                  MIN(uc_temp2, uc_temp3));
  834|       |
  835|      0|            uc_temp1 = (UWORD8)ps_mv_pred[LEFT]->i1_ref_frame[1];
  ------------------
  |  |  512|      0|#define LEFT  0
  ------------------
  836|      0|            uc_temp2 = (UWORD8)ps_mv_pred[TOP]->i1_ref_frame[1];
  ------------------
  |  |  514|      0|#define TOP   1
  ------------------
  837|      0|            uc_temp3 = (UWORD8)ps_mv_pred[TOP_R]->i1_ref_frame[1];
  ------------------
  |  |  516|      0|#define TOP_R 2
  ------------------
  838|       |
  839|      0|            ps_mv_final_pred->i1_ref_frame[1] = MIN(uc_temp1,
  ------------------
  |  |   61|      0|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 0, False: 0]
  |  |  |  Branch (61:24): [True: 0, False: 0]
  |  |  |  Branch (61:32): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  840|      0|                                                  MIN(uc_temp2, uc_temp3));
  841|       |
  842|      0|            if((ps_mv_final_pred->i1_ref_frame[0] < 0)
  ------------------
  |  Branch (842:16): [True: 0, False: 0]
  ------------------
  843|      0|                            && (ps_mv_final_pred->i1_ref_frame[1] < 0))
  ------------------
  |  Branch (843:32): [True: 0, False: 0]
  ------------------
  844|      0|            {
  845|      0|                u1_direct_zero_pred_flag = 1;
  846|      0|                ps_mv_final_pred->i1_ref_frame[0] = 0;
  847|      0|                ps_mv_final_pred->i1_ref_frame[1] = 0;
  848|      0|            }
  849|      0|            ih264d_get_motion_vector_predictor(
  850|      0|                            ps_mv_final_pred, ps_mv_pred,
  851|      0|                            ps_mv_final_pred->i1_ref_frame[0], 0,
  852|      0|                            (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  853|       |
  854|      0|            ih264d_get_motion_vector_predictor(
  855|      0|                            ps_mv_final_pred, ps_mv_pred,
  856|      0|                            ps_mv_final_pred->i1_ref_frame[1], 1,
  857|      0|                            (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  858|       |
  859|      0|            break;
  860|  9.94M|        case MB_SKIP:
  ------------------
  |  |  456|  9.94M|#define MB_SKIP     255
  ------------------
  |  Branch (860:9): [True: 9.94M, False: 327k]
  ------------------
  861|       |            /* Case when the MB has been skipped */
  862|       |            /* If either of left or the top subMB is not present
  863|       |             OR
  864|       |             If both the MV components of either the left or the top subMB are
  865|       |             zero and their reference frame pointer pointing to 0
  866|       |             then MV for the skipped MB is zero
  867|       |             else the Median of the mv_pred_t is used */
  868|  9.94M|            u1_a_in = (ps_cur_mb_info->u1_mb_ngbr_availablity &
  869|  9.94M|            LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   53|  9.94M|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  870|  9.94M|            u1_b_in = (ps_cur_mb_info->u1_mb_ngbr_availablity &
  871|  9.94M|            TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   55|  9.94M|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  872|  9.94M|            if(((u1_a_in * u1_b_in) == 0)
  ------------------
  |  Branch (872:16): [True: 2.23M, False: 7.70M]
  ------------------
  873|  7.70M|                            || ((ps_mv_pred[LEFT]->i2_mv[0]
  ------------------
  |  |  512|  7.70M|#define LEFT  0
  ------------------
  |  Branch (873:32): [True: 7.67M, False: 30.2k]
  ------------------
  874|  7.70M|                                            | ps_mv_pred[LEFT]->i2_mv[1]
  ------------------
  |  |  512|  7.70M|#define LEFT  0
  ------------------
  875|  7.70M|                                            | ps_mv_pred[LEFT]->i1_ref_frame[0])
  ------------------
  |  |  512|  7.70M|#define LEFT  0
  ------------------
  876|  7.70M|                                            == 0)
  877|  30.2k|                            || ((ps_mv_pred[TOP]->i2_mv[0]
  ------------------
  |  |  514|  30.2k|#define TOP   1
  ------------------
  |  Branch (877:32): [True: 6.55k, False: 23.6k]
  ------------------
  878|  30.2k|                                            | ps_mv_pred[TOP]->i2_mv[1]
  ------------------
  |  |  514|  30.2k|#define TOP   1
  ------------------
  879|  30.2k|                                            | ps_mv_pred[TOP]->i1_ref_frame[0])
  ------------------
  |  |  514|  30.2k|#define TOP   1
  ------------------
  880|  30.2k|                                            == 0))
  881|  9.92M|            {
  882|       |
  883|  9.92M|                ps_mv_final_pred->i2_mv[0] = 0;
  884|  9.92M|                ps_mv_final_pred->i2_mv[1] = 0;
  885|  9.92M|                break;
  886|  9.92M|            }
  887|       |            /* If the condition above is not true calculate the MV predictor
  888|       |             according to the process defined in sec 8.4.1.2.1 */
  889|   240k|        default:
  ------------------
  |  Branch (889:9): [True: 216k, False: 10.0M]
  ------------------
  890|   240k|            ih264d_get_motion_vector_predictor(
  891|   240k|                            ps_mv_final_pred, ps_mv_pred, u1_ref_idx, 0,
  892|   240k|                            (const UWORD8 *)gau1_ih264d_mv_pred_condition);
  893|   240k|            break;
  894|  10.2M|    }
  895|       |
  896|  10.2M|    return (u1_direct_zero_pred_flag);
  897|  10.2M|}
ih264d_rep_mv_colz:
 1175|  14.4M|{
 1176|       |
 1177|  14.4M|    UWORD8 k, m;
 1178|  14.4M|    UWORD8 *pu1_colz = ps_dec->pu1_col_zero_flag + ps_dec->i4_submb_ofst
 1179|  14.4M|                    + u4_sub_mb_num;
 1180|       |
 1181|  70.8M|    for(k = 0; k < u1_ht; k++)
  ------------------
  |  Branch (1181:16): [True: 56.4M, False: 14.4M]
  ------------------
 1182|  56.4M|    {
 1183|   279M|        for(m = 0; m < u1_wd; m++)
  ------------------
  |  Branch (1183:20): [True: 222M, False: 56.4M]
  ------------------
 1184|   222M|        {
 1185|   222M|            *(ps_mv_pred_dst + m) = *(ps_mv_pred_src);
 1186|   222M|            *(pu1_colz + m) = u1_colz;
 1187|       |
 1188|   222M|        }
 1189|  56.4M|        pu1_colz += SUB_BLK_WIDTH;
  ------------------
  |  |  560|  56.4M|#define SUB_BLK_WIDTH                 4
  ------------------
 1190|  56.4M|        ps_mv_pred_dst += SUB_BLK_WIDTH;
  ------------------
  |  |  560|  56.4M|#define SUB_BLK_WIDTH                 4
  ------------------
 1191|  56.4M|    }
 1192|  14.4M|}

ih264d_parse_bmb_non_direct_cavlc:
   79|  27.2k|{
   80|  27.2k|    dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
   81|  27.2k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   82|  27.2k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
   83|  27.2k|    UWORD8 * pu1_sub_mb_pred_modes = (UWORD8 *)(gau1_ih264d_submb_pred_modes) + 4;
   84|  27.2k|    const UWORD8 (*pu1_mb_pred_modes)[32] =
   85|  27.2k|                    (const UWORD8 (*)[32])gau1_ih264d_mb_pred_modes;
   86|  27.2k|    const UWORD8 * pu1_num_mb_part = (const UWORD8 *)gau1_ih264d_num_mb_part;
   87|  27.2k|    const UWORD8 * pu1_sub_mb_mc_mode = (const UWORD8 *)(gau1_ih264d_submb_mc_mode)
   88|  27.2k|                    + 4;
   89|       |
   90|  27.2k|    parse_pmbarams_t * ps_parse_mb_data = ps_dec->ps_parse_mb_data
   91|  27.2k|                    + u4_num_mbsNby2;
   92|  27.2k|    UWORD8 * pu1_col_info = ps_parse_mb_data->u1_col_info;
   93|  27.2k|    WORD8 (*pi1_ref_idx)[MAX_REFIDX_INFO_PER_MB] = ps_parse_mb_data->i1_ref_idx;
   94|  27.2k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
   95|  27.2k|    UWORD8 u1_mb_mc_mode, u1_num_mb_part, u1_sub_mb = !(u1_mb_type ^ B_8x8);
  ------------------
  |  |  480|  27.2k|#define B_8x8    22
  ------------------
   96|  27.2k|    UWORD32 u4_mb_mc_mode = 0, u4_mb_pred_mode = 0;
   97|  27.2k|    WORD32 ret;
   98|       |
   99|  27.2k|    if(u1_sub_mb)
  ------------------
  |  Branch (99:8): [True: 1.44k, False: 25.8k]
  ------------------
  100|  1.44k|    {
  101|  1.44k|        UWORD8 uc_i;
  102|  1.44k|        u1_mb_mc_mode = 0;
  103|  1.44k|        u1_num_mb_part = 4;
  104|       |        /* Reading the subMB type */
  105|  7.00k|        for(uc_i = 0; uc_i < 4; uc_i++)
  ------------------
  |  Branch (105:23): [True: 5.74k, False: 1.25k]
  ------------------
  106|  5.74k|        {
  107|       |
  108|  5.74k|            UWORD32 ui_sub_mb_mode;
  109|       |
  110|       |//Inlined ih264d_uev
  111|  5.74k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  112|  5.74k|            UWORD32 u4_word, u4_ldz;
  113|       |
  114|       |            /***************************************************************/
  115|       |            /* Find leading zeros in next 32 bits                          */
  116|       |            /***************************************************************/
  117|  5.74k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  5.74k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  5.74k|{                                                                           \
  |  |  152|  5.74k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  5.74k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  5.74k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  5.74k|                                                                            \
  |  |  156|  5.74k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  5.74k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 5.43k, False: 313]
  |  |  ------------------
  |  |  158|  5.74k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  5.43k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  5.74k|}
  ------------------
  118|  5.74k|            u4_ldz = CLZ(u4_word);
  119|       |            /* Flush the ps_bitstrm */
  120|  5.74k|            u4_bitstream_offset += (u4_ldz + 1);
  121|       |            /* Read the suffix from the ps_bitstrm */
  122|  5.74k|            u4_word = 0;
  123|  5.74k|            if(u4_ldz)
  ------------------
  |  Branch (123:16): [True: 2.39k, False: 3.34k]
  ------------------
  124|  2.39k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  2.39k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  2.39k|{                                                                           \
  |  |  122|  2.39k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  2.39k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  2.39k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  2.39k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  2.39k|                                                                            \
  |  |  127|  2.39k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.28k, False: 119]
  |  |  ------------------
  |  |  128|  2.39k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.28k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  2.39k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  2.39k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  2.39k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  2.39k|}                                                                           \
  ------------------
  125|  5.74k|                        u4_ldz);
  126|  5.74k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  127|  5.74k|            ui_sub_mb_mode = ((1 << u4_ldz) + u4_word - 1);
  128|       |//Inlined ih264d_uev
  129|       |
  130|  5.74k|            if(ui_sub_mb_mode > 12)
  ------------------
  |  Branch (130:16): [True: 191, False: 5.55k]
  ------------------
  131|    191|                return ERROR_SUB_MB_TYPE;
  132|  5.55k|            else
  133|  5.55k|            {
  134|  5.55k|                UWORD8 u1_subMbPredMode = pu1_sub_mb_pred_modes[ui_sub_mb_mode];
  135|  5.55k|                u4_mb_mc_mode = (u4_mb_mc_mode << 8)
  136|  5.55k|                                | pu1_sub_mb_mc_mode[ui_sub_mb_mode];
  137|  5.55k|                u4_mb_pred_mode = (u4_mb_pred_mode << 8) | u1_subMbPredMode;
  138|  5.55k|                pi1_ref_idx[0][uc_i] = ((u1_subMbPredMode & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  5.55k|#define PRED_L0   1
  ------------------
  139|  5.55k|                pi1_ref_idx[1][uc_i] = ((u1_subMbPredMode & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  5.55k|#define PRED_L1   2
  ------------------
  140|  5.55k|                COPYTHECONTEXT("sub_mb_type", u1_subMbPredMode);
  141|  5.55k|            }
  142|       |            /* Storing collocated Mb and SubMb mode information */
  143|  5.55k|            *pu1_col_info++ = ((PRED_8x8) << 6)
  ------------------
  |  |  453|  5.55k|#define PRED_8x8    3
  ------------------
  144|  5.55k|                            | ((pu1_sub_mb_mc_mode[ui_sub_mb_mode] << 4));
  145|  5.55k|            if(ui_sub_mb_mode != B_DIRECT_8x8)
  ------------------
  |  |  465|  5.55k|#define B_DIRECT_8x8    0
  ------------------
  |  Branch (145:16): [True: 2.20k, False: 3.34k]
  ------------------
  146|  2.20k|            {
  147|  2.20k|                if(ui_sub_mb_mode > B_BI_8x8)
  ------------------
  |  |  468|  2.20k|#define B_BI_8x8        3
  ------------------
  |  Branch (147:20): [True: 888, False: 1.32k]
  ------------------
  148|    888|                {
  149|    888|                    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  150|    888|                }
  151|  2.20k|            }
  152|  3.34k|            else if(!ps_dec->s_high_profile.u1_direct_8x8_inference_flag)
  ------------------
  |  Branch (152:21): [True: 2.82k, False: 521]
  ------------------
  153|  2.82k|            {
  154|  2.82k|                ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  155|  2.82k|            }
  156|  5.55k|        }
  157|  1.44k|    }
  158|  25.8k|    else
  159|  25.8k|    {
  160|  25.8k|        UWORD8 u1_mb_pred_mode_idx = 5 + u1_mb_type;
  161|  25.8k|        UWORD8 u1_mb_pred_mode_part0 = pu1_mb_pred_modes[0][u1_mb_pred_mode_idx];
  162|  25.8k|        UWORD8 u1_mb_pred_mode_part1 = pu1_mb_pred_modes[1][u1_mb_pred_mode_idx];
  163|  25.8k|        u1_mb_mc_mode = ps_cur_mb_info->u1_mb_mc_mode;
  164|  25.8k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_mc_mode];
  165|       |
  166|  25.8k|        pi1_ref_idx[0][0] = ((u1_mb_pred_mode_part0 & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  25.8k|#define PRED_L0   1
  ------------------
  167|  25.8k|        pi1_ref_idx[1][0] = ((u1_mb_pred_mode_part0 & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  25.8k|#define PRED_L1   2
  ------------------
  168|  25.8k|        pi1_ref_idx[0][1] = ((u1_mb_pred_mode_part1 & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  25.8k|#define PRED_L0   1
  ------------------
  169|  25.8k|        pi1_ref_idx[1][1] = ((u1_mb_pred_mode_part1 & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  25.8k|#define PRED_L1   2
  ------------------
  170|       |
  171|  25.8k|        u4_mb_pred_mode = (u1_mb_pred_mode_part0 << 8) | u1_mb_pred_mode_part1;
  172|  25.8k|        u4_mb_mc_mode = u1_mb_mc_mode | (u1_mb_mc_mode << 8);
  173|  25.8k|        u4_mb_mc_mode <<= 16;
  174|  25.8k|        u4_mb_pred_mode <<= 16;
  175|       |
  176|       |        /* Storing collocated Mb and SubMb mode information */
  177|  25.8k|        *pu1_col_info++ = (u1_mb_mc_mode << 6);
  178|  25.8k|        if(u1_mb_mc_mode)
  ------------------
  |  Branch (178:12): [True: 14.5k, False: 11.2k]
  ------------------
  179|  14.5k|            *pu1_col_info++ = (u1_mb_mc_mode << 6);
  180|  25.8k|    }
  181|       |
  182|  27.0k|    {
  183|  27.0k|        UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  184|  27.0k|        UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  185|  27.0k|        UWORD8 *pu1_num_ref_idx_lx_active =
  186|  27.0k|                        ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active;
  187|  27.0k|        const UWORD8 u1_mbaff_field = (u1_mbaff & uc_field);
  188|  27.0k|        UWORD8 u4_num_ref_idx_lx_active;
  189|       |
  190|  27.0k|        u4_num_ref_idx_lx_active = (pu1_num_ref_idx_lx_active[0]
  191|  27.0k|                        << u1_mbaff_field) - 1;
  192|       |
  193|  27.0k|        if(u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (193:12): [True: 12.0k, False: 15.0k]
  ------------------
  194|  12.0k|        {
  195|  12.0k|            if(1 == u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (195:16): [True: 2.77k, False: 9.27k]
  ------------------
  196|  2.77k|                ih264d_parse_bmb_ref_index_cavlc_range1(
  197|  2.77k|                                u1_num_mb_part, ps_bitstrm, pi1_ref_idx[0],
  198|  2.77k|                                u4_num_ref_idx_lx_active);
  199|  9.27k|            else
  200|  9.27k|            {
  201|  9.27k|                ret = ih264d_parse_bmb_ref_index_cavlc(u1_num_mb_part, ps_bitstrm,
  202|  9.27k|                                                 pi1_ref_idx[0],
  203|  9.27k|                                                 u4_num_ref_idx_lx_active);
  204|  9.27k|                if(ret != OK)
  ------------------
  |  |  114|  9.27k|#define OK        0
  ------------------
  |  Branch (204:20): [True: 271, False: 8.99k]
  ------------------
  205|    271|                    return ret;
  206|  9.27k|            }
  207|  12.0k|        }
  208|       |
  209|  26.8k|        u4_num_ref_idx_lx_active = (pu1_num_ref_idx_lx_active[1]
  210|  26.8k|                        << u1_mbaff_field) - 1;
  211|       |
  212|  26.8k|        if(u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (212:12): [True: 13.7k, False: 13.0k]
  ------------------
  213|  13.7k|        {
  214|  13.7k|            if(1 == u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (214:16): [True: 10.3k, False: 3.46k]
  ------------------
  215|  10.3k|                ih264d_parse_bmb_ref_index_cavlc_range1(
  216|  10.3k|                                u1_num_mb_part, ps_bitstrm, pi1_ref_idx[1],
  217|  10.3k|                                u4_num_ref_idx_lx_active);
  218|  3.46k|            else
  219|  3.46k|            {
  220|  3.46k|                ret = ih264d_parse_bmb_ref_index_cavlc(u1_num_mb_part, ps_bitstrm,
  221|  3.46k|                                                 pi1_ref_idx[1],
  222|  3.46k|                                                 u4_num_ref_idx_lx_active);
  223|  3.46k|                if(ret != OK)
  ------------------
  |  |  114|  3.46k|#define OK        0
  ------------------
  |  Branch (223:20): [True: 290, False: 3.17k]
  ------------------
  224|    290|                    return ret;
  225|  3.46k|            }
  226|  13.7k|        }
  227|  26.8k|    }
  228|       |
  229|       |    /* Read MotionVectors */
  230|  26.5k|    {
  231|  26.5k|        const UWORD8 * pu1_top_left_sub_mb_indx;
  232|       |
  233|  26.5k|        const UWORD8 * pu1_sub_mb_indx_mod =
  234|  26.5k|                        (const UWORD8 *)(gau1_ih264d_submb_indx_mod)
  235|  26.5k|                                        + (u1_sub_mb * 6);
  236|  26.5k|        const UWORD8 * pu1_sub_mb_partw = (const UWORD8 *)gau1_ih264d_submb_partw;
  237|  26.5k|        const UWORD8 * pu1_sub_mb_parth = (const UWORD8 *)gau1_ih264d_submb_parth;
  238|  26.5k|        const UWORD8 * pu1_num_sub_mb_part =
  239|  26.5k|                        (const UWORD8 *)gau1_ih264d_num_submb_part;
  240|  26.5k|        const UWORD8 * pu1_mb_partw = (const UWORD8 *)gau1_ih264d_mb_partw;
  241|  26.5k|        const UWORD8 * pu1_mb_parth = (const UWORD8 *)gau1_ih264d_mb_parth;
  242|  26.5k|        UWORD8 u1_p_idx = 0, u1_num_submb_part, uc_lx;
  243|  26.5k|        parse_part_params_t * ps_part;
  244|  26.5k|        mv_pred_t *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
  245|  26.5k|        UWORD8 u1_mb_part_wd, u1_mb_part_ht;
  246|       |
  247|       |        /* Initialisations */
  248|  26.5k|        ps_part = ps_dec->ps_part;
  249|       |        /* Default Initialization for Non subMb Case Mode */
  250|  26.5k|        u1_mb_part_wd = pu1_mb_partw[u1_mb_mc_mode];
  251|  26.5k|        u1_mb_part_ht = pu1_mb_parth[u1_mb_mc_mode];
  252|  26.5k|        u1_num_submb_part = 1;
  253|       |
  254|       |        /* Decoding the MV for the subMB */
  255|  79.5k|        for(uc_lx = 0; uc_lx < 2; uc_lx++)
  ------------------
  |  Branch (255:24): [True: 53.0k, False: 26.5k]
  ------------------
  256|  53.0k|        {
  257|  53.0k|            UWORD8 u1_sub_mb_num = 0, u1_pred_mode, uc_i;
  258|  53.0k|            UWORD32 u4_mb_mc_mode_tmp = u4_mb_mc_mode;
  259|  53.0k|            UWORD32 u4_mb_pred_mode_tmp = u4_mb_pred_mode;
  260|  53.0k|            UWORD16 u2_sub_mb_num = 0x028A; // for sub mb case
  261|  53.0k|            UWORD8 u1_b2 = uc_lx << 1;
  262|  53.0k|            u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  484|  26.5k|#define PRED_L1   2
  ------------------
                          u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  483|  79.5k|#define PRED_L0   1
  ------------------
  |  Branch (262:28): [True: 26.5k, False: 26.5k]
  ------------------
  263|  53.0k|            pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode << 1);
  264|       |
  265|   141k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (265:27): [True: 88.5k, False: 53.0k]
  ------------------
  266|  88.5k|            {
  267|  88.5k|                UWORD8 u1_mb_mc_mode, uc_j;
  268|  88.5k|                UWORD8 i1_pred = u4_mb_pred_mode_tmp >> 24;
  269|  88.5k|                u1_mb_mc_mode = u4_mb_mc_mode_tmp >> 24;
  270|  88.5k|                u4_mb_pred_mode_tmp <<= 8;
  271|  88.5k|                u4_mb_mc_mode_tmp <<= 8;
  272|       |                /* subMb prediction mode */
  273|  88.5k|                if(u1_sub_mb)
  ------------------
  |  Branch (273:20): [True: 9.36k, False: 79.1k]
  ------------------
  274|  9.36k|                {
  275|       |
  276|  9.36k|                    u1_mb_part_wd = pu1_sub_mb_partw[u1_mb_mc_mode];
  277|  9.36k|                    u1_mb_part_ht = pu1_sub_mb_parth[u1_mb_mc_mode];
  278|  9.36k|                    u1_sub_mb_num = u2_sub_mb_num >> 12;
  279|  9.36k|                    u1_num_submb_part = pu1_num_sub_mb_part[u1_mb_mc_mode];
  280|  9.36k|                    pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod
  281|  9.36k|                                    + (u1_mb_mc_mode << 1);
  282|  9.36k|                    u2_sub_mb_num <<= 4;
  283|  9.36k|                }
  284|   178k|                for(uc_j = 0; uc_j < u1_num_submb_part;
  ------------------
  |  Branch (284:31): [True: 89.8k, False: 88.5k]
  ------------------
  285|  89.8k|                                uc_j++, pu1_top_left_sub_mb_indx++)
  286|  89.8k|                {
  287|  89.8k|                    mv_pred_t * ps_mv;
  288|  89.8k|                    u1_sub_mb_num = u1_sub_mb_num + *pu1_top_left_sub_mb_indx;
  289|  89.8k|                    ps_mv = ps_mv_start + u1_sub_mb_num;
  290|       |
  291|       |                    /* Storing Info for partitions, writing only once */
  292|  89.8k|                    if(uc_lx)
  ------------------
  |  Branch (292:24): [True: 44.9k, False: 44.9k]
  ------------------
  293|  44.9k|                    {
  294|  44.9k|                        ps_part->u1_is_direct = (!i1_pred);
  295|  44.9k|                        ps_part->u1_pred_mode = i1_pred;
  296|  44.9k|                        ps_part->u1_sub_mb_num = u1_sub_mb_num;
  297|  44.9k|                        ps_part->u1_partheight = u1_mb_part_ht;
  298|  44.9k|                        ps_part->u1_partwidth = u1_mb_part_wd;
  299|       |                        /* Increment partition Index */
  300|  44.9k|                        u1_p_idx++;
  301|  44.9k|                        ps_part++;
  302|  44.9k|                    }
  303|       |
  304|  89.8k|                    if(i1_pred & u1_pred_mode)
  ------------------
  |  Branch (304:24): [True: 44.1k, False: 45.7k]
  ------------------
  305|  44.1k|                    {
  306|  44.1k|                        WORD16 i2_mvx, i2_mvy;
  307|       |
  308|       |//inlining ih264d_sev
  309|  44.1k|                        {
  310|  44.1k|                            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  311|  44.1k|                            UWORD32 u4_word, u4_ldz, u4_abs_val;
  312|       |
  313|       |                            /***************************************************************/
  314|       |                            /* Find leading zeros in next 32 bits                          */
  315|       |                            /***************************************************************/
  316|  44.1k|                            NEXTBITS_32(u4_word, u4_bitstream_offset,
  ------------------
  |  |  150|  44.1k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  44.1k|{                                                                           \
  |  |  152|  44.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  44.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  44.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  44.1k|                                                                            \
  |  |  156|  44.1k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  44.1k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 42.0k, False: 2.07k]
  |  |  ------------------
  |  |  158|  44.1k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  42.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  44.1k|}
  ------------------
  317|  44.1k|                                        pu4_bitstrm_buf);
  318|  44.1k|                            u4_ldz = CLZ(u4_word);
  319|       |
  320|       |                            /* Flush the ps_bitstrm */
  321|  44.1k|                            u4_bitstream_offset += (u4_ldz + 1);
  322|       |
  323|       |                            /* Read the suffix from the ps_bitstrm */
  324|  44.1k|                            u4_word = 0;
  325|  44.1k|                            if(u4_ldz)
  ------------------
  |  Branch (325:32): [True: 14.4k, False: 29.7k]
  ------------------
  326|  14.4k|                                GETBITS(u4_word, u4_bitstream_offset,
  ------------------
  |  |  120|  14.4k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  14.4k|{                                                                           \
  |  |  122|  14.4k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  14.4k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  14.4k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  14.4k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  14.4k|                                                                            \
  |  |  127|  14.4k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 13.7k, False: 637]
  |  |  ------------------
  |  |  128|  14.4k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  13.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  14.4k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  14.4k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  14.4k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  14.4k|}                                                                           \
  ------------------
  327|  44.1k|                                        pu4_bitstrm_buf, u4_ldz);
  328|       |
  329|  44.1k|                            *pu4_bitstrm_ofst = u4_bitstream_offset;
  330|  44.1k|                            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  331|       |
  332|  44.1k|                            if(u4_word & 0x1)
  ------------------
  |  Branch (332:32): [True: 7.68k, False: 36.4k]
  ------------------
  333|  7.68k|                                i2_mvx = (-(WORD32)u4_abs_val);
  334|  36.4k|                            else
  335|  36.4k|                                i2_mvx = (u4_abs_val);
  336|  44.1k|                        }
  337|       |//inlinined ih264d_sev
  338|       |
  339|       |//inlining ih264d_sev
  340|  44.1k|                        {
  341|  44.1k|                            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  342|  44.1k|                            UWORD32 u4_word, u4_ldz, u4_abs_val;
  343|       |
  344|       |                            /***************************************************************/
  345|       |                            /* Find leading zeros in next 32 bits                          */
  346|       |                            /***************************************************************/
  347|  44.1k|                            NEXTBITS_32(u4_word, u4_bitstream_offset,
  ------------------
  |  |  150|  44.1k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  44.1k|{                                                                           \
  |  |  152|  44.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  44.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  44.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  44.1k|                                                                            \
  |  |  156|  44.1k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  44.1k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 42.5k, False: 1.66k]
  |  |  ------------------
  |  |  158|  44.1k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  42.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  44.1k|}
  ------------------
  348|  44.1k|                                        pu4_bitstrm_buf);
  349|  44.1k|                            u4_ldz = CLZ(u4_word);
  350|       |
  351|       |                            /* Flush the ps_bitstrm */
  352|  44.1k|                            u4_bitstream_offset += (u4_ldz + 1);
  353|       |
  354|       |                            /* Read the suffix from the ps_bitstrm */
  355|  44.1k|                            u4_word = 0;
  356|  44.1k|                            if(u4_ldz)
  ------------------
  |  Branch (356:32): [True: 21.3k, False: 22.8k]
  ------------------
  357|  21.3k|                                GETBITS(u4_word, u4_bitstream_offset,
  ------------------
  |  |  120|  21.3k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  21.3k|{                                                                           \
  |  |  122|  21.3k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  21.3k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  21.3k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  21.3k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  21.3k|                                                                            \
  |  |  127|  21.3k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 20.6k, False: 666]
  |  |  ------------------
  |  |  128|  21.3k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  20.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  21.3k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  21.3k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  21.3k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  21.3k|}                                                                           \
  ------------------
  358|  44.1k|                                        pu4_bitstrm_buf, u4_ldz);
  359|       |
  360|  44.1k|                            *pu4_bitstrm_ofst = u4_bitstream_offset;
  361|  44.1k|                            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  362|       |
  363|  44.1k|                            if(u4_word & 0x1)
  ------------------
  |  Branch (363:32): [True: 8.49k, False: 35.6k]
  ------------------
  364|  8.49k|                                i2_mvy = (-(WORD32)u4_abs_val);
  365|  35.6k|                            else
  366|  35.6k|                                i2_mvy = (u4_abs_val);
  367|  44.1k|                        }
  368|       |//inlinined ih264d_sev
  369|       |
  370|       |                        /* Storing Mv residuals */
  371|  44.1k|                        ps_mv->i2_mv[u1_b2] = i2_mvx;
  372|  44.1k|                        ps_mv->i2_mv[u1_b2 + 1] = i2_mvy;
  373|  44.1k|                    }
  374|  89.8k|                }
  375|  88.5k|            }
  376|  53.0k|        }
  377|       |        /* write back to the scratch partition info */
  378|  26.5k|        ps_dec->ps_part = ps_part;
  379|  26.5k|        ps_parse_mb_data->u1_num_part = u1_sub_mb ? u1_p_idx : u1_num_mb_part;
  ------------------
  |  Branch (379:41): [True: 1.17k, False: 25.3k]
  ------------------
  380|       |
  381|  26.5k|    }
  382|  26.5k|    return OK;
  ------------------
  |  |  114|  26.5k|#define OK        0
  ------------------
  383|  26.8k|}
ih264d_parse_bmb_non_direct_cabac:
  402|   104k|{
  403|       |    /* Loads from ps_dec */
  404|   104k|    decoding_envirnoment_t * ps_cab_env = &ps_dec->s_cab_dec_env;
  405|   104k|    dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
  406|   104k|    ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
  407|   104k|    parse_pmbarams_t * ps_parse_mb_data = ps_dec->ps_parse_mb_data
  408|   104k|                    + u4_num_mbsNby2;
  409|       |
  410|       |    /* table pointer loads */
  411|   104k|    const UWORD8 * pu1_sub_mb_pred_modes = (UWORD8 *)(gau1_ih264d_submb_pred_modes)
  412|   104k|                    + 4;
  413|   104k|    const UWORD8 (*pu1_mb_pred_modes)[32] =
  414|   104k|                    (const UWORD8 (*)[32])gau1_ih264d_mb_pred_modes;
  415|   104k|    const UWORD8 *pu1_num_mb_part = (const UWORD8 *)gau1_ih264d_num_mb_part;
  416|   104k|    const UWORD8 *pu1_sub_mb_mc_mode = (UWORD8 *)(gau1_ih264d_submb_mc_mode) + 4;
  417|       |
  418|   104k|    const UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  419|   104k|    UWORD8 * pu1_col_info = ps_parse_mb_data->u1_col_info;
  420|   104k|    WORD8 *pi1_ref_idx_l0 = &ps_parse_mb_data->i1_ref_idx[0][0];
  421|   104k|    WORD8 *pi1_ref_idx_l1 = &ps_parse_mb_data->i1_ref_idx[1][0];
  422|   104k|    UWORD8 u1_dec_ref_l0, u1_dec_ref_l1;
  423|       |
  424|   104k|    UWORD8 u1_num_mb_part, u1_mb_mc_mode, u1_sub_mb, u1_mbpred_mode = 5
  425|   104k|                    + u1_mb_type;
  426|   104k|    UWORD32 u4_mb_mc_mode = 0, u4_mb_pred_mode = 0;
  427|   104k|    WORD32 ret;
  428|       |
  429|   104k|    p_curr_ctxt->u1_mb_type = CAB_NON_BD16x16;
  ------------------
  |  |  397|   104k|#define CAB_NON_BD16x16   0x05 /* 0000 0101 */
  ------------------
  430|   104k|    u1_sub_mb = !(u1_mb_type ^ B_8x8);
  ------------------
  |  |  480|   104k|#define B_8x8    22
  ------------------
  431|       |
  432|   104k|    {
  433|   104k|        UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  434|   104k|        UWORD8 *pu1_num_ref_idx_lx_active =
  435|   104k|                        ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active;
  436|   104k|        UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  437|   104k|        UWORD8 u1_mbaff_field = (u1_mbaff & uc_field);
  438|   104k|        u1_dec_ref_l0 = (pu1_num_ref_idx_lx_active[0] << u1_mbaff_field) - 1;
  439|   104k|        u1_dec_ref_l1 = (pu1_num_ref_idx_lx_active[1] << u1_mbaff_field) - 1;
  440|   104k|    }
  441|       |
  442|   104k|    if(u1_sub_mb)
  ------------------
  |  Branch (442:8): [True: 31.1k, False: 73.1k]
  ------------------
  443|  31.1k|    {
  444|  31.1k|        const UWORD8 u1_colz = ((PRED_8x8) << 6);
  ------------------
  |  |  453|  31.1k|#define PRED_8x8    3
  ------------------
  445|  31.1k|        UWORD8 uc_i;
  446|  31.1k|        u1_mb_mc_mode = 0;
  447|  31.1k|        u1_num_mb_part = 4;
  448|       |        /* Reading the subMB type */
  449|   155k|        for(uc_i = 0; uc_i < 4; uc_i++)
  ------------------
  |  Branch (449:23): [True: 124k, False: 31.1k]
  ------------------
  450|   124k|        {
  451|   124k|            UWORD8 u1_sub_mb_mode, u1_subMbPredModes;
  452|   124k|            u1_sub_mb_mode = ih264d_parse_submb_type_cabac(
  453|   124k|                            1, ps_cab_env, ps_bitstrm,
  454|   124k|                            ps_dec->p_sub_mb_type_t);
  455|       |
  456|   124k|            if(u1_sub_mb_mode > 12)
  ------------------
  |  Branch (456:16): [True: 0, False: 124k]
  ------------------
  457|      0|                return ERROR_SUB_MB_TYPE;
  458|       |
  459|   124k|            u1_subMbPredModes = pu1_sub_mb_pred_modes[u1_sub_mb_mode];
  460|   124k|            u4_mb_mc_mode = (u4_mb_mc_mode << 8) | pu1_sub_mb_mc_mode[u1_sub_mb_mode];
  461|   124k|            u4_mb_pred_mode = (u4_mb_pred_mode << 8) | u1_subMbPredModes;
  462|   124k|            *pi1_ref_idx_l0++ =
  463|   124k|                            (u1_subMbPredModes & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|   124k|#define PRED_L0   1
  ------------------
  |  Branch (463:29): [True: 101k, False: 23.2k]
  ------------------
  464|   124k|            *pi1_ref_idx_l1++ =
  465|   124k|                            (u1_subMbPredModes & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|   124k|#define PRED_L1   2
  ------------------
  |  Branch (465:29): [True: 37.9k, False: 86.6k]
  ------------------
  466|   124k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
  467|       |            /* Storing collocated Mb and SubMb mode information */
  468|   124k|            *pu1_col_info++ =
  469|   124k|                            (u1_colz | (pu1_sub_mb_mc_mode[u1_sub_mb_mode] << 4));
  470|   124k|            if(u1_sub_mb_mode != B_DIRECT_8x8)
  ------------------
  |  |  465|   124k|#define B_DIRECT_8x8    0
  ------------------
  |  Branch (470:16): [True: 112k, False: 11.8k]
  ------------------
  471|   112k|            {
  472|   112k|                if(u1_sub_mb_mode > B_BI_8x8)
  ------------------
  |  |  468|   112k|#define B_BI_8x8        3
  ------------------
  |  Branch (472:20): [True: 10.9k, False: 101k]
  ------------------
  473|  10.9k|                {
  474|  10.9k|                    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  475|  10.9k|                }
  476|   112k|            }
  477|  11.8k|            else if(!ps_dec->s_high_profile.u1_direct_8x8_inference_flag)
  ------------------
  |  Branch (477:21): [True: 11.0k, False: 817]
  ------------------
  478|  11.0k|            {
  479|  11.0k|                ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  480|  11.0k|            }
  481|   124k|        }
  482|  31.1k|        pi1_ref_idx_l0 -= 4;
  483|  31.1k|        pi1_ref_idx_l1 -= 4;
  484|  31.1k|    }
  485|  73.1k|    else
  486|  73.1k|    {
  487|  73.1k|        UWORD8 u1_mb_pred_mode_part0 = pu1_mb_pred_modes[0][u1_mbpred_mode];
  488|  73.1k|        UWORD8 u1_mb_pred_mode_part1 = pu1_mb_pred_modes[1][u1_mbpred_mode];
  489|  73.1k|        u1_mb_mc_mode = ps_cur_mb_info->u1_mb_mc_mode;
  490|  73.1k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_mc_mode];
  491|       |        /* Storing collocated Mb and SubMb mode information */
  492|  73.1k|        *pu1_col_info++ = (u1_mb_mc_mode << 6);
  493|  73.1k|        if(u1_mb_mc_mode)
  ------------------
  |  Branch (493:12): [True: 46.1k, False: 27.0k]
  ------------------
  494|  46.1k|            *pu1_col_info++ = (u1_mb_mc_mode << 6);
  495|  73.1k|        u4_mb_mc_mode = u1_mb_mc_mode | (u1_mb_mc_mode << 8);
  496|  73.1k|        u4_mb_mc_mode <<= 16;
  497|  73.1k|        u4_mb_pred_mode = ((u1_mb_pred_mode_part0 << 8) | u1_mb_pred_mode_part1) << 16;
  498|       |
  499|  73.1k|        *pi1_ref_idx_l0++ = (u1_mb_pred_mode_part0 & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|  73.1k|#define PRED_L0   1
  ------------------
  |  Branch (499:29): [True: 43.8k, False: 29.3k]
  ------------------
  500|  73.1k|        *pi1_ref_idx_l0-- = (u1_mb_pred_mode_part1 & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|  73.1k|#define PRED_L0   1
  ------------------
  |  Branch (500:29): [True: 64.2k, False: 8.91k]
  ------------------
  501|  73.1k|        *pi1_ref_idx_l1++ = (u1_mb_pred_mode_part0 & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|  73.1k|#define PRED_L1   2
  ------------------
  |  Branch (501:29): [True: 39.9k, False: 33.1k]
  ------------------
  502|  73.1k|        *pi1_ref_idx_l1-- = (u1_mb_pred_mode_part1 & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|  73.1k|#define PRED_L1   2
  ------------------
  |  Branch (502:29): [True: 65.3k, False: 7.78k]
  ------------------
  503|  73.1k|    }
  504|   104k|    {
  505|   104k|        WORD8 *pi1_lft_cxt = ps_dec->pi1_left_ref_idx_ctxt_inc;
  506|   104k|        WORD8 *pi1_top_cxt = p_curr_ctxt->i1_ref_idx;
  507|       |
  508|   104k|        ret = ih264d_parse_ref_idx_cabac(u1_num_mb_part, 0, u1_dec_ref_l0,
  509|   104k|                                   u1_mb_mc_mode, pi1_ref_idx_l0, pi1_lft_cxt,
  510|   104k|                                   pi1_top_cxt, ps_cab_env, ps_bitstrm,
  511|   104k|                                   ps_dec->p_ref_idx_t);
  512|   104k|        if(ret != OK)
  ------------------
  |  |  114|   104k|#define OK        0
  ------------------
  |  Branch (512:12): [True: 171, False: 104k]
  ------------------
  513|    171|            return ret;
  514|       |
  515|   104k|        ret = ih264d_parse_ref_idx_cabac(u1_num_mb_part, 2, u1_dec_ref_l1,
  516|   104k|                                   u1_mb_mc_mode, pi1_ref_idx_l1, pi1_lft_cxt,
  517|   104k|                                   pi1_top_cxt, ps_cab_env, ps_bitstrm,
  518|   104k|                                   ps_dec->p_ref_idx_t);
  519|   104k|        if(ret != OK)
  ------------------
  |  |  114|   104k|#define OK        0
  ------------------
  |  Branch (519:12): [True: 181, False: 103k]
  ------------------
  520|    181|            return ret;
  521|   104k|    }
  522|       |    /* Read MotionVectors */
  523|   103k|    {
  524|   103k|        const UWORD8 *pu1_top_left_sub_mb_indx;
  525|   103k|        UWORD8 uc_j, uc_lx;
  526|   103k|        UWORD8 u1_mb_part_wd, u1_mb_part_ht;
  527|       |
  528|   103k|        const UWORD8 *pu1_sub_mb_indx_mod =
  529|   103k|                        (const UWORD8 *)gau1_ih264d_submb_indx_mod
  530|   103k|                                        + (u1_sub_mb * 6);
  531|   103k|        const UWORD8 *pu1_sub_mb_partw = (const UWORD8 *)gau1_ih264d_submb_partw;
  532|   103k|        const UWORD8 *pu1_sub_mb_parth = (const UWORD8 *)gau1_ih264d_submb_parth;
  533|   103k|        const UWORD8 *pu1_num_sub_mb_part =
  534|   103k|                        (const UWORD8 *)gau1_ih264d_num_submb_part;
  535|   103k|        const UWORD8 *pu1_mb_partw = (const UWORD8 *)gau1_ih264d_mb_partw;
  536|   103k|        const UWORD8 *pu1_mb_parth = (const UWORD8 *)gau1_ih264d_mb_parth;
  537|       |
  538|   103k|        UWORD8 u1_p_idx = 0;
  539|   103k|        UWORD8 u1_num_submb_part;
  540|   103k|        parse_part_params_t *ps_part;
  541|       |        /* Initialisations */
  542|   103k|        mv_pred_t *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
  543|   103k|        ps_part = ps_dec->ps_part;
  544|       |
  545|       |        /* Default initialization for non subMb case */
  546|   103k|        u1_mb_part_wd = pu1_mb_partw[u1_mb_mc_mode];
  547|   103k|        u1_mb_part_ht = pu1_mb_parth[u1_mb_mc_mode];
  548|   103k|        u1_num_submb_part = 1;
  549|       |
  550|       |        /* Decoding the MV for the subMB */
  551|   311k|        for(uc_lx = 0; uc_lx < 2; uc_lx++)
  ------------------
  |  Branch (551:24): [True: 207k, False: 103k]
  ------------------
  552|   207k|        {
  553|   207k|            UWORD32 u4_sub_mb_num = 0;
  554|   207k|            UWORD32 u4_mb_pred_mode_tmp = u4_mb_pred_mode;
  555|   207k|            UWORD32 u4_mb_mc_mode_tmp = u4_mb_mc_mode;
  556|   207k|            UWORD8 u1_mb_mc_mode_1, u1_pred_mode, uc_i;
  557|   207k|            UWORD16 u2_sub_mb_num = 0x028A;
  558|   207k|            UWORD8 u1_b2 = uc_lx << 1;
  559|   207k|            u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  484|   103k|#define PRED_L1   2
  ------------------
                          u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  483|   311k|#define PRED_L0   1
  ------------------
  |  Branch (559:28): [True: 103k, False: 103k]
  ------------------
  560|       |            /* Default for Cabac */
  561|   207k|            pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode << 1);
  562|   694k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (562:27): [True: 486k, False: 207k]
  ------------------
  563|   486k|            {
  564|       |
  565|   486k|                WORD8 i1_pred = (UWORD8)(u4_mb_pred_mode_tmp >> 24);
  566|   486k|                u1_mb_mc_mode_1 = (UWORD8)(u4_mb_mc_mode_tmp >> 24);
  567|   486k|                u4_mb_pred_mode_tmp <<= 8;
  568|   486k|                u4_mb_mc_mode_tmp <<= 8;
  569|       |
  570|       |                /* subMb prediction mode */
  571|   486k|                if(u1_sub_mb)
  ------------------
  |  Branch (571:20): [True: 249k, False: 237k]
  ------------------
  572|   249k|                {
  573|   249k|                    u1_mb_part_wd = pu1_sub_mb_partw[u1_mb_mc_mode_1];
  574|   249k|                    u1_mb_part_ht = pu1_sub_mb_parth[u1_mb_mc_mode_1];
  575|   249k|                    u4_sub_mb_num = u2_sub_mb_num >> 12;
  576|   249k|                    pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode_1 << 1);
  577|   249k|                    u1_num_submb_part = pu1_num_sub_mb_part[u1_mb_mc_mode_1];
  578|   249k|                    u2_sub_mb_num = u2_sub_mb_num << 4;
  579|   249k|                }
  580|       |
  581|  1.00M|                for(uc_j = 0; uc_j < u1_num_submb_part;
  ------------------
  |  Branch (581:31): [True: 514k, False: 486k]
  ------------------
  582|   514k|                                uc_j++, pu1_top_left_sub_mb_indx++)
  583|   514k|                {
  584|   514k|                    mv_pred_t *ps_mv;
  585|   514k|                    u4_sub_mb_num = u4_sub_mb_num + *pu1_top_left_sub_mb_indx;
  586|   514k|                    ps_mv = ps_mv_start + u4_sub_mb_num;
  587|       |
  588|       |                    /* Storing Info for partitions, writing only once */
  589|   514k|                    if(uc_lx)
  ------------------
  |  Branch (589:24): [True: 257k, False: 257k]
  ------------------
  590|   257k|                    {
  591|   257k|                        ps_part->u1_is_direct = (!i1_pred);
  592|   257k|                        ps_part->u1_pred_mode = i1_pred;
  593|   257k|                        ps_part->u1_sub_mb_num = u4_sub_mb_num;
  594|   257k|                        ps_part->u1_partheight = u1_mb_part_ht;
  595|   257k|                        ps_part->u1_partwidth = u1_mb_part_wd;
  596|       |
  597|       |                        /* Increment partition Index */
  598|   257k|                        u1_p_idx++;
  599|   257k|                        ps_part++;
  600|   257k|                    }
  601|       |
  602|   514k|                    ih264d_get_mvd_cabac(u4_sub_mb_num, u1_b2, u1_mb_part_wd,
  603|   514k|                                         u1_mb_part_ht,
  604|   514k|                                         (UWORD8)(i1_pred & u1_pred_mode), ps_dec,
  605|   514k|                                         ps_mv);
  606|   514k|                }
  607|   486k|            }
  608|   207k|        }
  609|       |        /* write back to the scratch partition info */
  610|       |
  611|   103k|        ps_dec->ps_part = ps_part;
  612|   103k|        ps_parse_mb_data->u1_num_part = u1_sub_mb ? u1_p_idx : u1_num_mb_part;
  ------------------
  |  Branch (612:41): [True: 31.1k, False: 72.8k]
  ------------------
  613|       |
  614|   103k|    }
  615|       |
  616|   103k|    return OK;
  ------------------
  |  |  114|   103k|#define OK        0
  ------------------
  617|   104k|}
ih264d_parse_bmb_cabac:
  634|   108k|{
  635|   108k|    UWORD8 u1_cbp;
  636|   108k|    deblk_mb_t * ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u4_mb_num;
  637|   108k|    const UWORD8 *puc_mb_mc_mode = (const UWORD8 *)gau1_ih264d_mb_mc_mode;
  638|   108k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  639|   108k|    ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
  640|       |
  641|   108k|    WORD32 ret;
  642|   108k|    UWORD8 u1_Bdirect_tranform_read = 1;
  643|   108k|    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 1;
  644|       |
  645|   108k|    ps_cur_mb_info->u1_mb_mc_mode = puc_mb_mc_mode[5 + u1_mb_type];
  646|       |
  647|   108k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  648|       |
  649|   108k|    ps_cur_deblk_mb->u1_mb_type |= D_B_SLICE;
  ------------------
  |  |  384|   108k|#define D_B_SLICE         4
  ------------------
  650|   108k|    if(u1_mb_type != B_DIRECT)
  ------------------
  |  |  482|   108k|#define B_DIRECT  0
  ------------------
  |  Branch (650:8): [True: 104k, False: 4.21k]
  ------------------
  651|   104k|    {
  652|   104k|        ret = ih264d_parse_bmb_non_direct_cabac(ps_dec, ps_cur_mb_info, u4_mb_num,
  653|   104k|                                          u4_num_mbsNby2);
  654|   104k|        if(ret != OK)
  ------------------
  |  |  114|   104k|#define OK        0
  ------------------
  |  Branch (654:12): [True: 352, False: 103k]
  ------------------
  655|    352|            return ret;
  656|   104k|    }
  657|  4.21k|    else
  658|  4.21k|    {
  659|       |
  660|       |        /************ STORING PARTITION INFO ***********/
  661|  4.21k|        parse_part_params_t * ps_part_info;
  662|  4.21k|        ps_part_info = ps_dec->ps_part;
  663|  4.21k|        ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  571|  4.21k|#define PART_DIRECT_16x16              2
  ------------------
  664|  4.21k|        ps_part_info->u1_sub_mb_num = 0;
  665|  4.21k|        ps_dec->ps_part++;
  666|  4.21k|        p_curr_ctxt->u1_mb_type = CAB_BD16x16;
  ------------------
  |  |  396|  4.21k|#define CAB_BD16x16       0x04 /* 0000 0100 */
  ------------------
  667|       |
  668|  4.21k|        MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
  ------------------
  |  |  652|  4.21k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  4.21k|{                                                               \
  |  |  654|  4.21k|    memset(pu4_start,value,16);                                 \
  |  |  655|  4.21k|}
  ------------------
  669|  4.21k|        memset(ps_dec->pi1_left_ref_idx_ctxt_inc, 0, 4);
  670|  4.21k|        MEMSET_16BYTES(p_curr_ctxt->u1_mv, 0);
  ------------------
  |  |  652|  4.21k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  4.21k|{                                                               \
  |  |  654|  4.21k|    memset(pu4_start,value,16);                                 \
  |  |  655|  4.21k|}
  ------------------
  671|  4.21k|        memset(p_curr_ctxt->i1_ref_idx, 0, 4);
  672|       |
  673|       |        /* check whether transform8x8 u4_flag to be read or not */
  674|  4.21k|        u1_Bdirect_tranform_read =
  675|  4.21k|                        ps_dec->s_high_profile.u1_direct_8x8_inference_flag;
  676|  4.21k|    }
  677|       |
  678|       |    /* Read the Coded block pattern */
  679|   108k|    u1_cbp = (WORD8)ih264d_parse_ctx_cbp_cabac(ps_dec);
  680|   108k|    p_curr_ctxt->u1_cbp = u1_cbp;
  681|   108k|    ps_cur_mb_info->u1_cbp = u1_cbp;
  682|       |
  683|   108k|    if(u1_cbp > 47)
  ------------------
  |  Branch (683:8): [True: 0, False: 108k]
  ------------------
  684|      0|        return ERROR_CBP;
  685|       |
  686|   108k|    COPYTHECONTEXT("coded_block_pattern", u1_cbp);
  687|       |
  688|   108k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
  689|   108k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  690|       |
  691|   108k|    if((ps_dec->s_high_profile.u1_transform8x8_present) && (u1_cbp & (0xf))
  ------------------
  |  Branch (691:8): [True: 4.52k, False: 103k]
  |  Branch (691:60): [True: 2.55k, False: 1.97k]
  ------------------
  692|  2.55k|                    && (ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag)
  ------------------
  |  Branch (692:24): [True: 2.04k, False: 509]
  ------------------
  693|  2.04k|                    && (u1_Bdirect_tranform_read))
  ------------------
  |  Branch (693:24): [True: 1.95k, False: 90]
  ------------------
  694|  1.95k|    {
  695|  1.95k|        ps_cur_mb_info->u1_tran_form8x8 = ih264d_parse_transform8x8flag_cabac(
  696|  1.95k|                        ps_dec, ps_cur_mb_info);
  697|  1.95k|        COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  698|       |
  699|  1.95k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  700|  1.95k|        p_curr_ctxt->u1_transform8x8_ctxt = ps_cur_mb_info->u1_tran_form8x8;
  701|  1.95k|    }
  702|   106k|    else
  703|   106k|    {
  704|   106k|        p_curr_ctxt->u1_transform8x8_ctxt = 0;
  705|   106k|    }
  706|       |
  707|   108k|    p_curr_ctxt->u1_intra_chroma_pred_mode = 0;
  708|   108k|    p_curr_ctxt->u1_yuv_dc_csbp &= 0xFE;
  709|   108k|    ps_dec->pu1_left_yuv_dc_csbp[0] &= 0x6;
  710|       |
  711|       |    /* Read mb_qp_delta */
  712|   108k|    if(u1_cbp)
  ------------------
  |  Branch (712:8): [True: 28.3k, False: 79.7k]
  ------------------
  713|  28.3k|    {
  714|  28.3k|        WORD8 c_temp;
  715|  28.3k|        ret = ih264d_parse_mb_qp_delta_cabac(ps_dec, &c_temp);
  716|  28.3k|        if(ret != OK)
  ------------------
  |  |  114|  28.3k|#define OK        0
  ------------------
  |  Branch (716:12): [True: 148, False: 28.2k]
  ------------------
  717|    148|            return ret;
  718|  28.2k|        COPYTHECONTEXT("mb_qp_delta", c_temp);
  719|  28.2k|        if(c_temp)
  ------------------
  |  Branch (719:12): [True: 1.91k, False: 26.3k]
  ------------------
  720|  1.91k|        {
  721|  1.91k|            ret = ih264d_update_qp(ps_dec, c_temp);
  722|  1.91k|            if(ret != OK)
  ------------------
  |  |  114|  1.91k|#define OK        0
  ------------------
  |  Branch (722:16): [True: 0, False: 1.91k]
  ------------------
  723|      0|                return ret;
  724|  1.91k|        }
  725|  28.2k|    }
  726|  79.7k|    else
  727|  79.7k|        ps_dec->i1_prev_mb_qp_delta = 0;
  728|       |
  729|   108k|    ih264d_parse_residual4x4_cabac(ps_dec, ps_cur_mb_info, 0);
  730|   108k|    if(EXCEED_OFFSET(ps_dec->ps_bitstrm))
  ------------------
  |  |   93|   108k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 1.57k, False: 106k]
  |  |  ------------------
  ------------------
  731|  1.57k|        return ERROR_EOB_TERMINATE_T;
  732|   106k|    return OK;
  ------------------
  |  |  114|   106k|#define OK        0
  ------------------
  733|   108k|}
ih264d_parse_bmb_cavlc:
  749|  69.5k|{
  750|  69.5k|    UWORD32 u4_cbp;
  751|  69.5k|    deblk_mb_t * ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u4_mb_num;
  752|  69.5k|    dec_bit_stream_t * const ps_bitstrm = ps_dec->ps_bitstrm;
  753|  69.5k|    UWORD32 * pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  754|  69.5k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  755|  69.5k|    const UWORD8 *puc_mb_mc_mode = (const UWORD8 *)gau1_ih264d_mb_mc_mode;
  756|  69.5k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  757|       |
  758|  69.5k|    WORD32 ret;
  759|  69.5k|    UWORD8 u1_Bdirect_tranform_read = 1;
  760|  69.5k|    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 1;
  761|  69.5k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
  762|  69.5k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  763|       |
  764|  69.5k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  765|       |
  766|  69.5k|    ps_cur_mb_info->u1_mb_mc_mode = puc_mb_mc_mode[5 + u1_mb_type];
  767|       |
  768|  69.5k|    ps_cur_deblk_mb->u1_mb_type |= D_B_SLICE;
  ------------------
  |  |  384|  69.5k|#define D_B_SLICE         4
  ------------------
  769|  69.5k|    if(u1_mb_type != B_DIRECT)
  ------------------
  |  |  482|  69.5k|#define B_DIRECT  0
  ------------------
  |  Branch (769:8): [True: 27.2k, False: 42.2k]
  ------------------
  770|  27.2k|    {
  771|  27.2k|        ret = ih264d_parse_bmb_non_direct_cavlc(ps_dec, ps_cur_mb_info, u4_mb_num,
  772|  27.2k|                                          u4_num_mbsNby2);
  773|  27.2k|        if(ret != OK)
  ------------------
  |  |  114|  27.2k|#define OK        0
  ------------------
  |  Branch (773:12): [True: 752, False: 26.5k]
  ------------------
  774|    752|            return ret;
  775|  27.2k|    }
  776|  42.2k|    else
  777|  42.2k|    {
  778|       |        /************ STORING PARTITION INFO ***********/
  779|  42.2k|        parse_part_params_t * ps_part_info;
  780|  42.2k|        ps_part_info = ps_dec->ps_part;
  781|  42.2k|        ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  571|  42.2k|#define PART_DIRECT_16x16              2
  ------------------
  782|  42.2k|        ps_part_info->u1_sub_mb_num = 0;
  783|  42.2k|        ps_dec->ps_part++;
  784|       |        /* check whether transform8x8 u4_flag to be read or not */
  785|  42.2k|        u1_Bdirect_tranform_read =
  786|  42.2k|                        ps_dec->s_high_profile.u1_direct_8x8_inference_flag;
  787|  42.2k|    }
  788|       |
  789|       |    /* Read the Coded block pattern */
  790|  68.7k|    {
  791|  68.7k|        const UWORD8 * puc_CbpInter = gau1_ih264d_cbp_inter;
  792|       |//Inlined ih264d_uev
  793|  68.7k|        UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  794|  68.7k|        UWORD32 u4_word, u4_ldz;
  795|       |
  796|       |        /***************************************************************/
  797|       |        /* Find leading zeros in next 32 bits                          */
  798|       |        /***************************************************************/
  799|  68.7k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  68.7k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  68.7k|{                                                                           \
  |  |  152|  68.7k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  68.7k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  68.7k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  68.7k|                                                                            \
  |  |  156|  68.7k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  68.7k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 66.8k, False: 1.86k]
  |  |  ------------------
  |  |  158|  68.7k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  66.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  68.7k|}
  ------------------
  800|  68.7k|        u4_ldz = CLZ(u4_word);
  801|       |        /* Flush the ps_bitstrm */
  802|  68.7k|        u4_bitstream_offset += (u4_ldz + 1);
  803|       |        /* Read the suffix from the ps_bitstrm */
  804|  68.7k|        u4_word = 0;
  805|  68.7k|        if(u4_ldz)
  ------------------
  |  Branch (805:12): [True: 16.3k, False: 52.3k]
  ------------------
  806|  16.3k|            GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  16.3k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  16.3k|{                                                                           \
  |  |  122|  16.3k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  16.3k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  16.3k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  16.3k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  16.3k|                                                                            \
  |  |  127|  16.3k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 15.5k, False: 777]
  |  |  ------------------
  |  |  128|  16.3k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  15.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  16.3k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  16.3k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  16.3k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  16.3k|}                                                                           \
  ------------------
  807|  68.7k|        *pu4_bitstrm_ofst = u4_bitstream_offset;
  808|  68.7k|        u4_cbp = ((1 << u4_ldz) + u4_word - 1);
  809|       |//Inlined ih264d_uev
  810|  68.7k|        if(u4_cbp > 47)
  ------------------
  |  Branch (810:12): [True: 1.17k, False: 67.5k]
  ------------------
  811|  1.17k|            return ERROR_CBP;
  812|  67.5k|        u4_cbp = puc_CbpInter[u4_cbp];
  813|       |
  814|  67.5k|        if((ps_dec->s_high_profile.u1_transform8x8_present) && (u4_cbp & (0xf))
  ------------------
  |  Branch (814:12): [True: 5.57k, False: 62.0k]
  |  Branch (814:64): [True: 2.12k, False: 3.44k]
  ------------------
  815|  2.12k|                        && (ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag)
  ------------------
  |  Branch (815:28): [True: 1.91k, False: 214]
  ------------------
  816|  1.91k|                        && (u1_Bdirect_tranform_read))
  ------------------
  |  Branch (816:28): [True: 1.57k, False: 341]
  ------------------
  817|  1.57k|        {
  818|  1.57k|            ps_cur_mb_info->u1_tran_form8x8 = ih264d_get_bit_h264(ps_bitstrm);
  819|  1.57k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  820|  1.57k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  821|  1.57k|        }
  822|       |
  823|  67.5k|    }
  824|       |
  825|      0|    COPYTHECONTEXT("coded_block_pattern", u4_cbp);
  826|  67.5k|    ps_cur_mb_info->u1_cbp = u4_cbp;
  827|       |
  828|       |    /* Read mb_qp_delta */
  829|  67.5k|    if(u4_cbp)
  ------------------
  |  Branch (829:8): [True: 15.1k, False: 52.3k]
  ------------------
  830|  15.1k|    {
  831|  15.1k|        WORD32 i_temp;
  832|       |//inlining ih264d_sev
  833|       |
  834|  15.1k|        UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  835|  15.1k|        UWORD32 u4_word, u4_ldz, u4_abs_val;
  836|       |
  837|       |        /***************************************************************/
  838|       |        /* Find leading zeros in next 32 bits                          */
  839|       |        /***************************************************************/
  840|  15.1k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  15.1k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  15.1k|{                                                                           \
  |  |  152|  15.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  15.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  15.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  15.1k|                                                                            \
  |  |  156|  15.1k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  15.1k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 14.4k, False: 727]
  |  |  ------------------
  |  |  158|  15.1k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  14.4k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  15.1k|}
  ------------------
  841|  15.1k|        u4_ldz = CLZ(u4_word);
  842|       |
  843|       |        /* Flush the ps_bitstrm */
  844|  15.1k|        u4_bitstream_offset += (u4_ldz + 1);
  845|       |
  846|       |        /* Read the suffix from the ps_bitstrm */
  847|  15.1k|        u4_word = 0;
  848|  15.1k|        if(u4_ldz)
  ------------------
  |  Branch (848:12): [True: 6.82k, False: 8.35k]
  ------------------
  849|  6.82k|            GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  6.82k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  6.82k|{                                                                           \
  |  |  122|  6.82k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  6.82k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  6.82k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  6.82k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  6.82k|                                                                            \
  |  |  127|  6.82k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 6.28k, False: 547]
  |  |  ------------------
  |  |  128|  6.82k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  6.28k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  6.82k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  6.82k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  6.82k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  6.82k|}                                                                           \
  ------------------
  850|       |
  851|  15.1k|        *pu4_bitstrm_ofst = u4_bitstream_offset;
  852|  15.1k|        u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  853|       |
  854|  15.1k|        if(u4_word & 0x1)
  ------------------
  |  Branch (854:12): [True: 4.07k, False: 11.1k]
  ------------------
  855|  4.07k|            i_temp = (-(WORD32)u4_abs_val);
  856|  11.1k|        else
  857|  11.1k|            i_temp = (u4_abs_val);
  858|       |
  859|  15.1k|        if(i_temp < -26 || i_temp > 25)
  ------------------
  |  Branch (859:12): [True: 132, False: 15.0k]
  |  Branch (859:28): [True: 276, False: 14.7k]
  ------------------
  860|    408|            return ERROR_INV_RANGE_QP_T;
  861|       |//inlinined ih264d_sev
  862|  14.7k|        COPYTHECONTEXT("mb_qp_delta", i_temp);
  863|  14.7k|        if(i_temp)
  ------------------
  |  Branch (863:12): [True: 6.42k, False: 8.35k]
  ------------------
  864|  6.42k|        {
  865|  6.42k|            ret = ih264d_update_qp(ps_dec, (WORD8)i_temp);
  866|  6.42k|            if(ret != OK)
  ------------------
  |  |  114|  6.42k|#define OK        0
  ------------------
  |  Branch (866:16): [True: 0, False: 6.42k]
  ------------------
  867|      0|                return ret;
  868|  6.42k|        }
  869|       |
  870|  14.7k|        ret = ih264d_parse_residual4x4_cavlc(ps_dec, ps_cur_mb_info, 0);
  871|  14.7k|        if(ret != OK)
  ------------------
  |  |  114|  14.7k|#define OK        0
  ------------------
  |  Branch (871:12): [True: 1.11k, False: 13.6k]
  ------------------
  872|  1.11k|            return ret;
  873|  13.6k|        if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|  13.6k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 630, False: 13.0k]
  |  |  ------------------
  ------------------
  874|    630|            return ERROR_EOB_TERMINATE_T;
  875|  13.6k|    }
  876|  52.3k|    else
  877|  52.3k|    {
  878|  52.3k|        ps_dec->i1_prev_mb_qp_delta = 0;
  879|  52.3k|        ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|  52.3k|#define CAVLC  0
  ------------------
  880|  52.3k|    }
  881|       |
  882|  65.4k|    return OK;
  ------------------
  |  |  114|  65.4k|#define OK        0
  ------------------
  883|  67.5k|}
ih264d_mv_pred_ref_tfr_nby2_bmb:
  888|   124k|{
  889|   124k|    parse_pmbarams_t * ps_mb_part_info;
  890|   124k|    parse_part_params_t * ps_part;
  891|   124k|    mv_pred_t *ps_mv_nmb, *ps_mv_nmb_start, *ps_mv_ntop, *ps_mv_ntop_start;
  892|   124k|    pic_buffer_t * ps_ref_frame;
  893|   124k|    UWORD8 u1_direct_mode_width;
  894|   124k|    UWORD32 i;
  895|   124k|    UWORD8 j;
  896|   124k|    dec_mb_info_t * ps_cur_mb_info;
  897|   124k|    const UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  898|   124k|    UWORD8 u1_field;
  899|   124k|    WORD32 ret = 0;
  900|       |
  901|   124k|    ps_dec->i4_submb_ofst -= (WORD32)(u4_num_mbs - u4_mb_idx) << 4;
  902|   124k|    ps_mb_part_info = ps_dec->ps_parse_mb_data;
  903|   124k|    ps_part = ps_dec->ps_parse_part_params;
  904|       |
  905|       |    /* N/2 Mb MvPred and Transfer Setup Loop */
  906|  1.05M|    for(i = u4_mb_idx; i < u4_num_mbs; i++, ps_mb_part_info++)
  ------------------
  |  Branch (906:24): [True: 928k, False: 124k]
  ------------------
  907|   928k|    {
  908|   928k|        UWORD8 u1_colz = 0;
  909|   928k|        ps_dec->i4_submb_ofst += SUB_BLK_SIZE;
  ------------------
  |  |  562|   928k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   928k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   928k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
  910|       |        /* Restore the slice scratch MbX and MbY context */
  911|   928k|        ps_cur_mb_info = ps_dec->ps_nmb_info + i;
  912|       |
  913|       |
  914|   928k|        u1_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  915|       |
  916|   928k|        ps_mv_nmb_start = ps_dec->ps_mv_cur + (i << 4);
  917|   928k|        ps_dec->u2_mbx = ps_cur_mb_info->u2_mbx;
  918|   928k|        ps_dec->u2_mby = ps_cur_mb_info->u2_mby;
  919|   928k|        ps_dec->u1_currB_type = 0;
  920|   928k|        ps_dec->u2_mv_2mb[i & 0x1] = 0;
  921|       |
  922|       |        /* Look for MV Prediction and Reference Transfer in Non-I Mbs */
  923|   928k|        if(!ps_mb_part_info->u4_isI_mb)
  ------------------
  |  Branch (923:12): [True: 927k, False: 1.46k]
  ------------------
  924|   927k|        {
  925|   927k|            UWORD8 u1_blk_no;
  926|   927k|            WORD16 i1_ref_idx, i1_ref_idx1;
  927|   927k|            UWORD8 u1_pred_mode;
  928|   927k|            UWORD8 u1_sub_mb_x, u1_sub_mb_y, u1_sub_mb_num;
  929|   927k|            UWORD8 u1_lx, u1_lx_start, u1_lxend, u1_tmp_lx;
  930|   927k|            UWORD8 u1_num_part, u1_num_ref, u1_wd, u1_ht;
  931|   927k|            UWORD32 *pu4_wt_offst;
  932|   927k|            UWORD8 u1_scale_ref, u4_bot_mb;
  933|   927k|            deblk_mb_t * ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + i;
  934|   927k|            WORD8 (*pi1_ref_idx)[MAX_REFIDX_INFO_PER_MB] =
  935|   927k|                            ps_mb_part_info->i1_ref_idx;
  936|   927k|            WORD8 *pi1_ref_idx0 = pi1_ref_idx[0],
  937|   927k|                            *pi1_ref_idx1 = pi1_ref_idx[1];
  938|   927k|            UWORD32 **ppu4_wt_ofst = ps_mb_part_info->pu4_wt_offst;
  939|       |
  940|       |            /* MB Level initialisations */
  941|   927k|            ps_dec->u4_num_pmbair = i >> u1_mbaff;
  942|   927k|            ps_dec->u4_mb_idx_mv = i;
  943|       |
  944|       |            /* CHANGED CODE */
  945|   927k|            ps_mv_ntop_start = ps_mv_nmb_start
  946|   927k|                            - (ps_dec->u2_frm_wd_in_mbs << (4 + u1_mbaff)) + 12;
  947|       |
  948|   927k|            u1_num_part = ps_mb_part_info->u1_num_part;
  949|   927k|            ps_cur_deblk_mb->u1_mb_type |= (u1_num_part > 1) << 1;
  950|   927k|            u1_direct_mode_width = (1 == ps_mb_part_info->u1_num_part) ? 16 : 8;
  ------------------
  |  Branch (950:36): [True: 837k, False: 89.8k]
  ------------------
  951|       |
  952|       |
  953|   927k|            ps_cur_mb_info->u4_pred_info_pkd_idx = ps_dec->u4_pred_info_pkd_idx;
  954|   927k|            ps_cur_mb_info->u1_num_pred_parts = 0;
  955|       |
  956|       |            /****************************************************/
  957|       |            /* weighted u4_ofst pointer calculations, this loop  */
  958|       |            /* runs maximum 4 times, even in direct cases       */
  959|       |            /****************************************************/
  960|   927k|            u1_scale_ref = u1_mbaff & ps_cur_mb_info->u1_mb_field_decodingflag;
  961|   927k|            u4_bot_mb = 1 - ps_cur_mb_info->u1_topmb;
  962|   927k|            if(ps_dec->ps_cur_pps->u1_wted_bipred_idc)
  ------------------
  |  Branch (962:16): [True: 575k, False: 351k]
  ------------------
  963|   575k|            {
  964|   575k|                u1_num_ref = MIN(u1_num_part, 4);
  ------------------
  |  |   61|   575k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 572k, False: 2.71k]
  |  |  ------------------
  ------------------
  965|   575k|                if(PART_DIRECT_16x16 != ps_part->u1_is_direct)
  ------------------
  |  |  571|   575k|#define PART_DIRECT_16x16              2
  ------------------
  |  Branch (965:20): [True: 27.0k, False: 548k]
  ------------------
  966|  27.0k|                {
  967|  73.7k|                    for(u1_blk_no = 0; u1_blk_no < u1_num_ref; u1_blk_no++)
  ------------------
  |  Branch (967:40): [True: 46.6k, False: 27.0k]
  ------------------
  968|  46.6k|                    {
  969|  46.6k|                        i1_ref_idx = MAX(pi1_ref_idx0[u1_blk_no], 0);
  ------------------
  |  |   60|  46.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 4.66k, False: 41.9k]
  |  |  ------------------
  ------------------
  970|  46.6k|                        if(u1_scale_ref)
  ------------------
  |  Branch (970:28): [True: 0, False: 46.6k]
  ------------------
  971|      0|                            i1_ref_idx >>= 1;
  972|  46.6k|                        i1_ref_idx *=
  973|  46.6k|                                        ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1];
  974|  46.6k|                        if(u1_scale_ref)
  ------------------
  |  Branch (974:28): [True: 0, False: 46.6k]
  ------------------
  975|      0|                            i1_ref_idx +=
  976|      0|                                            (MAX(pi1_ref_idx1[u1_blk_no], 0)
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  977|      0|                                                            >> 1);
  978|  46.6k|                        else
  979|  46.6k|                            i1_ref_idx += MAX(pi1_ref_idx1[u1_blk_no], 0);
  ------------------
  |  |   60|  46.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 2.84k, False: 43.7k]
  |  |  ------------------
  ------------------
  980|  46.6k|                        pu4_wt_offst = (UWORD32*)&ps_dec->pu4_wt_ofsts[2
  981|  46.6k|                                        * X3(i1_ref_idx)];
  ------------------
  |  |   92|  46.6k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  982|       |
  983|  46.6k|                        if(pi1_ref_idx0[u1_blk_no] < 0)
  ------------------
  |  Branch (983:28): [True: 17.7k, False: 28.9k]
  ------------------
  984|  17.7k|                            pu4_wt_offst += 1;
  985|       |
  986|  46.6k|                        ppu4_wt_ofst[u1_blk_no] = pu4_wt_offst;
  987|  46.6k|                        if(u1_scale_ref
  ------------------
  |  Branch (987:28): [True: 0, False: 46.6k]
  ------------------
  988|      0|                                        && (ps_dec->ps_cur_pps->u1_wted_bipred_idc
  ------------------
  |  Branch (988:44): [True: 0, False: 0]
  ------------------
  989|      0|                                                        == 2))
  990|      0|                        {
  991|      0|                            i1_ref_idx = MAX(pi1_ref_idx0[u1_blk_no], 0);
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  992|      0|                            i1_ref_idx *=
  993|      0|                                            (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1]
  994|      0|                                                            << 1);
  995|      0|                            i1_ref_idx += MAX(pi1_ref_idx1[u1_blk_no], 0);
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  996|      0|                            if(u4_bot_mb)
  ------------------
  |  Branch (996:32): [True: 0, False: 0]
  ------------------
  997|      0|                            {
  998|      0|                                i1_ref_idx +=
  999|      0|                                                (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0]
 1000|      0|                                                                << 1)
 1001|      0|                                                                * (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1]
 1002|      0|                                                                                << 1);
 1003|      0|                            }
 1004|      0|                            pu4_wt_offst = (UWORD32*)&ps_dec->pu4_mbaff_wt_mat[2
 1005|      0|                                            * X3(i1_ref_idx)];
  ------------------
  |  |   92|      0|#define X3(a)   (((a) << 1) + (a))
  ------------------
 1006|      0|                            ppu4_wt_ofst[u1_blk_no] = pu4_wt_offst;
 1007|      0|                        }
 1008|  46.6k|                    }
 1009|  27.0k|                }
 1010|   575k|            }
 1011|       |
 1012|       |            /**************************************************/
 1013|       |            /* Loop on Partitions                             */
 1014|       |            /* direct mode is reflected as a single partition */
 1015|       |            /**************************************************/
 1016|  2.02M|            for(j = 0; j < u1_num_part; j++, ps_part++)
  ------------------
  |  Branch (1016:24): [True: 1.09M, False: 927k]
  ------------------
 1017|  1.09M|            {
 1018|  1.09M|                u1_sub_mb_num = ps_part->u1_sub_mb_num;
 1019|  1.09M|                ps_dec->u1_sub_mb_num = u1_sub_mb_num;
 1020|       |
 1021|  1.09M|                if(PART_NOT_DIRECT != ps_part->u1_is_direct)
  ------------------
  |  |  569|  1.09M|#define PART_NOT_DIRECT                0
  ------------------
  |  Branch (1021:20): [True: 815k, False: 277k]
  ------------------
 1022|   815k|                {
 1023|       |                    /**************************************************/
 1024|       |                    /* Direct Mode, Call DecodeSpatial/TemporalDirect */
 1025|       |                    /* only (those will in turn call FormMbPartInfo)  */
 1026|       |                    /**************************************************/
 1027|   815k|                    ret = ps_dec->ps_cur_slice->pf_decodeDirect(ps_dec,
 1028|   815k|                                                                u1_direct_mode_width,
 1029|   815k|                                                                ps_cur_mb_info, i);
 1030|   815k|                    if(ret != OK)
  ------------------
  |  |  114|   815k|#define OK        0
  ------------------
  |  Branch (1030:24): [True: 0, False: 815k]
  ------------------
 1031|      0|                        return ret;
 1032|   815k|                    ps_cur_deblk_mb->u1_mb_type |= (ps_dec->u1_currB_type << 1);
 1033|       |
 1034|   815k|                }
 1035|   277k|                else
 1036|   277k|                {
 1037|   277k|                    mv_pred_t s_mvPred;
 1038|       |                    /**************************************************/
 1039|       |                    /* Non Direct Mode, Call Motion Vector Predictor  */
 1040|       |                    /* and FormMbpartInfo                             */
 1041|       |                    /**************************************************/
 1042|   277k|                    u1_sub_mb_x = u1_sub_mb_num & 0x03;
 1043|   277k|                    u1_sub_mb_y = u1_sub_mb_num >> 2;
 1044|   277k|                    u1_blk_no =
 1045|   277k|                                    (u1_num_part < 4) ?
  ------------------
  |  Branch (1045:37): [True: 152k, False: 124k]
  ------------------
 1046|   152k|                                                    j :
 1047|   277k|                                                    (((u1_sub_mb_y >> 1) << 1)
 1048|   124k|                                                                    + (u1_sub_mb_x
 1049|   124k|                                                                                    >> 1));
 1050|       |
 1051|   277k|                    ps_mv_ntop = ps_mv_ntop_start + u1_sub_mb_x;
 1052|   277k|                    ps_mv_nmb = ps_mv_nmb_start + u1_sub_mb_num;
 1053|       |
 1054|   277k|                    u1_pred_mode = ps_part->u1_pred_mode;
 1055|   277k|                    u1_wd = ps_part->u1_partwidth;
 1056|   277k|                    u1_ht = ps_part->u1_partheight;
 1057|       |
 1058|   277k|                    u1_lx_start = 0;
 1059|   277k|                    u1_lxend = 2;
 1060|   277k|                    if( PRED_L0 == u1_pred_mode)
  ------------------
  |  |  483|   277k|#define PRED_L0   1
  ------------------
  |  Branch (1060:25): [True: 141k, False: 136k]
  ------------------
 1061|   141k|                    {
 1062|   141k|                        s_mvPred.i2_mv[2] = 0;
 1063|   141k|                        s_mvPred.i2_mv[3] = 0;
 1064|   141k|                        u1_lxend = 1;
 1065|   141k|                    }
 1066|   277k|                    if( PRED_L1 == u1_pred_mode)
  ------------------
  |  |  484|   277k|#define PRED_L1   2
  ------------------
  |  Branch (1066:25): [True: 67.3k, False: 210k]
  ------------------
 1067|  67.3k|                    {
 1068|  67.3k|                        s_mvPred.i2_mv[0] = 0;
 1069|  67.3k|                        s_mvPred.i2_mv[1] = 0;
 1070|  67.3k|                        u1_lx_start = 1;
 1071|  67.3k|                    }
 1072|       |
 1073|       |                    /* Populate the colpic info and reference frames */
 1074|   277k|                    s_mvPred.i1_ref_frame[0] = pi1_ref_idx0[u1_blk_no];
 1075|   277k|                    s_mvPred.i1_ref_frame[1] = pi1_ref_idx1[u1_blk_no];
 1076|       |
 1077|   277k|                    ps_dec->pf_mvpred(ps_dec, ps_cur_mb_info, ps_mv_nmb, ps_mv_ntop,
 1078|   277k|                                      &s_mvPred, u1_sub_mb_num, u1_wd,
 1079|   277k|                                      u1_lx_start, u1_lxend,
 1080|   277k|                                      ps_cur_mb_info->u1_mb_mc_mode);
 1081|       |
 1082|       |                    /**********************************************************/
 1083|       |                    /* Loop on number of predictors, 1 Each for Forw Backw    */
 1084|       |                    /* Loop 2 times for BiDirect mode                         */
 1085|       |                    /**********************************************************/
 1086|   624k|                    for(u1_lx = u1_lx_start; u1_lx < u1_lxend; u1_lx++)
  ------------------
  |  Branch (1086:46): [True: 346k, False: 277k]
  ------------------
 1087|   346k|                    {
 1088|   346k|                        WORD16 i2_mv_x, i2_mv_y;
 1089|       |
 1090|       |                        /********************************************************/
 1091|       |                        /* Predict Mv                                           */
 1092|       |                        /* Add Mv Residuals and store back                      */
 1093|       |                        /********************************************************/
 1094|   346k|                        i1_ref_idx = s_mvPred.i1_ref_frame[u1_lx];
 1095|   346k|                        u1_tmp_lx = (u1_lx << 1);
 1096|       |
 1097|   346k|                        i2_mv_x = ps_mv_nmb->i2_mv[u1_tmp_lx];
 1098|   346k|                        i2_mv_y = ps_mv_nmb->i2_mv[u1_tmp_lx + 1];
 1099|       |
 1100|   346k|                        i2_mv_x += s_mvPred.i2_mv[u1_tmp_lx];
 1101|   346k|                        i2_mv_y += s_mvPred.i2_mv[u1_tmp_lx + 1];
 1102|   346k|                        s_mvPred.i2_mv[u1_tmp_lx] = i2_mv_x;
 1103|   346k|                        s_mvPred.i2_mv[u1_tmp_lx + 1] = i2_mv_y;
 1104|       |
 1105|       |                        /********************************************************/
 1106|       |                        /* Transfer setup call                                  */
 1107|       |                        /* convert RefIdx if it is MbAff                        */
 1108|       |                        /* Pass Weight Offset and refFrame                      */
 1109|       |                        /********************************************************/
 1110|   346k|                        i1_ref_idx1 = i1_ref_idx >> u1_scale_ref;
 1111|   346k|                        if(u1_scale_ref && ((i1_ref_idx & 0x01) != u4_bot_mb))
  ------------------
  |  Branch (1111:28): [True: 0, False: 346k]
  |  Branch (1111:44): [True: 0, False: 0]
  ------------------
 1112|      0|                            i1_ref_idx1 += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1113|   346k|                        ps_ref_frame =
 1114|   346k|                                        ps_dec->ps_ref_pic_buf_lx[u1_lx][i1_ref_idx1];
 1115|       |
 1116|       |                        /* Storing Colocated-Zero u4_flag */
 1117|   346k|                        if(u1_lx == u1_lx_start)
  ------------------
  |  Branch (1117:28): [True: 277k, False: 68.9k]
  ------------------
 1118|   277k|                        {
 1119|       |                            /* Fill colocated info in MvPred structure */
 1120|   277k|                            s_mvPred.u1_col_ref_pic_idx =
 1121|   277k|                                            ps_ref_frame->u1_mv_buf_id;
 1122|   277k|                            s_mvPred.u1_pic_type = ps_ref_frame->u1_pic_type;
 1123|       |
 1124|       |                            /* Calculating colocated zero information */
 1125|   277k|                            u1_colz =
 1126|   277k|                                            (u1_field << 1)
 1127|   277k|                                                            | ((i1_ref_idx == 0)
  ------------------
  |  Branch (1127:64): [True: 234k, False: 43.0k]
  ------------------
 1128|   234k|                                                                            && (ABS(i2_mv_x)
  ------------------
  |  |  100|   234k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 34.7k, False: 199k]
  |  |  ------------------
  ------------------
  |  Branch (1128:80): [True: 95.5k, False: 139k]
  ------------------
 1129|   234k|                                                                                            <= 1)
 1130|  95.5k|                                                                            && (ABS(i2_mv_y)
  ------------------
  |  |  100|  95.5k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 20.0k, False: 75.5k]
  |  |  ------------------
  ------------------
  |  Branch (1130:80): [True: 74.6k, False: 20.9k]
  ------------------
 1131|  95.5k|                                                                                            <= 1));
 1132|   277k|                            u1_colz |= ps_mb_part_info->u1_col_info[u1_blk_no];
 1133|   277k|                        }
 1134|       |
 1135|   346k|                        pu4_wt_offst = ppu4_wt_ofst[u1_blk_no];
 1136|   346k|                        {
 1137|   346k|                            pred_info_pkd_t *ps_pred_pkd;
 1138|   346k|                           WORD16 i2_mv[2];
 1139|       |
 1140|   346k|                           i2_mv[0] = i2_mv_x;
 1141|   346k|                           i2_mv[1] = i2_mv_y;
 1142|       |
 1143|   346k|                           ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
 1144|   346k|                        ih264d_fill_pred_info(i2_mv,u1_wd,u1_ht,u1_sub_mb_num,u1_pred_mode,
 1145|   346k|                                        ps_pred_pkd,ps_ref_frame->u1_pic_buf_id,i1_ref_idx,pu4_wt_offst,
 1146|   346k|                                        ps_ref_frame->u1_pic_type);
 1147|   346k|                        ps_dec->u4_pred_info_pkd_idx++;
 1148|   346k|                        ps_cur_mb_info->u1_num_pred_parts++;
 1149|       |
 1150|       |
 1151|   346k|                        }
 1152|       |
 1153|   346k|                    }
 1154|   277k|                    ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb,
 1155|   277k|                                       u1_sub_mb_num, u1_colz, u1_ht,
 1156|   277k|                                       u1_wd);
 1157|   277k|                }
 1158|  1.09M|            }
 1159|       |
 1160|   927k|        }
 1161|  1.46k|        else
 1162|  1.46k|        {
 1163|       |            /* Set zero values in case of Intra Mbs */
 1164|  1.46k|            mv_pred_t s_mvPred =
 1165|  1.46k|                {
 1166|  1.46k|                    { 0, 0, 0, 0 },
 1167|  1.46k|                      { -1, -1 }, 0, 0};
 1168|       |            /* Storing colocated zero information */
 1169|  1.46k|            ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0,
 1170|  1.46k|                               (UWORD8)(u1_field << 1), 4, 4);
 1171|  1.46k|        }
 1172|       |
 1173|       |        /*if num _cores is set to 3 ,compute bs will be done in another thread*/
 1174|   928k|        if(ps_dec->u4_num_cores < 3)
  ------------------
  |  Branch (1174:12): [True: 928k, False: 0]
  ------------------
 1175|   928k|        {
 1176|   928k|            if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (1176:16): [True: 928k, False: 0]
  ------------------
 1177|   928k|                ps_dec->pf_compute_bs(ps_dec, ps_cur_mb_info,
 1178|   928k|                                     (UWORD16)(i >> u1_mbaff));
 1179|   928k|        }
 1180|   928k|    }
 1181|   124k|    return OK;
  ------------------
  |  |  114|   124k|#define OK        0
  ------------------
 1182|   124k|}
ih264d_get_implicit_weights:
 1196|  16.3k|{
 1197|  16.3k|    UWORD32 *pu4_iwt_ofst;
 1198|  16.3k|    UWORD8 i, j;
 1199|  16.3k|    struct pic_buffer_t *ps_pic_buff0, *ps_pic_buff1;
 1200|  16.3k|    WORD16 i2_dist_scale_factor;
 1201|  16.3k|    WORD16 i2_tb, i2_td, i2_tx;
 1202|  16.3k|    WORD64 i8_tb, i8_td;
 1203|  16.3k|    WORD32 i4_poc0, i4_poc1;
 1204|  16.3k|    UWORD32 ui_temp0, ui_temp1;
 1205|  16.3k|    UWORD8 uc_num_ref_idx_l0_active, uc_num_ref_idx_l1_active;
 1206|       |
 1207|  16.3k|    pu4_iwt_ofst = ps_dec->pu4_wts_ofsts_mat;
 1208|  16.3k|    uc_num_ref_idx_l0_active =
 1209|  16.3k|                    ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0];
 1210|  16.3k|    uc_num_ref_idx_l1_active =
 1211|  16.3k|                    ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1];
 1212|       |
 1213|  53.2k|    for(i = 0; i < uc_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (1213:16): [True: 36.9k, False: 16.3k]
  ------------------
 1214|  36.9k|    {
 1215|  36.9k|        ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][i];
 1216|  36.9k|        i4_poc0 = ps_pic_buff0->i4_avg_poc;
 1217|   127k|        for(j = 0; j < uc_num_ref_idx_l1_active; j++)
  ------------------
  |  Branch (1217:20): [True: 90.6k, False: 36.9k]
  ------------------
 1218|  90.6k|        {
 1219|  90.6k|            ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][j];
 1220|  90.6k|            i4_poc1 = ps_pic_buff1->i4_avg_poc;
 1221|       |
 1222|  90.6k|            if(i4_poc1 != i4_poc0)
  ------------------
  |  Branch (1222:16): [True: 13.5k, False: 77.1k]
  ------------------
 1223|  13.5k|            {
 1224|  13.5k|                i8_tb = (WORD64)ps_dec->ps_cur_pic->i4_poc - i4_poc0;
 1225|  13.5k|                i2_tb = CLIP_S8(i8_tb);
  ------------------
  |  |   59|  13.5k|#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.21k, False: 10.2k]
  |  |  |  |  |  Branch (77:54): [True: 4.79k, False: 5.48k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1226|  13.5k|                i8_td = (WORD64)i4_poc1 - i4_poc0;
 1227|  13.5k|                i2_td = CLIP_S8(i8_td);
  ------------------
  |  |   59|  13.5k|#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.29k, False: 10.2k]
  |  |  |  |  |  Branch (77:54): [True: 4.60k, False: 5.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1228|  13.5k|                i2_tx = (16384 + ABS(SIGN_POW2_DIV(i2_td, 1))) / i2_td;
  ------------------
  |  |  100|  27.0k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 4.85k, False: 8.65k]
  |  |  |  Branch (100:27): [True: 6.05k, False: 7.44k]
  |  |  |  Branch (100:39): [True: 4.85k, False: 0]
  |  |  |  Branch (100:46): [True: 1.20k, False: 7.44k]
  |  |  ------------------
  ------------------
 1229|  13.5k|                i2_dist_scale_factor = CLIP_S11(
  ------------------
  |  |   65|  13.5k|#define CLIP_S11(x) CLIP3(-1024, 1023, (x))
  |  |  ------------------
  |  |  |  |   77|  13.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.07k, False: 12.4k]
  |  |  |  |  |  Branch (77:54): [True: 792, False: 11.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1230|  13.5k|                                            (((i2_tb * i2_tx) + 32) >> 6));
 1231|       |
 1232|  13.5k|                if(/*((u4_poc1 - u4_poc0) == 0) ||*/
 1233|  13.5k|                (!(ps_pic_buff1->u1_is_short && ps_pic_buff0->u1_is_short))
  ------------------
  |  Branch (1233:20): [True: 11.7k, False: 1.76k]
  |  Branch (1233:49): [True: 10.5k, False: 1.23k]
  ------------------
 1234|  10.5k|                                || ((i2_dist_scale_factor >> 2) < -64)
  ------------------
  |  Branch (1234:36): [True: 1.63k, False: 8.87k]
  ------------------
 1235|  8.87k|                                || ((i2_dist_scale_factor >> 2) > 128))
  ------------------
  |  Branch (1235:36): [True: 730, False: 8.14k]
  ------------------
 1236|  5.35k|                {
 1237|       |                    /* same for forward and backward, wt=32 and Offset = 0 */
 1238|  5.35k|                    ui_temp0 = 0x00000020;
 1239|  5.35k|                    ui_temp1 = 0x00000020;
 1240|  5.35k|                }
 1241|  8.14k|                else
 1242|  8.14k|                {
 1243|  8.14k|                    ui_temp0 = 64 - (i2_dist_scale_factor >> 2);
 1244|  8.14k|                    ui_temp1 = (i2_dist_scale_factor >> 2);
 1245|  8.14k|                }
 1246|  13.5k|            }
 1247|  77.1k|            else
 1248|  77.1k|            {
 1249|  77.1k|                ui_temp0 = 0x00000020;
 1250|  77.1k|                ui_temp1 = 0x00000020;
 1251|  77.1k|            }
 1252|  90.6k|            pu4_iwt_ofst[0] = pu4_iwt_ofst[2] = pu4_iwt_ofst[4] = ui_temp0;
 1253|  90.6k|            pu4_iwt_ofst[1] = pu4_iwt_ofst[3] = pu4_iwt_ofst[5] = ui_temp1;
 1254|  90.6k|            pu4_iwt_ofst += 6;
 1255|  90.6k|        }
 1256|  36.9k|    }
 1257|  16.3k|    if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (1257:8): [True: 0, False: 16.3k]
  ------------------
 1258|      0|    {
 1259|      0|        UWORD8 k;
 1260|      0|        WORD32 i4_cur_poc = ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 1261|      0|        UWORD32* pu4_wt_mat = ps_dec->pu4_mbaff_wt_mat;
 1262|       |        /* Form the Implicit Weighted prediction matrix for field MBs also */
 1263|      0|        for(k = 0; k < 2; k++)
  ------------------
  |  Branch (1263:20): [True: 0, False: 0]
  ------------------
 1264|      0|        {
 1265|      0|            for(i = 0; i < (uc_num_ref_idx_l0_active << 1); i++)
  ------------------
  |  Branch (1265:24): [True: 0, False: 0]
  ------------------
 1266|      0|            {
 1267|      0|                UWORD16 u2_l0_idx;
 1268|       |
 1269|       |                /*u2_l0_idx = (i >= uc_num_ref_idx_l0_active)
 1270|       |                 ?(MAX_REF_BUFS + i - uc_num_ref_idx_l0_active) : (i) ;*/
 1271|       |
 1272|      0|                u2_l0_idx = i >> 1;
 1273|      0|                if((i & 0x01) != k)
  ------------------
  |  Branch (1273:20): [True: 0, False: 0]
  ------------------
 1274|      0|                {
 1275|      0|                    u2_l0_idx += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1276|      0|                }
 1277|      0|                ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][u2_l0_idx];
 1278|      0|                i4_poc0 = ps_pic_buff0->i4_poc;
 1279|      0|                for(j = 0; j < (uc_num_ref_idx_l1_active << 1); j++)
  ------------------
  |  Branch (1279:28): [True: 0, False: 0]
  ------------------
 1280|      0|                {
 1281|      0|                    UWORD16 u2_l1_idx;
 1282|       |                    /*u2_l1_idx = (j >= uc_num_ref_idx_l1_active)
 1283|       |                     ? (MAX_REF_BUFS + j - uc_num_ref_idx_l1_active ) : (j) ;*/
 1284|       |
 1285|      0|                    u2_l1_idx = j >> 1;
 1286|      0|                    if((j & 0x01) != k)
  ------------------
  |  Branch (1286:24): [True: 0, False: 0]
  ------------------
 1287|      0|                    {
 1288|      0|                        u2_l1_idx += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1289|      0|                    }
 1290|      0|                    ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][u2_l1_idx];
 1291|      0|                    i4_poc1 = ps_pic_buff1->i4_poc;
 1292|      0|                    if(i4_poc1 != i4_poc0)
  ------------------
  |  Branch (1292:24): [True: 0, False: 0]
  ------------------
 1293|      0|                    {
 1294|      0|                        i8_tb = (WORD64)i4_cur_poc - i4_poc0;
 1295|      0|                        i2_tb = CLIP_S8(i8_tb);
  ------------------
  |  |   59|      0|#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|      0|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 0]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1296|      0|                        i8_td = (WORD64)i4_poc1 - i4_poc0;
 1297|      0|                        i2_td = CLIP_S8(i8_td);
  ------------------
  |  |   59|      0|#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|      0|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 0]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1298|      0|                        i2_tx = (16384 + ABS(SIGN_POW2_DIV(i2_td, 1)))
  ------------------
  |  |  100|      0|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 0, False: 0]
  |  |  |  Branch (100:27): [True: 0, False: 0]
  |  |  |  Branch (100:39): [True: 0, False: 0]
  |  |  |  Branch (100:46): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1299|      0|                                        / i2_td;
 1300|      0|                        i2_dist_scale_factor = CLIP_S11(
  ------------------
  |  |   65|      0|#define CLIP_S11(x) CLIP3(-1024, 1023, (x))
  |  |  ------------------
  |  |  |  |   77|      0|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 0]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1301|      0|                                                    (((i2_tb * i2_tx) + 32) >> 6));
 1302|       |
 1303|      0|                        if(/*((u4_poc1 - u4_poc0) == 0) ||*/
 1304|      0|                        (!(ps_pic_buff1->u1_is_short && ps_pic_buff0->u1_is_short))
  ------------------
  |  Branch (1304:28): [True: 0, False: 0]
  |  Branch (1304:57): [True: 0, False: 0]
  ------------------
 1305|      0|                                        || ((i2_dist_scale_factor >> 2) < -64)
  ------------------
  |  Branch (1305:44): [True: 0, False: 0]
  ------------------
 1306|      0|                                        || ((i2_dist_scale_factor >> 2) > 128))
  ------------------
  |  Branch (1306:44): [True: 0, False: 0]
  ------------------
 1307|      0|                        {
 1308|       |                            /* same for forward and backward, wt=32 and Offset = 0 */
 1309|      0|                            ui_temp0 = 0x00000020;
 1310|      0|                            ui_temp1 = 0x00000020;
 1311|      0|                        }
 1312|      0|                        else
 1313|      0|                        {
 1314|      0|                            ui_temp0 = 64 - (i2_dist_scale_factor >> 2);
 1315|      0|                            ui_temp1 = (i2_dist_scale_factor >> 2);
 1316|      0|                        }
 1317|      0|                    }
 1318|      0|                    else
 1319|      0|                    {
 1320|      0|                        ui_temp0 = 0x00000020;
 1321|      0|                        ui_temp1 = 0x00000020;
 1322|      0|                    }
 1323|       |                    /* Store in the weight matrix */
 1324|      0|                    *pu4_wt_mat++ = ui_temp0;
 1325|      0|                    *pu4_wt_mat++ = ui_temp1;
 1326|      0|                    *pu4_wt_mat++ = ui_temp0;
 1327|      0|                    *pu4_wt_mat++ = ui_temp1;
 1328|      0|                    *pu4_wt_mat++ = ui_temp0;
 1329|      0|                    *pu4_wt_mat++ = ui_temp1;
 1330|       |
 1331|      0|                }
 1332|      0|            }
 1333|      0|            i4_cur_poc = ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 1334|      0|        }
 1335|      0|    }
 1336|  16.3k|}

ih264d_read_coeff4x4_cabac:
   69|  1.07M|{
   70|       |
   71|  1.07M|    decoding_envirnoment_t *ps_cab_env = &ps_dec->s_cab_dec_env;
   72|  1.07M|    UWORD32 u4_coded_flag;
   73|  1.07M|    UWORD32 u4_offset, *pu4_buffer;
   74|  1.07M|    UWORD32 u4_code_int_range, u4_code_int_val_ofst;
   75|  1.07M|    tu_sblk4x4_coeff_data_t *ps_tu_4x4;
   76|  1.07M|    WORD16 *pi2_coeff_data;
   77|  1.07M|    WORD32 num_sig_coeffs = 0;
   78|       |
   79|       |    /*loading from strcuctures*/
   80|       |
   81|  1.07M|    ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
   82|  1.07M|    ps_tu_4x4->u2_sig_coeff_map = 0;
   83|  1.07M|    pi2_coeff_data = &ps_tu_4x4->ai2_level[0];
   84|       |
   85|  1.07M|    u4_offset = ps_bitstrm->u4_ofst;
   86|  1.07M|    pu4_buffer = ps_bitstrm->pu4_buffer;
   87|       |
   88|  1.07M|    u4_code_int_range = ps_cab_env->u4_code_int_range;
   89|  1.07M|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
   90|       |
   91|  1.07M|    {
   92|       |
   93|       |        /*inilined DecodeDecision_onebin begins*/
   94|       |
   95|  1.07M|        {
   96|       |
   97|  1.07M|            UWORD32 u4_qnt_int_range, u4_int_range_lps;
   98|  1.07M|            UWORD32 u4_symbol, u1_mps_state;
   99|       |
  100|  1.07M|            UWORD32 table_lookup;
  101|  1.07M|            const UWORD32 *pu4_table = (const UWORD32 *)ps_cab_env->cabac_table;
  102|  1.07M|            UWORD32 u4_clz;
  103|       |
  104|  1.07M|            u1_mps_state = (ps_ctxt_coded->u1_mps_state);
  105|  1.07M|            u4_clz = CLZ(u4_code_int_range);
  106|  1.07M|            u4_qnt_int_range = u4_code_int_range << u4_clz;
  107|  1.07M|            u4_qnt_int_range = (u4_qnt_int_range >> 29) & 0x3;
  108|  1.07M|            table_lookup =
  109|  1.07M|                            pu4_table[(u1_mps_state << 2) + u4_qnt_int_range];
  110|  1.07M|            u4_int_range_lps = table_lookup & 0xff;
  111|  1.07M|            u4_int_range_lps = u4_int_range_lps << (23 - u4_clz);
  112|  1.07M|            u4_code_int_range = u4_code_int_range - u4_int_range_lps;
  113|  1.07M|            u4_symbol = ((u1_mps_state >> 6) & 0x1);
  114|  1.07M|            u1_mps_state = (table_lookup >> 8) & 0x7F;
  115|       |
  116|  1.07M|            CHECK_IF_LPS(u4_code_int_range, u4_code_int_val_ofst, u4_symbol,
  ------------------
  |  |  184|  1.07M|                    u4_codeIntRangeLPS_m,u1_mps_state_m,table_lookup_m)                     \
  |  |  185|  1.07M|{                                                                                         \
  |  |  186|  1.07M|  if(u4_codeIntValOffset_m >= u4_codeIntRange_m)                                            \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 176k, False: 893k]
  |  |  ------------------
  |  |  187|  1.07M|  {                                                                                         \
  |  |  188|   176k|      u4_symbol_m = 1 - u4_symbol_m;                                                        \
  |  |  189|   176k|      u4_codeIntValOffset_m -= u4_codeIntRange_m;                                           \
  |  |  190|   176k|      u4_codeIntRange_m = u4_codeIntRangeLPS_m;                                             \
  |  |  191|   176k|      u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                       \
  |  |  192|   176k|  }                                                                                         \
  |  |  193|  1.07M|}
  ------------------
  117|  1.07M|                         u4_int_range_lps, u1_mps_state, table_lookup)
  118|       |
  119|  1.07M|            if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)
  ------------------
  |  |  113|  1.07M|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  ------------------
  |  Branch (119:16): [True: 9.67k, False: 1.06M]
  ------------------
  120|  9.67k|            {
  121|       |
  122|  9.67k|                RENORM_RANGE_OFFSET(u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  170|  9.67k|  {                                                                                         \
  |  |  171|  9.67k|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|  9.67k|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|  9.67k|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  9.67k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  9.67k|{                                                                           \
  |  |  |  |  139|  9.67k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  9.67k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  9.67k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  9.67k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  9.67k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 9.43k, False: 243]
  |  |  |  |  ------------------
  |  |  |  |  144|  9.67k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  9.43k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  9.67k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  9.67k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  9.67k|}
  |  |  ------------------
  |  |  174|  9.67k|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|  9.67k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  9.67k|{                                                                           \
  |  |  |  |  195|  9.67k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  9.67k|}
  |  |  ------------------
  |  |  175|  9.67k|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|  9.67k|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|  9.67k|  }
  ------------------
  123|  9.67k|                                    u4_offset, pu4_buffer)
  124|  9.67k|            }
  125|       |
  126|  1.07M|            ps_ctxt_coded->u1_mps_state = u1_mps_state;
  127|  1.07M|            u4_coded_flag = u4_symbol;
  128|       |
  129|       |            /*inilined DecodeDecision_onebin ends*/
  130|       |
  131|  1.07M|        }
  132|       |
  133|  1.07M|    }
  134|       |
  135|  1.07M|    if(u4_coded_flag)
  ------------------
  |  Branch (135:8): [True: 455k, False: 615k]
  ------------------
  136|   455k|    {
  137|       |
  138|   455k|        {
  139|   455k|            bin_ctxt_model_t *p_binCtxt_last, *p_binCtxt_last_org;
  140|   455k|            UWORD32 uc_last_coeff_idx;
  141|   455k|            UWORD32 uc_bin;
  142|   455k|            UWORD32 i;
  143|   455k|            WORD32 first_coeff_offset = 0;
  144|       |
  145|   455k|            if((u4_ctxcat == CHROMA_AC_CTXCAT) || (u4_ctxcat == LUMA_AC_CTXCAT))
  ------------------
  |  |   75|   455k|#define CHROMA_AC_CTXCAT  4
  ------------------
                          if((u4_ctxcat == CHROMA_AC_CTXCAT) || (u4_ctxcat == LUMA_AC_CTXCAT))
  ------------------
  |  |   72|   405k|#define LUMA_AC_CTXCAT    1
  ------------------
  |  Branch (145:16): [True: 49.7k, False: 405k]
  |  Branch (145:51): [True: 13.3k, False: 392k]
  ------------------
  146|  63.0k|            {
  147|  63.0k|                first_coeff_offset = 1;
  148|  63.0k|            }
  149|       |
  150|   455k|            i = 0;
  151|   455k|            if(u4_ctxcat == CHROMA_DC_CTXCAT)
  ------------------
  |  |   74|   455k|#define CHROMA_DC_CTXCAT  3
  ------------------
  |  Branch (151:16): [True: 51.7k, False: 403k]
  ------------------
  152|  51.7k|            {
  153|  51.7k|                uc_last_coeff_idx = 3;
  154|  51.7k|            }
  155|   403k|            else
  156|   403k|            {
  157|   403k|                UWORD32 u4_start;
  158|   403k|                u4_start = (u4_ctxcat & 1) + (u4_ctxcat >> 2);
  159|   403k|                uc_last_coeff_idx = 15 - u4_start;
  160|   403k|            }
  161|   455k|            p_binCtxt_last_org = ps_ctxt_sig_coeff
  162|   455k|                            + LAST_COEFF_CTXT_MINUS_SIG_COEFF_CTXT;
  ------------------
  |  |   84|   455k|#define LAST_COEFF_CTXT_MINUS_SIG_COEFF_CTXT 61
  ------------------
  163|       |
  164|   455k|            do
  165|  3.55M|            {
  166|       |
  167|       |                /*inilined DecodeDecision_onebin begins*/
  168|  3.55M|                {
  169|       |
  170|  3.55M|                    UWORD32 u4_qnt_int_range, u4_int_range_lps;
  171|  3.55M|                    UWORD32 u4_symbol, u1_mps_state;
  172|  3.55M|                    UWORD32 table_lookup;
  173|  3.55M|                    const UWORD32 *pu4_table =
  174|  3.55M|                                    (const UWORD32 *)ps_cab_env->cabac_table;
  175|  3.55M|                    UWORD32 u4_clz;
  176|       |
  177|  3.55M|                    u1_mps_state = (ps_ctxt_sig_coeff->u1_mps_state);
  178|       |
  179|  3.55M|                    u4_clz = CLZ(u4_code_int_range);
  180|       |
  181|  3.55M|                    u4_qnt_int_range = u4_code_int_range << u4_clz;
  182|  3.55M|                    u4_qnt_int_range = (u4_qnt_int_range >> 29) & 0x3;
  183|       |
  184|  3.55M|                    table_lookup = pu4_table[(u1_mps_state << 2)
  185|  3.55M|                                    + u4_qnt_int_range];
  186|       |
  187|  3.55M|                    u4_int_range_lps = table_lookup & 0xff;
  188|       |
  189|  3.55M|                    u4_int_range_lps = u4_int_range_lps << (23 - u4_clz);
  190|  3.55M|                    u4_code_int_range = u4_code_int_range - u4_int_range_lps;
  191|  3.55M|                    u4_symbol = ((u1_mps_state >> 6) & 0x1);
  192|  3.55M|                    u1_mps_state = (table_lookup >> 8) & 0x7F;
  193|       |
  194|  3.55M|                    CHECK_IF_LPS(u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  184|  3.55M|                    u4_codeIntRangeLPS_m,u1_mps_state_m,table_lookup_m)                     \
  |  |  185|  3.55M|{                                                                                         \
  |  |  186|  3.55M|  if(u4_codeIntValOffset_m >= u4_codeIntRange_m)                                            \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 540k, False: 3.01M]
  |  |  ------------------
  |  |  187|  3.55M|  {                                                                                         \
  |  |  188|   540k|      u4_symbol_m = 1 - u4_symbol_m;                                                        \
  |  |  189|   540k|      u4_codeIntValOffset_m -= u4_codeIntRange_m;                                           \
  |  |  190|   540k|      u4_codeIntRange_m = u4_codeIntRangeLPS_m;                                             \
  |  |  191|   540k|      u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                       \
  |  |  192|   540k|  }                                                                                         \
  |  |  193|  3.55M|}
  ------------------
  195|  3.55M|                                 u4_symbol, u4_int_range_lps, u1_mps_state,
  196|  3.55M|                                 table_lookup)
  197|       |
  198|  3.55M|                    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_14)
  ------------------
  |  |  115|  3.55M|#define ONE_RIGHT_SHIFTED_BY_14 1<<14
  ------------------
  |  Branch (198:24): [True: 171k, False: 3.38M]
  ------------------
  199|   171k|                    {
  200|       |
  201|   171k|                        UWORD32 read_bits, u4_clz;
  202|   171k|                        u4_clz = CLZ(u4_code_int_range);
  203|   171k|                        NEXTBITS(read_bits, (u4_offset + 23), pu4_buffer,
  ------------------
  |  |  137|   171k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|   171k|{                                                                           \
  |  |  139|   171k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|   171k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|   171k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|   171k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|   171k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 165k, False: 5.27k]
  |  |  ------------------
  |  |  144|   171k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|   165k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|   171k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|   171k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|   171k|}
  ------------------
  204|   171k|                                 u4_clz)
  205|   171k|                        FLUSHBITS(u4_offset, (u4_clz))
  ------------------
  |  |  193|   171k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|   171k|{                                                                           \
  |  |  195|   171k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|   171k|}
  ------------------
  206|   171k|                        u4_code_int_range = u4_code_int_range << u4_clz;
  207|   171k|                        u4_code_int_val_ofst = (u4_code_int_val_ofst << u4_clz)
  208|   171k|                                        | read_bits;
  209|   171k|                    }
  210|       |
  211|  3.55M|                    INC_BIN_COUNT(
  212|  3.55M|                                    ps_cab_env)
  213|       |
  214|  3.55M|                    ps_ctxt_sig_coeff->u1_mps_state = u1_mps_state;
  215|  3.55M|                    uc_bin = u4_symbol;
  216|       |
  217|  3.55M|                }
  218|       |                /*incrementing pointer to point to the context of the next bin*/
  219|  3.55M|                ps_ctxt_sig_coeff++;
  220|       |
  221|       |                /*inilined DecodeDecision_onebin ends*/
  222|       |
  223|  3.55M|                if(uc_bin)
  ------------------
  |  Branch (223:20): [True: 1.22M, False: 2.33M]
  ------------------
  224|  1.22M|                {
  225|  1.22M|                    num_sig_coeffs++;
  226|  1.22M|                    SET_BIT(ps_tu_4x4->u2_sig_coeff_map, (i + first_coeff_offset));
  ------------------
  |  |  106|  1.22M|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  227|       |
  228|  1.22M|                    p_binCtxt_last = p_binCtxt_last_org + i;
  229|       |
  230|       |                    /*inilined DecodeDecision_onebin begins*/
  231|       |
  232|  1.22M|                    {
  233|       |
  234|  1.22M|                        UWORD32 u4_qnt_int_range, u4_int_range_lps;
  235|  1.22M|                        UWORD32 u4_symbol, u1_mps_state;
  236|  1.22M|                        UWORD32 table_lookup;
  237|  1.22M|                        const UWORD32 *pu4_table =
  238|  1.22M|                                        (const UWORD32 *)ps_cab_env->cabac_table;
  239|  1.22M|                        UWORD32 u4_clz;
  240|       |
  241|  1.22M|                        u1_mps_state = (p_binCtxt_last->u1_mps_state);
  242|       |
  243|  1.22M|                        u4_clz = CLZ(u4_code_int_range);
  244|  1.22M|                        u4_qnt_int_range = u4_code_int_range << u4_clz;
  245|  1.22M|                        u4_qnt_int_range = (u4_qnt_int_range >> 29)
  246|  1.22M|                                        & 0x3;
  247|       |
  248|  1.22M|                        table_lookup = pu4_table[(u1_mps_state << 2)
  249|  1.22M|                                        + u4_qnt_int_range];
  250|  1.22M|                        u4_int_range_lps = table_lookup & 0xff;
  251|       |
  252|  1.22M|                        u4_int_range_lps = u4_int_range_lps
  253|  1.22M|                                        << (23 - u4_clz);
  254|       |
  255|  1.22M|                        u4_code_int_range = u4_code_int_range
  256|  1.22M|                                        - u4_int_range_lps;
  257|  1.22M|                        u4_symbol = ((u1_mps_state >> 6) & 0x1);
  258|  1.22M|                        u1_mps_state = (table_lookup >> 8) & 0x7F;
  259|       |
  260|  1.22M|                        CHECK_IF_LPS(u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  184|  1.22M|                    u4_codeIntRangeLPS_m,u1_mps_state_m,table_lookup_m)                     \
  |  |  185|  1.22M|{                                                                                         \
  |  |  186|  1.22M|  if(u4_codeIntValOffset_m >= u4_codeIntRange_m)                                            \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 175k, False: 1.04M]
  |  |  ------------------
  |  |  187|  1.22M|  {                                                                                         \
  |  |  188|   175k|      u4_symbol_m = 1 - u4_symbol_m;                                                        \
  |  |  189|   175k|      u4_codeIntValOffset_m -= u4_codeIntRange_m;                                           \
  |  |  190|   175k|      u4_codeIntRange_m = u4_codeIntRangeLPS_m;                                             \
  |  |  191|   175k|      u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                       \
  |  |  192|   175k|  }                                                                                         \
  |  |  193|  1.22M|}
  ------------------
  261|  1.22M|                                     u4_symbol, u4_int_range_lps,
  262|  1.22M|                                     u1_mps_state, table_lookup)
  263|       |
  264|  1.22M|                        INC_BIN_COUNT(ps_cab_env)
  265|       |
  266|  1.22M|                        p_binCtxt_last->u1_mps_state = u1_mps_state;
  267|  1.22M|                        uc_bin = u4_symbol;
  268|       |
  269|  1.22M|                    }
  270|       |
  271|       |                    /*inilined DecodeDecision_onebin ends*/
  272|  1.22M|                    if(uc_bin == 1)
  ------------------
  |  Branch (272:24): [True: 430k, False: 793k]
  ------------------
  273|   430k|                        goto label_read_levels;
  274|       |
  275|  1.22M|                }
  276|       |
  277|  3.12M|                i = i + 1;
  278|       |
  279|  3.12M|            }
  280|  3.12M|            while(i < uc_last_coeff_idx);
  ------------------
  |  Branch (280:19): [True: 3.10M, False: 25.1k]
  ------------------
  281|       |
  282|  25.1k|            num_sig_coeffs++;
  283|  25.1k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, (i + first_coeff_offset));
  ------------------
  |  |  106|  25.1k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  284|       |
  285|   455k|            label_read_levels: ;
  286|       |
  287|   455k|        }
  288|       |
  289|       |        /// VALUE of No of Coeff in BLOCK = i + 1 for second case else i;
  290|       |
  291|       |        /* Decode coeff_abs_level_minus1 and coeff_sign_flag */
  292|      0|        {
  293|       |
  294|   455k|            WORD32 i2_abs_lvl;
  295|   455k|            UWORD32 u1_abs_level_equal1 = 1, u1_abs_level_gt1 = 0;
  296|       |
  297|   455k|            UWORD32 u4_ctx_inc;
  298|   455k|            UWORD32 ui_prefix;
  299|   455k|        bin_ctxt_model_t *p_ctxt_abs_level;
  300|       |
  301|       |
  302|   455k|        p_ctxt_abs_level = ps_dec->p_coeff_abs_level_minus1_t[u4_ctxcat];
  303|   455k|        u4_ctx_inc = ((0x51));
  304|       |
  305|       |        /*****************************************************/
  306|       |        /* Main Loop runs for no. of Significant coefficient */
  307|       |        /*****************************************************/
  308|       |
  309|       |
  310|   455k|        do
  311|  1.24M|            {
  312|       |
  313|  1.24M|                {
  314|  1.24M|                    INC_SYM_COUNT(&(ps_dec.s_cab_dec_env));
  315|       |
  316|       |                    /*****************************************************/
  317|       |                    /* inilining a modified ih264d_decode_bins_unary     */
  318|       |                    /*****************************************************/
  319|       |
  320|  1.24M|                    {
  321|  1.24M|                        UWORD32 u4_value;
  322|  1.24M|                        UWORD32 u4_symbol;
  323|  1.24M|                        bin_ctxt_model_t *ps_bin_ctxt;
  324|  1.24M|                        UWORD32 u4_ctx_Inc;
  325|       |
  326|  1.24M|                        u4_value = 0;
  327|       |
  328|  1.24M|                        u4_ctx_Inc = u4_ctx_inc & 0xf;
  329|  1.24M|                        ps_bin_ctxt = p_ctxt_abs_level + u4_ctx_Inc;
  330|       |
  331|  1.24M|                        do
  332|  2.55M|                        {
  333|       |
  334|  2.55M|                            {
  335|       |
  336|  2.55M|                                UWORD32 u4_qnt_int_range,
  337|  2.55M|                                                u4_int_range_lps;
  338|  2.55M|                                UWORD32 u1_mps_state;
  339|  2.55M|                                UWORD32 table_lookup;
  340|  2.55M|                                const UWORD32 *pu4_table =
  341|  2.55M|                                                (const UWORD32 *)ps_cab_env->cabac_table;
  342|  2.55M|                                UWORD32 u4_clz;
  343|       |
  344|  2.55M|                                u1_mps_state = (ps_bin_ctxt->u1_mps_state);
  345|  2.55M|                                u4_clz = CLZ(u4_code_int_range);
  346|  2.55M|                                u4_qnt_int_range = u4_code_int_range
  347|  2.55M|                                                << u4_clz;
  348|  2.55M|                                u4_qnt_int_range = (u4_qnt_int_range
  349|  2.55M|                                                >> 29) & 0x3;
  350|  2.55M|                                table_lookup = pu4_table[(u1_mps_state << 2)
  351|  2.55M|                                                + u4_qnt_int_range];
  352|  2.55M|                                u4_int_range_lps = table_lookup & 0xff;
  353|       |
  354|  2.55M|                                u4_int_range_lps = u4_int_range_lps
  355|  2.55M|                                                << (23 - u4_clz);
  356|  2.55M|                                u4_code_int_range = u4_code_int_range
  357|  2.55M|                                                - u4_int_range_lps;
  358|  2.55M|                                u4_symbol = ((u1_mps_state >> 6) & 0x1);
  359|  2.55M|                                u1_mps_state = (table_lookup >> 8) & 0x7F;
  360|       |
  361|  2.55M|                                CHECK_IF_LPS(u4_code_int_range,
  ------------------
  |  |  184|  2.55M|                    u4_codeIntRangeLPS_m,u1_mps_state_m,table_lookup_m)                     \
  |  |  185|  2.55M|{                                                                                         \
  |  |  186|  2.55M|  if(u4_codeIntValOffset_m >= u4_codeIntRange_m)                                            \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 309k, False: 2.24M]
  |  |  ------------------
  |  |  187|  2.55M|  {                                                                                         \
  |  |  188|   309k|      u4_symbol_m = 1 - u4_symbol_m;                                                        \
  |  |  189|   309k|      u4_codeIntValOffset_m -= u4_codeIntRange_m;                                           \
  |  |  190|   309k|      u4_codeIntRange_m = u4_codeIntRangeLPS_m;                                             \
  |  |  191|   309k|      u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                       \
  |  |  192|   309k|  }                                                                                         \
  |  |  193|  2.55M|}
  ------------------
  362|  2.55M|                                             u4_code_int_val_ofst, u4_symbol,
  363|  2.55M|                                             u4_int_range_lps, u1_mps_state,
  364|  2.55M|                                             table_lookup)
  365|       |
  366|  2.55M|                                if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_9)
  ------------------
  |  |  114|  2.55M|#define ONE_RIGHT_SHIFTED_BY_9    1<<9
  ------------------
  |  Branch (366:36): [True: 42.8k, False: 2.50M]
  ------------------
  367|  42.8k|                                {
  368|       |
  369|  42.8k|                                    RENORM_RANGE_OFFSET(u4_code_int_range,
  ------------------
  |  |  170|  42.8k|  {                                                                                         \
  |  |  171|  42.8k|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|  42.8k|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|  42.8k|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  42.8k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  42.8k|{                                                                           \
  |  |  |  |  139|  42.8k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  42.8k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  42.8k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  42.8k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  42.8k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 41.3k, False: 1.55k]
  |  |  |  |  ------------------
  |  |  |  |  144|  42.8k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  41.3k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  42.8k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  42.8k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  42.8k|}
  |  |  ------------------
  |  |  174|  42.8k|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|  42.8k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  42.8k|{                                                                           \
  |  |  |  |  195|  42.8k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  42.8k|}
  |  |  ------------------
  |  |  175|  42.8k|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|  42.8k|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|  42.8k|  }
  ------------------
  370|  42.8k|                                                        u4_code_int_val_ofst,
  371|  42.8k|                                                        u4_offset, pu4_buffer)
  372|  42.8k|                                }
  373|       |
  374|  2.55M|                                INC_BIN_COUNT(ps_cab_env);
  375|       |
  376|  2.55M|                                ps_bin_ctxt->u1_mps_state = u1_mps_state;
  377|  2.55M|                            }
  378|       |
  379|  2.55M|                            INC_BIN_COUNT(ps_cab_env);INC_DECISION_BINS(ps_cab_env);
  380|       |
  381|  2.55M|                            u4_value++;
  382|  2.55M|                            ps_bin_ctxt = p_ctxt_abs_level + (u4_ctx_inc >> 4);
  383|       |
  384|  2.55M|                        }
  385|  2.55M|                        while(u4_symbol && (u4_value < UCOFF_LEVEL));
  ------------------
  |  |   41|  1.36M|#define UCOFF_LEVEL  14
  ------------------
  |  Branch (385:31): [True: 1.36M, False: 1.18M]
  |  Branch (385:44): [True: 1.30M, False: 65.8k]
  ------------------
  386|       |
  387|  1.24M|                        ui_prefix = u4_value - 1 + u4_symbol;
  388|       |
  389|  1.24M|                    }
  390|       |
  391|  1.24M|                    if(ui_prefix == UCOFF_LEVEL)
  ------------------
  |  |   41|  1.24M|#define UCOFF_LEVEL  14
  ------------------
  |  Branch (391:24): [True: 65.8k, False: 1.18M]
  ------------------
  392|  65.8k|                    {
  393|  65.8k|                        UWORD32 ui16_sufS = 0;
  394|  65.8k|                        UWORD32 u1_max_bins;
  395|  65.8k|                        UWORD32 u4_value;
  396|       |
  397|  65.8k|                        i2_abs_lvl = UCOFF_LEVEL;
  ------------------
  |  |   41|  65.8k|#define UCOFF_LEVEL  14
  ------------------
  398|       |                        /*inlining ih264d_decode_bypass_bins_unary begins*/
  399|       |
  400|  65.8k|                        {
  401|  65.8k|                            UWORD32 uc_bin;
  402|  65.8k|                            UWORD32 bits_to_flush;
  403|       |
  404|       |
  405|  65.8k|                            bits_to_flush = 0;
  406|       |                            /*renormalize to ensure there 23 bits more in the u4_code_int_val_ofst*/
  407|  65.8k|                            {
  408|  65.8k|                                UWORD32 u4_clz, read_bits;
  409|       |
  410|  65.8k|                                u4_clz = CLZ(u4_code_int_range);
  411|  65.8k|                                FLUSHBITS(u4_offset, u4_clz)
  ------------------
  |  |  193|  65.8k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  65.8k|{                                                                           \
  |  |  195|  65.8k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  65.8k|}
  ------------------
  412|  65.8k|                                NEXTBITS(read_bits, u4_offset, pu4_buffer, CABAC_BITS_TO_READ)
  ------------------
  |  |  137|  65.8k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  65.8k|{                                                                           \
  |  |  139|  65.8k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  65.8k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  65.8k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  65.8k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  65.8k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 63.6k, False: 2.10k]
  |  |  ------------------
  |  |  144|  65.8k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  63.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  65.8k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  65.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  65.8k|}
  ------------------
  413|  65.8k|                                u4_code_int_range = u4_code_int_range << u4_clz;
  414|  65.8k|                                u4_code_int_val_ofst = (u4_code_int_val_ofst
  415|  65.8k|                                                << u4_clz) | read_bits;
  416|       |
  417|  65.8k|                            }
  418|       |
  419|  65.8k|                            do
  420|  84.7k|                            {
  421|  84.7k|                                bits_to_flush++;
  422|       |
  423|  84.7k|                                u4_code_int_range = u4_code_int_range >> 1;
  424|       |
  425|  84.7k|                                if(u4_code_int_val_ofst >= u4_code_int_range)
  ------------------
  |  Branch (425:36): [True: 19.0k, False: 65.7k]
  ------------------
  426|  19.0k|                                {
  427|       |                                    /* S=1 */
  428|  19.0k|                                    uc_bin = 1;
  429|  19.0k|                                    u4_code_int_val_ofst -= u4_code_int_range;
  430|  19.0k|                                }
  431|  65.7k|                                else
  432|  65.7k|                                {
  433|       |                                    /* S=0 */
  434|  65.7k|                                    uc_bin = 0;
  435|  65.7k|                                }
  436|       |
  437|  84.7k|                                INC_BIN_COUNT(
  438|  84.7k|                                                ps_cab_env);INC_BYPASS_BINS(ps_cab_env);
  439|       |
  440|  84.7k|                            }
  441|  84.7k|                            while(uc_bin && (bits_to_flush < CABAC_BITS_TO_READ));
  ------------------
  |  |  618|  19.0k|#define CABAC_BITS_TO_READ 23
  ------------------
  |  Branch (441:35): [True: 19.0k, False: 65.7k]
  |  Branch (441:45): [True: 18.9k, False: 15]
  ------------------
  442|       |
  443|  65.8k|                            u4_value = (bits_to_flush - 1);
  444|       |
  445|  65.8k|                        }
  446|       |                        /*inlining ih264d_decode_bypass_bins_unary ends*/
  447|       |
  448|  65.8k|                        ui16_sufS = (1 << u4_value);
  449|  65.8k|                        u1_max_bins = u4_value;
  450|       |
  451|  65.8k|                        if(u4_value > 0)
  ------------------
  |  Branch (451:28): [True: 9.27k, False: 56.5k]
  ------------------
  452|  9.27k|                        {
  453|       |
  454|       |                            /*inline bypassbins_flc begins*/
  455|       |
  456|  9.27k|                            if(u4_value > 10)
  ------------------
  |  Branch (456:32): [True: 108, False: 9.16k]
  ------------------
  457|    108|                            {
  458|    108|                                UWORD32 u4_clz, read_bits;
  459|       |
  460|    108|                                u4_clz = CLZ(u4_code_int_range);
  461|    108|                                FLUSHBITS(u4_offset, u4_clz)
  ------------------
  |  |  193|    108|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|    108|{                                                                           \
  |  |  195|    108|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|    108|}
  ------------------
  462|    108|                                NEXTBITS(read_bits, u4_offset, pu4_buffer, CABAC_BITS_TO_READ)
  ------------------
  |  |  137|    108|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|    108|{                                                                           \
  |  |  139|    108|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|    108|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|    108|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|    108|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|    108|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 65, False: 43]
  |  |  ------------------
  |  |  144|    108|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|     65|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|    108|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|    108|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|    108|}
  ------------------
  463|    108|                                u4_code_int_range = u4_code_int_range << u4_clz;
  464|    108|                                u4_code_int_val_ofst = (u4_code_int_val_ofst
  465|    108|                                                << u4_clz) | read_bits;
  466|    108|                            }
  467|       |
  468|  9.27k|                            {
  469|  9.27k|                                UWORD32 ui_bins;
  470|  9.27k|                                UWORD32 uc_bin;
  471|  9.27k|                                UWORD32 bits_to_flush;
  472|       |
  473|  9.27k|                                ui_bins = 0;
  474|  9.27k|                                bits_to_flush = 0;
  475|       |
  476|  9.27k|                                do
  477|  18.9k|                                {
  478|  18.9k|                                    bits_to_flush++;
  479|       |
  480|  18.9k|                                    u4_code_int_range = u4_code_int_range >> 1;
  481|       |
  482|  18.9k|                                    if(u4_code_int_val_ofst
  ------------------
  |  Branch (482:40): [True: 9.23k, False: 9.75k]
  ------------------
  483|  18.9k|                                                    >= u4_code_int_range)
  484|  9.23k|                                    {
  485|       |                                        /* S=1 */
  486|  9.23k|                                        uc_bin = 1;
  487|  9.23k|                                        u4_code_int_val_ofst -=
  488|  9.23k|                                                        u4_code_int_range;
  489|  9.23k|                                    }
  490|  9.75k|                                    else
  491|  9.75k|                                    {
  492|       |                                        /* S=0 */
  493|  9.75k|                                        uc_bin = 0;
  494|  9.75k|                                    }
  495|       |
  496|  18.9k|                                    INC_BIN_COUNT(
  497|  18.9k|                                                    ps_cab_env);INC_BYPASS_BINS(ps_cab_env);
  498|       |
  499|  18.9k|                                    ui_bins = ((ui_bins << 1) | uc_bin);
  500|       |
  501|  18.9k|                                }
  502|  18.9k|                                while(bits_to_flush < u1_max_bins);
  ------------------
  |  Branch (502:39): [True: 9.71k, False: 9.27k]
  ------------------
  503|       |
  504|  9.27k|                                u4_value = ui_bins;
  505|  9.27k|                            }
  506|       |
  507|       |                            /*inline bypassbins_flc ends*/
  508|       |
  509|  9.27k|                        }
  510|       |
  511|       |                        //Value of K
  512|  65.8k|                        ui16_sufS += u4_value;
  513|  65.8k|                        i2_abs_lvl += ui16_sufS;
  514|       |
  515|  65.8k|                    }
  516|  1.18M|                    else
  517|  1.18M|                        i2_abs_lvl = 1 + ui_prefix;
  518|       |
  519|  1.24M|                    if(i2_abs_lvl > 1)
  ------------------
  |  Branch (519:24): [True: 259k, False: 989k]
  ------------------
  520|   259k|                    {
  521|   259k|                        u1_abs_level_gt1++;
  522|   259k|                    }
  523|  1.24M|                    if(!u1_abs_level_gt1)
  ------------------
  |  Branch (523:24): [True: 915k, False: 333k]
  ------------------
  524|   915k|                    {
  525|   915k|                        u1_abs_level_equal1++;
  526|   915k|                        u4_ctx_inc = (5 << 4) + MIN(u1_abs_level_equal1, 4);
  ------------------
  |  |   61|   915k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 636k, False: 278k]
  |  |  ------------------
  ------------------
  527|   915k|                    }
  528|   333k|                    else
  529|   333k|                        u4_ctx_inc = (5 + MIN(u1_abs_level_gt1, 4)) << 4;
  ------------------
  |  |   61|   333k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 254k, False: 78.8k]
  |  |  ------------------
  ------------------
  530|       |
  531|       |                    /*u4_ctx_inc = g_table_temp[u1_abs_level_gt1][u1_abs_level_equal1];*/
  532|       |
  533|       |                    /* encode coeff_sign_flag[i] */
  534|       |
  535|  1.24M|                    {
  536|  1.24M|                        u4_code_int_range = u4_code_int_range >> 1;
  537|       |
  538|  1.24M|                        if(u4_code_int_val_ofst >= (u4_code_int_range))
  ------------------
  |  Branch (538:28): [True: 439k, False: 809k]
  ------------------
  539|   439k|                        {
  540|       |                            /* S=1 */
  541|   439k|                            u4_code_int_val_ofst -= u4_code_int_range;
  542|   439k|                            i2_abs_lvl = (-i2_abs_lvl);
  543|   439k|                        }
  544|       |
  545|  1.24M|                    }
  546|  1.24M|                    num_sig_coeffs--;
  547|  1.24M|                    *pi2_coeff_data++ = i2_abs_lvl;
  548|  1.24M|                }
  549|  1.24M|            }
  550|  1.24M|            while(num_sig_coeffs > 0);
  ------------------
  |  Branch (550:19): [True: 793k, False: 455k]
  ------------------
  551|   455k|        }
  552|   455k|    }
  553|       |
  554|  1.07M|    if(u4_coded_flag)
  ------------------
  |  Branch (554:8): [True: 455k, False: 615k]
  ------------------
  555|   455k|    {
  556|   455k|        WORD32 offset;
  557|   455k|        offset = (UWORD8 *)pi2_coeff_data - (UWORD8 *)ps_tu_4x4;
  558|   455k|        offset = ALIGN4(offset);
  ------------------
  |  |   52|   455k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  559|   455k|        ps_dec->pv_parse_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_parse_tu_coeff_data + offset);
  560|   455k|    }
  561|       |
  562|       |
  563|       |    /*updating structures*/
  564|  1.07M|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  565|  1.07M|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  566|  1.07M|    ps_bitstrm->u4_ofst = u4_offset;
  567|  1.07M|    return (u4_coded_flag);
  568|  1.07M|}
ih264d_read_coeff8x8_cabac:
  585|   131k|{
  586|   131k|    decoding_envirnoment_t *ps_cab_env = &ps_dec->s_cab_dec_env;
  587|   131k|    UWORD32 u4_offset, *pu4_buffer;
  588|   131k|    UWORD32 u4_code_int_range, u4_code_int_val_ofst;
  589|       |
  590|       |    /* High profile related declarations */
  591|   131k|    UWORD8 u1_field_coding_flag = ps_cur_mb_info->ps_curmb->u1_mb_fld;
  592|   131k|    const UWORD8 *pu1_lastcoeff_context_inc =
  593|   131k|                    (UWORD8 *)gau1_ih264d_lastcoeff_context_inc;
  594|   131k|    const UWORD8 *pu1_sigcoeff_context_inc;
  595|   131k|    bin_ctxt_model_t *ps_ctxt_sig_coeff;
  596|   131k|    WORD32 num_sig_coeffs = 0;
  597|   131k|    tu_blk8x8_coeff_data_t *ps_tu_8x8;
  598|   131k|    WORD16 *pi2_coeff_data;
  599|       |
  600|       |    /*loading from strcuctures*/
  601|       |
  602|   131k|    ps_tu_8x8 = (tu_blk8x8_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
  603|   131k|    ps_tu_8x8->au4_sig_coeff_map[0] = 0;
  604|   131k|    ps_tu_8x8->au4_sig_coeff_map[1] = 0;
  605|   131k|    pi2_coeff_data = &ps_tu_8x8->ai2_level[0];
  606|       |
  607|       |
  608|   131k|    if(!u1_field_coding_flag)
  ------------------
  |  Branch (608:8): [True: 131k, False: 0]
  ------------------
  609|   131k|    {
  610|   131k|        pu1_sigcoeff_context_inc =
  611|   131k|                        (UWORD8 *)gau1_ih264d_sigcoeff_context_inc_frame;
  612|       |
  613|       |        /*******************************************************************/
  614|       |        /* last coefficient context is derived from significant coeff u4_flag */
  615|       |        /* only significant coefficient matrix need to be initialized      */
  616|       |        /*******************************************************************/
  617|   131k|        ps_ctxt_sig_coeff = ps_dec->s_high_profile.ps_sigcoeff_8x8_frame;
  618|   131k|    }
  619|      0|    else
  620|      0|    {
  621|      0|        pu1_sigcoeff_context_inc =
  622|      0|                        (UWORD8 *)gau1_ih264d_sigcoeff_context_inc_field;
  623|       |
  624|       |        /*******************************************************************/
  625|       |        /* last coefficient context is derived from significant coeff u4_flag */
  626|       |        /* only significant coefficient matrix need to be initialized      */
  627|       |        /*******************************************************************/
  628|      0|        ps_ctxt_sig_coeff = ps_dec->s_high_profile.ps_sigcoeff_8x8_field;
  629|      0|    }
  630|       |
  631|       |    /*loading from strcuctures*/
  632|       |
  633|   131k|    u4_offset = ps_bitstrm->u4_ofst;
  634|   131k|    pu4_buffer = ps_bitstrm->pu4_buffer;
  635|       |
  636|   131k|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  637|   131k|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  638|       |
  639|   131k|    {
  640|   131k|        {
  641|   131k|            bin_ctxt_model_t *p_binCtxt_last, *p_binCtxt_last_org,
  642|   131k|                            *p_ctxt_sig_coeff_org;
  643|   131k|            UWORD32 uc_last_coeff_idx;
  644|   131k|            UWORD32 uc_bin;
  645|   131k|            UWORD32 i;
  646|       |
  647|   131k|            i = 0;
  648|       |
  649|   131k|            uc_last_coeff_idx = 63;
  650|       |
  651|   131k|            p_binCtxt_last_org = ps_ctxt_sig_coeff
  652|   131k|                            + LAST_COEFF_CTXT_MINUS_SIG_COEFF_CTXT_8X8;
  ------------------
  |  |   85|   131k|#define LAST_COEFF_CTXT_MINUS_SIG_COEFF_CTXT_8X8 15
  ------------------
  653|       |
  654|   131k|            p_ctxt_sig_coeff_org = ps_ctxt_sig_coeff;
  655|       |
  656|   131k|            do
  657|  3.45M|            {
  658|       |                /*inilined DecodeDecision_onebin begins*/
  659|  3.45M|                {
  660|  3.45M|                    UWORD32 u4_qnt_int_range, u4_int_range_lps;
  661|  3.45M|                    UWORD32 u4_symbol, u1_mps_state;
  662|  3.45M|                    UWORD32 table_lookup;
  663|  3.45M|                    const UWORD32 *pu4_table =
  664|  3.45M|                                    (const UWORD32 *)ps_cab_env->cabac_table;
  665|  3.45M|                    UWORD32 u4_clz;
  666|       |
  667|  3.45M|                    u1_mps_state = (ps_ctxt_sig_coeff->u1_mps_state);
  668|       |
  669|  3.45M|                    u4_clz = CLZ(u4_code_int_range);
  670|       |
  671|  3.45M|                    u4_qnt_int_range = u4_code_int_range << u4_clz;
  672|  3.45M|                    u4_qnt_int_range = (u4_qnt_int_range >> 29) & 0x3;
  673|       |
  674|  3.45M|                    table_lookup = pu4_table[(u1_mps_state << 2)
  675|  3.45M|                                    + u4_qnt_int_range];
  676|       |
  677|  3.45M|                    u4_int_range_lps = table_lookup & 0xff;
  678|       |
  679|  3.45M|                    u4_int_range_lps = u4_int_range_lps << (23 - u4_clz);
  680|  3.45M|                    u4_code_int_range = u4_code_int_range - u4_int_range_lps;
  681|  3.45M|                    u4_symbol = ((u1_mps_state >> 6) & 0x1);
  682|  3.45M|                    u1_mps_state = (table_lookup >> 8) & 0x7F;
  683|       |
  684|  3.45M|                    CHECK_IF_LPS(u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  184|  3.45M|                    u4_codeIntRangeLPS_m,u1_mps_state_m,table_lookup_m)                     \
  |  |  185|  3.45M|{                                                                                         \
  |  |  186|  3.45M|  if(u4_codeIntValOffset_m >= u4_codeIntRange_m)                                            \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 145k, False: 3.30M]
  |  |  ------------------
  |  |  187|  3.45M|  {                                                                                         \
  |  |  188|   145k|      u4_symbol_m = 1 - u4_symbol_m;                                                        \
  |  |  189|   145k|      u4_codeIntValOffset_m -= u4_codeIntRange_m;                                           \
  |  |  190|   145k|      u4_codeIntRange_m = u4_codeIntRangeLPS_m;                                             \
  |  |  191|   145k|      u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                       \
  |  |  192|   145k|  }                                                                                         \
  |  |  193|  3.45M|}
  ------------------
  685|  3.45M|                                 u4_symbol, u4_int_range_lps, u1_mps_state,
  686|  3.45M|                                 table_lookup)
  687|       |
  688|  3.45M|                    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_14)
  ------------------
  |  |  115|  3.45M|#define ONE_RIGHT_SHIFTED_BY_14 1<<14
  ------------------
  |  Branch (688:24): [True: 36.6k, False: 3.41M]
  ------------------
  689|  36.6k|                    {
  690|  36.6k|                        UWORD32 read_bits, u4_clz;
  691|  36.6k|                        u4_clz = CLZ(u4_code_int_range);
  692|  36.6k|                        NEXTBITS(read_bits, (u4_offset + 23), pu4_buffer,
  ------------------
  |  |  137|  36.6k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  36.6k|{                                                                           \
  |  |  139|  36.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  36.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  36.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  36.6k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  36.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 35.6k, False: 1.03k]
  |  |  ------------------
  |  |  144|  36.6k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  35.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  36.6k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  36.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  36.6k|}
  ------------------
  693|  36.6k|                                 u4_clz)
  694|  36.6k|                        FLUSHBITS(u4_offset, (u4_clz))
  ------------------
  |  |  193|  36.6k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  36.6k|{                                                                           \
  |  |  195|  36.6k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  36.6k|}
  ------------------
  695|  36.6k|                        u4_code_int_range = u4_code_int_range << u4_clz;
  696|  36.6k|                        u4_code_int_val_ofst = (u4_code_int_val_ofst << u4_clz)
  697|  36.6k|                                        | read_bits;
  698|  36.6k|                    }
  699|       |
  700|  3.45M|                    ps_ctxt_sig_coeff->u1_mps_state = u1_mps_state;
  701|  3.45M|                    uc_bin = u4_symbol;
  702|  3.45M|                }
  703|       |                /*incrementing pointer to point to the context of the next bin*/
  704|  3.45M|                ps_ctxt_sig_coeff = p_ctxt_sig_coeff_org
  705|  3.45M|                                + pu1_sigcoeff_context_inc[i + 1];
  706|       |
  707|       |                /*inilined DecodeDecision_onebin ends*/
  708|  3.45M|                if(uc_bin)
  ------------------
  |  Branch (708:20): [True: 341k, False: 3.11M]
  ------------------
  709|   341k|                {
  710|   341k|                    num_sig_coeffs++;
  711|   341k|                    SET_BIT(ps_tu_8x8->au4_sig_coeff_map[i>31], (i > 31 ? i - 32:i));
  ------------------
  |  |  106|   682k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  |  |  ------------------
  |  |  |  Branch (106:43): [True: 23.7k, False: 317k]
  |  |  ------------------
  ------------------
  712|       |
  713|   341k|                    p_binCtxt_last = p_binCtxt_last_org
  714|   341k|                                    + pu1_lastcoeff_context_inc[i];
  715|       |
  716|       |                    /*inilined DecodeDecision_onebin begins*/
  717|       |
  718|   341k|                    {
  719|   341k|                        UWORD32 u4_qnt_int_range, u4_int_range_lps;
  720|   341k|                        UWORD32 u4_symbol, u1_mps_state;
  721|   341k|                        UWORD32 table_lookup;
  722|   341k|                        const UWORD32 *pu4_table =
  723|   341k|                                        (const UWORD32 *)ps_cab_env->cabac_table;
  724|   341k|                        UWORD32 u4_clz;
  725|       |
  726|   341k|                        u1_mps_state = (p_binCtxt_last->u1_mps_state);
  727|       |
  728|   341k|                        u4_clz = CLZ(u4_code_int_range);
  729|   341k|                        u4_qnt_int_range = u4_code_int_range << u4_clz;
  730|   341k|                        u4_qnt_int_range = (u4_qnt_int_range >> 29)
  731|   341k|                                        & 0x3;
  732|       |
  733|   341k|                        table_lookup = pu4_table[(u1_mps_state << 2)
  734|   341k|                                        + u4_qnt_int_range];
  735|   341k|                        u4_int_range_lps = table_lookup & 0xff;
  736|       |
  737|   341k|                        u4_int_range_lps = u4_int_range_lps
  738|   341k|                                        << (23 - u4_clz);
  739|       |
  740|   341k|                        u4_code_int_range = u4_code_int_range
  741|   341k|                                        - u4_int_range_lps;
  742|   341k|                        u4_symbol = ((u1_mps_state >> 6) & 0x1);
  743|   341k|                        u1_mps_state = (table_lookup >> 8) & 0x7F;
  744|       |
  745|   341k|                        CHECK_IF_LPS(u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  184|   341k|                    u4_codeIntRangeLPS_m,u1_mps_state_m,table_lookup_m)                     \
  |  |  185|   341k|{                                                                                         \
  |  |  186|   341k|  if(u4_codeIntValOffset_m >= u4_codeIntRange_m)                                            \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 36.2k, False: 304k]
  |  |  ------------------
  |  |  187|   341k|  {                                                                                         \
  |  |  188|  36.2k|      u4_symbol_m = 1 - u4_symbol_m;                                                        \
  |  |  189|  36.2k|      u4_codeIntValOffset_m -= u4_codeIntRange_m;                                           \
  |  |  190|  36.2k|      u4_codeIntRange_m = u4_codeIntRangeLPS_m;                                             \
  |  |  191|  36.2k|      u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                       \
  |  |  192|  36.2k|  }                                                                                         \
  |  |  193|   341k|}
  ------------------
  746|   341k|                                     u4_symbol, u4_int_range_lps,
  747|   341k|                                     u1_mps_state, table_lookup)
  748|       |
  749|   341k|                        p_binCtxt_last->u1_mps_state = u1_mps_state;
  750|   341k|                        uc_bin = u4_symbol;
  751|   341k|                    }
  752|       |
  753|       |                    /*inilined DecodeDecision_onebin ends*/
  754|   341k|                    if(uc_bin == 1)
  ------------------
  |  Branch (754:24): [True: 93.8k, False: 247k]
  ------------------
  755|  93.8k|                        goto label_read_levels;
  756|       |
  757|   341k|                }
  758|       |
  759|  3.35M|                i = i + 1;
  760|       |
  761|  3.35M|            }
  762|  3.35M|            while(i < uc_last_coeff_idx);
  ------------------
  |  Branch (762:19): [True: 3.32M, False: 37.7k]
  ------------------
  763|       |
  764|  37.7k|            num_sig_coeffs++;
  765|  37.7k|            SET_BIT(ps_tu_8x8->au4_sig_coeff_map[i>31], (i > 31 ? i - 32:i));
  ------------------
  |  |  106|  75.5k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  |  |  ------------------
  |  |  |  Branch (106:43): [True: 37.7k, False: 0]
  |  |  ------------------
  ------------------
  766|       |
  767|   131k|            label_read_levels: ;
  768|   131k|        }
  769|       |
  770|       |        /// VALUE of No of Coeff in BLOCK = i + 1 for second case else i;
  771|       |
  772|       |        /* Decode coeff_abs_level_minus1 and coeff_sign_flag */
  773|      0|        {
  774|   131k|            WORD32 i2_abs_lvl;
  775|   131k|            UWORD32 u1_abs_level_equal1 = 1, u1_abs_level_gt1 = 0;
  776|       |
  777|   131k|            UWORD32 u4_ctx_inc;
  778|   131k|            UWORD32 ui_prefix;
  779|   131k|            bin_ctxt_model_t *p_ctxt_abs_level;
  780|       |
  781|   131k|            p_ctxt_abs_level =
  782|   131k|                            ps_dec->p_coeff_abs_level_minus1_t[LUMA_8X8_CTXCAT];
  ------------------
  |  |   76|   131k|#define LUMA_8X8_CTXCAT   5
  ------------------
  783|   131k|            u4_ctx_inc = ((0x51));
  784|       |
  785|       |            /*****************************************************/
  786|       |            /* Main Loop runs for no. of Significant coefficient */
  787|       |            /*****************************************************/
  788|   131k|            do
  789|   378k|            {
  790|   378k|                {
  791|       |
  792|       |                    /*****************************************************/
  793|       |                    /* inilining a modified ih264d_decode_bins_unary     */
  794|       |                    /*****************************************************/
  795|       |
  796|   378k|                    {
  797|   378k|                        UWORD32 u4_value;
  798|   378k|                        UWORD32 u4_symbol;
  799|   378k|                        bin_ctxt_model_t *ps_bin_ctxt;
  800|   378k|                        UWORD32 u4_ctx_Inc;
  801|   378k|                        u4_value = 0;
  802|       |
  803|   378k|                        u4_ctx_Inc = u4_ctx_inc & 0xf;
  804|   378k|                        ps_bin_ctxt = p_ctxt_abs_level + u4_ctx_Inc;
  805|       |
  806|   378k|                        do
  807|   575k|                        {
  808|   575k|                            {
  809|   575k|                                UWORD32 u4_qnt_int_range,
  810|   575k|                                                u4_int_range_lps;
  811|   575k|                                UWORD32 u1_mps_state;
  812|   575k|                                UWORD32 table_lookup;
  813|   575k|                                const UWORD32 *pu4_table =
  814|   575k|                                                (const UWORD32 *)ps_cab_env->cabac_table;
  815|   575k|                                UWORD32 u4_clz;
  816|       |
  817|   575k|                                u1_mps_state = (ps_bin_ctxt->u1_mps_state);
  818|   575k|                                u4_clz = CLZ(u4_code_int_range);
  819|   575k|                                u4_qnt_int_range = u4_code_int_range
  820|   575k|                                                << u4_clz;
  821|   575k|                                u4_qnt_int_range = (u4_qnt_int_range
  822|   575k|                                                >> 29) & 0x3;
  823|   575k|                                table_lookup = pu4_table[(u1_mps_state << 2)
  824|   575k|                                                + u4_qnt_int_range];
  825|   575k|                                u4_int_range_lps = table_lookup & 0xff;
  826|       |
  827|   575k|                                u4_int_range_lps = u4_int_range_lps
  828|   575k|                                                << (23 - u4_clz);
  829|   575k|                                u4_code_int_range = u4_code_int_range
  830|   575k|                                                - u4_int_range_lps;
  831|   575k|                                u4_symbol = ((u1_mps_state >> 6) & 0x1);
  832|   575k|                                u1_mps_state = (table_lookup >> 8) & 0x7F;
  833|       |
  834|   575k|                                CHECK_IF_LPS(u4_code_int_range,
  ------------------
  |  |  184|   575k|                    u4_codeIntRangeLPS_m,u1_mps_state_m,table_lookup_m)                     \
  |  |  185|   575k|{                                                                                         \
  |  |  186|   575k|  if(u4_codeIntValOffset_m >= u4_codeIntRange_m)                                            \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 59.2k, False: 516k]
  |  |  ------------------
  |  |  187|   575k|  {                                                                                         \
  |  |  188|  59.2k|      u4_symbol_m = 1 - u4_symbol_m;                                                        \
  |  |  189|  59.2k|      u4_codeIntValOffset_m -= u4_codeIntRange_m;                                           \
  |  |  190|  59.2k|      u4_codeIntRange_m = u4_codeIntRangeLPS_m;                                             \
  |  |  191|  59.2k|      u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                       \
  |  |  192|  59.2k|  }                                                                                         \
  |  |  193|   575k|}
  ------------------
  835|   575k|                                             u4_code_int_val_ofst, u4_symbol,
  836|   575k|                                             u4_int_range_lps, u1_mps_state,
  837|   575k|                                             table_lookup)
  838|       |
  839|   575k|                                if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_9)
  ------------------
  |  |  114|   575k|#define ONE_RIGHT_SHIFTED_BY_9    1<<9
  ------------------
  |  Branch (839:36): [True: 12.4k, False: 563k]
  ------------------
  840|  12.4k|                                {
  841|       |
  842|  12.4k|                                    RENORM_RANGE_OFFSET(u4_code_int_range,
  ------------------
  |  |  170|  12.4k|  {                                                                                         \
  |  |  171|  12.4k|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|  12.4k|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|  12.4k|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  12.4k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  12.4k|{                                                                           \
  |  |  |  |  139|  12.4k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  12.4k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  12.4k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  12.4k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  12.4k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 11.8k, False: 573]
  |  |  |  |  ------------------
  |  |  |  |  144|  12.4k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  11.8k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  12.4k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  12.4k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  12.4k|}
  |  |  ------------------
  |  |  174|  12.4k|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|  12.4k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  12.4k|{                                                                           \
  |  |  |  |  195|  12.4k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  12.4k|}
  |  |  ------------------
  |  |  175|  12.4k|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|  12.4k|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|  12.4k|  }
  ------------------
  843|  12.4k|                                                        u4_code_int_val_ofst,
  844|  12.4k|                                                        u4_offset, pu4_buffer)
  845|  12.4k|                                }
  846|       |
  847|   575k|                                ps_bin_ctxt->u1_mps_state = u1_mps_state;
  848|   575k|                            }
  849|       |
  850|   575k|                            u4_value++;
  851|   575k|                            ps_bin_ctxt = p_ctxt_abs_level + (u4_ctx_inc >> 4);
  852|       |
  853|   575k|                        }
  854|   575k|                        while(u4_symbol && (u4_value < UCOFF_LEVEL));
  ------------------
  |  |   41|   205k|#define UCOFF_LEVEL  14
  ------------------
  |  Branch (854:31): [True: 205k, False: 370k]
  |  Branch (854:44): [True: 196k, False: 8.77k]
  ------------------
  855|       |
  856|   378k|                        ui_prefix = u4_value - 1 + u4_symbol;
  857|   378k|                    }
  858|       |
  859|   378k|                    if(ui_prefix == UCOFF_LEVEL)
  ------------------
  |  |   41|   378k|#define UCOFF_LEVEL  14
  ------------------
  |  Branch (859:24): [True: 8.77k, False: 370k]
  ------------------
  860|  8.77k|                    {
  861|  8.77k|                        UWORD32 ui16_sufS = 0;
  862|  8.77k|                        UWORD32 u1_max_bins;
  863|  8.77k|                        UWORD32 u4_value;
  864|       |
  865|  8.77k|                        i2_abs_lvl = UCOFF_LEVEL;
  ------------------
  |  |   41|  8.77k|#define UCOFF_LEVEL  14
  ------------------
  866|       |                        /*inlining ih264d_decode_bypass_bins_unary begins*/
  867|       |
  868|  8.77k|                        {
  869|  8.77k|                            UWORD32 uc_bin;
  870|  8.77k|                            UWORD32 bits_to_flush;
  871|       |
  872|       |
  873|  8.77k|                            bits_to_flush = 0;
  874|       |                            /*renormalize to ensure there 23 bits more in the u4_code_int_val_ofst*/
  875|  8.77k|                            {
  876|  8.77k|                                UWORD32 u4_clz, read_bits;
  877|       |
  878|  8.77k|                                u4_clz = CLZ(u4_code_int_range);
  879|  8.77k|                                FLUSHBITS(u4_offset, u4_clz)
  ------------------
  |  |  193|  8.77k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  8.77k|{                                                                           \
  |  |  195|  8.77k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  8.77k|}
  ------------------
  880|  8.77k|                                NEXTBITS(read_bits, u4_offset, pu4_buffer, CABAC_BITS_TO_READ)
  ------------------
  |  |  137|  8.77k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  8.77k|{                                                                           \
  |  |  139|  8.77k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  8.77k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  8.77k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  8.77k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  8.77k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 8.45k, False: 319]
  |  |  ------------------
  |  |  144|  8.77k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  8.45k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  8.77k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  8.77k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  8.77k|}
  ------------------
  881|  8.77k|                                u4_code_int_range = u4_code_int_range << u4_clz;
  882|  8.77k|                                u4_code_int_val_ofst = (u4_code_int_val_ofst
  883|  8.77k|                                                << u4_clz) | read_bits;
  884|  8.77k|                            }
  885|       |
  886|  8.77k|                            do
  887|  14.9k|                            {
  888|  14.9k|                                bits_to_flush++;
  889|       |
  890|  14.9k|                                u4_code_int_range = u4_code_int_range >> 1;
  891|       |
  892|  14.9k|                                if(u4_code_int_val_ofst >= u4_code_int_range)
  ------------------
  |  Branch (892:36): [True: 6.20k, False: 8.76k]
  ------------------
  893|  6.20k|                                {
  894|       |                                    /* S=1 */
  895|  6.20k|                                    uc_bin = 1;
  896|  6.20k|                                    u4_code_int_val_ofst -= u4_code_int_range;
  897|  6.20k|                                }
  898|  8.76k|                                else
  899|  8.76k|                                {
  900|       |                                    /* S=0 */
  901|  8.76k|                                    uc_bin = 0;
  902|  8.76k|                                }
  903|       |
  904|  14.9k|                            }
  905|  14.9k|                            while(uc_bin && (bits_to_flush < CABAC_BITS_TO_READ));
  ------------------
  |  |  618|  6.20k|#define CABAC_BITS_TO_READ 23
  ------------------
  |  Branch (905:35): [True: 6.20k, False: 8.76k]
  |  Branch (905:45): [True: 6.19k, False: 15]
  ------------------
  906|       |
  907|  8.77k|                            u4_value = (bits_to_flush - 1);
  908|  8.77k|                        }
  909|       |                        /*inlining ih264d_decode_bypass_bins_unary ends*/
  910|       |
  911|  8.77k|                        ui16_sufS = (1 << u4_value);
  912|  8.77k|                        u1_max_bins = u4_value;
  913|       |
  914|  8.77k|                        if(u4_value > 0)
  ------------------
  |  Branch (914:28): [True: 1.80k, False: 6.96k]
  ------------------
  915|  1.80k|                        {
  916|       |                            /*inline bypassbins_flc begins*/
  917|       |
  918|  1.80k|                            if(u4_value > 10)
  ------------------
  |  Branch (918:32): [True: 159, False: 1.65k]
  ------------------
  919|    159|                            {
  920|    159|                                UWORD32 u4_clz, read_bits;
  921|       |
  922|    159|                                u4_clz = CLZ(u4_code_int_range);
  923|    159|                                FLUSHBITS(u4_offset, u4_clz)
  ------------------
  |  |  193|    159|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|    159|{                                                                           \
  |  |  195|    159|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|    159|}
  ------------------
  924|    159|                                NEXTBITS(read_bits, u4_offset, pu4_buffer, CABAC_BITS_TO_READ)
  ------------------
  |  |  137|    159|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|    159|{                                                                           \
  |  |  139|    159|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|    159|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|    159|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|    159|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|    159|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 125, False: 34]
  |  |  ------------------
  |  |  144|    159|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|    125|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|    159|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|    159|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|    159|}
  ------------------
  925|    159|                                u4_code_int_range = u4_code_int_range << u4_clz;
  926|    159|                                u4_code_int_val_ofst = (u4_code_int_val_ofst
  927|    159|                                                << u4_clz) | read_bits;
  928|    159|                            }
  929|       |
  930|  1.80k|                            {
  931|  1.80k|                                UWORD32 ui_bins;
  932|  1.80k|                                UWORD32 uc_bin;
  933|  1.80k|                                UWORD32 bits_to_flush;
  934|       |
  935|  1.80k|                                ui_bins = 0;
  936|  1.80k|                                bits_to_flush = 0;
  937|       |
  938|  1.80k|                                do
  939|  6.19k|                                {
  940|  6.19k|                                    bits_to_flush++;
  941|       |
  942|  6.19k|                                    u4_code_int_range = u4_code_int_range >> 1;
  943|       |
  944|  6.19k|                                    if(u4_code_int_val_ofst
  ------------------
  |  Branch (944:40): [True: 2.43k, False: 3.76k]
  ------------------
  945|  6.19k|                                                    >= u4_code_int_range)
  946|  2.43k|                                    {
  947|       |                                        /* S=1 */
  948|  2.43k|                                        uc_bin = 1;
  949|  2.43k|                                        u4_code_int_val_ofst -=
  950|  2.43k|                                                        u4_code_int_range;
  951|  2.43k|                                    }
  952|  3.76k|                                    else
  953|  3.76k|                                    {
  954|       |                                        /* S=0 */
  955|  3.76k|                                        uc_bin = 0;
  956|  3.76k|                                    }
  957|       |
  958|  6.19k|                                    ui_bins = ((ui_bins << 1) | uc_bin);
  959|       |
  960|  6.19k|                                }
  961|  6.19k|                                while(bits_to_flush < u1_max_bins);
  ------------------
  |  Branch (961:39): [True: 4.38k, False: 1.80k]
  ------------------
  962|       |
  963|  1.80k|                                u4_value = ui_bins;
  964|  1.80k|                            }
  965|       |                            /*inline bypassbins_flc ends*/
  966|  1.80k|                        }
  967|       |
  968|       |                        //Value of K
  969|  8.77k|                        ui16_sufS += u4_value;
  970|  8.77k|                        i2_abs_lvl += (WORD32)ui16_sufS;
  971|  8.77k|                    }
  972|   370k|                    else
  973|   370k|                    {
  974|   370k|                        i2_abs_lvl = 1 + ui_prefix;
  975|   370k|                    }
  976|       |
  977|   378k|                    if(i2_abs_lvl > 1)
  ------------------
  |  Branch (977:24): [True: 49.9k, False: 328k]
  ------------------
  978|  49.9k|                    {
  979|  49.9k|                        u1_abs_level_gt1++;
  980|  49.9k|                    }
  981|   378k|                    if(!u1_abs_level_gt1)
  ------------------
  |  Branch (981:24): [True: 293k, False: 84.8k]
  ------------------
  982|   293k|                    {
  983|   293k|                        u1_abs_level_equal1++;
  984|   293k|                        u4_ctx_inc = (5 << 4) + MIN(u1_abs_level_equal1, 4);
  ------------------
  |  |   61|   293k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 200k, False: 93.6k]
  |  |  ------------------
  ------------------
  985|   293k|                    }
  986|  84.8k|                    else
  987|  84.8k|                    {
  988|  84.8k|                        u4_ctx_inc = (5 + MIN(u1_abs_level_gt1, 4)) << 4;
  ------------------
  |  |   61|  84.8k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 61.3k, False: 23.4k]
  |  |  ------------------
  ------------------
  989|  84.8k|                    }
  990|       |
  991|       |                    /*u4_ctx_inc = g_table_temp[u1_abs_level_gt1][u1_abs_level_equal1];*/
  992|       |
  993|       |                    /* encode coeff_sign_flag[i] */
  994|       |
  995|   378k|                    {
  996|   378k|                        u4_code_int_range = u4_code_int_range >> 1;
  997|       |
  998|   378k|                        if(u4_code_int_val_ofst >= (u4_code_int_range))
  ------------------
  |  Branch (998:28): [True: 114k, False: 264k]
  ------------------
  999|   114k|                        {
 1000|       |                            /* S=1 */
 1001|   114k|                            u4_code_int_val_ofst -= u4_code_int_range;
 1002|   114k|                            i2_abs_lvl = (-i2_abs_lvl);
 1003|   114k|                        }
 1004|   378k|                    }
 1005|       |
 1006|   378k|                    *pi2_coeff_data++ = i2_abs_lvl;
 1007|   378k|                    num_sig_coeffs--;
 1008|   378k|                }
 1009|   378k|            }
 1010|   378k|            while(num_sig_coeffs > 0);
  ------------------
  |  Branch (1010:19): [True: 247k, False: 131k]
  ------------------
 1011|   131k|        }
 1012|   131k|    }
 1013|       |
 1014|      0|    {
 1015|   131k|        WORD32 offset;
 1016|   131k|        offset = (UWORD8 *)pi2_coeff_data - (UWORD8 *)ps_tu_8x8;
 1017|   131k|        offset = ALIGN4(offset);
  ------------------
  |  |   52|   131k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1018|   131k|        ps_dec->pv_parse_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_parse_tu_coeff_data + offset);
 1019|   131k|    }
 1020|       |
 1021|       |    /*updating structures*/
 1022|   131k|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
 1023|   131k|    ps_cab_env->u4_code_int_range = u4_code_int_range;
 1024|   131k|    ps_bitstrm->u4_ofst = u4_offset;
 1025|   131k|}
ih264d_cabac_parse_8x8block:
 1072|   235k|{
 1073|   235k|    UWORD32 u4_ctxinc, u4_subblock_coded;
 1074|   235k|    UWORD32 u4_top0, u4_top1;
 1075|   235k|    UWORD32 u4_csbp = 0;
 1076|   235k|    UWORD32 u4_idx = 0;
 1077|   235k|    dec_bit_stream_t * const ps_bitstrm = ps_dec->ps_bitstrm;
 1078|   235k|    bin_ctxt_model_t * const ps_cbf = ps_dec->p_cbf_t[u4_ctx_cat];
 1079|   235k|    bin_ctxt_model_t *ps_src_bin_ctxt;
 1080|   235k|    bin_ctxt_model_t * const ps_sig_coeff_flag =
 1081|   235k|                    ps_dec->p_significant_coeff_flag_t[u4_ctx_cat];
 1082|       |
 1083|   235k|    UWORD8 *pu1_inv_scan = ps_dec->pu1_inv_scan;
 1084|       |
 1085|       |    /*------------------------------------------------------*/
 1086|       |    /* Residual 4x4 decoding: SubBlock 0                    */
 1087|       |    /*------------------------------------------------------*/
 1088|   235k|    u4_ctxinc = ((!!pu1_top_nnz[0]) << 1) + (!!pu1_left_nnz[0]);
 1089|       |
 1090|   235k|    ps_src_bin_ctxt = ps_cbf + u4_ctxinc;
 1091|       |
 1092|   235k|    u4_top0 = ih264d_read_coeff4x4_cabac( ps_bitstrm,
 1093|   235k|                                         u4_ctx_cat, ps_sig_coeff_flag, ps_dec,
 1094|   235k|                                         ps_src_bin_ctxt);
 1095|       |
 1096|   235k|    INSERT_BIT(u4_csbp, u4_idx, u4_top0);
  ------------------
  |  |  109|   235k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|   235k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1097|       |
 1098|       |    /*------------------------------------------------------*/
 1099|       |    /* Residual 4x4 decoding: SubBlock 1                    */
 1100|       |    /*------------------------------------------------------*/
 1101|   235k|    u4_idx++;
 1102|   235k|    pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|   235k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 1103|   235k|    u4_ctxinc = ((!!pu1_top_nnz[1]) << 1) + u4_top0;
 1104|       |
 1105|   235k|    ps_src_bin_ctxt = ps_cbf + u4_ctxinc;
 1106|       |
 1107|   235k|    u4_top1 = ih264d_read_coeff4x4_cabac(ps_bitstrm,
 1108|   235k|                                         u4_ctx_cat, ps_sig_coeff_flag, ps_dec,
 1109|   235k|                                         ps_src_bin_ctxt);
 1110|       |
 1111|   235k|    INSERT_BIT(u4_csbp, u4_idx, u4_top1);
  ------------------
  |  |  109|   235k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|   235k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1112|   235k|    pu1_left_nnz[0] = u4_top1;
 1113|       |
 1114|       |    /*------------------------------------------------------*/
 1115|       |    /* Residual 4x4 decoding: SubBlock 2                    */
 1116|       |    /*------------------------------------------------------*/
 1117|   235k|    u4_idx += (u4_sub_block_strd - 1);
 1118|   235k|    pi2_coeff_block += ((u4_sub_block_strd - 1) * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|   235k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 1119|   235k|    u4_ctxinc = (u4_top0 << 1) + (!!pu1_left_nnz[1]);
 1120|       |
 1121|   235k|    ps_src_bin_ctxt = ps_cbf + u4_ctxinc;
 1122|       |
 1123|   235k|    u4_subblock_coded = ih264d_read_coeff4x4_cabac(ps_bitstrm, u4_ctx_cat,
 1124|   235k|                                                   ps_sig_coeff_flag, ps_dec,
 1125|   235k|                                                   ps_src_bin_ctxt);
 1126|       |
 1127|   235k|    INSERT_BIT(u4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|   235k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|   235k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1128|   235k|    pu1_top_nnz[0] = u4_subblock_coded;
 1129|       |
 1130|       |    /*------------------------------------------------------*/
 1131|       |    /* Residual 4x4 decoding: SubBlock 3                    */
 1132|       |    /*------------------------------------------------------*/
 1133|   235k|    u4_idx++;
 1134|   235k|    pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|   235k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 1135|   235k|    u4_ctxinc = (u4_top1 << 1) + u4_subblock_coded;
 1136|       |
 1137|   235k|    ps_src_bin_ctxt = ps_cbf + u4_ctxinc;
 1138|       |
 1139|   235k|    u4_subblock_coded = ih264d_read_coeff4x4_cabac(ps_bitstrm, u4_ctx_cat,
 1140|   235k|                                                   ps_sig_coeff_flag, ps_dec,
 1141|   235k|                                                   ps_src_bin_ctxt);
 1142|       |
 1143|   235k|    INSERT_BIT(u4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|   235k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|   235k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1144|   235k|    pu1_top_nnz[1] = pu1_left_nnz[1] = u4_subblock_coded;
 1145|       |
 1146|   235k|    return (u4_csbp);
 1147|   235k|}
ih264d_parse_residual4x4_cabac:
 1164|   344k|{
 1165|   344k|    UWORD8 u1_cbp = ps_cur_mb_info->u1_cbp;
 1166|   344k|    UWORD16 ui16_csbp = 0;
 1167|   344k|    WORD16 *pi2_residual_buf;
 1168|   344k|    UWORD8 uc_ctx_cat;
 1169|   344k|    UWORD8 *pu1_top_nnz = ps_cur_mb_info->ps_curmb->pu1_nnz_y;
 1170|   344k|    UWORD8 *pu1_left_nnz = ps_dec->pu1_left_nnz_y;
 1171|   344k|    UWORD8 *pu1_top_nnz_uv = ps_cur_mb_info->ps_curmb->pu1_nnz_uv;
 1172|   344k|    ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
 1173|   344k|    ctxt_inc_mb_info_t *ps_top_ctxt = ps_dec->p_top_ctxt_mb_info;
 1174|   344k|    dec_bit_stream_t * const ps_bitstrm = ps_dec->ps_bitstrm;
 1175|   344k|    UWORD32 u4_nbr_avail = ps_dec->u1_mb_ngbr_availablity;
 1176|   344k|    WORD16 *pi2_coeff_block = NULL;
 1177|   344k|    bin_ctxt_model_t *ps_src_bin_ctxt;
 1178|       |
 1179|   344k|    UWORD8 u1_top_dc_csbp = (ps_top_ctxt->u1_yuv_dc_csbp) >> 1;
 1180|   344k|    UWORD8 u1_left_dc_csbp = (ps_dec->pu1_left_yuv_dc_csbp[0]) >> 1;
 1181|       |
 1182|       |
 1183|   344k|    if(!(u4_nbr_avail & TOP_MB_AVAILABLE_MASK))
  ------------------
  |  |   55|   344k|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  |  Branch (1183:8): [True: 58.1k, False: 286k]
  ------------------
 1184|  58.1k|    {
 1185|  58.1k|        if(p_curr_ctxt->u1_mb_type & CAB_INTRA_MASK)
  ------------------
  |  |  406|  58.1k|#define CAB_INTRA_MASK    0x04 /* 0000 0100 */
  ------------------
  |  Branch (1185:12): [True: 34.8k, False: 23.3k]
  ------------------
 1186|  34.8k|        {
 1187|  34.8k|            *(UWORD32 *)pu1_top_nnz = 0;
 1188|  34.8k|            u1_top_dc_csbp = 0;
 1189|  34.8k|            *(UWORD32 *)pu1_top_nnz_uv = 0;
 1190|  34.8k|        }
 1191|  23.3k|        else
 1192|  23.3k|        {
 1193|  23.3k|            *(UWORD32 *)pu1_top_nnz = 0x01010101;
 1194|  23.3k|            u1_top_dc_csbp = 0x3;
 1195|  23.3k|            *(UWORD32 *)pu1_top_nnz_uv = 0x01010101;
 1196|  23.3k|        }
 1197|  58.1k|    }
 1198|   286k|    else
 1199|   286k|    {
 1200|   286k|        UWORD32 *pu4_buf;
 1201|   286k|        UWORD8 *pu1_buf;
 1202|   286k|        pu1_buf = ps_cur_mb_info->ps_top_mb->pu1_nnz_y;
 1203|   286k|        pu4_buf = (UWORD32 *)pu1_buf;
 1204|   286k|        *(UWORD32 *)(pu1_top_nnz) = *pu4_buf;
 1205|       |
 1206|   286k|        pu1_buf = ps_cur_mb_info->ps_top_mb->pu1_nnz_uv;
 1207|   286k|        pu4_buf = (UWORD32 *)pu1_buf;
 1208|   286k|        *(UWORD32 *)(pu1_top_nnz_uv) = *pu4_buf;
 1209|       |
 1210|   286k|    }
 1211|       |
 1212|   344k|    if(!(u4_nbr_avail & LEFT_MB_AVAILABLE_MASK))
  ------------------
  |  |   53|   344k|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  |  Branch (1212:8): [True: 74.7k, False: 270k]
  ------------------
 1213|  74.7k|    {
 1214|  74.7k|        if(p_curr_ctxt->u1_mb_type & CAB_INTRA_MASK)
  ------------------
  |  |  406|  74.7k|#define CAB_INTRA_MASK    0x04 /* 0000 0100 */
  ------------------
  |  Branch (1214:12): [True: 55.5k, False: 19.2k]
  ------------------
 1215|  55.5k|        {
 1216|  55.5k|            UWORD32 *pu4_buf;
 1217|  55.5k|            UWORD8 *pu1_buf;
 1218|  55.5k|            *(UWORD32 *)pu1_left_nnz = 0;
 1219|  55.5k|            u1_left_dc_csbp = 0;
 1220|  55.5k|            pu1_buf = ps_dec->pu1_left_nnz_uv;
 1221|  55.5k|            pu4_buf = (UWORD32 *)pu1_buf;
 1222|  55.5k|            *pu4_buf = 0;
 1223|  55.5k|        }
 1224|  19.2k|        else
 1225|  19.2k|        {
 1226|  19.2k|            UWORD32 *pu4_buf;
 1227|  19.2k|            UWORD8 *pu1_buf;
 1228|  19.2k|            *(UWORD32 *)pu1_left_nnz = 0x01010101;
 1229|  19.2k|            u1_left_dc_csbp = 0x3;
 1230|  19.2k|            pu1_buf = ps_dec->pu1_left_nnz_uv;
 1231|  19.2k|            pu4_buf = (UWORD32 *)pu1_buf;
 1232|  19.2k|            *pu4_buf = 0x01010101;
 1233|  19.2k|        }
 1234|  74.7k|    }
 1235|       |
 1236|   344k|    uc_ctx_cat = u1_offset ? LUMA_AC_CTXCAT : LUMA_4X4_CTXCAT;
  ------------------
  |  |   72|  43.2k|#define LUMA_AC_CTXCAT    1
  ------------------
                  uc_ctx_cat = u1_offset ? LUMA_AC_CTXCAT : LUMA_4X4_CTXCAT;
  ------------------
  |  |   73|   646k|#define LUMA_4X4_CTXCAT   2
  ------------------
  |  Branch (1236:18): [True: 43.2k, False: 301k]
  ------------------
 1237|       |
 1238|   344k|    ps_cur_mb_info->u1_qp_div6 = ps_dec->u1_qp_y_div6;
 1239|   344k|    ps_cur_mb_info->u1_qpc_div6 = ps_dec->u1_qp_u_div6;
 1240|   344k|    ps_cur_mb_info->u1_qp_rem6 = ps_dec->u1_qp_y_rem6;
 1241|   344k|    ps_cur_mb_info->u1_qpc_rem6 = ps_dec->u1_qp_u_rem6;
 1242|       |    // CHECK_THIS
 1243|   344k|    ps_cur_mb_info->u1_qpcr_div6 = ps_dec->u1_qp_v_div6;
 1244|   344k|    ps_cur_mb_info->u1_qpcr_rem6 = ps_dec->u1_qp_v_rem6;
 1245|       |
 1246|   344k|    if(u1_cbp & 0x0f)
  ------------------
  |  Branch (1246:8): [True: 117k, False: 227k]
  ------------------
 1247|   117k|    {
 1248|   117k|        if(ps_cur_mb_info->u1_tran_form8x8 == 0)
  ------------------
  |  Branch (1248:12): [True: 74.3k, False: 43.4k]
  ------------------
 1249|  74.3k|        {
 1250|       |            /*******************************************************************/
 1251|       |            /* Block 0 residual decoding, check cbp and proceed (subblock = 0) */
 1252|       |            /*******************************************************************/
 1253|  74.3k|            if(!(u1_cbp & 0x1))
  ------------------
  |  Branch (1253:16): [True: 23.1k, False: 51.1k]
  ------------------
 1254|  23.1k|            {
 1255|  23.1k|                *(UWORD16 *)(pu1_top_nnz) = 0;
 1256|  23.1k|                *(UWORD16 *)(pu1_left_nnz) = 0;
 1257|  23.1k|            }
 1258|  51.1k|            else
 1259|  51.1k|            {
 1260|  51.1k|                ui16_csbp = ih264d_cabac_parse_8x8block(pi2_coeff_block, 4,
 1261|  51.1k|                                                        uc_ctx_cat, ps_dec,
 1262|  51.1k|                                                        pu1_top_nnz,
 1263|  51.1k|                                                        pu1_left_nnz);
 1264|  51.1k|            }
 1265|       |
 1266|       |            /*******************************************************************/
 1267|       |            /* Block 1 residual decoding, check cbp and proceed (subblock = 2) */
 1268|       |            /*******************************************************************/
 1269|  74.3k|            pi2_coeff_block += (2 * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  74.3k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 1270|  74.3k|            if(!(u1_cbp & 0x2))
  ------------------
  |  Branch (1270:16): [True: 26.6k, False: 47.6k]
  ------------------
 1271|  26.6k|            {
 1272|  26.6k|                *(UWORD16 *)(pu1_top_nnz + 2) = 0;
 1273|  26.6k|                *(UWORD16 *)(pu1_left_nnz) = 0;
 1274|  26.6k|            }
 1275|  47.6k|            else
 1276|  47.6k|            {
 1277|  47.6k|                UWORD32 u4_temp = ih264d_cabac_parse_8x8block(pi2_coeff_block,
 1278|  47.6k|                                                              4, uc_ctx_cat,
 1279|  47.6k|                                                              ps_dec,
 1280|  47.6k|                                                              (pu1_top_nnz + 2),
 1281|  47.6k|                                                              pu1_left_nnz);
 1282|  47.6k|                ui16_csbp |= (u4_temp << 2);
 1283|  47.6k|            }
 1284|       |
 1285|       |            /*******************************************************************/
 1286|       |            /* Block 2 residual decoding, check cbp and proceed (subblock = 8) */
 1287|       |            /*******************************************************************/
 1288|  74.3k|            pi2_coeff_block += (6 * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  74.3k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 1289|  74.3k|            if(!(u1_cbp & 0x4))
  ------------------
  |  Branch (1289:16): [True: 24.6k, False: 49.7k]
  ------------------
 1290|  24.6k|            {
 1291|  24.6k|                *(UWORD16 *)(pu1_top_nnz) = 0;
 1292|  24.6k|                *(UWORD16 *)(pu1_left_nnz + 2) = 0;
 1293|  24.6k|            }
 1294|  49.7k|            else
 1295|  49.7k|            {
 1296|  49.7k|                UWORD32 u4_temp = ih264d_cabac_parse_8x8block(
 1297|  49.7k|                                pi2_coeff_block, 4, uc_ctx_cat, ps_dec,
 1298|  49.7k|                                pu1_top_nnz, (pu1_left_nnz + 2));
 1299|  49.7k|                ui16_csbp |= (u4_temp << 8);
 1300|  49.7k|            }
 1301|       |
 1302|       |            /*******************************************************************/
 1303|       |            /* Block 3 residual decoding, check cbp and proceed (subblock = 10)*/
 1304|       |            /*******************************************************************/
 1305|  74.3k|            pi2_coeff_block += (2 * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  74.3k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 1306|  74.3k|            if(!(u1_cbp & 0x8))
  ------------------
  |  Branch (1306:16): [True: 28.3k, False: 45.9k]
  ------------------
 1307|  28.3k|            {
 1308|  28.3k|                *(UWORD16 *)(pu1_top_nnz + 2) = 0;
 1309|  28.3k|                *(UWORD16 *)(pu1_left_nnz + 2) = 0;
 1310|  28.3k|            }
 1311|  45.9k|            else
 1312|  45.9k|            {
 1313|  45.9k|                UWORD32 u4_temp = ih264d_cabac_parse_8x8block(
 1314|  45.9k|                                pi2_coeff_block, 4, uc_ctx_cat, ps_dec,
 1315|  45.9k|                                (pu1_top_nnz + 2), (pu1_left_nnz + 2));
 1316|  45.9k|                ui16_csbp |= (u4_temp << 10);
 1317|  45.9k|            }
 1318|       |
 1319|  74.3k|        }
 1320|  43.4k|        else
 1321|  43.4k|        {
 1322|  43.4k|            ui16_csbp = 0;
 1323|       |
 1324|       |            /*******************************************************************/
 1325|       |            /* Block 0 residual decoding, check cbp and proceed (subblock = 0) */
 1326|       |            /*******************************************************************/
 1327|  43.4k|            if(!(u1_cbp & 0x1))
  ------------------
  |  Branch (1327:16): [True: 9.67k, False: 33.8k]
  ------------------
 1328|  9.67k|            {
 1329|  9.67k|                *(UWORD16 *)(pu1_top_nnz) = 0;
 1330|  9.67k|                *(UWORD16 *)(pu1_left_nnz) = 0;
 1331|  9.67k|            }
 1332|  33.8k|            else
 1333|  33.8k|            {
 1334|       |
 1335|  33.8k|                dec_bit_stream_t * const ps_bitstrm = ps_dec->ps_bitstrm;
 1336|       |
 1337|  33.8k|                ih264d_read_coeff8x8_cabac( ps_bitstrm,
 1338|  33.8k|                                           ps_dec, ps_cur_mb_info);
 1339|       |
 1340|  33.8k|                pu1_left_nnz[0] = 1;
 1341|  33.8k|                pu1_left_nnz[1] = 1;
 1342|       |
 1343|  33.8k|                pu1_top_nnz[0] = 1;
 1344|  33.8k|                pu1_top_nnz[1] = 1;
 1345|       |
 1346|       |                /* added to be used by BS computation module */
 1347|  33.8k|                ui16_csbp |= 0x0033;
 1348|  33.8k|            }
 1349|       |
 1350|       |            /*******************************************************************/
 1351|       |            /* Block 1 residual decoding, check cbp and proceed (subblock = 2) */
 1352|       |            /*******************************************************************/
 1353|  43.4k|            pi2_coeff_block += 64;
 1354|       |
 1355|  43.4k|            if(!(u1_cbp & 0x2))
  ------------------
  |  Branch (1355:16): [True: 11.4k, False: 32.0k]
  ------------------
 1356|  11.4k|            {
 1357|  11.4k|                *(UWORD16 *)(pu1_top_nnz + 2) = 0;
 1358|  11.4k|                *(UWORD16 *)(pu1_left_nnz) = 0;
 1359|  11.4k|            }
 1360|  32.0k|            else
 1361|  32.0k|            {
 1362|       |
 1363|       |
 1364|  32.0k|                dec_bit_stream_t * const ps_bitstrm = ps_dec->ps_bitstrm;
 1365|       |
 1366|  32.0k|                ih264d_read_coeff8x8_cabac(ps_bitstrm,
 1367|  32.0k|                                           ps_dec, ps_cur_mb_info);
 1368|       |
 1369|  32.0k|                pu1_left_nnz[0] = 1;
 1370|  32.0k|                pu1_left_nnz[1] = 1;
 1371|       |
 1372|  32.0k|                pu1_top_nnz[2] = 1;
 1373|  32.0k|                pu1_top_nnz[3] = 1;
 1374|       |
 1375|       |                /* added to be used by BS computation module */
 1376|  32.0k|                ui16_csbp |= 0x00CC;
 1377|       |
 1378|  32.0k|            }
 1379|       |
 1380|       |            /*******************************************************************/
 1381|       |            /* Block 2 residual decoding, check cbp and proceed (subblock = 8) */
 1382|       |            /*******************************************************************/
 1383|  43.4k|            pi2_coeff_block += 64;
 1384|  43.4k|            if(!(u1_cbp & 0x4))
  ------------------
  |  Branch (1384:16): [True: 9.29k, False: 34.1k]
  ------------------
 1385|  9.29k|            {
 1386|  9.29k|                *(UWORD16 *)(pu1_top_nnz) = 0;
 1387|  9.29k|                *(UWORD16 *)(pu1_left_nnz + 2) = 0;
 1388|  9.29k|            }
 1389|  34.1k|            else
 1390|  34.1k|            {
 1391|       |
 1392|  34.1k|                dec_bit_stream_t * const ps_bitstrm = ps_dec->ps_bitstrm;
 1393|       |
 1394|  34.1k|                ih264d_read_coeff8x8_cabac(ps_bitstrm,
 1395|  34.1k|                                           ps_dec, ps_cur_mb_info);
 1396|       |
 1397|  34.1k|                pu1_left_nnz[2] = 1;
 1398|  34.1k|                pu1_left_nnz[3] = 1;
 1399|       |
 1400|  34.1k|                pu1_top_nnz[0] = 1;
 1401|  34.1k|                pu1_top_nnz[1] = 1;
 1402|       |
 1403|       |                /* added to be used by BS computation module */
 1404|  34.1k|                ui16_csbp |= 0x3300;
 1405|  34.1k|            }
 1406|       |
 1407|       |            /*******************************************************************/
 1408|       |            /* Block 3 residual decoding, check cbp and proceed (subblock = 10)*/
 1409|       |            /*******************************************************************/
 1410|  43.4k|            pi2_coeff_block += 64;
 1411|       |
 1412|  43.4k|            if(!(u1_cbp & 0x8))
  ------------------
  |  Branch (1412:16): [True: 11.8k, False: 31.6k]
  ------------------
 1413|  11.8k|            {
 1414|  11.8k|                *(UWORD16 *)(pu1_top_nnz + 2) = 0;
 1415|  11.8k|                *(UWORD16 *)(pu1_left_nnz + 2) = 0;
 1416|  11.8k|            }
 1417|  31.6k|            else
 1418|  31.6k|            {
 1419|       |
 1420|  31.6k|                dec_bit_stream_t * const ps_bitstrm = ps_dec->ps_bitstrm;
 1421|       |
 1422|  31.6k|                ih264d_read_coeff8x8_cabac(ps_bitstrm,
 1423|  31.6k|                                           ps_dec, ps_cur_mb_info);
 1424|       |
 1425|  31.6k|                pu1_left_nnz[2] = 1;
 1426|  31.6k|                pu1_left_nnz[3] = 1;
 1427|       |
 1428|  31.6k|                pu1_top_nnz[2] = 1;
 1429|  31.6k|                pu1_top_nnz[3] = 1;
 1430|       |
 1431|       |                /* added to be used by BS computation module */
 1432|  31.6k|                ui16_csbp |= 0xCC00;
 1433|  31.6k|            }
 1434|  43.4k|        }
 1435|   117k|    }
 1436|   227k|    else
 1437|   227k|    {
 1438|   227k|        *(UWORD32 *)(pu1_top_nnz) = 0;
 1439|   227k|        *(UWORD32 *)(pu1_left_nnz) = 0;
 1440|   227k|    }
 1441|       |    /*--------------------------------------------------------------------*/
 1442|       |    /* Store the last row of N values to top row                          */
 1443|       |    /*--------------------------------------------------------------------*/
 1444|   344k|    ps_cur_mb_info->u2_luma_csbp = ui16_csbp;
 1445|   344k|    ps_cur_mb_info->ps_curmb->u2_luma_csbp = ui16_csbp;
 1446|   344k|    {
 1447|   344k|        WORD8 i;
 1448|   344k|        UWORD16 u2_chroma_csbp = 0;
 1449|   344k|        ps_cur_mb_info->u2_chroma_csbp = 0;
 1450|       |
 1451|   344k|        u1_cbp >>= 4;
 1452|   344k|        pu1_top_nnz = pu1_top_nnz_uv;
 1453|   344k|        pu1_left_nnz = ps_dec->pu1_left_nnz_uv;
 1454|       |        /*--------------------------------------------------------------------*/
 1455|       |        /* if Chroma Component not present OR no ac values present            */
 1456|       |        /* Set the values of N to zero                                        */
 1457|       |        /*--------------------------------------------------------------------*/
 1458|   344k|        if(u1_cbp == CBPC_ALLZERO)
  ------------------
  |  |  507|   344k|#define CBPC_ALLZERO    0
  ------------------
  |  Branch (1458:12): [True: 301k, False: 43.3k]
  ------------------
 1459|   301k|        {
 1460|   301k|            ps_dec->pu1_left_yuv_dc_csbp[0] &= 0x1;
 1461|   301k|            *(UWORD32 *)(pu1_top_nnz) = 0;
 1462|   301k|            *(UWORD32 *)(pu1_left_nnz) = 0;
 1463|   301k|            p_curr_ctxt->u1_yuv_dc_csbp &= 0x1;
 1464|   301k|            return (0);
 1465|   301k|        }
 1466|       |
 1467|       |        /*--------------------------------------------------------------------*/
 1468|       |        /* Decode Chroma DC values                                            */
 1469|       |        /*--------------------------------------------------------------------*/
 1470|   130k|        for(i = 0; i < 2; i++)
  ------------------
  |  Branch (1470:20): [True: 86.7k, False: 43.3k]
  ------------------
 1471|  86.7k|        {
 1472|  86.7k|            UWORD8 uc_a = 1, uc_b = 1;
 1473|  86.7k|            UWORD32 u4_ctx_inc;
 1474|  86.7k|            UWORD8 uc_codedBlockFlag;
 1475|  86.7k|            UWORD8 pu1_inv_scan[4] =
 1476|  86.7k|                { 0, 1, 2, 3 };
 1477|  86.7k|            WORD32 u4_scale;
 1478|  86.7k|            WORD32 i4_mb_inter_inc;
 1479|  86.7k|            tu_sblk4x4_coeff_data_t *ps_tu_4x4 =
 1480|  86.7k|                            (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
 1481|  86.7k|            WORD16 *pi2_coeff_data =
 1482|  86.7k|                            (WORD16 *)ps_dec->pv_parse_tu_coeff_data;
 1483|  86.7k|            WORD16 ai2_dc_coef[4];
 1484|       |
 1485|  86.7k|            INC_SYM_COUNT(&(ps_dec->s_cab_dec_env));
 1486|  86.7k|            u4_scale = (i) ?
  ------------------
  |  Branch (1486:24): [True: 43.3k, False: 43.3k]
  ------------------
 1487|  43.3k|                            (ps_dec->pu2_quant_scale_v[0]
 1488|  43.3k|                                            << ps_dec->u1_qp_v_div6) :
 1489|  86.7k|                            (ps_dec->pu2_quant_scale_u[0]
 1490|  43.3k|                                            << ps_dec->u1_qp_u_div6);
 1491|       |
 1492|       |            /*--------------------------------------------------------------------*/
 1493|       |            /* Decode Bitstream to get the DC coeff                               */
 1494|       |            /*--------------------------------------------------------------------*/
 1495|  86.7k|            uc_a = (u1_left_dc_csbp >> i) & 0x01;
 1496|  86.7k|            uc_b = (u1_top_dc_csbp >> i) & 0x01;
 1497|  86.7k|            u4_ctx_inc = (uc_a + (uc_b << 1));
 1498|       |
 1499|  86.7k|            ps_src_bin_ctxt = (ps_dec->p_cbf_t[CHROMA_DC_CTXCAT]) + u4_ctx_inc;
  ------------------
  |  |   74|  86.7k|#define CHROMA_DC_CTXCAT  3
  ------------------
 1500|       |
 1501|  86.7k|            uc_codedBlockFlag =
 1502|  86.7k|                            ih264d_read_coeff4x4_cabac(ps_bitstrm,
 1503|  86.7k|                                            CHROMA_DC_CTXCAT,
  ------------------
  |  |   74|  86.7k|#define CHROMA_DC_CTXCAT  3
  ------------------
 1504|  86.7k|                                            ps_dec->p_significant_coeff_flag_t[CHROMA_DC_CTXCAT],
  ------------------
  |  |   74|  86.7k|#define CHROMA_DC_CTXCAT  3
  ------------------
 1505|  86.7k|                                            ps_dec, ps_src_bin_ctxt);
 1506|       |
 1507|  86.7k|            i4_mb_inter_inc = (!((ps_cur_mb_info->ps_curmb->u1_mb_type == I_4x4_MB)
  ------------------
  |  |  417|  86.7k|#define I_4x4_MB    0
  ------------------
  |  Branch (1507:34): [True: 15.8k, False: 70.9k]
  ------------------
 1508|  70.9k|                            || (ps_cur_mb_info->ps_curmb->u1_mb_type == I_16x16_MB)))
  ------------------
  |  |  418|  70.9k|#define I_16x16_MB  1
  ------------------
  |  Branch (1508:32): [True: 13.0k, False: 57.8k]
  ------------------
 1509|  86.7k|                            * 3;
 1510|       |
 1511|  86.7k|            if(ps_dec->s_high_profile.u1_scaling_present)
  ------------------
  |  Branch (1511:16): [True: 30.4k, False: 56.3k]
  ------------------
 1512|  30.4k|            {
 1513|  30.4k|                u4_scale *=
 1514|  30.4k|                                ps_dec->s_high_profile.i2_scalinglist4x4[i4_mb_inter_inc
 1515|  30.4k|                                                + 1 + i][0];
 1516|       |
 1517|  30.4k|            }
 1518|  56.3k|            else
 1519|  56.3k|            {
 1520|  56.3k|                u4_scale <<= 4;
 1521|  56.3k|            }
 1522|       |
 1523|  86.7k|            if(uc_codedBlockFlag)
  ------------------
  |  Branch (1523:16): [True: 51.7k, False: 35.0k]
  ------------------
 1524|  51.7k|            {
 1525|  51.7k|                WORD32 i_z0, i_z1, i_z2, i_z3;
 1526|  51.7k|                WORD32 *pi4_scale;
 1527|       |
 1528|  51.7k|                SET_BIT(u1_top_dc_csbp, i);
  ------------------
  |  |  106|  51.7k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
 1529|  51.7k|                SET_BIT(u1_left_dc_csbp, i);
  ------------------
  |  |  106|  51.7k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
 1530|       |
 1531|  51.7k|                ai2_dc_coef[0] = 0;
 1532|  51.7k|                ai2_dc_coef[1] = 0;
 1533|  51.7k|                ai2_dc_coef[2] = 0;
 1534|  51.7k|                ai2_dc_coef[3] = 0;
 1535|       |
 1536|  51.7k|                ih264d_unpack_coeff4x4_dc_4x4blk(ps_tu_4x4,
 1537|  51.7k|                                                 ai2_dc_coef,
 1538|  51.7k|                                                 pu1_inv_scan);
 1539|  51.7k|                i_z0 = (ai2_dc_coef[0] + ai2_dc_coef[2]);
 1540|  51.7k|                i_z1 = (ai2_dc_coef[0] - ai2_dc_coef[2]);
 1541|  51.7k|                i_z2 = (ai2_dc_coef[1] - ai2_dc_coef[3]);
 1542|  51.7k|                i_z3 = (ai2_dc_coef[1] + ai2_dc_coef[3]);
 1543|       |
 1544|       |                /*-----------------------------------------------------------*/
 1545|       |                /* Scaling and storing the values back                       */
 1546|       |                /*-----------------------------------------------------------*/
 1547|  51.7k|                *pi2_coeff_data++ = ((i_z0 + i_z3) * u4_scale) >> 5;
 1548|  51.7k|                *pi2_coeff_data++ = ((i_z0 - i_z3) * u4_scale) >> 5;
 1549|  51.7k|                *pi2_coeff_data++ = ((i_z1 + i_z2) * u4_scale) >> 5;
 1550|  51.7k|                *pi2_coeff_data++ = ((i_z1 - i_z2) * u4_scale) >> 5;
 1551|       |
 1552|  51.7k|                ps_dec->pv_parse_tu_coeff_data = (void *)pi2_coeff_data;
 1553|       |
 1554|  51.7k|                SET_BIT(ps_cur_mb_info->u1_yuv_dc_block_flag,(i+1));
  ------------------
  |  |  106|  51.7k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
 1555|  51.7k|            }
 1556|  35.0k|            else
 1557|  35.0k|            {
 1558|  35.0k|                CLEARBIT(u1_top_dc_csbp, i);
  ------------------
  |  |   55|  35.0k|#define CLEARBIT(a,i) ((a) &= ~(1 << i))
  ------------------
 1559|  35.0k|                CLEARBIT(u1_left_dc_csbp, i);
  ------------------
  |  |   55|  35.0k|#define CLEARBIT(a,i) ((a) &= ~(1 << i))
  ------------------
 1560|  35.0k|            }
 1561|  86.7k|        }
 1562|       |
 1563|       |        /*********************************************************************/
 1564|       |        /*                   Update the DC csbp                              */
 1565|       |        /*********************************************************************/
 1566|  43.3k|        ps_dec->pu1_left_yuv_dc_csbp[0] &= 0x1;
 1567|  43.3k|        p_curr_ctxt->u1_yuv_dc_csbp &= 0x1;
 1568|  43.3k|        ps_dec->pu1_left_yuv_dc_csbp[0] |= (u1_left_dc_csbp << 1);
 1569|  43.3k|        p_curr_ctxt->u1_yuv_dc_csbp |= (u1_top_dc_csbp << 1);
 1570|  43.3k|        if(u1_cbp == CBPC_ACZERO)
  ------------------
  |  |  508|  43.3k|#define CBPC_ACZERO     1
  ------------------
  |  Branch (1570:12): [True: 23.0k, False: 20.3k]
  ------------------
 1571|  23.0k|        {
 1572|  23.0k|            *(UWORD32 *)(pu1_top_nnz) = 0;
 1573|  23.0k|            *(UWORD32 *)(pu1_left_nnz) = 0;
 1574|  23.0k|            return (0);
 1575|  23.0k|        }
 1576|       |        /*--------------------------------------------------------------------*/
 1577|       |        /* Decode Chroma AC values                                            */
 1578|       |        /*--------------------------------------------------------------------*/
 1579|  20.3k|        {
 1580|  20.3k|            UWORD32 u4_temp;
 1581|       |            /*****************************************************************/
 1582|       |            /* U Block  residual decoding, check cbp and proceed (subblock=0)*/
 1583|       |            /*****************************************************************/
 1584|  20.3k|            u2_chroma_csbp = ih264d_cabac_parse_8x8block(pi2_coeff_block, 2,
 1585|  20.3k|            CHROMA_AC_CTXCAT,
  ------------------
  |  |   75|  20.3k|#define CHROMA_AC_CTXCAT  4
  ------------------
 1586|  20.3k|                                                         ps_dec, pu1_top_nnz,
 1587|  20.3k|                                                         pu1_left_nnz);
 1588|       |
 1589|  20.3k|            pi2_coeff_block += MB_CHROM_SIZE;
  ------------------
  |  |  564|  20.3k|#define MB_CHROM_SIZE                 64
  ------------------
 1590|       |            /*****************************************************************/
 1591|       |            /* V Block  residual decoding, check cbp and proceed (subblock=1)*/
 1592|       |            /*****************************************************************/
 1593|  20.3k|            u4_temp = ih264d_cabac_parse_8x8block(pi2_coeff_block, 2,
 1594|  20.3k|            CHROMA_AC_CTXCAT,
  ------------------
  |  |   75|  20.3k|#define CHROMA_AC_CTXCAT  4
  ------------------
 1595|  20.3k|                                                  ps_dec, (pu1_top_nnz + 2),
 1596|  20.3k|                                                  (pu1_left_nnz + 2));
 1597|  20.3k|            u2_chroma_csbp |= (u4_temp << 4);
 1598|  20.3k|        }
 1599|       |        /*********************************************************************/
 1600|       |        /*                   Update the AC csbp                              */
 1601|       |        /*********************************************************************/
 1602|  20.3k|        ps_cur_mb_info->u2_chroma_csbp = u2_chroma_csbp;
 1603|  20.3k|    }
 1604|       |
 1605|      0|    return (0);
 1606|  43.3k|}

ih264d_uev:
   78|  5.52M|{
   79|  5.52M|    UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
   80|  5.52M|    UWORD32 u4_word, u4_ldz;
   81|       |
   82|       |    /***************************************************************/
   83|       |    /* Find leading zeros in next 32 bits                          */
   84|       |    /***************************************************************/
   85|  5.52M|    NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  5.52M|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  5.52M|{                                                                           \
  |  |  152|  5.52M|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  5.52M|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  5.52M|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  5.52M|                                                                            \
  |  |  156|  5.52M|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  5.52M|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 4.45M, False: 1.07M]
  |  |  ------------------
  |  |  158|  5.52M|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  4.45M|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  5.52M|}
  ------------------
   86|  5.52M|    u4_ldz = CLZ(u4_word);
   87|       |    /* Flush the ps_bitstrm */
   88|  5.52M|    u4_bitstream_offset += (u4_ldz + 1);
   89|       |    /* Read the suffix from the ps_bitstrm */
   90|  5.52M|    u4_word = 0;
   91|  5.52M|    if(u4_ldz)
  ------------------
  |  Branch (91:8): [True: 2.19M, False: 3.33M]
  ------------------
   92|  2.19M|        GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  2.19M|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  2.19M|{                                                                           \
  |  |  122|  2.19M|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  2.19M|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  2.19M|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  2.19M|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  2.19M|                                                                            \
  |  |  127|  2.19M|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.07M, False: 119k]
  |  |  ------------------
  |  |  128|  2.19M|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.07M|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  2.19M|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  2.19M|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  2.19M|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  2.19M|}                                                                           \
  ------------------
   93|  5.52M|    *pu4_bitstrm_ofst = u4_bitstream_offset;
   94|  5.52M|    return ((1 << u4_ldz) + u4_word - 1);
   95|  5.52M|}
ih264d_sev:
  123|  1.63M|{
  124|  1.63M|    UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  125|  1.63M|    UWORD32 u4_word, u4_ldz, u4_abs_val;
  126|       |
  127|       |    /***************************************************************/
  128|       |    /* Find leading zeros in next 32 bits                          */
  129|       |    /***************************************************************/
  130|  1.63M|    NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  1.63M|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  1.63M|{                                                                           \
  |  |  152|  1.63M|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  1.63M|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  1.63M|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  1.63M|                                                                            \
  |  |  156|  1.63M|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  1.63M|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 1.60M, False: 33.6k]
  |  |  ------------------
  |  |  158|  1.63M|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  1.60M|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  1.63M|}
  ------------------
  131|  1.63M|    u4_ldz = CLZ(u4_word);
  132|       |
  133|       |    /* Flush the ps_bitstrm */
  134|  1.63M|    u4_bitstream_offset += (u4_ldz + 1);
  135|       |
  136|       |    /* Read the suffix from the ps_bitstrm */
  137|  1.63M|    u4_word = 0;
  138|  1.63M|    if(u4_ldz)
  ------------------
  |  Branch (138:8): [True: 834k, False: 800k]
  ------------------
  139|   834k|        GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|   834k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|   834k|{                                                                           \
  |  |  122|   834k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|   834k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|   834k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|   834k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|   834k|                                                                            \
  |  |  127|   834k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 814k, False: 20.4k]
  |  |  ------------------
  |  |  128|   834k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|   814k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|   834k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|   834k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|   834k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|   834k|}                                                                           \
  ------------------
  140|       |
  141|  1.63M|    *pu4_bitstrm_ofst = u4_bitstream_offset;
  142|  1.63M|    u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  143|       |
  144|  1.63M|    if(u4_word & 0x1)
  ------------------
  |  Branch (144:8): [True: 374k, False: 1.25M]
  ------------------
  145|   374k|        return (-(WORD32)u4_abs_val);
  146|  1.25M|    else
  147|  1.25M|        return (u4_abs_val);
  148|  1.63M|}
ih264d_tev_range1:
  176|  19.4k|{
  177|  19.4k|    UWORD32 u4_code;
  178|  19.4k|    GETBIT(u4_code, *pu4_bitstrm_ofst, pu4_bitstrm_buf);
  ------------------
  |  |  105|  19.4k|#define   GETBIT(u4_code, u4_offset, pu4_bitstream)                         \
  |  |  106|  19.4k|{                                                                           \
  |  |  107|  19.4k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  108|  19.4k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  109|  19.4k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  110|  19.4k|    u4_code = pu4_buf[u4_word_off] << u4_bit_off;                           \
  |  |  111|  19.4k|    (u4_offset)++;                                                          \
  |  |  112|  19.4k|    u4_code = (u4_code >> 31);                                              \
  |  |  113|  19.4k|}
  ------------------
  179|  19.4k|    return (!u4_code);
  180|  19.4k|}
ih264d_cavlc_4x4res_block_totalcoeff_1:
  305|   113k|{
  306|       |
  307|   113k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  308|   113k|    UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
  309|   113k|    UWORD32 u4_trailing_ones = u4_total_coeff_trail_one & 0xFFFF;
  310|   113k|    WORD32 i2_level;
  311|   113k|    UWORD32 u4_tot_zero, u4_ldz, u4_scan_pos;
  312|       |
  313|   113k|    tu_sblk4x4_coeff_data_t *ps_tu_4x4;
  314|   113k|    WORD16 *pi2_coeff_data;
  315|   113k|    dec_struct_t *ps_dec = (dec_struct_t *)ps_bitstrm->pv_codec_handle;
  316|       |
  317|   113k|    ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
  318|   113k|    ps_tu_4x4->u2_sig_coeff_map = 0;
  319|   113k|    pi2_coeff_data = &ps_tu_4x4->ai2_level[0];
  320|       |
  321|       |
  322|   113k|    if(u4_trailing_ones)
  ------------------
  |  Branch (322:8): [True: 102k, False: 11.1k]
  ------------------
  323|   102k|    {
  324|   102k|        UWORD32 u4_sign;
  325|       |        /****************************************************************/
  326|       |        /* Decode Trailing One as in section 9.2.2                      */
  327|       |        /****************************************************************/
  328|   102k|        GETBIT(u4_sign, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  105|   102k|#define   GETBIT(u4_code, u4_offset, pu4_bitstream)                         \
  |  |  106|   102k|{                                                                           \
  |  |  107|   102k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  108|   102k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  109|   102k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  110|   102k|    u4_code = pu4_buf[u4_word_off] << u4_bit_off;                           \
  |  |  111|   102k|    (u4_offset)++;                                                          \
  |  |  112|   102k|    u4_code = (u4_code >> 31);                                              \
  |  |  113|   102k|}
  ------------------
  329|   102k|        i2_level = u4_sign ? -1 : 1;
  ------------------
  |  Branch (329:20): [True: 57.7k, False: 44.4k]
  ------------------
  330|   102k|    }
  331|  11.1k|    else
  332|  11.1k|    {
  333|       |        /****************************************************************/
  334|       |        /* Decoding Level based on prefix and suffix  as in 9.2.2       */
  335|       |        /****************************************************************/
  336|  11.1k|        UWORD32 u4_lev_suffix, u4_lev_suffix_size;
  337|  11.1k|        WORD32 u2_lev_code, u2_abs_value;
  338|  11.1k|        UWORD32 u4_lev_prefix;
  339|       |        /***************************************************************/
  340|       |        /* Find leading zeros in next 32 bits                          */
  341|       |        /***************************************************************/
  342|  11.1k|        FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|  11.1k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|  11.1k|{                                                                           \
  |  |  167|  11.1k|    UWORD32 u4_word;                                                        \
  |  |  168|  11.1k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  11.1k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  11.1k|{                                                                           \
  |  |  |  |  152|  11.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  11.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  11.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  11.1k|                                                                            \
  |  |  |  |  156|  11.1k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  11.1k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 10.6k, False: 492]
  |  |  |  |  ------------------
  |  |  |  |  158|  11.1k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  10.6k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  11.1k|}
  |  |  ------------------
  |  |  169|  11.1k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|  11.1k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|  11.1k|}
  ------------------
  343|  11.1k|                              pu4_bitstrm_buf);
  344|  11.1k|        u2_lev_code = (2 + MIN(u4_lev_prefix, 15));
  ------------------
  |  |   61|  11.1k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 6.09k, False: 5.05k]
  |  |  ------------------
  ------------------
  345|       |
  346|  11.1k|        if(14 == u4_lev_prefix)
  ------------------
  |  Branch (346:12): [True: 271, False: 10.8k]
  ------------------
  347|    271|            u4_lev_suffix_size = 4;
  348|  10.8k|        else if(15 <= u4_lev_prefix)
  ------------------
  |  Branch (348:17): [True: 5.05k, False: 5.82k]
  ------------------
  349|  5.05k|        {
  350|  5.05k|            u2_lev_code += 15;
  351|  5.05k|            u4_lev_suffix_size = u4_lev_prefix - 3;
  352|  5.05k|        }
  353|  5.82k|        else
  354|  5.82k|            u4_lev_suffix_size = 0;
  355|       |
  356|       |        //HP_LEVEL_PREFIX
  357|  11.1k|        if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (357:12): [True: 4.93k, False: 6.20k]
  ------------------
  358|  4.93k|        {
  359|  4.93k|            u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
  360|  4.93k|        }
  361|  11.1k|        if(u4_lev_suffix_size)
  ------------------
  |  Branch (361:12): [True: 5.32k, False: 5.82k]
  ------------------
  362|  5.32k|        {
  363|  5.32k|            GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  5.32k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  5.32k|{                                                                           \
  |  |  122|  5.32k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  5.32k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  5.32k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  5.32k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  5.32k|                                                                            \
  |  |  127|  5.32k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 5.06k, False: 262]
  |  |  ------------------
  |  |  128|  5.32k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  5.06k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  5.32k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  5.32k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  5.32k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  5.32k|}                                                                           \
  ------------------
  364|  5.32k|                    u4_lev_suffix_size);
  365|  5.32k|            u2_lev_code += u4_lev_suffix;
  366|  5.32k|        }
  367|       |
  368|  11.1k|        u2_abs_value = (u2_lev_code + 2) >> 1;
  369|       |        /*********************************************************/
  370|       |        /* If Level code is odd, level is negative else positive */
  371|       |        /*********************************************************/
  372|  11.1k|        i2_level = (u2_lev_code & 1) ? -u2_abs_value : u2_abs_value;
  ------------------
  |  Branch (372:20): [True: 2.42k, False: 8.72k]
  ------------------
  373|       |
  374|  11.1k|    }
  375|       |
  376|       |    /****************************************************************/
  377|       |    /* Decoding total zeros as in section 9.2.3, table 9.7          */
  378|       |    /****************************************************************/
  379|   113k|    FIND_ONE_IN_STREAM_LEN(u4_ldz, u4_bitstream_offset, pu4_bitstrm_buf, 8);
  ------------------
  |  |  176|   113k|#define   FIND_ONE_IN_STREAM_LEN(u4_ldz, u4_offset, pu4_bitstream, u4_len)  \
  |  |  177|   113k|{                                                                           \
  |  |  178|   113k|    UWORD32 u4_word;                                                        \
  |  |  179|   113k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|   113k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|   113k|{                                                                           \
  |  |  |  |  152|   113k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|   113k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|   113k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|   113k|                                                                            \
  |  |  |  |  156|   113k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|   113k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 110k, False: 2.99k]
  |  |  |  |  ------------------
  |  |  |  |  158|   113k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|   110k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|   113k|}
  |  |  ------------------
  |  |  180|   113k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  181|   113k|    if(u4_ldz < u4_len)                                                     \
  |  |  ------------------
  |  |  |  Branch (181:8): [True: 107k, False: 5.93k]
  |  |  ------------------
  |  |  182|   113k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  183|   113k|    else                                                                    \
  |  |  184|   113k|    {                                                                       \
  |  |  185|  5.93k|        u4_ldz = u4_len;                                                    \
  |  |  186|  5.93k|        (u4_offset) += u4_ldz;                                              \
  |  |  187|  5.93k|    }                                                                       \
  |  |  188|   113k|}
  ------------------
  380|       |
  381|   113k|    if(u4_ldz)
  ------------------
  |  Branch (381:8): [True: 45.1k, False: 68.1k]
  ------------------
  382|  45.1k|    {
  383|  45.1k|        GETBIT(u4_tot_zero, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  105|  45.1k|#define   GETBIT(u4_code, u4_offset, pu4_bitstream)                         \
  |  |  106|  45.1k|{                                                                           \
  |  |  107|  45.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  108|  45.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  109|  45.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  110|  45.1k|    u4_code = pu4_buf[u4_word_off] << u4_bit_off;                           \
  |  |  111|  45.1k|    (u4_offset)++;                                                          \
  |  |  112|  45.1k|    u4_code = (u4_code >> 31);                                              \
  |  |  113|  45.1k|}
  ------------------
  384|  45.1k|        u4_tot_zero = (u4_ldz << 1) - u4_tot_zero;
  385|  45.1k|    }
  386|  68.1k|    else
  387|  68.1k|        u4_tot_zero = 0;
  388|       |
  389|       |    /***********************************************************************/
  390|       |    /* Inverse scan and store  residual coeff. Update the bitstream u4_ofst */
  391|       |    /***********************************************************************/
  392|   113k|    u4_scan_pos = u4_tot_zero + u4_isdc;
  393|   113k|    if(u4_scan_pos > 15)
  ------------------
  |  Branch (393:8): [True: 5.90k, False: 107k]
  ------------------
  394|  5.90k|        return -1;
  395|       |
  396|   107k|    SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|   107k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  397|   107k|    *pi2_coeff_data++ = i2_level;
  398|       |
  399|       |
  400|   107k|    {
  401|   107k|        WORD32 offset;
  402|   107k|        offset = (UWORD8 *)pi2_coeff_data - (UWORD8 *)ps_tu_4x4;
  403|   107k|        offset = ALIGN4(offset);
  ------------------
  |  |   52|   107k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  404|   107k|        ps_dec->pv_parse_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_parse_tu_coeff_data + offset);
  405|   107k|    }
  406|       |
  407|   107k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
  408|   107k|    return 0;
  409|   113k|}
ih264d_cavlc_4x4res_block_totalcoeff_2to10:
  439|  72.4k|{
  440|  72.4k|    UWORD32 u4_total_zeroes;
  441|  72.4k|    WORD32 i;
  442|  72.4k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  443|  72.4k|    UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
  444|  72.4k|    UWORD32 u4_trailing_ones = u4_total_coeff_trail_one & 0xFFFF;
  445|  72.4k|    UWORD32 u4_total_coeff = u4_total_coeff_trail_one >> 16;
  446|       |    // To avoid error check at 4x4 level, allocating for 3 extra levels(16+3)
  447|       |    // since u4_trailing_ones can at the max be 3. This will be required when
  448|       |    // u4_total_coeff is less than u4_trailing_ones
  449|  72.4k|    WORD16 ai2_level_arr[19];
  450|  72.4k|    WORD16 *i2_level_arr = &ai2_level_arr[3];
  451|       |
  452|  72.4k|    tu_sblk4x4_coeff_data_t *ps_tu_4x4;
  453|  72.4k|    WORD16 *pi2_coeff_data;
  454|  72.4k|    dec_struct_t *ps_dec = (dec_struct_t *)ps_bitstrm->pv_codec_handle;
  455|       |
  456|  72.4k|    ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
  457|  72.4k|    ps_tu_4x4->u2_sig_coeff_map = 0;
  458|  72.4k|    pi2_coeff_data = &ps_tu_4x4->ai2_level[0];
  459|       |
  460|  72.4k|    i = u4_total_coeff - 1;
  461|       |
  462|  72.4k|    if(u4_trailing_ones)
  ------------------
  |  Branch (462:8): [True: 62.6k, False: 9.79k]
  ------------------
  463|  62.6k|    {
  464|       |        /*********************************************************************/
  465|       |        /* Decode Trailing Ones                                              */
  466|       |        /* read the sign of T1's and put them in level array                 */
  467|       |        /*********************************************************************/
  468|  62.6k|        UWORD32 u4_signs, u4_cnt = u4_trailing_ones;
  469|  62.6k|        WORD16 (*ppi2_trlone_lkup)[3] =
  470|  62.6k|                        (WORD16 (*)[3])gai2_ih264d_trailing_one_level;
  471|  62.6k|        WORD16 *pi2_trlone_lkup;
  472|       |
  473|  62.6k|        GETBITS(u4_signs, u4_bitstream_offset, pu4_bitstrm_buf, u4_cnt);
  ------------------
  |  |  120|  62.6k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  62.6k|{                                                                           \
  |  |  122|  62.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  62.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  62.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  62.6k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  62.6k|                                                                            \
  |  |  127|  62.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 59.4k, False: 3.19k]
  |  |  ------------------
  |  |  128|  62.6k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  59.4k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  62.6k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  62.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  62.6k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  62.6k|}                                                                           \
  ------------------
  474|       |
  475|  62.6k|        pi2_trlone_lkup = ppi2_trlone_lkup[(1 << u4_cnt) - 2 + u4_signs];
  476|       |
  477|   197k|        while(u4_cnt)
  ------------------
  |  Branch (477:15): [True: 134k, False: 62.6k]
  ------------------
  478|   134k|        {
  479|   134k|            i2_level_arr[i--] = *pi2_trlone_lkup++;
  480|   134k|            u4_cnt--;
  481|   134k|        }
  482|  62.6k|    }
  483|       |
  484|       |    /****************************************************************/
  485|       |    /* Decoding Levels Begins                                       */
  486|       |    /****************************************************************/
  487|  72.4k|    if(i >= 0)
  ------------------
  |  Branch (487:8): [True: 31.8k, False: 40.6k]
  ------------------
  488|  31.8k|    {
  489|       |        /****************************************************************/
  490|       |        /* First level is decoded outside the loop as it has lot of     */
  491|       |        /* special cases.                                               */
  492|       |        /****************************************************************/
  493|  31.8k|        UWORD32 u4_lev_suffix, u4_suffix_len, u4_lev_suffix_size;
  494|  31.8k|        WORD32 u2_lev_code, u2_abs_value;
  495|  31.8k|        UWORD32 u4_lev_prefix;
  496|       |
  497|       |        /***************************************************************/
  498|       |        /* u4_suffix_len = 0,  Find leading zeros in next 32 bits      */
  499|       |        /***************************************************************/
  500|  31.8k|        FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|  31.8k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|  31.8k|{                                                                           \
  |  |  167|  31.8k|    UWORD32 u4_word;                                                        \
  |  |  168|  31.8k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  31.8k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  31.8k|{                                                                           \
  |  |  |  |  152|  31.8k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  31.8k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  31.8k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  31.8k|                                                                            \
  |  |  |  |  156|  31.8k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  31.8k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 30.5k, False: 1.28k]
  |  |  |  |  ------------------
  |  |  |  |  158|  31.8k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  30.5k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  31.8k|}
  |  |  ------------------
  |  |  169|  31.8k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|  31.8k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|  31.8k|}
  ------------------
  501|  31.8k|                              pu4_bitstrm_buf);
  502|       |
  503|       |        /*********************************************************/
  504|       |        /* Special decoding case when trailing ones are 3        */
  505|       |        /*********************************************************/
  506|  31.8k|        u2_lev_code = MIN(15, u4_lev_prefix);
  ------------------
  |  |   61|  31.8k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 6.45k, False: 25.3k]
  |  |  ------------------
  ------------------
  507|       |
  508|  31.8k|        u2_lev_code += (3 == u4_trailing_ones) ? 0 : 2;
  ------------------
  |  Branch (508:24): [True: 11.0k, False: 20.7k]
  ------------------
  509|       |
  510|  31.8k|        if(14 == u4_lev_prefix)
  ------------------
  |  Branch (510:12): [True: 806, False: 31.0k]
  ------------------
  511|    806|            u4_lev_suffix_size = 4;
  512|  31.0k|        else if(15 <= u4_lev_prefix)
  ------------------
  |  Branch (512:17): [True: 6.48k, False: 24.5k]
  ------------------
  513|  6.48k|        {
  514|  6.48k|            u2_lev_code += 15;
  515|  6.48k|            u4_lev_suffix_size = u4_lev_prefix - 3;
  516|  6.48k|        }
  517|  24.5k|        else
  518|  24.5k|            u4_lev_suffix_size = 0;
  519|       |
  520|       |        //HP_LEVEL_PREFIX
  521|  31.8k|        if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (521:12): [True: 6.45k, False: 25.3k]
  ------------------
  522|  6.45k|        {
  523|  6.45k|            u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
  524|  6.45k|        }
  525|  31.8k|        if(u4_lev_suffix_size)
  ------------------
  |  Branch (525:12): [True: 7.29k, False: 24.5k]
  ------------------
  526|  7.29k|        {
  527|  7.29k|            GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  7.29k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  7.29k|{                                                                           \
  |  |  122|  7.29k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  7.29k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  7.29k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  7.29k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  7.29k|                                                                            \
  |  |  127|  7.29k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 6.84k, False: 448]
  |  |  ------------------
  |  |  128|  7.29k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  6.84k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  7.29k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  7.29k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  7.29k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  7.29k|}                                                                           \
  ------------------
  528|  7.29k|                    u4_lev_suffix_size);
  529|  7.29k|            u2_lev_code += u4_lev_suffix;
  530|  7.29k|        }
  531|       |
  532|  31.8k|        u2_abs_value = (u2_lev_code + 2) >> 1;
  533|       |        /*********************************************************/
  534|       |        /* If Level code is odd, level is negative else positive */
  535|       |        /*********************************************************/
  536|  31.8k|        i2_level_arr[i--] = (u2_lev_code & 1) ? -u2_abs_value : u2_abs_value;
  ------------------
  |  Branch (536:29): [True: 9.18k, False: 22.6k]
  ------------------
  537|       |
  538|  31.8k|        u4_suffix_len = (u2_abs_value > 3) ? 2 : 1;
  ------------------
  |  Branch (538:25): [True: 9.51k, False: 22.3k]
  ------------------
  539|       |
  540|       |        /*********************************************************/
  541|       |        /* Now loop over the remaining levels                    */
  542|       |        /*********************************************************/
  543|   127k|        while(i >= 0)
  ------------------
  |  Branch (543:15): [True: 95.7k, False: 31.8k]
  ------------------
  544|  95.7k|        {
  545|       |
  546|       |            /***************************************************************/
  547|       |            /* Find leading zeros in next 32 bits                          */
  548|       |            /***************************************************************/
  549|  95.7k|            FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|  95.7k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|  95.7k|{                                                                           \
  |  |  167|  95.7k|    UWORD32 u4_word;                                                        \
  |  |  168|  95.7k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  95.7k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  95.7k|{                                                                           \
  |  |  |  |  152|  95.7k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  95.7k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  95.7k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  95.7k|                                                                            \
  |  |  |  |  156|  95.7k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  95.7k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 92.6k, False: 3.11k]
  |  |  |  |  ------------------
  |  |  |  |  158|  95.7k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  92.6k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  95.7k|}
  |  |  ------------------
  |  |  169|  95.7k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|  95.7k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|  95.7k|}
  ------------------
  550|  95.7k|                                  pu4_bitstrm_buf);
  551|       |
  552|  95.7k|            u4_lev_suffix_size =
  553|  95.7k|                            (15 <= u4_lev_prefix) ?
  ------------------
  |  Branch (553:29): [True: 33.2k, False: 62.4k]
  ------------------
  554|  62.4k|                                            (u4_lev_prefix - 3) : u4_suffix_len;
  555|       |
  556|       |            /*********************************************************/
  557|       |            /* Compute level code using prefix and suffix            */
  558|       |            /*********************************************************/
  559|  95.7k|            GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  95.7k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  95.7k|{                                                                           \
  |  |  122|  95.7k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  95.7k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  95.7k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  95.7k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  95.7k|                                                                            \
  |  |  127|  95.7k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 91.8k, False: 3.91k]
  |  |  ------------------
  |  |  128|  95.7k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  91.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  95.7k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  95.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  95.7k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  95.7k|}                                                                           \
  ------------------
  560|  95.7k|                    u4_lev_suffix_size);
  561|  95.7k|            u2_lev_code = (MIN(15,u4_lev_prefix) << u4_suffix_len)
  ------------------
  |  |   61|  95.7k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 33.1k, False: 62.6k]
  |  |  ------------------
  ------------------
  562|  95.7k|                            + u4_lev_suffix;
  563|       |
  564|       |            //HP_LEVEL_PREFIX
  565|  95.7k|            if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (565:16): [True: 33.1k, False: 62.6k]
  ------------------
  566|  33.1k|            {
  567|  33.1k|                u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
  568|  33.1k|            }
  569|  95.7k|            u2_abs_value = (u2_lev_code + 2) >> 1;
  570|       |
  571|       |            /*********************************************************/
  572|       |            /* If Level code is odd, level is negative else positive */
  573|       |            /*********************************************************/
  574|  95.7k|            i2_level_arr[i--] =
  575|  95.7k|                            (u2_lev_code & 1) ? -u2_abs_value : u2_abs_value;
  ------------------
  |  Branch (575:29): [True: 29.4k, False: 66.2k]
  ------------------
  576|       |
  577|       |            /*********************************************************/
  578|       |            /* Increment suffix length if required                   */
  579|       |            /*********************************************************/
  580|  95.7k|            u4_suffix_len +=
  581|  95.7k|                            (u4_suffix_len < 6) ?
  ------------------
  |  Branch (581:29): [True: 85.0k, False: 10.7k]
  ------------------
  582|  85.0k|                                            (u2_abs_value
  583|  85.0k|                                                            > (3
  584|  85.0k|                                                                            << (u4_suffix_len
  585|  85.0k|                                                                                            - 1))) :
  586|  95.7k|                                            0;
  587|  95.7k|        }
  588|       |
  589|       |        /****************************************************************/
  590|       |        /* Decoding Levels Ends                                         */
  591|       |        /****************************************************************/
  592|  31.8k|    }
  593|       |
  594|       |    /****************************************************************/
  595|       |    /* Decoding total zeros as in section 9.2.3, table 9.7          */
  596|       |    /****************************************************************/
  597|  72.4k|    {
  598|  72.4k|        UWORD32 u4_index;
  599|  72.4k|        const UWORD8 (*ppu1_total_zero_lkup)[64] =
  600|  72.4k|                        (const UWORD8 (*)[64])gau1_ih264d_table_total_zero_2to10;
  601|       |
  602|  72.4k|        NEXTBITS(u4_index, u4_bitstream_offset, pu4_bitstrm_buf, 6);
  ------------------
  |  |  137|  72.4k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  72.4k|{                                                                           \
  |  |  139|  72.4k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  72.4k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  72.4k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  72.4k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  72.4k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 69.8k, False: 2.54k]
  |  |  ------------------
  |  |  144|  72.4k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  69.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  72.4k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  72.4k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  72.4k|}
  ------------------
  603|  72.4k|        u4_total_zeroes = ppu1_total_zero_lkup[u4_total_coeff - 2][u4_index];
  604|       |
  605|  72.4k|        FLUSHBITS(u4_bitstream_offset, (u4_total_zeroes >> 4));
  ------------------
  |  |  193|  72.4k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  72.4k|{                                                                           \
  |  |  195|  72.4k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  72.4k|}
  ------------------
  606|  72.4k|        u4_total_zeroes &= 0xf;
  607|  72.4k|    }
  608|       |
  609|       |    /**************************************************************/
  610|       |    /* Decode the runs and form the coefficient buffer            */
  611|       |    /**************************************************************/
  612|  72.4k|    {
  613|  72.4k|        const UWORD8 *pu1_table_runbefore;
  614|  72.4k|        UWORD32 u4_run;
  615|  72.4k|        WORD32 k;
  616|  72.4k|        WORD32 u4_scan_pos = u4_total_coeff + u4_total_zeroes - 1 + u4_isdc;
  617|  72.4k|        WORD32 u4_zeroes_left = u4_total_zeroes;
  618|  72.4k|        k = u4_total_coeff - 1;
  619|       |
  620|       |        /**************************************************************/
  621|       |        /* Decoding Runs Begin for zeros left > 6                     */
  622|       |        /**************************************************************/
  623|  96.8k|        while((u4_zeroes_left > 6) && k)
  ------------------
  |  Branch (623:15): [True: 27.0k, False: 69.8k]
  |  Branch (623:39): [True: 24.3k, False: 2.60k]
  ------------------
  624|  24.3k|        {
  625|  24.3k|            UWORD32 u4_code;
  626|       |
  627|  24.3k|            NEXTBITS(u4_code, u4_bitstream_offset, pu4_bitstrm_buf, 3);
  ------------------
  |  |  137|  24.3k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  24.3k|{                                                                           \
  |  |  139|  24.3k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  24.3k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  24.3k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  24.3k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  24.3k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 23.3k, False: 1.00k]
  |  |  ------------------
  |  |  144|  24.3k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  23.3k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  24.3k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  24.3k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  24.3k|}
  ------------------
  628|       |
  629|  24.3k|            if(u4_code != 0)
  ------------------
  |  Branch (629:16): [True: 13.1k, False: 11.1k]
  ------------------
  630|  13.1k|            {
  631|  13.1k|                FLUSHBITS(u4_bitstream_offset, 3);
  ------------------
  |  |  193|  13.1k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  13.1k|{                                                                           \
  |  |  195|  13.1k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  13.1k|}
  ------------------
  632|  13.1k|                u4_run = (7 - u4_code);
  633|  13.1k|            }
  634|  11.1k|            else
  635|  11.1k|            {
  636|       |
  637|  11.1k|                FIND_ONE_IN_STREAM_LEN(u4_code, u4_bitstream_offset,
  ------------------
  |  |  176|  11.1k|#define   FIND_ONE_IN_STREAM_LEN(u4_ldz, u4_offset, pu4_bitstream, u4_len)  \
  |  |  177|  11.1k|{                                                                           \
  |  |  178|  11.1k|    UWORD32 u4_word;                                                        \
  |  |  179|  11.1k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  11.1k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  11.1k|{                                                                           \
  |  |  |  |  152|  11.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  11.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  11.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  11.1k|                                                                            \
  |  |  |  |  156|  11.1k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  11.1k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 10.6k, False: 531]
  |  |  |  |  ------------------
  |  |  |  |  158|  11.1k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  10.6k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  11.1k|}
  |  |  ------------------
  |  |  180|  11.1k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  181|  11.1k|    if(u4_ldz < u4_len)                                                     \
  |  |  ------------------
  |  |  |  Branch (181:8): [True: 4.71k, False: 6.48k]
  |  |  ------------------
  |  |  182|  11.1k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  183|  11.1k|    else                                                                    \
  |  |  184|  11.1k|    {                                                                       \
  |  |  185|  6.48k|        u4_ldz = u4_len;                                                    \
  |  |  186|  6.48k|        (u4_offset) += u4_ldz;                                              \
  |  |  187|  6.48k|    }                                                                       \
  |  |  188|  11.1k|}
  ------------------
  638|  11.1k|                                       pu4_bitstrm_buf, 11);
  639|  11.1k|                u4_run = (4 + u4_code);
  640|  11.1k|            }
  641|       |
  642|  24.3k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|  24.3k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  643|  24.3k|            *pi2_coeff_data++ = i2_level_arr[k--];
  644|  24.3k|            u4_zeroes_left -= (WORD32)u4_run;
  645|  24.3k|            u4_scan_pos -= (WORD32)(u4_run + 1);
  646|  24.3k|        }
  647|       |
  648|  72.4k|        if (u4_zeroes_left < 0 || u4_scan_pos < 0)
  ------------------
  |  Branch (648:13): [True: 6.88k, False: 65.5k]
  |  Branch (648:35): [True: 0, False: 65.5k]
  ------------------
  649|  6.88k|            return -1;
  650|       |
  651|       |        /**************************************************************/
  652|       |        /* Decoding Runs for 0 < zeros left <=6                       */
  653|       |        /**************************************************************/
  654|  65.5k|        pu1_table_runbefore = (UWORD8 *)gau1_ih264d_table_run_before;
  655|   139k|        while((u4_zeroes_left > 0) && k)
  ------------------
  |  Branch (655:15): [True: 102k, False: 36.3k]
  |  Branch (655:39): [True: 73.6k, False: 29.1k]
  ------------------
  656|  73.6k|        {
  657|  73.6k|            UWORD32 u4_code;
  658|  73.6k|            NEXTBITS(u4_code, u4_bitstream_offset, pu4_bitstrm_buf, 3);
  ------------------
  |  |  137|  73.6k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  73.6k|{                                                                           \
  |  |  139|  73.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  73.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  73.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  73.6k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  73.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 71.3k, False: 2.27k]
  |  |  ------------------
  |  |  144|  73.6k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  71.3k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  73.6k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  73.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  73.6k|}
  ------------------
  659|       |
  660|  73.6k|            u4_code = pu1_table_runbefore[u4_code + (u4_zeroes_left << 3)];
  661|  73.6k|            u4_run = u4_code >> 2;
  662|       |
  663|  73.6k|            FLUSHBITS(u4_bitstream_offset, (u4_code & 0x03));
  ------------------
  |  |  193|  73.6k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  73.6k|{                                                                           \
  |  |  195|  73.6k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  73.6k|}
  ------------------
  664|       |
  665|  73.6k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|  73.6k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  666|  73.6k|            *pi2_coeff_data++ = i2_level_arr[k--];
  667|  73.6k|            u4_zeroes_left -= (WORD32)u4_run;
  668|  73.6k|            u4_scan_pos -= (WORD32)(u4_run + 1);
  669|  73.6k|        }
  670|  65.5k|        if (u4_zeroes_left < 0 || u4_scan_pos < 0)
  ------------------
  |  Branch (670:13): [True: 0, False: 65.5k]
  |  Branch (670:35): [True: 0, False: 65.5k]
  ------------------
  671|      0|            return -1;
  672|       |        /**************************************************************/
  673|       |        /* Decoding Runs End                                          */
  674|       |        /**************************************************************/
  675|       |
  676|       |        /**************************************************************/
  677|       |        /* Copy the remaining coefficients                            */
  678|       |        /**************************************************************/
  679|   194k|        while(k >= 0)
  ------------------
  |  Branch (679:15): [True: 129k, False: 65.5k]
  ------------------
  680|   129k|        {
  681|       |
  682|   129k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|   129k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  683|   129k|            *pi2_coeff_data++ = i2_level_arr[k--];
  684|   129k|            u4_scan_pos--;
  685|   129k|        }
  686|  65.5k|    }
  687|       |
  688|      0|    {
  689|  65.5k|        WORD32 offset;
  690|  65.5k|        offset = (UWORD8 *)pi2_coeff_data - (UWORD8 *)ps_tu_4x4;
  691|  65.5k|        offset = ALIGN4(offset);
  ------------------
  |  |   52|  65.5k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  692|  65.5k|        ps_dec->pv_parse_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_parse_tu_coeff_data + offset);
  693|  65.5k|    }
  694|       |
  695|  65.5k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
  696|  65.5k|    return 0;
  697|  65.5k|}
ih264d_cavlc_4x4res_block_totalcoeff_11to16:
  727|  18.2k|{
  728|  18.2k|    UWORD32 u4_total_zeroes;
  729|  18.2k|    WORD32 i;
  730|  18.2k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  731|  18.2k|    UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
  732|  18.2k|    UWORD32 u4_trailing_ones = u4_total_coeff_trail_one & 0xFFFF;
  733|  18.2k|    UWORD32 u4_total_coeff = u4_total_coeff_trail_one >> 16;
  734|       |    // To avoid error check at 4x4 level, allocating for 3 extra levels(16+3)
  735|       |    // since u4_trailing_ones can at the max be 3. This will be required when
  736|       |    // u4_total_coeff is less than u4_trailing_ones
  737|  18.2k|    WORD16 ai2_level_arr[19];//
  738|  18.2k|    WORD16 *i2_level_arr = &ai2_level_arr[3];
  739|       |
  740|  18.2k|    tu_sblk4x4_coeff_data_t *ps_tu_4x4;
  741|  18.2k|    WORD16 *pi2_coeff_data;
  742|  18.2k|    dec_struct_t *ps_dec = (dec_struct_t *)ps_bitstrm->pv_codec_handle;
  743|       |
  744|  18.2k|    ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
  745|  18.2k|    ps_tu_4x4->u2_sig_coeff_map = 0;
  746|  18.2k|    pi2_coeff_data = &ps_tu_4x4->ai2_level[0];
  747|       |
  748|  18.2k|    i = u4_total_coeff - 1;
  749|  18.2k|    if(u4_trailing_ones)
  ------------------
  |  Branch (749:8): [True: 13.0k, False: 5.16k]
  ------------------
  750|  13.0k|    {
  751|       |        /*********************************************************************/
  752|       |        /* Decode Trailing Ones                                              */
  753|       |        /* read the sign of T1's and put them in level array                 */
  754|       |        /*********************************************************************/
  755|  13.0k|        UWORD32 u4_signs, u4_cnt = u4_trailing_ones;
  756|  13.0k|        WORD16 (*ppi2_trlone_lkup)[3] =
  757|  13.0k|                        (WORD16 (*)[3])gai2_ih264d_trailing_one_level;
  758|  13.0k|        WORD16 *pi2_trlone_lkup;
  759|       |
  760|  13.0k|        GETBITS(u4_signs, u4_bitstream_offset, pu4_bitstrm_buf, u4_cnt);
  ------------------
  |  |  120|  13.0k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  13.0k|{                                                                           \
  |  |  122|  13.0k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  13.0k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  13.0k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  13.0k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  13.0k|                                                                            \
  |  |  127|  13.0k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 12.5k, False: 508]
  |  |  ------------------
  |  |  128|  13.0k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  12.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  13.0k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  13.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  13.0k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  13.0k|}                                                                           \
  ------------------
  761|       |
  762|  13.0k|        pi2_trlone_lkup = ppi2_trlone_lkup[(1 << u4_cnt) - 2 + u4_signs];
  763|       |
  764|  47.8k|        while(u4_cnt)
  ------------------
  |  Branch (764:15): [True: 34.7k, False: 13.0k]
  ------------------
  765|  34.7k|        {
  766|  34.7k|            i2_level_arr[i--] = *pi2_trlone_lkup++;
  767|  34.7k|            u4_cnt--;
  768|  34.7k|        }
  769|  13.0k|    }
  770|       |
  771|       |    /****************************************************************/
  772|       |    /* Decoding Levels Begins                                       */
  773|       |    /****************************************************************/
  774|  18.2k|    if(i >= 0)
  ------------------
  |  Branch (774:8): [True: 18.2k, False: 0]
  ------------------
  775|  18.2k|    {
  776|       |        /****************************************************************/
  777|       |        /* First level is decoded outside the loop as it has lot of     */
  778|       |        /* special cases.                                               */
  779|       |        /****************************************************************/
  780|  18.2k|        UWORD32 u4_lev_suffix, u4_suffix_len, u4_lev_suffix_size;
  781|  18.2k|        UWORD16 u2_lev_code, u2_abs_value;
  782|  18.2k|        UWORD32 u4_lev_prefix;
  783|       |
  784|  18.2k|        if(u4_trailing_ones < 3)
  ------------------
  |  Branch (784:12): [True: 8.09k, False: 10.1k]
  ------------------
  785|  8.09k|        {
  786|       |            /*********************************************************/
  787|       |            /* u4_suffix_len = 1                                     */
  788|       |            /*********************************************************/
  789|       |            /***************************************************************/
  790|       |            /* Find leading zeros in next 32 bits                          */
  791|       |            /***************************************************************/
  792|  8.09k|            FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|  8.09k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|  8.09k|{                                                                           \
  |  |  167|  8.09k|    UWORD32 u4_word;                                                        \
  |  |  168|  8.09k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  8.09k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  8.09k|{                                                                           \
  |  |  |  |  152|  8.09k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  8.09k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  8.09k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  8.09k|                                                                            \
  |  |  |  |  156|  8.09k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  8.09k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 7.33k, False: 765]
  |  |  |  |  ------------------
  |  |  |  |  158|  8.09k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  7.33k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  8.09k|}
  |  |  ------------------
  |  |  169|  8.09k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|  8.09k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|  8.09k|}
  ------------------
  793|  8.09k|                                  pu4_bitstrm_buf);
  794|       |
  795|  8.09k|            u4_lev_suffix_size =
  796|  8.09k|                            (15 <= u4_lev_prefix) ? (u4_lev_prefix - 3) : 1;
  ------------------
  |  Branch (796:29): [True: 2.98k, False: 5.11k]
  ------------------
  797|       |
  798|  8.09k|            GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  8.09k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  8.09k|{                                                                           \
  |  |  122|  8.09k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  8.09k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  8.09k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  8.09k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  8.09k|                                                                            \
  |  |  127|  8.09k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 7.58k, False: 509]
  |  |  ------------------
  |  |  128|  8.09k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  7.58k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  8.09k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  8.09k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  8.09k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  8.09k|}                                                                           \
  ------------------
  799|  8.09k|                    u4_lev_suffix_size);
  800|  8.09k|            u2_lev_code = 2 + (MIN(u4_lev_prefix,15) << 1) + u4_lev_suffix;
  ------------------
  |  |   61|  8.09k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 5.11k, False: 2.98k]
  |  |  ------------------
  ------------------
  801|       |
  802|       |            //HP_LEVEL_PREFIX
  803|  8.09k|            if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (803:16): [True: 2.98k, False: 5.11k]
  ------------------
  804|  2.98k|            {
  805|  2.98k|                u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
  806|  2.98k|            }
  807|  8.09k|        }
  808|  10.1k|        else
  809|  10.1k|        {
  810|       |            /*********************************************************/
  811|       |            /*u4_suffix_len = 0                                      */
  812|       |            /*********************************************************/
  813|       |            /***************************************************************/
  814|       |            /* Find leading zeros in next 32 bits                          */
  815|       |            /***************************************************************/
  816|  10.1k|            FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|  10.1k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|  10.1k|{                                                                           \
  |  |  167|  10.1k|    UWORD32 u4_word;                                                        \
  |  |  168|  10.1k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  10.1k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  10.1k|{                                                                           \
  |  |  |  |  152|  10.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  10.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  10.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  10.1k|                                                                            \
  |  |  |  |  156|  10.1k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  10.1k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 9.61k, False: 509]
  |  |  |  |  ------------------
  |  |  |  |  158|  10.1k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  9.61k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  10.1k|}
  |  |  ------------------
  |  |  169|  10.1k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|  10.1k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|  10.1k|}
  ------------------
  817|  10.1k|                                  pu4_bitstrm_buf);
  818|       |
  819|       |            /*********************************************************/
  820|       |            /* Special decoding case when trailing ones are 3        */
  821|       |            /*********************************************************/
  822|  10.1k|            u2_lev_code = MIN(15, u4_lev_prefix);
  ------------------
  |  |   61|  10.1k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 459, False: 9.66k]
  |  |  ------------------
  ------------------
  823|       |
  824|  10.1k|            u2_lev_code += (3 == u4_trailing_ones) ? 0 : (2);
  ------------------
  |  Branch (824:28): [True: 10.1k, False: 0]
  ------------------
  825|       |
  826|  10.1k|            if(14 == u4_lev_prefix)
  ------------------
  |  Branch (826:16): [True: 71, False: 10.0k]
  ------------------
  827|     71|                u4_lev_suffix_size = 4;
  828|  10.0k|            else if(15 <= u4_lev_prefix)
  ------------------
  |  Branch (828:21): [True: 733, False: 9.31k]
  ------------------
  829|    733|            {
  830|    733|                u2_lev_code += 15;
  831|    733|                u4_lev_suffix_size = (u4_lev_prefix - 3);
  832|    733|            }
  833|  9.31k|            else
  834|  9.31k|                u4_lev_suffix_size = 0;
  835|       |
  836|       |            //HP_LEVEL_PREFIX
  837|  10.1k|            if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (837:16): [True: 459, False: 9.66k]
  ------------------
  838|    459|            {
  839|    459|                u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
  840|    459|            }
  841|  10.1k|            if(u4_lev_suffix_size)
  ------------------
  |  Branch (841:16): [True: 804, False: 9.31k]
  ------------------
  842|    804|            {
  843|    804|                GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|    804|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|    804|{                                                                           \
  |  |  122|    804|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|    804|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|    804|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|    804|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|    804|                                                                            \
  |  |  127|    804|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 698, False: 106]
  |  |  ------------------
  |  |  128|    804|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|    698|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|    804|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|    804|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|    804|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|    804|}                                                                           \
  ------------------
  844|    804|                        u4_lev_suffix_size);
  845|    804|                u2_lev_code += u4_lev_suffix;
  846|    804|            }
  847|  10.1k|        }
  848|       |
  849|  18.2k|        u2_abs_value = (u2_lev_code + 2) >> 1;
  850|       |        /*********************************************************/
  851|       |        /* If Level code is odd, level is negative else positive */
  852|       |        /*********************************************************/
  853|  18.2k|        i2_level_arr[i--] = (u2_lev_code & 1) ? -u2_abs_value : u2_abs_value;
  ------------------
  |  Branch (853:29): [True: 4.43k, False: 13.7k]
  ------------------
  854|       |
  855|  18.2k|        u4_suffix_len = (u2_abs_value > 3) ? 2 : 1;
  ------------------
  |  Branch (855:25): [True: 6.54k, False: 11.6k]
  ------------------
  856|       |
  857|       |        /*********************************************************/
  858|       |        /* Now loop over the remaining levels                    */
  859|       |        /*********************************************************/
  860|   239k|        while(i >= 0)
  ------------------
  |  Branch (860:15): [True: 221k, False: 18.2k]
  ------------------
  861|   221k|        {
  862|       |
  863|       |            /***************************************************************/
  864|       |            /* Find leading zeros in next 32 bits                          */
  865|       |            /***************************************************************/
  866|   221k|            FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|   221k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|   221k|{                                                                           \
  |  |  167|   221k|    UWORD32 u4_word;                                                        \
  |  |  168|   221k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|   221k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|   221k|{                                                                           \
  |  |  |  |  152|   221k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|   221k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|   221k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|   221k|                                                                            \
  |  |  |  |  156|   221k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|   221k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 213k, False: 7.40k]
  |  |  |  |  ------------------
  |  |  |  |  158|   221k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|   213k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|   221k|}
  |  |  ------------------
  |  |  169|   221k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|   221k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|   221k|}
  ------------------
  867|   221k|                                  pu4_bitstrm_buf);
  868|       |
  869|   221k|            u4_lev_suffix_size =
  870|   221k|                            (15 <= u4_lev_prefix) ?
  ------------------
  |  Branch (870:29): [True: 49.1k, False: 171k]
  ------------------
  871|   171k|                                            (u4_lev_prefix - 3) : u4_suffix_len;
  872|       |
  873|       |            /*********************************************************/
  874|       |            /* Compute level code using prefix and suffix            */
  875|       |            /*********************************************************/
  876|   221k|            GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|   221k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|   221k|{                                                                           \
  |  |  122|   221k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|   221k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|   221k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|   221k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|   221k|                                                                            \
  |  |  127|   221k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 211k, False: 9.97k]
  |  |  ------------------
  |  |  128|   221k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|   211k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|   221k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|   221k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|   221k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|   221k|}                                                                           \
  ------------------
  877|   221k|                    u4_lev_suffix_size);
  878|   221k|            u2_lev_code = (MIN(15,u4_lev_prefix) << u4_suffix_len)
  ------------------
  |  |   61|   221k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 48.9k, False: 172k]
  |  |  ------------------
  ------------------
  879|   221k|                            + u4_lev_suffix;
  880|       |
  881|       |            //HP_LEVEL_PREFIX
  882|   221k|            if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (882:16): [True: 48.9k, False: 172k]
  ------------------
  883|  48.9k|            {
  884|  48.9k|                u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
  885|  48.9k|            }
  886|   221k|            u2_abs_value = (u2_lev_code + 2) >> 1;
  887|       |
  888|       |            /*********************************************************/
  889|       |            /* If Level code is odd, level is negative else positive */
  890|       |            /*********************************************************/
  891|   221k|            i2_level_arr[i--] =
  892|   221k|                            (u2_lev_code & 1) ? -u2_abs_value : u2_abs_value;
  ------------------
  |  Branch (892:29): [True: 125k, False: 95.4k]
  ------------------
  893|       |
  894|       |            /*********************************************************/
  895|       |            /* Increment suffix length if required                   */
  896|       |            /*********************************************************/
  897|   221k|            u4_suffix_len +=
  898|   221k|                            (u4_suffix_len < 6) ?
  ------------------
  |  Branch (898:29): [True: 184k, False: 36.8k]
  ------------------
  899|   184k|                                            (u2_abs_value
  900|   184k|                                                            > (3
  901|   184k|                                                                            << (u4_suffix_len
  902|   184k|                                                                                            - 1))) :
  903|   221k|                                            0;
  904|   221k|        }
  905|       |
  906|       |        /****************************************************************/
  907|       |        /* Decoding Levels Ends                                         */
  908|       |        /****************************************************************/
  909|  18.2k|    }
  910|       |
  911|  18.2k|    if(u4_total_coeff < (16 - u4_isdc))
  ------------------
  |  Branch (911:8): [True: 6.11k, False: 12.1k]
  ------------------
  912|  6.11k|    {
  913|  6.11k|        UWORD32 u4_index;
  914|  6.11k|        const UWORD8 (*ppu1_total_zero_lkup)[16] =
  915|  6.11k|                        (const UWORD8 (*)[16])gau1_ih264d_table_total_zero_11to15;
  916|       |
  917|  6.11k|        NEXTBITS(u4_index, u4_bitstream_offset, pu4_bitstrm_buf, 4);
  ------------------
  |  |  137|  6.11k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  6.11k|{                                                                           \
  |  |  139|  6.11k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  6.11k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  6.11k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  6.11k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  6.11k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 5.92k, False: 190]
  |  |  ------------------
  |  |  144|  6.11k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  5.92k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  6.11k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  6.11k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  6.11k|}
  ------------------
  918|  6.11k|        u4_total_zeroes = ppu1_total_zero_lkup[u4_total_coeff - 11][u4_index];
  919|       |
  920|  6.11k|        FLUSHBITS(u4_bitstream_offset, (u4_total_zeroes >> 4));
  ------------------
  |  |  193|  6.11k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  6.11k|{                                                                           \
  |  |  195|  6.11k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  6.11k|}
  ------------------
  921|  6.11k|        u4_total_zeroes &= 0xf;
  922|  6.11k|    }
  923|  12.1k|    else
  924|  12.1k|        u4_total_zeroes = 0;
  925|       |
  926|       |    /**************************************************************/
  927|       |    /* Decode the runs and form the coefficient buffer            */
  928|       |    /**************************************************************/
  929|  18.2k|    {
  930|  18.2k|        const UWORD8 *pu1_table_runbefore;
  931|  18.2k|        UWORD32 u4_run;
  932|  18.2k|        WORD32 k;
  933|  18.2k|        WORD32 u4_scan_pos = u4_total_coeff + u4_total_zeroes - 1 + u4_isdc;
  934|  18.2k|        WORD32 u4_zeroes_left = u4_total_zeroes;
  935|  18.2k|        k = u4_total_coeff - 1;
  936|       |
  937|       |        /**************************************************************/
  938|       |        /* Decoding Runs for 0 < zeros left <=6                       */
  939|       |        /**************************************************************/
  940|  18.2k|        pu1_table_runbefore = (UWORD8 *)gau1_ih264d_table_run_before;
  941|  37.2k|        while((u4_zeroes_left > 0) && k)
  ------------------
  |  Branch (941:15): [True: 19.5k, False: 17.6k]
  |  Branch (941:39): [True: 19.0k, False: 557]
  ------------------
  942|  19.0k|        {
  943|  19.0k|            UWORD32 u4_code;
  944|  19.0k|            NEXTBITS(u4_code, u4_bitstream_offset, pu4_bitstrm_buf, 3);
  ------------------
  |  |  137|  19.0k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  19.0k|{                                                                           \
  |  |  139|  19.0k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  19.0k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  19.0k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  19.0k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  19.0k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 17.9k, False: 1.05k]
  |  |  ------------------
  |  |  144|  19.0k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  17.9k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  19.0k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  19.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  19.0k|}
  ------------------
  945|       |
  946|  19.0k|            u4_code = pu1_table_runbefore[u4_code + (u4_zeroes_left << 3)];
  947|  19.0k|            u4_run = u4_code >> 2;
  948|       |
  949|  19.0k|            FLUSHBITS(u4_bitstream_offset, (u4_code & 0x03));
  ------------------
  |  |  193|  19.0k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  19.0k|{                                                                           \
  |  |  195|  19.0k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  19.0k|}
  ------------------
  950|  19.0k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|  19.0k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  951|  19.0k|            *pi2_coeff_data++ = i2_level_arr[k--];
  952|  19.0k|            u4_zeroes_left -= (WORD32)u4_run;
  953|  19.0k|            u4_scan_pos -= (WORD32)(u4_run + 1);
  954|  19.0k|        }
  955|  18.2k|        if (u4_zeroes_left < 0 || u4_scan_pos < 0)
  ------------------
  |  Branch (955:13): [True: 0, False: 18.2k]
  |  Branch (955:35): [True: 0, False: 18.2k]
  ------------------
  956|      0|          return -1;
  957|       |
  958|       |        /**************************************************************/
  959|       |        /* Decoding Runs End                                          */
  960|       |        /**************************************************************/
  961|       |
  962|       |        /**************************************************************/
  963|       |        /* Copy the remaining coefficients                            */
  964|       |        /**************************************************************/
  965|   273k|        while(k >= 0)
  ------------------
  |  Branch (965:15): [True: 255k, False: 18.2k]
  ------------------
  966|   255k|        {
  967|   255k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|   255k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  968|   255k|            *pi2_coeff_data++ = i2_level_arr[k--];
  969|   255k|            u4_scan_pos--;
  970|   255k|        }
  971|  18.2k|    }
  972|       |
  973|      0|    {
  974|  18.2k|        WORD32 offset;
  975|  18.2k|        offset = (UWORD8 *)pi2_coeff_data - (UWORD8 *)ps_tu_4x4;
  976|  18.2k|        offset = ALIGN4(offset);
  ------------------
  |  |   52|  18.2k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  977|  18.2k|        ps_dec->pv_parse_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_parse_tu_coeff_data + offset);
  978|  18.2k|    }
  979|       |
  980|  18.2k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
  981|  18.2k|    return 0;
  982|  18.2k|}
ih264d_rest_of_residual_cav_chroma_dc_block:
 1007|  91.1k|{
 1008|  91.1k|    UWORD32 u4_total_zeroes;
 1009|  91.1k|    WORD16 i;
 1010|  91.1k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1011|  91.1k|    UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
 1012|  91.1k|    UWORD32 u4_trailing_ones = u4_total_coeff_trail_one & 0xFFFF;
 1013|  91.1k|    UWORD32 u4_total_coeff = u4_total_coeff_trail_one >> 16;
 1014|       |    // To avoid error check at 4x4 level, allocating for 3 extra levels(4+3)
 1015|       |    // since u4_trailing_ones can at the max be 3. This will be required when
 1016|       |    // u4_total_coeff is less than u4_trailing_ones
 1017|  91.1k|    WORD16 ai2_level_arr[7];//
 1018|  91.1k|    WORD16 *i2_level_arr = &ai2_level_arr[3];
 1019|       |
 1020|  91.1k|    tu_sblk4x4_coeff_data_t *ps_tu_4x4;
 1021|  91.1k|    WORD16 *pi2_coeff_data;
 1022|  91.1k|    dec_struct_t *ps_dec = (dec_struct_t *)ps_bitstrm->pv_codec_handle;
 1023|       |
 1024|  91.1k|    ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
 1025|  91.1k|    ps_tu_4x4->u2_sig_coeff_map = 0;
 1026|  91.1k|    pi2_coeff_data = &ps_tu_4x4->ai2_level[0];
 1027|       |
 1028|  91.1k|    i = u4_total_coeff - 1;
 1029|  91.1k|    if(u4_trailing_ones)
  ------------------
  |  Branch (1029:8): [True: 86.6k, False: 4.52k]
  ------------------
 1030|  86.6k|    {
 1031|       |        /*********************************************************************/
 1032|       |        /* Decode Trailing Ones                                              */
 1033|       |        /* read the sign of T1's and put them in level array                 */
 1034|       |        /*********************************************************************/
 1035|  86.6k|        UWORD32 u4_signs, u4_cnt = u4_trailing_ones;
 1036|  86.6k|        WORD16 (*ppi2_trlone_lkup)[3] =
 1037|  86.6k|                        (WORD16 (*)[3])gai2_ih264d_trailing_one_level;
 1038|  86.6k|        WORD16 *pi2_trlone_lkup;
 1039|       |
 1040|  86.6k|        GETBITS(u4_signs, u4_bitstream_offset, pu4_bitstrm_buf, u4_cnt);
  ------------------
  |  |  120|  86.6k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  86.6k|{                                                                           \
  |  |  122|  86.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  86.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  86.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  86.6k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  86.6k|                                                                            \
  |  |  127|  86.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 83.5k, False: 3.09k]
  |  |  ------------------
  |  |  128|  86.6k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  83.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  86.6k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  86.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  86.6k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  86.6k|}                                                                           \
  ------------------
 1041|       |
 1042|  86.6k|        pi2_trlone_lkup = ppi2_trlone_lkup[(1 << u4_cnt) - 2 + u4_signs];
 1043|       |
 1044|   197k|        while(u4_cnt)
  ------------------
  |  Branch (1044:15): [True: 110k, False: 86.6k]
  ------------------
 1045|   110k|        {
 1046|   110k|            i2_level_arr[i--] = *pi2_trlone_lkup++;
 1047|   110k|            u4_cnt--;
 1048|   110k|        }
 1049|  86.6k|    }
 1050|       |
 1051|       |    /****************************************************************/
 1052|       |    /* Decoding Levels Begins                                       */
 1053|       |    /****************************************************************/
 1054|  91.1k|    if(i >= 0)
  ------------------
  |  Branch (1054:8): [True: 13.9k, False: 77.2k]
  ------------------
 1055|  13.9k|    {
 1056|       |        /****************************************************************/
 1057|       |        /* First level is decoded outside the loop as it has lot of     */
 1058|       |        /* special cases.                                               */
 1059|       |        /****************************************************************/
 1060|  13.9k|        UWORD32 u4_lev_suffix, u4_suffix_len, u4_lev_suffix_size;
 1061|  13.9k|        UWORD16 u2_lev_code, u2_abs_value;
 1062|  13.9k|        UWORD32 u4_lev_prefix;
 1063|       |
 1064|       |        /***************************************************************/
 1065|       |        /* u4_suffix_len = 0,  Find leading zeros in next 32 bits      */
 1066|       |        /***************************************************************/
 1067|  13.9k|        FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|  13.9k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|  13.9k|{                                                                           \
  |  |  167|  13.9k|    UWORD32 u4_word;                                                        \
  |  |  168|  13.9k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  13.9k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  13.9k|{                                                                           \
  |  |  |  |  152|  13.9k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  13.9k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  13.9k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  13.9k|                                                                            \
  |  |  |  |  156|  13.9k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  13.9k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 13.5k, False: 373]
  |  |  |  |  ------------------
  |  |  |  |  158|  13.9k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  13.5k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  13.9k|}
  |  |  ------------------
  |  |  169|  13.9k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|  13.9k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|  13.9k|}
  ------------------
 1068|  13.9k|                              pu4_bitstrm_buf);
 1069|       |
 1070|       |        /*********************************************************/
 1071|       |        /* Special decoding case when trailing ones are 3        */
 1072|       |        /*********************************************************/
 1073|  13.9k|        u2_lev_code = MIN(15, u4_lev_prefix);
  ------------------
  |  |   61|  13.9k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 1.92k, False: 11.9k]
  |  |  ------------------
  ------------------
 1074|       |
 1075|  13.9k|        u2_lev_code += (3 == u4_trailing_ones) ? 0 : (2);
  ------------------
  |  Branch (1075:24): [True: 4.21k, False: 9.69k]
  ------------------
 1076|       |
 1077|  13.9k|        if(14 == u4_lev_prefix)
  ------------------
  |  Branch (1077:12): [True: 218, False: 13.6k]
  ------------------
 1078|    218|            u4_lev_suffix_size = 4;
 1079|  13.6k|        else if(15 <= u4_lev_prefix)
  ------------------
  |  Branch (1079:17): [True: 1.93k, False: 11.7k]
  ------------------
 1080|  1.93k|        {
 1081|  1.93k|            u2_lev_code += 15;
 1082|  1.93k|            u4_lev_suffix_size = u4_lev_prefix - 3;
 1083|  1.93k|        }
 1084|  11.7k|        else
 1085|  11.7k|            u4_lev_suffix_size = 0;
 1086|       |
 1087|       |        //HP_LEVEL_PREFIX
 1088|  13.9k|        if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (1088:12): [True: 1.92k, False: 11.9k]
  ------------------
 1089|  1.92k|        {
 1090|  1.92k|            u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
 1091|  1.92k|        }
 1092|  13.9k|        if(u4_lev_suffix_size)
  ------------------
  |  Branch (1092:12): [True: 2.14k, False: 11.7k]
  ------------------
 1093|  2.14k|        {
 1094|  2.14k|            GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  2.14k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  2.14k|{                                                                           \
  |  |  122|  2.14k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  2.14k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  2.14k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  2.14k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  2.14k|                                                                            \
  |  |  127|  2.14k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 1.84k, False: 301]
  |  |  ------------------
  |  |  128|  2.14k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  1.84k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  2.14k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  2.14k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  2.14k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  2.14k|}                                                                           \
  ------------------
 1095|  2.14k|                    u4_lev_suffix_size);
 1096|  2.14k|            u2_lev_code += u4_lev_suffix;
 1097|  2.14k|        }
 1098|       |
 1099|  13.9k|        u2_abs_value = (u2_lev_code + 2) >> 1;
 1100|       |        /*********************************************************/
 1101|       |        /* If Level code is odd, level is negative else positive */
 1102|       |        /*********************************************************/
 1103|  13.9k|        i2_level_arr[i--] = (u2_lev_code & 1) ? -u2_abs_value : u2_abs_value;
  ------------------
  |  Branch (1103:29): [True: 2.32k, False: 11.5k]
  ------------------
 1104|       |
 1105|  13.9k|        u4_suffix_len = (u2_abs_value > 3) ? 2 : 1;
  ------------------
  |  Branch (1105:25): [True: 2.48k, False: 11.4k]
  ------------------
 1106|       |
 1107|       |        /*********************************************************/
 1108|       |        /* Now loop over the remaining levels                    */
 1109|       |        /*********************************************************/
 1110|  21.7k|        while(i >= 0)
  ------------------
  |  Branch (1110:15): [True: 7.86k, False: 13.9k]
  ------------------
 1111|  7.86k|        {
 1112|       |
 1113|       |            /***************************************************************/
 1114|       |            /* Find leading zeros in next 32 bits                          */
 1115|       |            /***************************************************************/
 1116|  7.86k|            FIND_ONE_IN_STREAM_32(u4_lev_prefix, u4_bitstream_offset,
  ------------------
  |  |  165|  7.86k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|  7.86k|{                                                                           \
  |  |  167|  7.86k|    UWORD32 u4_word;                                                        \
  |  |  168|  7.86k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  7.86k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  7.86k|{                                                                           \
  |  |  |  |  152|  7.86k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  7.86k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  7.86k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  7.86k|                                                                            \
  |  |  |  |  156|  7.86k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  7.86k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 7.55k, False: 307]
  |  |  |  |  ------------------
  |  |  |  |  158|  7.86k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  7.55k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  7.86k|}
  |  |  ------------------
  |  |  169|  7.86k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|  7.86k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|  7.86k|}
  ------------------
 1117|  7.86k|                                  pu4_bitstrm_buf);
 1118|       |
 1119|  7.86k|            u4_lev_suffix_size =
 1120|  7.86k|                            (15 <= u4_lev_prefix) ?
  ------------------
  |  Branch (1120:29): [True: 363, False: 7.49k]
  ------------------
 1121|  7.49k|                                            (u4_lev_prefix - 3) : u4_suffix_len;
 1122|       |
 1123|       |            /*********************************************************/
 1124|       |            /* Compute level code using prefix and suffix            */
 1125|       |            /*********************************************************/
 1126|  7.86k|            GETBITS(u4_lev_suffix, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  7.86k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  7.86k|{                                                                           \
  |  |  122|  7.86k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  7.86k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  7.86k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  7.86k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  7.86k|                                                                            \
  |  |  127|  7.86k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 7.33k, False: 531]
  |  |  ------------------
  |  |  128|  7.86k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  7.33k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  7.86k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  7.86k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  7.86k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  7.86k|}                                                                           \
  ------------------
 1127|  7.86k|                    u4_lev_suffix_size);
 1128|  7.86k|            u2_lev_code = (MIN(u4_lev_prefix,15) << u4_suffix_len)
  ------------------
  |  |   61|  7.86k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 7.49k, False: 363]
  |  |  ------------------
  ------------------
 1129|  7.86k|                            + u4_lev_suffix;
 1130|       |
 1131|       |            //HP_LEVEL_PREFIX
 1132|  7.86k|            if(16 <= u4_lev_prefix)
  ------------------
  |  Branch (1132:16): [True: 356, False: 7.50k]
  ------------------
 1133|    356|            {
 1134|    356|                u2_lev_code += ((1 << (u4_lev_prefix - 3)) - 4096);
 1135|    356|            }
 1136|  7.86k|            u2_abs_value = (u2_lev_code + 2) >> 1;
 1137|       |
 1138|       |            /*********************************************************/
 1139|       |            /* If Level code is odd, level is negative else positive */
 1140|       |            /*********************************************************/
 1141|  7.86k|            i2_level_arr[i--] =
 1142|  7.86k|                            (u2_lev_code & 1) ? -u2_abs_value : u2_abs_value;
  ------------------
  |  Branch (1142:29): [True: 2.77k, False: 5.08k]
  ------------------
 1143|       |
 1144|       |            /*********************************************************/
 1145|       |            /* Increment suffix length if required                   */
 1146|       |            /*********************************************************/
 1147|  7.86k|            u4_suffix_len += (u2_abs_value > (3 << (u4_suffix_len - 1)));
 1148|  7.86k|        }
 1149|       |
 1150|       |        /****************************************************************/
 1151|       |        /* Decoding Levels Ends                                         */
 1152|       |        /****************************************************************/
 1153|  13.9k|    }
 1154|       |
 1155|  91.1k|    if(u4_total_coeff < 4)
  ------------------
  |  Branch (1155:8): [True: 85.1k, False: 5.98k]
  ------------------
 1156|  85.1k|    {
 1157|  85.1k|        UWORD32 u4_max_ldz = (4 - u4_total_coeff);
 1158|  85.1k|        FIND_ONE_IN_STREAM_LEN(u4_total_zeroes, u4_bitstream_offset,
  ------------------
  |  |  176|  85.1k|#define   FIND_ONE_IN_STREAM_LEN(u4_ldz, u4_offset, pu4_bitstream, u4_len)  \
  |  |  177|  85.1k|{                                                                           \
  |  |  178|  85.1k|    UWORD32 u4_word;                                                        \
  |  |  179|  85.1k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|  85.1k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|  85.1k|{                                                                           \
  |  |  |  |  152|  85.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|  85.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|  85.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|  85.1k|                                                                            \
  |  |  |  |  156|  85.1k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|  85.1k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 82.2k, False: 2.88k]
  |  |  |  |  ------------------
  |  |  |  |  158|  85.1k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  82.2k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|  85.1k|}
  |  |  ------------------
  |  |  180|  85.1k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  181|  85.1k|    if(u4_ldz < u4_len)                                                     \
  |  |  ------------------
  |  |  |  Branch (181:8): [True: 72.2k, False: 12.9k]
  |  |  ------------------
  |  |  182|  85.1k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  183|  85.1k|    else                                                                    \
  |  |  184|  85.1k|    {                                                                       \
  |  |  185|  12.9k|        u4_ldz = u4_len;                                                    \
  |  |  186|  12.9k|        (u4_offset) += u4_ldz;                                              \
  |  |  187|  12.9k|    }                                                                       \
  |  |  188|  85.1k|}
  ------------------
 1159|  85.1k|                               pu4_bitstrm_buf, u4_max_ldz);
 1160|  85.1k|    }
 1161|  5.98k|    else
 1162|  5.98k|        u4_total_zeroes = 0;
 1163|       |
 1164|       |    /**************************************************************/
 1165|       |    /* Decode the runs and form the coefficient buffer            */
 1166|       |    /**************************************************************/
 1167|  91.1k|    {
 1168|  91.1k|        const UWORD8 *pu1_table_runbefore;
 1169|  91.1k|        UWORD32 u4_run;
 1170|  91.1k|        WORD32 u4_scan_pos = (u4_total_coeff + u4_total_zeroes - 1);
 1171|  91.1k|        UWORD32 u4_zeroes_left = u4_total_zeroes;
 1172|  91.1k|        i = u4_total_coeff - 1;
 1173|       |
 1174|       |        /**************************************************************/
 1175|       |        /* Decoding Runs for 0 < zeros left <=6                       */
 1176|       |        /**************************************************************/
 1177|  91.1k|        pu1_table_runbefore = (UWORD8 *)gau1_ih264d_table_run_before;
 1178|   104k|        while(u4_zeroes_left && i)
  ------------------
  |  Branch (1178:15): [True: 37.3k, False: 67.4k]
  |  Branch (1178:33): [True: 13.7k, False: 23.6k]
  ------------------
 1179|  13.7k|        {
 1180|  13.7k|            UWORD32 u4_code;
 1181|  13.7k|            NEXTBITS(u4_code, u4_bitstream_offset, pu4_bitstrm_buf, 3);
  ------------------
  |  |  137|  13.7k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  13.7k|{                                                                           \
  |  |  139|  13.7k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  13.7k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  13.7k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  13.7k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  13.7k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 13.3k, False: 362]
  |  |  ------------------
  |  |  144|  13.7k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  13.3k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  13.7k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  13.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  13.7k|}
  ------------------
 1182|       |
 1183|  13.7k|            u4_code = pu1_table_runbefore[u4_code + (u4_zeroes_left << 3)];
 1184|  13.7k|            u4_run = u4_code >> 2;
 1185|       |
 1186|  13.7k|            FLUSHBITS(u4_bitstream_offset, (u4_code & 0x03));
  ------------------
  |  |  193|  13.7k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  13.7k|{                                                                           \
  |  |  195|  13.7k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  13.7k|}
  ------------------
 1187|  13.7k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|  13.7k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
 1188|  13.7k|            *pi2_coeff_data++ = i2_level_arr[i--];
 1189|  13.7k|            u4_zeroes_left -= (WORD32)u4_run;
 1190|  13.7k|            u4_scan_pos -= (WORD32)(u4_run + 1);
 1191|  13.7k|        }
 1192|       |        /**************************************************************/
 1193|       |        /* Decoding Runs End                                          */
 1194|       |        /**************************************************************/
 1195|       |
 1196|       |        /**************************************************************/
 1197|       |        /* Copy the remaining coefficients                            */
 1198|       |        /**************************************************************/
 1199|   210k|        while(i >= 0)
  ------------------
  |  Branch (1199:15): [True: 118k, False: 91.1k]
  ------------------
 1200|   118k|        {
 1201|   118k|            SET_BIT(ps_tu_4x4->u2_sig_coeff_map, u4_scan_pos);
  ------------------
  |  |  106|   118k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
 1202|   118k|            *pi2_coeff_data++ = i2_level_arr[i--];
 1203|   118k|            u4_scan_pos--;
 1204|   118k|        }
 1205|  91.1k|    }
 1206|       |
 1207|  91.1k|    {
 1208|  91.1k|        WORD32 offset;
 1209|  91.1k|        offset = (UWORD8 *)pi2_coeff_data - (UWORD8 *)ps_tu_4x4;
 1210|  91.1k|        offset = ALIGN4(offset);
  ------------------
  |  |   52|  91.1k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
 1211|  91.1k|        ps_dec->pv_parse_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_parse_tu_coeff_data + offset);
 1212|  91.1k|    }
 1213|       |
 1214|  91.1k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
 1215|  91.1k|}
ih264d_cavlc_parse4x4coeff_n0to7:
 1238|   630k|{
 1239|   630k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1240|   630k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1241|   630k|    UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
 1242|   630k|    UWORD32 u4_code, u4_index, u4_ldz;
 1243|   630k|    const UWORD16 *pu2_code = (const UWORD16*)gau2_ih264d_code_gx;
 1244|   630k|    const UWORD16 *pu2_offset_num_vlc =
 1245|   630k|                    (const UWORD16 *)gau2_ih264d_offset_num_vlc_tab;
 1246|   630k|    UWORD32 u4_offset_num_vlc = pu2_offset_num_vlc[u4_n];
 1247|       |
 1248|       |
 1249|   630k|    UNUSED(pi2_coeff_block);
  ------------------
  |  |   45|   630k|#define UNUSED(x) ((void)(x))
  ------------------
 1250|   630k|    *pu4_total_coeff = 0;
 1251|   630k|    FIND_ONE_IN_STREAM_32(u4_ldz, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  165|   630k|#define   FIND_ONE_IN_STREAM_32(u4_ldz, u4_offset, pu4_bitstream)           \
  |  |  166|   630k|{                                                                           \
  |  |  167|   630k|    UWORD32 u4_word;                                                        \
  |  |  168|   630k|    NEXTBITS_32(u4_word, u4_offset, pu4_bitstream);                         \
  |  |  ------------------
  |  |  |  |  150|   630k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  |  |  151|   630k|{                                                                           \
  |  |  |  |  152|   630k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  153|   630k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  154|   630k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  155|   630k|                                                                            \
  |  |  |  |  156|   630k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  157|   630k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (157:8): [True: 611k, False: 18.7k]
  |  |  |  |  ------------------
  |  |  |  |  158|   630k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|   611k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  159|   630k|}
  |  |  ------------------
  |  |  169|   630k|    u4_ldz = CLZ(u4_word);                                     \
  |  |  170|   630k|    (u4_offset) += (u4_ldz + 1);                                            \
  |  |  171|   630k|}
  ------------------
 1252|   630k|    NEXTBITS(u4_index, u4_bitstream_offset, pu4_bitstrm_buf, 3);
  ------------------
  |  |  137|   630k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|   630k|{                                                                           \
  |  |  139|   630k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|   630k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|   630k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|   630k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|   630k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 608k, False: 22.4k]
  |  |  ------------------
  |  |  144|   630k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|   608k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|   630k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|   630k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|   630k|}
  ------------------
 1253|   630k|    u4_index += (u4_ldz << 3);
 1254|   630k|    u4_index += u4_offset_num_vlc;
 1255|       |
 1256|   630k|    u4_index = MIN(u4_index, 303);
  ------------------
  |  |   61|   630k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 627k, False: 3.48k]
  |  |  ------------------
  ------------------
 1257|   630k|    u4_code = pu2_code[u4_index];
 1258|       |
 1259|   630k|    FLUSHBITS(u4_bitstream_offset, (u4_code & 0x03));
  ------------------
  |  |  193|   630k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|   630k|{                                                                           \
  |  |  195|   630k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|   630k|}
  ------------------
 1260|   630k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
 1261|   630k|    *pu4_total_coeff = (u4_code >> 4);
 1262|       |
 1263|   630k|    if(*pu4_total_coeff)
  ------------------
  |  Branch (1263:8): [True: 180k, False: 450k]
  ------------------
 1264|   180k|    {
 1265|   180k|        UWORD32 u4_trailing_ones, u4_offset, u4_total_coeff_tone;
 1266|   180k|        const UWORD8 *pu1_offset =
 1267|   180k|                        (UWORD8 *)gau1_ih264d_total_coeff_fn_ptr_offset;
 1268|   180k|        WORD32 ret;
 1269|   180k|        u4_trailing_ones = ((u4_code >> 2) & 0x03);
 1270|   180k|        u4_offset = pu1_offset[*pu4_total_coeff - 1];
 1271|   180k|        u4_total_coeff_tone = (*pu4_total_coeff << 16) | u4_trailing_ones;
 1272|       |
 1273|   180k|        ret = ps_dec->pf_cavlc_4x4res_block[u4_offset](u4_isdc,
 1274|   180k|                                                       u4_total_coeff_tone,
 1275|   180k|                                                       ps_bitstrm);
 1276|   180k|        if(ret != 0)
  ------------------
  |  Branch (1276:12): [True: 7.14k, False: 173k]
  ------------------
 1277|  7.14k|            return ERROR_CAVLC_NUM_COEFF_T;
 1278|   180k|    }
 1279|       |
 1280|   623k|    return OK;
  ------------------
  |  |  114|   623k|#define OK        0
  ------------------
 1281|   630k|}
ih264d_cavlc_parse4x4coeff_n8:
 1288|  24.2k|{
 1289|       |
 1290|  24.2k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1291|  24.2k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1292|  24.2k|    UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
 1293|  24.2k|    UWORD32 u4_code;
 1294|  24.2k|    UNUSED(u4_n);
  ------------------
  |  |   45|  24.2k|#define UNUSED(x) ((void)(x))
  ------------------
 1295|  24.2k|    UNUSED(pi2_coeff_block);
  ------------------
  |  |   45|  24.2k|#define UNUSED(x) ((void)(x))
  ------------------
 1296|  24.2k|    GETBITS(u4_code, u4_bitstream_offset, pu4_bitstrm_buf, 6);
  ------------------
  |  |  120|  24.2k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  24.2k|{                                                                           \
  |  |  122|  24.2k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  24.2k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  24.2k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  24.2k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  24.2k|                                                                            \
  |  |  127|  24.2k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 23.0k, False: 1.22k]
  |  |  ------------------
  |  |  128|  24.2k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  23.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  24.2k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  24.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  24.2k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  24.2k|}                                                                           \
  ------------------
 1297|  24.2k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
 1298|  24.2k|    *pu4_total_coeff = 0;
 1299|       |
 1300|  24.2k|    if(u4_code != 3)
  ------------------
  |  Branch (1300:8): [True: 23.8k, False: 417]
  ------------------
 1301|  23.8k|    {
 1302|  23.8k|        UWORD8 *pu1_offset = (UWORD8 *)gau1_ih264d_total_coeff_fn_ptr_offset;
 1303|  23.8k|        UWORD32 u4_trailing_ones, u4_offset, u4_total_coeff_tone;
 1304|       |
 1305|  23.8k|        *pu4_total_coeff = (u4_code >> 2) + 1;
 1306|  23.8k|        u4_trailing_ones = u4_code & 0x03;
 1307|  23.8k|        u4_offset = pu1_offset[*pu4_total_coeff - 1];
 1308|  23.8k|        u4_total_coeff_tone = (*pu4_total_coeff << 16) | u4_trailing_ones;
 1309|       |
 1310|  23.8k|        ps_dec->pf_cavlc_4x4res_block[u4_offset](u4_isdc,
 1311|  23.8k|                                                 u4_total_coeff_tone,
 1312|  23.8k|                                                 ps_bitstrm);
 1313|  23.8k|    }
 1314|       |
 1315|  24.2k|    return OK;
  ------------------
  |  |  114|  24.2k|#define OK        0
  ------------------
 1316|  24.2k|}
ih264d_cavlc_parse_chroma_dc:
 1339|  61.2k|{
 1340|  61.2k|    UWORD32 u4_total_coeff, u4_trailing_ones, u4_total_coeff_tone, u4_code;
 1341|  61.2k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1342|  61.2k|    UWORD32 u4_bitstream_offset = ps_bitstrm->u4_ofst;
 1343|  61.2k|    const UWORD8 *pu1_cav_chromdc = (const UWORD8*)gau1_ih264d_cav_chromdc_vld;
 1344|  61.2k|    UNUSED(i4_mb_inter_inc);
  ------------------
  |  |   45|  61.2k|#define UNUSED(x) ((void)(x))
  ------------------
 1345|       |    /******************************************************************/
 1346|       |    /*  Chroma DC Block for U component                               */
 1347|       |    /******************************************************************/
 1348|  61.2k|    NEXTBITS(u4_code, u4_bitstream_offset, pu4_bitstrm_buf, 8);
  ------------------
  |  |  137|  61.2k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  61.2k|{                                                                           \
  |  |  139|  61.2k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  61.2k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  61.2k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  61.2k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  61.2k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 59.7k, False: 1.48k]
  |  |  ------------------
  |  |  144|  61.2k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  59.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  61.2k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  61.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  61.2k|}
  ------------------
 1349|       |
 1350|  61.2k|    u4_code = pu1_cav_chromdc[u4_code];
 1351|       |
 1352|  61.2k|    FLUSHBITS(u4_bitstream_offset, ((u4_code & 0x7) + 1));
  ------------------
  |  |  193|  61.2k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  61.2k|{                                                                           \
  |  |  195|  61.2k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  61.2k|}
  ------------------
 1353|  61.2k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
 1354|       |
 1355|  61.2k|    u4_total_coeff = (u4_code >> 5);
 1356|       |
 1357|  61.2k|    if(u4_total_coeff)
  ------------------
  |  Branch (1357:8): [True: 45.9k, False: 15.2k]
  ------------------
 1358|  45.9k|    {
 1359|  45.9k|        WORD32 i_z0, i_z1, i_z2, i_z3;
 1360|  45.9k|        tu_sblk4x4_coeff_data_t *ps_tu_4x4;
 1361|  45.9k|        dec_struct_t *ps_dec = (dec_struct_t *)ps_bitstrm->pv_codec_handle;
 1362|  45.9k|        WORD16 ai2_dc_coef[4];
 1363|  45.9k|        UWORD8 pu1_inv_scan[4] =
 1364|  45.9k|                        { 0, 1, 2, 3 };
 1365|  45.9k|        WORD16 *pi2_coeff_data =
 1366|  45.9k|                                    (WORD16 *)ps_dec->pv_parse_tu_coeff_data;
 1367|       |
 1368|  45.9k|        ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
 1369|       |
 1370|  45.9k|        u4_trailing_ones = ((u4_code >> 3) & 0x3);
 1371|  45.9k|        u4_total_coeff_tone = (u4_total_coeff << 16) | u4_trailing_ones;
 1372|  45.9k|        ih264d_rest_of_residual_cav_chroma_dc_block(u4_total_coeff_tone,
 1373|  45.9k|                                                    ps_bitstrm);
 1374|       |
 1375|  45.9k|        ai2_dc_coef[0] = 0;
 1376|  45.9k|        ai2_dc_coef[1] = 0;
 1377|  45.9k|        ai2_dc_coef[2] = 0;
 1378|  45.9k|        ai2_dc_coef[3] = 0;
 1379|       |
 1380|  45.9k|        ih264d_unpack_coeff4x4_dc_4x4blk(ps_tu_4x4,
 1381|  45.9k|                                         ai2_dc_coef,
 1382|  45.9k|                                         pu1_inv_scan);
 1383|       |        /*-------------------------------------------------------------------*/
 1384|       |        /* Inverse 2x2 transform and scaling  of chroma DC                   */
 1385|       |        /*-------------------------------------------------------------------*/
 1386|  45.9k|        i_z0 = (ai2_dc_coef[0] + ai2_dc_coef[2]);
 1387|  45.9k|        i_z1 = (ai2_dc_coef[0] - ai2_dc_coef[2]);
 1388|  45.9k|        i_z2 = (ai2_dc_coef[1] - ai2_dc_coef[3]);
 1389|  45.9k|        i_z3 = (ai2_dc_coef[1] + ai2_dc_coef[3]);
 1390|       |
 1391|       |        /*-----------------------------------------------------------*/
 1392|       |        /* Scaling and storing the values back                       */
 1393|       |        /*-----------------------------------------------------------*/
 1394|  45.9k|        *pi2_coeff_data++ = (WORD16)(((i_z0 + i_z3) * (WORD32)u4_scale_u) >> 5);
 1395|  45.9k|        *pi2_coeff_data++ = (WORD16)(((i_z0 - i_z3) * (WORD32)u4_scale_u) >> 5);
 1396|  45.9k|        *pi2_coeff_data++ = (WORD16)(((i_z1 + i_z2) * (WORD32)u4_scale_u) >> 5);
 1397|  45.9k|        *pi2_coeff_data++ = (WORD16)(((i_z1 - i_z2) * (WORD32)u4_scale_u) >> 5);
 1398|       |
 1399|  45.9k|        ps_dec->pv_parse_tu_coeff_data = (void *)pi2_coeff_data;
 1400|       |
 1401|  45.9k|        SET_BIT(ps_cur_mb_info->u1_yuv_dc_block_flag,1);
  ------------------
  |  |  106|  45.9k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
 1402|  45.9k|    }
 1403|       |
 1404|       |    /******************************************************************/
 1405|       |    /*  Chroma DC Block for V component                               */
 1406|       |    /******************************************************************/
 1407|  61.2k|    pi2_coeff_block += 64;
 1408|  61.2k|    u4_bitstream_offset = ps_bitstrm->u4_ofst;
 1409|       |
 1410|  61.2k|    NEXTBITS(u4_code, u4_bitstream_offset, pu4_bitstrm_buf, 8);
  ------------------
  |  |  137|  61.2k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|  61.2k|{                                                                           \
  |  |  139|  61.2k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|  61.2k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|  61.2k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|  61.2k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|  61.2k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 58.8k, False: 2.34k]
  |  |  ------------------
  |  |  144|  61.2k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  58.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|  61.2k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  61.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|  61.2k|}
  ------------------
 1411|       |
 1412|  61.2k|    u4_code = pu1_cav_chromdc[u4_code];
 1413|       |
 1414|  61.2k|    FLUSHBITS(u4_bitstream_offset, ((u4_code & 0x7) + 1));
  ------------------
  |  |  193|  61.2k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|  61.2k|{                                                                           \
  |  |  195|  61.2k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|  61.2k|}
  ------------------
 1415|  61.2k|    ps_bitstrm->u4_ofst = u4_bitstream_offset;
 1416|       |
 1417|  61.2k|    u4_total_coeff = (u4_code >> 5);
 1418|       |
 1419|  61.2k|    if(u4_total_coeff)
  ------------------
  |  Branch (1419:8): [True: 45.1k, False: 16.0k]
  ------------------
 1420|  45.1k|    {
 1421|  45.1k|        WORD32 i_z0, i_z1, i_z2, i_z3;
 1422|  45.1k|        tu_sblk4x4_coeff_data_t *ps_tu_4x4;
 1423|  45.1k|        dec_struct_t *ps_dec = (dec_struct_t *)ps_bitstrm->pv_codec_handle;
 1424|  45.1k|        WORD16 ai2_dc_coef[4];
 1425|  45.1k|        UWORD8 pu1_inv_scan[4] =
 1426|  45.1k|                        { 0, 1, 2, 3 };
 1427|  45.1k|        WORD16 *pi2_coeff_data =
 1428|  45.1k|                                    (WORD16 *)ps_dec->pv_parse_tu_coeff_data;
 1429|       |
 1430|  45.1k|        ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
 1431|       |
 1432|  45.1k|        u4_trailing_ones = ((u4_code >> 3) & 0x3);
 1433|  45.1k|        u4_total_coeff_tone = (u4_total_coeff << 16) | u4_trailing_ones;
 1434|  45.1k|        ih264d_rest_of_residual_cav_chroma_dc_block(u4_total_coeff_tone,
 1435|  45.1k|                                                    ps_bitstrm);
 1436|       |
 1437|  45.1k|        ai2_dc_coef[0] = 0;
 1438|  45.1k|        ai2_dc_coef[1] = 0;
 1439|  45.1k|        ai2_dc_coef[2] = 0;
 1440|  45.1k|        ai2_dc_coef[3] = 0;
 1441|       |
 1442|  45.1k|        ih264d_unpack_coeff4x4_dc_4x4blk(ps_tu_4x4,
 1443|  45.1k|                                         ai2_dc_coef,
 1444|  45.1k|                                         pu1_inv_scan);
 1445|       |
 1446|       |        /*-------------------------------------------------------------------*/
 1447|       |        /* Inverse 2x2 transform and scaling  of chroma DC                   */
 1448|       |        /*-------------------------------------------------------------------*/
 1449|  45.1k|        i_z0 = (ai2_dc_coef[0] + ai2_dc_coef[2]);
 1450|  45.1k|        i_z1 = (ai2_dc_coef[0] - ai2_dc_coef[2]);
 1451|  45.1k|        i_z2 = (ai2_dc_coef[1] - ai2_dc_coef[3]);
 1452|  45.1k|        i_z3 = (ai2_dc_coef[1] + ai2_dc_coef[3]);
 1453|       |
 1454|       |        /*-----------------------------------------------------------*/
 1455|       |        /* Scaling and storing the values back                       */
 1456|       |        /*-----------------------------------------------------------*/
 1457|  45.1k|        *pi2_coeff_data++ = (WORD16)(((i_z0 + i_z3) * (WORD32)u4_scale_v) >> 5);
 1458|  45.1k|        *pi2_coeff_data++ = (WORD16)(((i_z0 - i_z3) * (WORD32)u4_scale_v) >> 5);
 1459|  45.1k|        *pi2_coeff_data++ = (WORD16)(((i_z1 + i_z2) * (WORD32)u4_scale_v) >> 5);
 1460|  45.1k|        *pi2_coeff_data++ = (WORD16)(((i_z1 - i_z2) * (WORD32)u4_scale_v) >> 5);
 1461|       |
 1462|  45.1k|        ps_dec->pv_parse_tu_coeff_data = (void *)pi2_coeff_data;
 1463|       |
 1464|  45.1k|        SET_BIT(ps_cur_mb_info->u1_yuv_dc_block_flag,2);
  ------------------
  |  |  106|  45.1k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
 1465|  45.1k|    }
 1466|  61.2k|}
ih264d_parse_pmb_ref_index_cavlc_range1:
 1496|  5.12k|{
 1497|  5.12k|    UWORD32 u4_i;
 1498|  5.12k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1499|  5.12k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
 1500|  5.12k|    UNUSED(u4_num_ref_idx_active_minus1);
  ------------------
  |  |   45|  5.12k|#define UNUSED(x) ((void)(x))
  ------------------
 1501|  14.0k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (1501:19): [True: 8.88k, False: 5.12k]
  ------------------
 1502|  8.88k|    {
 1503|  8.88k|        UWORD32 u4_ref_idx;
 1504|  8.88k|        u4_ref_idx = ih264d_tev_range1(pu4_bitstream_off, pu4_bitstrm_buf);
 1505|       |
 1506|       |        /* Storing Reference Idx Information */
 1507|  8.88k|        pi1_ref_idx[u4_i] = (WORD8)u4_ref_idx;
 1508|  8.88k|    }
 1509|  5.12k|}
ih264d_parse_pmb_ref_index_cavlc:
 1540|  13.9k|{
 1541|  13.9k|    UWORD32 u4_i;
 1542|  13.9k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1543|  13.9k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
 1544|       |
 1545|  30.4k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (1545:19): [True: 17.1k, False: 13.2k]
  ------------------
 1546|  17.1k|    {
 1547|  17.1k|        UWORD32 u4_ref_idx;
 1548|       |//Inlined ih264d_uev
 1549|  17.1k|        UWORD32 u4_bitstream_offset = *pu4_bitstream_off;
 1550|  17.1k|        UWORD32 u4_word, u4_ldz;
 1551|       |
 1552|       |        /***************************************************************/
 1553|       |        /* Find leading zeros in next 32 bits                          */
 1554|       |        /***************************************************************/
 1555|  17.1k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  17.1k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  17.1k|{                                                                           \
  |  |  152|  17.1k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  17.1k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  17.1k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  17.1k|                                                                            \
  |  |  156|  17.1k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  17.1k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 16.6k, False: 451]
  |  |  ------------------
  |  |  158|  17.1k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  16.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  17.1k|}
  ------------------
 1556|  17.1k|        u4_ldz = CLZ(u4_word);
 1557|       |        /* Flush the ps_bitstrm */
 1558|  17.1k|        u4_bitstream_offset += (u4_ldz + 1);
 1559|       |        /* Read the suffix from the ps_bitstrm */
 1560|  17.1k|        u4_word = 0;
 1561|  17.1k|        if(u4_ldz)
  ------------------
  |  Branch (1561:12): [True: 6.06k, False: 11.0k]
  ------------------
 1562|  6.06k|            GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  6.06k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  6.06k|{                                                                           \
  |  |  122|  6.06k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  6.06k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  6.06k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  6.06k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  6.06k|                                                                            \
  |  |  127|  6.06k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 5.42k, False: 636]
  |  |  ------------------
  |  |  128|  6.06k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  5.42k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  6.06k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  6.06k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  6.06k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  6.06k|}                                                                           \
  ------------------
 1563|  17.1k|        *pu4_bitstream_off = u4_bitstream_offset;
 1564|  17.1k|        u4_ref_idx = ((1 << u4_ldz) + u4_word - 1);
 1565|       |//Inlined ih264d_uev
 1566|       |
 1567|  17.1k|        if(u4_ref_idx > u4_num_ref_idx_active_minus1)
  ------------------
  |  Branch (1567:12): [True: 636, False: 16.5k]
  ------------------
 1568|    636|            return ERROR_REF_IDX;
 1569|       |
 1570|       |        /* Storing Reference Idx Information */
 1571|  16.5k|        pi1_ref_idx[u4_i] = (WORD8)u4_ref_idx;
 1572|  16.5k|    }
 1573|  13.2k|    return OK;
  ------------------
  |  |  114|  13.2k|#define OK        0
  ------------------
 1574|  13.9k|}
ih264d_parse_bmb_ref_index_cavlc_range1:
 1604|  13.0k|{
 1605|  13.0k|    UWORD32 u4_i;
 1606|  13.0k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1607|  13.0k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
 1608|  13.0k|    UNUSED(u4_num_ref_idx_active_minus1);
  ------------------
  |  |   45|  13.0k|#define UNUSED(x) ((void)(x))
  ------------------
 1609|  34.8k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (1609:19): [True: 21.7k, False: 13.0k]
  ------------------
 1610|  21.7k|    {
 1611|  21.7k|        if(pi1_ref_idx[u4_i] > -1)
  ------------------
  |  Branch (1611:12): [True: 7.52k, False: 14.2k]
  ------------------
 1612|  7.52k|        {
 1613|  7.52k|            UWORD32 u4_ref_idx;
 1614|       |
 1615|  7.52k|            u4_ref_idx = ih264d_tev_range1(pu4_bitstream_off, pu4_bitstrm_buf);
 1616|       |
 1617|       |            /* Storing Reference Idx Information */
 1618|  7.52k|            pi1_ref_idx[u4_i] = (WORD8)u4_ref_idx;
 1619|  7.52k|        }
 1620|  21.7k|    }
 1621|  13.0k|}
ih264d_parse_bmb_ref_index_cavlc:
 1651|  12.7k|{
 1652|  12.7k|    UWORD32 u4_i;
 1653|  12.7k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1654|  12.7k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
 1655|       |
 1656|  32.5k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (1656:19): [True: 20.3k, False: 12.1k]
  ------------------
 1657|  20.3k|    {
 1658|  20.3k|        if(pi1_ref_idx[u4_i] > -1)
  ------------------
  |  Branch (1658:12): [True: 14.4k, False: 5.97k]
  ------------------
 1659|  14.4k|        {
 1660|  14.4k|            UWORD32 u4_ref_idx;
 1661|       |//inlining ih264d_uev
 1662|  14.4k|            UWORD32 u4_bitstream_offset = *pu4_bitstream_off;
 1663|  14.4k|            UWORD32 u4_word, u4_ldz;
 1664|       |
 1665|       |            /***************************************************************/
 1666|       |            /* Find leading zeros in next 32 bits                          */
 1667|       |            /***************************************************************/
 1668|  14.4k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  14.4k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  14.4k|{                                                                           \
  |  |  152|  14.4k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  14.4k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  14.4k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  14.4k|                                                                            \
  |  |  156|  14.4k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  14.4k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 12.8k, False: 1.56k]
  |  |  ------------------
  |  |  158|  14.4k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  12.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  14.4k|}
  ------------------
 1669|  14.4k|            u4_ldz = CLZ(u4_word);
 1670|       |            /* Flush the ps_bitstrm */
 1671|  14.4k|            u4_bitstream_offset += (u4_ldz + 1);
 1672|       |            /* Read the suffix from the ps_bitstrm */
 1673|  14.4k|            u4_word = 0;
 1674|  14.4k|            if(u4_ldz)
  ------------------
  |  Branch (1674:16): [True: 2.40k, False: 12.0k]
  ------------------
 1675|  2.40k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  2.40k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  2.40k|{                                                                           \
  |  |  122|  2.40k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  2.40k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  2.40k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  2.40k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  2.40k|                                                                            \
  |  |  127|  2.40k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.13k, False: 266]
  |  |  ------------------
  |  |  128|  2.40k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.13k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  2.40k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  2.40k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  2.40k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  2.40k|}                                                                           \
  ------------------
 1676|  14.4k|            *pu4_bitstream_off = u4_bitstream_offset;
 1677|  14.4k|            u4_ref_idx = ((1 << u4_ldz) + u4_word - 1);
 1678|       |//inlining ih264d_uev
 1679|  14.4k|            if(u4_ref_idx > u4_num_ref_idx_active_minus1)
  ------------------
  |  Branch (1679:16): [True: 561, False: 13.8k]
  ------------------
 1680|    561|                return ERROR_REF_IDX;
 1681|       |
 1682|       |            /* Storing Reference Idx Information */
 1683|  13.8k|            pi1_ref_idx[u4_i] = (WORD8)u4_ref_idx;
 1684|  13.8k|        }
 1685|  20.3k|    }
 1686|  12.1k|    return OK;
  ------------------
  |  |  114|  12.1k|#define OK        0
  ------------------
 1687|  12.7k|}
ih264d_cavlc_parse_8x8block_both_available:
 1736|  94.1k|{
 1737|  94.1k|    UWORD32 u4_num_coeff, u4_n, u4_subblock_coded;
 1738|  94.1k|    UWORD32 u4_top0, u4_top1;
 1739|  94.1k|    UWORD32 *pu4_dummy;
 1740|  94.1k|    WORD32 (**pf_cavlc_parse4x4coeff)(WORD16 *pi2_coeff_block,
 1741|  94.1k|                                      UWORD32 u4_isdc,
 1742|  94.1k|                                      WORD32 u4_n,
 1743|  94.1k|                                      struct _DecStruct *ps_dec,
 1744|  94.1k|                                      UWORD32 *pu4_dummy) =
 1745|  94.1k|                                      ps_dec->pf_cavlc_parse4x4coeff;
 1746|  94.1k|    UWORD32 u4_idx = 0;
 1747|  94.1k|    UWORD8 *puc_temp;
 1748|  94.1k|    WORD32 ret;
 1749|       |
 1750|  94.1k|    *pu4_csbp = 0;
 1751|       |    /* need to change the inverse scan matrices here */
 1752|  94.1k|    puc_temp = ps_dec->pu1_inv_scan;
 1753|       |
 1754|       |    /*------------------------------------------------------*/
 1755|       |    /* Residual 4x4 decoding: SubBlock 0                    */
 1756|       |    /*------------------------------------------------------*/
 1757|  94.1k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (1757:8): [True: 44.1k, False: 49.9k]
  ------------------
 1758|  44.1k|    {
 1759|  44.1k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (1759:12): [True: 44.1k, False: 0]
  ------------------
 1760|  44.1k|        {
 1761|  44.1k|            ps_dec->pu1_inv_scan =
 1762|  44.1k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[0];
 1763|  44.1k|        }
 1764|      0|        else
 1765|      0|        {
 1766|      0|            ps_dec->pu1_inv_scan =
 1767|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[0];
 1768|      0|        }
 1769|  44.1k|    }
 1770|  94.1k|    u4_n = (pu1_top_nnz[0] + pu1_left_nnz[0] + 1) >> 1;
 1771|  94.1k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 1772|  94.1k|                                             u4_n, ps_dec, &u4_num_coeff);
 1773|  94.1k|    if(ret != OK)
  ------------------
  |  |  114|  94.1k|#define OK        0
  ------------------
  |  Branch (1773:8): [True: 556, False: 93.5k]
  ------------------
 1774|    556|        return ret;
 1775|       |
 1776|  93.5k|    u4_top0 = u4_num_coeff;
 1777|  93.5k|    u4_subblock_coded = (u4_num_coeff != 0);
 1778|  93.5k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  93.5k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  93.5k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1779|       |
 1780|       |    /*------------------------------------------------------*/
 1781|       |    /* Residual 4x4 decoding: SubBlock 1                    */
 1782|       |    /*------------------------------------------------------*/
 1783|  93.5k|    u4_idx++;
 1784|  93.5k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (1784:8): [True: 44.1k, False: 49.4k]
  ------------------
 1785|  44.1k|    {
 1786|  44.1k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (1786:12): [True: 44.1k, False: 0]
  ------------------
 1787|  44.1k|        {
 1788|  44.1k|            ps_dec->pu1_inv_scan =
 1789|  44.1k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[1];
 1790|  44.1k|        }
 1791|      0|        else
 1792|      0|        {
 1793|      0|            ps_dec->pu1_inv_scan =
 1794|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[1];
 1795|      0|        }
 1796|  44.1k|    }
 1797|  49.4k|    else
 1798|  49.4k|    {
 1799|  49.4k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  49.4k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 1800|  49.4k|    }
 1801|  93.5k|    u4_n = (pu1_top_nnz[1] + u4_num_coeff + 1) >> 1;
 1802|  93.5k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 1803|  93.5k|                                             u4_n, ps_dec, &u4_num_coeff);
 1804|  93.5k|    if(ret != OK)
  ------------------
  |  |  114|  93.5k|#define OK        0
  ------------------
  |  Branch (1804:8): [True: 375, False: 93.1k]
  ------------------
 1805|    375|        return ret;
 1806|       |
 1807|  93.1k|    u4_top1 = pu1_left_nnz[0] = u4_num_coeff;
 1808|  93.1k|    u4_subblock_coded = (u4_num_coeff != 0);
 1809|  93.1k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  93.1k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  93.1k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1810|       |
 1811|       |    /*------------------------------------------------------*/
 1812|       |    /* Residual 4x4 decoding: SubBlock 2                    */
 1813|       |    /*------------------------------------------------------*/
 1814|  93.1k|    u4_idx += (u4_sub_block_strd - 1);
 1815|  93.1k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (1815:8): [True: 44.0k, False: 49.1k]
  ------------------
 1816|  44.0k|    {
 1817|  44.0k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (1817:12): [True: 44.0k, False: 0]
  ------------------
 1818|  44.0k|        {
 1819|  44.0k|            ps_dec->pu1_inv_scan =
 1820|  44.0k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[2];
 1821|  44.0k|        }
 1822|      0|        else
 1823|      0|        {
 1824|      0|            ps_dec->pu1_inv_scan =
 1825|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[2];
 1826|      0|        }
 1827|  44.0k|    }
 1828|  49.1k|    else
 1829|  49.1k|    {
 1830|  49.1k|        pi2_coeff_block += ((u4_sub_block_strd - 1) * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  49.1k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 1831|  49.1k|    }
 1832|  93.1k|    u4_n = (u4_top0 + pu1_left_nnz[1] + 1) >> 1;
 1833|  93.1k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 1834|  93.1k|                                             u4_n, ps_dec, &u4_num_coeff);
 1835|  93.1k|    if(ret != OK)
  ------------------
  |  |  114|  93.1k|#define OK        0
  ------------------
  |  Branch (1835:8): [True: 489, False: 92.7k]
  ------------------
 1836|    489|        return ret;
 1837|       |
 1838|  92.7k|    pu1_top_nnz[0] = u4_num_coeff;
 1839|  92.7k|    u4_subblock_coded = (u4_num_coeff != 0);
 1840|  92.7k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  92.7k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  92.7k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1841|       |
 1842|       |    /*------------------------------------------------------*/
 1843|       |    /* Residual 4x4 decoding: SubBlock 3                    */
 1844|       |    /*------------------------------------------------------*/
 1845|  92.7k|    u4_idx++;
 1846|  92.7k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (1846:8): [True: 44.0k, False: 48.6k]
  ------------------
 1847|  44.0k|    {
 1848|  44.0k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (1848:12): [True: 44.0k, False: 0]
  ------------------
 1849|  44.0k|        {
 1850|  44.0k|            ps_dec->pu1_inv_scan =
 1851|  44.0k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[3];
 1852|  44.0k|        }
 1853|      0|        else
 1854|      0|        {
 1855|      0|            ps_dec->pu1_inv_scan =
 1856|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[3];
 1857|      0|        }
 1858|  44.0k|    }
 1859|  48.6k|    else
 1860|  48.6k|    {
 1861|  48.6k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  48.6k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 1862|  48.6k|    }
 1863|  92.7k|    u4_n = (u4_top1 + u4_num_coeff + 1) >> 1;
 1864|  92.7k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 1865|  92.7k|                                             u4_n, ps_dec, &u4_num_coeff);
 1866|  92.7k|    if(ret != OK)
  ------------------
  |  |  114|  92.7k|#define OK        0
  ------------------
  |  Branch (1866:8): [True: 634, False: 92.0k]
  ------------------
 1867|    634|        return ret;
 1868|       |
 1869|  92.0k|    pu1_top_nnz[1] = pu1_left_nnz[1] = u4_num_coeff;
 1870|  92.0k|    u4_subblock_coded = (u4_num_coeff != 0);
 1871|  92.0k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  92.0k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  92.0k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1872|       |
 1873|  92.0k|    ps_dec->pu1_inv_scan = puc_temp;
 1874|       |
 1875|  92.0k|    return OK;
  ------------------
  |  |  114|  92.0k|#define OK        0
  ------------------
 1876|  92.7k|}
ih264d_cavlc_parse_8x8block_left_available:
 1926|  20.6k|{
 1927|  20.6k|    UWORD32 u4_num_coeff, u4_n, u4_subblock_coded;
 1928|  20.6k|    UWORD32 u4_top0, u4_top1;
 1929|  20.6k|    UWORD32 *pu4_dummy;
 1930|  20.6k|    WORD32 (**pf_cavlc_parse4x4coeff)(WORD16 *pi2_coeff_block,
 1931|  20.6k|                                      UWORD32 u4_isdc,
 1932|  20.6k|                                      WORD32 u4_n,
 1933|  20.6k|                                      struct _DecStruct *ps_dec,
 1934|  20.6k|                                      UWORD32 *pu4_dummy) =
 1935|  20.6k|                                      ps_dec->pf_cavlc_parse4x4coeff;
 1936|  20.6k|    UWORD32 u4_idx = 0;
 1937|  20.6k|    UWORD8 *puc_temp;
 1938|  20.6k|    WORD32 ret;
 1939|       |
 1940|  20.6k|    *pu4_csbp = 0;
 1941|  20.6k|    puc_temp = ps_dec->pu1_inv_scan;
 1942|       |
 1943|       |    /*------------------------------------------------------*/
 1944|       |    /* Residual 4x4 decoding: SubBlock 0                    */
 1945|       |    /*------------------------------------------------------*/
 1946|  20.6k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (1946:8): [True: 5.96k, False: 14.6k]
  ------------------
 1947|  5.96k|    {
 1948|  5.96k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (1948:12): [True: 5.96k, False: 0]
  ------------------
 1949|  5.96k|        {
 1950|  5.96k|            ps_dec->pu1_inv_scan =
 1951|  5.96k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[0];
 1952|  5.96k|        }
 1953|      0|        else
 1954|      0|        {
 1955|      0|            ps_dec->pu1_inv_scan =
 1956|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[0];
 1957|      0|        }
 1958|  5.96k|    }
 1959|  20.6k|    u4_n = pu1_left_nnz[0];
 1960|  20.6k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 1961|  20.6k|                                             u4_n, ps_dec, &u4_num_coeff);
 1962|  20.6k|    if(ret != OK)
  ------------------
  |  |  114|  20.6k|#define OK        0
  ------------------
  |  Branch (1962:8): [True: 165, False: 20.4k]
  ------------------
 1963|    165|        return ret;
 1964|       |
 1965|  20.4k|    u4_top0 = u4_num_coeff;
 1966|  20.4k|    u4_subblock_coded = (u4_num_coeff != 0);
 1967|  20.4k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  20.4k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  20.4k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1968|       |
 1969|       |    /*------------------------------------------------------*/
 1970|       |    /* Residual 4x4 decoding: SubBlock 1                    */
 1971|       |    /*------------------------------------------------------*/
 1972|  20.4k|    u4_idx++;
 1973|  20.4k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (1973:8): [True: 5.95k, False: 14.5k]
  ------------------
 1974|  5.95k|    {
 1975|  5.95k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (1975:12): [True: 5.95k, False: 0]
  ------------------
 1976|  5.95k|        {
 1977|  5.95k|            ps_dec->pu1_inv_scan =
 1978|  5.95k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[1];
 1979|  5.95k|        }
 1980|      0|        else
 1981|      0|        {
 1982|      0|            ps_dec->pu1_inv_scan =
 1983|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[1];
 1984|      0|        }
 1985|  5.95k|    }
 1986|  14.5k|    else
 1987|  14.5k|    {
 1988|  14.5k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  14.5k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 1989|  14.5k|    }
 1990|  20.4k|    u4_n = u4_num_coeff;
 1991|  20.4k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 1992|  20.4k|                                             u4_n, ps_dec, &u4_num_coeff);
 1993|  20.4k|    if(ret != OK)
  ------------------
  |  |  114|  20.4k|#define OK        0
  ------------------
  |  Branch (1993:8): [True: 263, False: 20.2k]
  ------------------
 1994|    263|        return ret;
 1995|       |
 1996|  20.2k|    u4_top1 = pu1_left_nnz[0] = u4_num_coeff;
 1997|  20.2k|    u4_subblock_coded = (u4_num_coeff != 0);
 1998|  20.2k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  20.2k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  20.2k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 1999|       |
 2000|       |    /*------------------------------------------------------*/
 2001|       |    /* Residual 4x4 decoding: SubBlock 2                    */
 2002|       |    /*------------------------------------------------------*/
 2003|  20.2k|    u4_idx += (u4_sub_block_strd - 1);
 2004|  20.2k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2004:8): [True: 5.90k, False: 14.3k]
  ------------------
 2005|  5.90k|    {
 2006|  5.90k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2006:12): [True: 5.90k, False: 0]
  ------------------
 2007|  5.90k|        {
 2008|  5.90k|            ps_dec->pu1_inv_scan =
 2009|  5.90k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[2];
 2010|  5.90k|        }
 2011|      0|        else
 2012|      0|        {
 2013|      0|            ps_dec->pu1_inv_scan =
 2014|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[2];
 2015|      0|        }
 2016|  5.90k|    }
 2017|  14.3k|    else
 2018|  14.3k|    {
 2019|  14.3k|        pi2_coeff_block += ((u4_sub_block_strd - 1) * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  14.3k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2020|  14.3k|    }
 2021|  20.2k|    u4_n = (u4_top0 + pu1_left_nnz[1] + 1) >> 1;
 2022|  20.2k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2023|  20.2k|                                             u4_n, ps_dec, &u4_num_coeff);
 2024|  20.2k|    if(ret != OK)
  ------------------
  |  |  114|  20.2k|#define OK        0
  ------------------
  |  Branch (2024:8): [True: 257, False: 19.9k]
  ------------------
 2025|    257|        return ret;
 2026|       |
 2027|  19.9k|    pu1_top_nnz[0] = u4_num_coeff;
 2028|  19.9k|    u4_subblock_coded = (u4_num_coeff != 0);
 2029|  19.9k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  19.9k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  19.9k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2030|       |
 2031|       |    /*------------------------------------------------------*/
 2032|       |    /* Residual 4x4 decoding: SubBlock 3                    */
 2033|       |    /*------------------------------------------------------*/
 2034|  19.9k|    u4_idx++;
 2035|  19.9k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2035:8): [True: 5.89k, False: 14.0k]
  ------------------
 2036|  5.89k|    {
 2037|  5.89k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2037:12): [True: 5.89k, False: 0]
  ------------------
 2038|  5.89k|        {
 2039|  5.89k|            ps_dec->pu1_inv_scan =
 2040|  5.89k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[3];
 2041|  5.89k|        }
 2042|      0|        else
 2043|      0|        {
 2044|      0|            ps_dec->pu1_inv_scan =
 2045|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[3];
 2046|      0|        }
 2047|  5.89k|    }
 2048|  14.0k|    else
 2049|  14.0k|    {
 2050|  14.0k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  14.0k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2051|  14.0k|    }
 2052|  19.9k|    u4_n = (u4_top1 + u4_num_coeff + 1) >> 1;
 2053|  19.9k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2054|  19.9k|                                             u4_n, ps_dec, &u4_num_coeff);
 2055|  19.9k|    if(ret != OK)
  ------------------
  |  |  114|  19.9k|#define OK        0
  ------------------
  |  Branch (2055:8): [True: 253, False: 19.7k]
  ------------------
 2056|    253|        return ret;
 2057|       |
 2058|  19.7k|    pu1_top_nnz[1] = pu1_left_nnz[1] = u4_num_coeff;
 2059|  19.7k|    u4_subblock_coded = (u4_num_coeff != 0);
 2060|  19.7k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  19.7k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  19.7k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2061|       |
 2062|  19.7k|    ps_dec->pu1_inv_scan = puc_temp;
 2063|       |
 2064|  19.7k|    return OK;
  ------------------
  |  |  114|  19.7k|#define OK        0
  ------------------
 2065|  19.9k|}
ih264d_cavlc_parse_8x8block_top_available:
 2115|  26.0k|{
 2116|  26.0k|    UWORD32 u4_num_coeff, u4_n, u4_subblock_coded;
 2117|  26.0k|    UWORD32 u4_top0, u4_top1;
 2118|  26.0k|    UWORD32 *pu4_dummy;
 2119|  26.0k|    WORD32 (**pf_cavlc_parse4x4coeff)(WORD16 *pi2_coeff_block,
 2120|  26.0k|                                      UWORD32 u4_isdc,
 2121|  26.0k|                                      WORD32 u4_n,
 2122|  26.0k|                                      struct _DecStruct *ps_dec,
 2123|  26.0k|                                      UWORD32 *pu4_dummy) =
 2124|  26.0k|                                      ps_dec->pf_cavlc_parse4x4coeff;
 2125|  26.0k|    UWORD32 u4_idx = 0;
 2126|  26.0k|    UWORD8 *puc_temp;
 2127|  26.0k|    WORD32 ret;
 2128|       |
 2129|  26.0k|    *pu4_csbp = 0;
 2130|  26.0k|    puc_temp = ps_dec->pu1_inv_scan;
 2131|       |
 2132|       |    /*------------------------------------------------------*/
 2133|       |    /* Residual 4x4 decoding: SubBlock 0                    */
 2134|       |    /*------------------------------------------------------*/
 2135|  26.0k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2135:8): [True: 6.57k, False: 19.4k]
  ------------------
 2136|  6.57k|    {
 2137|  6.57k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2137:12): [True: 6.57k, False: 0]
  ------------------
 2138|  6.57k|        {
 2139|  6.57k|            ps_dec->pu1_inv_scan =
 2140|  6.57k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[0];
 2141|  6.57k|        }
 2142|      0|        else
 2143|      0|        {
 2144|      0|            ps_dec->pu1_inv_scan =
 2145|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[0];
 2146|      0|        }
 2147|  6.57k|    }
 2148|  26.0k|    u4_n = pu1_top_nnz[0];
 2149|  26.0k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2150|  26.0k|                                             u4_n, ps_dec, &u4_num_coeff);
 2151|  26.0k|    if(ret != OK)
  ------------------
  |  |  114|  26.0k|#define OK        0
  ------------------
  |  Branch (2151:8): [True: 483, False: 25.5k]
  ------------------
 2152|    483|        return ret;
 2153|       |
 2154|  25.5k|    u4_top0 = u4_num_coeff;
 2155|  25.5k|    u4_subblock_coded = (u4_num_coeff != 0);
 2156|  25.5k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  25.5k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  25.5k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2157|       |
 2158|       |    /*------------------------------------------------------*/
 2159|       |    /* Residual 4x4 decoding: SubBlock 1                    */
 2160|       |    /*------------------------------------------------------*/
 2161|  25.5k|    u4_idx++;
 2162|  25.5k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2162:8): [True: 6.56k, False: 19.0k]
  ------------------
 2163|  6.56k|    {
 2164|  6.56k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2164:12): [True: 6.56k, False: 0]
  ------------------
 2165|  6.56k|        {
 2166|  6.56k|            ps_dec->pu1_inv_scan =
 2167|  6.56k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[1];
 2168|  6.56k|        }
 2169|      0|        else
 2170|      0|        {
 2171|      0|            ps_dec->pu1_inv_scan =
 2172|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[1];
 2173|      0|        }
 2174|  6.56k|    }
 2175|  19.0k|    else
 2176|  19.0k|    {
 2177|  19.0k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  19.0k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2178|  19.0k|    }
 2179|  25.5k|    u4_n = (pu1_top_nnz[1] + u4_num_coeff + 1) >> 1;
 2180|  25.5k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2181|  25.5k|                                             u4_n, ps_dec, &u4_num_coeff);
 2182|  25.5k|    if(ret != OK)
  ------------------
  |  |  114|  25.5k|#define OK        0
  ------------------
  |  Branch (2182:8): [True: 292, False: 25.2k]
  ------------------
 2183|    292|        return ret;
 2184|       |
 2185|  25.2k|    u4_top1 = pu1_left_nnz[0] = u4_num_coeff;
 2186|  25.2k|    u4_subblock_coded = (u4_num_coeff != 0);
 2187|  25.2k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  25.2k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  25.2k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2188|       |
 2189|       |    /*------------------------------------------------------*/
 2190|       |    /* Residual 4x4 decoding: SubBlock 2                    */
 2191|       |    /*------------------------------------------------------*/
 2192|  25.2k|    u4_idx += (u4_sub_block_strd - 1);
 2193|  25.2k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2193:8): [True: 6.55k, False: 18.7k]
  ------------------
 2194|  6.55k|    {
 2195|  6.55k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2195:12): [True: 6.55k, False: 0]
  ------------------
 2196|  6.55k|        {
 2197|  6.55k|            ps_dec->pu1_inv_scan =
 2198|  6.55k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[2];
 2199|  6.55k|        }
 2200|      0|        else
 2201|      0|        {
 2202|      0|            ps_dec->pu1_inv_scan =
 2203|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[2];
 2204|      0|        }
 2205|  6.55k|    }
 2206|  18.7k|    else
 2207|  18.7k|    {
 2208|  18.7k|        pi2_coeff_block += ((u4_sub_block_strd - 1) * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  18.7k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2209|  18.7k|    }
 2210|  25.2k|    u4_n = u4_top0;
 2211|  25.2k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2212|  25.2k|                                             u4_n, ps_dec, &u4_num_coeff);
 2213|  25.2k|    if(ret != OK)
  ------------------
  |  |  114|  25.2k|#define OK        0
  ------------------
  |  Branch (2213:8): [True: 413, False: 24.8k]
  ------------------
 2214|    413|        return ret;
 2215|       |
 2216|  24.8k|    pu1_top_nnz[0] = u4_num_coeff;
 2217|  24.8k|    u4_subblock_coded = (u4_num_coeff != 0);
 2218|  24.8k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  24.8k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  24.8k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2219|       |
 2220|       |    /*------------------------------------------------------*/
 2221|       |    /* Residual 4x4 decoding: SubBlock 3                    */
 2222|       |    /*------------------------------------------------------*/
 2223|  24.8k|    u4_idx++;
 2224|  24.8k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2224:8): [True: 6.53k, False: 18.3k]
  ------------------
 2225|  6.53k|    {
 2226|  6.53k|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2226:12): [True: 6.53k, False: 0]
  ------------------
 2227|  6.53k|        {
 2228|  6.53k|            ps_dec->pu1_inv_scan =
 2229|  6.53k|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[3];
 2230|  6.53k|        }
 2231|      0|        else
 2232|      0|        {
 2233|      0|            ps_dec->pu1_inv_scan =
 2234|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[3];
 2235|      0|        }
 2236|  6.53k|    }
 2237|  18.3k|    else
 2238|  18.3k|    {
 2239|  18.3k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  18.3k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2240|  18.3k|    }
 2241|  24.8k|    u4_n = (u4_top1 + u4_num_coeff + 1) >> 1;
 2242|  24.8k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2243|  24.8k|                                             u4_n, ps_dec, &u4_num_coeff);
 2244|  24.8k|    if(ret != OK)
  ------------------
  |  |  114|  24.8k|#define OK        0
  ------------------
  |  Branch (2244:8): [True: 560, False: 24.3k]
  ------------------
 2245|    560|        return ret;
 2246|       |
 2247|  24.3k|    pu1_top_nnz[1] = pu1_left_nnz[1] = u4_num_coeff;
 2248|  24.3k|    u4_subblock_coded = (u4_num_coeff != 0);
 2249|  24.3k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  24.3k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  24.3k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2250|       |
 2251|  24.3k|    ps_dec->pu1_inv_scan = puc_temp;
 2252|       |
 2253|  24.3k|    return OK;
  ------------------
  |  |  114|  24.3k|#define OK        0
  ------------------
 2254|  24.8k|}
ih264d_cavlc_parse_8x8block_none_available:
 2304|  13.0k|{
 2305|  13.0k|    UWORD32 u4_num_coeff, u4_n, u4_subblock_coded;
 2306|  13.0k|    UWORD32 u4_top0, u4_top1;
 2307|  13.0k|    UWORD32 *pu4_dummy;
 2308|  13.0k|    WORD32 (**pf_cavlc_parse4x4coeff)(WORD16 *pi2_coeff_block,
 2309|  13.0k|                                      UWORD32 u4_isdc,
 2310|  13.0k|                                      WORD32 u4_n,
 2311|  13.0k|                                      struct _DecStruct *ps_dec,
 2312|  13.0k|                                      UWORD32 *pu4_dummy) =
 2313|  13.0k|                                      ps_dec->pf_cavlc_parse4x4coeff;
 2314|  13.0k|    UWORD32 u4_idx = 0;
 2315|  13.0k|    UWORD8 *puc_temp;
 2316|  13.0k|    WORD32 ret;
 2317|       |
 2318|  13.0k|    *pu4_csbp = 0;
 2319|  13.0k|    puc_temp = ps_dec->pu1_inv_scan;
 2320|       |
 2321|       |    /*------------------------------------------------------*/
 2322|       |    /* Residual 4x4 decoding: SubBlock 0                    */
 2323|       |    /*------------------------------------------------------*/
 2324|  13.0k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2324:8): [True: 712, False: 12.2k]
  ------------------
 2325|    712|    {
 2326|    712|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2326:12): [True: 712, False: 0]
  ------------------
 2327|    712|        {
 2328|    712|            ps_dec->pu1_inv_scan =
 2329|    712|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[0];
 2330|    712|        }
 2331|      0|        else
 2332|      0|        {
 2333|      0|            ps_dec->pu1_inv_scan =
 2334|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[0];
 2335|      0|        }
 2336|    712|    }
 2337|  13.0k|    ret = pf_cavlc_parse4x4coeff[0](pi2_coeff_block, u4_isdc, 0,
 2338|  13.0k|                                    ps_dec, &u4_num_coeff);
 2339|  13.0k|    if(ret != OK)
  ------------------
  |  |  114|  13.0k|#define OK        0
  ------------------
  |  Branch (2339:8): [True: 1.03k, False: 11.9k]
  ------------------
 2340|  1.03k|        return ret;
 2341|       |
 2342|  11.9k|    u4_top0 = u4_num_coeff;
 2343|  11.9k|    u4_subblock_coded = (u4_num_coeff != 0);
 2344|  11.9k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  11.9k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  11.9k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2345|       |
 2346|       |    /*------------------------------------------------------*/
 2347|       |    /* Residual 4x4 decoding: SubBlock 1                    */
 2348|       |    /*------------------------------------------------------*/
 2349|  11.9k|    u4_idx++;
 2350|  11.9k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2350:8): [True: 705, False: 11.2k]
  ------------------
 2351|    705|    {
 2352|    705|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2352:12): [True: 705, False: 0]
  ------------------
 2353|    705|        {
 2354|    705|            ps_dec->pu1_inv_scan =
 2355|    705|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[1];
 2356|    705|        }
 2357|      0|        else
 2358|      0|        {
 2359|      0|            ps_dec->pu1_inv_scan =
 2360|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[1];
 2361|      0|        }
 2362|    705|    }
 2363|  11.2k|    else
 2364|  11.2k|    {
 2365|  11.2k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  11.2k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2366|  11.2k|    }
 2367|  11.9k|    u4_n = u4_num_coeff;
 2368|  11.9k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2369|  11.9k|                                             u4_n, ps_dec, &u4_num_coeff);
 2370|  11.9k|    if(ret != OK)
  ------------------
  |  |  114|  11.9k|#define OK        0
  ------------------
  |  Branch (2370:8): [True: 485, False: 11.4k]
  ------------------
 2371|    485|        return ret;
 2372|       |
 2373|  11.4k|    u4_top1 = pu1_left_nnz[0] = u4_num_coeff;
 2374|  11.4k|    u4_subblock_coded = (u4_num_coeff != 0);
 2375|  11.4k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  11.4k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  11.4k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2376|       |
 2377|       |    /*------------------------------------------------------*/
 2378|       |    /* Residual 4x4 decoding: SubBlock 2                    */
 2379|       |    /*------------------------------------------------------*/
 2380|  11.4k|    u4_idx += (u4_sub_block_strd - 1);
 2381|  11.4k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2381:8): [True: 700, False: 10.7k]
  ------------------
 2382|    700|    {
 2383|    700|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2383:12): [True: 700, False: 0]
  ------------------
 2384|    700|        {
 2385|    700|            ps_dec->pu1_inv_scan =
 2386|    700|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[2];
 2387|    700|        }
 2388|      0|        else
 2389|      0|        {
 2390|      0|            ps_dec->pu1_inv_scan =
 2391|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[2];
 2392|      0|        }
 2393|    700|    }
 2394|  10.7k|    else
 2395|  10.7k|    {
 2396|  10.7k|        pi2_coeff_block += ((u4_sub_block_strd - 1) * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  10.7k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2397|  10.7k|    }
 2398|  11.4k|    u4_n = u4_top0;
 2399|  11.4k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2400|  11.4k|                                             u4_n, ps_dec, &u4_num_coeff);
 2401|  11.4k|    if(ret != OK)
  ------------------
  |  |  114|  11.4k|#define OK        0
  ------------------
  |  Branch (2401:8): [True: 226, False: 11.2k]
  ------------------
 2402|    226|        return ret;
 2403|       |
 2404|  11.2k|    pu1_top_nnz[0] = u4_num_coeff;
 2405|  11.2k|    u4_subblock_coded = (u4_num_coeff != 0);
 2406|  11.2k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  11.2k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  11.2k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2407|       |
 2408|       |    /*------------------------------------------------------*/
 2409|       |    /* Residual 4x4 decoding: SubBlock 3                    */
 2410|       |    /*------------------------------------------------------*/
 2411|  11.2k|    u4_idx++;
 2412|  11.2k|    if(u1_tran_form8x8)
  ------------------
  |  Branch (2412:8): [True: 687, False: 10.5k]
  ------------------
 2413|    687|    {
 2414|    687|        if(!u1_mb_field_decodingflag)
  ------------------
  |  Branch (2414:12): [True: 687, False: 0]
  ------------------
 2415|    687|        {
 2416|    687|            ps_dec->pu1_inv_scan =
 2417|    687|                            (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[3];
 2418|    687|        }
 2419|      0|        else
 2420|      0|        {
 2421|      0|            ps_dec->pu1_inv_scan =
 2422|      0|                            (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[3];
 2423|      0|        }
 2424|    687|    }
 2425|  10.5k|    else
 2426|  10.5k|    {
 2427|  10.5k|        pi2_coeff_block += NUM_COEFFS_IN_4x4BLK;
  ------------------
  |  |  617|  10.5k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2428|  10.5k|    }
 2429|  11.2k|    u4_n = (u4_top1 + u4_num_coeff + 1) >> 1;
 2430|  11.2k|    ret = pf_cavlc_parse4x4coeff[(u4_n > 7)](pi2_coeff_block, u4_isdc,
 2431|  11.2k|                                             u4_n, ps_dec, &u4_num_coeff);
 2432|  11.2k|    if(ret != OK)
  ------------------
  |  |  114|  11.2k|#define OK        0
  ------------------
  |  Branch (2432:8): [True: 347, False: 10.9k]
  ------------------
 2433|    347|        return ret;
 2434|       |
 2435|  10.9k|    pu1_top_nnz[1] = pu1_left_nnz[1] = u4_num_coeff;
 2436|  10.9k|    u4_subblock_coded = (u4_num_coeff != 0);
 2437|  10.9k|    INSERT_BIT(*pu4_csbp, u4_idx, u4_subblock_coded);
  ------------------
  |  |  109|  10.9k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  10.9k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
 2438|       |
 2439|  10.9k|    ps_dec->pu1_inv_scan = puc_temp;
 2440|       |
 2441|  10.9k|    return OK;
  ------------------
  |  |  114|  10.9k|#define OK        0
  ------------------
 2442|  11.2k|}
ih264d_parse_residual4x4_cavlc:
 2459|   100k|{
 2460|   100k|    UWORD8 u1_cbp = ps_cur_mb_info->u1_cbp;
 2461|   100k|    UWORD16 ui16_csbp = 0;
 2462|   100k|    UWORD32 u4_nbr_avl;
 2463|   100k|    WORD16 *pi2_residual_buf;
 2464|       |
 2465|   100k|    UWORD8 u1_is_top_mb_avail;
 2466|   100k|    UWORD8 u1_is_left_mb_avail;
 2467|       |
 2468|   100k|    UWORD8 *pu1_top_nnz = ps_cur_mb_info->ps_curmb->pu1_nnz_y;
 2469|   100k|    UWORD8 *pu1_left_nnz = ps_dec->pu1_left_nnz_y;
 2470|   100k|    WORD16 *pi2_coeff_block = NULL;
 2471|   100k|    UWORD32 *pu4_dummy;
 2472|   100k|    WORD32 ret;
 2473|       |
 2474|   100k|    WORD32 (**pf_cavlc_parse_8x8block)(WORD16 *pi2_coeff_block,
 2475|   100k|                                       UWORD32 u4_sub_block_strd,
 2476|   100k|                                       UWORD32 u4_isdc,
 2477|   100k|                                       struct _DecStruct *ps_dec,
 2478|   100k|                                       UWORD8 *pu1_top_nnz,
 2479|   100k|                                       UWORD8 *pu1_left_nnz,
 2480|   100k|                                       UWORD8 u1_tran_form8x8,
 2481|   100k|                                       UWORD8 u1_mb_field_decodingflag,
 2482|   100k|                                       UWORD32 *pu4_dummy) = ps_dec->pf_cavlc_parse_8x8block;
 2483|       |
 2484|       |
 2485|   100k|    {
 2486|   100k|        UWORD8 uc_temp = ps_dec->u1_mb_ngbr_availablity;
 2487|   100k|        u1_is_top_mb_avail = BOOLEAN(uc_temp & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|   100k|#define BOOLEAN(x) (!!(x))
  ------------------
 2488|   100k|        u1_is_left_mb_avail = BOOLEAN(uc_temp & LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|   100k|#define BOOLEAN(x) (!!(x))
  ------------------
 2489|   100k|        u4_nbr_avl = (u1_is_top_mb_avail << 1) | u1_is_left_mb_avail;
 2490|   100k|    }
 2491|       |
 2492|   100k|    ps_cur_mb_info->u1_qp_div6 = ps_dec->u1_qp_y_div6;
 2493|   100k|    ps_cur_mb_info->u1_qp_rem6 = ps_dec->u1_qp_y_rem6;
 2494|   100k|    ps_cur_mb_info->u1_qpc_div6 = ps_dec->u1_qp_u_div6;
 2495|   100k|    ps_cur_mb_info->u1_qpc_rem6 = ps_dec->u1_qp_u_rem6;
 2496|   100k|    ps_cur_mb_info->u1_qpcr_div6 = ps_dec->u1_qp_v_div6;
 2497|   100k|    ps_cur_mb_info->u1_qpcr_rem6 = ps_dec->u1_qp_v_rem6;
 2498|       |
 2499|   100k|    if(u1_cbp & 0xf)
  ------------------
  |  Branch (2499:8): [True: 57.3k, False: 43.6k]
  ------------------
 2500|  57.3k|    {
 2501|  57.3k|        pu1_top_nnz[0] = ps_cur_mb_info->ps_top_mb->pu1_nnz_y[0];
 2502|  57.3k|        pu1_top_nnz[1] = ps_cur_mb_info->ps_top_mb->pu1_nnz_y[1];
 2503|  57.3k|        pu1_top_nnz[2] = ps_cur_mb_info->ps_top_mb->pu1_nnz_y[2];
 2504|  57.3k|        pu1_top_nnz[3] = ps_cur_mb_info->ps_top_mb->pu1_nnz_y[3];
 2505|       |
 2506|       |        /*******************************************************************/
 2507|       |        /* Block 0 residual decoding, check cbp and proceed (subblock = 0) */
 2508|       |        /*******************************************************************/
 2509|  57.3k|        if(!(u1_cbp & 0x1))
  ------------------
  |  Branch (2509:12): [True: 9.18k, False: 48.1k]
  ------------------
 2510|  9.18k|        {
 2511|  9.18k|            *(UWORD16 *)(pu1_top_nnz) = 0;
 2512|  9.18k|            *(UWORD16 *)(pu1_left_nnz) = 0;
 2513|       |
 2514|  9.18k|        }
 2515|  48.1k|        else
 2516|  48.1k|        {
 2517|  48.1k|            UWORD32 u4_temp;
 2518|  48.1k|            ret = pf_cavlc_parse_8x8block[u4_nbr_avl](
 2519|  48.1k|                        pi2_coeff_block, 4, u1_offset, ps_dec, pu1_top_nnz,
 2520|  48.1k|                        pu1_left_nnz, ps_cur_mb_info->u1_tran_form8x8,
 2521|  48.1k|                        ps_cur_mb_info->u1_mb_field_decodingflag, &u4_temp);
 2522|  48.1k|            if(ret != OK)
  ------------------
  |  |  114|  48.1k|#define OK        0
  ------------------
  |  Branch (2522:16): [True: 1.14k, False: 46.9k]
  ------------------
 2523|  1.14k|                return ret;
 2524|  46.9k|            ui16_csbp = u4_temp;
 2525|  46.9k|        }
 2526|       |
 2527|       |        /*******************************************************************/
 2528|       |        /* Block 1 residual decoding, check cbp and proceed (subblock = 2) */
 2529|       |        /*******************************************************************/
 2530|  56.1k|        if(ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (2530:12): [True: 19.2k, False: 36.9k]
  ------------------
 2531|  19.2k|        {
 2532|  19.2k|            pi2_coeff_block += 64;
 2533|  19.2k|        }
 2534|  36.9k|        else
 2535|  36.9k|        {
 2536|  36.9k|            pi2_coeff_block += (2 * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  36.9k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2537|  36.9k|        }
 2538|       |
 2539|  56.1k|        if(!(u1_cbp & 0x2))
  ------------------
  |  Branch (2539:12): [True: 32.6k, False: 23.5k]
  ------------------
 2540|  32.6k|        {
 2541|  32.6k|            *(UWORD16 *)(pu1_top_nnz + 2) = 0;
 2542|  32.6k|            *(UWORD16 *)(pu1_left_nnz) = 0;
 2543|  32.6k|        }
 2544|  23.5k|        else
 2545|  23.5k|        {
 2546|  23.5k|            UWORD32 u4_temp = (u4_nbr_avl | 0x1);
 2547|  23.5k|            ret = pf_cavlc_parse_8x8block[u4_temp](
 2548|  23.5k|                        pi2_coeff_block, 4, u1_offset, ps_dec,
 2549|  23.5k|                        (pu1_top_nnz + 2), pu1_left_nnz,
 2550|  23.5k|                        ps_cur_mb_info->u1_tran_form8x8,
 2551|  23.5k|                        ps_cur_mb_info->u1_mb_field_decodingflag, &u4_temp);
 2552|  23.5k|            if(ret != OK)
  ------------------
  |  |  114|  23.5k|#define OK        0
  ------------------
  |  Branch (2552:16): [True: 1.02k, False: 22.5k]
  ------------------
 2553|  1.02k|                return ret;
 2554|  22.5k|            ui16_csbp |= (u4_temp << 2);
 2555|  22.5k|        }
 2556|       |
 2557|       |        /*******************************************************************/
 2558|       |        /* Block 2 residual decoding, check cbp and proceed (subblock = 8) */
 2559|       |        /*******************************************************************/
 2560|  55.1k|        if(ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (2560:12): [True: 19.0k, False: 36.0k]
  ------------------
 2561|  19.0k|        {
 2562|  19.0k|            pi2_coeff_block += 64;
 2563|  19.0k|        }
 2564|  36.0k|        else
 2565|  36.0k|        {
 2566|  36.0k|            pi2_coeff_block += (6 * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  36.0k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2567|  36.0k|        }
 2568|       |
 2569|  55.1k|        if(!(u1_cbp & 0x4))
  ------------------
  |  Branch (2569:12): [True: 31.7k, False: 23.3k]
  ------------------
 2570|  31.7k|        {
 2571|  31.7k|            *(UWORD16 *)(pu1_top_nnz) = 0;
 2572|  31.7k|            *(UWORD16 *)(pu1_left_nnz + 2) = 0;
 2573|  31.7k|        }
 2574|  23.3k|        else
 2575|  23.3k|        {
 2576|  23.3k|            UWORD32 u4_temp = (u4_nbr_avl | 0x2);
 2577|  23.3k|            ret = pf_cavlc_parse_8x8block[u4_temp](
 2578|  23.3k|                        pi2_coeff_block, 4, u1_offset, ps_dec, pu1_top_nnz,
 2579|  23.3k|                        (pu1_left_nnz + 2), ps_cur_mb_info->u1_tran_form8x8,
 2580|  23.3k|                        ps_cur_mb_info->u1_mb_field_decodingflag, &u4_temp);
 2581|  23.3k|            if(ret != OK)
  ------------------
  |  |  114|  23.3k|#define OK        0
  ------------------
  |  Branch (2581:16): [True: 1.64k, False: 21.7k]
  ------------------
 2582|  1.64k|                return ret;
 2583|  21.7k|            ui16_csbp |= (u4_temp << 8);
 2584|  21.7k|        }
 2585|       |
 2586|       |        /*******************************************************************/
 2587|       |        /* Block 3 residual decoding, check cbp and proceed (subblock = 10)*/
 2588|       |        /*******************************************************************/
 2589|  53.5k|        if(ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (2589:12): [True: 19.0k, False: 34.4k]
  ------------------
 2590|  19.0k|        {
 2591|  19.0k|            pi2_coeff_block += 64;
 2592|  19.0k|        }
 2593|  34.4k|        else
 2594|  34.4k|        {
 2595|  34.4k|            pi2_coeff_block += (2 * NUM_COEFFS_IN_4x4BLK);
  ------------------
  |  |  617|  34.4k|#define NUM_COEFFS_IN_4x4BLK 16
  ------------------
 2596|  34.4k|        }
 2597|       |
 2598|  53.5k|        if(!(u1_cbp & 0x8))
  ------------------
  |  Branch (2598:12): [True: 30.6k, False: 22.8k]
  ------------------
 2599|  30.6k|        {
 2600|  30.6k|            *(UWORD16 *)(pu1_top_nnz + 2) = 0;
 2601|  30.6k|            *(UWORD16 *)(pu1_left_nnz + 2) = 0;
 2602|  30.6k|        }
 2603|  22.8k|        else
 2604|  22.8k|        {
 2605|  22.8k|            UWORD32 u4_temp;
 2606|  22.8k|            ret = pf_cavlc_parse_8x8block[0x3](
 2607|  22.8k|                        pi2_coeff_block, 4, u1_offset, ps_dec,
 2608|  22.8k|                        (pu1_top_nnz + 2), (pu1_left_nnz + 2),
 2609|  22.8k|                        ps_cur_mb_info->u1_tran_form8x8,
 2610|  22.8k|                        ps_cur_mb_info->u1_mb_field_decodingflag, &u4_temp);
 2611|  22.8k|            if(ret != OK)
  ------------------
  |  |  114|  22.8k|#define OK        0
  ------------------
  |  Branch (2611:16): [True: 983, False: 21.8k]
  ------------------
 2612|    983|                return ret;
 2613|  21.8k|            ui16_csbp |= (u4_temp << 10);
 2614|  21.8k|        }
 2615|  53.5k|    }
 2616|  43.6k|    else
 2617|  43.6k|    {
 2618|  43.6k|        *(UWORD32 *)(pu1_top_nnz) = 0;
 2619|  43.6k|        *(UWORD32 *)(pu1_left_nnz) = 0;
 2620|  43.6k|    }
 2621|       |
 2622|  96.1k|    ps_cur_mb_info->u2_luma_csbp = ui16_csbp;
 2623|  96.1k|    ps_cur_mb_info->ps_curmb->u2_luma_csbp = ui16_csbp;
 2624|       |
 2625|  96.1k|    {
 2626|  96.1k|        UWORD16 u2_chroma_csbp = 0;
 2627|  96.1k|        ps_cur_mb_info->u2_chroma_csbp = 0;
 2628|  96.1k|        pu1_top_nnz = ps_cur_mb_info->ps_curmb->pu1_nnz_uv;
 2629|  96.1k|        pu1_left_nnz = ps_dec->pu1_left_nnz_uv;
 2630|       |
 2631|  96.1k|        u1_cbp >>= 4;
 2632|       |        /*--------------------------------------------------------------------*/
 2633|       |        /* if Chroma Component not present OR no ac values present            */
 2634|       |        /* Set the values of N to zero                                        */
 2635|       |        /*--------------------------------------------------------------------*/
 2636|  96.1k|        if(u1_cbp == CBPC_ALLZERO || u1_cbp == CBPC_ACZERO)
  ------------------
  |  |  507|   192k|#define CBPC_ALLZERO    0
  ------------------
                      if(u1_cbp == CBPC_ALLZERO || u1_cbp == CBPC_ACZERO)
  ------------------
  |  |  508|  61.2k|#define CBPC_ACZERO     1
  ------------------
  |  Branch (2636:12): [True: 34.9k, False: 61.2k]
  |  Branch (2636:38): [True: 42.5k, False: 18.6k]
  ------------------
 2637|  77.5k|        {
 2638|  77.5k|            *(UWORD32 *)(pu1_top_nnz) = 0;
 2639|  77.5k|            *(UWORD32 *)(pu1_left_nnz) = 0;
 2640|  77.5k|        }
 2641|       |
 2642|  96.1k|        if(u1_cbp == CBPC_ALLZERO)
  ------------------
  |  |  507|  96.1k|#define CBPC_ALLZERO    0
  ------------------
  |  Branch (2642:12): [True: 34.9k, False: 61.2k]
  ------------------
 2643|  34.9k|        {
 2644|  34.9k|            return (0);
 2645|  34.9k|        }
 2646|       |        /*--------------------------------------------------------------------*/
 2647|       |        /* Decode Chroma DC values                                            */
 2648|       |        /*--------------------------------------------------------------------*/
 2649|  61.2k|        {
 2650|  61.2k|            WORD32 u4_scale_u;
 2651|  61.2k|            WORD32 u4_scale_v;
 2652|  61.2k|            WORD32 i4_mb_inter_inc;
 2653|  61.2k|            u4_scale_u = ps_dec->pu2_quant_scale_u[0] << ps_dec->u1_qp_u_div6;
 2654|  61.2k|            u4_scale_v = ps_dec->pu2_quant_scale_v[0] << ps_dec->u1_qp_v_div6;
 2655|  61.2k|            i4_mb_inter_inc = (!((ps_cur_mb_info->ps_curmb->u1_mb_type == I_4x4_MB)
  ------------------
  |  |  417|  61.2k|#define I_4x4_MB    0
  ------------------
  |  Branch (2655:34): [True: 15.7k, False: 45.4k]
  ------------------
 2656|  45.4k|                            || (ps_cur_mb_info->ps_curmb->u1_mb_type == I_16x16_MB)))
  ------------------
  |  |  418|  45.4k|#define I_16x16_MB  1
  ------------------
  |  Branch (2656:32): [True: 18.8k, False: 26.5k]
  ------------------
 2657|  61.2k|                            * 3;
 2658|       |
 2659|  61.2k|            if(ps_dec->s_high_profile.u1_scaling_present)
  ------------------
  |  Branch (2659:16): [True: 11.7k, False: 49.4k]
  ------------------
 2660|  11.7k|            {
 2661|  11.7k|                u4_scale_u *=
 2662|  11.7k|                                ps_dec->s_high_profile.i2_scalinglist4x4[i4_mb_inter_inc
 2663|  11.7k|                                                + 1][0];
 2664|  11.7k|                u4_scale_v *=
 2665|  11.7k|                                ps_dec->s_high_profile.i2_scalinglist4x4[i4_mb_inter_inc
 2666|  11.7k|                                                + 2][0];
 2667|       |
 2668|  11.7k|            }
 2669|  49.4k|            else
 2670|  49.4k|            {
 2671|  49.4k|                u4_scale_u <<= 4;
 2672|  49.4k|                u4_scale_v <<= 4;
 2673|  49.4k|            }
 2674|       |
 2675|  61.2k|            ih264d_cavlc_parse_chroma_dc(ps_cur_mb_info,pi2_coeff_block, ps_dec->ps_bitstrm,
 2676|  61.2k|                                         u4_scale_u, u4_scale_v,
 2677|  61.2k|                                         i4_mb_inter_inc);
 2678|  61.2k|        }
 2679|       |
 2680|  61.2k|        if(u1_cbp == CBPC_ACZERO)
  ------------------
  |  |  508|  61.2k|#define CBPC_ACZERO     1
  ------------------
  |  Branch (2680:12): [True: 42.5k, False: 18.6k]
  ------------------
 2681|  42.5k|            return (0);
 2682|       |
 2683|  18.6k|        pu1_top_nnz[0] = ps_cur_mb_info->ps_top_mb->pu1_nnz_uv[0];
 2684|  18.6k|        pu1_top_nnz[1] = ps_cur_mb_info->ps_top_mb->pu1_nnz_uv[1];
 2685|  18.6k|        pu1_top_nnz[2] = ps_cur_mb_info->ps_top_mb->pu1_nnz_uv[2];
 2686|  18.6k|        pu1_top_nnz[3] = ps_cur_mb_info->ps_top_mb->pu1_nnz_uv[3];
 2687|       |        /*--------------------------------------------------------------------*/
 2688|       |        /* Decode Chroma AC values                                            */
 2689|       |        /*--------------------------------------------------------------------*/
 2690|  18.6k|        {
 2691|  18.6k|            UWORD32 u4_temp;
 2692|       |            /*****************************************************************/
 2693|       |            /* U Block  residual decoding, check cbp and proceed (subblock=0)*/
 2694|       |            /*****************************************************************/
 2695|  18.6k|            ret = pf_cavlc_parse_8x8block[u4_nbr_avl](
 2696|  18.6k|                        pi2_coeff_block, 2, 1, ps_dec, pu1_top_nnz,
 2697|  18.6k|                        pu1_left_nnz, 0, 0, &u4_temp);
 2698|  18.6k|            if(ret != OK)
  ------------------
  |  |  114|  18.6k|#define OK        0
  ------------------
  |  Branch (2698:16): [True: 1.28k, False: 17.3k]
  ------------------
 2699|  1.28k|                return ret;
 2700|  17.3k|            u2_chroma_csbp = u4_temp;
 2701|       |
 2702|  17.3k|            pi2_coeff_block += MB_CHROM_SIZE;
  ------------------
  |  |  564|  17.3k|#define MB_CHROM_SIZE                 64
  ------------------
 2703|       |            /*****************************************************************/
 2704|       |            /* V Block  residual decoding, check cbp and proceed (subblock=1)*/
 2705|       |            /*****************************************************************/
 2706|  17.3k|            ret = pf_cavlc_parse_8x8block[u4_nbr_avl](pi2_coeff_block, 2, 1,
 2707|  17.3k|                                                      ps_dec,
 2708|  17.3k|                                                      (pu1_top_nnz + 2),
 2709|  17.3k|                                                      (pu1_left_nnz + 2), 0,
 2710|  17.3k|                                                      0, &u4_temp);
 2711|  17.3k|            if(ret != OK)
  ------------------
  |  |  114|  17.3k|#define OK        0
  ------------------
  |  Branch (2711:16): [True: 746, False: 16.5k]
  ------------------
 2712|    746|                return ret;
 2713|  16.5k|            u2_chroma_csbp |= (u4_temp << 4);
 2714|  16.5k|        }
 2715|       |
 2716|      0|        ps_cur_mb_info->u2_chroma_csbp = u2_chroma_csbp;
 2717|  16.5k|    }
 2718|  16.5k|    return OK;
  ------------------
  |  |  114|  16.5k|#define OK        0
  ------------------
 2719|  17.3k|}

ih264d_get_pre_sei_params:
   86|   175k|{
   87|   175k|    if((NULL != ps_dec->ps_sei) &&
  ------------------
  |  Branch (87:8): [True: 175k, False: 0]
  ------------------
   88|   175k|        ((0 == ps_dec->ps_sei->s_sei_ccv_params.u1_ccv_cancel_flag) &&
  ------------------
  |  Branch (88:10): [True: 174k, False: 311]
  ------------------
   89|   174k|        (0 == ps_dec->ps_sei->s_sei_ccv_params.u1_ccv_persistence_flag)))
  ------------------
  |  Branch (89:9): [True: 174k, False: 83]
  ------------------
   90|   174k|    {
   91|   174k|        ps_dec->ps_sei->u1_sei_ccv_params_present_flag = 0;
   92|   174k|        memset(&ps_dec->ps_sei->s_sei_ccv_params, 0, sizeof(sei_ccv_params_t));
   93|   174k|    }
   94|       |
   95|   175k|    if((NULL != ps_dec->ps_cur_sps) &&
  ------------------
  |  Branch (95:8): [True: 146k, False: 28.8k]
  ------------------
   96|   146k|        ((1 == ps_dec->ps_cur_sps->u1_vui_parameters_present_flag) &&
  ------------------
  |  Branch (96:10): [True: 19.3k, False: 126k]
  ------------------
   97|  19.3k|        ((2 != ps_dec->ps_cur_sps->s_vui.u1_colour_primaries) &&
  ------------------
  |  Branch (97:10): [True: 2.09k, False: 17.2k]
  ------------------
   98|  2.09k|        (2 != ps_dec->ps_cur_sps->s_vui.u1_matrix_coeffs) &&
  ------------------
  |  Branch (98:9): [True: 1.86k, False: 234]
  ------------------
   99|  1.86k|        (2 != ps_dec->ps_cur_sps->s_vui.u1_tfr_chars) &&
  ------------------
  |  Branch (99:9): [True: 1.79k, False: 70]
  ------------------
  100|  1.79k|        (4 != ps_dec->ps_cur_sps->s_vui.u1_tfr_chars) &&
  ------------------
  |  Branch (100:9): [True: 1.72k, False: 67]
  ------------------
  101|  1.72k|        (5 != ps_dec->ps_cur_sps->s_vui.u1_tfr_chars))))
  ------------------
  |  Branch (101:9): [True: 1.53k, False: 194]
  ------------------
  102|  1.53k|    {
  103|  1.53k|        if((1 == ps_dec->ps_sei_parse->u1_sei_ccv_params_present_flag) ||
  ------------------
  |  Branch (103:12): [True: 125, False: 1.40k]
  ------------------
  104|  1.40k|            (IDR_SLICE_NAL == u1_nal_unit_type))
  ------------------
  |  |  328|  1.40k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (104:13): [True: 476, False: 932]
  ------------------
  105|    601|        {
  106|    601|            ps_dec->ps_sei->u1_sei_ccv_params_present_flag =
  107|    601|                        ps_dec->ps_sei_parse->u1_sei_ccv_params_present_flag;
  108|    601|            ps_dec->ps_sei->s_sei_ccv_params = ps_dec->ps_sei_parse->s_sei_ccv_params;
  109|    601|        }
  110|  1.53k|    }
  111|   173k|    else
  112|   173k|    {
  113|   173k|        ps_dec->ps_sei->u1_sei_ccv_params_present_flag = 0;
  114|   173k|        memset(&ps_dec->ps_sei->s_sei_ccv_params, 0, sizeof(sei_ccv_params_t));
  115|   173k|    }
  116|       |
  117|   175k|    if(IDR_SLICE_NAL == u1_nal_unit_type)
  ------------------
  |  |  328|   175k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (117:8): [True: 111k, False: 63.7k]
  ------------------
  118|   111k|    {
  119|   111k|        ps_dec->ps_sei->u1_sei_mdcv_params_present_flag =
  120|   111k|                        ps_dec->ps_sei_parse->u1_sei_mdcv_params_present_flag;
  121|   111k|        ps_dec->ps_sei->s_sei_mdcv_params = ps_dec->ps_sei_parse->s_sei_mdcv_params;
  122|   111k|        ps_dec->ps_sei->u1_sei_cll_params_present_flag =
  123|   111k|                        ps_dec->ps_sei_parse->u1_sei_cll_params_present_flag;
  124|   111k|        ps_dec->ps_sei->s_sei_cll_params = ps_dec->ps_sei_parse->s_sei_cll_params;
  125|   111k|        ps_dec->ps_sei->u1_sei_ave_params_present_flag =
  126|   111k|                        ps_dec->ps_sei_parse->u1_sei_ave_params_present_flag;
  127|   111k|        ps_dec->ps_sei->s_sei_ave_params = ps_dec->ps_sei_parse->s_sei_ave_params;
  128|   111k|        ps_dec->ps_sei->u1_sei_sii_params_present_flag =
  129|   111k|            ps_dec->ps_sei_parse->u1_sei_sii_params_present_flag;
  130|   111k|        ps_dec->ps_sei->s_sei_sii_params = ps_dec->ps_sei_parse->s_sei_sii_params;
  131|   111k|    }
  132|       |
  133|   175k|    if(NULL != ps_dec->ps_sei)
  ------------------
  |  Branch (133:8): [True: 175k, False: 0]
  ------------------
  134|   175k|    {
  135|   175k|        ps_dec->ps_sei->u1_sei_fgc_params_present_flag =
  136|   175k|            ps_dec->ps_sei_parse->u1_sei_fgc_params_present_flag;
  137|   175k|        ps_dec->ps_sei->s_sei_fgc_params = ps_dec->ps_sei_parse->s_sei_fgc_params;
  138|   175k|    }
  139|       |
  140|   175k|    ps_dec->ps_sei_parse->u1_sei_mdcv_params_present_flag = 0;
  141|   175k|    memset(&ps_dec->ps_sei_parse->s_sei_mdcv_params, 0, sizeof(sei_mdcv_params_t));
  142|   175k|    ps_dec->ps_sei_parse->u1_sei_cll_params_present_flag = 0;
  143|   175k|    memset(&ps_dec->ps_sei_parse->s_sei_cll_params, 0, sizeof(sei_cll_params_t));
  144|   175k|    ps_dec->ps_sei_parse->u1_sei_ave_params_present_flag = 0;
  145|   175k|    memset(&ps_dec->ps_sei_parse->s_sei_ave_params, 0, sizeof(sei_ave_params_t));
  146|   175k|    ps_dec->ps_sei_parse->u1_sei_ccv_params_present_flag = 0;
  147|   175k|    memset(&ps_dec->ps_sei_parse->s_sei_ccv_params, 0, sizeof(sei_ccv_params_t));
  148|   175k|    ps_dec->ps_sei_parse->u1_sei_sii_params_present_flag = 0;
  149|   175k|    memset(&ps_dec->ps_sei_parse->s_sei_sii_params, 0, sizeof(sei_sii_params_t));
  150|   175k|}
ih264d_parse_sei:
  207|  1.93k|{
  208|  1.93k|    UNUSED(ps_dec);
  ------------------
  |  |   45|  1.93k|#define UNUSED(x) ((void)(x))
  ------------------
  209|  1.93k|    UNUSED(ps_bitstrm);
  ------------------
  |  |   45|  1.93k|#define UNUSED(x) ((void)(x))
  ------------------
  210|  1.93k|    return (0);
  211|  1.93k|}
ih264d_correct_level_idc:
  500|   140k|{
  501|   140k|    UWORD32 u4_max_mbs_allowed;
  502|       |
  503|   140k|    switch(u4_level_idc)
  504|   140k|    {
  505|  1.30k|        case H264_LEVEL_1_0:
  ------------------
  |  |  291|  1.30k|#define H264_LEVEL_1_0     10
  ------------------
  |  Branch (505:9): [True: 1.30k, False: 139k]
  ------------------
  506|  1.30k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_10;
  ------------------
  |  |  321|  1.30k|#define MAX_MBS_LEVEL_10 99
  ------------------
  507|  1.30k|            break;
  508|  14.9k|        case H264_LEVEL_1_1:
  ------------------
  |  |  292|  14.9k|#define H264_LEVEL_1_1     11
  ------------------
  |  Branch (508:9): [True: 14.9k, False: 125k]
  ------------------
  509|  14.9k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_11;
  ------------------
  |  |  320|  14.9k|#define MAX_MBS_LEVEL_11 396
  ------------------
  510|  14.9k|            break;
  511|  1.62k|        case H264_LEVEL_1_2:
  ------------------
  |  |  293|  1.62k|#define H264_LEVEL_1_2     12
  ------------------
  |  Branch (511:9): [True: 1.62k, False: 139k]
  ------------------
  512|  1.62k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_12;
  ------------------
  |  |  319|  1.62k|#define MAX_MBS_LEVEL_12 396
  ------------------
  513|  1.62k|            break;
  514|  1.04k|        case H264_LEVEL_1_3:
  ------------------
  |  |  294|  1.04k|#define H264_LEVEL_1_3     13
  ------------------
  |  Branch (514:9): [True: 1.04k, False: 139k]
  ------------------
  515|  1.04k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_13;
  ------------------
  |  |  318|  1.04k|#define MAX_MBS_LEVEL_13 396
  ------------------
  516|  1.04k|            break;
  517|  18.3k|        case H264_LEVEL_2_0:
  ------------------
  |  |  295|  18.3k|#define H264_LEVEL_2_0     20
  ------------------
  |  Branch (517:9): [True: 18.3k, False: 122k]
  ------------------
  518|  18.3k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_20;
  ------------------
  |  |  317|  18.3k|#define MAX_MBS_LEVEL_20 396
  ------------------
  519|  18.3k|            break;
  520|  2.57k|        case H264_LEVEL_2_1:
  ------------------
  |  |  296|  2.57k|#define H264_LEVEL_2_1     21
  ------------------
  |  Branch (520:9): [True: 2.57k, False: 138k]
  ------------------
  521|  2.57k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_21;
  ------------------
  |  |  316|  2.57k|#define MAX_MBS_LEVEL_21 792
  ------------------
  522|  2.57k|            break;
  523|    649|        case H264_LEVEL_2_2:
  ------------------
  |  |  297|    649|#define H264_LEVEL_2_2     22
  ------------------
  |  Branch (523:9): [True: 649, False: 140k]
  ------------------
  524|    649|            u4_max_mbs_allowed = MAX_MBS_LEVEL_22;
  ------------------
  |  |  315|    649|#define MAX_MBS_LEVEL_22 1620
  ------------------
  525|    649|            break;
  526|  1.50k|        case H264_LEVEL_3_0:
  ------------------
  |  |  298|  1.50k|#define H264_LEVEL_3_0     30
  ------------------
  |  Branch (526:9): [True: 1.50k, False: 139k]
  ------------------
  527|  1.50k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_30;
  ------------------
  |  |  314|  1.50k|#define MAX_MBS_LEVEL_30 1620
  ------------------
  528|  1.50k|            break;
  529|  5.89k|        case H264_LEVEL_3_1:
  ------------------
  |  |  299|  5.89k|#define H264_LEVEL_3_1     31
  ------------------
  |  Branch (529:9): [True: 5.89k, False: 134k]
  ------------------
  530|  5.89k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_31;
  ------------------
  |  |  313|  5.89k|#define MAX_MBS_LEVEL_31 3600
  ------------------
  531|  5.89k|            break;
  532|  21.9k|        case H264_LEVEL_3_2:
  ------------------
  |  |  300|  21.9k|#define H264_LEVEL_3_2     32
  ------------------
  |  Branch (532:9): [True: 21.9k, False: 118k]
  ------------------
  533|  21.9k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_32;
  ------------------
  |  |  312|  21.9k|#define MAX_MBS_LEVEL_32 5120
  ------------------
  534|  21.9k|            break;
  535|  6.92k|        case H264_LEVEL_4_0:
  ------------------
  |  |  301|  6.92k|#define H264_LEVEL_4_0     40
  ------------------
  |  Branch (535:9): [True: 6.92k, False: 133k]
  ------------------
  536|  6.92k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_40;
  ------------------
  |  |  311|  6.92k|#define MAX_MBS_LEVEL_40 8192
  ------------------
  537|  6.92k|            break;
  538|  1.15k|        case H264_LEVEL_4_1:
  ------------------
  |  |  302|  1.15k|#define H264_LEVEL_4_1     41
  ------------------
  |  Branch (538:9): [True: 1.15k, False: 139k]
  ------------------
  539|  1.15k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_41;
  ------------------
  |  |  310|  1.15k|#define MAX_MBS_LEVEL_41 8192
  ------------------
  540|  1.15k|            break;
  541|  5.00k|        case H264_LEVEL_4_2:
  ------------------
  |  |  303|  5.00k|#define H264_LEVEL_4_2     42
  ------------------
  |  Branch (541:9): [True: 5.00k, False: 135k]
  ------------------
  542|  5.00k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_42;
  ------------------
  |  |  309|  5.00k|#define MAX_MBS_LEVEL_42 8704
  ------------------
  543|  5.00k|            break;
  544|     78|        case H264_LEVEL_5_0:
  ------------------
  |  |  304|     78|#define H264_LEVEL_5_0     50
  ------------------
  |  Branch (544:9): [True: 78, False: 140k]
  ------------------
  545|     78|            u4_max_mbs_allowed = MAX_MBS_LEVEL_50;
  ------------------
  |  |  308|     78|#define MAX_MBS_LEVEL_50 22080
  ------------------
  546|     78|            break;
  547|      0|        case H264_LEVEL_5_1:
  ------------------
  |  |  305|      0|#define H264_LEVEL_5_1     51
  ------------------
  |  Branch (547:9): [True: 0, False: 140k]
  ------------------
  548|  57.7k|        default:
  ------------------
  |  Branch (548:9): [True: 57.7k, False: 82.9k]
  ------------------
  549|  57.7k|            u4_max_mbs_allowed = MAX_MBS_LEVEL_51;
  ------------------
  |  |  307|  57.7k|#define MAX_MBS_LEVEL_51 36864
  ------------------
  550|  57.7k|            break;
  551|       |
  552|   140k|    }
  553|       |
  554|       |    /*correct of the level is incorrect*/
  555|   140k|    if(u4_total_mbs > u4_max_mbs_allowed)
  ------------------
  |  Branch (555:8): [True: 1.65k, False: 138k]
  ------------------
  556|  1.65k|    {
  557|  1.65k|        if(u4_total_mbs > MAX_MBS_LEVEL_50)
  ------------------
  |  |  308|  1.65k|#define MAX_MBS_LEVEL_50 22080
  ------------------
  |  Branch (557:12): [True: 81, False: 1.57k]
  ------------------
  558|     81|            u4_level_idc = H264_LEVEL_5_1;
  ------------------
  |  |  305|     81|#define H264_LEVEL_5_1     51
  ------------------
  559|  1.57k|        else if(u4_total_mbs > MAX_MBS_LEVEL_42)
  ------------------
  |  |  309|  1.57k|#define MAX_MBS_LEVEL_42 8704
  ------------------
  |  Branch (559:17): [True: 78, False: 1.49k]
  ------------------
  560|     78|            u4_level_idc = H264_LEVEL_5_0;
  ------------------
  |  |  304|     78|#define H264_LEVEL_5_0     50
  ------------------
  561|  1.49k|        else if(u4_total_mbs > MAX_MBS_LEVEL_41)
  ------------------
  |  |  310|  1.49k|#define MAX_MBS_LEVEL_41 8192
  ------------------
  |  Branch (561:17): [True: 165, False: 1.33k]
  ------------------
  562|    165|            u4_level_idc = H264_LEVEL_4_2;
  ------------------
  |  |  303|    165|#define H264_LEVEL_4_2     42
  ------------------
  563|  1.33k|        else if(u4_total_mbs > MAX_MBS_LEVEL_40)
  ------------------
  |  |  311|  1.33k|#define MAX_MBS_LEVEL_40 8192
  ------------------
  |  Branch (563:17): [True: 0, False: 1.33k]
  ------------------
  564|      0|            u4_level_idc = H264_LEVEL_4_1;
  ------------------
  |  |  302|      0|#define H264_LEVEL_4_1     41
  ------------------
  565|  1.33k|        else if(u4_total_mbs > MAX_MBS_LEVEL_32)
  ------------------
  |  |  312|  1.33k|#define MAX_MBS_LEVEL_32 5120
  ------------------
  |  Branch (565:17): [True: 125, False: 1.20k]
  ------------------
  566|    125|            u4_level_idc = H264_LEVEL_4_0;
  ------------------
  |  |  301|    125|#define H264_LEVEL_4_0     40
  ------------------
  567|  1.20k|        else if(u4_total_mbs > MAX_MBS_LEVEL_31)
  ------------------
  |  |  313|  1.20k|#define MAX_MBS_LEVEL_31 3600
  ------------------
  |  Branch (567:17): [True: 189, False: 1.02k]
  ------------------
  568|    189|            u4_level_idc = H264_LEVEL_3_2;
  ------------------
  |  |  300|    189|#define H264_LEVEL_3_2     32
  ------------------
  569|  1.02k|        else if(u4_total_mbs > MAX_MBS_LEVEL_30)
  ------------------
  |  |  314|  1.02k|#define MAX_MBS_LEVEL_30 1620
  ------------------
  |  Branch (569:17): [True: 174, False: 846]
  ------------------
  570|    174|            u4_level_idc = H264_LEVEL_3_1;
  ------------------
  |  |  299|    174|#define H264_LEVEL_3_1     31
  ------------------
  571|    846|        else if(u4_total_mbs > MAX_MBS_LEVEL_21)
  ------------------
  |  |  316|    846|#define MAX_MBS_LEVEL_21 792
  ------------------
  |  Branch (571:17): [True: 124, False: 722]
  ------------------
  572|    124|            u4_level_idc = H264_LEVEL_3_0;
  ------------------
  |  |  298|    124|#define H264_LEVEL_3_0     30
  ------------------
  573|    722|        else if(u4_total_mbs > MAX_MBS_LEVEL_20)
  ------------------
  |  |  317|    722|#define MAX_MBS_LEVEL_20 396
  ------------------
  |  Branch (573:17): [True: 500, False: 222]
  ------------------
  574|    500|            u4_level_idc = H264_LEVEL_2_1;
  ------------------
  |  |  296|    500|#define H264_LEVEL_2_1     21
  ------------------
  575|    222|        else if(u4_total_mbs > MAX_MBS_LEVEL_10)
  ------------------
  |  |  321|    222|#define MAX_MBS_LEVEL_10 99
  ------------------
  |  Branch (575:17): [True: 222, False: 0]
  ------------------
  576|    222|            u4_level_idc = H264_LEVEL_2_0;
  ------------------
  |  |  295|    222|#define H264_LEVEL_2_0     20
  ------------------
  577|  1.65k|    }
  578|       |
  579|   140k|    return (u4_level_idc);
  580|       |
  581|   140k|}

ih264d_parse_imb_cavlc:
   92|  56.5k|{
   93|  56.5k|    WORD32 i4_delta_qp;
   94|  56.5k|    UWORD32 u4_temp;
   95|  56.5k|    UWORD32 ui_is_top_mb_available;
   96|  56.5k|    UWORD32 ui_is_left_mb_available;
   97|  56.5k|    UWORD32 u4_cbp;
   98|  56.5k|    UWORD32 u4_offset;
   99|  56.5k|    UWORD32 *pu4_bitstrm_buf;
  100|  56.5k|    WORD32 ret;
  101|       |
  102|  56.5k|    dec_bit_stream_t * const ps_bitstrm = ps_dec->ps_bitstrm;
  103|  56.5k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  104|  56.5k|    UNUSED(u4_mb_num);
  ------------------
  |  |   45|  56.5k|#define UNUSED(x) ((void)(x))
  ------------------
  105|  56.5k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
  106|  56.5k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  107|       |
  108|  56.5k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  109|       |
  110|  56.5k|    u4_temp = ps_dec->u1_mb_ngbr_availablity;
  111|  56.5k|    ui_is_top_mb_available = BOOLEAN(u4_temp & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|  56.5k|#define BOOLEAN(x) (!!(x))
  ------------------
  112|  56.5k|    ui_is_left_mb_available = BOOLEAN(u4_temp & LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|  56.5k|#define BOOLEAN(x) (!!(x))
  ------------------
  113|       |
  114|  56.5k|    pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  115|       |
  116|  56.5k|    if(u1_mb_type == I_4x4_MB)
  ------------------
  |  |  417|  56.5k|#define I_4x4_MB    0
  ------------------
  |  Branch (116:8): [True: 13.4k, False: 43.0k]
  ------------------
  117|  13.4k|    {
  118|  13.4k|        ps_cur_mb_info->ps_curmb->u1_mb_type = I_4x4_MB;
  ------------------
  |  |  417|  13.4k|#define I_4x4_MB    0
  ------------------
  119|  13.4k|        u4_offset = 0;
  120|       |
  121|       |        /*--------------------------------------------------------------------*/
  122|       |        /* Read transform_size_8x8_flag if present                            */
  123|       |        /*--------------------------------------------------------------------*/
  124|  13.4k|        if(ps_dec->s_high_profile.u1_transform8x8_present)
  ------------------
  |  Branch (124:12): [True: 8.27k, False: 5.13k]
  ------------------
  125|  8.27k|        {
  126|  8.27k|            ps_cur_mb_info->u1_tran_form8x8 = ih264d_get_bit_h264(ps_bitstrm);
  127|  8.27k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  128|  8.27k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  129|  8.27k|        }
  130|       |
  131|       |        /*--------------------------------------------------------------------*/
  132|       |        /* Read the IntraPrediction modes for LUMA                            */
  133|       |        /*--------------------------------------------------------------------*/
  134|  13.4k|        if (!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (134:13): [True: 5.40k, False: 8.00k]
  ------------------
  135|  5.40k|        {
  136|  5.40k|            UWORD8 *pu1_temp;
  137|  5.40k|            ih264d_read_intra_pred_modes(ps_dec,
  138|  5.40k|                                          ((UWORD8 *)ps_dec->pv_parse_tu_coeff_data),
  139|  5.40k|                                          ((UWORD8 *)ps_dec->pv_parse_tu_coeff_data+16),
  140|  5.40k|                                          ps_cur_mb_info->u1_tran_form8x8);
  141|  5.40k|            pu1_temp = (UWORD8 *)ps_dec->pv_parse_tu_coeff_data;
  142|  5.40k|            pu1_temp += 32;
  143|  5.40k|            ps_dec->pv_parse_tu_coeff_data = (void *)pu1_temp;
  144|  5.40k|        }
  145|  8.00k|        else
  146|  8.00k|        {
  147|  8.00k|            UWORD8 *pu1_temp;
  148|  8.00k|            ih264d_read_intra_pred_modes(ps_dec,
  149|  8.00k|                                          ((UWORD8 *)ps_dec->pv_parse_tu_coeff_data),
  150|  8.00k|                                          ((UWORD8 *)ps_dec->pv_parse_tu_coeff_data+4),
  151|  8.00k|                                          ps_cur_mb_info->u1_tran_form8x8);
  152|  8.00k|            pu1_temp = (UWORD8 *)ps_dec->pv_parse_tu_coeff_data;
  153|  8.00k|            pu1_temp += 8;
  154|  8.00k|            ps_dec->pv_parse_tu_coeff_data = (void *)pu1_temp;
  155|  8.00k|        }
  156|       |        /*--------------------------------------------------------------------*/
  157|       |        /* Read the IntraPrediction mode for CHROMA                           */
  158|       |        /*--------------------------------------------------------------------*/
  159|       |//Inlined ih264d_uev
  160|  13.4k|        {
  161|  13.4k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  162|  13.4k|            UWORD32 u4_word, u4_ldz, u4_temp;
  163|       |
  164|       |            /***************************************************************/
  165|       |            /* Find leading zeros in next 32 bits                          */
  166|       |            /***************************************************************/
  167|  13.4k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  13.4k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  13.4k|{                                                                           \
  |  |  152|  13.4k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  13.4k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  13.4k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  13.4k|                                                                            \
  |  |  156|  13.4k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  13.4k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 13.0k, False: 344]
  |  |  ------------------
  |  |  158|  13.4k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  13.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  13.4k|}
  ------------------
  168|  13.4k|            u4_ldz = CLZ(u4_word);
  169|       |            /* Flush the ps_bitstrm */
  170|  13.4k|            u4_bitstream_offset += (u4_ldz + 1);
  171|       |            /* Read the suffix from the ps_bitstrm */
  172|  13.4k|            u4_word = 0;
  173|  13.4k|            if(u4_ldz)
  ------------------
  |  Branch (173:16): [True: 2.49k, False: 10.9k]
  ------------------
  174|  2.49k|            {
  175|  2.49k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  2.49k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  2.49k|{                                                                           \
  |  |  122|  2.49k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  2.49k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  2.49k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  2.49k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  2.49k|                                                                            \
  |  |  127|  2.49k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.34k, False: 148]
  |  |  ------------------
  |  |  128|  2.49k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.34k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  2.49k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  2.49k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  2.49k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  2.49k|}                                                                           \
  ------------------
  176|  2.49k|                        u4_ldz);
  177|  2.49k|            }
  178|  13.4k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  179|  13.4k|            u4_temp = ((1 << u4_ldz) + u4_word - 1);
  180|  13.4k|            if(u4_temp > 3)
  ------------------
  |  Branch (180:16): [True: 862, False: 12.5k]
  ------------------
  181|    862|            {
  182|    862|                return ERROR_CHROMA_PRED_MODE;
  183|    862|            }
  184|  12.5k|            ps_cur_mb_info->u1_chroma_pred_mode = u4_temp;
  185|  12.5k|            COPYTHECONTEXT("intra_chroma_pred_mode", ps_cur_mb_info->u1_chroma_pred_mode);
  186|  12.5k|        }
  187|       |        /*--------------------------------------------------------------------*/
  188|       |        /* Read the Coded block pattern                                       */
  189|       |        /*--------------------------------------------------------------------*/
  190|      0|        {
  191|  12.5k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  192|  12.5k|            UWORD32 u4_word, u4_ldz;
  193|       |
  194|       |            /***************************************************************/
  195|       |            /* Find leading zeros in next 32 bits                          */
  196|       |            /***************************************************************/
  197|  12.5k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  12.5k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  12.5k|{                                                                           \
  |  |  152|  12.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  12.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  12.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  12.5k|                                                                            \
  |  |  156|  12.5k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  12.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 12.2k, False: 262]
  |  |  ------------------
  |  |  158|  12.5k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  12.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  12.5k|}
  ------------------
  198|  12.5k|            u4_ldz = CLZ(u4_word);
  199|       |            /* Flush the ps_bitstrm */
  200|  12.5k|            u4_bitstream_offset += (u4_ldz + 1);
  201|       |            /* Read the suffix from the ps_bitstrm */
  202|  12.5k|            u4_word = 0;
  203|  12.5k|            if(u4_ldz)
  ------------------
  |  Branch (203:16): [True: 4.85k, False: 7.69k]
  ------------------
  204|  4.85k|            {
  205|  4.85k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  4.85k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  4.85k|{                                                                           \
  |  |  122|  4.85k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  4.85k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  4.85k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  4.85k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  4.85k|                                                                            \
  |  |  127|  4.85k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 4.69k, False: 154]
  |  |  ------------------
  |  |  128|  4.85k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  4.69k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  4.85k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  4.85k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  4.85k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  4.85k|}                                                                           \
  ------------------
  206|  4.85k|                        u4_ldz);
  207|  4.85k|            }
  208|  12.5k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  209|  12.5k|            u4_cbp = ((1 << u4_ldz) + u4_word - 1);
  210|  12.5k|        }
  211|  12.5k|        if(u4_cbp > 47)
  ------------------
  |  Branch (211:12): [True: 220, False: 12.3k]
  ------------------
  212|    220|        {
  213|    220|            return ERROR_CBP;
  214|    220|        }
  215|       |
  216|  12.3k|        u4_cbp = gau1_ih264d_cbp_table[u4_cbp][0];
  217|  12.3k|        COPYTHECONTEXT("coded_block_pattern", u1_cbp);
  218|  12.3k|        ps_cur_mb_info->u1_cbp = u4_cbp;
  219|       |
  220|       |        /*--------------------------------------------------------------------*/
  221|       |        /* Read mb_qp_delta                                                   */
  222|       |        /*--------------------------------------------------------------------*/
  223|  12.3k|        if(ps_cur_mb_info->u1_cbp)
  ------------------
  |  Branch (223:12): [True: 11.7k, False: 530]
  ------------------
  224|  11.7k|        {
  225|  11.7k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  226|  11.7k|            UWORD32 u4_word, u4_ldz, u4_abs_val;
  227|       |
  228|       |            /***************************************************************/
  229|       |            /* Find leading zeros in next 32 bits                          */
  230|       |            /***************************************************************/
  231|  11.7k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  11.7k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  11.7k|{                                                                           \
  |  |  152|  11.7k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  11.7k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  11.7k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  11.7k|                                                                            \
  |  |  156|  11.7k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  11.7k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 11.2k, False: 507]
  |  |  ------------------
  |  |  158|  11.7k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  11.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  11.7k|}
  ------------------
  232|  11.7k|            u4_ldz = CLZ(u4_word);
  233|       |
  234|       |            /* Flush the ps_bitstrm */
  235|  11.7k|            u4_bitstream_offset += (u4_ldz + 1);
  236|       |
  237|       |            /* Read the suffix from the ps_bitstrm */
  238|  11.7k|            u4_word = 0;
  239|  11.7k|            if(u4_ldz)
  ------------------
  |  Branch (239:16): [True: 1.56k, False: 10.2k]
  ------------------
  240|  1.56k|            {
  241|  1.56k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  1.56k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  1.56k|{                                                                           \
  |  |  122|  1.56k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  1.56k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  1.56k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  1.56k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  1.56k|                                                                            \
  |  |  127|  1.56k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 1.47k, False: 96]
  |  |  ------------------
  |  |  128|  1.56k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  1.47k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  1.56k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  1.56k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  1.56k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  1.56k|}                                                                           \
  ------------------
  242|  1.56k|                        u4_ldz);
  243|  1.56k|            }
  244|       |
  245|  11.7k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  246|  11.7k|            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  247|       |
  248|  11.7k|            if(u4_word & 0x1)
  ------------------
  |  Branch (248:16): [True: 1.04k, False: 10.7k]
  ------------------
  249|  1.04k|            {
  250|  1.04k|                i4_delta_qp = (-(WORD32)u4_abs_val);
  251|  1.04k|            }
  252|  10.7k|            else
  253|  10.7k|            {
  254|  10.7k|                i4_delta_qp = (u4_abs_val);
  255|  10.7k|            }
  256|       |
  257|  11.7k|            if((i4_delta_qp < -26) || (i4_delta_qp > 25))
  ------------------
  |  Branch (257:16): [True: 96, False: 11.7k]
  |  Branch (257:39): [True: 124, False: 11.5k]
  ------------------
  258|    220|            {
  259|    220|                return ERROR_INV_RANGE_QP_T;
  260|    220|            }
  261|       |
  262|  11.5k|            COPYTHECONTEXT("mb_qp_delta", i1_delta_qp);
  263|  11.5k|            if(i4_delta_qp != 0)
  ------------------
  |  Branch (263:16): [True: 1.34k, False: 10.2k]
  ------------------
  264|  1.34k|            {
  265|  1.34k|                ret = ih264d_update_qp(ps_dec, (WORD8)i4_delta_qp);
  266|  1.34k|                if(ret != OK)
  ------------------
  |  |  114|  1.34k|#define OK        0
  ------------------
  |  Branch (266:20): [True: 0, False: 1.34k]
  ------------------
  267|      0|                    return ret;
  268|  1.34k|            }
  269|  11.5k|        }
  270|       |
  271|  12.3k|    }
  272|  43.0k|    else
  273|  43.0k|    {
  274|  43.0k|        u4_offset = 1;
  275|  43.0k|        ps_cur_mb_info->ps_curmb->u1_mb_type = I_16x16_MB;
  ------------------
  |  |  418|  43.0k|#define I_16x16_MB  1
  ------------------
  276|       |        /*-------------------------------------------------------------------*/
  277|       |        /* Read the IntraPrediction mode for CHROMA                          */
  278|       |        /*-------------------------------------------------------------------*/
  279|  43.0k|        {
  280|  43.0k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  281|  43.0k|            UWORD32 u4_word, u4_ldz;
  282|       |
  283|       |            /***************************************************************/
  284|       |            /* Find leading zeros in next 32 bits                          */
  285|       |            /***************************************************************/
  286|  43.0k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  43.0k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  43.0k|{                                                                           \
  |  |  152|  43.0k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  43.0k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  43.0k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  43.0k|                                                                            \
  |  |  156|  43.0k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  43.0k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 42.5k, False: 519]
  |  |  ------------------
  |  |  158|  43.0k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  42.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  43.0k|}
  ------------------
  287|  43.0k|            u4_ldz = CLZ(u4_word);
  288|       |            /* Flush the ps_bitstrm */
  289|  43.0k|            u4_bitstream_offset += (u4_ldz + 1);
  290|       |            /* Read the suffix from the ps_bitstrm */
  291|  43.0k|            u4_word = 0;
  292|  43.0k|            if(u4_ldz)
  ------------------
  |  Branch (292:16): [True: 9.18k, False: 33.9k]
  ------------------
  293|  9.18k|            {
  294|  9.18k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  9.18k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  9.18k|{                                                                           \
  |  |  122|  9.18k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  9.18k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  9.18k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  9.18k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  9.18k|                                                                            \
  |  |  127|  9.18k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 8.68k, False: 503]
  |  |  ------------------
  |  |  128|  9.18k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  8.68k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  9.18k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  9.18k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  9.18k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  9.18k|}                                                                           \
  ------------------
  295|  9.18k|                        u4_ldz);
  296|  9.18k|            }
  297|  43.0k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  298|  43.0k|            u4_temp = ((1 << u4_ldz) + u4_word - 1);
  299|       |
  300|       |//Inlined ih264d_uev
  301|       |
  302|  43.0k|            if(u4_temp > 3)
  ------------------
  |  Branch (302:16): [True: 685, False: 42.4k]
  ------------------
  303|    685|            {
  304|    685|                return ERROR_CHROMA_PRED_MODE;
  305|    685|            }
  306|  42.4k|            ps_cur_mb_info->u1_chroma_pred_mode = u4_temp;
  307|  42.4k|            COPYTHECONTEXT("intra_chroma_pred_mode", ps_cur_mb_info->u1_chroma_pred_mode);
  308|  42.4k|        }
  309|       |        /*-------------------------------------------------------------------*/
  310|       |        /* Read the Coded block pattern                                      */
  311|       |        /*-------------------------------------------------------------------*/
  312|      0|        u4_cbp = gau1_ih264d_cbp_tab[(u1_mb_type - 1) >> 2];
  313|  42.4k|        ps_cur_mb_info->u1_cbp = u4_cbp;
  314|       |
  315|       |        /*-------------------------------------------------------------------*/
  316|       |        /* Read mb_qp_delta                                                  */
  317|       |        /*-------------------------------------------------------------------*/
  318|  42.4k|        {
  319|  42.4k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  320|  42.4k|            UWORD32 u4_word, u4_ldz, u4_abs_val;
  321|       |
  322|       |            /***************************************************************/
  323|       |            /* Find leading zeros in next 32 bits                          */
  324|       |            /***************************************************************/
  325|  42.4k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  42.4k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  42.4k|{                                                                           \
  |  |  152|  42.4k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  42.4k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  42.4k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  42.4k|                                                                            \
  |  |  156|  42.4k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  42.4k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 41.8k, False: 577]
  |  |  ------------------
  |  |  158|  42.4k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  41.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  42.4k|}
  ------------------
  326|  42.4k|            u4_ldz = CLZ(u4_word);
  327|       |
  328|       |            /* Flush the ps_bitstrm */
  329|  42.4k|            u4_bitstream_offset += (u4_ldz + 1);
  330|       |
  331|       |            /* Read the suffix from the ps_bitstrm */
  332|  42.4k|            u4_word = 0;
  333|  42.4k|            if(u4_ldz)
  ------------------
  |  Branch (333:16): [True: 20.8k, False: 21.5k]
  ------------------
  334|  20.8k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  20.8k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  20.8k|{                                                                           \
  |  |  122|  20.8k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  20.8k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  20.8k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  20.8k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  20.8k|                                                                            \
  |  |  127|  20.8k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 19.2k, False: 1.61k]
  |  |  ------------------
  |  |  128|  20.8k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  19.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  20.8k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  20.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  20.8k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  20.8k|}                                                                           \
  ------------------
  335|  42.4k|                        u4_ldz);
  336|       |
  337|  42.4k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  338|  42.4k|            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  339|       |
  340|  42.4k|            if(u4_word & 0x1)
  ------------------
  |  Branch (340:16): [True: 12.6k, False: 29.7k]
  ------------------
  341|  12.6k|                i4_delta_qp = (-(WORD32)u4_abs_val);
  342|  29.7k|            else
  343|  29.7k|                i4_delta_qp = (u4_abs_val);
  344|       |
  345|  42.4k|            if((i4_delta_qp < -26) || (i4_delta_qp > 25))
  ------------------
  |  Branch (345:16): [True: 121, False: 42.2k]
  |  Branch (345:39): [True: 154, False: 42.1k]
  ------------------
  346|    275|                return ERROR_INV_RANGE_QP_T;
  347|       |
  348|  42.4k|        }
  349|       |//inlinined ih264d_sev
  350|  42.1k|        COPYTHECONTEXT("Delta quant", i1_delta_qp);
  351|       |
  352|  42.1k|        if(i4_delta_qp != 0)
  ------------------
  |  Branch (352:12): [True: 20.5k, False: 21.5k]
  ------------------
  353|  20.5k|        {
  354|  20.5k|            ret = ih264d_update_qp(ps_dec, (WORD8)i4_delta_qp);
  355|  20.5k|            if(ret != OK)
  ------------------
  |  |  114|  20.5k|#define OK        0
  ------------------
  |  Branch (355:16): [True: 0, False: 20.5k]
  ------------------
  356|      0|                return ret;
  357|  20.5k|        }
  358|       |
  359|  42.1k|        {
  360|  42.1k|            WORD16 i_scaleFactor;
  361|  42.1k|            UWORD32 ui_N = 0;
  362|  42.1k|            WORD16 *pi2_scale_matrix_ptr;
  363|       |            /*******************************************************************/
  364|       |            /* for luma DC coefficients the scaling is done during the parsing */
  365|       |            /* to preserve the precision                                       */
  366|       |            /*******************************************************************/
  367|  42.1k|            if(ps_dec->s_high_profile.u1_scaling_present)
  ------------------
  |  Branch (367:16): [True: 8.84k, False: 33.2k]
  ------------------
  368|  8.84k|            {
  369|  8.84k|                pi2_scale_matrix_ptr =
  370|  8.84k|                                ps_dec->s_high_profile.i2_scalinglist4x4[0];
  371|  8.84k|            }
  372|  33.2k|            else
  373|  33.2k|            {
  374|  33.2k|                i_scaleFactor = 16;
  375|  33.2k|                pi2_scale_matrix_ptr = &i_scaleFactor;
  376|  33.2k|            }
  377|       |
  378|       |            /*---------------------------------------------------------------*/
  379|       |            /* Decode DC coefficients                                        */
  380|       |            /*---------------------------------------------------------------*/
  381|       |            /*---------------------------------------------------------------*/
  382|       |            /* Calculation of N                                              */
  383|       |            /*---------------------------------------------------------------*/
  384|  42.1k|            if(ui_is_left_mb_available)
  ------------------
  |  Branch (384:16): [True: 28.2k, False: 13.8k]
  ------------------
  385|  28.2k|            {
  386|       |
  387|  28.2k|                if(ui_is_top_mb_available)
  ------------------
  |  Branch (387:20): [True: 22.0k, False: 6.25k]
  ------------------
  388|  22.0k|                {
  389|  22.0k|                    ui_N = ((ps_cur_mb_info->ps_top_mb->pu1_nnz_y[0]
  390|  22.0k|                                    + ps_dec->pu1_left_nnz_y[0] + 1) >> 1);
  391|  22.0k|                }
  392|  6.25k|                else
  393|  6.25k|                {
  394|  6.25k|                    ui_N = ps_dec->pu1_left_nnz_y[0];
  395|  6.25k|                }
  396|  28.2k|            }
  397|  13.8k|            else if(ui_is_top_mb_available)
  ------------------
  |  Branch (397:21): [True: 10.2k, False: 3.61k]
  ------------------
  398|  10.2k|            {
  399|  10.2k|                ui_N = ps_cur_mb_info->ps_top_mb->pu1_nnz_y[0];
  400|  10.2k|            }
  401|       |
  402|  42.1k|            {
  403|  42.1k|                WORD16 pi2_dc_coef[16];
  404|  42.1k|                WORD32 pi4_tmp[16];
  405|  42.1k|                tu_sblk4x4_coeff_data_t *ps_tu_4x4 =
  406|  42.1k|                                (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
  407|  42.1k|                WORD16 *pi2_coeff_block =
  408|  42.1k|                                (WORD16 *)ps_dec->pv_parse_tu_coeff_data;
  409|  42.1k|                UWORD32 u4_num_coeff;
  410|  42.1k|                ps_tu_4x4->u2_sig_coeff_map = 0;
  411|       |
  412|  42.1k|                ret = ps_dec->pf_cavlc_parse4x4coeff[(ui_N > 7)](pi2_dc_coef, 0, ui_N,
  413|  42.1k|                                                                 ps_dec, &u4_num_coeff);
  414|  42.1k|                if(ret != OK)
  ------------------
  |  |  114|  42.1k|#define OK        0
  ------------------
  |  Branch (414:20): [True: 223, False: 41.9k]
  ------------------
  415|    223|                    return ret;
  416|       |
  417|  41.9k|                if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|  41.9k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 222, False: 41.6k]
  |  |  ------------------
  ------------------
  418|    222|                    return ERROR_EOB_TERMINATE_T;
  419|  41.6k|                if(ps_tu_4x4->u2_sig_coeff_map)
  ------------------
  |  Branch (419:20): [True: 11.0k, False: 30.6k]
  ------------------
  420|  11.0k|                {
  421|  11.0k|                    memset(pi2_dc_coef,0,sizeof(pi2_dc_coef));
  422|  11.0k|                    ih264d_unpack_coeff4x4_dc_4x4blk(ps_tu_4x4,
  423|  11.0k|                                                     pi2_dc_coef,
  424|  11.0k|                                                     ps_dec->pu1_inv_scan);
  425|       |
  426|  11.0k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  11.0k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
  427|  11.0k|                    ps_dec->pf_ihadamard_scaling_4x4(pi2_dc_coef,
  428|  11.0k|                                                     pi2_coeff_block,
  429|  11.0k|                                                     ps_dec->pu2_quant_scale_y,
  430|  11.0k|                                                     (UWORD16 *)pi2_scale_matrix_ptr,
  431|  11.0k|                                                     ps_dec->u1_qp_y_div6,
  432|  11.0k|                                                     pi4_tmp);
  433|  11.0k|                    pi2_coeff_block += 16;
  434|  11.0k|                    ps_dec->pv_parse_tu_coeff_data = (void *)pi2_coeff_block;
  435|  11.0k|                    SET_BIT(ps_cur_mb_info->u1_yuv_dc_block_flag,0);
  ------------------
  |  |  106|  11.0k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  436|  11.0k|                }
  437|       |
  438|  41.6k|            }
  439|  41.6k|        }
  440|  41.6k|    }
  441|       |
  442|       |
  443|  53.7k|    if(u4_cbp)
  ------------------
  |  Branch (443:8): [True: 30.1k, False: 23.6k]
  ------------------
  444|  30.1k|    {
  445|       |
  446|  30.1k|        ret = ih264d_parse_residual4x4_cavlc(ps_dec, ps_cur_mb_info,
  447|  30.1k|                                       (UWORD8)u4_offset);
  448|  30.1k|        if(ret != OK)
  ------------------
  |  |  114|  30.1k|#define OK        0
  ------------------
  |  Branch (448:12): [True: 1.48k, False: 28.6k]
  ------------------
  449|  1.48k|            return ret;
  450|  28.6k|        if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|  28.6k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 493, False: 28.1k]
  |  |  ------------------
  ------------------
  451|    493|            return ERROR_EOB_TERMINATE_T;
  452|       |
  453|       |        /* Store Left Mb NNZ and TOP chroma NNZ */
  454|  28.6k|    }
  455|  23.6k|    else
  456|  23.6k|    {
  457|  23.6k|        ps_cur_mb_info->u1_qp_div6 = ps_dec->u1_qp_y_div6;
  458|  23.6k|        ps_cur_mb_info->u1_qpc_div6 = ps_dec->u1_qp_u_div6;
  459|  23.6k|        ps_cur_mb_info->u1_qpcr_div6 = ps_dec->u1_qp_v_div6;
  460|  23.6k|        ps_cur_mb_info->u1_qp_rem6 = ps_dec->u1_qp_y_rem6;
  461|  23.6k|        ps_cur_mb_info->u1_qpc_rem6 = ps_dec->u1_qp_u_rem6;
  462|  23.6k|        ps_cur_mb_info->u1_qpcr_rem6 = ps_dec->u1_qp_v_rem6;
  463|  23.6k|        ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|  23.6k|#define CAVLC  0
  ------------------
  464|  23.6k|    }
  465|       |
  466|  51.8k|    return OK;
  ------------------
  |  |  114|  51.8k|#define OK        0
  ------------------
  467|  53.7k|}
ih264d_parse_imb_cabac:
  485|  79.1k|{
  486|  79.1k|    WORD8 i1_delta_qp;
  487|  79.1k|    UWORD8 u1_cbp;
  488|  79.1k|    UWORD8 u1_offset;
  489|       |    /* Variables for handling Cabac contexts */
  490|  79.1k|    ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
  491|  79.1k|    ctxt_inc_mb_info_t *ps_left_ctxt = ps_dec->p_left_ctxt_mb_info;
  492|  79.1k|    dec_bit_stream_t * const ps_bitstrm = ps_dec->ps_bitstrm;
  493|  79.1k|    bin_ctxt_model_t *p_bin_ctxt;
  494|       |
  495|  79.1k|    UWORD8 u1_intra_chrom_pred_mode;
  496|  79.1k|    UWORD8 u1_dc_block_flag = 0;
  497|  79.1k|    WORD32 ret;
  498|       |
  499|  79.1k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  500|       |
  501|  79.1k|    if(ps_left_ctxt == ps_dec->ps_def_ctxt_mb_info)
  ------------------
  |  Branch (501:8): [True: 16.7k, False: 62.3k]
  ------------------
  502|  16.7k|    {
  503|  16.7k|        ps_dec->pu1_left_yuv_dc_csbp[0] = 0xf;
  504|  16.7k|    }
  505|       |
  506|  79.1k|    if(ps_dec->ps_cur_slice->u1_slice_type != I_SLICE)
  ------------------
  |  |  370|  79.1k|#define I_SLICE  2
  ------------------
  |  Branch (506:8): [True: 5.61k, False: 73.5k]
  ------------------
  507|  5.61k|    {
  508|  5.61k|        WORD32 *pi4_buf;
  509|  5.61k|        WORD8 *pi1_buf;
  510|  5.61k|        MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
  ------------------
  |  |  652|  5.61k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  5.61k|{                                                               \
  |  |  654|  5.61k|    memset(pu4_start,value,16);                                 \
  |  |  655|  5.61k|}
  ------------------
  511|  5.61k|        *((UWORD32 *)ps_dec->pi1_left_ref_idx_ctxt_inc) = 0;
  512|  5.61k|        MEMSET_16BYTES(p_curr_ctxt->u1_mv, 0);
  ------------------
  |  |  652|  5.61k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  5.61k|{                                                               \
  |  |  654|  5.61k|    memset(pu4_start,value,16);                                 \
  |  |  655|  5.61k|}
  ------------------
  513|  5.61k|        memset(p_curr_ctxt->i1_ref_idx, 0, 4);
  514|  5.61k|    }
  515|       |
  516|  79.1k|    if(u1_mb_type == I_4x4_MB)
  ------------------
  |  |  417|  79.1k|#define I_4x4_MB    0
  ------------------
  |  Branch (516:8): [True: 40.2k, False: 38.9k]
  ------------------
  517|  40.2k|    {
  518|  40.2k|        ps_cur_mb_info->ps_curmb->u1_mb_type = I_4x4_MB;
  ------------------
  |  |  417|  40.2k|#define I_4x4_MB    0
  ------------------
  519|  40.2k|        p_curr_ctxt->u1_mb_type = CAB_I4x4;
  ------------------
  |  |  394|  40.2k|#define CAB_I4x4          0x00 /* 0000 00x0 */
  ------------------
  520|  40.2k|        u1_offset = 0;
  521|       |
  522|  40.2k|        ps_cur_mb_info->u1_tran_form8x8 = 0;
  523|  40.2k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  524|       |
  525|       |        /*--------------------------------------------------------------------*/
  526|       |        /* Read transform_size_8x8_flag if present                            */
  527|       |        /*--------------------------------------------------------------------*/
  528|  40.2k|        if(ps_dec->s_high_profile.u1_transform8x8_present)
  ------------------
  |  Branch (528:12): [True: 24.2k, False: 15.9k]
  ------------------
  529|  24.2k|        {
  530|  24.2k|            ps_cur_mb_info->u1_tran_form8x8 = ih264d_parse_transform8x8flag_cabac(
  531|  24.2k|                            ps_dec, ps_cur_mb_info);
  532|  24.2k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  533|  24.2k|            p_curr_ctxt->u1_transform8x8_ctxt = ps_cur_mb_info->u1_tran_form8x8;
  534|  24.2k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  535|  24.2k|        }
  536|  15.9k|        else
  537|  15.9k|        {
  538|  15.9k|            p_curr_ctxt->u1_transform8x8_ctxt = 0;
  539|  15.9k|        }
  540|       |
  541|       |        /*--------------------------------------------------------------------*/
  542|       |        /* Read the IntraPrediction modes for LUMA                            */
  543|       |        /*--------------------------------------------------------------------*/
  544|  40.2k|        if (!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (544:13): [True: 16.6k, False: 23.6k]
  ------------------
  545|  16.6k|        {
  546|  16.6k|            UWORD8 *pu1_temp;
  547|  16.6k|            ih264d_read_intra_pred_modes_cabac(
  548|  16.6k|                            ps_dec,
  549|  16.6k|                            ((UWORD8 *)ps_dec->pv_parse_tu_coeff_data),
  550|  16.6k|                            ((UWORD8 *)ps_dec->pv_parse_tu_coeff_data+16),
  551|  16.6k|                            ps_cur_mb_info->u1_tran_form8x8);
  552|  16.6k|            pu1_temp = (UWORD8 *)ps_dec->pv_parse_tu_coeff_data;
  553|  16.6k|            pu1_temp += 32;
  554|  16.6k|            ps_dec->pv_parse_tu_coeff_data = (void *)pu1_temp;
  555|  16.6k|        }
  556|  23.6k|        else
  557|  23.6k|        {
  558|  23.6k|            UWORD8 *pu1_temp;
  559|  23.6k|            ih264d_read_intra_pred_modes_cabac(
  560|  23.6k|                            ps_dec,
  561|  23.6k|                            ((UWORD8 *)ps_dec->pv_parse_tu_coeff_data),
  562|  23.6k|                            ((UWORD8 *)ps_dec->pv_parse_tu_coeff_data+4),
  563|  23.6k|                            ps_cur_mb_info->u1_tran_form8x8);
  564|  23.6k|            pu1_temp = (UWORD8 *)ps_dec->pv_parse_tu_coeff_data;
  565|  23.6k|            pu1_temp += 8;
  566|  23.6k|            ps_dec->pv_parse_tu_coeff_data = (void *)pu1_temp;
  567|  23.6k|        }
  568|       |        /*--------------------------------------------------------------------*/
  569|       |        /* Read the IntraPrediction mode for CHROMA                           */
  570|       |        /*--------------------------------------------------------------------*/
  571|  40.2k|        u1_intra_chrom_pred_mode = ih264d_parse_chroma_pred_mode_cabac(ps_dec);
  572|  40.2k|        COPYTHECONTEXT("intra_chroma_pred_mode", u1_intra_chrom_pred_mode);
  573|  40.2k|        p_curr_ctxt->u1_intra_chroma_pred_mode = ps_cur_mb_info->u1_chroma_pred_mode =
  574|  40.2k|                        u1_intra_chrom_pred_mode;
  575|       |
  576|       |        /*--------------------------------------------------------------------*/
  577|       |        /* Read the Coded block pattern                                       */
  578|       |        /*--------------------------------------------------------------------*/
  579|  40.2k|        u1_cbp = ih264d_parse_ctx_cbp_cabac(ps_dec);
  580|  40.2k|        COPYTHECONTEXT("coded_block_pattern", u1_cbp);
  581|  40.2k|        ps_cur_mb_info->u1_cbp = u1_cbp;
  582|  40.2k|        p_curr_ctxt->u1_cbp = u1_cbp;
  583|       |
  584|       |        /*--------------------------------------------------------------------*/
  585|       |        /* Read mb_qp_delta                                                   */
  586|       |        /*--------------------------------------------------------------------*/
  587|  40.2k|        if(ps_cur_mb_info->u1_cbp)
  ------------------
  |  Branch (587:12): [True: 28.4k, False: 11.7k]
  ------------------
  588|  28.4k|        {
  589|  28.4k|            ret = ih264d_parse_mb_qp_delta_cabac(ps_dec, &i1_delta_qp);
  590|  28.4k|            if(ret != OK)
  ------------------
  |  |  114|  28.4k|#define OK        0
  ------------------
  |  Branch (590:16): [True: 107, False: 28.3k]
  ------------------
  591|    107|                return ret;
  592|  28.3k|            COPYTHECONTEXT("mb_qp_delta", i1_delta_qp);
  593|  28.3k|            if(i1_delta_qp != 0)
  ------------------
  |  Branch (593:16): [True: 4.94k, False: 23.4k]
  ------------------
  594|  4.94k|            {
  595|  4.94k|                ret = ih264d_update_qp(ps_dec, i1_delta_qp);
  596|  4.94k|                if(ret != OK)
  ------------------
  |  |  114|  4.94k|#define OK        0
  ------------------
  |  Branch (596:20): [True: 0, False: 4.94k]
  ------------------
  597|      0|                    return ret;
  598|  4.94k|            }
  599|  28.3k|        }
  600|  11.7k|        else
  601|  11.7k|            ps_dec->i1_prev_mb_qp_delta = 0;
  602|  40.1k|        p_curr_ctxt->u1_yuv_dc_csbp &= 0xFE;
  603|  40.1k|    }
  604|  38.9k|    else
  605|  38.9k|    {
  606|  38.9k|        u1_offset = 1;
  607|  38.9k|        ps_cur_mb_info->ps_curmb->u1_mb_type = I_16x16_MB;
  ------------------
  |  |  418|  38.9k|#define I_16x16_MB  1
  ------------------
  608|  38.9k|        p_curr_ctxt->u1_mb_type = CAB_I16x16;
  ------------------
  |  |  395|  38.9k|#define CAB_I16x16        0x01 /* 0000 00x1 */
  ------------------
  609|  38.9k|        ps_cur_mb_info->u1_tran_form8x8 = 0;
  610|  38.9k|        p_curr_ctxt->u1_transform8x8_ctxt = 0;
  611|  38.9k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  612|       |        /*--------------------------------------------------------------------*/
  613|       |        /* Read the IntraPrediction mode for CHROMA                           */
  614|       |        /*--------------------------------------------------------------------*/
  615|  38.9k|        u1_intra_chrom_pred_mode = ih264d_parse_chroma_pred_mode_cabac(ps_dec);
  616|  38.9k|        if(u1_intra_chrom_pred_mode > 3)
  ------------------
  |  Branch (616:12): [True: 0, False: 38.9k]
  ------------------
  617|      0|            return ERROR_CHROMA_PRED_MODE;
  618|       |
  619|  38.9k|        COPYTHECONTEXT("Chroma intra_chroma_pred_mode pred mode", u1_intra_chrom_pred_mode);
  620|  38.9k|        p_curr_ctxt->u1_intra_chroma_pred_mode = ps_cur_mb_info->u1_chroma_pred_mode =
  621|  38.9k|                        u1_intra_chrom_pred_mode;
  622|       |
  623|       |        /*--------------------------------------------------------------------*/
  624|       |        /* Read the Coded block pattern                                       */
  625|       |        /*--------------------------------------------------------------------*/
  626|  38.9k|        u1_cbp = gau1_ih264d_cbp_tab[(u1_mb_type - 1) >> 2];
  627|  38.9k|        ps_cur_mb_info->u1_cbp = u1_cbp;
  628|  38.9k|        p_curr_ctxt->u1_cbp = u1_cbp;
  629|       |
  630|       |        /*--------------------------------------------------------------------*/
  631|       |        /* Read mb_qp_delta                                                   */
  632|       |        /*--------------------------------------------------------------------*/
  633|  38.9k|        ret = ih264d_parse_mb_qp_delta_cabac(ps_dec, &i1_delta_qp);
  634|  38.9k|        if(ret != OK)
  ------------------
  |  |  114|  38.9k|#define OK        0
  ------------------
  |  Branch (634:12): [True: 69, False: 38.8k]
  ------------------
  635|     69|            return ret;
  636|  38.8k|        COPYTHECONTEXT("mb_qp_delta", i1_delta_qp);
  637|  38.8k|        if(i1_delta_qp != 0)
  ------------------
  |  Branch (637:12): [True: 5.87k, False: 33.0k]
  ------------------
  638|  5.87k|        {
  639|  5.87k|            ret = ih264d_update_qp(ps_dec, i1_delta_qp);
  640|  5.87k|            if(ret != OK)
  ------------------
  |  |  114|  5.87k|#define OK        0
  ------------------
  |  Branch (640:16): [True: 0, False: 5.87k]
  ------------------
  641|      0|                return ret;
  642|  5.87k|        }
  643|       |
  644|  38.8k|        {
  645|  38.8k|            WORD16 i_scaleFactor;
  646|  38.8k|            WORD16* pi2_scale_matrix_ptr;
  647|       |            /*******************************************************************/
  648|       |            /* for luma DC coefficients the scaling is done during the parsing */
  649|       |            /* to preserve the precision                                       */
  650|       |            /*******************************************************************/
  651|  38.8k|            if(ps_dec->s_high_profile.u1_scaling_present)
  ------------------
  |  Branch (651:16): [True: 1.06k, False: 37.8k]
  ------------------
  652|  1.06k|            {
  653|  1.06k|                pi2_scale_matrix_ptr =
  654|  1.06k|                                ps_dec->s_high_profile.i2_scalinglist4x4[0];
  655|       |
  656|  1.06k|            }
  657|  37.8k|            else
  658|  37.8k|            {
  659|  37.8k|                i_scaleFactor = 16;
  660|  37.8k|                pi2_scale_matrix_ptr = &i_scaleFactor;
  661|  37.8k|            }
  662|  38.8k|            {
  663|  38.8k|                ctxt_inc_mb_info_t *ps_top_ctxt = ps_dec->p_top_ctxt_mb_info;
  664|  38.8k|                UWORD8 uc_a, uc_b;
  665|  38.8k|                UWORD32 u4_ctx_inc;
  666|       |
  667|  38.8k|                INC_SYM_COUNT(&(ps_dec->s_cab_dec_env));
  668|       |
  669|       |                /* if MbAddrN not available then CondTermN = 1 */
  670|  38.8k|                uc_b = ((ps_top_ctxt->u1_yuv_dc_csbp) & 0x01);
  671|       |
  672|       |                /* if MbAddrN not available then CondTermN = 1 */
  673|  38.8k|                uc_a = ((ps_dec->pu1_left_yuv_dc_csbp[0]) & 0x01);
  674|       |
  675|  38.8k|                u4_ctx_inc = (uc_a + (uc_b << 1));
  676|       |
  677|  38.8k|                {
  678|  38.8k|                    WORD16 pi2_dc_coef[16];
  679|  38.8k|                    tu_sblk4x4_coeff_data_t *ps_tu_4x4 =
  680|  38.8k|                                    (tu_sblk4x4_coeff_data_t *)ps_dec->pv_parse_tu_coeff_data;
  681|  38.8k|                    WORD16 *pi2_coeff_block =
  682|  38.8k|                                    (WORD16 *)ps_dec->pv_parse_tu_coeff_data;
  683|       |
  684|  38.8k|                    p_bin_ctxt = (ps_dec->p_cbf_t[LUMA_DC_CTXCAT]) + u4_ctx_inc;
  ------------------
  |  |   71|  38.8k|#define LUMA_DC_CTXCAT    0
  ------------------
  685|       |
  686|  38.8k|                    u1_dc_block_flag =
  687|  38.8k|                                    ih264d_read_coeff4x4_cabac(ps_bitstrm,
  688|  38.8k|                                                    LUMA_DC_CTXCAT,
  ------------------
  |  |   71|  38.8k|#define LUMA_DC_CTXCAT    0
  ------------------
  689|  38.8k|                                                    ps_dec->p_significant_coeff_flag_t[LUMA_DC_CTXCAT],
  ------------------
  |  |   71|  38.8k|#define LUMA_DC_CTXCAT    0
  ------------------
  690|  38.8k|                                                    ps_dec, p_bin_ctxt);
  691|       |
  692|       |                    /* Store coded_block_flag */
  693|  38.8k|                    p_curr_ctxt->u1_yuv_dc_csbp &= 0xFE;
  694|  38.8k|                    p_curr_ctxt->u1_yuv_dc_csbp |= u1_dc_block_flag;
  695|  38.8k|                    if(u1_dc_block_flag)
  ------------------
  |  Branch (695:24): [True: 23.5k, False: 15.3k]
  ------------------
  696|  23.5k|                    {
  697|  23.5k|                        WORD32 pi4_tmp[16];
  698|  23.5k|                        memset(pi2_dc_coef,0,sizeof(pi2_dc_coef));
  699|  23.5k|                        ih264d_unpack_coeff4x4_dc_4x4blk(ps_tu_4x4,
  700|  23.5k|                                                         pi2_dc_coef,
  701|  23.5k|                                                         ps_dec->pu1_inv_scan);
  702|       |
  703|  23.5k|                        PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  23.5k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
  704|  23.5k|                        ps_dec->pf_ihadamard_scaling_4x4(pi2_dc_coef,
  705|  23.5k|                                                         pi2_coeff_block,
  706|  23.5k|                                                         ps_dec->pu2_quant_scale_y,
  707|  23.5k|                                                         (UWORD16 *)pi2_scale_matrix_ptr,
  708|  23.5k|                                                         ps_dec->u1_qp_y_div6,
  709|  23.5k|                                                         pi4_tmp);
  710|  23.5k|                        pi2_coeff_block += 16;
  711|  23.5k|                        ps_dec->pv_parse_tu_coeff_data = (void *)pi2_coeff_block;
  712|  23.5k|                        SET_BIT(ps_cur_mb_info->u1_yuv_dc_block_flag,0);
  ------------------
  |  |  106|  23.5k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  713|  23.5k|                    }
  714|       |
  715|  38.8k|                }
  716|       |
  717|  38.8k|            }
  718|  38.8k|        }
  719|  38.8k|    }
  720|       |
  721|  79.0k|    ps_dec->pu1_left_yuv_dc_csbp[0] &= 0x6;
  722|  79.0k|    ps_dec->pu1_left_yuv_dc_csbp[0] |= u1_dc_block_flag;
  723|       |
  724|  79.0k|    ih264d_parse_residual4x4_cabac(ps_dec, ps_cur_mb_info, u1_offset);
  725|  79.0k|    if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|  79.0k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 2.81k, False: 76.1k]
  |  |  ------------------
  ------------------
  726|  2.81k|        return ERROR_EOB_TERMINATE_T;
  727|  76.1k|    return OK;
  ------------------
  |  |  114|  76.1k|#define OK        0
  ------------------
  728|  79.0k|}
ih264d_parse_ipcm_mb:
 1215|  2.70k|{
 1216|  2.70k|    dec_bit_stream_t * const ps_bitstrm = ps_dec->ps_bitstrm;
 1217|  2.70k|    UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 1218|  2.70k|    UWORD8 *pu1_y, *pu1_u, *pu1_v;
 1219|  2.70k|    WORD32 ret;
 1220|       |
 1221|  2.70k|    UWORD32 u4_rec_width_y, u4_rec_width_uv;
 1222|  2.70k|    UWORD32 u1_num_mb_pair;
 1223|  2.70k|    UWORD8 u1_x, u1_y;
 1224|       |    /* CHANGED CODE */
 1225|  2.70k|    tfr_ctxt_t *ps_frame_buf;
 1226|  2.70k|    UWORD8 u1_mb_field_decoding_flag;
 1227|  2.70k|    UWORD32 *pu4_buf;
 1228|  2.70k|    UWORD8 *pu1_buf;
 1229|       |    /* CHANGED CODE */
 1230|       |
 1231|  2.70k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1231:8): [True: 1.16k, False: 1.53k]
  ------------------
 1232|  1.16k|    {
 1233|  1.16k|        ps_frame_buf = &ps_dec->s_tran_addrecon_parse;
 1234|  1.16k|    }
 1235|  1.53k|    else
 1236|  1.53k|    {
 1237|  1.53k|        ps_frame_buf = &ps_dec->s_tran_addrecon;
 1238|  1.53k|    }
 1239|       |    /* align bistream to byte boundary. */
 1240|       |    /* pcm_alignment_zero_bit discarded */
 1241|       |    /* For XX GotoByteBoundary */
 1242|  2.70k|    if(ps_bitstrm->u4_ofst & 0x07)
  ------------------
  |  Branch (1242:8): [True: 2.45k, False: 254]
  ------------------
 1243|  2.45k|    {
 1244|  2.45k|        ps_bitstrm->u4_ofst += 8;
 1245|  2.45k|        ps_bitstrm->u4_ofst &= 0xFFFFFFF8;
 1246|  2.45k|    }
 1247|       |
 1248|       |    /*  Store left Nnz as 16 for each 4x4 blk */
 1249|       |
 1250|  2.70k|    pu1_buf = ps_dec->pu1_left_nnz_y;
 1251|  2.70k|    pu4_buf = (UWORD32 *)pu1_buf;
 1252|  2.70k|    *pu4_buf = 0x10101010;
 1253|  2.70k|    pu1_buf = ps_cur_mb_info->ps_curmb->pu1_nnz_y;
 1254|  2.70k|    pu4_buf = (UWORD32 *)pu1_buf;
 1255|  2.70k|    *pu4_buf = 0x10101010;
 1256|  2.70k|    pu1_buf = ps_cur_mb_info->ps_curmb->pu1_nnz_uv;
 1257|  2.70k|    pu4_buf = (UWORD32 *)pu1_buf;
 1258|  2.70k|    *pu4_buf = 0x10101010;
 1259|  2.70k|    pu1_buf = ps_dec->pu1_left_nnz_uv;
 1260|  2.70k|    pu4_buf = (UWORD32 *)pu1_buf;
 1261|  2.70k|    *pu4_buf = 0x10101010;
 1262|  2.70k|    ps_cur_mb_info->u1_cbp = 0xff;
 1263|       |
 1264|  2.70k|    ps_dec->i1_prev_mb_qp_delta = 0;
 1265|       |    /* Get neighbour MB's */
 1266|  2.70k|    u1_num_mb_pair = (u4_mbNum >> u1_mbaff);
 1267|       |
 1268|       |    /*****************************************************************************/
 1269|       |    /* calculate the RECON buffer YUV pointers for the PCM data                  */
 1270|       |    /*****************************************************************************/
 1271|       |    /* CHANGED CODE  */
 1272|  2.70k|    u1_mb_field_decoding_flag = ps_cur_mb_info->u1_mb_field_decodingflag;
 1273|  2.70k|    pu1_y = ps_frame_buf->pu1_dest_y + (u1_num_mb_pair << 4);
 1274|  2.70k|    pu1_u = ps_frame_buf->pu1_dest_u + (u1_num_mb_pair << 4);
 1275|  2.70k|    pu1_v = pu1_u + 1;
 1276|       |
 1277|  2.70k|    u4_rec_width_y = ps_dec->u2_frm_wd_y << u1_mb_field_decoding_flag;
 1278|  2.70k|    u4_rec_width_uv = ps_dec->u2_frm_wd_uv << u1_mb_field_decoding_flag;
 1279|       |    /* CHANGED CODE  */
 1280|       |
 1281|  2.70k|    if(u1_mbaff)
  ------------------
  |  Branch (1281:8): [True: 0, False: 2.70k]
  ------------------
 1282|      0|    {
 1283|      0|        UWORD8 u1_top_mb;
 1284|       |
 1285|      0|        u1_top_mb = ps_cur_mb_info->u1_topmb;
 1286|       |
 1287|      0|        if(u1_top_mb == 0)
  ------------------
  |  Branch (1287:12): [True: 0, False: 0]
  ------------------
 1288|      0|        {
 1289|      0|            pu1_y += (u1_mb_field_decoding_flag ?
  ------------------
  |  Branch (1289:23): [True: 0, False: 0]
  ------------------
 1290|      0|                            (u4_rec_width_y >> 1) : (u4_rec_width_y << 4));
 1291|      0|            pu1_u += (u1_mb_field_decoding_flag ?
  ------------------
  |  Branch (1291:23): [True: 0, False: 0]
  ------------------
 1292|      0|                            (u4_rec_width_uv) : (u4_rec_width_uv << 4));
 1293|      0|            pu1_v = pu1_u + 1;
 1294|      0|        }
 1295|      0|    }
 1296|       |
 1297|       |    /* Read Luma samples */
 1298|  45.9k|    for(u1_y = 0; u1_y < 16; u1_y++)
  ------------------
  |  Branch (1298:19): [True: 43.2k, False: 2.70k]
  ------------------
 1299|  43.2k|    {
 1300|   735k|        for(u1_x = 0; u1_x < 16; u1_x++)
  ------------------
  |  Branch (1300:23): [True: 692k, False: 43.2k]
  ------------------
 1301|   692k|            pu1_y[u1_x] = ih264d_get_bits_h264(ps_bitstrm, 8);
 1302|       |
 1303|  43.2k|        pu1_y += u4_rec_width_y;
 1304|  43.2k|    }
 1305|       |
 1306|       |    /* Read Chroma samples */
 1307|  24.3k|    for(u1_y = 0; u1_y < 8; u1_y++)
  ------------------
  |  Branch (1307:19): [True: 21.6k, False: 2.70k]
  ------------------
 1308|  21.6k|    {
 1309|   194k|        for(u1_x = 0; u1_x < 8; u1_x++)
  ------------------
  |  Branch (1309:23): [True: 173k, False: 21.6k]
  ------------------
 1310|   173k|            pu1_u[u1_x * YUV420SP_FACTOR] = ih264d_get_bits_h264(ps_bitstrm, 8);
  ------------------
  |  |  119|   173k|#define YUV420SP_FACTOR 2
  ------------------
 1311|       |
 1312|  21.6k|        pu1_u += u4_rec_width_uv;
 1313|  21.6k|    }
 1314|       |
 1315|  24.3k|    for(u1_y = 0; u1_y < 8; u1_y++)
  ------------------
  |  Branch (1315:19): [True: 21.6k, False: 2.70k]
  ------------------
 1316|  21.6k|    {
 1317|   194k|        for(u1_x = 0; u1_x < 8; u1_x++)
  ------------------
  |  Branch (1317:23): [True: 173k, False: 21.6k]
  ------------------
 1318|   173k|            pu1_v[u1_x * YUV420SP_FACTOR] = ih264d_get_bits_h264(ps_bitstrm, 8);
  ------------------
  |  |  119|   173k|#define YUV420SP_FACTOR 2
  ------------------
 1319|       |
 1320|  21.6k|        pu1_v += u4_rec_width_uv;
 1321|  21.6k|    }
 1322|       |
 1323|  2.70k|    if(CABAC == ps_dec->ps_cur_pps->u1_entropy_coding_mode)
  ------------------
  |  |  339|  2.70k|#define CABAC  1
  ------------------
  |  Branch (1323:8): [True: 1.32k, False: 1.38k]
  ------------------
 1324|  1.32k|    {
 1325|  1.32k|        UWORD32 *pu4_buf;
 1326|  1.32k|        UWORD8 *pu1_buf;
 1327|  1.32k|        ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
 1328|       |        /* Re-initialize the cabac decoding engine. */
 1329|  1.32k|        ret = ih264d_init_cabac_dec_envirnoment(&(ps_dec->s_cab_dec_env), ps_bitstrm);
 1330|  1.32k|        if(ret != OK)
  ------------------
  |  |  114|  1.32k|#define OK        0
  ------------------
  |  Branch (1330:12): [True: 734, False: 587]
  ------------------
 1331|    734|            return ret;
 1332|       |        /* update the cabac contetxs */
 1333|    587|        p_curr_ctxt->u1_mb_type = CAB_I_PCM;
  ------------------
  |  |  407|    587|#define CAB_I_PCM         0x20 /* 001x xxxx */
  ------------------
 1334|    587|        p_curr_ctxt->u1_cbp = 47;
 1335|    587|        p_curr_ctxt->u1_intra_chroma_pred_mode = 0;
 1336|    587|        p_curr_ctxt->u1_transform8x8_ctxt = 0;
 1337|    587|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
 1338|       |
 1339|    587|        pu1_buf = ps_dec->pu1_left_nnz_y;
 1340|    587|        pu4_buf = (UWORD32 *)pu1_buf;
 1341|    587|        *pu4_buf = 0x01010101;
 1342|       |
 1343|    587|        pu1_buf = ps_cur_mb_info->ps_curmb->pu1_nnz_y;
 1344|    587|        pu4_buf = (UWORD32 *)pu1_buf;
 1345|    587|        *pu4_buf = 0x01010101;
 1346|       |
 1347|    587|        pu1_buf = ps_cur_mb_info->ps_curmb->pu1_nnz_uv;
 1348|    587|        pu4_buf = (UWORD32 *)pu1_buf;
 1349|    587|        *pu4_buf = 0x01010101;
 1350|       |
 1351|    587|        pu1_buf = ps_dec->pu1_left_nnz_uv;
 1352|    587|        pu4_buf = (UWORD32 *)pu1_buf;
 1353|    587|        *pu4_buf = 0x01010101;
 1354|       |
 1355|    587|        p_curr_ctxt->u1_yuv_dc_csbp = 0x7;
 1356|    587|        ps_dec->pu1_left_yuv_dc_csbp[0] = 0x7;
 1357|    587|        if(ps_dec->ps_cur_slice->u1_slice_type != I_SLICE)
  ------------------
  |  |  370|    587|#define I_SLICE  2
  ------------------
  |  Branch (1357:12): [True: 102, False: 485]
  ------------------
 1358|    102|        {
 1359|       |
 1360|    102|            MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
  ------------------
  |  |  652|    102|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|    102|{                                                               \
  |  |  654|    102|    memset(pu4_start,value,16);                                 \
  |  |  655|    102|}
  ------------------
 1361|    102|            memset(ps_dec->pi1_left_ref_idx_ctxt_inc, 0, 4);
 1362|    102|            MEMSET_16BYTES(p_curr_ctxt->u1_mv, 0);
  ------------------
  |  |  652|    102|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|    102|{                                                               \
  |  |  654|    102|    memset(pu4_start,value,16);                                 \
  |  |  655|    102|}
  ------------------
 1363|    102|            memset(p_curr_ctxt->i1_ref_idx, 0, 4);
 1364|       |
 1365|    102|        }
 1366|    587|    }
 1367|  1.97k|    return OK;
  ------------------
  |  |  114|  1.97k|#define OK        0
  ------------------
 1368|  2.70k|}

ih264d_parse_mb_type_intra_cabac:
   70|  89.6k|{
   71|  89.6k|    decoding_envirnoment_t * ps_cab_env = &ps_dec->s_cab_dec_env;
   72|  89.6k|    dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
   73|  89.6k|    ctxt_inc_mb_info_t * ps_left_ctxt = ps_dec->p_left_ctxt_mb_info;
   74|  89.6k|    ctxt_inc_mb_info_t * ps_top_ctxt = ps_dec->p_top_ctxt_mb_info;
   75|  89.6k|    bin_ctxt_model_t *ps_mb_bin_ctxt = ps_dec->p_mb_type_t;
   76|  89.6k|    WORD8 u1_mb_type, u1_bin;
   77|  89.6k|    UWORD32 u4_cxt_inc;
   78|       |
   79|  89.6k|    u4_cxt_inc = 0;
   80|  89.6k|    if(!u1_inter)
  ------------------
  |  Branch (80:8): [True: 81.5k, False: 8.12k]
  ------------------
   81|  81.5k|    {
   82|  81.5k|        if(ps_left_ctxt != ps_dec->ps_def_ctxt_mb_info)
  ------------------
  |  Branch (82:12): [True: 64.6k, False: 16.8k]
  ------------------
   83|  64.6k|            u4_cxt_inc += ((ps_left_ctxt->u1_mb_type != CAB_I4x4) ? 1 : 0);
  ------------------
  |  |  394|  64.6k|#define CAB_I4x4          0x00 /* 0000 00x0 */
  ------------------
  |  Branch (83:28): [True: 36.3k, False: 28.2k]
  ------------------
   84|  81.5k|        if(ps_top_ctxt != ps_dec->ps_def_ctxt_mb_info)
  ------------------
  |  Branch (84:12): [True: 59.1k, False: 22.3k]
  ------------------
   85|  59.1k|            u4_cxt_inc += ((ps_top_ctxt->u1_mb_type != CAB_I4x4) ? 1 : 0);
  ------------------
  |  |  394|  59.1k|#define CAB_I4x4          0x00 /* 0000 00x0 */
  ------------------
  |  Branch (85:28): [True: 34.4k, False: 24.7k]
  ------------------
   86|  81.5k|    }
   87|  8.12k|    else
   88|  8.12k|    {
   89|  8.12k|        ps_mb_bin_ctxt = ps_mb_bin_ctxt + 3 + (ps_dec->u1_B << 1);
   90|  8.12k|    }
   91|       |
   92|       |    /* b0 */
   93|  89.6k|    u1_mb_type = (UWORD8)ih264d_decode_bin(u4_cxt_inc, ps_mb_bin_ctxt, ps_bitstrm,
   94|  89.6k|                                          ps_cab_env);
   95|  89.6k|    if(u1_mb_type)
  ------------------
  |  Branch (95:8): [True: 44.6k, False: 44.9k]
  ------------------
   96|  44.6k|    {
   97|       |        /* I16x16 or I_PCM mode */
   98|       |        /* b1 */
   99|  44.6k|        u1_bin = ih264d_decode_terminate(ps_cab_env, ps_bitstrm);
  100|  44.6k|        if(u1_bin == 0)
  ------------------
  |  Branch (100:12): [True: 43.3k, False: 1.32k]
  ------------------
  101|  43.3k|        {
  102|       |            /* I16x16 mode */
  103|       |            /* Read b2 and b3 */
  104|  43.3k|            u4_cxt_inc = (u1_inter) ? 0x021 : 0x043;
  ------------------
  |  Branch (104:26): [True: 3.03k, False: 40.3k]
  ------------------
  105|       |
  106|  43.3k|            u1_bin = ih264d_decode_bins(2, u4_cxt_inc, ps_mb_bin_ctxt, ps_bitstrm,
  107|  43.3k|                                        ps_cab_env);
  108|       |
  109|  43.3k|            if(u1_bin & 0x01)
  ------------------
  |  Branch (109:16): [True: 6.51k, False: 36.8k]
  ------------------
  110|  6.51k|                u1_mb_type += 4;
  111|       |
  112|  43.3k|            if(u1_bin & 0x02)
  ------------------
  |  Branch (112:16): [True: 2.89k, False: 40.4k]
  ------------------
  113|  2.89k|                u1_mb_type += 12;
  114|       |
  115|  43.3k|            if(u1_bin & 0x01)
  ------------------
  |  Branch (115:16): [True: 6.51k, False: 36.8k]
  ------------------
  116|  6.51k|            {
  117|       |                /* since b3=1, Read three bins */
  118|  6.51k|                u4_cxt_inc = (u1_inter) ? 0x0332 : 0x0765;
  ------------------
  |  Branch (118:30): [True: 593, False: 5.91k]
  ------------------
  119|  6.51k|                u1_bin = (UWORD8)ih264d_decode_bins(3, u4_cxt_inc, ps_mb_bin_ctxt,
  120|  6.51k|                                                    ps_bitstrm, ps_cab_env);
  121|       |
  122|  6.51k|            }
  123|  36.8k|            else
  124|  36.8k|            {
  125|       |                /* Read two bins */
  126|  36.8k|                u4_cxt_inc = (u1_inter) ? 0x033 : 0x076;
  ------------------
  |  Branch (126:30): [True: 2.44k, False: 34.4k]
  ------------------
  127|  36.8k|                u1_bin = (UWORD8)ih264d_decode_bins(2, u4_cxt_inc, ps_mb_bin_ctxt,
  128|  36.8k|                                                    ps_bitstrm, ps_cab_env);
  129|  36.8k|            }
  130|  43.3k|            u1_mb_type += u1_bin;
  131|  43.3k|        }
  132|  1.32k|        else
  133|  1.32k|        {
  134|       |            /* I_PCM mode */
  135|       |            /* b1=1 */
  136|  1.32k|            u1_mb_type = 25;
  137|  1.32k|        }
  138|  44.6k|    }
  139|  89.6k|    return (u1_mb_type);
  140|  89.6k|}
ih264d_parse_mb_type_cabac:
  155|   235k|{
  156|   235k|    const UWORD8 uc_slice_type = ps_dec->ps_cur_slice->u1_slice_type;
  157|   235k|    decoding_envirnoment_t *ps_cab_env = &ps_dec->s_cab_dec_env;
  158|   235k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
  159|   235k|    ctxt_inc_mb_info_t *ps_left_ctxt = ps_dec->p_left_ctxt_mb_info;
  160|   235k|    ctxt_inc_mb_info_t *ps_top_ctxt = ps_dec->p_top_ctxt_mb_info;
  161|   235k|    WORD8 c_ctxt_inc;
  162|   235k|    bin_ctxt_model_t *ps_mb_bin_ctxt = ps_dec->p_mb_type_t;
  163|   235k|    WORD8 u1_mb_type = 0, u1_bin;
  164|   235k|    UWORD32 u4_cxt_inc;
  165|       |
  166|   235k|    INC_SYM_COUNT(ps_cab_env);
  167|       |
  168|   235k|    c_ctxt_inc = 0;
  169|       |
  170|   235k|    if(uc_slice_type == SI_SLICE)
  ------------------
  |  |  372|   235k|#define SI_SLICE 4
  ------------------
  |  Branch (170:8): [True: 0, False: 235k]
  ------------------
  171|      0|    {
  172|       |        /* b0 */
  173|      0|        if(ps_left_ctxt != ps_dec->ps_def_ctxt_mb_info)
  ------------------
  |  Branch (173:12): [True: 0, False: 0]
  ------------------
  174|      0|            c_ctxt_inc += ((ps_left_ctxt->u1_mb_type != CAB_SI4x4) ? 1 : 0);
  ------------------
  |  |  399|      0|#define CAB_SI4x4         0x08 /* 0000 10x0 */
  ------------------
  |  Branch (174:28): [True: 0, False: 0]
  ------------------
  175|      0|        if(ps_top_ctxt != ps_dec->ps_def_ctxt_mb_info)
  ------------------
  |  Branch (175:12): [True: 0, False: 0]
  ------------------
  176|      0|            c_ctxt_inc += ((ps_top_ctxt->u1_mb_type != CAB_SI4x4) ? 1 : 0);
  ------------------
  |  |  399|      0|#define CAB_SI4x4         0x08 /* 0000 10x0 */
  ------------------
  |  Branch (176:28): [True: 0, False: 0]
  ------------------
  177|       |
  178|      0|        u4_cxt_inc = c_ctxt_inc;
  179|      0|        u1_bin = (UWORD8)ih264d_decode_bin(u4_cxt_inc, ps_mb_bin_ctxt, ps_bitstrm,
  180|      0|                                           ps_cab_env);
  181|      0|        if(u1_bin == 0)
  ------------------
  |  Branch (181:12): [True: 0, False: 0]
  ------------------
  182|      0|        {
  183|       |            /* SI MB */
  184|      0|            u1_mb_type = 0;
  185|      0|        }
  186|      0|        else
  187|      0|        {
  188|      0|            u1_mb_type = 1 + ih264d_parse_mb_type_intra_cabac(0, ps_dec);
  189|      0|        }
  190|      0|    }
  191|   235k|    else if(uc_slice_type == P_SLICE)
  ------------------
  |  |  368|   235k|#define P_SLICE  0
  ------------------
  |  Branch (191:13): [True: 111k, False: 124k]
  ------------------
  192|   111k|    {
  193|       |        /* P Slice */
  194|       |        /* b0 */
  195|   111k|        u4_cxt_inc = 0;
  196|   111k|        u1_bin = (UWORD8)ih264d_decode_bin(u4_cxt_inc, ps_mb_bin_ctxt, ps_bitstrm,
  197|   111k|                                           ps_cab_env);
  198|   111k|        if(!u1_bin)
  ------------------
  |  Branch (198:12): [True: 104k, False: 6.79k]
  ------------------
  199|   104k|        {
  200|       |            /* Inter MB types */
  201|       |            /* b1 */
  202|   104k|            u4_cxt_inc = 0x01;
  203|   104k|            u1_bin = (UWORD8)ih264d_decode_bin(u4_cxt_inc, ps_mb_bin_ctxt,
  204|   104k|                                               ps_bitstrm, ps_cab_env);
  205|       |            /* b2 */
  206|   104k|            u4_cxt_inc = u1_bin + 2;
  207|   104k|            u1_mb_type = (UWORD8)ih264d_decode_bin(u4_cxt_inc, ps_mb_bin_ctxt,
  208|   104k|                                                  ps_bitstrm, ps_cab_env);
  209|   104k|            u1_mb_type = (u1_bin << 1) + u1_mb_type;
  210|   104k|            if(u1_mb_type)
  ------------------
  |  Branch (210:16): [True: 56.4k, False: 48.2k]
  ------------------
  211|  56.4k|                u1_mb_type = 4 - u1_mb_type;
  212|   104k|        }
  213|  6.79k|        else
  214|  6.79k|        {
  215|       |            /* Intra Prefix 1 found */
  216|       |            /* Intra MB type */
  217|  6.79k|            u1_mb_type = 5 + ih264d_parse_mb_type_intra_cabac(1, ps_dec);
  218|  6.79k|        }
  219|   111k|    }
  220|   124k|    else if(uc_slice_type == B_SLICE)
  ------------------
  |  |  369|   124k|#define B_SLICE  1
  ------------------
  |  Branch (220:13): [True: 124k, False: 0]
  ------------------
  221|   124k|    {
  222|   124k|        WORD8 a, b;
  223|       |        /* B Slice */
  224|       |        /* b0 */
  225|       |        /* a = b = 0, if B slice and MB is a SKIP or B_DIRECT16x16 */
  226|   124k|        a = 0;
  227|   124k|        b = 0;
  228|   124k|        u1_mb_type = 0;
  229|   124k|        if(ps_left_ctxt != ps_dec->ps_def_ctxt_mb_info)
  ------------------
  |  Branch (229:12): [True: 112k, False: 12.1k]
  ------------------
  230|   112k|            a = ((ps_left_ctxt->u1_mb_type & CAB_BD16x16_MASK) != CAB_BD16x16);
  ------------------
  |  |  405|   112k|#define CAB_BD16x16_MASK  0x07 /* 0000 0111 */
  ------------------
                          a = ((ps_left_ctxt->u1_mb_type & CAB_BD16x16_MASK) != CAB_BD16x16);
  ------------------
  |  |  396|   112k|#define CAB_BD16x16       0x04 /* 0000 0100 */
  ------------------
  231|   124k|        if(ps_top_ctxt != ps_dec->ps_def_ctxt_mb_info)
  ------------------
  |  Branch (231:12): [True: 102k, False: 21.8k]
  ------------------
  232|   102k|            b = ((ps_top_ctxt->u1_mb_type & CAB_BD16x16_MASK) != CAB_BD16x16);
  ------------------
  |  |  405|   102k|#define CAB_BD16x16_MASK  0x07 /* 0000 0111 */
  ------------------
                          b = ((ps_top_ctxt->u1_mb_type & CAB_BD16x16_MASK) != CAB_BD16x16);
  ------------------
  |  |  396|   102k|#define CAB_BD16x16       0x04 /* 0000 0100 */
  ------------------
  233|       |
  234|   124k|        u4_cxt_inc = a + b;
  235|       |
  236|   124k|        u1_bin = (UWORD8)ih264d_decode_bin(u4_cxt_inc, ps_mb_bin_ctxt, ps_bitstrm,
  237|   124k|                                           ps_cab_env);
  238|       |
  239|   124k|        if(u1_bin)
  ------------------
  |  Branch (239:12): [True: 118k, False: 5.28k]
  ------------------
  240|   118k|        {
  241|       |
  242|       |            /* b1 */
  243|   118k|            u4_cxt_inc = 0x03;
  244|   118k|            u1_bin = (UWORD8)ih264d_decode_bin(u4_cxt_inc, ps_mb_bin_ctxt,
  245|   118k|                                               ps_bitstrm, ps_cab_env);
  246|       |
  247|   118k|            if(!u1_bin)
  ------------------
  |  Branch (247:16): [True: 28.3k, False: 90.5k]
  ------------------
  248|  28.3k|            {
  249|       |                /* b2 */
  250|  28.3k|                u4_cxt_inc = 0x05;
  251|  28.3k|                u1_bin = (UWORD8)ih264d_decode_bin(u4_cxt_inc, ps_mb_bin_ctxt,
  252|  28.3k|                                                   ps_bitstrm, ps_cab_env);
  253|       |
  254|  28.3k|                u1_mb_type = u1_bin + 1;
  255|  28.3k|            }
  256|  90.5k|            else
  257|  90.5k|            {
  258|  90.5k|                u1_mb_type = 3;
  259|       |                /* b2 */
  260|  90.5k|                u4_cxt_inc = 0x04;
  261|  90.5k|                u1_bin = (UWORD8)ih264d_decode_bin(u4_cxt_inc, ps_mb_bin_ctxt,
  262|  90.5k|                                                   ps_bitstrm, ps_cab_env);
  263|       |
  264|  90.5k|                if(u1_bin)
  ------------------
  |  Branch (264:20): [True: 74.1k, False: 16.4k]
  ------------------
  265|  74.1k|                {
  266|  74.1k|                    u1_mb_type += 8;
  267|       |                    /* b3 */
  268|  74.1k|                    u4_cxt_inc = 0x05;
  269|  74.1k|                    u1_bin = (UWORD8)ih264d_decode_bin(u4_cxt_inc, ps_mb_bin_ctxt,
  270|  74.1k|                                                       ps_bitstrm, ps_cab_env);
  271|       |
  272|  74.1k|                    if(!u1_bin)
  ------------------
  |  Branch (272:24): [True: 31.1k, False: 42.9k]
  ------------------
  273|  31.1k|                    {
  274|  31.1k|                        u1_mb_type++;
  275|       |                        /* b4, b5, b6 */
  276|  31.1k|                        u4_cxt_inc = 0x0555;
  277|  31.1k|                        u1_bin = (UWORD8)ih264d_decode_bins(3, u4_cxt_inc,
  278|  31.1k|                                                            ps_mb_bin_ctxt,
  279|  31.1k|                                                            ps_bitstrm,
  280|  31.1k|                                                            ps_cab_env);
  281|       |
  282|       |
  283|       |
  284|  31.1k|                        u1_mb_type += u1_bin;
  285|  31.1k|                    }
  286|  42.9k|                    else
  287|  42.9k|                    {
  288|       |                        /* b4 */
  289|  42.9k|                        u4_cxt_inc = 0x05;
  290|  42.9k|                        u1_bin = (UWORD8)ih264d_decode_bin(u4_cxt_inc,
  291|  42.9k|                                                           ps_mb_bin_ctxt,
  292|  42.9k|                                                           ps_bitstrm,
  293|  42.9k|                                                           ps_cab_env);
  294|       |
  295|  42.9k|                        if(u1_bin)
  ------------------
  |  Branch (295:28): [True: 38.3k, False: 4.57k]
  ------------------
  296|  38.3k|                        {
  297|       |                            /* b5 */
  298|  38.3k|                            u1_bin = (UWORD8)ih264d_decode_bin(u4_cxt_inc,
  299|  38.3k|                                                               ps_mb_bin_ctxt,
  300|  38.3k|                                                               ps_bitstrm,
  301|  38.3k|                                                               ps_cab_env);
  302|       |
  303|  38.3k|                            u1_mb_type += (u1_bin ? 11 : 0);
  ------------------
  |  Branch (303:44): [True: 35.7k, False: 2.62k]
  ------------------
  304|  38.3k|                        }
  305|  4.57k|                        else
  306|  4.57k|                        {
  307|  4.57k|                            u1_mb_type = 20;
  308|       |                            /* b5 */
  309|  4.57k|                            u1_bin = (UWORD8)ih264d_decode_bin(u4_cxt_inc,
  310|  4.57k|                                                               ps_mb_bin_ctxt,
  311|  4.57k|                                                               ps_bitstrm,
  312|  4.57k|                                                               ps_cab_env);
  313|       |
  314|  4.57k|                            if(!u1_bin)
  ------------------
  |  Branch (314:32): [True: 3.25k, False: 1.32k]
  ------------------
  315|  3.25k|                            {
  316|       |                                /* b6 */
  317|  3.25k|                                u1_bin = (UWORD8)ih264d_decode_bin(u4_cxt_inc,
  318|  3.25k|                                                                   ps_mb_bin_ctxt,
  319|  3.25k|                                                                   ps_bitstrm,
  320|  3.25k|                                                                   ps_cab_env);
  321|       |
  322|  3.25k|                                u1_mb_type += u1_bin;
  323|  3.25k|                            }
  324|  1.32k|                            else
  325|  1.32k|                            {
  326|       |                                /* Intra Prefix 111101 found */
  327|       |                                /* Intra MB type */
  328|  1.32k|                                u1_mb_type =
  329|  1.32k|                                                23
  330|  1.32k|                                                                + ih264d_parse_mb_type_intra_cabac(
  331|  1.32k|                                                                                1,
  332|  1.32k|                                                                                ps_dec);
  333|  1.32k|                            }
  334|  4.57k|                        }
  335|  42.9k|                    }
  336|  74.1k|                }
  337|  16.4k|                else
  338|  16.4k|                {
  339|       |                    /* b3, b4, b5 */
  340|  16.4k|                    u4_cxt_inc = 0x0555;
  341|  16.4k|                    u1_bin = (UWORD8)ih264d_decode_bins(3, u4_cxt_inc,
  342|  16.4k|                                                        ps_mb_bin_ctxt, ps_bitstrm,
  343|  16.4k|                                                        ps_cab_env);
  344|       |
  345|       |
  346|       |
  347|       |
  348|  16.4k|                    u1_mb_type += u1_bin;
  349|  16.4k|                }
  350|  90.5k|            }
  351|   118k|        }
  352|   124k|    }
  353|   235k|    return ((UWORD32)u1_mb_type);
  354|   235k|}
ih264d_parse_submb_type_cabac:
  372|   219k|{
  373|   219k|    WORD8 u1_sub_mb_type, u1_bin;
  374|       |
  375|   219k|    INC_SYM_COUNT(ps_cab_env);
  376|       |
  377|   219k|    u1_sub_mb_type = 0;
  378|   219k|    u1_bin = (UWORD8)ih264d_decode_bin(0, ps_sub_mb_cxt, ps_bitstrm,
  379|   219k|                                       ps_cab_env);
  380|       |
  381|   219k|    if(u1_slc_type_b ^ u1_bin)
  ------------------
  |  Branch (381:8): [True: 45.2k, False: 173k]
  ------------------
  382|  45.2k|        return 0;
  383|       |
  384|   173k|    if(!u1_slc_type_b)
  ------------------
  |  Branch (384:8): [True: 45.6k, False: 128k]
  ------------------
  385|  45.6k|    {
  386|       |        /* P Slice */
  387|  45.6k|        u1_sub_mb_type = 1;
  388|  45.6k|        u1_bin = (UWORD8)ih264d_decode_bin(1, ps_sub_mb_cxt, ps_bitstrm,
  389|  45.6k|                                           ps_cab_env);
  390|  45.6k|        if(u1_bin == 1)
  ------------------
  |  Branch (390:12): [True: 37.1k, False: 8.48k]
  ------------------
  391|  37.1k|        {
  392|  37.1k|            u1_bin = (UWORD8)ih264d_decode_bin(2, ps_sub_mb_cxt, ps_bitstrm,
  393|  37.1k|                                               ps_cab_env);
  394|  37.1k|            u1_sub_mb_type = (2 + (!u1_bin));
  395|  37.1k|        }
  396|       |
  397|  45.6k|        return u1_sub_mb_type;
  398|  45.6k|    }
  399|   128k|    else
  400|   128k|    {
  401|       |        /* B Slice */
  402|       |
  403|       |        /* b1 */
  404|   128k|        u1_bin = (UWORD8)ih264d_decode_bin(1, ps_sub_mb_cxt, ps_bitstrm,
  405|   128k|                                           ps_cab_env);
  406|   128k|        if(u1_bin)
  ------------------
  |  Branch (406:12): [True: 49.3k, False: 79.0k]
  ------------------
  407|  49.3k|        {
  408|       |            /* b2 */
  409|  49.3k|            u1_bin = (UWORD8)ih264d_decode_bin(2, ps_sub_mb_cxt, ps_bitstrm,
  410|  49.3k|                                               ps_cab_env);
  411|  49.3k|            if(u1_bin)
  ------------------
  |  Branch (411:16): [True: 4.29k, False: 45.0k]
  ------------------
  412|  4.29k|            {
  413|       |                /* b3 */
  414|  4.29k|                u1_sub_mb_type = 7;
  415|  4.29k|                u1_bin = (UWORD8)ih264d_decode_bin(3, ps_sub_mb_cxt, ps_bitstrm,
  416|  4.29k|                                                   ps_cab_env);
  417|  4.29k|                u1_sub_mb_type += u1_bin << 2;
  418|  4.29k|                u1_bin = !u1_bin;
  419|       |                /* b4 */
  420|  4.29k|                if(u1_bin == 0)
  ------------------
  |  Branch (420:20): [True: 1.82k, False: 2.46k]
  ------------------
  421|  1.82k|                {
  422|  1.82k|                    u1_bin = ih264d_decode_bin(3, ps_sub_mb_cxt, ps_bitstrm,
  423|  1.82k|                                               ps_cab_env);
  424|  1.82k|                }
  425|  2.46k|                else
  426|  2.46k|                {
  427|  2.46k|                    u1_bin = (UWORD8)ih264d_decode_bins(2, 0x33, ps_sub_mb_cxt,
  428|  2.46k|                                                        ps_bitstrm, ps_cab_env);
  429|  2.46k|                }
  430|       |
  431|  4.29k|                return (u1_sub_mb_type + u1_bin);
  432|  4.29k|            }
  433|  45.0k|            else
  434|  45.0k|            {
  435|       |                /* b3 */
  436|  45.0k|                u1_bin = (UWORD8)ih264d_decode_bins(2, 0x33, ps_sub_mb_cxt,
  437|  45.0k|                                                    ps_bitstrm, ps_cab_env);
  438|  45.0k|                return (3 + u1_bin);
  439|  45.0k|            }
  440|  49.3k|        }
  441|  79.0k|        else
  442|  79.0k|        {
  443|       |            /* b2 */
  444|  79.0k|            u1_bin = (UWORD8)ih264d_decode_bin(3, ps_sub_mb_cxt, ps_bitstrm,
  445|  79.0k|                                               ps_cab_env);
  446|  79.0k|            return (1 + u1_bin);
  447|  79.0k|        }
  448|   128k|    }
  449|   173k|}
ih264d_parse_ref_idx_cabac:
  473|   279k|{
  474|   279k|    UWORD8 u1_a, u1_b;
  475|   279k|    UWORD32 u4_cxt_inc;
  476|   279k|    UWORD8 u1_blk_no, u1_i, u1_idx_lft, u1_idx_top;
  477|   279k|    WORD8 i1_ref_idx;
  478|       |
  479|   913k|    for(u1_blk_no = 0, u1_i = 0; u1_i < u1_num_part; u1_i++, pi1_ref_idx++)
  ------------------
  |  Branch (479:34): [True: 634k, False: 279k]
  ------------------
  480|   634k|    {
  481|   634k|        u1_idx_lft = ((u1_blk_no & 0x02) >> 1) + u1_b2;
  482|   634k|        u1_idx_top = (u1_blk_no & 0x01) + u1_b2;
  483|   634k|        i1_ref_idx = *pi1_ref_idx;
  484|       |
  485|   634k|        if(i1_ref_idx > 0)
  ------------------
  |  Branch (485:12): [True: 294k, False: 340k]
  ------------------
  486|   294k|        {
  487|   294k|            u1_a = pi1_lft_cxt[u1_idx_lft] > 0;
  488|   294k|            u1_b = pi1_top_cxt[u1_idx_top] > 0;
  489|       |
  490|   294k|            u4_cxt_inc = u1_a + (u1_b << 1);
  491|   294k|            u4_cxt_inc = (u4_cxt_inc | 0x55540);
  492|       |
  493|   294k|            i1_ref_idx = (WORD8)ih264d_decode_bins_unary(32, u4_cxt_inc,
  494|   294k|                                                         ps_ref_cxt, ps_bitstrm,
  495|   294k|                                                         ps_cab_env);
  496|       |
  497|   294k|            if((i1_ref_idx > u1_max_ref_minus1) || (i1_ref_idx < 0))
  ------------------
  |  Branch (497:16): [True: 726, False: 293k]
  |  Branch (497:52): [True: 0, False: 293k]
  ------------------
  498|    726|            {
  499|    726|                return ERROR_REF_IDX;
  500|    726|            }
  501|       |
  502|   293k|            *pi1_ref_idx = i1_ref_idx;
  503|       |
  504|   293k|            INC_SYM_COUNT(ps_cab_env);
  505|       |
  506|   293k|        }
  507|       |
  508|       |        /* Storing Reference Idx Information */
  509|   633k|        pi1_lft_cxt[u1_idx_lft] = i1_ref_idx;
  510|   633k|        pi1_top_cxt[u1_idx_top] = i1_ref_idx;
  511|   633k|        u1_blk_no = u1_blk_no + 1 + (u1_mb_mode & 0x01);
  512|   633k|    }
  513|       |    /* if(!u1_sub_mb) */
  514|   279k|    if(u1_num_part != 4)
  ------------------
  |  Branch (514:8): [True: 204k, False: 74.8k]
  ------------------
  515|   204k|    {
  516|   204k|        pi1_lft_cxt[(!(u1_mb_mode & 0x1)) + u1_b2] = pi1_lft_cxt[u1_b2];
  517|   204k|        pi1_top_cxt[(!(u1_mb_mode & 0x2)) + u1_b2] = pi1_top_cxt[u1_b2];
  518|   204k|    }
  519|   279k|    return OK;
  ------------------
  |  |  114|   279k|#define OK        0
  ------------------
  520|   279k|}
ih264d_parse_mb_qp_delta_cabac:
  536|   171k|{
  537|   171k|    decoding_envirnoment_t * ps_cab_env = &ps_dec->s_cab_dec_env;
  538|   171k|    dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
  539|       |
  540|   171k|    UWORD8 u1_code_num;
  541|   171k|    bin_ctxt_model_t *ps_mb_qp_delta_ctxt = ps_dec->p_mb_qp_delta_t;
  542|   171k|    UWORD32 u4_cxt_inc;
  543|       |
  544|   171k|    INC_SYM_COUNT(ps_cab_env);
  545|       |
  546|   171k|    u4_cxt_inc = (!(!(ps_dec->i1_prev_mb_qp_delta)));
  547|       |
  548|   171k|    u1_code_num = 0;
  549|   171k|    u4_cxt_inc = (u4_cxt_inc | 0x33320);
  550|       |    /* max number of bins = 53,
  551|       |     since Range for MbQpDelta= -26 to +25 inclusive, UNARY code */
  552|   171k|    u1_code_num = ih264d_decode_bins_unary(32, u4_cxt_inc, ps_mb_qp_delta_ctxt,
  553|   171k|                                          ps_bitstrm, ps_cab_env);
  554|   171k|    if(u1_code_num == 32)
  ------------------
  |  Branch (554:8): [True: 1.01k, False: 170k]
  ------------------
  555|  1.01k|    {
  556|       |        /* Read remaining 21 bins */
  557|  1.01k|        UWORD8 uc_codeNumX;
  558|  1.01k|        u4_cxt_inc = 0x33333;
  559|  1.01k|        uc_codeNumX = ih264d_decode_bins_unary(21, u4_cxt_inc, ps_mb_qp_delta_ctxt,
  560|  1.01k|                                               ps_bitstrm, ps_cab_env);
  561|  1.01k|        u1_code_num = u1_code_num + uc_codeNumX;
  562|  1.01k|    }
  563|       |
  564|   171k|    *pi1_mb_qp_delta = (u1_code_num + 1) >> 1;
  565|       |    /* Table 9.3: If code_num is even Syntax Element has -ve value */
  566|   171k|    if(!(u1_code_num & 0x01))
  ------------------
  |  Branch (566:8): [True: 148k, False: 23.2k]
  ------------------
  567|   148k|        *pi1_mb_qp_delta = -(*pi1_mb_qp_delta);
  568|       |
  569|       |    /* Range of MbQpDelta= -26 to +25 inclusive */
  570|   171k|    if((*pi1_mb_qp_delta < -26) || (*pi1_mb_qp_delta > 25))
  ------------------
  |  Branch (570:8): [True: 0, False: 171k]
  |  Branch (570:36): [True: 852, False: 170k]
  ------------------
  571|    852|        return ERROR_INV_RANGE_QP_T;
  572|   170k|    ps_dec->i1_prev_mb_qp_delta = *pi1_mb_qp_delta;
  573|   170k|    return OK;
  ------------------
  |  |  114|   170k|#define OK        0
  ------------------
  574|   171k|}
ih264d_parse_chroma_pred_mode_cabac:
  588|  88.3k|{
  589|  88.3k|    decoding_envirnoment_t * ps_cab_env = &ps_dec->s_cab_dec_env;
  590|  88.3k|    dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
  591|  88.3k|    ctxt_inc_mb_info_t * ps_left_ctxt = ps_dec->p_left_ctxt_mb_info;
  592|  88.3k|    ctxt_inc_mb_info_t * ps_top_ctxt = ps_dec->p_top_ctxt_mb_info;
  593|  88.3k|    WORD8 i1_chroma_pred_mode, a, b;
  594|  88.3k|    UWORD32 u4_cxt_inc;
  595|       |
  596|  88.3k|    INC_SYM_COUNT(ps_cab_env);
  597|       |
  598|       |    /* Binarization is TU and Cmax=3 */
  599|  88.3k|    i1_chroma_pred_mode = 0;
  600|  88.3k|    a = 0;
  601|  88.3k|    b = 0;
  602|       |
  603|  88.3k|    a = ((ps_left_ctxt->u1_intra_chroma_pred_mode != 0) ? 1 : 0);
  ------------------
  |  Branch (603:10): [True: 38.4k, False: 49.8k]
  ------------------
  604|       |
  605|  88.3k|    b = ((ps_top_ctxt->u1_intra_chroma_pred_mode != 0) ? 1 : 0);
  ------------------
  |  Branch (605:10): [True: 36.1k, False: 52.1k]
  ------------------
  606|  88.3k|    u4_cxt_inc = a + b;
  607|       |
  608|  88.3k|    u4_cxt_inc = (u4_cxt_inc | 0x330);
  609|       |
  610|  88.3k|    i1_chroma_pred_mode = ih264d_decode_bins_tunary(
  611|  88.3k|                    3, u4_cxt_inc, ps_dec->p_intra_chroma_pred_mode_t,
  612|  88.3k|                    ps_bitstrm, ps_cab_env);
  613|       |
  614|  88.3k|    return (i1_chroma_pred_mode);
  615|  88.3k|}
ih264d_parse_transform8x8flag_cabac:
  635|  59.3k|{
  636|  59.3k|    decoding_envirnoment_t * ps_cab_env = &ps_dec->s_cab_dec_env;
  637|  59.3k|    dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
  638|  59.3k|    ctxt_inc_mb_info_t * ps_left_ctxt = ps_dec->p_left_ctxt_mb_info;
  639|  59.3k|    ctxt_inc_mb_info_t * ps_top_ctxt = ps_dec->p_top_ctxt_mb_info;
  640|  59.3k|    UWORD8 u1_transform_8x8flag;
  641|  59.3k|    UWORD8 u1_mb_ngbr_avail = ps_cur_mb_info->u1_mb_ngbr_availablity;
  642|       |
  643|  59.3k|    WORD8 a, b;
  644|  59.3k|    UWORD32 u4_cxt_inc;
  645|       |
  646|       |    /* for calculating the context increment for transform8x8 u4_flag */
  647|       |    /* it reads transform8x8 u4_flag of the neighbors through */
  648|       |
  649|       |    /* Binarization is FLC */
  650|  59.3k|    a = 0;
  651|  59.3k|    b = 0;
  652|       |
  653|  59.3k|    if(u1_mb_ngbr_avail & LEFT_MB_AVAILABLE_MASK)
  ------------------
  |  |   53|  59.3k|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  |  Branch (653:8): [True: 40.3k, False: 19.0k]
  ------------------
  654|  40.3k|    {
  655|  40.3k|        a = ps_left_ctxt->u1_transform8x8_ctxt;
  656|  40.3k|    }
  657|  59.3k|    if(u1_mb_ngbr_avail & TOP_MB_AVAILABLE_MASK)
  ------------------
  |  |   55|  59.3k|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  |  Branch (657:8): [True: 45.1k, False: 14.2k]
  ------------------
  658|  45.1k|    {
  659|  45.1k|        b = ps_top_ctxt->u1_transform8x8_ctxt;
  660|       |
  661|  45.1k|    }
  662|       |
  663|  59.3k|    u4_cxt_inc = a + b;
  664|       |
  665|  59.3k|    u1_transform_8x8flag = ih264d_decode_bin(
  666|  59.3k|                    u4_cxt_inc, ps_dec->s_high_profile.ps_transform8x8_flag,
  667|  59.3k|                    ps_bitstrm, ps_cab_env);
  668|       |
  669|  59.3k|    return (u1_transform_8x8flag);
  670|  59.3k|}
ih264d_read_intra_pred_modes_cabac:
  695|  44.9k|{
  696|  44.9k|    WORD32 i4x4_luma_blk_idx = 0;
  697|  44.9k|    dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
  698|  44.9k|    decoding_envirnoment_t * ps_cab_env = &ps_dec->s_cab_dec_env;
  699|  44.9k|    bin_ctxt_model_t *ps_ctxt_ipred_luma_mpm, *ps_ctx_ipred_luma_rm;
  700|  44.9k|    WORD32 i4_rem_intra4x4_pred_mode;
  701|  44.9k|    UWORD32 u4_prev_intra4x4_pred_mode_flag;
  702|  44.9k|    UWORD32 u4_code_int_range, u4_code_int_val_ofst;
  703|  44.9k|    const UWORD32 *pu4_table = (const UWORD32 *)ps_cab_env->cabac_table;
  704|       |
  705|  44.9k|    ps_ctxt_ipred_luma_mpm = ps_dec->p_prev_intra4x4_pred_mode_flag_t;
  706|  44.9k|    ps_ctx_ipred_luma_rm = ps_dec->p_rem_intra4x4_pred_mode_t;
  707|  44.9k|    SWITCHOFFTRACE;
  708|       |
  709|  44.9k|    i4x4_luma_blk_idx = (0 == u1_tran_form8x8) ? 16 : 4;
  ------------------
  |  Branch (709:25): [True: 17.6k, False: 27.3k]
  ------------------
  710|       |
  711|  44.9k|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  712|  44.9k|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  713|       |
  714|  44.9k|    do
  715|   391k|    {
  716|       |
  717|   391k|        DECODE_ONE_BIN_MACRO(ps_ctxt_ipred_luma_mpm, u4_code_int_range,
  ------------------
  |  |  217|   391k|                     p_DecBitStream_arg,u4_symbol)                                           \
  |  |  218|   391k|{                                                                                       \
  |  |  219|   391k|    bin_ctxt_model_t *p_binCtxt_m = (bin_ctxt_model_t *) p_binCtxt_arg;                           \
  |  |  220|   391k|    dec_bit_stream_t *p_DecBitStream_m = (dec_bit_stream_t *) p_DecBitStream_arg;                 \
  |  |  221|   391k|    const UWORD32 *pu4_table_m = (const UWORD32 *) pu4_table_arg;                         \
  |  |  222|   391k|                                                                                        \
  |  |  223|   391k|    UWORD32 u4_quantCodeIntRange_m,u4_codeIntRangeLPS_m;                                    \
  |  |  224|   391k|    UWORD32 u1_mps_state_m;                                                               \
  |  |  225|   391k|    UWORD32 table_lookup_m;                                                               \
  |  |  226|   391k|    UWORD32 u4_clz_m;                                                                     \
  |  |  227|   391k|                                                                                        \
  |  |  228|   391k|    u1_mps_state_m = (p_binCtxt_m->u1_mps_state);                                           \
  |  |  229|   391k|    u4_clz_m = CLZ(u4_code_int_range);                                                  \
  |  |  230|   391k|    u4_quantCodeIntRange_m = u4_code_int_range << u4_clz_m;                                   \
  |  |  231|   391k|    u4_quantCodeIntRange_m = (u4_quantCodeIntRange_m >> 29) & 0x3;                          \
  |  |  232|   391k|    table_lookup_m = pu4_table_m[(u1_mps_state_m << 2)+u4_quantCodeIntRange_m];                 \
  |  |  233|   391k|    u4_codeIntRangeLPS_m = table_lookup_m & 0xff;                                           \
  |  |  234|   391k|                                                                                        \
  |  |  235|   391k|    u4_codeIntRangeLPS_m = u4_codeIntRangeLPS_m << (23 - u4_clz_m);                           \
  |  |  236|   391k|    u4_code_int_range = u4_code_int_range - u4_codeIntRangeLPS_m;                             \
  |  |  237|   391k|    u4_symbol = ((u1_mps_state_m>> 6) & 0x1);                                             \
  |  |  238|   391k|    /*if mps*/                                                                          \
  |  |  239|   391k|    u1_mps_state_m = (table_lookup_m >> 8) & 0x7F;                                          \
  |  |  240|   391k|    if(u4_code_int_val_ofst >= u4_code_int_range)                                          \
  |  |  ------------------
  |  |  |  Branch (240:8): [True: 63.7k, False: 327k]
  |  |  ------------------
  |  |  241|   391k|  {                                                                                     \
  |  |  242|  63.7k|                                                                                        \
  |  |  243|  63.7k|    u4_symbol = 1 - u4_symbol;                                                          \
  |  |  244|  63.7k|    u4_code_int_val_ofst -= u4_code_int_range;                                             \
  |  |  245|  63.7k|    u4_code_int_range = u4_codeIntRangeLPS_m;                                               \
  |  |  246|  63.7k|    u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                         \
  |  |  247|  63.7k|  }                                                                                     \
  |  |  248|   391k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)                                        \
  |  |  ------------------
  |  |  |  |  113|   782k|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  |  |  ------------------
  |  |  |  Branch (248:8): [True: 4.38k, False: 386k]
  |  |  ------------------
  |  |  249|   391k|    {                                                                                   \
  |  |  250|  4.38k|        UWORD32 *pu4_buffer,u4_offset;                                                  \
  |  |  251|  4.38k|        UWORD32 read_bits,u4_clz_m  ;                                                     \
  |  |  252|  4.38k|                                                                                        \
  |  |  253|  4.38k|        pu4_buffer = p_DecBitStream_m->pu4_buffer;                                         \
  |  |  254|  4.38k|        u4_offset = p_DecBitStream_m->u4_ofst;                                          \
  |  |  255|  4.38k|        u4_clz_m = CLZ(u4_code_int_range);                                              \
  |  |  256|  4.38k|        NEXTBITS(read_bits,(u4_offset+23),pu4_buffer,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  4.38k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  4.38k|{                                                                           \
  |  |  |  |  139|  4.38k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  4.38k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  4.38k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  4.38k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  4.38k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 4.00k, False: 376]
  |  |  |  |  ------------------
  |  |  |  |  144|  4.38k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  4.00k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  4.38k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  4.38k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  4.38k|}
  |  |  ------------------
  |  |  257|  4.38k|        FLUSHBITS(u4_offset,(u4_clz_m))                                                   \
  |  |  ------------------
  |  |  |  |  193|  4.38k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  4.38k|{                                                                           \
  |  |  |  |  195|  4.38k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  4.38k|}
  |  |  ------------------
  |  |  258|  4.38k|        u4_code_int_range = u4_code_int_range << u4_clz_m;                                    \
  |  |  259|  4.38k|        u4_code_int_val_ofst= (u4_code_int_val_ofst << u4_clz_m) | read_bits;               \
  |  |  260|  4.38k|                                                                                        \
  |  |  261|  4.38k|                                                                                        \
  |  |  262|  4.38k|        p_DecBitStream_m->u4_ofst = u4_offset;                                          \
  |  |  263|  4.38k|    }                                                                                   \
  |  |  264|   391k|    p_binCtxt_m->u1_mps_state = u1_mps_state_m;                                             \
  |  |  265|   391k|}
  ------------------
  718|   391k|                             u4_code_int_val_ofst, pu4_table, ps_bitstrm,
  719|   391k|                             u4_prev_intra4x4_pred_mode_flag)
  720|   391k|        *pu1_prev_intra4x4_pred_mode_flag = u4_prev_intra4x4_pred_mode_flag;
  721|       |
  722|   391k|        i4_rem_intra4x4_pred_mode = -1;
  723|   391k|        if(!u4_prev_intra4x4_pred_mode_flag)
  ------------------
  |  Branch (723:12): [True: 103k, False: 287k]
  ------------------
  724|   103k|        {
  725|       |
  726|       |            /*inlining DecodeDecisionBins_FLC*/
  727|       |
  728|   103k|            {
  729|       |
  730|   103k|                UWORD8 u1_max_bins = 3;
  731|   103k|                UWORD32 u4_value;
  732|   103k|                UWORD32 u4_symbol, i;
  733|       |
  734|   103k|                i = 0;
  735|   103k|                u4_value = 0;
  736|       |
  737|   103k|                do
  738|   310k|                {
  739|       |
  740|   310k|                    DECODE_ONE_BIN_MACRO(ps_ctx_ipred_luma_rm, u4_code_int_range,
  ------------------
  |  |  217|   310k|                     p_DecBitStream_arg,u4_symbol)                                           \
  |  |  218|   310k|{                                                                                       \
  |  |  219|   310k|    bin_ctxt_model_t *p_binCtxt_m = (bin_ctxt_model_t *) p_binCtxt_arg;                           \
  |  |  220|   310k|    dec_bit_stream_t *p_DecBitStream_m = (dec_bit_stream_t *) p_DecBitStream_arg;                 \
  |  |  221|   310k|    const UWORD32 *pu4_table_m = (const UWORD32 *) pu4_table_arg;                         \
  |  |  222|   310k|                                                                                        \
  |  |  223|   310k|    UWORD32 u4_quantCodeIntRange_m,u4_codeIntRangeLPS_m;                                    \
  |  |  224|   310k|    UWORD32 u1_mps_state_m;                                                               \
  |  |  225|   310k|    UWORD32 table_lookup_m;                                                               \
  |  |  226|   310k|    UWORD32 u4_clz_m;                                                                     \
  |  |  227|   310k|                                                                                        \
  |  |  228|   310k|    u1_mps_state_m = (p_binCtxt_m->u1_mps_state);                                           \
  |  |  229|   310k|    u4_clz_m = CLZ(u4_code_int_range);                                                  \
  |  |  230|   310k|    u4_quantCodeIntRange_m = u4_code_int_range << u4_clz_m;                                   \
  |  |  231|   310k|    u4_quantCodeIntRange_m = (u4_quantCodeIntRange_m >> 29) & 0x3;                          \
  |  |  232|   310k|    table_lookup_m = pu4_table_m[(u1_mps_state_m << 2)+u4_quantCodeIntRange_m];                 \
  |  |  233|   310k|    u4_codeIntRangeLPS_m = table_lookup_m & 0xff;                                           \
  |  |  234|   310k|                                                                                        \
  |  |  235|   310k|    u4_codeIntRangeLPS_m = u4_codeIntRangeLPS_m << (23 - u4_clz_m);                           \
  |  |  236|   310k|    u4_code_int_range = u4_code_int_range - u4_codeIntRangeLPS_m;                             \
  |  |  237|   310k|    u4_symbol = ((u1_mps_state_m>> 6) & 0x1);                                             \
  |  |  238|   310k|    /*if mps*/                                                                          \
  |  |  239|   310k|    u1_mps_state_m = (table_lookup_m >> 8) & 0x7F;                                          \
  |  |  240|   310k|    if(u4_code_int_val_ofst >= u4_code_int_range)                                          \
  |  |  ------------------
  |  |  |  Branch (240:8): [True: 89.0k, False: 221k]
  |  |  ------------------
  |  |  241|   310k|  {                                                                                     \
  |  |  242|  89.0k|                                                                                        \
  |  |  243|  89.0k|    u4_symbol = 1 - u4_symbol;                                                          \
  |  |  244|  89.0k|    u4_code_int_val_ofst -= u4_code_int_range;                                             \
  |  |  245|  89.0k|    u4_code_int_range = u4_codeIntRangeLPS_m;                                               \
  |  |  246|  89.0k|    u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                         \
  |  |  247|  89.0k|  }                                                                                     \
  |  |  248|   310k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)                                        \
  |  |  ------------------
  |  |  |  |  113|   621k|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  |  |  ------------------
  |  |  |  Branch (248:8): [True: 7.10k, False: 303k]
  |  |  ------------------
  |  |  249|   310k|    {                                                                                   \
  |  |  250|  7.10k|        UWORD32 *pu4_buffer,u4_offset;                                                  \
  |  |  251|  7.10k|        UWORD32 read_bits,u4_clz_m  ;                                                     \
  |  |  252|  7.10k|                                                                                        \
  |  |  253|  7.10k|        pu4_buffer = p_DecBitStream_m->pu4_buffer;                                         \
  |  |  254|  7.10k|        u4_offset = p_DecBitStream_m->u4_ofst;                                          \
  |  |  255|  7.10k|        u4_clz_m = CLZ(u4_code_int_range);                                              \
  |  |  256|  7.10k|        NEXTBITS(read_bits,(u4_offset+23),pu4_buffer,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  7.10k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  7.10k|{                                                                           \
  |  |  |  |  139|  7.10k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  7.10k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  7.10k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  7.10k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  7.10k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 6.17k, False: 931]
  |  |  |  |  ------------------
  |  |  |  |  144|  7.10k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  6.17k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  7.10k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  7.10k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  7.10k|}
  |  |  ------------------
  |  |  257|  7.10k|        FLUSHBITS(u4_offset,(u4_clz_m))                                                   \
  |  |  ------------------
  |  |  |  |  193|  7.10k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  7.10k|{                                                                           \
  |  |  |  |  195|  7.10k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  7.10k|}
  |  |  ------------------
  |  |  258|  7.10k|        u4_code_int_range = u4_code_int_range << u4_clz_m;                                    \
  |  |  259|  7.10k|        u4_code_int_val_ofst= (u4_code_int_val_ofst << u4_clz_m) | read_bits;               \
  |  |  260|  7.10k|                                                                                        \
  |  |  261|  7.10k|                                                                                        \
  |  |  262|  7.10k|        p_DecBitStream_m->u4_ofst = u4_offset;                                          \
  |  |  263|  7.10k|    }                                                                                   \
  |  |  264|   310k|    p_binCtxt_m->u1_mps_state = u1_mps_state_m;                                             \
  |  |  265|   310k|}
  ------------------
  741|   310k|                                         u4_code_int_val_ofst, pu4_table,
  742|   310k|                                         ps_bitstrm, u4_symbol)
  743|       |
  744|   310k|                    INC_BIN_COUNT(ps_cab_env);INC_DECISION_BINS(ps_cab_env);
  745|       |
  746|   310k|                    u4_value = u4_value | (u4_symbol << i);
  747|       |
  748|   310k|                    i++;
  749|   310k|                }
  750|   310k|                while(i < u1_max_bins);
  ------------------
  |  Branch (750:23): [True: 207k, False: 103k]
  ------------------
  751|       |
  752|   103k|                i4_rem_intra4x4_pred_mode = (u4_value);
  753|       |
  754|   103k|            }
  755|       |
  756|   103k|        }
  757|       |
  758|   391k|        (*pu1_rem_intra4x4_pred_mode) = i4_rem_intra4x4_pred_mode;
  759|       |
  760|   391k|        COPYTHECONTEXT("intra4x4_pred_mode", i4_rem_intra4x4_pred_mode);
  761|       |
  762|   391k|        pu1_prev_intra4x4_pred_mode_flag++;
  763|   391k|        pu1_rem_intra4x4_pred_mode++;
  764|       |
  765|   391k|        i4x4_luma_blk_idx--;
  766|   391k|    }
  767|   391k|    while(i4x4_luma_blk_idx);
  ------------------
  |  Branch (767:11): [True: 346k, False: 44.9k]
  ------------------
  768|       |
  769|  44.9k|    ps_cab_env->u4_code_int_range = u4_code_int_range;
  770|  44.9k|    ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
  771|       |
  772|  44.9k|    return (0);
  773|       |
  774|  44.9k|}
ih264d_parse_ctx_cbp_cabac:
  790|   302k|{
  791|       |
  792|   302k|    UWORD32 u4_cxt_inc;
  793|   302k|    decoding_envirnoment_t * ps_cab_env = &ps_dec->s_cab_dec_env;
  794|   302k|    dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
  795|   302k|    ctxt_inc_mb_info_t * ps_left_ctxt = ps_dec->p_left_ctxt_mb_info;
  796|   302k|    ctxt_inc_mb_info_t * ps_top_ctxt = ps_dec->p_top_ctxt_mb_info;
  797|   302k|    bin_ctxt_model_t *ps_ctxt_cbp_luma = ps_dec->p_cbp_luma_t, *ps_bin_ctxt;
  798|   302k|    WORD8 c_Cbp; //,i,j;
  799|   302k|    UWORD32 u4_code_int_range, u4_code_int_val_ofst;
  800|   302k|    UWORD32 u4_offset, *pu4_buffer;
  801|   302k|    const UWORD32 *pu4_table = (const UWORD32 *)ps_cab_env->cabac_table;
  802|       |
  803|   302k|    INC_SYM_COUNT(ps_cab_env);
  804|       |
  805|       |
  806|       |
  807|       |    /* CBP Luma, FL, Cmax = 15, L = 4 */
  808|   302k|    u4_cxt_inc = (!((ps_top_ctxt->u1_cbp >> 2) & 0x01)) << 1;
  809|   302k|    u4_cxt_inc += !((ps_left_ctxt->u1_cbp >> 1) & 0x01);
  810|       |
  811|   302k|    u4_offset = ps_bitstrm->u4_ofst;
  812|   302k|    pu4_buffer = ps_bitstrm->pu4_buffer;
  813|       |
  814|   302k|    u4_code_int_range = ps_cab_env->u4_code_int_range;
  815|   302k|    u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
  816|       |    /*renormalize to ensure there 23 bits more in the u4_code_int_val_ofst*/
  817|   302k|    {
  818|   302k|        UWORD32 u4_clz, read_bits;
  819|       |
  820|   302k|        u4_clz = CLZ(u4_code_int_range);
  821|   302k|        FLUSHBITS(u4_offset, u4_clz)
  ------------------
  |  |  193|   302k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  194|   302k|{                                                                           \
  |  |  195|   302k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  196|   302k|}
  ------------------
  822|   302k|        NEXTBITS(read_bits, u4_offset, pu4_buffer, 23)
  ------------------
  |  |  137|   302k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  138|   302k|{                                                                           \
  |  |  139|   302k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  140|   302k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  141|   302k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  142|   302k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  143|   302k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (143:8): [True: 293k, False: 8.65k]
  |  |  ------------------
  |  |  144|   302k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|   293k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  145|   302k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|   302k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  146|   302k|}
  ------------------
  823|   302k|        u4_code_int_range = u4_code_int_range << u4_clz;
  824|   302k|        u4_code_int_val_ofst = (u4_code_int_val_ofst << u4_clz) | read_bits;
  825|   302k|    }
  826|       |
  827|   302k|    ps_bin_ctxt = ps_ctxt_cbp_luma + u4_cxt_inc;
  828|       |
  829|       |    /*inlining DecodeDecision_onebin without renorm*/
  830|   302k|    {
  831|       |
  832|   302k|        UWORD32 u4_qnt_int_range, u4_int_range_lps;
  833|   302k|        UWORD32 u4_symbol, u1_mps_state;
  834|   302k|        UWORD32 table_lookup;
  835|   302k|        UWORD32 u4_clz;
  836|       |
  837|   302k|        u1_mps_state = (ps_bin_ctxt->u1_mps_state);
  838|       |
  839|   302k|        u4_clz = CLZ(u4_code_int_range);
  840|   302k|        u4_qnt_int_range = u4_code_int_range << u4_clz;
  841|   302k|        u4_qnt_int_range = (u4_qnt_int_range >> 29) & 0x3;
  842|       |
  843|   302k|        table_lookup = pu4_table[(u1_mps_state << 2) + u4_qnt_int_range];
  844|   302k|        u4_int_range_lps = table_lookup & 0xff;
  845|       |
  846|   302k|        u4_int_range_lps = u4_int_range_lps << (23 - u4_clz);
  847|   302k|        u4_code_int_range = u4_code_int_range - u4_int_range_lps;
  848|       |
  849|   302k|        u4_symbol = ((u1_mps_state >> 6) & 0x1);
  850|       |
  851|       |        /*if mps*/
  852|   302k|        u1_mps_state = (table_lookup >> 8) & 0x7F;
  853|       |
  854|   302k|        CHECK_IF_LPS(u4_code_int_range, u4_code_int_val_ofst, u4_symbol,
  ------------------
  |  |  184|   302k|                    u4_codeIntRangeLPS_m,u1_mps_state_m,table_lookup_m)                     \
  |  |  185|   302k|{                                                                                         \
  |  |  186|   302k|  if(u4_codeIntValOffset_m >= u4_codeIntRange_m)                                            \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 23.6k, False: 278k]
  |  |  ------------------
  |  |  187|   302k|  {                                                                                         \
  |  |  188|  23.6k|      u4_symbol_m = 1 - u4_symbol_m;                                                        \
  |  |  189|  23.6k|      u4_codeIntValOffset_m -= u4_codeIntRange_m;                                           \
  |  |  190|  23.6k|      u4_codeIntRange_m = u4_codeIntRangeLPS_m;                                             \
  |  |  191|  23.6k|      u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                       \
  |  |  192|  23.6k|  }                                                                                         \
  |  |  193|   302k|}
  ------------------
  855|   302k|                     u4_int_range_lps, u1_mps_state, table_lookup)
  856|       |
  857|   302k|        INC_BIN_COUNT(ps_cab_env);
  858|       |
  859|   302k|        ps_bin_ctxt->u1_mps_state = u1_mps_state;
  860|       |
  861|   302k|        c_Cbp = u4_symbol;
  862|       |
  863|   302k|    }
  864|       |
  865|   302k|    u4_cxt_inc = (!((ps_top_ctxt->u1_cbp >> 3) & 0x01)) << 1;
  866|   302k|    u4_cxt_inc += !(c_Cbp & 0x01);
  867|   302k|    ps_bin_ctxt = ps_ctxt_cbp_luma + u4_cxt_inc;
  868|       |    /*inlining DecodeDecision_onebin without renorm*/
  869|       |
  870|   302k|    {
  871|       |
  872|   302k|        UWORD32 u4_qnt_int_range, u4_int_range_lps;
  873|   302k|        UWORD32 u4_symbol, u1_mps_state;
  874|   302k|        UWORD32 table_lookup;
  875|   302k|        UWORD32 u4_clz;
  876|       |
  877|   302k|        u1_mps_state = (ps_bin_ctxt->u1_mps_state);
  878|       |
  879|   302k|        u4_clz = CLZ(u4_code_int_range);
  880|   302k|        u4_qnt_int_range = u4_code_int_range << u4_clz;
  881|   302k|        u4_qnt_int_range = (u4_qnt_int_range >> 29) & 0x3;
  882|       |
  883|   302k|        table_lookup = pu4_table[(u1_mps_state << 2) + u4_qnt_int_range];
  884|   302k|        u4_int_range_lps = table_lookup & 0xff;
  885|       |
  886|   302k|        u4_int_range_lps = u4_int_range_lps << (23 - u4_clz);
  887|   302k|        u4_code_int_range = u4_code_int_range - u4_int_range_lps;
  888|       |
  889|   302k|        u4_symbol = ((u1_mps_state >> 6) & 0x1);
  890|       |
  891|       |        /*if mps*/
  892|   302k|        u1_mps_state = (table_lookup >> 8) & 0x7F;
  893|       |
  894|   302k|        CHECK_IF_LPS(u4_code_int_range, u4_code_int_val_ofst, u4_symbol,
  ------------------
  |  |  184|   302k|                    u4_codeIntRangeLPS_m,u1_mps_state_m,table_lookup_m)                     \
  |  |  185|   302k|{                                                                                         \
  |  |  186|   302k|  if(u4_codeIntValOffset_m >= u4_codeIntRange_m)                                            \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 20.3k, False: 281k]
  |  |  ------------------
  |  |  187|   302k|  {                                                                                         \
  |  |  188|  20.3k|      u4_symbol_m = 1 - u4_symbol_m;                                                        \
  |  |  189|  20.3k|      u4_codeIntValOffset_m -= u4_codeIntRange_m;                                           \
  |  |  190|  20.3k|      u4_codeIntRange_m = u4_codeIntRangeLPS_m;                                             \
  |  |  191|  20.3k|      u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                       \
  |  |  192|  20.3k|  }                                                                                         \
  |  |  193|   302k|}
  ------------------
  895|   302k|                     u4_int_range_lps, u1_mps_state, table_lookup)
  896|       |
  897|   302k|        INC_BIN_COUNT(ps_cab_env);
  898|       |
  899|   302k|        ps_bin_ctxt->u1_mps_state = u1_mps_state;
  900|       |
  901|   302k|        c_Cbp |= u4_symbol << 1;
  902|       |
  903|   302k|    }
  904|       |
  905|   302k|    u4_cxt_inc = (!(c_Cbp & 0x01)) << 1;
  906|   302k|    u4_cxt_inc += !((ps_left_ctxt->u1_cbp >> 3) & 0x01);
  907|   302k|    ps_bin_ctxt = ps_ctxt_cbp_luma + u4_cxt_inc;
  908|       |    /*inlining DecodeDecision_onebin without renorm*/
  909|       |
  910|   302k|    {
  911|       |
  912|   302k|        UWORD32 u4_qnt_int_range, u4_int_range_lps;
  913|   302k|        UWORD32 u4_symbol, u1_mps_state;
  914|   302k|        UWORD32 table_lookup;
  915|   302k|        UWORD32 u4_clz;
  916|       |
  917|   302k|        u1_mps_state = (ps_bin_ctxt->u1_mps_state);
  918|       |
  919|   302k|        u4_clz = CLZ(u4_code_int_range);
  920|   302k|        u4_qnt_int_range = u4_code_int_range << u4_clz;
  921|   302k|        u4_qnt_int_range = (u4_qnt_int_range >> 29) & 0x3;
  922|       |
  923|   302k|        table_lookup = pu4_table[(u1_mps_state << 2) + u4_qnt_int_range];
  924|   302k|        u4_int_range_lps = table_lookup & 0xff;
  925|       |
  926|   302k|        u4_int_range_lps = u4_int_range_lps << (23 - u4_clz);
  927|   302k|        u4_code_int_range = u4_code_int_range - u4_int_range_lps;
  928|       |
  929|   302k|        u4_symbol = ((u1_mps_state >> 6) & 0x1);
  930|       |
  931|       |        /*if mps*/
  932|   302k|        u1_mps_state = (table_lookup >> 8) & 0x7F;
  933|       |
  934|   302k|        CHECK_IF_LPS(u4_code_int_range, u4_code_int_val_ofst, u4_symbol,
  ------------------
  |  |  184|   302k|                    u4_codeIntRangeLPS_m,u1_mps_state_m,table_lookup_m)                     \
  |  |  185|   302k|{                                                                                         \
  |  |  186|   302k|  if(u4_codeIntValOffset_m >= u4_codeIntRange_m)                                            \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 23.1k, False: 279k]
  |  |  ------------------
  |  |  187|   302k|  {                                                                                         \
  |  |  188|  23.1k|      u4_symbol_m = 1 - u4_symbol_m;                                                        \
  |  |  189|  23.1k|      u4_codeIntValOffset_m -= u4_codeIntRange_m;                                           \
  |  |  190|  23.1k|      u4_codeIntRange_m = u4_codeIntRangeLPS_m;                                             \
  |  |  191|  23.1k|      u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                       \
  |  |  192|  23.1k|  }                                                                                         \
  |  |  193|   302k|}
  ------------------
  935|   302k|                     u4_int_range_lps, u1_mps_state, table_lookup)
  936|       |
  937|   302k|        INC_BIN_COUNT(ps_cab_env);
  938|       |
  939|   302k|        ps_bin_ctxt->u1_mps_state = u1_mps_state;
  940|       |
  941|   302k|        c_Cbp |= u4_symbol << 2;
  942|       |
  943|   302k|    }
  944|       |
  945|   302k|    u4_cxt_inc = (!((c_Cbp >> 1) & 0x01)) << 1;
  946|   302k|    u4_cxt_inc += !((c_Cbp >> 2) & 0x01);
  947|   302k|    ps_bin_ctxt = ps_ctxt_cbp_luma + u4_cxt_inc;
  948|       |    /*inlining DecodeDecision_onebin without renorm*/
  949|       |
  950|   302k|    {
  951|       |
  952|   302k|        UWORD32 u4_qnt_int_range, u4_int_range_lps;
  953|   302k|        UWORD32 u4_symbol, u1_mps_state;
  954|   302k|        UWORD32 table_lookup;
  955|   302k|        UWORD32 u4_clz;
  956|       |
  957|   302k|        u1_mps_state = (ps_bin_ctxt->u1_mps_state);
  958|       |
  959|   302k|        u4_clz = CLZ(u4_code_int_range);
  960|   302k|        u4_qnt_int_range = u4_code_int_range << u4_clz;
  961|   302k|        u4_qnt_int_range = (u4_qnt_int_range >> 29) & 0x3;
  962|       |
  963|   302k|        table_lookup = pu4_table[(u1_mps_state << 2) + u4_qnt_int_range];
  964|   302k|        u4_int_range_lps = table_lookup & 0xff;
  965|       |
  966|   302k|        u4_int_range_lps = u4_int_range_lps << (23 - u4_clz);
  967|   302k|        u4_code_int_range = u4_code_int_range - u4_int_range_lps;
  968|       |
  969|   302k|        u4_symbol = ((u1_mps_state >> 6) & 0x1);
  970|       |
  971|       |        /*if mps*/
  972|   302k|        u1_mps_state = (table_lookup >> 8) & 0x7F;
  973|       |
  974|   302k|        CHECK_IF_LPS(u4_code_int_range, u4_code_int_val_ofst, u4_symbol,
  ------------------
  |  |  184|   302k|                    u4_codeIntRangeLPS_m,u1_mps_state_m,table_lookup_m)                     \
  |  |  185|   302k|{                                                                                         \
  |  |  186|   302k|  if(u4_codeIntValOffset_m >= u4_codeIntRange_m)                                            \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 22.6k, False: 279k]
  |  |  ------------------
  |  |  187|   302k|  {                                                                                         \
  |  |  188|  22.6k|      u4_symbol_m = 1 - u4_symbol_m;                                                        \
  |  |  189|  22.6k|      u4_codeIntValOffset_m -= u4_codeIntRange_m;                                           \
  |  |  190|  22.6k|      u4_codeIntRange_m = u4_codeIntRangeLPS_m;                                             \
  |  |  191|  22.6k|      u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                       \
  |  |  192|  22.6k|  }                                                                                         \
  |  |  193|   302k|}
  ------------------
  975|   302k|                     u4_int_range_lps, u1_mps_state, table_lookup)
  976|       |
  977|   302k|        INC_BIN_COUNT(ps_cab_env);
  978|       |
  979|   302k|        ps_bin_ctxt->u1_mps_state = u1_mps_state;
  980|       |
  981|   302k|        c_Cbp |= u4_symbol << 3;
  982|       |
  983|   302k|    }
  984|       |
  985|   302k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)
  ------------------
  |  |  113|   302k|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  ------------------
  |  Branch (985:8): [True: 0, False: 302k]
  ------------------
  986|      0|    {
  987|       |
  988|      0|        RENORM_RANGE_OFFSET(u4_code_int_range, u4_code_int_val_ofst, u4_offset,
  ------------------
  |  |  170|      0|  {                                                                                         \
  |  |  171|      0|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|      0|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|      0|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|      0|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|      0|{                                                                           \
  |  |  |  |  139|      0|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|      0|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|      0|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|      0|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|      0|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  |  144|      0|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|      0|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|      0|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|      0|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|      0|}
  |  |  ------------------
  |  |  174|      0|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|      0|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|      0|{                                                                           \
  |  |  |  |  195|      0|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|      0|}
  |  |  ------------------
  |  |  175|      0|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|      0|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|      0|  }
  ------------------
  989|      0|                            pu4_buffer)
  990|       |
  991|      0|    }
  992|       |
  993|   302k|    {
  994|   302k|        UWORD32 u4_cxt_inc;
  995|   302k|        WORD8 a, b, c, d;
  996|   302k|        bin_ctxt_model_t *p_CtxtCbpChroma = ps_dec->p_cbp_chroma_t;
  997|       |
  998|       |        /* CBP Chroma, TU, Cmax = 2 */
  999|   302k|        a = 0;
 1000|   302k|        b = 0;
 1001|   302k|        c = 0;
 1002|   302k|        d = 0;
 1003|       |
 1004|   302k|        {
 1005|   302k|            a = (ps_top_ctxt->u1_cbp > 15) ? 2 : 0;
  ------------------
  |  Branch (1005:17): [True: 24.3k, False: 278k]
  ------------------
 1006|   302k|            c = (ps_top_ctxt->u1_cbp > 31) ? 2 : 0;
  ------------------
  |  Branch (1006:17): [True: 13.7k, False: 288k]
  ------------------
 1007|   302k|        }
 1008|       |
 1009|   302k|        {
 1010|   302k|            b = (ps_left_ctxt->u1_cbp > 15) ? 1 : 0;
  ------------------
  |  Branch (1010:17): [True: 20.6k, False: 281k]
  ------------------
 1011|   302k|            d = (ps_left_ctxt->u1_cbp > 31) ? 1 : 0;
  ------------------
  |  Branch (1011:17): [True: 10.8k, False: 291k]
  ------------------
 1012|   302k|        }
 1013|   302k|        u4_cxt_inc = a + b;
 1014|   302k|        u4_cxt_inc = (u4_cxt_inc | ((4 + c + d) << 4));
 1015|       |
 1016|       |        /*inlining ih264d_decode_bins_tunary */
 1017|       |
 1018|   302k|        {
 1019|       |
 1020|   302k|            UWORD8 u1_max_bins = 2;
 1021|   302k|            UWORD32 u4_ctx_inc = u4_cxt_inc;
 1022|       |
 1023|   302k|            UWORD32 u4_value;
 1024|   302k|            UWORD32 u4_symbol;
 1025|   302k|            UWORD8 u4_ctx_Inc;
 1026|   302k|            bin_ctxt_model_t *ps_bin_ctxt;
 1027|   302k|            u4_value = 0;
 1028|       |
 1029|   302k|            do
 1030|   339k|            {
 1031|   339k|                u4_ctx_Inc = u4_ctx_inc & 0xF;
 1032|   339k|                u4_ctx_inc = u4_ctx_inc >> 4;
 1033|       |
 1034|   339k|                ps_bin_ctxt = p_CtxtCbpChroma + u4_ctx_Inc;
 1035|       |                /*inlining DecodeDecision_onebin*/
 1036|   339k|                {
 1037|       |
 1038|   339k|                    UWORD32 u4_qnt_int_range, u4_int_range_lps;
 1039|       |
 1040|   339k|                    UWORD32 u1_mps_state;
 1041|   339k|                    UWORD32 table_lookup;
 1042|   339k|                    UWORD32 u4_clz;
 1043|       |
 1044|   339k|                    u1_mps_state = (ps_bin_ctxt->u1_mps_state);
 1045|       |
 1046|   339k|                    u4_clz = CLZ(u4_code_int_range);
 1047|   339k|                    u4_qnt_int_range = u4_code_int_range << u4_clz;
 1048|   339k|                    u4_qnt_int_range = (u4_qnt_int_range >> 29) & 0x3;
 1049|       |
 1050|   339k|                    table_lookup = pu4_table[(u1_mps_state << 2)
 1051|   339k|                                    + u4_qnt_int_range];
 1052|   339k|                    u4_int_range_lps = table_lookup & 0xff;
 1053|       |
 1054|   339k|                    u4_int_range_lps = u4_int_range_lps << (23 - u4_clz);
 1055|   339k|                    u4_code_int_range = u4_code_int_range - u4_int_range_lps;
 1056|       |
 1057|   339k|                    u4_symbol = ((u1_mps_state >> 6) & 0x1);
 1058|       |
 1059|       |                    /*if mps*/
 1060|   339k|                    u1_mps_state = (table_lookup >> 8) & 0x7F;
 1061|       |
 1062|   339k|                    CHECK_IF_LPS(u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  184|   339k|                    u4_codeIntRangeLPS_m,u1_mps_state_m,table_lookup_m)                     \
  |  |  185|   339k|{                                                                                         \
  |  |  186|   339k|  if(u4_codeIntValOffset_m >= u4_codeIntRange_m)                                            \
  |  |  ------------------
  |  |  |  Branch (186:6): [True: 28.2k, False: 310k]
  |  |  ------------------
  |  |  187|   339k|  {                                                                                         \
  |  |  188|  28.2k|      u4_symbol_m = 1 - u4_symbol_m;                                                        \
  |  |  189|  28.2k|      u4_codeIntValOffset_m -= u4_codeIntRange_m;                                           \
  |  |  190|  28.2k|      u4_codeIntRange_m = u4_codeIntRangeLPS_m;                                             \
  |  |  191|  28.2k|      u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                       \
  |  |  192|  28.2k|  }                                                                                         \
  |  |  193|   339k|}
  ------------------
 1063|   339k|                                 u4_symbol, u4_int_range_lps, u1_mps_state,
 1064|   339k|                                 table_lookup)
 1065|       |
 1066|   339k|                    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)
  ------------------
  |  |  113|   339k|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  ------------------
  |  Branch (1066:24): [True: 142, False: 339k]
  ------------------
 1067|    142|                    {
 1068|    142|                        RENORM_RANGE_OFFSET(u4_code_int_range,
  ------------------
  |  |  170|    142|  {                                                                                         \
  |  |  171|    142|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|    142|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|    142|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|    142|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|    142|{                                                                           \
  |  |  |  |  139|    142|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|    142|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|    142|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|    142|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|    142|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 74, False: 68]
  |  |  |  |  ------------------
  |  |  |  |  144|    142|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|     74|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|    142|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    142|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|    142|}
  |  |  ------------------
  |  |  174|    142|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|    142|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|    142|{                                                                           \
  |  |  |  |  195|    142|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|    142|}
  |  |  ------------------
  |  |  175|    142|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|    142|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|    142|  }
  ------------------
 1069|    142|                                            u4_code_int_val_ofst, u4_offset,
 1070|    142|                                            pu4_buffer)
 1071|    142|                    }
 1072|   339k|                    ps_bin_ctxt->u1_mps_state = u1_mps_state;
 1073|   339k|                }
 1074|       |
 1075|   339k|                INC_BIN_COUNT(ps_cab_env);INC_DECISION_BINS(
 1076|   339k|                                ps_cab_env);
 1077|       |
 1078|   339k|                u4_value++;
 1079|   339k|            }
 1080|   339k|            while((u4_value < u1_max_bins) & (u4_symbol));
  ------------------
  |  Branch (1080:19): [True: 36.8k, False: 302k]
  ------------------
 1081|       |
 1082|   302k|            u4_value = u4_value - 1 + u4_symbol;
 1083|       |
 1084|   302k|            a = (u4_value);
 1085|       |
 1086|   302k|        }
 1087|       |
 1088|   302k|c_Cbp = (c_Cbp | (a << 4));
 1089|   302k|}
 1090|       |
 1091|   302k|ps_bitstrm->u4_ofst = u4_offset;
 1092|       |
 1093|   302k|ps_cab_env->u4_code_int_range = u4_code_int_range;
 1094|   302k|ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
 1095|       |
 1096|   302k|return (c_Cbp);
 1097|   302k|}
ih264d_get_mvd_cabac:
 1119|   843k|{
 1120|   843k|    UWORD8 u1_abs_mvd_x = 0, u1_abs_mvd_y = 0;
 1121|   843k|    UWORD8 u1_sub_mb_x, u1_sub_mb_y;
 1122|   843k|    UWORD8 *pu1_top_mv_ctxt, *pu1_lft_mv_ctxt;
 1123|   843k|    WORD16 *pi2_mv;
 1124|       |
 1125|   843k|    u1_sub_mb_x = (UWORD8)(u1_sub_mb & 0x03);
 1126|   843k|    u1_sub_mb_y = (UWORD8)(u1_sub_mb >> 2);
 1127|   843k|    pu1_top_mv_ctxt = &ps_dec->ps_curr_ctxt_mb_info->u1_mv[u1_sub_mb_x][u1_b2];
 1128|   843k|    pu1_lft_mv_ctxt = &ps_dec->pu1_left_mv_ctxt_inc[u1_sub_mb_y][u1_b2];
 1129|   843k|    pi2_mv = &ps_mv->i2_mv[u1_b2];
 1130|       |
 1131|   843k|    if(u1_dec_mvd)
  ------------------
  |  Branch (1131:8): [True: 616k, False: 227k]
  ------------------
 1132|   616k|    {
 1133|   616k|        WORD16 i2_mv_x, i2_mv_y;
 1134|   616k|        WORD32 i2_temp;
 1135|   616k|        {
 1136|   616k|            decoding_envirnoment_t * ps_cab_env = &ps_dec->s_cab_dec_env;
 1137|   616k|            dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
 1138|   616k|            UWORD16 u2_abs_mvd_x_a, u2_abs_mvd_x_b, u2_abs_mvd_y_a,
 1139|   616k|                            u2_abs_mvd_y_b;
 1140|       |
 1141|   616k|            u2_abs_mvd_x_b = (UWORD16)pu1_top_mv_ctxt[0];
 1142|   616k|            u2_abs_mvd_y_b = (UWORD16)pu1_top_mv_ctxt[1];
 1143|   616k|            u2_abs_mvd_x_a = (UWORD16)pu1_lft_mv_ctxt[0];
 1144|   616k|            u2_abs_mvd_y_a = (UWORD16)pu1_lft_mv_ctxt[1];
 1145|       |
 1146|   616k|            i2_temp = u2_abs_mvd_x_a + u2_abs_mvd_x_b;
 1147|       |
 1148|   616k|            i2_mv_x = ih264d_parse_mvd_cabac(ps_bitstrm, ps_cab_env,
 1149|   616k|                                             ps_dec->p_mvd_x_t, i2_temp);
 1150|       |
 1151|   616k|            i2_temp = u2_abs_mvd_y_a + u2_abs_mvd_y_b;
 1152|       |
 1153|   616k|            i2_mv_y = ih264d_parse_mvd_cabac(ps_bitstrm, ps_cab_env,
 1154|   616k|                                             ps_dec->p_mvd_y_t, i2_temp);
 1155|   616k|        }
 1156|       |
 1157|       |        /***********************************************************************/
 1158|       |        /* Store the abs_mvd_values in cabac contexts                          */
 1159|       |        /* The follownig code can be easily optimzed if mvX, mvY clip values   */
 1160|       |        /* are packed in 16 bits follwed by memcpy                             */
 1161|       |        /***********************************************************************/
 1162|   616k|        u1_abs_mvd_x = CLIP3(0, 127, ABS(i2_mv_x));
  ------------------
  |  |   77|  1.23M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 616k]
  |  |  |  Branch (77:33): [True: 84.2k, False: 532k]
  |  |  |  Branch (77:54): [True: 1.54k, False: 614k]
  |  |  |  Branch (77:56): [True: 84.2k, False: 532k]
  |  |  |  Branch (77:77): [True: 83.5k, False: 531k]
  |  |  ------------------
  ------------------
 1163|   616k|        u1_abs_mvd_y = CLIP3(0, 127, ABS(i2_mv_y));
  ------------------
  |  |   77|  1.23M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 616k]
  |  |  |  Branch (77:33): [True: 64.0k, False: 552k]
  |  |  |  Branch (77:54): [True: 1.34k, False: 615k]
  |  |  |  Branch (77:56): [True: 64.0k, False: 552k]
  |  |  |  Branch (77:77): [True: 63.3k, False: 551k]
  |  |  ------------------
  ------------------
 1164|       |
 1165|   616k|        COPYTHECONTEXT("MVD", i2_mv_x);COPYTHECONTEXT("MVD", i2_mv_y);
 1166|       |
 1167|       |        /* Storing Mv residuals */
 1168|   616k|        pi2_mv[0] = i2_mv_x;
 1169|   616k|        pi2_mv[1] = i2_mv_y;
 1170|   616k|    }
 1171|       |
 1172|       |    /***************************************************************/
 1173|       |    /* Store abs_mvd_values cabac contexts                         */
 1174|       |    /***************************************************************/
 1175|   843k|    {
 1176|   843k|        UWORD8 u1_i;
 1177|  3.00M|        for(u1_i = 0; u1_i < u1_part_wd; u1_i++, pu1_top_mv_ctxt += 4)
  ------------------
  |  Branch (1177:23): [True: 2.16M, False: 843k]
  ------------------
 1178|  2.16M|        {
 1179|  2.16M|            pu1_top_mv_ctxt[0] = u1_abs_mvd_x;
 1180|  2.16M|            pu1_top_mv_ctxt[1] = u1_abs_mvd_y;
 1181|  2.16M|        }
 1182|       |
 1183|  2.82M|        for(u1_i = 0; u1_i < u1_part_ht; u1_i++, pu1_lft_mv_ctxt += 4)
  ------------------
  |  Branch (1183:23): [True: 1.98M, False: 843k]
  ------------------
 1184|  1.98M|        {
 1185|  1.98M|            pu1_lft_mv_ctxt[0] = u1_abs_mvd_x;
 1186|  1.98M|            pu1_lft_mv_ctxt[1] = u1_abs_mvd_y;
 1187|  1.98M|        }
 1188|   843k|    }
 1189|   843k|}
ih264d_parse_mvd_cabac:
 1222|  1.23M|{
 1223|  1.23M|    WORD8 k;
 1224|  1.23M|    WORD16 i2_suf;
 1225|  1.23M|    WORD16 i2_mvd;
 1226|  1.23M|    UWORD16 u2_abs_mvd;
 1227|  1.23M|    UWORD32 u4_ctx_inc;
 1228|  1.23M|    UWORD32 u4_prefix;
 1229|  1.23M|    const UWORD32 *pu4_table = (const UWORD32 *)ps_cab_env->cabac_table;
 1230|  1.23M|    UWORD32 u4_code_int_range, u4_code_int_val_ofst;
 1231|       |
 1232|       |    /*  if mvd < 9                                                  */
 1233|       |    /*  mvd =  Prefix                                                   */
 1234|       |    /*  else                                                            */
 1235|       |    /*  mvd = Prefix + Suffix                                           */
 1236|       |    /*  decode sign bit                                                 */
 1237|       |    /*  Prefix TU decoding Cmax =Ucoff and Suffix 3rd order Exp-Golomb  */
 1238|       |
 1239|  1.23M|    u2_abs_mvd = (UWORD16)i4_temp;
 1240|  1.23M|    u4_ctx_inc = 1;
 1241|       |
 1242|  1.23M|    if(u2_abs_mvd < 3)
  ------------------
  |  Branch (1242:8): [True: 952k, False: 279k]
  ------------------
 1243|   952k|        u4_ctx_inc = 0;
 1244|   279k|    else if(u2_abs_mvd > 32)
  ------------------
  |  Branch (1244:13): [True: 16.2k, False: 263k]
  ------------------
 1245|  16.2k|        u4_ctx_inc = 2;
 1246|       |
 1247|  1.23M|    u4_ctx_inc = (u4_ctx_inc | 0x65430);
 1248|       |
 1249|       |    /*inlining modified version of ih264d_decode_bins_unary*/
 1250|       |
 1251|  1.23M|    {
 1252|  1.23M|        UWORD8 u1_max_bins = 9;
 1253|  1.23M|        UWORD32 u4_value;
 1254|  1.23M|        UWORD32 u4_symbol;
 1255|  1.23M|        bin_ctxt_model_t *ps_bin_ctxt;
 1256|  1.23M|        UWORD32 u4_ctx_Inc;
 1257|       |
 1258|  1.23M|        u4_value = 0;
 1259|  1.23M|        u4_code_int_range = ps_cab_env->u4_code_int_range;
 1260|  1.23M|        u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
 1261|       |
 1262|  1.23M|        do
 1263|  2.63M|        {
 1264|  2.63M|            u4_ctx_Inc = u4_ctx_inc & 0xf;
 1265|  2.63M|            u4_ctx_inc = u4_ctx_inc >> 4;
 1266|       |
 1267|  2.63M|            ps_bin_ctxt = p_ctxt_mvd + u4_ctx_Inc;
 1268|       |
 1269|  2.63M|            DECODE_ONE_BIN_MACRO(ps_bin_ctxt, u4_code_int_range,
  ------------------
  |  |  217|  2.63M|                     p_DecBitStream_arg,u4_symbol)                                           \
  |  |  218|  2.63M|{                                                                                       \
  |  |  219|  2.63M|    bin_ctxt_model_t *p_binCtxt_m = (bin_ctxt_model_t *) p_binCtxt_arg;                           \
  |  |  220|  2.63M|    dec_bit_stream_t *p_DecBitStream_m = (dec_bit_stream_t *) p_DecBitStream_arg;                 \
  |  |  221|  2.63M|    const UWORD32 *pu4_table_m = (const UWORD32 *) pu4_table_arg;                         \
  |  |  222|  2.63M|                                                                                        \
  |  |  223|  2.63M|    UWORD32 u4_quantCodeIntRange_m,u4_codeIntRangeLPS_m;                                    \
  |  |  224|  2.63M|    UWORD32 u1_mps_state_m;                                                               \
  |  |  225|  2.63M|    UWORD32 table_lookup_m;                                                               \
  |  |  226|  2.63M|    UWORD32 u4_clz_m;                                                                     \
  |  |  227|  2.63M|                                                                                        \
  |  |  228|  2.63M|    u1_mps_state_m = (p_binCtxt_m->u1_mps_state);                                           \
  |  |  229|  2.63M|    u4_clz_m = CLZ(u4_code_int_range);                                                  \
  |  |  230|  2.63M|    u4_quantCodeIntRange_m = u4_code_int_range << u4_clz_m;                                   \
  |  |  231|  2.63M|    u4_quantCodeIntRange_m = (u4_quantCodeIntRange_m >> 29) & 0x3;                          \
  |  |  232|  2.63M|    table_lookup_m = pu4_table_m[(u1_mps_state_m << 2)+u4_quantCodeIntRange_m];                 \
  |  |  233|  2.63M|    u4_codeIntRangeLPS_m = table_lookup_m & 0xff;                                           \
  |  |  234|  2.63M|                                                                                        \
  |  |  235|  2.63M|    u4_codeIntRangeLPS_m = u4_codeIntRangeLPS_m << (23 - u4_clz_m);                           \
  |  |  236|  2.63M|    u4_code_int_range = u4_code_int_range - u4_codeIntRangeLPS_m;                             \
  |  |  237|  2.63M|    u4_symbol = ((u1_mps_state_m>> 6) & 0x1);                                             \
  |  |  238|  2.63M|    /*if mps*/                                                                          \
  |  |  239|  2.63M|    u1_mps_state_m = (table_lookup_m >> 8) & 0x7F;                                          \
  |  |  240|  2.63M|    if(u4_code_int_val_ofst >= u4_code_int_range)                                          \
  |  |  ------------------
  |  |  |  Branch (240:8): [True: 335k, False: 2.30M]
  |  |  ------------------
  |  |  241|  2.63M|  {                                                                                     \
  |  |  242|   335k|                                                                                        \
  |  |  243|   335k|    u4_symbol = 1 - u4_symbol;                                                          \
  |  |  244|   335k|    u4_code_int_val_ofst -= u4_code_int_range;                                             \
  |  |  245|   335k|    u4_code_int_range = u4_codeIntRangeLPS_m;                                               \
  |  |  246|   335k|    u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                         \
  |  |  247|   335k|  }                                                                                     \
  |  |  248|  2.63M|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)                                        \
  |  |  ------------------
  |  |  |  |  113|  5.27M|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  |  |  ------------------
  |  |  |  Branch (248:8): [True: 33.7k, False: 2.60M]
  |  |  ------------------
  |  |  249|  2.63M|    {                                                                                   \
  |  |  250|  33.7k|        UWORD32 *pu4_buffer,u4_offset;                                                  \
  |  |  251|  33.7k|        UWORD32 read_bits,u4_clz_m  ;                                                     \
  |  |  252|  33.7k|                                                                                        \
  |  |  253|  33.7k|        pu4_buffer = p_DecBitStream_m->pu4_buffer;                                         \
  |  |  254|  33.7k|        u4_offset = p_DecBitStream_m->u4_ofst;                                          \
  |  |  255|  33.7k|        u4_clz_m = CLZ(u4_code_int_range);                                              \
  |  |  256|  33.7k|        NEXTBITS(read_bits,(u4_offset+23),pu4_buffer,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  33.7k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  33.7k|{                                                                           \
  |  |  |  |  139|  33.7k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  33.7k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  33.7k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  33.7k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  33.7k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 32.3k, False: 1.39k]
  |  |  |  |  ------------------
  |  |  |  |  144|  33.7k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  32.3k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  33.7k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  33.7k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  33.7k|}
  |  |  ------------------
  |  |  257|  33.7k|        FLUSHBITS(u4_offset,(u4_clz_m))                                                   \
  |  |  ------------------
  |  |  |  |  193|  33.7k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  33.7k|{                                                                           \
  |  |  |  |  195|  33.7k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  33.7k|}
  |  |  ------------------
  |  |  258|  33.7k|        u4_code_int_range = u4_code_int_range << u4_clz_m;                                    \
  |  |  259|  33.7k|        u4_code_int_val_ofst= (u4_code_int_val_ofst << u4_clz_m) | read_bits;               \
  |  |  260|  33.7k|                                                                                        \
  |  |  261|  33.7k|                                                                                        \
  |  |  262|  33.7k|        p_DecBitStream_m->u4_ofst = u4_offset;                                          \
  |  |  263|  33.7k|    }                                                                                   \
  |  |  264|  2.63M|    p_binCtxt_m->u1_mps_state = u1_mps_state_m;                                             \
  |  |  265|  2.63M|}
  ------------------
 1270|  2.63M|                                 u4_code_int_val_ofst, pu4_table, ps_bitstrm,
 1271|  2.63M|                                 u4_symbol)
 1272|       |
 1273|  2.63M|            INC_BIN_COUNT(ps_cab_env);INC_DECISION_BINS(ps_cab_env);
 1274|       |
 1275|  2.63M|            u4_value++;
 1276|       |
 1277|  2.63M|        }
 1278|  2.63M|        while(u4_symbol && u4_value < 5);
  ------------------
  |  Branch (1278:15): [True: 1.59M, False: 1.03M]
  |  Branch (1278:28): [True: 1.40M, False: 194k]
  ------------------
 1279|       |
 1280|  1.23M|        ps_bin_ctxt = p_ctxt_mvd + 6;
 1281|       |
 1282|  1.23M|        if(u4_symbol && (u4_value < u1_max_bins))
  ------------------
  |  Branch (1282:12): [True: 194k, False: 1.03M]
  |  Branch (1282:25): [True: 194k, False: 0]
  ------------------
 1283|   194k|        {
 1284|       |
 1285|   194k|            do
 1286|   737k|            {
 1287|       |
 1288|   737k|                DECODE_ONE_BIN_MACRO(ps_bin_ctxt, u4_code_int_range,
  ------------------
  |  |  217|   737k|                     p_DecBitStream_arg,u4_symbol)                                           \
  |  |  218|   737k|{                                                                                       \
  |  |  219|   737k|    bin_ctxt_model_t *p_binCtxt_m = (bin_ctxt_model_t *) p_binCtxt_arg;                           \
  |  |  220|   737k|    dec_bit_stream_t *p_DecBitStream_m = (dec_bit_stream_t *) p_DecBitStream_arg;                 \
  |  |  221|   737k|    const UWORD32 *pu4_table_m = (const UWORD32 *) pu4_table_arg;                         \
  |  |  222|   737k|                                                                                        \
  |  |  223|   737k|    UWORD32 u4_quantCodeIntRange_m,u4_codeIntRangeLPS_m;                                    \
  |  |  224|   737k|    UWORD32 u1_mps_state_m;                                                               \
  |  |  225|   737k|    UWORD32 table_lookup_m;                                                               \
  |  |  226|   737k|    UWORD32 u4_clz_m;                                                                     \
  |  |  227|   737k|                                                                                        \
  |  |  228|   737k|    u1_mps_state_m = (p_binCtxt_m->u1_mps_state);                                           \
  |  |  229|   737k|    u4_clz_m = CLZ(u4_code_int_range);                                                  \
  |  |  230|   737k|    u4_quantCodeIntRange_m = u4_code_int_range << u4_clz_m;                                   \
  |  |  231|   737k|    u4_quantCodeIntRange_m = (u4_quantCodeIntRange_m >> 29) & 0x3;                          \
  |  |  232|   737k|    table_lookup_m = pu4_table_m[(u1_mps_state_m << 2)+u4_quantCodeIntRange_m];                 \
  |  |  233|   737k|    u4_codeIntRangeLPS_m = table_lookup_m & 0xff;                                           \
  |  |  234|   737k|                                                                                        \
  |  |  235|   737k|    u4_codeIntRangeLPS_m = u4_codeIntRangeLPS_m << (23 - u4_clz_m);                           \
  |  |  236|   737k|    u4_code_int_range = u4_code_int_range - u4_codeIntRangeLPS_m;                             \
  |  |  237|   737k|    u4_symbol = ((u1_mps_state_m>> 6) & 0x1);                                             \
  |  |  238|   737k|    /*if mps*/                                                                          \
  |  |  239|   737k|    u1_mps_state_m = (table_lookup_m >> 8) & 0x7F;                                          \
  |  |  240|   737k|    if(u4_code_int_val_ofst >= u4_code_int_range)                                          \
  |  |  ------------------
  |  |  |  Branch (240:8): [True: 23.6k, False: 714k]
  |  |  ------------------
  |  |  241|   737k|  {                                                                                     \
  |  |  242|  23.6k|                                                                                        \
  |  |  243|  23.6k|    u4_symbol = 1 - u4_symbol;                                                          \
  |  |  244|  23.6k|    u4_code_int_val_ofst -= u4_code_int_range;                                             \
  |  |  245|  23.6k|    u4_code_int_range = u4_codeIntRangeLPS_m;                                               \
  |  |  246|  23.6k|    u1_mps_state_m = (table_lookup_m >> 15) & 0x7F;                                         \
  |  |  247|  23.6k|  }                                                                                     \
  |  |  248|   737k|    if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_8)                                        \
  |  |  ------------------
  |  |  |  |  113|  1.47M|#define ONE_RIGHT_SHIFTED_BY_8 1<<8
  |  |  ------------------
  |  |  |  Branch (248:8): [True: 4.60k, False: 733k]
  |  |  ------------------
  |  |  249|   737k|    {                                                                                   \
  |  |  250|  4.60k|        UWORD32 *pu4_buffer,u4_offset;                                                  \
  |  |  251|  4.60k|        UWORD32 read_bits,u4_clz_m  ;                                                     \
  |  |  252|  4.60k|                                                                                        \
  |  |  253|  4.60k|        pu4_buffer = p_DecBitStream_m->pu4_buffer;                                         \
  |  |  254|  4.60k|        u4_offset = p_DecBitStream_m->u4_ofst;                                          \
  |  |  255|  4.60k|        u4_clz_m = CLZ(u4_code_int_range);                                              \
  |  |  256|  4.60k|        NEXTBITS(read_bits,(u4_offset+23),pu4_buffer,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  4.60k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  4.60k|{                                                                           \
  |  |  |  |  139|  4.60k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  4.60k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  4.60k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  4.60k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  4.60k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 4.27k, False: 337]
  |  |  |  |  ------------------
  |  |  |  |  144|  4.60k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  4.27k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  4.60k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  4.60k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  4.60k|}
  |  |  ------------------
  |  |  257|  4.60k|        FLUSHBITS(u4_offset,(u4_clz_m))                                                   \
  |  |  ------------------
  |  |  |  |  193|  4.60k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  4.60k|{                                                                           \
  |  |  |  |  195|  4.60k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  4.60k|}
  |  |  ------------------
  |  |  258|  4.60k|        u4_code_int_range = u4_code_int_range << u4_clz_m;                                    \
  |  |  259|  4.60k|        u4_code_int_val_ofst= (u4_code_int_val_ofst << u4_clz_m) | read_bits;               \
  |  |  260|  4.60k|                                                                                        \
  |  |  261|  4.60k|                                                                                        \
  |  |  262|  4.60k|        p_DecBitStream_m->u4_ofst = u4_offset;                                          \
  |  |  263|  4.60k|    }                                                                                   \
  |  |  264|   737k|    p_binCtxt_m->u1_mps_state = u1_mps_state_m;                                             \
  |  |  265|   737k|}
  ------------------
 1289|   737k|                                     u4_code_int_val_ofst, pu4_table,
 1290|   737k|                                     ps_bitstrm, u4_symbol)
 1291|       |
 1292|   737k|                INC_BIN_COUNT(ps_cab_env);INC_DECISION_BINS(ps_cab_env);
 1293|   737k|                u4_value++;
 1294|   737k|            }
 1295|   737k|            while(u4_symbol && (u4_value < u1_max_bins));
  ------------------
  |  Branch (1295:19): [True: 714k, False: 23.6k]
  |  Branch (1295:32): [True: 542k, False: 171k]
  ------------------
 1296|       |
 1297|   194k|        }
 1298|       |
 1299|  1.23M|        ps_cab_env->u4_code_int_range = u4_code_int_range;
 1300|  1.23M|        ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
 1301|  1.23M|        u4_value = u4_value - 1 + u4_symbol;
 1302|  1.23M|        u4_prefix = (u4_value);
 1303|  1.23M|    }
 1304|       |
 1305|  1.23M|    i2_mvd = u4_prefix;
 1306|       |
 1307|  1.23M|    if(i2_mvd == 9)
  ------------------
  |  Branch (1307:8): [True: 171k, False: 1.06M]
  ------------------
 1308|   171k|    {
 1309|       |        /* Read Suffix */
 1310|   171k|        k = ih264d_decode_bypass_bins_unary(ps_cab_env, ps_bitstrm);
 1311|   171k|        i2_suf = (k > 15) ? INT16_MAX : ((1 << k) - 1);
  ------------------
  |  Branch (1311:18): [True: 102, False: 171k]
  ------------------
 1312|   171k|        k = k + 3;
 1313|   171k|        i2_suf = (i2_suf << 3);
 1314|   171k|        i2_mvd += i2_suf;
 1315|   171k|        i2_suf = ih264d_decode_bypass_bins(ps_cab_env, k, ps_bitstrm);
 1316|   171k|        i2_mvd += i2_suf;
 1317|   171k|    }
 1318|       |    /* Read Sign bit */
 1319|  1.23M|    if(!i2_mvd)
  ------------------
  |  Branch (1319:8): [True: 636k, False: 596k]
  ------------------
 1320|   636k|        return (i2_mvd);
 1321|       |
 1322|   596k|    else
 1323|   596k|    {
 1324|   596k|        UWORD32 u4_code_int_val_ofst, u4_code_int_range;
 1325|       |
 1326|   596k|        u4_code_int_val_ofst = ps_cab_env->u4_code_int_val_ofst;
 1327|   596k|        u4_code_int_range = ps_cab_env->u4_code_int_range;
 1328|       |
 1329|   596k|        if(u4_code_int_range < ONE_RIGHT_SHIFTED_BY_9)
  ------------------
  |  |  114|   596k|#define ONE_RIGHT_SHIFTED_BY_9    1<<9
  ------------------
  |  Branch (1329:12): [True: 9.36k, False: 587k]
  ------------------
 1330|  9.36k|        {
 1331|  9.36k|            UWORD32 *pu4_buffer, u4_offset;
 1332|       |
 1333|  9.36k|            pu4_buffer = ps_bitstrm->pu4_buffer;
 1334|  9.36k|            u4_offset = ps_bitstrm->u4_ofst;
 1335|       |
 1336|  9.36k|            RENORM_RANGE_OFFSET(u4_code_int_range, u4_code_int_val_ofst,
  ------------------
  |  |  170|  9.36k|  {                                                                                         \
  |  |  171|  9.36k|    UWORD32 read_bits_m,u4_clz_m  ;                                                         \
  |  |  172|  9.36k|    u4_clz_m = CLZ(u4_codeIntRange_m);                                                  \
  |  |  173|  9.36k|    NEXTBITS(read_bits_m,(u4_offset_m+23),pu4_buffer_m,u4_clz_m)                            \
  |  |  ------------------
  |  |  |  |  137|  9.36k|#define     NEXTBITS(u4_word, u4_offset, pu4_bitstream, u4_no_bits)         \
  |  |  |  |  138|  9.36k|{                                                                           \
  |  |  |  |  139|  9.36k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  |  |  140|  9.36k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  |  |  141|  9.36k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  |  |  142|  9.36k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  |  |  143|  9.36k|    if(u4_bit_off)                                                          \
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (143:8): [True: 8.96k, False: 406]
  |  |  |  |  ------------------
  |  |  |  |  144|  9.36k|        u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  8.96k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  145|  9.36k|    u4_word = u4_word >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  9.36k|#define INT_IN_BITS         32
  |  |  |  |  ------------------
  |  |  |  |  146|  9.36k|}
  |  |  ------------------
  |  |  174|  9.36k|    FLUSHBITS(u4_offset_m,(u4_clz_m))                                                       \
  |  |  ------------------
  |  |  |  |  193|  9.36k|#define   FLUSHBITS(u4_offset, u4_no_bits)                                  \
  |  |  |  |  194|  9.36k|{                                                                           \
  |  |  |  |  195|  9.36k|        (u4_offset) += (u4_no_bits);                                        \
  |  |  |  |  196|  9.36k|}
  |  |  ------------------
  |  |  175|  9.36k|    u4_codeIntRange_m = u4_codeIntRange_m << u4_clz_m;                                      \
  |  |  176|  9.36k|    u4_codeIntValOffset_m = (u4_codeIntValOffset_m << u4_clz_m) | read_bits_m;              \
  |  |  177|  9.36k|  }
  ------------------
 1337|  9.36k|                                u4_offset, pu4_buffer)
 1338|  9.36k|            ps_bitstrm->u4_ofst = u4_offset;
 1339|  9.36k|        }
 1340|       |
 1341|   596k|        u4_code_int_range = u4_code_int_range >> 1;
 1342|       |
 1343|   596k|        if(u4_code_int_val_ofst >= u4_code_int_range)
  ------------------
  |  Branch (1343:12): [True: 148k, False: 448k]
  ------------------
 1344|   148k|        {
 1345|       |            /* S=1 */
 1346|   148k|            u4_code_int_val_ofst -= u4_code_int_range;
 1347|   148k|            i2_mvd = (-i2_mvd);
 1348|   148k|        }
 1349|       |
 1350|   596k|        ps_cab_env->u4_code_int_val_ofst = u4_code_int_val_ofst;
 1351|   596k|        ps_cab_env->u4_code_int_range = u4_code_int_range;
 1352|       |
 1353|   596k|        return (i2_mvd);
 1354|       |
 1355|   596k|    }
 1356|  1.23M|}

ih264d_parse_pmb_cavlc:
   87|  57.6k|{
   88|  57.6k|    UWORD32 u1_num_mb_part;
   89|  57.6k|    UWORD32 uc_sub_mb;
   90|  57.6k|    dec_bit_stream_t * const ps_bitstrm = ps_dec->ps_bitstrm;
   91|  57.6k|    UWORD32 * const pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   92|  57.6k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
   93|       |
   94|  57.6k|    parse_pmbarams_t * ps_parse_mb_data = ps_dec->ps_parse_mb_data
   95|  57.6k|                    + u4_num_mbsNby2;
   96|  57.6k|    WORD8 * pi1_ref_idx = ps_parse_mb_data->i1_ref_idx[0];
   97|  57.6k|    const UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
   98|  57.6k|    const UWORD8 * pu1_num_mb_part = (const UWORD8 *)gau1_ih264d_num_mb_part;
   99|  57.6k|    UWORD8 * pu1_col_info = ps_parse_mb_data->u1_col_info;
  100|       |
  101|  57.6k|    UWORD32 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  102|  57.6k|    UWORD32 u4_sum_mb_mode_pack = 0;
  103|  57.6k|    WORD32 ret;
  104|       |
  105|  57.6k|    UWORD8 u1_no_submb_part_size_lt8x8_flag = 1;
  106|  57.6k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
  107|  57.6k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  108|       |
  109|  57.6k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  110|       |
  111|  57.6k|    ps_cur_mb_info->u1_mb_mc_mode = u1_mb_type;
  112|  57.6k|    uc_sub_mb = ((u1_mb_type == PRED_8x8) | (u1_mb_type == PRED_8x8R0));
  ------------------
  |  |  453|  57.6k|#define PRED_8x8    3
  ------------------
                  uc_sub_mb = ((u1_mb_type == PRED_8x8) | (u1_mb_type == PRED_8x8R0));
  ------------------
  |  |  454|  57.6k|#define PRED_8x8R0  4
  ------------------
  113|       |
  114|       |    /* Reading the subMB type */
  115|  57.6k|    if(uc_sub_mb)
  ------------------
  |  Branch (115:8): [True: 2.52k, False: 55.1k]
  ------------------
  116|  2.52k|    {
  117|  2.52k|        WORD32 i;
  118|  2.52k|        UWORD8 u1_colz = (PRED_8x8 << 6);
  ------------------
  |  |  453|  2.52k|#define PRED_8x8    3
  ------------------
  119|       |
  120|  11.1k|        for(i = 0; i < 4; i++)
  ------------------
  |  Branch (120:20): [True: 9.11k, False: 2.01k]
  ------------------
  121|  9.11k|        {
  122|  9.11k|            UWORD32 ui_sub_mb_mode;
  123|       |
  124|       |            //Inlined ih264d_uev
  125|  9.11k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  126|  9.11k|            UWORD32 u4_word, u4_ldz;
  127|       |
  128|       |            /***************************************************************/
  129|       |            /* Find leading zeros in next 32 bits                          */
  130|       |            /***************************************************************/
  131|  9.11k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  9.11k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  9.11k|{                                                                           \
  |  |  152|  9.11k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  9.11k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  9.11k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  9.11k|                                                                            \
  |  |  156|  9.11k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  9.11k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 8.74k, False: 374]
  |  |  ------------------
  |  |  158|  9.11k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  8.74k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  9.11k|}
  ------------------
  132|  9.11k|            u4_ldz = CLZ(u4_word);
  133|       |            /* Flush the ps_bitstrm */
  134|  9.11k|            u4_bitstream_offset += (u4_ldz + 1);
  135|       |            /* Read the suffix from the ps_bitstrm */
  136|  9.11k|            u4_word = 0;
  137|  9.11k|            if(u4_ldz)
  ------------------
  |  Branch (137:16): [True: 5.62k, False: 3.48k]
  ------------------
  138|  5.62k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  5.62k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  5.62k|{                                                                           \
  |  |  122|  5.62k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  5.62k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  5.62k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  5.62k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  5.62k|                                                                            \
  |  |  127|  5.62k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 5.20k, False: 425]
  |  |  ------------------
  |  |  128|  5.62k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  5.20k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  5.62k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  5.62k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  5.62k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  5.62k|}                                                                           \
  ------------------
  139|  9.11k|                        u4_ldz);
  140|  9.11k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  141|  9.11k|            ui_sub_mb_mode = ((1 << u4_ldz) + u4_word - 1);
  142|       |            //Inlined ih264d_uev
  143|       |
  144|  9.11k|            if(ui_sub_mb_mode > 3)
  ------------------
  |  Branch (144:16): [True: 514, False: 8.60k]
  ------------------
  145|    514|            {
  146|    514|                return ERROR_SUB_MB_TYPE;
  147|    514|            }
  148|  8.60k|            else
  149|  8.60k|            {
  150|  8.60k|                u4_sum_mb_mode_pack = (u4_sum_mb_mode_pack << 8) | ui_sub_mb_mode;
  151|       |                /* Storing collocated information */
  152|  8.60k|                *pu1_col_info++ = u1_colz | (UWORD8)(ui_sub_mb_mode << 4);
  153|       |
  154|  8.60k|                COPYTHECONTEXT("sub_mb_type", ui_sub_mb_mode);
  155|  8.60k|            }
  156|       |
  157|       |            /* check if Motion compensation is done below 8x8 */
  158|  8.60k|            if(ui_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  8.60k|#define P_L0_8x8    0
  ------------------
  |  Branch (158:16): [True: 5.11k, False: 3.48k]
  ------------------
  159|  5.11k|            {
  160|  5.11k|                u1_no_submb_part_size_lt8x8_flag = 0;
  161|  5.11k|            }
  162|  8.60k|        }
  163|       |
  164|       |        //
  165|  2.01k|        u1_num_mb_part = 4;
  166|  2.01k|    }
  167|  55.1k|    else
  168|  55.1k|    {
  169|  55.1k|        *pu1_col_info++ = (u1_mb_type << 6);
  170|  55.1k|        if(u1_mb_type)
  ------------------
  |  Branch (170:12): [True: 15.7k, False: 39.3k]
  ------------------
  171|  15.7k|            *pu1_col_info++ = (u1_mb_type << 6);
  172|  55.1k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_type];
  173|       |
  174|  55.1k|    }
  175|       |
  176|       |    /* Decoding reference index 0: For simple profile the following   */
  177|       |    /* conditions are always true (mb_field_decoding_flag == 0);      */
  178|       |    /* (MbPartPredMode != PredL1)                                     */
  179|       |
  180|  57.1k|    {
  181|       |
  182|  57.1k|        UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  183|  57.1k|        UWORD8 uc_num_ref_idx_l0_active_minus1 =
  184|  57.1k|                        (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0]
  185|  57.1k|                                        << (u1_mbaff & uc_field)) - 1;
  186|       |
  187|  57.1k|        if((uc_num_ref_idx_l0_active_minus1 > 0) & (u1_mb_type != PRED_8x8R0))
  ------------------
  |  |  454|  57.1k|#define PRED_8x8R0  4
  ------------------
  |  Branch (187:12): [True: 19.0k, False: 38.1k]
  ------------------
  188|  19.0k|        {
  189|  19.0k|            if(1 == uc_num_ref_idx_l0_active_minus1)
  ------------------
  |  Branch (189:16): [True: 5.12k, False: 13.9k]
  ------------------
  190|  5.12k|                ih264d_parse_pmb_ref_index_cavlc_range1(
  191|  5.12k|                                u1_num_mb_part, ps_bitstrm, pi1_ref_idx,
  192|  5.12k|                                uc_num_ref_idx_l0_active_minus1);
  193|  13.9k|            else
  194|  13.9k|            {
  195|  13.9k|                ret = ih264d_parse_pmb_ref_index_cavlc(
  196|  13.9k|                                u1_num_mb_part, ps_bitstrm, pi1_ref_idx,
  197|  13.9k|                                uc_num_ref_idx_l0_active_minus1);
  198|  13.9k|                if(ret != OK)
  ------------------
  |  |  114|  13.9k|#define OK        0
  ------------------
  |  Branch (198:20): [True: 636, False: 13.2k]
  ------------------
  199|    636|                    return ret;
  200|  13.9k|            }
  201|  19.0k|        }
  202|  38.1k|        else
  203|  38.1k|        {
  204|       |            /* When there exists only a single frame to predict from */
  205|  38.1k|            UWORD32 uc_i;
  206|  90.8k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (206:27): [True: 52.6k, False: 38.1k]
  ------------------
  207|       |                /* Storing Reference Idx Information */
  208|  52.6k|                pi1_ref_idx[uc_i] = 0;
  209|  38.1k|        }
  210|  57.1k|    }
  211|       |
  212|  56.5k|    {
  213|  56.5k|        UWORD8 u1_p_idx;
  214|  56.5k|        UWORD32 uc_i;
  215|  56.5k|        parse_part_params_t * ps_part = ps_dec->ps_part;
  216|  56.5k|        UWORD8 u1_sub_mb_mode, u1_num_subpart, u1_mb_part_width, u1_mb_part_height;
  217|  56.5k|        UWORD32 u4_sub_mb_num;
  218|  56.5k|        const UWORD8 * pu1_top_left_sub_mb_indx;
  219|  56.5k|        mv_pred_t * ps_mv, *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
  220|       |        /* Loading the table pointers */
  221|  56.5k|        const UWORD8 * pu1_mb_partw = (const UWORD8 *)gau1_ih264d_mb_partw;
  222|  56.5k|        const UWORD8 * pu1_mb_parth = (const UWORD8 *)gau1_ih264d_mb_parth;
  223|  56.5k|        const UWORD8 * pu1_sub_mb_indx_mod =
  224|  56.5k|                        (const UWORD8 *)(gau1_ih264d_submb_indx_mod)
  225|  56.5k|                                        + (uc_sub_mb * 6);
  226|  56.5k|        const UWORD8 * pu1_sub_mb_partw = (const UWORD8 *)gau1_ih264d_submb_partw;
  227|  56.5k|        const UWORD8 * pu1_sub_mb_parth = (const UWORD8 *)gau1_ih264d_submb_parth;
  228|  56.5k|        const UWORD8 * pu1_num_sub_mb_part =
  229|  56.5k|                        (const UWORD8 *)gau1_ih264d_num_submb_part;
  230|       |
  231|  56.5k|        UWORD16 u2_sub_mb_num = 0x028A;
  232|       |
  233|       |        /*********************************************************/
  234|       |        /* default initialisations for condition (uc_sub_mb == 0) */
  235|       |        /* i.e. all are subpartitions of 8x8                     */
  236|       |        /*********************************************************/
  237|  56.5k|        u1_sub_mb_mode = 0;
  238|  56.5k|        u1_num_subpart = 1;
  239|  56.5k|        u1_mb_part_width = pu1_mb_partw[u1_mb_type];
  240|  56.5k|        u1_mb_part_height = pu1_mb_parth[u1_mb_type];
  241|  56.5k|        pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_type << 1);
  242|  56.5k|        u4_sub_mb_num = 0;
  243|       |
  244|       |        /* Loop on number of partitions */
  245|   134k|        for(uc_i = 0, u1_p_idx = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (245:37): [True: 77.9k, False: 56.5k]
  ------------------
  246|  77.9k|        {
  247|  77.9k|            UWORD8 uc_j;
  248|  77.9k|            if(uc_sub_mb)
  ------------------
  |  Branch (248:16): [True: 7.99k, False: 69.9k]
  ------------------
  249|  7.99k|            {
  250|  7.99k|                u1_sub_mb_mode = u4_sum_mb_mode_pack >> 24;
  251|  7.99k|                u1_num_subpart = pu1_num_sub_mb_part[u1_sub_mb_mode];
  252|  7.99k|                u1_mb_part_width = pu1_sub_mb_partw[u1_sub_mb_mode];
  253|  7.99k|                u1_mb_part_height = pu1_sub_mb_parth[u1_sub_mb_mode];
  254|  7.99k|                pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_sub_mb_mode << 1);
  255|  7.99k|                u4_sub_mb_num = u2_sub_mb_num >> 12;
  256|  7.99k|                u4_sum_mb_mode_pack <<= 8;
  257|  7.99k|                u2_sub_mb_num <<= 4;
  258|  7.99k|            }
  259|       |
  260|       |            /* Loop on Number of sub-partitions */
  261|   163k|            for(uc_j = 0; uc_j < u1_num_subpart; uc_j++, pu1_top_left_sub_mb_indx++)
  ------------------
  |  Branch (261:27): [True: 85.6k, False: 77.9k]
  ------------------
  262|  85.6k|            {
  263|  85.6k|                WORD16 i2_mvx, i2_mvy;
  264|  85.6k|                u4_sub_mb_num += *pu1_top_left_sub_mb_indx;
  265|  85.6k|                ps_mv = ps_mv_start + u4_sub_mb_num;
  266|       |
  267|       |                /* Reading the differential Mv from the bitstream */
  268|       |                //i2_mvx = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  269|       |                //inlining ih264d_sev
  270|  85.6k|                {
  271|  85.6k|                    UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  272|  85.6k|                    UWORD32 u4_word, u4_ldz, u4_abs_val;
  273|       |
  274|       |                    /***************************************************************/
  275|       |                    /* Find leading zeros in next 32 bits                          */
  276|       |                    /***************************************************************/
  277|  85.6k|                    NEXTBITS_32(u4_word, u4_bitstream_offset,
  ------------------
  |  |  150|  85.6k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  85.6k|{                                                                           \
  |  |  152|  85.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  85.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  85.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  85.6k|                                                                            \
  |  |  156|  85.6k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  85.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 82.4k, False: 3.24k]
  |  |  ------------------
  |  |  158|  85.6k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  82.4k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  85.6k|}
  ------------------
  278|  85.6k|                                pu4_bitstrm_buf);
  279|  85.6k|                    u4_ldz = CLZ(u4_word);
  280|       |
  281|       |                    /* Flush the ps_bitstrm */
  282|  85.6k|                    u4_bitstream_offset += (u4_ldz + 1);
  283|       |
  284|       |                    /* Read the suffix from the ps_bitstrm */
  285|  85.6k|                    u4_word = 0;
  286|  85.6k|                    if(u4_ldz)
  ------------------
  |  Branch (286:24): [True: 41.3k, False: 44.3k]
  ------------------
  287|  41.3k|                        GETBITS(u4_word, u4_bitstream_offset,
  ------------------
  |  |  120|  41.3k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  41.3k|{                                                                           \
  |  |  122|  41.3k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  41.3k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  41.3k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  41.3k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  41.3k|                                                                            \
  |  |  127|  41.3k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 38.8k, False: 2.55k]
  |  |  ------------------
  |  |  128|  41.3k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  38.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  41.3k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  41.3k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  41.3k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  41.3k|}                                                                           \
  ------------------
  288|  85.6k|                                pu4_bitstrm_buf, u4_ldz);
  289|       |
  290|  85.6k|                    *pu4_bitstrm_ofst = u4_bitstream_offset;
  291|  85.6k|                    u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  292|       |
  293|  85.6k|                    if(u4_word & 0x1)
  ------------------
  |  Branch (293:24): [True: 16.8k, False: 68.8k]
  ------------------
  294|  16.8k|                        i2_mvx = (-(WORD32)u4_abs_val);
  295|  68.8k|                    else
  296|  68.8k|                        i2_mvx = (u4_abs_val);
  297|  85.6k|                }
  298|       |                //inlinined ih264d_sev
  299|  85.6k|                COPYTHECONTEXT("MVD", i2_mvx);
  300|  85.6k|                i2_mvy = ih264d_sev(pu4_bitstrm_ofst,
  301|  85.6k|                                     pu4_bitstrm_buf);
  302|  85.6k|                COPYTHECONTEXT("MVD", i2_mvy);
  303|       |
  304|       |                /* Storing Info for partitions */
  305|  85.6k|                ps_part->u1_is_direct = PART_NOT_DIRECT;
  ------------------
  |  |  569|  85.6k|#define PART_NOT_DIRECT                0
  ------------------
  306|  85.6k|                ps_part->u1_sub_mb_num = u4_sub_mb_num;
  307|  85.6k|                ps_part->u1_partheight = u1_mb_part_height;
  308|  85.6k|                ps_part->u1_partwidth = u1_mb_part_width;
  309|       |
  310|       |                /* Storing Mv residuals */
  311|  85.6k|                ps_mv->i2_mv[0] = i2_mvx;
  312|  85.6k|                ps_mv->i2_mv[1] = i2_mvy;
  313|       |
  314|       |                /* Increment partition Index */
  315|  85.6k|                u1_p_idx++;
  316|  85.6k|                ps_part++;
  317|  85.6k|            }
  318|  77.9k|        }
  319|  56.5k|        ps_parse_mb_data->u1_num_part = u1_p_idx;
  320|  56.5k|        ps_dec->ps_part = ps_part;
  321|  56.5k|    }
  322|       |
  323|  56.5k|    {
  324|  56.5k|        UWORD32 u4_cbp;
  325|       |
  326|       |        /* Read the Coded block pattern */
  327|  56.5k|        UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  328|  56.5k|        UWORD32 u4_word, u4_ldz;
  329|       |
  330|       |        /***************************************************************/
  331|       |        /* Find leading zeros in next 32 bits                          */
  332|       |        /***************************************************************/
  333|  56.5k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  56.5k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  56.5k|{                                                                           \
  |  |  152|  56.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  56.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  56.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  56.5k|                                                                            \
  |  |  156|  56.5k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  56.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 55.1k, False: 1.36k]
  |  |  ------------------
  |  |  158|  56.5k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  55.1k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  56.5k|}
  ------------------
  334|  56.5k|        u4_ldz = CLZ(u4_word);
  335|       |        /* Flush the ps_bitstrm */
  336|  56.5k|        u4_bitstream_offset += (u4_ldz + 1);
  337|       |        /* Read the suffix from the ps_bitstrm */
  338|  56.5k|        u4_word = 0;
  339|  56.5k|        if(u4_ldz)
  ------------------
  |  Branch (339:12): [True: 15.0k, False: 41.4k]
  ------------------
  340|  15.0k|            GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  15.0k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  15.0k|{                                                                           \
  |  |  122|  15.0k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  15.0k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  15.0k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  15.0k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  15.0k|                                                                            \
  |  |  127|  15.0k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 14.2k, False: 864]
  |  |  ------------------
  |  |  128|  15.0k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  14.2k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  15.0k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  15.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  15.0k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  15.0k|}                                                                           \
  ------------------
  341|  56.5k|        *pu4_bitstrm_ofst = u4_bitstream_offset;
  342|  56.5k|        u4_cbp = ((1 << u4_ldz) + u4_word - 1);
  343|       |
  344|  56.5k|        if(u4_cbp > 47)
  ------------------
  |  Branch (344:12): [True: 1.52k, False: 54.9k]
  ------------------
  345|  1.52k|            return ERROR_CBP;
  346|       |
  347|  54.9k|        u4_cbp = *((UWORD8*)gau1_ih264d_cbp_inter + u4_cbp);
  348|  54.9k|        COPYTHECONTEXT("coded_block_pattern", u4_cbp);
  349|  54.9k|        ps_cur_mb_info->u1_cbp = u4_cbp;
  350|       |
  351|       |        /* Read the transform8x8 u4_flag if present */
  352|  54.9k|        if((ps_dec->s_high_profile.u1_transform8x8_present) && (u4_cbp & 0xf)
  ------------------
  |  Branch (352:12): [True: 5.73k, False: 49.2k]
  |  Branch (352:64): [True: 2.08k, False: 3.64k]
  ------------------
  353|  2.08k|                        && u1_no_submb_part_size_lt8x8_flag)
  ------------------
  |  Branch (353:28): [True: 1.88k, False: 204]
  ------------------
  354|  1.88k|        {
  355|  1.88k|            ps_cur_mb_info->u1_tran_form8x8 = ih264d_get_bit_h264(ps_bitstrm);
  356|  1.88k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  357|  1.88k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  358|  1.88k|        }
  359|       |
  360|       |        /* Read mb_qp_delta */
  361|  54.9k|        if(u4_cbp)
  ------------------
  |  Branch (361:12): [True: 13.5k, False: 41.4k]
  ------------------
  362|  13.5k|        {
  363|  13.5k|            WORD32 i_temp;
  364|       |
  365|  13.5k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  366|  13.5k|            UWORD32 u4_word, u4_ldz, u4_abs_val;
  367|       |
  368|       |            /***************************************************************/
  369|       |            /* Find leading zeros in next 32 bits                          */
  370|       |            /***************************************************************/
  371|  13.5k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  13.5k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  13.5k|{                                                                           \
  |  |  152|  13.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  13.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  13.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  13.5k|                                                                            \
  |  |  156|  13.5k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  13.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 13.0k, False: 533]
  |  |  ------------------
  |  |  158|  13.5k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  13.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  13.5k|}
  ------------------
  372|  13.5k|            u4_ldz = CLZ(u4_word);
  373|       |
  374|       |            /* Flush the ps_bitstrm */
  375|  13.5k|            u4_bitstream_offset += (u4_ldz + 1);
  376|       |
  377|       |            /* Read the suffix from the ps_bitstrm */
  378|  13.5k|            u4_word = 0;
  379|  13.5k|            if(u4_ldz)
  ------------------
  |  Branch (379:16): [True: 4.24k, False: 9.30k]
  ------------------
  380|  4.24k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf,
  ------------------
  |  |  120|  4.24k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  4.24k|{                                                                           \
  |  |  122|  4.24k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  4.24k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  4.24k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  4.24k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  4.24k|                                                                            \
  |  |  127|  4.24k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 3.39k, False: 853]
  |  |  ------------------
  |  |  128|  4.24k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  3.39k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  4.24k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  4.24k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  4.24k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  4.24k|}                                                                           \
  ------------------
  381|  13.5k|                        u4_ldz);
  382|       |
  383|  13.5k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  384|  13.5k|            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  385|       |
  386|  13.5k|            if(u4_word & 0x1)
  ------------------
  |  Branch (386:16): [True: 2.11k, False: 11.4k]
  ------------------
  387|  2.11k|                i_temp = (-(WORD32)u4_abs_val);
  388|  11.4k|            else
  389|  11.4k|                i_temp = (u4_abs_val);
  390|       |
  391|  13.5k|            if((i_temp < -26) || (i_temp > 25))
  ------------------
  |  Branch (391:16): [True: 147, False: 13.3k]
  |  Branch (391:34): [True: 282, False: 13.1k]
  ------------------
  392|    429|                return ERROR_INV_RANGE_QP_T;
  393|       |            //inlinined ih264d_sev
  394|       |
  395|  13.1k|            COPYTHECONTEXT("mb_qp_delta", i_temp);
  396|  13.1k|            if(i_temp)
  ------------------
  |  Branch (396:16): [True: 3.81k, False: 9.30k]
  ------------------
  397|  3.81k|            {
  398|  3.81k|                ret = ih264d_update_qp(ps_dec, (WORD8)i_temp);
  399|  3.81k|                if(ret != OK)
  ------------------
  |  |  114|  3.81k|#define OK        0
  ------------------
  |  Branch (399:20): [True: 0, False: 3.81k]
  ------------------
  400|      0|                    return ret;
  401|  3.81k|            }
  402|       |
  403|  13.1k|            ret = ih264d_parse_residual4x4_cavlc(ps_dec, ps_cur_mb_info, 0);
  404|  13.1k|            if(ret != OK)
  ------------------
  |  |  114|  13.1k|#define OK        0
  ------------------
  |  Branch (404:16): [True: 2.98k, False: 10.1k]
  ------------------
  405|  2.98k|                return ret;
  406|  10.1k|            if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|  10.1k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 908, False: 9.22k]
  |  |  ------------------
  ------------------
  407|    908|                return ERROR_EOB_TERMINATE_T;
  408|  10.1k|        }
  409|  41.4k|        else
  410|  41.4k|        {
  411|  41.4k|            ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|  41.4k|#define CAVLC  0
  ------------------
  412|  41.4k|        }
  413|       |
  414|       |
  415|       |
  416|  54.9k|    }
  417|       |
  418|  50.6k|    return OK;
  ------------------
  |  |  114|  50.6k|#define OK        0
  ------------------
  419|  54.9k|}
ih264d_parse_pmb_cabac:
  436|  89.7k|{
  437|  89.7k|    UWORD32 u1_num_mb_part;
  438|  89.7k|    UWORD32 uc_sub_mb;
  439|  89.7k|    parse_pmbarams_t * ps_parse_mb_data = ps_dec->ps_parse_mb_data
  440|  89.7k|                    + u4_num_mbsNby2;
  441|  89.7k|    WORD8 * pi1_ref_idx = ps_parse_mb_data->i1_ref_idx[0];
  442|  89.7k|    const UWORD8 * pu1_num_mb_part = (const UWORD8 *)gau1_ih264d_num_mb_part;
  443|  89.7k|    const UWORD32 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  444|  89.7k|    UWORD8 * pu1_col_info = ps_parse_mb_data->u1_col_info;
  445|  89.7k|    UWORD32 u1_mb_mc_mode = u1_mb_type;
  446|  89.7k|    ctxt_inc_mb_info_t * p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
  447|  89.7k|    decoding_envirnoment_t * ps_cab_env = &ps_dec->s_cab_dec_env;
  448|  89.7k|    dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
  449|  89.7k|    UWORD32 u4_sub_mb_pack = 0;
  450|  89.7k|    WORD32 ret;
  451|       |
  452|  89.7k|    UWORD8 u1_no_submb_part_size_lt8x8_flag = 1;
  453|  89.7k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
  454|  89.7k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  455|       |
  456|  89.7k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  457|       |
  458|  89.7k|    p_curr_ctxt->u1_mb_type = CAB_P;
  ------------------
  |  |  398|  89.7k|#define CAB_P             0x07 /* 0000 0111 */
  ------------------
  459|  89.7k|    ps_cur_mb_info->u1_mb_mc_mode = u1_mb_type;
  460|  89.7k|    uc_sub_mb = ((u1_mb_type == PRED_8x8) | (u1_mb_type == PRED_8x8R0));
  ------------------
  |  |  453|  89.7k|#define PRED_8x8    3
  ------------------
                  uc_sub_mb = ((u1_mb_type == PRED_8x8) | (u1_mb_type == PRED_8x8R0));
  ------------------
  |  |  454|  89.7k|#define PRED_8x8R0  4
  ------------------
  461|       |
  462|       |    /* Reading the subMB type */
  463|  89.7k|    if(uc_sub_mb)
  ------------------
  |  Branch (463:8): [True: 15.6k, False: 74.0k]
  ------------------
  464|  15.6k|    {
  465|       |
  466|  15.6k|        UWORD8 u1_colz = (PRED_8x8 << 6);
  ------------------
  |  |  453|  15.6k|#define PRED_8x8    3
  ------------------
  467|  15.6k|        u1_mb_mc_mode = 0;
  468|       |
  469|  15.6k|        {
  470|  15.6k|            UWORD8 u1_sub_mb_mode;
  471|  15.6k|            u1_sub_mb_mode = ih264d_parse_submb_type_cabac(
  472|  15.6k|                            0, ps_cab_env, ps_bitstrm,
  473|  15.6k|                            ps_dec->p_sub_mb_type_t);
  474|  15.6k|            if(u1_sub_mb_mode > 3)
  ------------------
  |  Branch (474:16): [True: 0, False: 15.6k]
  ------------------
  475|      0|                return ERROR_SUB_MB_TYPE;
  476|       |
  477|  15.6k|            u4_sub_mb_pack = (u4_sub_mb_pack << 8) | u1_sub_mb_mode;
  478|       |            /* Storing collocated information */
  479|  15.6k|            *pu1_col_info++ = u1_colz | ((UWORD8)(u1_sub_mb_mode << 4));
  480|  15.6k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
  481|       |            /* check if Motion compensation is done below 8x8 */
  482|  15.6k|            if(u1_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  15.6k|#define P_L0_8x8    0
  ------------------
  |  Branch (482:16): [True: 9.31k, False: 6.34k]
  ------------------
  483|  9.31k|            {
  484|  9.31k|                u1_no_submb_part_size_lt8x8_flag = 0;
  485|  9.31k|            }
  486|  15.6k|        }
  487|      0|        {
  488|  15.6k|            UWORD8 u1_sub_mb_mode;
  489|  15.6k|            u1_sub_mb_mode = ih264d_parse_submb_type_cabac(
  490|  15.6k|                            0, ps_cab_env, ps_bitstrm,
  491|  15.6k|                            ps_dec->p_sub_mb_type_t);
  492|  15.6k|            if(u1_sub_mb_mode > 3)
  ------------------
  |  Branch (492:16): [True: 0, False: 15.6k]
  ------------------
  493|      0|                return ERROR_SUB_MB_TYPE;
  494|       |
  495|  15.6k|            u4_sub_mb_pack = (u4_sub_mb_pack << 8) | u1_sub_mb_mode;
  496|       |            /* Storing collocated information */
  497|  15.6k|            *pu1_col_info++ = u1_colz | ((UWORD8)(u1_sub_mb_mode << 4));
  498|  15.6k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
  499|       |            /* check if Motion compensation is done below 8x8 */
  500|  15.6k|            if(u1_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  15.6k|#define P_L0_8x8    0
  ------------------
  |  Branch (500:16): [True: 9.47k, False: 6.19k]
  ------------------
  501|  9.47k|            {
  502|  9.47k|                u1_no_submb_part_size_lt8x8_flag = 0;
  503|  9.47k|            }
  504|  15.6k|        }
  505|      0|        {
  506|  15.6k|            UWORD8 u1_sub_mb_mode;
  507|  15.6k|            u1_sub_mb_mode = ih264d_parse_submb_type_cabac(
  508|  15.6k|                            0, ps_cab_env, ps_bitstrm,
  509|  15.6k|                            ps_dec->p_sub_mb_type_t);
  510|  15.6k|            if(u1_sub_mb_mode > 3)
  ------------------
  |  Branch (510:16): [True: 0, False: 15.6k]
  ------------------
  511|      0|                return ERROR_SUB_MB_TYPE;
  512|       |
  513|  15.6k|            u4_sub_mb_pack = (u4_sub_mb_pack << 8) | u1_sub_mb_mode;
  514|       |            /* Storing collocated information */
  515|  15.6k|            *pu1_col_info++ = u1_colz | ((UWORD8)(u1_sub_mb_mode << 4));
  516|  15.6k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
  517|       |            /* check if Motion compensation is done below 8x8 */
  518|  15.6k|            if(u1_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  15.6k|#define P_L0_8x8    0
  ------------------
  |  Branch (518:16): [True: 9.34k, False: 6.31k]
  ------------------
  519|  9.34k|            {
  520|  9.34k|                u1_no_submb_part_size_lt8x8_flag = 0;
  521|  9.34k|            }
  522|  15.6k|        }
  523|      0|        {
  524|  15.6k|            UWORD8 u1_sub_mb_mode;
  525|  15.6k|            u1_sub_mb_mode = ih264d_parse_submb_type_cabac(
  526|  15.6k|                            0, ps_cab_env, ps_bitstrm,
  527|  15.6k|                            ps_dec->p_sub_mb_type_t);
  528|  15.6k|            if(u1_sub_mb_mode > 3)
  ------------------
  |  Branch (528:16): [True: 0, False: 15.6k]
  ------------------
  529|      0|                return ERROR_SUB_MB_TYPE;
  530|       |
  531|  15.6k|            u4_sub_mb_pack = (u4_sub_mb_pack << 8) | u1_sub_mb_mode;
  532|       |            /* Storing collocated information */
  533|  15.6k|            *pu1_col_info++ = u1_colz | ((UWORD8)(u1_sub_mb_mode << 4));
  534|  15.6k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
  535|       |            /* check if Motion compensation is done below 8x8 */
  536|  15.6k|            if(u1_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  15.6k|#define P_L0_8x8    0
  ------------------
  |  Branch (536:16): [True: 9.19k, False: 6.46k]
  ------------------
  537|  9.19k|            {
  538|  9.19k|                u1_no_submb_part_size_lt8x8_flag = 0;
  539|  9.19k|            }
  540|  15.6k|        }
  541|      0|        u1_num_mb_part = 4;
  542|  15.6k|    }
  543|  74.0k|    else
  544|  74.0k|    {
  545|  74.0k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_type];
  546|       |        /* Storing collocated Mb and SubMb mode information */
  547|  74.0k|        *pu1_col_info++ = (u1_mb_type << 6);
  548|  74.0k|        if(u1_mb_type)
  ------------------
  |  Branch (548:12): [True: 35.3k, False: 38.7k]
  ------------------
  549|  35.3k|            *pu1_col_info++ = (u1_mb_type << 6);
  550|  74.0k|    }
  551|       |    /* Decoding reference index 0: For simple profile the following   */
  552|       |    /* conditions are always true (mb_field_decoding_flag == 0);      */
  553|       |    /* (MbPartPredMode != PredL1)                                     */
  554|  89.7k|    {
  555|  89.7k|        WORD8 * pi1_top_ref_idx_ctx_inc_arr = p_curr_ctxt->i1_ref_idx;
  556|  89.7k|        WORD8 * pi1_left_ref_idx_ctxt_inc = ps_dec->pi1_left_ref_idx_ctxt_inc;
  557|  89.7k|        UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  558|  89.7k|        UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  559|  89.7k|        UWORD8 uc_num_ref_idx_l0_active_minus1 =
  560|  89.7k|                        (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0]
  561|  89.7k|                                        << (u1_mbaff & uc_field)) - 1;
  562|       |
  563|  89.7k|        if((uc_num_ref_idx_l0_active_minus1 > 0) & (u1_mb_type != PRED_8x8R0))
  ------------------
  |  |  454|  89.7k|#define PRED_8x8R0  4
  ------------------
  |  Branch (563:12): [True: 44.3k, False: 45.3k]
  ------------------
  564|  44.3k|        {
  565|       |            /* force the routine to decode ref idx for each partition */
  566|  44.3k|            *((UWORD32 *)pi1_ref_idx) = 0x01010101;
  567|  44.3k|            ret = ih264d_parse_ref_idx_cabac(u1_num_mb_part, 0,
  568|  44.3k|                                             uc_num_ref_idx_l0_active_minus1,
  569|  44.3k|                                             u1_mb_mc_mode, pi1_ref_idx,
  570|  44.3k|                                             pi1_left_ref_idx_ctxt_inc,
  571|  44.3k|                                             pi1_top_ref_idx_ctx_inc_arr, ps_cab_env,
  572|  44.3k|                                             ps_bitstrm, ps_dec->p_ref_idx_t);
  573|  44.3k|            if(ret != OK)
  ------------------
  |  |  114|  44.3k|#define OK        0
  ------------------
  |  Branch (573:16): [True: 104, False: 44.2k]
  ------------------
  574|    104|                return ret;
  575|  44.3k|        }
  576|  45.3k|        else
  577|  45.3k|        {
  578|       |            /* When there exists only a single frame to predict from */
  579|  45.3k|            pi1_left_ref_idx_ctxt_inc[0] = 0;
  580|  45.3k|            pi1_left_ref_idx_ctxt_inc[1] = 0;
  581|  45.3k|            pi1_top_ref_idx_ctx_inc_arr[0] = 0;
  582|  45.3k|            pi1_top_ref_idx_ctx_inc_arr[1] = 0;
  583|  45.3k|            *((UWORD32 *)pi1_ref_idx) = 0;
  584|  45.3k|        }
  585|  89.7k|    }
  586|       |
  587|  89.6k|    {
  588|  89.6k|        UWORD8 u1_p_idx;
  589|  89.6k|        UWORD32 uc_i;
  590|  89.6k|        parse_part_params_t * ps_part = ps_dec->ps_part;
  591|  89.6k|        UWORD8 u1_sub_mb_mode, u1_num_subpart, u1_mb_part_width, u1_mb_part_height;
  592|  89.6k|        UWORD32 u4_sub_mb_num;
  593|  89.6k|        const UWORD8 * pu1_top_left_sub_mb_indx;
  594|  89.6k|        mv_pred_t *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
  595|  89.6k|        UWORD16 u2_sub_mb_num_pack = 0x028A;
  596|       |
  597|       |        /* Loading the table pointers */
  598|  89.6k|        const UWORD8 * pu1_mb_partw = (const UWORD8 *)gau1_ih264d_mb_partw;
  599|  89.6k|        const UWORD8 * pu1_mb_parth = (const UWORD8 *)gau1_ih264d_mb_parth;
  600|  89.6k|        const UWORD8 * pu1_sub_mb_indx_mod =
  601|  89.6k|                        (const UWORD8 *)(gau1_ih264d_submb_indx_mod)
  602|  89.6k|                                        + (uc_sub_mb * 6);
  603|  89.6k|        const UWORD8 * pu1_sub_mb_partw = (const UWORD8 *)gau1_ih264d_submb_partw;
  604|  89.6k|        const UWORD8 * pu1_sub_mb_parth = (const UWORD8 *)gau1_ih264d_submb_parth;
  605|  89.6k|        const UWORD8 * pu1_num_sub_mb_part =
  606|  89.6k|                        (const UWORD8 *)gau1_ih264d_num_submb_part;
  607|       |
  608|       |        /*********************************************************/
  609|       |        /* default initialisations for condition (uc_sub_mb == 0) */
  610|       |        /* i.e. all are subpartitions of 8x8                     */
  611|       |        /*********************************************************/
  612|  89.6k|        u1_sub_mb_mode = 0;
  613|  89.6k|        u1_num_subpart = 1;
  614|  89.6k|        u1_mb_part_width = pu1_mb_partw[u1_mb_type];
  615|  89.6k|        u1_mb_part_height = pu1_mb_parth[u1_mb_type];
  616|  89.6k|        pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_type << 1);
  617|  89.6k|        u4_sub_mb_num = 0;
  618|       |
  619|       |        /* Loop on number of partitions */
  620|   261k|        for(uc_i = 0, u1_p_idx = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (620:37): [True: 171k, False: 89.6k]
  ------------------
  621|   171k|        {
  622|   171k|            UWORD8 uc_j;
  623|   171k|            if(uc_sub_mb)
  ------------------
  |  Branch (623:16): [True: 62.2k, False: 109k]
  ------------------
  624|  62.2k|            {
  625|  62.2k|                u1_sub_mb_mode = u4_sub_mb_pack >> 24;
  626|  62.2k|                u1_num_subpart = pu1_num_sub_mb_part[u1_sub_mb_mode];
  627|  62.2k|                u1_mb_part_width = pu1_sub_mb_partw[u1_sub_mb_mode];
  628|  62.2k|                u1_mb_part_height = pu1_sub_mb_parth[u1_sub_mb_mode];
  629|  62.2k|                pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_sub_mb_mode << 1);
  630|  62.2k|                u4_sub_mb_num = u2_sub_mb_num_pack >> 12;
  631|  62.2k|                u4_sub_mb_pack <<= 8;
  632|  62.2k|                u2_sub_mb_num_pack <<= 4;
  633|  62.2k|            }
  634|       |            /* Loop on Number of sub-partitions */
  635|   392k|            for(uc_j = 0; uc_j < u1_num_subpart; uc_j++, pu1_top_left_sub_mb_indx++)
  ------------------
  |  Branch (635:27): [True: 220k, False: 171k]
  ------------------
  636|   220k|            {
  637|   220k|                mv_pred_t * ps_mv;
  638|       |
  639|   220k|                u4_sub_mb_num += *pu1_top_left_sub_mb_indx;
  640|   220k|                ps_mv = ps_mv_start + u4_sub_mb_num;
  641|       |
  642|       |                /* Storing Info for partitions */
  643|   220k|                ps_part->u1_is_direct = PART_NOT_DIRECT;
  ------------------
  |  |  569|   220k|#define PART_NOT_DIRECT                0
  ------------------
  644|   220k|                ps_part->u1_sub_mb_num = u4_sub_mb_num;
  645|   220k|                ps_part->u1_partheight = u1_mb_part_height;
  646|   220k|                ps_part->u1_partwidth = u1_mb_part_width;
  647|       |
  648|       |                /* Increment partition Index */
  649|   220k|                u1_p_idx++;
  650|   220k|                ps_part++;
  651|       |
  652|   220k|                ih264d_get_mvd_cabac(u4_sub_mb_num, 0, u1_mb_part_width,
  653|   220k|                                     u1_mb_part_height, 1, ps_dec, ps_mv);
  654|   220k|            }
  655|   171k|        }
  656|  89.6k|        ps_parse_mb_data->u1_num_part = u1_p_idx;
  657|  89.6k|        ps_dec->ps_part = ps_part;
  658|  89.6k|    }
  659|  89.6k|    {
  660|  89.6k|        UWORD8 u1_cbp;
  661|       |
  662|       |        /* Read the Coded block pattern */
  663|  89.6k|        u1_cbp = (WORD8)ih264d_parse_ctx_cbp_cabac(ps_dec);
  664|  89.6k|        COPYTHECONTEXT("coded_block_pattern", u1_cbp);
  665|  89.6k|        ps_cur_mb_info->u1_cbp = u1_cbp;
  666|  89.6k|        p_curr_ctxt->u1_cbp = u1_cbp;
  667|  89.6k|        p_curr_ctxt->u1_intra_chroma_pred_mode = 0;
  668|  89.6k|        p_curr_ctxt->u1_yuv_dc_csbp &= 0xFE;
  669|  89.6k|        ps_dec->pu1_left_yuv_dc_csbp[0] &= 0x6;
  670|       |
  671|  89.6k|        if(u1_cbp > 47)
  ------------------
  |  Branch (671:12): [True: 0, False: 89.6k]
  ------------------
  672|      0|            return ERROR_CBP;
  673|       |
  674|  89.6k|        ps_cur_mb_info->u1_tran_form8x8 = 0;
  675|  89.6k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  676|       |
  677|       |        /* Read the transform8x8 u4_flag if present */
  678|  89.6k|        if((ps_dec->s_high_profile.u1_transform8x8_present) && (u1_cbp & 0xf)
  ------------------
  |  Branch (678:12): [True: 18.8k, False: 70.8k]
  |  Branch (678:64): [True: 11.6k, False: 7.14k]
  ------------------
  679|  11.6k|                        && u1_no_submb_part_size_lt8x8_flag)
  ------------------
  |  Branch (679:28): [True: 10.6k, False: 985]
  ------------------
  680|  10.6k|        {
  681|  10.6k|            ps_cur_mb_info->u1_tran_form8x8 = ih264d_parse_transform8x8flag_cabac(
  682|  10.6k|                            ps_dec, ps_cur_mb_info);
  683|  10.6k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  684|  10.6k|            p_curr_ctxt->u1_transform8x8_ctxt = ps_cur_mb_info->u1_tran_form8x8;
  685|  10.6k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  686|       |
  687|  10.6k|        }
  688|  78.9k|        else
  689|  78.9k|        {
  690|  78.9k|            p_curr_ctxt->u1_transform8x8_ctxt = 0;
  691|  78.9k|        }
  692|       |
  693|       |        /* Read mb_qp_delta */
  694|  89.6k|        if(u1_cbp)
  ------------------
  |  Branch (694:12): [True: 31.4k, False: 58.1k]
  ------------------
  695|  31.4k|        {
  696|  31.4k|            WORD8 c_temp;
  697|  31.4k|            ret = ih264d_parse_mb_qp_delta_cabac(ps_dec, &c_temp);
  698|  31.4k|            if(ret != OK)
  ------------------
  |  |  114|  31.4k|#define OK        0
  ------------------
  |  Branch (698:16): [True: 70, False: 31.4k]
  ------------------
  699|     70|                return ret;
  700|  31.4k|            COPYTHECONTEXT("mb_qp_delta", c_temp);
  701|  31.4k|            if(c_temp != 0)
  ------------------
  |  Branch (701:16): [True: 6.10k, False: 25.3k]
  ------------------
  702|  6.10k|            {
  703|  6.10k|                ret = ih264d_update_qp(ps_dec, c_temp);
  704|  6.10k|                if(ret != OK)
  ------------------
  |  |  114|  6.10k|#define OK        0
  ------------------
  |  Branch (704:20): [True: 0, False: 6.10k]
  ------------------
  705|      0|                    return ret;
  706|  6.10k|            }
  707|  31.4k|        }
  708|  58.1k|        else
  709|  58.1k|            ps_dec->i1_prev_mb_qp_delta = 0;
  710|       |
  711|       |
  712|       |
  713|  89.5k|        ih264d_parse_residual4x4_cabac(ps_dec, ps_cur_mb_info, 0);
  714|  89.5k|        if(EXCEED_OFFSET(ps_dec->ps_bitstrm))
  ------------------
  |  |   93|  89.5k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 2.55k, False: 87.0k]
  |  |  ------------------
  ------------------
  715|  2.55k|            return ERROR_EOB_TERMINATE_T;
  716|  89.5k|    }
  717|  87.0k|    return OK;
  ------------------
  |  |  114|  87.0k|#define OK        0
  ------------------
  718|  89.5k|}
ih264d_update_nnz_for_skipmb:
  755|  13.5M|{
  756|  13.5M|    UWORD32 *pu4_buf;
  757|  13.5M|    UWORD8 *pu1_buf;
  758|  13.5M|    UNUSED(u1_entrpy);
  ------------------
  |  |   45|  13.5M|#define UNUSED(x) ((void)(x))
  ------------------
  759|  13.5M|    pu1_buf = ps_dec->pu1_left_nnz_y;
  760|  13.5M|    pu4_buf = (UWORD32 *)pu1_buf;
  761|  13.5M|    *pu4_buf = 0;
  762|  13.5M|    pu1_buf = ps_dec->pu1_left_nnz_uv;
  763|  13.5M|    pu4_buf = (UWORD32 *)pu1_buf;
  764|  13.5M|    *pu4_buf = 0;
  765|  13.5M|    pu1_buf = ps_cur_mb_info->ps_curmb->pu1_nnz_y;
  766|  13.5M|    pu4_buf = (UWORD32 *)pu1_buf;
  767|  13.5M|    *pu4_buf = 0;
  768|  13.5M|    pu1_buf = ps_cur_mb_info->ps_curmb->pu1_nnz_uv;
  769|  13.5M|    pu4_buf = (UWORD32 *)pu1_buf;
  770|  13.5M|    *pu4_buf = 0;
  771|  13.5M|    ps_cur_mb_info->ps_curmb->u2_luma_csbp = 0;
  772|  13.5M|    ps_cur_mb_info->u2_luma_csbp = 0;
  773|  13.5M|    ps_cur_mb_info->u2_chroma_csbp = 0;
  774|  13.5M|}

ih264d_form_pred_weight_matrix:
   90|  16.9k|{
   91|  16.9k|    dec_slice_params_t *ps_cur_slice;
   92|  16.9k|    UWORD8 uc_num_ref_idx_l0_active, uc_num_ref_idx_l1_active;
   93|  16.9k|    UWORD8 i, j;
   94|  16.9k|    UWORD32 *pu4_mat_iwt_ofst;
   95|  16.9k|    UWORD16 i2_idx;
   96|  16.9k|    UWORD32 *pui32_weight_offset_l0, *pui32_weight_offset_l1;
   97|  16.9k|    UWORD32 u4_temp;
   98|       |
   99|  16.9k|    ps_cur_slice = ps_dec->ps_cur_slice;
  100|  16.9k|    uc_num_ref_idx_l0_active = ps_cur_slice->u1_num_ref_idx_lx_active[0];
  101|  16.9k|    uc_num_ref_idx_l1_active = ps_cur_slice->u1_num_ref_idx_lx_active[1];
  102|       |
  103|  16.9k|    pu4_mat_iwt_ofst = ps_dec->pu4_wts_ofsts_mat;
  104|       |
  105|  16.9k|    if(ps_cur_slice->u1_slice_type == B_SLICE)
  ------------------
  |  |  369|  16.9k|#define B_SLICE  1
  ------------------
  |  Branch (105:8): [True: 4.31k, False: 12.6k]
  ------------------
  106|  4.31k|    {
  107|  16.9k|        for(i = 0; i < uc_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (107:20): [True: 12.6k, False: 4.31k]
  ------------------
  108|  12.6k|        {
  109|  12.6k|            pui32_weight_offset_l0 = ps_cur_slice->u4_wt_ofst_lx[0][i];
  110|  32.4k|            for(j = 0; j < uc_num_ref_idx_l1_active; j++)
  ------------------
  |  Branch (110:24): [True: 19.8k, False: 12.6k]
  ------------------
  111|  19.8k|            {
  112|  19.8k|                pui32_weight_offset_l1 = ps_cur_slice->u4_wt_ofst_lx[1][j];
  113|  19.8k|                i2_idx = i * uc_num_ref_idx_l0_active + j;
  114|  19.8k|                i2_idx = X3(i2_idx);
  ------------------
  |  |   92|  19.8k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  115|       |                /*        u4_temp = (pui32_weight_offset_l0[0] | (pui32_weight_offset_l1[0] << 16));
  116|       |                 pu4_mat_iwt_ofst[0] = u4_temp;
  117|       |                 u4_temp = (pui32_weight_offset_l0[1] | (pui32_weight_offset_l1[1] << 16));
  118|       |                 pu4_mat_iwt_ofst[1] = u4_temp;
  119|       |                 u4_temp = (pui32_weight_offset_l0[2] | (pui32_weight_offset_l1[2] << 16));
  120|       |                 pu4_mat_iwt_ofst[2] = u4_temp;
  121|       |                 pu4_mat_iwt_ofst += 3;*/
  122|  19.8k|                pu4_mat_iwt_ofst[0] = pui32_weight_offset_l0[0];
  123|  19.8k|                pu4_mat_iwt_ofst[1] = pui32_weight_offset_l1[0];
  124|  19.8k|                pu4_mat_iwt_ofst[2] = pui32_weight_offset_l0[1];
  125|  19.8k|                pu4_mat_iwt_ofst[3] = pui32_weight_offset_l1[1];
  126|  19.8k|                pu4_mat_iwt_ofst[4] = pui32_weight_offset_l0[2];
  127|  19.8k|                pu4_mat_iwt_ofst[5] = pui32_weight_offset_l1[2];
  128|  19.8k|                pu4_mat_iwt_ofst += 6;
  129|  19.8k|            }
  130|  12.6k|        }
  131|  4.31k|    }
  132|  12.6k|    else
  133|  12.6k|    {
  134|  33.9k|        for(i = 0; i < uc_num_ref_idx_l0_active; i++)
  ------------------
  |  Branch (134:20): [True: 21.2k, False: 12.6k]
  ------------------
  135|  21.2k|        {
  136|  21.2k|            pui32_weight_offset_l0 = ps_cur_slice->u4_wt_ofst_lx[0][i];
  137|  21.2k|            i2_idx = X3(i);
  ------------------
  |  |   92|  21.2k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  138|  21.2k|            u4_temp = (UWORD32)pui32_weight_offset_l0[0];
  139|  21.2k|            pu4_mat_iwt_ofst[0] = u4_temp;
  140|  21.2k|            u4_temp = (UWORD32)pui32_weight_offset_l0[1];
  141|  21.2k|            pu4_mat_iwt_ofst[2] = u4_temp;
  142|  21.2k|            u4_temp = (UWORD32)pui32_weight_offset_l0[2];
  143|  21.2k|            pu4_mat_iwt_ofst[4] = u4_temp;
  144|  21.2k|            pu4_mat_iwt_ofst += 6;
  145|  21.2k|        }
  146|  12.6k|    }
  147|  16.9k|}
ih264d_end_of_pic_dispbuf_mgr:
  750|   129k|{
  751|   129k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
  752|   129k|    UWORD8 u1_num_of_users = 0;
  753|   129k|    WORD32 ret;
  754|       |
  755|   129k|    H264_MUTEX_LOCK(&ps_dec->process_disp_mutex);
  756|   129k|    if(1)
  ------------------
  |  Branch (756:8): [True: 129k, Folded]
  ------------------
  757|   129k|    {
  758|       |
  759|   129k|        {
  760|   129k|            ih264d_delete_nonref_nondisplay_pics(ps_dec->ps_dpb_mgr);
  761|   129k|            if(ps_cur_slice->u1_mmco_equalto5
  ------------------
  |  Branch (761:16): [True: 2.50k, False: 127k]
  ------------------
  762|   127k|                            || (ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL))
  ------------------
  |  |  328|   127k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (762:32): [True: 107k, False: 19.9k]
  ------------------
  763|   109k|            {
  764|   109k|                ps_dec->ps_cur_pic->i4_poc = 0;
  765|   109k|                if(ps_dec->u4_total_mbs_coded
  ------------------
  |  Branch (765:20): [True: 109k, False: 116]
  ------------------
  766|   109k|                                == (ps_dec->ps_cur_sps->u4_max_mb_addr + 1))
  767|   109k|                    ih264d_reset_ref_bufs(ps_dec->ps_dpb_mgr);
  768|   109k|                ih264d_release_display_bufs(ps_dec);
  769|   109k|            }
  770|   129k|            if(IVD_DECODE_FRAME_OUT != ps_dec->e_frm_out_mode)
  ------------------
  |  Branch (770:16): [True: 129k, False: 0]
  ------------------
  771|   129k|            {
  772|   129k|                ret = ih264d_assign_display_seq(ps_dec);
  773|   129k|                if(ret != OK)
  ------------------
  |  |  114|   129k|#define OK        0
  ------------------
  |  Branch (773:20): [True: 0, False: 129k]
  ------------------
  774|      0|                    return ret;
  775|   129k|            }
  776|   129k|        }
  777|       |
  778|   129k|        if(ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (778:12): [True: 112k, False: 17.0k]
  ------------------
  779|   112k|        {
  780|       |            /* Mark pic buf as needed for reference */
  781|   112k|            ih264_buf_mgr_set_status((buf_mgr_t *)ps_dec->pv_pic_buf_mgr,
  782|   112k|                                     ps_dec->u1_pic_buf_id,
  783|   112k|                                     BUF_MGR_REF);
  ------------------
  |  |   50|   112k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  784|       |            /* Mark mv buf as needed for reference */
  785|   112k|            ih264_buf_mgr_set_status((buf_mgr_t *)ps_dec->pv_mv_buf_mgr,
  786|   112k|                                     ps_dec->as_buf_id_info_map[ps_dec->u1_pic_buf_id].mv_buf_id,
  787|   112k|                                     BUF_MGR_REF);
  ------------------
  |  |   50|   112k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  788|   112k|            ps_dec->au1_pic_buf_ref_flag[ps_dec->u1_pic_buf_id] = 1;
  789|   112k|        }
  790|       |
  791|       |        /* 420 consumer */
  792|       |        /* Increment the number of users by 1 for display based upon */
  793|       |        /*the SEEK KEY FRAME control sent to decoder                 */
  794|   129k|        if(((0 == ps_dec->u1_last_pic_not_decoded)
  ------------------
  |  Branch (794:13): [True: 129k, False: 0]
  ------------------
  795|   129k|                        && (0
  ------------------
  |  Branch (795:28): [True: 129k, False: 0]
  ------------------
  796|   129k|                                        == (ps_dec->ps_cur_pic->u4_pack_slc_typ
  797|   129k|                                                        & ps_dec->u4_skip_frm_mask)))
  798|      0|                        || (ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL))
  ------------------
  |  |  328|      0|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (798:28): [True: 0, False: 0]
  ------------------
  799|   129k|        {
  800|       |            /* Mark pic buf as needed for display */
  801|   129k|            ih264_buf_mgr_set_status((buf_mgr_t *)ps_dec->pv_pic_buf_mgr,
  802|   129k|                                     ps_dec->u1_pic_buf_id,
  803|   129k|                                     BUF_MGR_IO);
  ------------------
  |  |   53|   129k|#define BUF_MGR_IO           (1 << 3)
  ------------------
  804|       |
  805|   129k|        }
  806|       |
  807|   129k|        if(!ps_cur_slice->u1_field_pic_flag
  ------------------
  |  Branch (807:12): [True: 129k, False: 0]
  ------------------
  808|      0|                        || ((TOP_FIELD_ONLY | BOT_FIELD_ONLY)
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                                      || ((TOP_FIELD_ONLY | BOT_FIELD_ONLY)
  ------------------
  |  |   65|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
  |  Branch (808:28): [True: 0, False: 0]
  ------------------
  809|      0|                                        != ps_dec->u1_top_bottom_decoded))
  810|   129k|        {
  811|   129k|            pic_buffer_t *ps_cur_pic = ps_dec->ps_cur_pic;
  812|   129k|            ps_cur_pic->u2_disp_width = ps_dec->u2_disp_width;
  813|   129k|            ps_cur_pic->u2_disp_height = ps_dec->u2_disp_height >> 1;
  814|       |
  815|   129k|            ps_cur_pic->u2_crop_offset_y = ps_dec->u2_crop_offset_y;
  816|   129k|            ps_cur_pic->u2_crop_offset_uv = ps_dec->u2_crop_offset_uv;
  817|   129k|            ps_cur_pic->u1_pic_type = 0;
  818|   129k|            {
  819|   129k|                WORD64 i8_display_poc;
  820|   129k|                i8_display_poc = (WORD64)ps_dec->i4_prev_max_display_seq +
  821|   129k|                            ps_dec->ps_cur_pic->i4_poc;
  822|   129k|                if(IS_OUT_OF_RANGE_S32(i8_display_poc))
  ------------------
  |  |   58|   129k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 129k]
  |  |  |  Branch (58:54): [True: 393, False: 129k]
  |  |  ------------------
  ------------------
  823|    393|                {
  824|    393|                    ps_dec->i4_prev_max_display_seq = 0;
  825|    393|                }
  826|   129k|            }
  827|   129k|            ret = ih264d_insert_pic_in_display_list(
  828|   129k|                            ps_dec->ps_dpb_mgr,
  829|   129k|                            ps_dec->u1_pic_buf_id,
  830|   129k|                            ps_dec->i4_prev_max_display_seq
  831|   129k|                                            + ps_dec->ps_cur_pic->i4_poc,
  832|   129k|                            ps_dec->ps_cur_pic->i4_frame_num);
  833|   129k|            if(ret != OK)
  ------------------
  |  |  114|   129k|#define OK        0
  ------------------
  |  Branch (833:16): [True: 0, False: 129k]
  ------------------
  834|      0|                return ret;
  835|       |
  836|   129k|            {
  837|   129k|                ivd_video_decode_op_t * ps_dec_output =
  838|   129k|                                (ivd_video_decode_op_t *)ps_dec->pv_dec_out;
  839|       |
  840|   129k|                ps_dec_output->u4_frame_decoded_flag = 1;
  841|   129k|            }
  842|   129k|            if(ps_dec->au1_pic_buf_ref_flag[ps_dec->u1_pic_buf_id] == 0)
  ------------------
  |  Branch (842:16): [True: 17.0k, False: 112k]
  ------------------
  843|  17.0k|            {
  844|  17.0k|                ih264_buf_mgr_release((buf_mgr_t *)ps_dec->pv_mv_buf_mgr,
  845|  17.0k|                                      ps_dec->as_buf_id_info_map[ps_dec->u1_pic_buf_id].mv_buf_id,
  846|  17.0k|                                      BUF_MGR_REF);
  ------------------
  |  |   50|  17.0k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  847|  17.0k|                ps_dec->au1_pic_buf_ref_flag[ps_dec->u1_pic_buf_id] = 0;
  848|       |
  849|  17.0k|            }
  850|   129k|        }
  851|      0|        else
  852|      0|        {
  853|      0|            H264_DEC_DEBUG_PRINT("pic not inserted display %d %d\n",
  ------------------
  |  |   39|      0|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
  854|      0|                                 ps_cur_slice->u1_field_pic_flag,
  855|      0|                                 ps_dec->u1_second_field);
  856|      0|        }
  857|       |
  858|   129k|        if(!ps_cur_slice->u1_field_pic_flag
  ------------------
  |  Branch (858:12): [True: 129k, False: 0]
  ------------------
  859|      0|                        || ((TOP_FIELD_ONLY | BOT_FIELD_ONLY)
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                                      || ((TOP_FIELD_ONLY | BOT_FIELD_ONLY)
  ------------------
  |  |   65|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
  |  Branch (859:28): [True: 0, False: 0]
  ------------------
  860|      0|                                        == ps_dec->u1_top_bottom_decoded))
  861|   129k|        {
  862|   129k|            if(IVD_DECODE_FRAME_OUT == ps_dec->e_frm_out_mode)
  ------------------
  |  Branch (862:16): [True: 0, False: 129k]
  ------------------
  863|      0|            {
  864|      0|                ret = ih264d_assign_display_seq(ps_dec);
  865|      0|                if(ret != OK)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (865:20): [True: 0, False: 0]
  ------------------
  866|      0|                    return ret;
  867|      0|            }
  868|   129k|        }
  869|   129k|    }
  870|       |
  871|   129k|    H264_MUTEX_UNLOCK(&ps_dec->process_disp_mutex);
  872|       |
  873|   129k|    return OK;
  ------------------
  |  |  114|   129k|#define OK        0
  ------------------
  874|   129k|}
ih264d_deblock_picture:
  894|   129k|{
  895|   129k|    dec_struct_t *ps_dec = (dec_struct_t *)ptr;
  896|       |
  897|   129k|    {
  898|       |        /*Deblock picture only if all the mb's in the frame have been decoded*/
  899|   129k|        if(ps_dec->u1_pic_decode_done == 1)
  ------------------
  |  Branch (899:12): [True: 129k, False: 116]
  ------------------
  900|   129k|        {
  901|   129k|            if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag
  ------------------
  |  Branch (901:16): [True: 0, False: 129k]
  ------------------
  902|   129k|                            || ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (902:32): [True: 0, False: 129k]
  ------------------
  903|      0|            {
  904|      0|                ps_dec->p_DeblockPicture[ps_dec->ps_cur_slice->u1_mbaff_frame_flag](
  905|      0|                                ps_dec);
  906|      0|            }
  907|   129k|            else
  908|       |
  909|   129k|            {
  910|       |
  911|   129k|                ih264d_deblock_picture_progressive(ps_dec);
  912|   129k|            }
  913|       |
  914|   129k|        }
  915|   129k|    }
  916|       |
  917|   129k|}
ih264d_deblock_display:
  930|   129k|{
  931|   129k|    WORD32 ret;
  932|       |    /* Call deblocking */
  933|   129k|    ih264d_deblock_picture(ps_dec);
  934|       |
  935|   129k|    ret = ih264d_end_of_pic_dispbuf_mgr(ps_dec);
  936|   129k|    if(ret != OK)
  ------------------
  |  |  114|   129k|#define OK        0
  ------------------
  |  Branch (936:8): [True: 0, False: 129k]
  ------------------
  937|      0|        return ret;
  938|       |
  939|   129k|    return OK;
  ------------------
  |  |  114|   129k|#define OK        0
  ------------------
  940|   129k|}
ih264d_end_of_pic:
  956|   129k|{
  957|   129k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
  958|   129k|    WORD32 ret;
  959|       |
  960|   129k|    {
  961|   129k|        dec_err_status_t * ps_err = ps_dec->ps_dec_err_status;
  962|   129k|        if(ps_err->u1_err_flag & REJECT_CUR_PIC)
  ------------------
  |  |  601|   129k|#define REJECT_CUR_PIC    (0x01)
  ------------------
  |  Branch (962:12): [True: 0, False: 129k]
  ------------------
  963|      0|        {
  964|      0|            ih264d_err_pic_dispbuf_mgr(ps_dec);
  965|      0|            return ERROR_NEW_FRAME_EXPECTED;
  966|      0|        }
  967|   129k|    }
  968|       |
  969|   129k|    H264_MUTEX_LOCK(&ps_dec->process_disp_mutex);
  970|   129k|    ret = ih264d_end_of_pic_processing(ps_dec);
  971|   129k|    if(ret != OK)
  ------------------
  |  |  114|   129k|#define OK        0
  ------------------
  |  Branch (971:8): [True: 0, False: 129k]
  ------------------
  972|      0|        return ret;
  973|       |    /*--------------------------------------------------------------------*/
  974|       |    /* ih264d_decode_pic_order_cnt - calculate the Pic Order Cnt                    */
  975|       |    /* Needed to detect end of picture                                    */
  976|       |    /*--------------------------------------------------------------------*/
  977|       |
  978|   129k|    H264_MUTEX_UNLOCK(&ps_dec->process_disp_mutex);
  979|       |
  980|   129k|    return OK;
  ------------------
  |  |  114|   129k|#define OK        0
  ------------------
  981|   129k|}
ih264d_fix_error_in_dpb:
  997|   140k|{
  998|       |    /*--------------------------------------------------------------------*/
  999|       |    /* If there is common node in lt_list and st_list then delete it from */
 1000|       |    /* st_list                                                            */
 1001|       |    /*--------------------------------------------------------------------*/
 1002|   140k|    UWORD8 no_of_nodes_deleted = 0;
 1003|   140k|    UWORD8 lt_ref_num = ps_dec->ps_dpb_mgr->u1_num_lt_ref_bufs;
 1004|   140k|    struct dpb_info_t *ps_lt_curr_dpb = ps_dec->ps_dpb_mgr->ps_dpb_ht_head;
 1005|   158k|    while(lt_ref_num && ps_lt_curr_dpb)
  ------------------
  |  Branch (1005:11): [True: 17.7k, False: 140k]
  |  Branch (1005:25): [True: 17.7k, False: 0]
  ------------------
 1006|  17.7k|    {
 1007|  17.7k|        if(ps_dec->ps_dpb_mgr->ps_dpb_st_head
  ------------------
  |  Branch (1007:12): [True: 1.95k, False: 15.7k]
  ------------------
 1008|  1.95k|                && ((ps_lt_curr_dpb->s_bot_field.u1_reference_info
  ------------------
  |  Branch (1008:20): [True: 0, False: 1.95k]
  ------------------
 1009|  1.95k|                        | ps_lt_curr_dpb->s_top_field.u1_reference_info)
 1010|  1.95k|                        == (IS_SHORT_TERM | IS_LONG_TERM)))
  ------------------
  |  |  596|  1.95k|#define IS_SHORT_TERM  1
  ------------------
                                      == (IS_SHORT_TERM | IS_LONG_TERM)))
  ------------------
  |  |  597|  1.95k|#define IS_LONG_TERM   2
  ------------------
 1011|      0|        {
 1012|      0|            struct dpb_info_t *ps_st_next_dpb = ps_dec->ps_dpb_mgr->ps_dpb_st_head;
 1013|      0|            struct dpb_info_t *ps_st_curr_dpb = ps_dec->ps_dpb_mgr->ps_dpb_st_head;
 1014|      0|            UWORD8 st_ref_num = ps_dec->ps_dpb_mgr->u1_num_st_ref_bufs;
 1015|      0|            while(st_ref_num && ps_st_curr_dpb)
  ------------------
  |  Branch (1015:19): [True: 0, False: 0]
  |  Branch (1015:33): [True: 0, False: 0]
  ------------------
 1016|      0|            {
 1017|      0|                if(ps_st_curr_dpb == ps_lt_curr_dpb)
  ------------------
  |  Branch (1017:20): [True: 0, False: 0]
  ------------------
 1018|      0|                {
 1019|      0|                    if(st_ref_num == ps_dec->ps_dpb_mgr->u1_num_st_ref_bufs)
  ------------------
  |  Branch (1019:24): [True: 0, False: 0]
  ------------------
 1020|      0|                    {
 1021|      0|                        ps_dec->ps_dpb_mgr->ps_dpb_st_head =
 1022|      0|                                ps_dec->ps_dpb_mgr->ps_dpb_st_head->ps_prev_short;
 1023|      0|                        ps_st_curr_dpb = ps_dec->ps_dpb_mgr->ps_dpb_st_head;
 1024|      0|                    }
 1025|      0|                    else
 1026|      0|                    {
 1027|      0|                        ps_st_next_dpb->ps_prev_short = ps_st_curr_dpb->ps_prev_short;
 1028|      0|                    }
 1029|      0|                    ps_dec->ps_dpb_mgr->u1_num_st_ref_bufs--;
 1030|      0|                    no_of_nodes_deleted++;
 1031|      0|                    break;
 1032|      0|                }
 1033|      0|                ps_st_next_dpb = ps_st_curr_dpb;
 1034|      0|                ps_st_curr_dpb = ps_st_curr_dpb->ps_prev_short;
 1035|      0|                st_ref_num--;
 1036|      0|            }
 1037|      0|        }
 1038|  17.7k|        ps_lt_curr_dpb = ps_lt_curr_dpb->ps_prev_long;
 1039|  17.7k|        lt_ref_num--;
 1040|  17.7k|    }
 1041|   140k|    return no_of_nodes_deleted;
 1042|   140k|}

ih264d_decode_spatial_direct:
   75|   526k|{
   76|   526k|    mv_pred_t s_mv_pred, *ps_mv;
   77|   526k|    UWORD32 u4_sub_mb_num;
   78|   526k|    UWORD8 u1_col_zero_flag, u1_direct_zero_pred_flag = 0;
   79|   526k|    UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
   80|   526k|    mv_pred_t *ps_mv_ntop_start;
   81|   526k|    mv_pred_t *ps_mv_nmb_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
   82|   526k|    UWORD8 partition_size, sub_partition, u1_mb_partw, u1_mb_parth;
   83|   526k|    UWORD8 i;
   84|   526k|    WORD8 i1_pred, i1_ref_frame0, i1_ref_frame1;
   85|   526k|    struct pic_buffer_t *ps_ref_frame = NULL, *ps_col_pic, *ps_pic_buff0 = NULL,
   86|   526k|                    *ps_pic_buff1 = NULL;
   87|       |
   88|   526k|    UWORD8 u1_zero_pred_cond_f, u1_zero_pred_cond_b;
   89|   526k|    WORD16 i2_def_mv[2], i2_spat_pred_mv[4], *pi2_final_mv0, *pi2_final_mv1;
   90|   526k|    UWORD16 ui2_mask_fwd = 0, ui2_mask_bwd = 0, u2_mask = 0;
   91|   526k|    UWORD32 *pui32_weight_ofsts = NULL;
   92|   526k|    directmv_t s_mvdirect;
   93|   526k|    UWORD8 u1_colz;
   94|   526k|    UWORD8 u1_final_ref_idx = 0;
   95|   526k|    const UWORD8 *pu1_mb_parth = (const UWORD8 *)gau1_ih264d_mb_parth;
   96|   526k|    const UWORD8 *pu1_mb_partw = (const UWORD8 *)gau1_ih264d_mb_partw;
   97|   526k|    const UWORD16 sub_mask_table[] =
   98|   526k|        { 0x33, 0x3, 0x11, 0x1 };
   99|   526k|    const UWORD16 mask_table[] =
  100|   526k|        { 0xffff, /*16x16 NA */
  101|   526k|          0xff, /* 16x8*/
  102|   526k|          0x3333, /* 8x16*/
  103|   526k|          0x33 };/* 8x8*/
  104|   526k|    mv_pred_t s_temp_mv_pred;
  105|   526k|    WORD32 ret = 0;
  106|       |
  107|       |    /* CHANGED CODE */
  108|   526k|    ps_mv_ntop_start = ps_dec->ps_mv_cur + (u4_mb_num << 4)
  109|   526k|                    - (ps_dec->u2_frm_wd_in_mbs << (4 + u1_mbaff)) + 12;
  110|       |
  111|       |    /* assign default values for MotionVector as zero */
  112|   526k|    i2_def_mv[0] = 0;
  113|   526k|    i2_def_mv[1] = 0;
  114|       |
  115|   526k|    u1_direct_zero_pred_flag = ps_dec->pf_mvpred(ps_dec, ps_cur_mb_info, ps_mv_nmb_start,
  116|   526k|                                              ps_mv_ntop_start, &s_mv_pred, 0, 4,
  117|   526k|                                              0, 1, B_DIRECT_SPATIAL);
  ------------------
  |  |  489|   526k|#define B_DIRECT_SPATIAL  26
  ------------------
  118|       |
  119|   526k|    i2_spat_pred_mv[0] = s_mv_pred.i2_mv[0];
  120|   526k|    i2_spat_pred_mv[1] = s_mv_pred.i2_mv[1];
  121|   526k|    i2_spat_pred_mv[2] = s_mv_pred.i2_mv[2];
  122|   526k|    i2_spat_pred_mv[3] = s_mv_pred.i2_mv[3];
  123|       |
  124|   526k|    i1_ref_frame0 = s_mv_pred.i1_ref_frame[0];
  125|   526k|    i1_ref_frame1 = s_mv_pred.i1_ref_frame[1];
  126|       |
  127|   526k|    i1_ref_frame0 = (i1_ref_frame0 < 0) ? -1 : i1_ref_frame0;
  ------------------
  |  Branch (127:21): [True: 49.7k, False: 476k]
  ------------------
  128|   526k|    i1_ref_frame1 = (i1_ref_frame1 < 0) ? -1 : i1_ref_frame1;
  ------------------
  |  Branch (128:21): [True: 30.3k, False: 496k]
  ------------------
  129|       |
  130|   526k|    i1_pred = 0;
  131|       |
  132|   526k|    {
  133|   526k|        WORD8 u1_ref_idx, u1_ref_idx1;
  134|   526k|        UWORD32 uc_Idx, uc_Idx1;
  135|   526k|        UWORD8 u1_scale_ref = (ps_dec->ps_cur_slice->u1_mbaff_frame_flag
  ------------------
  |  Branch (135:32): [True: 0, False: 526k]
  ------------------
  136|      0|                        && ps_cur_mb_info->u1_mb_field_decodingflag);
  ------------------
  |  Branch (136:28): [True: 0, False: 0]
  ------------------
  137|   526k|        u1_final_ref_idx = i1_ref_frame0;
  138|   526k|        if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (138:12): [True: 476k, False: 49.7k]
  ------------------
  139|   476k|        {
  140|       |            /* convert RefIdx if it is MbAff */
  141|   476k|            u1_ref_idx = i1_ref_frame0;
  142|   476k|            u1_ref_idx1 = i1_ref_frame0;
  143|   476k|            if(u1_scale_ref)
  ------------------
  |  Branch (143:16): [True: 0, False: 476k]
  ------------------
  144|      0|            {
  145|      0|                u1_ref_idx1 = u1_ref_idx >> 1;
  146|      0|                if((u1_ref_idx & 0x01) != (1 - ps_cur_mb_info->u1_topmb))
  ------------------
  |  Branch (146:20): [True: 0, False: 0]
  ------------------
  147|      0|                    u1_ref_idx1 += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  148|      0|            }
  149|       |            /* If i1_ref_frame0 < 0 then refIdxCol is obtained from ps_pic_buff1 */
  150|   476k|            ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][u1_ref_idx1];
  151|   476k|            ps_ref_frame = ps_pic_buff0;
  152|   476k|            i1_pred = PRED_L0;
  ------------------
  |  |  483|   476k|#define PRED_L0   1
  ------------------
  153|   476k|        }
  154|       |
  155|   526k|        if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (155:12): [True: 496k, False: 30.3k]
  ------------------
  156|   496k|        {
  157|       |            /* convert RefIdx if it is MbAff */
  158|   496k|            u1_ref_idx = i1_ref_frame1;
  159|   496k|            u1_ref_idx1 = i1_ref_frame1;
  160|   496k|            if(u1_scale_ref)
  ------------------
  |  Branch (160:16): [True: 0, False: 496k]
  ------------------
  161|      0|            {
  162|      0|                u1_ref_idx1 = u1_ref_idx >> 1;
  163|      0|                if((u1_ref_idx & 0x01) != (1 - ps_cur_mb_info->u1_topmb))
  ------------------
  |  Branch (163:20): [True: 0, False: 0]
  ------------------
  164|      0|                    u1_ref_idx1 += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  165|      0|            }
  166|   496k|            ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][u1_ref_idx1];
  167|   496k|            i1_pred = i1_pred | PRED_L1;
  ------------------
  |  |  484|   496k|#define PRED_L1   2
  ------------------
  168|   496k|        }
  169|   526k|        if(i1_ref_frame0 < 0)
  ------------------
  |  Branch (169:12): [True: 49.7k, False: 476k]
  ------------------
  170|  49.7k|        {
  171|  49.7k|            ps_ref_frame = ps_pic_buff1;
  172|  49.7k|            u1_final_ref_idx = i1_ref_frame1;
  173|  49.7k|        }
  174|       |
  175|   526k|        u1_zero_pred_cond_f = (u1_direct_zero_pred_flag) || (i1_ref_frame0 < 0);
  ------------------
  |  Branch (175:31): [True: 9.70k, False: 516k]
  |  Branch (175:61): [True: 49.7k, False: 466k]
  ------------------
  176|   526k|        u1_zero_pred_cond_b = (u1_direct_zero_pred_flag) || (i1_ref_frame1 < 0);
  ------------------
  |  Branch (176:31): [True: 9.70k, False: 516k]
  |  Branch (176:61): [True: 30.3k, False: 486k]
  ------------------
  177|       |
  178|   526k|        if(ps_dec->ps_cur_pps->u1_wted_bipred_idc)
  ------------------
  |  Branch (178:12): [True: 418k, False: 107k]
  ------------------
  179|   418k|        {
  180|   418k|            uc_Idx = ((i1_ref_frame0 < 1) ? 0 : i1_ref_frame0)
  ------------------
  |  Branch (180:23): [True: 414k, False: 3.95k]
  ------------------
  181|   418k|                            * ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1];
  182|   418k|            if(u1_scale_ref)
  ------------------
  |  Branch (182:16): [True: 0, False: 418k]
  ------------------
  183|      0|                uc_Idx >>= 1;
  184|   418k|            uc_Idx1 = (i1_ref_frame1 < 0) ? 0 : i1_ref_frame1;
  ------------------
  |  Branch (184:23): [True: 24.8k, False: 393k]
  ------------------
  185|   418k|            uc_Idx += (u1_scale_ref) ? (uc_Idx1 >> 1) : uc_Idx1;
  ------------------
  |  Branch (185:23): [True: 0, False: 418k]
  ------------------
  186|   418k|            pui32_weight_ofsts =
  187|   418k|                            (UWORD32*)&ps_dec->pu4_wt_ofsts[2 * X3(uc_Idx)];
  ------------------
  |  |   92|   418k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  188|       |
  189|   418k|            if(i1_ref_frame0 < 0)
  ------------------
  |  Branch (189:16): [True: 44.6k, False: 373k]
  ------------------
  190|  44.6k|                pui32_weight_ofsts += 1;
  191|       |
  192|   418k|            if(u1_scale_ref && (ps_dec->ps_cur_pps->u1_wted_bipred_idc == 2))
  ------------------
  |  Branch (192:16): [True: 0, False: 418k]
  |  Branch (192:32): [True: 0, False: 0]
  ------------------
  193|      0|            {
  194|      0|                WORD16 i2_ref_idx;
  195|      0|                i2_ref_idx = MAX(i1_ref_frame0, 0);
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  196|      0|                i2_ref_idx *= (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1]
  197|      0|                                << 1);
  198|      0|                i2_ref_idx += MAX(i1_ref_frame1, 0);
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  199|      0|                if(!ps_cur_mb_info->u1_topmb)
  ------------------
  |  Branch (199:20): [True: 0, False: 0]
  ------------------
  200|      0|                    i2_ref_idx +=
  201|      0|                                    (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0]
  202|      0|                                                    << 1)
  203|      0|                                                    * (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1]
  204|      0|                                                                    << 1);
  205|      0|                pui32_weight_ofsts = (UWORD32*)&ps_dec->pu4_mbaff_wt_mat[2
  206|      0|                                * X3(i2_ref_idx)];
  ------------------
  |  |   92|      0|#define X3(a)   (((a) << 1) + (a))
  ------------------
  207|      0|            }
  208|   418k|        }
  209|   526k|    }
  210|       |
  211|   526k|    s_temp_mv_pred.i1_ref_frame[0] = i1_ref_frame0;
  212|   526k|    s_temp_mv_pred.i1_ref_frame[1] = i1_ref_frame1;
  213|   526k|    s_temp_mv_pred.u1_col_ref_pic_idx = ps_ref_frame->u1_mv_buf_id;
  214|   526k|    s_temp_mv_pred.u1_pic_type = ps_ref_frame->u1_pic_type;
  215|       |
  216|       |    /**********************************************************************/
  217|       |    /* Call the function which gets the number of partitions and          */
  218|       |    /* partition info of colocated Mb                                     */
  219|       |    /**********************************************************************/
  220|       |
  221|   526k|    ps_dec->pf_parse_mvdirect(ps_dec, ps_dec->ps_col_pic, &s_mvdirect, u1_wd_x,
  222|   526k|                           ps_dec->i4_submb_ofst, ps_cur_mb_info);
  223|   526k|    ps_col_pic = ps_dec->ps_col_pic;
  224|   526k|    if((s_mvdirect.u1_col_zeroflag_change == 0) || u1_direct_zero_pred_flag)
  ------------------
  |  Branch (224:8): [True: 523k, False: 2.74k]
  |  Branch (224:52): [True: 86, False: 2.65k]
  ------------------
  225|   523k|    {
  226|   523k|        WORD16 i2_mv_x, i2_mv_y, i2_mvX1, i2_mvY1;
  227|       |        /* Most probable case */
  228|   523k|        u1_col_zero_flag = *(ps_col_pic->pu1_col_zero_flag
  229|   523k|                        + s_mvdirect.i4_mv_indices[0]);
  230|   523k|        u1_col_zero_flag = u1_col_zero_flag & 0x01;
  231|       |
  232|   523k|        if(u1_zero_pred_cond_f || ((i1_ref_frame0 == 0) && (u1_col_zero_flag == 1)))
  ------------------
  |  Branch (232:12): [True: 58.7k, False: 464k]
  |  Branch (232:36): [True: 461k, False: 3.75k]
  |  Branch (232:60): [True: 157k, False: 303k]
  ------------------
  233|   216k|        {
  234|   216k|            i2_mv_x = 0;
  235|   216k|            i2_mv_y = 0;
  236|   216k|        }
  237|   307k|        else
  238|   307k|        {
  239|   307k|            i2_mv_x = i2_spat_pred_mv[0];
  240|   307k|            i2_mv_y = i2_spat_pred_mv[1];
  241|       |
  242|   307k|        }
  243|       |
  244|   523k|        if(u1_zero_pred_cond_b || ((i1_ref_frame1 == 0) && (u1_col_zero_flag == 1)))
  ------------------
  |  Branch (244:12): [True: 39.5k, False: 484k]
  |  Branch (244:36): [True: 479k, False: 4.67k]
  |  Branch (244:60): [True: 158k, False: 321k]
  ------------------
  245|   197k|        {
  246|   197k|            i2_mvX1 = 0;
  247|   197k|            i2_mvY1 = 0;
  248|   197k|        }
  249|   325k|        else
  250|   325k|        {
  251|   325k|            i2_mvX1 = i2_spat_pred_mv[2];
  252|   325k|            i2_mvY1 = i2_spat_pred_mv[3];
  253|   325k|        }
  254|       |
  255|   523k|        u4_sub_mb_num = ps_dec->u1_sub_mb_num;
  256|   523k|        u1_mb_partw = (u1_wd_x >> 2);
  257|       |
  258|       |
  259|   523k|        if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (259:12): [True: 474k, False: 49.0k]
  ------------------
  260|   474k|        {
  261|   474k|            {
  262|   474k|               pred_info_pkd_t *ps_pred_pkd;
  263|   474k|               WORD16 i2_mv[2];
  264|   474k|               WORD8 i1_ref_idx= 0;
  265|       |
  266|   474k|               i2_mv[0] = i2_mv_x;
  267|   474k|               i2_mv[1] = i2_mv_y;
  268|       |
  269|   474k|               ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  270|   474k|            ih264d_fill_pred_info(i2_mv,u1_mb_partw,u1_mb_partw,u4_sub_mb_num,i1_pred,
  271|   474k|                            ps_pred_pkd,ps_pic_buff0->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  272|   474k|                            ps_pic_buff0->u1_pic_type);
  273|   474k|            ps_dec->u4_pred_info_pkd_idx++;
  274|   474k|            ps_cur_mb_info->u1_num_pred_parts++;
  275|       |
  276|       |
  277|   474k|            }
  278|       |
  279|   474k|        }
  280|       |
  281|   523k|        if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (281:12): [True: 493k, False: 29.8k]
  ------------------
  282|   493k|        {
  283|   493k|            {
  284|   493k|                pred_info_pkd_t *ps_pred_pkd;
  285|   493k|               WORD16 i2_mv[2];
  286|   493k|               WORD8 i1_ref_idx= 0;
  287|       |
  288|   493k|               i2_mv[0] = i2_mvX1;
  289|   493k|               i2_mv[1] = i2_mvY1;
  290|       |
  291|   493k|               ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  292|   493k|            ih264d_fill_pred_info(i2_mv,u1_mb_partw,u1_mb_partw,u4_sub_mb_num,i1_pred,
  293|   493k|                            ps_pred_pkd,ps_pic_buff1->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  294|   493k|                            ps_pic_buff1->u1_pic_type);
  295|   493k|            ps_dec->u4_pred_info_pkd_idx++;
  296|   493k|            ps_cur_mb_info->u1_num_pred_parts++;
  297|       |
  298|       |
  299|   493k|            }
  300|   493k|        }
  301|       |
  302|       |
  303|       |        /* Replication optimisation */
  304|   523k|        s_temp_mv_pred.i2_mv[0] = i2_mv_x;
  305|   523k|        s_temp_mv_pred.i2_mv[1] = i2_mv_y;
  306|   523k|        s_temp_mv_pred.i2_mv[2] = i2_mvX1;
  307|   523k|        s_temp_mv_pred.i2_mv[3] = i2_mvY1;
  308|       |
  309|       |        /* Calculating colocated zero information */
  310|   523k|        {
  311|       |            /*************************************/
  312|       |            /* If(bit2 and bit3 set)             */
  313|       |            /* then                              */
  314|       |            /*  (bit0 and bit1) => submmbmode    */
  315|       |            /*  (bit2 and bit3) => mbmode        */
  316|       |            /* else                              */
  317|       |            /*  (bit0 and bit1) => mbmode        */
  318|       |            /*************************************/
  319|       |            /*UWORD8 u1_packed_mb_sub_mb_mode = sub_partition ?
  320|       |             (s_mvdirect.i1_partitionsize[0]) : ((s_mvdirect.i1_partitionsize[0]) << 2);*/
  321|   523k|            UWORD8 u1_packed_mb_sub_mb_mode = (u1_mb_partw == 2) ? 0x03 : 0;
  ------------------
  |  Branch (321:47): [True: 3.25k, False: 520k]
  ------------------
  322|       |
  323|   523k|            if(i1_ref_frame0 < 0)
  ------------------
  |  Branch (323:16): [True: 49.0k, False: 474k]
  ------------------
  324|  49.0k|            {
  325|  49.0k|                i2_mv_x = i2_mvX1;
  326|  49.0k|                i2_mv_y = i2_mvY1;
  327|  49.0k|            }
  328|       |
  329|       |            /* Change from left shift 4 to 6 - Varun */
  330|   523k|            u1_colz = (ps_cur_mb_info->u1_mb_field_decodingflag << 1)
  331|   523k|                            | ((u1_final_ref_idx == 0) && (ABS(i2_mv_x) <= 1)
  ------------------
  |  |  100|   519k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 104k, False: 414k]
  |  |  ------------------
  ------------------
  |  Branch (331:32): [True: 519k, False: 4.42k]
  |  Branch (331:59): [True: 394k, False: 125k]
  ------------------
  332|   394k|                                            && (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|   394k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 34.6k, False: 359k]
  |  |  ------------------
  ------------------
  |  Branch (332:48): [True: 359k, False: 34.9k]
  ------------------
  333|   523k|            u1_colz |= (u1_packed_mb_sub_mb_mode << 6);
  334|   523k|        }
  335|   523k|        ps_mv = ps_mv_nmb_start + u4_sub_mb_num;
  336|   523k|        ih264d_rep_mv_colz(ps_dec, &s_temp_mv_pred, ps_mv, u4_sub_mb_num, u1_colz,
  337|   523k|                           u1_mb_partw, u1_mb_partw);
  338|   523k|        if(u1_wd_x == MB_SIZE)
  ------------------
  |  |  554|   523k|#define MB_SIZE             16
  ------------------
  |  Branch (338:12): [True: 520k, False: 3.25k]
  ------------------
  339|   520k|            ps_dec->u1_currB_type = 0;
  340|       |
  341|       |
  342|       |
  343|   523k|        return OK;
  ------------------
  |  |  114|   523k|#define OK        0
  ------------------
  344|   523k|    }
  345|       |    /***************************************************************************/
  346|       |    /* If present MB is 16x16 and the partition of colocated Mb is >= PRED_8x8 */
  347|       |    /* i.e 8x8 or less than 8x8 partitions then set up DMA for (0,0) and       */
  348|       |    /* spatially predicted motion vector and do the multiplexing after         */
  349|       |    /* motion compensation                                                     */
  350|       |    /***************************************************************************/
  351|       |
  352|       |
  353|  2.65k|    if((u1_wd_x == MB_SIZE) && (s_mvdirect.i1_num_partitions > 2))
  ------------------
  |  |  554|  2.65k|#define MB_SIZE             16
  ------------------
  |  Branch (353:8): [True: 2.55k, False: 97]
  |  Branch (353:32): [True: 1.66k, False: 895]
  ------------------
  354|  1.66k|    {
  355|  1.66k|        ps_cur_mb_info->u1_Mux = 1;
  356|  1.66k|        if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (356:12): [True: 1.32k, False: 335]
  ------------------
  357|  1.32k|        {
  358|       |
  359|  1.32k|            {
  360|  1.32k|                pred_info_pkd_t *ps_pred_pkd;
  361|  1.32k|               WORD8 i1_ref_idx= 0;
  362|       |
  363|  1.32k|               ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  364|  1.32k|            ih264d_fill_pred_info(&(i2_spat_pred_mv[0]),4,4,0,i1_pred,
  365|  1.32k|                            ps_pred_pkd,ps_pic_buff0->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  366|  1.32k|                            ps_pic_buff0->u1_pic_type);
  367|  1.32k|            ps_dec->u4_pred_info_pkd_idx++;
  368|  1.32k|            ps_cur_mb_info->u1_num_pred_parts++;
  369|       |
  370|       |
  371|  1.32k|            }
  372|       |
  373|       |            /******    (0,0) Motion vectors DMA     *****/
  374|  1.32k|            {
  375|  1.32k|                pred_info_pkd_t *ps_pred_pkd;
  376|  1.32k|               WORD16 i2_mv[2];
  377|  1.32k|               WORD8 i1_ref_idx= 0;
  378|       |
  379|  1.32k|               i2_mv[0] = 0;
  380|  1.32k|               i2_mv[1] = 0;
  381|       |
  382|  1.32k|               ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  383|  1.32k|            ih264d_fill_pred_info(i2_mv,4,4,0,i1_pred,
  384|  1.32k|                            ps_pred_pkd,ps_pic_buff0->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  385|  1.32k|                            ps_pic_buff0->u1_pic_type);
  386|  1.32k|            ps_dec->u4_pred_info_pkd_idx++;
  387|  1.32k|            ps_cur_mb_info->u1_num_pred_parts++;
  388|       |
  389|       |
  390|  1.32k|            }
  391|  1.32k|        }
  392|  1.66k|        if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (392:12): [True: 1.32k, False: 341]
  ------------------
  393|  1.32k|        {
  394|  1.32k|            {
  395|  1.32k|                pred_info_pkd_t *ps_pred_pkd;
  396|  1.32k|               WORD16 i2_mv[2];
  397|  1.32k|               WORD8 i1_ref_idx= 0;
  398|       |
  399|  1.32k|               ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  400|  1.32k|            ih264d_fill_pred_info(&(i2_spat_pred_mv[2]),4,4,0,i1_pred,
  401|  1.32k|                            ps_pred_pkd,ps_pic_buff1->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  402|  1.32k|                            ps_pic_buff1->u1_pic_type);
  403|  1.32k|            ps_dec->u4_pred_info_pkd_idx++;
  404|  1.32k|            ps_cur_mb_info->u1_num_pred_parts++;
  405|       |
  406|       |
  407|  1.32k|            }
  408|       |
  409|       |            /******    (0,0) Motion vectors DMA     *****/
  410|       |
  411|  1.32k|            {
  412|  1.32k|                pred_info_pkd_t *ps_pred_pkd;
  413|  1.32k|               WORD16 i2_mv[2];
  414|  1.32k|               WORD8 i1_ref_idx= 0;
  415|       |
  416|  1.32k|               i2_mv[0] = 0;
  417|  1.32k|               i2_mv[1] = 0;
  418|       |
  419|  1.32k|               ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  420|  1.32k|            ih264d_fill_pred_info(i2_mv,4,4,0,i1_pred,
  421|  1.32k|                            ps_pred_pkd,ps_pic_buff1->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  422|  1.32k|                            ps_pic_buff1->u1_pic_type);
  423|  1.32k|            ps_dec->u4_pred_info_pkd_idx++;
  424|  1.32k|            ps_cur_mb_info->u1_num_pred_parts++;
  425|       |
  426|       |
  427|  1.32k|            }
  428|  1.32k|        }
  429|  1.66k|    }
  430|       |
  431|       |    /*u1_col = *(ps_col_pic->pu1_col_zero_flag + s_mvdirect.i4_mv_indices[0]);
  432|       |     u1_col &= 1;
  433|       |     u1_init = 0;*/
  434|       |
  435|  17.5k|    for(i = 0; i < s_mvdirect.i1_num_partitions; i++)
  ------------------
  |  Branch (435:16): [True: 14.8k, False: 2.65k]
  ------------------
  436|  14.8k|    {
  437|  14.8k|        partition_size = s_mvdirect.i1_partitionsize[i];
  438|  14.8k|        u4_sub_mb_num = s_mvdirect.i1_submb_num[i];
  439|       |
  440|  14.8k|        sub_partition = partition_size >> 2;
  441|  14.8k|        partition_size &= 0x3;
  442|  14.8k|        u1_mb_partw = pu1_mb_partw[partition_size];
  443|  14.8k|        u1_mb_parth = pu1_mb_parth[partition_size];
  444|  14.8k|        u2_mask = mask_table[partition_size];
  445|  14.8k|        if(sub_partition != 0)
  ------------------
  |  Branch (445:12): [True: 12.6k, False: 2.19k]
  ------------------
  446|  12.6k|        {
  447|  12.6k|            u1_mb_partw >>= 1;
  448|  12.6k|            u1_mb_parth >>= 1;
  449|  12.6k|            u2_mask = sub_mask_table[partition_size];
  450|  12.6k|        }
  451|       |
  452|  14.8k|        u1_col_zero_flag = *(ps_col_pic->pu1_col_zero_flag
  453|  14.8k|                        + s_mvdirect.i4_mv_indices[i]);
  454|  14.8k|        u1_col_zero_flag = u1_col_zero_flag & 0x01;
  455|       |
  456|       |        /*if(u1_col != u1_col_zero_flag)
  457|       |         u1_init = 1;*/
  458|       |
  459|  14.8k|        if(u1_zero_pred_cond_f || ((i1_ref_frame0 == 0) && (u1_col_zero_flag == 1)))
  ------------------
  |  Branch (459:12): [True: 3.41k, False: 11.4k]
  |  Branch (459:36): [True: 8.97k, False: 2.49k]
  |  Branch (459:60): [True: 3.85k, False: 5.12k]
  ------------------
  460|  7.26k|        {
  461|  7.26k|            pi2_final_mv0 = &i2_def_mv[0];
  462|  7.26k|            ui2_mask_fwd |= (u2_mask << u4_sub_mb_num);
  463|  7.26k|        }
  464|  7.61k|        else
  465|  7.61k|            pi2_final_mv0 = &i2_spat_pred_mv[0];
  466|       |
  467|  14.8k|        if(u1_zero_pred_cond_b || ((i1_ref_frame1 == 0) && (u1_col_zero_flag == 1)))
  ------------------
  |  Branch (467:12): [True: 2.93k, False: 11.9k]
  |  Branch (467:36): [True: 9.38k, False: 2.57k]
  |  Branch (467:60): [True: 3.92k, False: 5.45k]
  ------------------
  468|  6.85k|        {
  469|  6.85k|            pi2_final_mv1 = &i2_def_mv[0];
  470|  6.85k|            ui2_mask_bwd |= (u2_mask << u4_sub_mb_num);
  471|  6.85k|        }
  472|  8.02k|        else
  473|  8.02k|            pi2_final_mv1 = &i2_spat_pred_mv[2];
  474|       |
  475|  14.8k|        if(ps_cur_mb_info->u1_Mux != 1)
  ------------------
  |  Branch (475:12): [True: 1.97k, False: 12.9k]
  ------------------
  476|  1.97k|        {
  477|       |            /*u1_sub_mb_x = u4_sub_mb_num & 0x03;
  478|       |             uc_sub_mb_y = (u4_sub_mb_num >> 2);*/
  479|  1.97k|            if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (479:16): [True: 1.25k, False: 725]
  ------------------
  480|  1.25k|            {
  481|       |
  482|  1.25k|                {
  483|  1.25k|                    pred_info_pkd_t *ps_pred_pkd;
  484|  1.25k|                   WORD8 i1_ref_idx= 0;
  485|       |
  486|  1.25k|                   ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  487|  1.25k|                ih264d_fill_pred_info(pi2_final_mv0,u1_mb_partw,u1_mb_parth,u4_sub_mb_num,i1_pred,
  488|  1.25k|                                ps_pred_pkd,ps_pic_buff0->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  489|  1.25k|                                ps_pic_buff0->u1_pic_type);
  490|  1.25k|                ps_dec->u4_pred_info_pkd_idx++;
  491|  1.25k|                ps_cur_mb_info->u1_num_pred_parts++;
  492|       |
  493|       |
  494|  1.25k|                }
  495|       |
  496|  1.25k|            }
  497|       |
  498|  1.97k|            if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (498:16): [True: 1.73k, False: 242]
  ------------------
  499|  1.73k|            {
  500|  1.73k|                {
  501|  1.73k|                    pred_info_pkd_t *ps_pred_pkd;
  502|  1.73k|                   WORD8 i1_ref_idx= 0;
  503|       |
  504|  1.73k|                   ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  505|  1.73k|                ih264d_fill_pred_info(pi2_final_mv1,u1_mb_partw,u1_mb_parth,u4_sub_mb_num,i1_pred,
  506|  1.73k|                                ps_pred_pkd,ps_pic_buff1->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  507|  1.73k|                                ps_pic_buff1->u1_pic_type);
  508|  1.73k|                ps_dec->u4_pred_info_pkd_idx++;
  509|  1.73k|                ps_cur_mb_info->u1_num_pred_parts++;
  510|       |
  511|       |
  512|  1.73k|                }
  513|  1.73k|            }
  514|  1.97k|        }
  515|       |
  516|       |        /* Replication optimisation */
  517|  14.8k|        s_temp_mv_pred.i2_mv[0] = pi2_final_mv0[0];
  518|  14.8k|        s_temp_mv_pred.i2_mv[1] = pi2_final_mv0[1];
  519|  14.8k|        s_temp_mv_pred.i2_mv[2] = pi2_final_mv1[0];
  520|  14.8k|        s_temp_mv_pred.i2_mv[3] = pi2_final_mv1[1];
  521|       |
  522|       |        /* Calculating colocated zero information */
  523|  14.8k|        {
  524|  14.8k|            WORD16 i2_mv_x = 0, i2_mv_y = 0;
  525|       |            /*************************************/
  526|       |            /* If(bit2 and bit3 set)             */
  527|       |            /* then                              */
  528|       |            /*  (bit0 and bit1) => submmbmode    */
  529|       |            /*  (bit2 and bit3) => mbmode        */
  530|       |            /* else                              */
  531|       |            /*  (bit0 and bit1) => mbmode        */
  532|       |            /*************************************/
  533|  14.8k|            UWORD8 u1_packed_mb_sub_mb_mode =
  534|  14.8k|                            sub_partition ? (s_mvdirect.i1_partitionsize[i]) : ((s_mvdirect.i1_partitionsize[i])
  ------------------
  |  Branch (534:29): [True: 12.6k, False: 2.19k]
  ------------------
  535|  2.19k|                                                            << 2);
  536|       |
  537|  14.8k|            if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (537:16): [True: 11.4k, False: 3.41k]
  ------------------
  538|  11.4k|            {
  539|  11.4k|                i2_mv_x = pi2_final_mv0[0];
  540|  11.4k|                i2_mv_y = pi2_final_mv0[1];
  541|  11.4k|            }
  542|  3.41k|            else
  543|  3.41k|            {
  544|  3.41k|                i2_mv_x = pi2_final_mv1[0];
  545|  3.41k|                i2_mv_y = pi2_final_mv1[1];
  546|  3.41k|            }
  547|       |
  548|  14.8k|            u1_colz = (ps_cur_mb_info->u1_mb_field_decodingflag << 1)
  549|  14.8k|                            | ((u1_final_ref_idx == 0) && (ABS(i2_mv_x) <= 1)
  ------------------
  |  |  100|  12.3k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 472, False: 11.8k]
  |  |  ------------------
  ------------------
  |  Branch (549:32): [True: 12.3k, False: 2.57k]
  |  Branch (549:59): [True: 11.9k, False: 346]
  ------------------
  550|  11.9k|                                            && (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|  11.9k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 232, False: 11.7k]
  |  |  ------------------
  ------------------
  |  Branch (550:48): [True: 11.7k, False: 175]
  ------------------
  551|  14.8k|            u1_colz |= (u1_packed_mb_sub_mb_mode << 4);
  552|  14.8k|        }
  553|  14.8k|        ps_mv = ps_mv_nmb_start + u4_sub_mb_num;
  554|  14.8k|        ih264d_rep_mv_colz(ps_dec, &s_temp_mv_pred, ps_mv, u4_sub_mb_num, u1_colz,
  555|  14.8k|                           u1_mb_parth, u1_mb_partw);
  556|  14.8k|    }
  557|  2.65k|    i = 0;
  558|  2.65k|    if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (558:8): [True: 1.95k, False: 698]
  ------------------
  559|  1.95k|        ps_cur_mb_info->u2_mask[i++] = ui2_mask_fwd;
  560|  2.65k|    if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (560:8): [True: 2.19k, False: 463]
  ------------------
  561|  2.19k|        ps_cur_mb_info->u2_mask[i] = ui2_mask_bwd;
  562|       |
  563|       |    /*if(u1_init)
  564|       |     H264_DEC_DEBUG_PRINT("hit\n");
  565|       |     else
  566|       |     H264_DEC_DEBUG_PRINT("miss\n");*/
  567|       |
  568|  2.65k|    return OK;
  ------------------
  |  |  114|  2.65k|#define OK        0
  ------------------
  569|   526k|}
ih264d_decode_temporal_direct:
  587|   289k|{
  588|   289k|    struct pic_buffer_t *ps_pic_buff0, *ps_pic_buff1, *ps_col_pic;
  589|   289k|    mv_pred_t *ps_mv, s_temp_mv_pred;
  590|   289k|    UWORD32 u4_sub_mb_num;
  591|   289k|    UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  592|   289k|    WORD16 i2_mv_x0, i2_mv_y0, i2_mv_x1, i2_mv_y1;
  593|   289k|    UWORD8 u1_mb_partw, u1_mb_parth;
  594|   289k|    UWORD8 i, partition_size, sub_partition;
  595|   289k|    UWORD32 *pui32_weight_ofsts = NULL;
  596|   289k|    directmv_t s_mvdirect;
  597|   289k|    const UWORD8 *pu1_mb_parth = (const UWORD8 *)gau1_ih264d_mb_parth;
  598|   289k|    const UWORD8 *pu1_mb_partw = (const UWORD8 *)gau1_ih264d_mb_partw;
  599|   289k|    WORD8 c_refFrm0, c_refFrm1;
  600|   289k|    UWORD8 u1_ref_idx0, u1_is_cur_mb_fld;
  601|   289k|    WORD32 pic0_poc, pic1_poc, cur_poc;
  602|   289k|    WORD32 ret = 0;
  603|       |
  604|   289k|    u1_is_cur_mb_fld = ps_cur_mb_info->u1_mb_field_decodingflag;
  605|   289k|    ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][0];
  606|       |
  607|       |    /**********************************************************************/
  608|       |    /* Call the function which gets the number of partitions and          */
  609|       |    /* partition info of colocated Mb                                     */
  610|       |    /**********************************************************************/
  611|   289k|    ps_dec->pf_parse_mvdirect(ps_dec, ps_dec->ps_col_pic, &s_mvdirect, u1_wd_x,
  612|   289k|                           ps_dec->i4_submb_ofst, ps_cur_mb_info);
  613|   289k|    ps_col_pic = ps_dec->ps_col_pic;
  614|       |
  615|   597k|    for(i = 0; i < s_mvdirect.i1_num_partitions; i++)
  ------------------
  |  Branch (615:16): [True: 307k, False: 289k]
  ------------------
  616|   307k|    {
  617|   307k|        UWORD8 u1_colz;
  618|   307k|        partition_size = s_mvdirect.i1_partitionsize[i];
  619|   307k|        u4_sub_mb_num = s_mvdirect.i1_submb_num[i];
  620|   307k|        ps_mv = ps_col_pic->ps_mv + s_mvdirect.i4_mv_indices[i];
  621|       |
  622|       |        /* This should be removed to catch unitialized memory read */
  623|   307k|        u1_ref_idx0 = 0;
  624|       |
  625|   307k|        sub_partition = partition_size >> 2;
  626|   307k|        partition_size &= 0x3;
  627|   307k|        u1_mb_partw = pu1_mb_partw[partition_size];
  628|   307k|        u1_mb_parth = pu1_mb_parth[partition_size];
  629|   307k|        if(sub_partition != 0)
  ------------------
  |  Branch (629:12): [True: 17.1k, False: 290k]
  ------------------
  630|  17.1k|        {
  631|  17.1k|            u1_mb_partw >>= 1;
  632|  17.1k|            u1_mb_parth >>= 1;
  633|  17.1k|        }
  634|   307k|        c_refFrm0 = ps_mv->i1_ref_frame[0];
  635|   307k|        c_refFrm1 = ps_mv->i1_ref_frame[1];
  636|       |
  637|   307k|        if((c_refFrm0 == -1) && (c_refFrm1 == -1))
  ------------------
  |  Branch (637:12): [True: 2.83k, False: 304k]
  |  Branch (637:33): [True: 498, False: 2.33k]
  ------------------
  638|    498|        {
  639|    498|            u1_ref_idx0 = 0;
  640|    498|            ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][0];
  641|    498|            if(u1_mbaff && u1_is_cur_mb_fld)
  ------------------
  |  Branch (641:16): [True: 0, False: 498]
  |  Branch (641:28): [True: 0, False: 0]
  ------------------
  642|      0|            {
  643|      0|                if(ps_cur_mb_info->u1_topmb)
  ------------------
  |  Branch (643:20): [True: 0, False: 0]
  ------------------
  644|      0|                {
  645|      0|                    pic0_poc = ps_pic_buff0->i4_top_field_order_cnt;
  646|      0|                    pic1_poc = ps_pic_buff1->i4_top_field_order_cnt;
  647|      0|                    cur_poc = ps_dec->ps_cur_pic->i4_top_field_order_cnt;
  648|      0|                }
  649|      0|                else
  650|      0|                {
  651|      0|                    pic1_poc = ps_pic_buff1->i4_bottom_field_order_cnt;
  652|      0|                    cur_poc = ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
  653|      0|                    ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][MAX_REF_BUFS];
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  654|      0|                    pic0_poc = ps_pic_buff0->i4_bottom_field_order_cnt;
  655|      0|                    ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][MAX_REF_BUFS];
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  656|      0|                }
  657|      0|            }
  658|    498|            else
  659|    498|            {
  660|    498|                pic0_poc = ps_pic_buff0->i4_avg_poc;
  661|    498|                pic1_poc = ps_pic_buff1->i4_avg_poc;
  662|    498|                cur_poc = ps_dec->ps_cur_pic->i4_poc;
  663|    498|            }
  664|    498|        }
  665|   307k|        else
  666|   307k|        {
  667|   307k|            UWORD8 uc_i, u1_num_frw_ref_pics;
  668|   307k|            UWORD8 buf_id, u1_pic_type;
  669|   307k|            buf_id = ps_mv->u1_col_ref_pic_idx;
  670|   307k|            u1_pic_type = ps_mv->u1_pic_type;
  671|   307k|            if(ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (671:16): [True: 0, False: 307k]
  ------------------
  672|      0|            {
  673|      0|                if(s_mvdirect.u1_vert_mv_scale == FRM_TO_FLD)
  ------------------
  |  |   48|      0|#define FRM_TO_FLD    1
  ------------------
  |  Branch (673:20): [True: 0, False: 0]
  ------------------
  674|      0|                {
  675|      0|                    u1_pic_type = TOP_FLD;
  ------------------
  |  |  353|      0|#define TOP_FLD         0x01
  ------------------
  676|      0|                    if(ps_dec->ps_cur_slice->u1_bottom_field_flag)
  ------------------
  |  Branch (676:24): [True: 0, False: 0]
  ------------------
  677|      0|                        u1_pic_type = BOT_FLD;
  ------------------
  |  |  354|      0|#define BOT_FLD         0x02
  ------------------
  678|      0|                }
  679|      0|            }
  680|   307k|            u1_num_frw_ref_pics =
  681|   307k|                            ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0];
  682|       |
  683|   460k|            for(uc_i = 0; uc_i < u1_num_frw_ref_pics; uc_i++)
  ------------------
  |  Branch (683:27): [True: 428k, False: 31.8k]
  ------------------
  684|   428k|            {
  685|   428k|                if(ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (685:20): [True: 0, False: 428k]
  ------------------
  686|      0|                {
  687|      0|                    if(ps_dec->ps_ref_pic_buf_lx[0][uc_i]->u1_mv_buf_id == buf_id)
  ------------------
  |  Branch (687:24): [True: 0, False: 0]
  ------------------
  688|      0|                    {
  689|      0|                        if(ps_dec->ps_ref_pic_buf_lx[0][uc_i]->u1_pic_type
  ------------------
  |  Branch (689:28): [True: 0, False: 0]
  ------------------
  690|      0|                                        == u1_pic_type)
  691|      0|                        {
  692|      0|                            u1_ref_idx0 = uc_i;
  693|      0|                            break;
  694|      0|                        }
  695|      0|                    }
  696|      0|                }
  697|   428k|                else
  698|   428k|                {
  699|   428k|                    if(ps_dec->ps_ref_pic_buf_lx[0][uc_i]->u1_mv_buf_id == buf_id)
  ------------------
  |  Branch (699:24): [True: 275k, False: 153k]
  ------------------
  700|   275k|                    {
  701|   275k|                        u1_ref_idx0 = uc_i;
  702|   275k|                        break;
  703|   275k|                    }
  704|   428k|                }
  705|   428k|            }
  706|       |
  707|   307k|            ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][u1_ref_idx0];
  708|   307k|            ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][0];
  709|       |
  710|   307k|            if(u1_mbaff && u1_is_cur_mb_fld)
  ------------------
  |  Branch (710:16): [True: 0, False: 307k]
  |  Branch (710:28): [True: 0, False: 0]
  ------------------
  711|      0|            {
  712|      0|                pic0_poc = ps_pic_buff0->i4_top_field_order_cnt;
  713|      0|                u1_ref_idx0 <<= 1;
  714|      0|                if(s_mvdirect.u1_vert_mv_scale == ONE_TO_ONE)
  ------------------
  |  |   47|      0|#define ONE_TO_ONE    0
  ------------------
  |  Branch (714:20): [True: 0, False: 0]
  ------------------
  715|      0|                {
  716|      0|                    if(u1_pic_type == BOT_FLD)
  ------------------
  |  |  354|      0|#define BOT_FLD         0x02
  ------------------
  |  Branch (716:24): [True: 0, False: 0]
  ------------------
  717|      0|                    {
  718|      0|                        pic0_poc = ps_pic_buff0->i4_bottom_field_order_cnt;
  719|      0|                        ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][(u1_ref_idx0
  720|      0|                                        >> 1) + MAX_REF_BUFS];
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  721|      0|                        if(ps_cur_mb_info->u1_topmb)
  ------------------
  |  Branch (721:28): [True: 0, False: 0]
  ------------------
  722|      0|                            u1_ref_idx0++;
  723|      0|                    }
  724|      0|                    else
  725|      0|                    {
  726|      0|                        if(1 - ps_cur_mb_info->u1_topmb)
  ------------------
  |  Branch (726:28): [True: 0, False: 0]
  ------------------
  727|      0|                            u1_ref_idx0++;
  728|      0|                    }
  729|      0|                }
  730|      0|                if(s_mvdirect.u1_vert_mv_scale == FRM_TO_FLD)
  ------------------
  |  |   48|      0|#define FRM_TO_FLD    1
  ------------------
  |  Branch (730:20): [True: 0, False: 0]
  ------------------
  731|      0|                {
  732|      0|                    if(1 - ps_cur_mb_info->u1_topmb)
  ------------------
  |  Branch (732:24): [True: 0, False: 0]
  ------------------
  733|      0|                    {
  734|      0|                        pic0_poc = ps_pic_buff0->i4_bottom_field_order_cnt;
  735|      0|                        ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][(u1_ref_idx0
  736|      0|                                        >> 1) + MAX_REF_BUFS];
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  737|      0|                    }
  738|      0|                }
  739|      0|                if(ps_cur_mb_info->u1_topmb)
  ------------------
  |  Branch (739:20): [True: 0, False: 0]
  ------------------
  740|      0|                {
  741|      0|                    pic1_poc = ps_pic_buff1->i4_top_field_order_cnt;
  742|      0|                    cur_poc = ps_dec->ps_cur_pic->i4_top_field_order_cnt;
  743|      0|                }
  744|      0|                else
  745|      0|                {
  746|      0|                    pic1_poc = ps_pic_buff1->i4_bottom_field_order_cnt;
  747|      0|                    cur_poc = ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
  748|      0|                    ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][MAX_REF_BUFS];
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  749|      0|                }
  750|      0|            }
  751|   307k|            else
  752|   307k|            {
  753|   307k|                pic0_poc = ps_pic_buff0->i4_avg_poc;
  754|   307k|                pic1_poc = ps_pic_buff1->i4_avg_poc;
  755|   307k|                cur_poc = ps_dec->ps_cur_pic->i4_poc;
  756|   307k|            }
  757|   307k|        }
  758|   307k|        {
  759|   307k|            WORD16 i16_td;
  760|   307k|            WORD64 diff;
  761|   307k|            if(c_refFrm0 >= 0)
  ------------------
  |  Branch (761:16): [True: 304k, False: 2.83k]
  ------------------
  762|   304k|            {
  763|   304k|                i2_mv_x0 = ps_mv->i2_mv[0];
  764|   304k|                i2_mv_y0 = ps_mv->i2_mv[1];
  765|   304k|            }
  766|  2.83k|            else if(c_refFrm1 >= 0)
  ------------------
  |  Branch (766:21): [True: 2.33k, False: 498]
  ------------------
  767|  2.33k|            {
  768|  2.33k|                i2_mv_x0 = ps_mv->i2_mv[2];
  769|  2.33k|                i2_mv_y0 = ps_mv->i2_mv[3];
  770|  2.33k|            }
  771|    498|            else
  772|    498|            {
  773|    498|                i2_mv_x0 = 0;
  774|    498|                i2_mv_y0 = 0;
  775|    498|            }
  776|       |            /* If FRM_TO_FLD or FLD_TO_FRM scale the "y" component of the colocated Mv*/
  777|   307k|            if(s_mvdirect.u1_vert_mv_scale == FRM_TO_FLD)
  ------------------
  |  |   48|   307k|#define FRM_TO_FLD    1
  ------------------
  |  Branch (777:16): [True: 0, False: 307k]
  ------------------
  778|      0|            {
  779|      0|                i2_mv_y0 /= 2;
  780|      0|            }
  781|   307k|            else if(s_mvdirect.u1_vert_mv_scale == FLD_TO_FRM)
  ------------------
  |  |   49|   307k|#define FLD_TO_FRM    2
  ------------------
  |  Branch (781:21): [True: 0, False: 307k]
  ------------------
  782|      0|            {
  783|      0|                i2_mv_y0 *= 2;
  784|      0|            }
  785|       |
  786|   307k|            diff = (WORD64)pic1_poc - pic0_poc;
  787|   307k|            i16_td = CLIP_S8(diff);
  ------------------
  |  |   59|   307k|#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   307k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.91k, False: 303k]
  |  |  |  |  |  Branch (77:54): [True: 15.0k, False: 288k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  788|   307k|            if((ps_pic_buff0->u1_is_short == 0) || (i16_td == 0))
  ------------------
  |  Branch (788:16): [True: 73.6k, False: 233k]
  |  Branch (788:52): [True: 188k, False: 45.3k]
  ------------------
  789|   262k|            {
  790|   262k|                i2_mv_x1 = 0;
  791|   262k|                i2_mv_y1 = 0;
  792|   262k|            }
  793|  45.3k|            else
  794|  45.3k|            {
  795|  45.3k|                WORD16 i2_tb, i2_tx, i2_dist_scale_factor, i2_temp;
  796|       |
  797|  45.3k|                diff = (WORD64)cur_poc - pic0_poc;
  798|  45.3k|                i2_tb = CLIP_S8(diff);
  ------------------
  |  |   59|  45.3k|#define CLIP_S8(x) CLIP3(INT8_MIN, INT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  45.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 12.1k, False: 33.2k]
  |  |  |  |  |  Branch (77:54): [True: 11.9k, False: 21.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  799|       |
  800|  45.3k|                i2_tx = (16384 + ABS(SIGN_POW2_DIV(i16_td, 1))) / i16_td;
  ------------------
  |  |  100|  90.6k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 7.57k, False: 37.7k]
  |  |  |  Branch (100:27): [True: 7.95k, False: 37.3k]
  |  |  |  Branch (100:39): [True: 7.57k, False: 0]
  |  |  |  Branch (100:46): [True: 385, False: 37.3k]
  |  |  ------------------
  ------------------
  801|  45.3k|                i2_dist_scale_factor = CLIP_S11(
  ------------------
  |  |   65|  45.3k|#define CLIP_S11(x) CLIP3(-1024, 1023, (x))
  |  |  ------------------
  |  |  |  |   77|  45.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.68k, False: 39.6k]
  |  |  |  |  |  Branch (77:54): [True: 430, False: 39.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  802|  45.3k|                                            (((i2_tb * i2_tx) + 32) >> 6));
  803|  45.3k|                i2_temp = (i2_mv_x0 * i2_dist_scale_factor + 128) >> 8;
  804|  45.3k|                i2_mv_x1 = i2_temp - i2_mv_x0;
  805|  45.3k|                i2_mv_x0 = i2_temp;
  806|       |
  807|  45.3k|                i2_temp = (i2_mv_y0 * i2_dist_scale_factor + 128) >> 8;
  808|  45.3k|                i2_mv_y1 = i2_temp - i2_mv_y0;
  809|  45.3k|                i2_mv_y0 = i2_temp;
  810|  45.3k|            }
  811|   307k|            {
  812|   307k|                mv_pred_t *ps_mv;
  813|       |
  814|       |                /*u1_sub_mb_x = u4_sub_mb_num & 0x03;
  815|       |                 uc_sub_mb_y = u4_sub_mb_num >> 2;*/
  816|   307k|                if(ps_dec->ps_cur_pps->u1_wted_bipred_idc)
  ------------------
  |  Branch (816:20): [True: 140k, False: 167k]
  ------------------
  817|   140k|                {
  818|   140k|                    UWORD8 u1_idx =
  819|   140k|                                    u1_ref_idx0
  820|   140k|                                                    * ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1];
  821|   140k|                    UWORD8 u1_scale_ref = u1_mbaff && u1_is_cur_mb_fld;
  ------------------
  |  Branch (821:43): [True: 0, False: 140k]
  |  Branch (821:55): [True: 0, False: 0]
  ------------------
  822|   140k|                    if(u1_scale_ref)
  ------------------
  |  Branch (822:24): [True: 0, False: 140k]
  ------------------
  823|      0|                        u1_idx >>= 1;
  824|   140k|                    pui32_weight_ofsts = (UWORD32*)&ps_dec->pu4_wt_ofsts[2
  825|   140k|                                    * X3(u1_idx)];
  ------------------
  |  |   92|   140k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  826|   140k|                    if(u1_scale_ref
  ------------------
  |  Branch (826:24): [True: 0, False: 140k]
  ------------------
  827|      0|                                    && (ps_dec->ps_cur_pps->u1_wted_bipred_idc
  ------------------
  |  Branch (827:40): [True: 0, False: 0]
  ------------------
  828|      0|                                                    == 2))
  829|      0|                    {
  830|      0|                        WORD16 i2_ref_idx;
  831|      0|                        i2_ref_idx = u1_ref_idx0;
  832|      0|                        i2_ref_idx *=
  833|      0|                                        (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1]
  834|      0|                                                        << 1);
  835|      0|                        if(!ps_cur_mb_info->u1_topmb)
  ------------------
  |  Branch (835:28): [True: 0, False: 0]
  ------------------
  836|      0|                            i2_ref_idx +=
  837|      0|                                            (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0]
  838|      0|                                                            << 1)
  839|      0|                                                            * (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1]
  840|      0|                                                                            << 1);
  841|      0|                        pui32_weight_ofsts =
  842|      0|                                        (UWORD32*)&ps_dec->pu4_mbaff_wt_mat[2
  843|      0|                                                        * X3(i2_ref_idx)];
  ------------------
  |  |   92|      0|#define X3(a)   (((a) << 1) + (a))
  ------------------
  844|      0|                    }
  845|   140k|                }
  846|   307k|                {
  847|   307k|                    pred_info_pkd_t *ps_pred_pkd;
  848|   307k|                   WORD16 i2_mv[2];
  849|   307k|                   WORD8 i1_ref_idx= 0;
  850|       |
  851|   307k|                   i2_mv[0] = i2_mv_x0;
  852|   307k|                   i2_mv[1] = i2_mv_y0;
  853|       |
  854|   307k|                   ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  855|   307k|                ih264d_fill_pred_info(i2_mv,u1_mb_partw,u1_mb_parth,u4_sub_mb_num,PRED_L0 | PRED_L1,
  ------------------
  |  |  483|   307k|#define PRED_L0   1
  ------------------
                              ih264d_fill_pred_info(i2_mv,u1_mb_partw,u1_mb_parth,u4_sub_mb_num,PRED_L0 | PRED_L1,
  ------------------
  |  |  484|   307k|#define PRED_L1   2
  ------------------
  856|   307k|                                ps_pred_pkd,ps_pic_buff0->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  857|   307k|                                ps_pic_buff0->u1_pic_type);
  858|   307k|                ps_dec->u4_pred_info_pkd_idx++;
  859|   307k|                ps_cur_mb_info->u1_num_pred_parts++;
  860|       |
  861|       |
  862|   307k|                }
  863|   307k|                {
  864|   307k|                   pred_info_pkd_t *ps_pred_pkd;
  865|   307k|                   WORD16 i2_mv[2];
  866|   307k|                   WORD8 i1_ref_idx= 0;
  867|       |
  868|   307k|                   i2_mv[0] = i2_mv_x1;
  869|   307k|                   i2_mv[1] = i2_mv_y1;
  870|       |
  871|   307k|                   ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  872|   307k|                ih264d_fill_pred_info(i2_mv,u1_mb_partw,u1_mb_parth,u4_sub_mb_num,PRED_L0 | PRED_L1,
  ------------------
  |  |  483|   307k|#define PRED_L0   1
  ------------------
                              ih264d_fill_pred_info(i2_mv,u1_mb_partw,u1_mb_parth,u4_sub_mb_num,PRED_L0 | PRED_L1,
  ------------------
  |  |  484|   307k|#define PRED_L1   2
  ------------------
  873|   307k|                                ps_pred_pkd,ps_pic_buff1->u1_pic_buf_id,i1_ref_idx,pui32_weight_ofsts,
  874|   307k|                                ps_pic_buff1->u1_pic_type);
  875|   307k|                ps_dec->u4_pred_info_pkd_idx++;
  876|   307k|                ps_cur_mb_info->u1_num_pred_parts++;
  877|       |
  878|       |
  879|   307k|                }
  880|       |
  881|       |                /* Replication optimisation */
  882|   307k|                s_temp_mv_pred.i2_mv[0] = i2_mv_x0;
  883|   307k|                s_temp_mv_pred.i2_mv[1] = i2_mv_y0;
  884|   307k|                s_temp_mv_pred.i2_mv[2] = i2_mv_x1;
  885|   307k|                s_temp_mv_pred.i2_mv[3] = i2_mv_y1;
  886|   307k|                s_temp_mv_pred.i1_ref_frame[0] = u1_ref_idx0;
  887|   307k|                s_temp_mv_pred.i1_ref_frame[1] = 0;
  888|   307k|                s_temp_mv_pred.u1_col_ref_pic_idx = ps_pic_buff0->u1_mv_buf_id;
  889|   307k|                s_temp_mv_pred.u1_pic_type = ps_pic_buff0->u1_pic_type;
  890|   307k|                ps_mv = ps_dec->ps_mv_cur + (u4_mb_num << 4) + u4_sub_mb_num;
  891|       |
  892|   307k|                {
  893|   307k|                    WORD16 i2_mv_x = 0, i2_mv_y = 0;
  894|   307k|                    UWORD8 u1_packed_mb_sub_mb_mode =
  895|   307k|                                    sub_partition ? (s_mvdirect.i1_partitionsize[i]) : ((s_mvdirect.i1_partitionsize[i])
  ------------------
  |  Branch (895:37): [True: 17.1k, False: 290k]
  ------------------
  896|   290k|                                                                    << 2);
  897|       |
  898|   307k|                    if(c_refFrm0 >= 0)
  ------------------
  |  Branch (898:24): [True: 304k, False: 2.83k]
  ------------------
  899|   304k|                    {
  900|   304k|                        i2_mv_x = i2_mv_x0;
  901|   304k|                        i2_mv_y = i2_mv_y0;
  902|   304k|                    }
  903|  2.83k|                    else
  904|  2.83k|                    {
  905|  2.83k|                        i2_mv_x = i2_mv_x1;
  906|  2.83k|                        i2_mv_y = i2_mv_y1;
  907|  2.83k|                    }
  908|       |
  909|   307k|                    u1_colz =
  910|   307k|                                    (ps_cur_mb_info->u1_mb_field_decodingflag << 1)
  911|   307k|                                                    | ((u1_ref_idx0 == 0)
  ------------------
  |  Branch (911:56): [True: 249k, False: 58.0k]
  ------------------
  912|   249k|                                                                    && (ABS(i2_mv_x)
  ------------------
  |  |  100|   249k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 7.47k, False: 242k]
  |  |  ------------------
  ------------------
  |  Branch (912:72): [True: 233k, False: 16.1k]
  ------------------
  913|   249k|                                                                                    <= 1)
  914|   233k|                                                                    && (ABS(i2_mv_y)
  ------------------
  |  |  100|   233k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 5.98k, False: 227k]
  |  |  ------------------
  ------------------
  |  Branch (914:72): [True: 224k, False: 9.35k]
  ------------------
  915|   233k|                                                                                    <= 1));
  916|   307k|                    u1_colz |= (u1_packed_mb_sub_mb_mode << 4);
  917|   307k|                }
  918|   307k|                ih264d_rep_mv_colz(ps_dec, &s_temp_mv_pred, ps_mv, u4_sub_mb_num,
  919|   307k|                                   u1_colz, u1_mb_parth, u1_mb_partw);
  920|   307k|            }
  921|   307k|        }
  922|   307k|    }
  923|       |    /* return value set to UWORD8 to make it homogeneous  */
  924|       |    /* with decodespatialdirect                           */
  925|   289k|    return OK;
  ------------------
  |  |  114|   289k|#define OK        0
  ------------------
  926|   289k|}
ih264d_init_ref_idx_lx_b:
 1227|  42.3k|{
 1228|  42.3k|    struct pic_buffer_t *ps_ref_pic_buf_lx;
 1229|  42.3k|    dpb_manager_t *ps_dpb_mgr;
 1230|  42.3k|    struct dpb_info_t *ps_next_dpb;
 1231|  42.3k|    WORD32 i_cur_poc, i_max_st_poc, i_min_st_poc, i_ref_poc, i_temp_poc;
 1232|  42.3k|    WORD8 i, j;
 1233|  42.3k|    UWORD8 u1_max_lt_index, u1_min_lt_index;
 1234|  42.3k|    UWORD32 u4_lt_index;
 1235|  42.3k|    WORD32 i_cur_idx;
 1236|  42.3k|    UWORD8 u1_field_pic_flag;
 1237|  42.3k|    dec_slice_params_t *ps_cur_slice;
 1238|  42.3k|    UWORD8 u1_L0, u1_L1;
 1239|  42.3k|    UWORD8 u1_num_short_term_bufs;
 1240|  42.3k|    UWORD8 u1_max_ref_idx_l0, u1_max_ref_idx_l1;
 1241|  42.3k|    struct pic_buffer_t *aps_st_pic_bufs[2 * MAX_REF_BUFS] = {NULL};
 1242|  42.3k|    ps_cur_slice = ps_dec->ps_cur_slice;
 1243|  42.3k|    u1_field_pic_flag = ps_cur_slice->u1_field_pic_flag;
 1244|  42.3k|    u1_max_ref_idx_l0 = ps_cur_slice->u1_num_ref_idx_lx_active[0]
 1245|  42.3k|                    << u1_field_pic_flag;
 1246|  42.3k|    u1_max_ref_idx_l1 = ps_cur_slice->u1_num_ref_idx_lx_active[1]
 1247|  42.3k|                    << u1_field_pic_flag;
 1248|       |
 1249|  42.3k|    ps_dpb_mgr = ps_dec->ps_dpb_mgr;
 1250|       |    /* Get the current POC */
 1251|  42.3k|    i_cur_poc = ps_dec->ps_cur_pic->i4_poc;
 1252|       |
 1253|       |    /* Get MaxStPOC,MinStPOC,MaxLt,MinLt */
 1254|  42.3k|    i_max_st_poc = i_cur_poc;
 1255|  42.3k|    i_min_st_poc = i_cur_poc;
 1256|  42.3k|    u1_max_lt_index = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  42.3k|#define MAX_REF_BUFS    32
  ------------------
 1257|  42.3k|    u1_min_lt_index = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  42.3k|#define MAX_REF_BUFS    32
  ------------------
 1258|       |    /* Start from ST head */
 1259|  42.3k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_st_head;
 1260|  78.5k|    for(i = 0; i < ps_dpb_mgr->u1_num_st_ref_bufs; i++)
  ------------------
  |  Branch (1260:16): [True: 36.2k, False: 42.3k]
  ------------------
 1261|  36.2k|    {
 1262|  36.2k|        i_ref_poc = ps_next_dpb->ps_pic_buf->i4_poc;
 1263|  36.2k|        if(i_ref_poc < i_cur_poc)
  ------------------
  |  Branch (1263:12): [True: 12.7k, False: 23.5k]
  ------------------
 1264|  12.7k|        {
 1265|       |            /* RefPic Buf POC is before Current POC in display order */
 1266|  12.7k|            i_min_st_poc = MIN(i_min_st_poc, i_ref_poc);
  ------------------
  |  |   61|  12.7k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 1.91k, False: 10.7k]
  |  |  ------------------
  ------------------
 1267|  12.7k|        }
 1268|  23.5k|        else
 1269|  23.5k|        {
 1270|       |            /* RefPic Buf POC is after Current POC in display order */
 1271|  23.5k|            i_max_st_poc = MAX(i_max_st_poc, i_ref_poc);
  ------------------
  |  |   60|  23.5k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 2.03k, False: 21.5k]
  |  |  ------------------
  ------------------
 1272|  23.5k|        }
 1273|       |
 1274|       |        /* Chase the next link */
 1275|  36.2k|        ps_next_dpb = ps_next_dpb->ps_prev_short;
 1276|  36.2k|    }
 1277|       |
 1278|       |    /* Sort ST ref pocs in ascending order */
 1279|  42.3k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_st_head;
 1280|  78.5k|    for (j = 0; j < ps_dpb_mgr->u1_num_st_ref_bufs; j++)
  ------------------
  |  Branch (1280:17): [True: 36.2k, False: 42.3k]
  ------------------
 1281|  36.2k|    {
 1282|  36.2k|        aps_st_pic_bufs[j] = ps_next_dpb->ps_pic_buf;
 1283|  36.2k|        ps_next_dpb = ps_next_dpb->ps_prev_short;
 1284|  36.2k|    }
 1285|  42.3k|    qsort(aps_st_pic_bufs, ps_dpb_mgr->u1_num_st_ref_bufs,
 1286|  42.3k|        sizeof(aps_st_pic_bufs[0]), poc_compare);
 1287|       |
 1288|       |    /* Start from LT head */
 1289|  42.3k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
 1290|  42.3k|    if(ps_next_dpb)
  ------------------
  |  Branch (1290:8): [True: 4.66k, False: 37.6k]
  ------------------
 1291|  4.66k|    {
 1292|  4.66k|        u1_max_lt_index = ps_next_dpb->u1_lt_idx;
 1293|  4.66k|        u1_min_lt_index = ps_next_dpb->u1_lt_idx;
 1294|  4.66k|    }
 1295|  48.0k|    for(i = 0; i < ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
  ------------------
  |  Branch (1295:16): [True: 5.72k, False: 42.3k]
  ------------------
 1296|  5.72k|    {
 1297|  5.72k|        u4_lt_index = ps_next_dpb->u1_lt_idx;
 1298|  5.72k|        u1_max_lt_index = (UWORD8)(MAX(u1_max_lt_index, u4_lt_index));
  ------------------
  |  |   60|  5.72k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 5.72k]
  |  |  ------------------
  ------------------
 1299|  5.72k|        u1_min_lt_index = (UWORD8)(MIN(u1_min_lt_index, u4_lt_index));
  ------------------
  |  |   61|  5.72k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 1.06k, False: 4.66k]
  |  |  ------------------
  ------------------
 1300|       |
 1301|       |        /* Chase the next link */
 1302|  5.72k|        ps_next_dpb = ps_next_dpb->ps_prev_long;
 1303|  5.72k|    }
 1304|       |
 1305|       |    /* 1. Initialize refIdxL0 */
 1306|  42.3k|    u1_L0 = 0;
 1307|  42.3k|    i_temp_poc = i_cur_poc;
 1308|  42.3k|    if(u1_field_pic_flag)
  ------------------
  |  Branch (1308:8): [True: 0, False: 42.3k]
  ------------------
 1309|      0|    {
 1310|      0|        ps_ref_pic_buf_lx = ps_dpb_mgr->ps_init_dpb[0][0];
 1311|      0|        ps_ref_pic_buf_lx += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1312|      0|    }
 1313|  42.3k|    else
 1314|  42.3k|    {
 1315|  42.3k|        ps_ref_pic_buf_lx = ps_dpb_mgr->ps_init_dpb[0][0];
 1316|       |        /* Avoid integer overflow while decrementing by one */
 1317|  42.3k|        if (i_temp_poc > INT32_MIN)
  ------------------
  |  Branch (1317:13): [True: 42.2k, False: 68]
  ------------------
 1318|  42.2k|            i_temp_poc--;
 1319|  42.3k|    }
 1320|       |
 1321|  42.3k|    i_cur_idx = -1;
 1322|  78.5k|    for(j = 0; j < ps_dpb_mgr->u1_num_st_ref_bufs; j++)
  ------------------
  |  Branch (1322:16): [True: 36.2k, False: 42.3k]
  ------------------
 1323|  36.2k|    {
 1324|  36.2k|        if (NULL == aps_st_pic_bufs[j])
  ------------------
  |  Branch (1324:13): [True: 0, False: 36.2k]
  ------------------
 1325|      0|        {
 1326|      0|            break;
 1327|      0|        }
 1328|  36.2k|        if (aps_st_pic_bufs[j]->i4_poc <= i_temp_poc)
  ------------------
  |  Branch (1328:13): [True: 12.7k, False: 23.5k]
  ------------------
 1329|  12.7k|        {
 1330|  12.7k|            i_cur_idx = j;
 1331|  12.7k|        }
 1332|  36.2k|    }
 1333|       |    /* Arrange all short term buffers in output order as given by POC */
 1334|       |    /* 1.1 Arrange POC's less than CurrPOC in the descending POC order starting
 1335|       |     from (CurrPOC - 1)*/
 1336|  55.0k|    for(j = i_cur_idx; j >= 0; j--)
  ------------------
  |  Branch (1336:24): [True: 12.7k, False: 42.3k]
  ------------------
 1337|  12.7k|    {
 1338|  12.7k|        if(aps_st_pic_bufs[j])
  ------------------
  |  Branch (1338:12): [True: 12.7k, False: 0]
  ------------------
 1339|  12.7k|        {
 1340|       |            /* Copy info in pic buffer */
 1341|  12.7k|            ih264d_insert_pic_in_ref_pic_listx(ps_ref_pic_buf_lx,
 1342|  12.7k|                                               aps_st_pic_bufs[j]);
 1343|  12.7k|            ps_ref_pic_buf_lx++;
 1344|  12.7k|            u1_L0++;
 1345|  12.7k|        }
 1346|  12.7k|    }
 1347|       |
 1348|       |    /* 1.2. Arrange POC's more than CurrPOC in the ascending POC order starting
 1349|       |     from (CurrPOC + 1)*/
 1350|  65.8k|    for(j = i_cur_idx + 1; j < ps_dpb_mgr->u1_num_st_ref_bufs; j++)
  ------------------
  |  Branch (1350:28): [True: 23.5k, False: 42.3k]
  ------------------
 1351|  23.5k|    {
 1352|  23.5k|        if(aps_st_pic_bufs[j])
  ------------------
  |  Branch (1352:12): [True: 23.5k, False: 0]
  ------------------
 1353|  23.5k|        {
 1354|  23.5k|            ih264d_insert_pic_in_ref_pic_listx(ps_ref_pic_buf_lx,
 1355|  23.5k|                                               aps_st_pic_bufs[j]);
 1356|  23.5k|            ps_ref_pic_buf_lx++;
 1357|  23.5k|            u1_L0++;
 1358|  23.5k|        }
 1359|  23.5k|    }
 1360|       |
 1361|       |    /* 1.3 Arrange all Long term buffers in ascending order, in LongtermIndex */
 1362|       |    /* Start from ST head */
 1363|       |
 1364|  42.3k|    u1_num_short_term_bufs = u1_L0;
 1365|  86.2k|    for(u4_lt_index = u1_min_lt_index; u4_lt_index <= u1_max_lt_index; u4_lt_index++)
  ------------------
  |  Branch (1365:40): [True: 43.9k, False: 42.3k]
  ------------------
 1366|  43.9k|    {
 1367|  43.9k|        ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
 1368|  46.9k|        for(i = 0; i < ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
  ------------------
  |  Branch (1368:20): [True: 8.75k, False: 38.1k]
  ------------------
 1369|  8.75k|        {
 1370|  8.75k|            if(ps_next_dpb->u1_lt_idx == u4_lt_index)
  ------------------
  |  Branch (1370:16): [True: 5.72k, False: 3.02k]
  ------------------
 1371|  5.72k|            {
 1372|  5.72k|                ih264d_insert_pic_in_ref_pic_listx(ps_ref_pic_buf_lx,
 1373|  5.72k|                                                   ps_next_dpb->ps_pic_buf);
 1374|  5.72k|                ps_ref_pic_buf_lx->u1_long_term_pic_num =
 1375|  5.72k|                                ps_ref_pic_buf_lx->u1_long_term_frm_idx;
 1376|       |
 1377|  5.72k|                ps_ref_pic_buf_lx++;
 1378|  5.72k|                u1_L0++;
 1379|  5.72k|                break;
 1380|  5.72k|            }
 1381|  3.02k|            ps_next_dpb = ps_next_dpb->ps_prev_long;
 1382|  3.02k|        }
 1383|  43.9k|    }
 1384|       |
 1385|  42.3k|    if(u1_field_pic_flag)
  ------------------
  |  Branch (1385:8): [True: 0, False: 42.3k]
  ------------------
 1386|      0|    {
 1387|       |        /* Initialize the rest of the entries in the */
 1388|       |        /* reference list to handle of errors        */
 1389|      0|        {
 1390|      0|            UWORD8 u1_i;
 1391|      0|            pic_buffer_t ref_pic;
 1392|       |
 1393|      0|            ref_pic = *(ps_dpb_mgr->ps_init_dpb[0][0] + MAX_REF_BUFS);
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1394|       |
 1395|      0|            if(NULL == ref_pic.pu1_buf1)
  ------------------
  |  Branch (1395:16): [True: 0, False: 0]
  ------------------
 1396|      0|            {
 1397|      0|                ref_pic = *ps_dec->ps_cur_pic;
 1398|      0|            }
 1399|      0|            for(u1_i = u1_L0; u1_i < u1_max_ref_idx_l0; u1_i++)
  ------------------
  |  Branch (1399:31): [True: 0, False: 0]
  ------------------
 1400|      0|            {
 1401|      0|                *ps_ref_pic_buf_lx = ref_pic;
 1402|      0|                ps_ref_pic_buf_lx++;
 1403|      0|            }
 1404|      0|        }
 1405|      0|        ih264d_convert_frm_to_fld_list(
 1406|      0|                        ps_dpb_mgr->ps_init_dpb[0][0] + MAX_REF_BUFS, &u1_L0,
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1407|      0|                        ps_dec, u1_num_short_term_bufs);
 1408|       |
 1409|      0|        ps_ref_pic_buf_lx = ps_dpb_mgr->ps_init_dpb[0][0] + u1_L0;
 1410|      0|    }
 1411|       |
 1412|  42.3k|    ps_dec->ps_cur_slice->u1_initial_list_size[0] = u1_L0;
 1413|       |
 1414|       |    /* Initialize the rest of the entries in the */
 1415|       |    /* reference list to handle of errors        */
 1416|  42.3k|    {
 1417|  42.3k|        UWORD8 u1_i;
 1418|  42.3k|        pic_buffer_t ref_pic;
 1419|       |
 1420|  42.3k|        ref_pic = *(ps_dpb_mgr->ps_init_dpb[0][0]);
 1421|       |
 1422|  42.3k|        if(NULL == ref_pic.pu1_buf1)
  ------------------
  |  Branch (1422:12): [True: 0, False: 42.3k]
  ------------------
 1423|      0|        {
 1424|      0|            ref_pic = *ps_dec->ps_cur_pic;
 1425|      0|        }
 1426|   105k|        for(u1_i = u1_L0; u1_i < u1_max_ref_idx_l0; u1_i++)
  ------------------
  |  Branch (1426:27): [True: 62.8k, False: 42.3k]
  ------------------
 1427|  62.8k|        {
 1428|  62.8k|            *ps_ref_pic_buf_lx = ref_pic;
 1429|  62.8k|            ps_ref_pic_buf_lx++;
 1430|  62.8k|        }
 1431|  42.3k|    }
 1432|  42.3k|    {
 1433|       |        /* 2. Initialize refIdxL1 */
 1434|  42.3k|        u1_L1 = 0;
 1435|  42.3k|        if(u1_field_pic_flag)
  ------------------
  |  Branch (1435:12): [True: 0, False: 42.3k]
  ------------------
 1436|      0|        {
 1437|      0|            ps_ref_pic_buf_lx = ps_dpb_mgr->ps_init_dpb[1][0] + MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1438|      0|        }
 1439|  42.3k|        else
 1440|  42.3k|        {
 1441|  42.3k|            ps_ref_pic_buf_lx = ps_dpb_mgr->ps_init_dpb[1][0];
 1442|  42.3k|        }
 1443|       |
 1444|       |        /* 2.1. Arrange POC's more than CurrPOC in the ascending POC order starting
 1445|       |         from (CurrPOC + 1)*/
 1446|  65.8k|        for(j = i_cur_idx + 1; j < ps_dpb_mgr->u1_num_st_ref_bufs; j++)
  ------------------
  |  Branch (1446:32): [True: 23.5k, False: 42.3k]
  ------------------
 1447|  23.5k|        {
 1448|  23.5k|            if(aps_st_pic_bufs[j])
  ------------------
  |  Branch (1448:16): [True: 23.5k, False: 0]
  ------------------
 1449|  23.5k|            {
 1450|       |                /* Start from ST head */
 1451|  23.5k|                ih264d_insert_pic_in_ref_pic_listx(ps_ref_pic_buf_lx,
 1452|  23.5k|                                                   aps_st_pic_bufs[j]);
 1453|  23.5k|                ps_ref_pic_buf_lx++;
 1454|  23.5k|                u1_L1++;
 1455|  23.5k|            }
 1456|  23.5k|        }
 1457|       |
 1458|       |        /* Arrange all short term buffers in output order as given by POC */
 1459|       |        /* 2.2 Arrange POC's less than CurrPOC in the descending POC order starting
 1460|       |         from (CurrPOC - 1)*/
 1461|  55.0k|        for(j = i_cur_idx; j >= 0; j--)
  ------------------
  |  Branch (1461:28): [True: 12.7k, False: 42.3k]
  ------------------
 1462|  12.7k|        {
 1463|  12.7k|            if(aps_st_pic_bufs[j])
  ------------------
  |  Branch (1463:16): [True: 12.7k, False: 0]
  ------------------
 1464|  12.7k|            {
 1465|  12.7k|                ih264d_insert_pic_in_ref_pic_listx(ps_ref_pic_buf_lx,
 1466|  12.7k|                                                   aps_st_pic_bufs[j]);
 1467|  12.7k|                ps_ref_pic_buf_lx++;
 1468|  12.7k|                u1_L1++;
 1469|  12.7k|            }
 1470|  12.7k|        }
 1471|       |
 1472|       |        /* 2.3 Arrange all Long term buffers in ascending order, in LongtermIndex */
 1473|       |        /* Start from ST head */
 1474|  42.3k|        u1_num_short_term_bufs = u1_L1;
 1475|       |
 1476|  86.2k|        for(u4_lt_index = u1_min_lt_index; u4_lt_index <= u1_max_lt_index;
  ------------------
  |  Branch (1476:44): [True: 43.9k, False: 42.3k]
  ------------------
 1477|  43.9k|                        u4_lt_index++)
 1478|  43.9k|        {
 1479|  43.9k|            ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
 1480|  46.9k|            for(i = 0; i < ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
  ------------------
  |  Branch (1480:24): [True: 8.75k, False: 38.1k]
  ------------------
 1481|  8.75k|            {
 1482|  8.75k|                if(ps_next_dpb->u1_lt_idx == u4_lt_index)
  ------------------
  |  Branch (1482:20): [True: 5.72k, False: 3.02k]
  ------------------
 1483|  5.72k|                {
 1484|  5.72k|                    ih264d_insert_pic_in_ref_pic_listx(ps_ref_pic_buf_lx,
 1485|  5.72k|                                                       ps_next_dpb->ps_pic_buf);
 1486|  5.72k|                    ps_ref_pic_buf_lx->u1_long_term_pic_num =
 1487|  5.72k|                                    ps_ref_pic_buf_lx->u1_long_term_frm_idx;
 1488|  5.72k|                    ps_ref_pic_buf_lx++;
 1489|  5.72k|                    u1_L1++;
 1490|  5.72k|                    break;
 1491|  5.72k|                }
 1492|  3.02k|                ps_next_dpb = ps_next_dpb->ps_prev_long;
 1493|  3.02k|            }
 1494|  43.9k|        }
 1495|       |
 1496|  42.3k|        if(u1_field_pic_flag)
  ------------------
  |  Branch (1496:12): [True: 0, False: 42.3k]
  ------------------
 1497|      0|        {
 1498|       |            /* Initialize the rest of the entries in the */
 1499|       |            /* reference list to handle of errors        */
 1500|      0|            {
 1501|      0|                UWORD8 u1_i;
 1502|      0|                pic_buffer_t ref_pic;
 1503|       |
 1504|      0|                ref_pic = *(ps_dpb_mgr->ps_init_dpb[0][0] + MAX_REF_BUFS);
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1505|       |
 1506|      0|                if(NULL == ref_pic.pu1_buf1)
  ------------------
  |  Branch (1506:20): [True: 0, False: 0]
  ------------------
 1507|      0|                {
 1508|      0|                    ref_pic = *ps_dec->ps_cur_pic;
 1509|      0|                }
 1510|      0|                for(u1_i = u1_L1; u1_i < u1_max_ref_idx_l1; u1_i++)
  ------------------
  |  Branch (1510:35): [True: 0, False: 0]
  ------------------
 1511|      0|                {
 1512|      0|                    *ps_ref_pic_buf_lx = ref_pic;
 1513|      0|                    ps_ref_pic_buf_lx++;
 1514|      0|                }
 1515|      0|            }
 1516|       |
 1517|      0|            ih264d_convert_frm_to_fld_list(
 1518|      0|                            ps_dpb_mgr->ps_init_dpb[1][0] + MAX_REF_BUFS,
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1519|      0|                            &u1_L1, ps_dec, u1_num_short_term_bufs);
 1520|      0|            ps_ref_pic_buf_lx = ps_dpb_mgr->ps_init_dpb[1][0] + u1_L1;
 1521|      0|        }
 1522|       |
 1523|  42.3k|        ps_dec->ps_cur_slice->u1_initial_list_size[1] = u1_L1;
 1524|       |
 1525|       |        /* Initialize the rest of the entries in the */
 1526|       |        /* reference list to handle of errors        */
 1527|  42.3k|        {
 1528|  42.3k|            UWORD8 u1_i;
 1529|  42.3k|            pic_buffer_t ref_pic;
 1530|       |
 1531|  42.3k|            ref_pic = *(ps_dpb_mgr->ps_init_dpb[0][0]);
 1532|       |
 1533|  42.3k|            if(NULL == ref_pic.pu1_buf1)
  ------------------
  |  Branch (1533:16): [True: 0, False: 42.3k]
  ------------------
 1534|      0|            {
 1535|      0|                ref_pic = *ps_dec->ps_cur_pic;
 1536|      0|            }
 1537|   101k|            for(u1_i = u1_L1; u1_i < u1_max_ref_idx_l1; u1_i++)
  ------------------
  |  Branch (1537:31): [True: 59.5k, False: 42.3k]
  ------------------
 1538|  59.5k|            {
 1539|  59.5k|                *ps_ref_pic_buf_lx = ref_pic;
 1540|  59.5k|                ps_ref_pic_buf_lx++;
 1541|  59.5k|            }
 1542|  42.3k|        }
 1543|       |
 1544|       |        /* If list0 and list 1 ebtries are same then swap the 0th and 1st entry */
 1545|       |        /* of list 1                                                            */
 1546|  42.3k|        {
 1547|  42.3k|            struct pic_buffer_t *ps_ref_pic1_buf_l0, *ps_ref_pic1_buf_l1;
 1548|  42.3k|            struct pic_buffer_t s_ref_pic1_buf_temp;
 1549|       |
 1550|  42.3k|            ps_ref_pic1_buf_l0 = ps_dpb_mgr->ps_init_dpb[0][0];
 1551|  42.3k|            ps_ref_pic1_buf_l1 = ps_dpb_mgr->ps_init_dpb[1][0];
 1552|       |
 1553|  42.3k|            if((u1_L0 == u1_L1) && (u1_L0 > 1))
  ------------------
  |  Branch (1553:16): [True: 42.3k, False: 0]
  |  Branch (1553:36): [True: 5.45k, False: 36.8k]
  ------------------
 1554|  5.45k|            {
 1555|  5.45k|                WORD32 i_index, i_swap;
 1556|       |
 1557|  5.45k|                i_swap = 1;
 1558|       |
 1559|  15.6k|                for(i_index = 0; i_index < u1_L0; i_index++)
  ------------------
  |  Branch (1559:34): [True: 12.2k, False: 3.44k]
  ------------------
 1560|  12.2k|                {
 1561|  12.2k|                    if((ps_ref_pic1_buf_l0[i_index]).pu1_buf1
  ------------------
  |  Branch (1561:24): [True: 2.00k, False: 10.2k]
  ------------------
 1562|  12.2k|                                    != (ps_ref_pic1_buf_l1[i_index]).pu1_buf1)
 1563|  2.00k|                    {
 1564|  2.00k|                        i_swap = 0;
 1565|  2.00k|                        break;
 1566|  2.00k|                    }
 1567|  12.2k|                }
 1568|  5.45k|                if(1 == i_swap)
  ------------------
  |  Branch (1568:20): [True: 3.44k, False: 2.00k]
  ------------------
 1569|  3.44k|                {
 1570|  3.44k|                    memcpy(&s_ref_pic1_buf_temp, &ps_ref_pic1_buf_l1[1],
 1571|  3.44k|                           sizeof(struct pic_buffer_t));
 1572|  3.44k|                    memcpy(&ps_ref_pic1_buf_l1[1], &ps_ref_pic1_buf_l1[0],
 1573|  3.44k|                           sizeof(struct pic_buffer_t));
 1574|  3.44k|                    memcpy(&ps_ref_pic1_buf_l1[0], &s_ref_pic1_buf_temp,
 1575|  3.44k|                           sizeof(struct pic_buffer_t));
 1576|  3.44k|                }
 1577|  5.45k|            }
 1578|  42.3k|        }
 1579|  42.3k|    }
 1580|  42.3k|}
ih264d_one_to_one:
 1604|   815k|{
 1605|   815k|    UWORD8 *pu1_col_zero_flag_start, u1_col_mb_pred_mode, u1_num_blks, u1_sub_mb_num;
 1606|   815k|    UWORD8 u1_init_colzero_flag;
 1607|   815k|    UNUSED(ps_cur_mb_info);
  ------------------
  |  |   45|   815k|#define UNUSED(x) ((void)(x))
  ------------------
 1608|   815k|    pu1_col_zero_flag_start = ps_col_pic->pu1_col_zero_flag + u2_sub_mb_ofst;
 1609|   815k|    u1_col_mb_pred_mode = pu1_col_zero_flag_start[ps_dec->u1_sub_mb_num];
 1610|   815k|    u1_init_colzero_flag = u1_col_mb_pred_mode & 1;
 1611|   815k|    u1_col_mb_pred_mode >>= 6;
 1612|   815k|    ps_direct->u1_vert_mv_scale = ONE_TO_ONE;
  ------------------
  |  |   47|   815k|#define ONE_TO_ONE    0
  ------------------
 1613|   815k|    ps_direct->u1_col_zeroflag_change = 0;
 1614|       |
 1615|   815k|    if(u1_wd_x == MB_SIZE)
  ------------------
  |  |  554|   815k|#define MB_SIZE             16
  ------------------
  |  Branch (1615:8): [True: 801k, False: 14.5k]
  ------------------
 1616|   801k|    {
 1617|   801k|        ps_dec->u1_currB_type = (!!u1_col_mb_pred_mode);
 1618|   801k|        if(u1_col_mb_pred_mode == PRED_16x16)
  ------------------
  |  |  450|   801k|#define PRED_16x16  0
  ------------------
  |  Branch (1618:12): [True: 782k, False: 18.4k]
  ------------------
 1619|   782k|        {
 1620|   782k|            ps_direct->i1_num_partitions = 1;
 1621|   782k|            ps_direct->i4_mv_indices[0] = u2_sub_mb_ofst;
 1622|   782k|            ps_direct->i1_submb_num[0] = 0;
 1623|   782k|            ps_direct->i1_partitionsize[0] = PRED_16x16;
  ------------------
  |  |  450|   782k|#define PRED_16x16  0
  ------------------
 1624|       |
 1625|   782k|            return;
 1626|   782k|        }
 1627|  18.4k|        else if(u1_col_mb_pred_mode < PRED_8x8)
  ------------------
  |  |  453|  18.4k|#define PRED_8x8    3
  ------------------
  |  Branch (1627:17): [True: 14.3k, False: 4.14k]
  ------------------
 1628|  14.3k|        {
 1629|  14.3k|            ps_direct->i1_num_partitions = 2;
 1630|  14.3k|            ps_direct->i4_mv_indices[0] = u2_sub_mb_ofst;
 1631|  14.3k|            ps_direct->i1_submb_num[0] = 0;
 1632|  14.3k|            ps_direct->i1_partitionsize[0] = u1_col_mb_pred_mode;
 1633|  14.3k|            u1_sub_mb_num = (u1_col_mb_pred_mode == PRED_16x8) ? 8 : 2;
  ------------------
  |  |  451|  14.3k|#define PRED_16x8   1
  ------------------
  |  Branch (1633:29): [True: 8.69k, False: 5.64k]
  ------------------
 1634|  14.3k|            ps_direct->i1_submb_num[1] = u1_sub_mb_num;
 1635|  14.3k|            ps_direct->i4_mv_indices[1] = u2_sub_mb_ofst
 1636|  14.3k|                            + ps_direct->i1_submb_num[1];
 1637|  14.3k|            ps_direct->i1_partitionsize[1] = u1_col_mb_pred_mode;
 1638|  14.3k|            if((pu1_col_zero_flag_start[u1_sub_mb_num] & 1) != u1_init_colzero_flag)
  ------------------
  |  Branch (1638:16): [True: 4.06k, False: 10.2k]
  ------------------
 1639|  4.06k|                ps_direct->u1_col_zeroflag_change = 1;
 1640|  14.3k|            return;
 1641|  14.3k|        }
 1642|  4.14k|        else
 1643|  4.14k|        {
 1644|  4.14k|            u1_num_blks = 4;
 1645|  4.14k|        }
 1646|   801k|    }
 1647|  14.5k|    else
 1648|  14.5k|    {
 1649|  14.5k|        u1_num_blks = 1;
 1650|  14.5k|    }
 1651|       |
 1652|  18.6k|    {
 1653|  18.6k|        const UWORD8 *pu1_top_lt_mb_part_idx;
 1654|  18.6k|        UWORD8 u1_col_sub_mb_pred_mode, uc_blk, u1_sub_blk, u1_submb_col = 0;
 1655|  18.6k|        UWORD8 u1_num_sub_blks, uc_direct8x8inf, *pu1_col_zero_flag, u1_sub_mb_num;
 1656|  18.6k|        const UWORD8 *pu1_num_sub_mb_part =
 1657|  18.6k|                        (const UWORD8 *)gau1_ih264d_num_submb_part;
 1658|  18.6k|        UWORD8 i1_num_partitions = 0, partition_size;
 1659|  18.6k|        WORD32 mv_index;
 1660|  18.6k|        const UWORD8 *pu1_top_lt_sub_mb_idx = gau1_ih264d_submb_indx_mod_sp_drct;
 1661|       |
 1662|  18.6k|        u1_sub_mb_num = ps_dec->u1_sub_mb_num;
 1663|  18.6k|        uc_direct8x8inf = ps_dec->ps_cur_slice->u1_direct_8x8_inference_flag;
 1664|  18.6k|        pu1_top_lt_mb_part_idx = gau1_ih264d_top_left_mb_part_indx_mod
 1665|  18.6k|                        + (PRED_8x8 << 1) + 1;
  ------------------
  |  |  453|  18.6k|#define PRED_8x8    3
  ------------------
 1666|       |
 1667|  49.7k|        for(uc_blk = 0; uc_blk < u1_num_blks; uc_blk++)
  ------------------
  |  Branch (1667:25): [True: 31.1k, False: 18.6k]
  ------------------
 1668|  31.1k|        {
 1669|  31.1k|            partition_size = PRED_8x8;
  ------------------
  |  |  453|  31.1k|#define PRED_8x8    3
  ------------------
 1670|  31.1k|            pu1_top_lt_sub_mb_idx = gau1_ih264d_submb_indx_mod_sp_drct;
 1671|  31.1k|            if(uc_direct8x8inf == 1)
  ------------------
  |  Branch (1671:16): [True: 3.94k, False: 27.1k]
  ------------------
 1672|  3.94k|            {
 1673|  3.94k|                u1_submb_col = u1_sub_mb_num | (u1_sub_mb_num >> 1);
 1674|  3.94k|                mv_index = u2_sub_mb_ofst + u1_submb_col;
 1675|  3.94k|                u1_num_sub_blks = 1;
 1676|  3.94k|            }
 1677|  27.1k|            else
 1678|  27.1k|            {
 1679|       |                /* colMbPart is either 8x8, 8x4, 4x8, 4x4 */
 1680|  27.1k|                pu1_col_zero_flag = pu1_col_zero_flag_start + u1_sub_mb_num;
 1681|  27.1k|                u1_col_sub_mb_pred_mode = *pu1_col_zero_flag;
 1682|  27.1k|                u1_col_sub_mb_pred_mode = (u1_col_sub_mb_pred_mode & 0x30) >> 4;
 1683|  27.1k|                partition_size = (UWORD8)((u1_col_sub_mb_pred_mode)
 1684|  27.1k|                                | (PRED_8x8 << 2));
  ------------------
  |  |  453|  27.1k|#define PRED_8x8    3
  ------------------
 1685|  27.1k|                mv_index = u2_sub_mb_ofst + u1_sub_mb_num;
 1686|  27.1k|                pu1_top_lt_sub_mb_idx += (u1_col_sub_mb_pred_mode << 1);
 1687|  27.1k|                u1_num_sub_blks = pu1_num_sub_mb_part[u1_col_sub_mb_pred_mode];
 1688|       |
 1689|  27.1k|            }
 1690|       |
 1691|  73.1k|            for(u1_sub_blk = 0; u1_sub_blk < u1_num_sub_blks;
  ------------------
  |  Branch (1691:33): [True: 42.0k, False: 31.1k]
  ------------------
 1692|  42.0k|                            u1_sub_blk++, pu1_top_lt_sub_mb_idx++)
 1693|  42.0k|            {
 1694|  42.0k|                u1_sub_mb_num += *pu1_top_lt_sub_mb_idx;
 1695|  42.0k|                mv_index += *pu1_top_lt_sub_mb_idx;
 1696|  42.0k|                ps_direct->i4_mv_indices[i1_num_partitions] = mv_index;
 1697|  42.0k|                ps_direct->i1_submb_num[i1_num_partitions] = u1_sub_mb_num;
 1698|  42.0k|                ps_direct->i1_partitionsize[i1_num_partitions] = partition_size;
 1699|  42.0k|                i1_num_partitions++;
 1700|  42.0k|                if(!uc_direct8x8inf)
  ------------------
  |  Branch (1700:20): [True: 38.0k, False: 3.94k]
  ------------------
 1701|  38.0k|                    u1_submb_col = u1_sub_mb_num;
 1702|  42.0k|                if((pu1_col_zero_flag_start[u1_submb_col] & 1)
  ------------------
  |  Branch (1702:20): [True: 8.54k, False: 33.4k]
  ------------------
 1703|  42.0k|                                != u1_init_colzero_flag)
 1704|  8.54k|                    ps_direct->u1_col_zeroflag_change = 1;
 1705|  42.0k|            }
 1706|  31.1k|            u1_sub_mb_num = *pu1_top_lt_mb_part_idx++;
 1707|  31.1k|        }
 1708|  18.6k|        ps_direct->i1_num_partitions = i1_num_partitions;
 1709|  18.6k|    }
 1710|  18.6k|}
ih264d_cal_col_pic:
 1939|  29.8k|{
 1940|  29.8k|    struct pic_buffer_t* ps_col_pic = ps_dec->ps_col_pic;
 1941|  29.8k|    UWORD8 uc_curpictype, uc_colpictype;
 1942|  29.8k|    ps_col_pic = ps_dec->ps_ref_pic_buf_lx[1][0];
 1943|  29.8k|    uc_curpictype = (ps_dec->ps_cur_pic->u1_picturetype & 0x7);
 1944|  29.8k|    uc_colpictype = (ps_col_pic->u1_picturetype & 0x7);
 1945|  29.8k|    if(uc_curpictype == FRM_PIC)
  ------------------
  |  |  352|  29.8k|#define FRM_PIC         0x00
  ------------------
  |  Branch (1945:8): [True: 29.8k, False: 0]
  ------------------
 1946|  29.8k|    {
 1947|  29.8k|        if(uc_colpictype == FRM_PIC)
  ------------------
  |  |  352|  29.8k|#define FRM_PIC         0x00
  ------------------
  |  Branch (1947:12): [True: 29.8k, False: 0]
  ------------------
 1948|  29.8k|            ps_dec->pf_parse_mvdirect = ih264d_one_to_one;
 1949|      0|        else if(uc_colpictype == COMP_FLD_PAIR)
  ------------------
  |  |  355|      0|#define COMP_FLD_PAIR   0x03 /* TOP_FLD | BOT_FLD */
  ------------------
  |  Branch (1949:17): [True: 0, False: 0]
  ------------------
 1950|      0|        {
 1951|      0|            ps_dec->pf_parse_mvdirect = ih264d_fld_to_frm;
 1952|      0|            if(ps_col_pic->i4_top_field_order_cnt
  ------------------
  |  Branch (1952:16): [True: 0, False: 0]
  ------------------
 1953|      0|                            >= ps_col_pic->i4_bottom_field_order_cnt)
 1954|      0|            {
 1955|      0|                struct pic_buffer_t* ps_tempPic = ps_col_pic;
 1956|      0|                UWORD32 ui_half_num_of_sub_mbs = ((ps_dec->u2_pic_ht
 1957|      0|                                * ps_dec->u2_pic_wd) >> 5);
 1958|      0|                ps_col_pic = ps_dec->ps_ref_pic_buf_lx[1][MAX_REF_BUFS];
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1959|       |                /* memcpy ps_tempPic to ps_col_pic */
 1960|      0|                *ps_col_pic = *ps_tempPic;
 1961|      0|                ps_col_pic->pu1_buf1 = ps_tempPic->pu1_buf1
 1962|      0|                                + ps_tempPic->u2_frm_wd_y;
 1963|      0|                ps_col_pic->pu1_buf2 = ps_tempPic->pu1_buf2
 1964|      0|                                + ps_tempPic->u2_frm_wd_uv;
 1965|      0|                ps_col_pic->pu1_buf3 = ps_tempPic->pu1_buf3
 1966|      0|                                + ps_tempPic->u2_frm_wd_uv;
 1967|      0|                ps_col_pic->pu1_col_zero_flag = ps_tempPic->pu1_col_zero_flag
 1968|      0|                                + ui_half_num_of_sub_mbs;
 1969|      0|                ps_col_pic->ps_mv = ps_tempPic->ps_mv + ui_half_num_of_sub_mbs;
 1970|       |
 1971|       |
 1972|      0|                ps_col_pic->u1_pic_type = 0;/*complementary reference field pair-refering as frame */
 1973|       |
 1974|       |
 1975|       |
 1976|      0|            }
 1977|      0|        }
 1978|      0|        else
 1979|      0|        {
 1980|      0|            UWORD32 i4_error_code;
 1981|      0|            i4_error_code = ERROR_DBP_MANAGER_T;
 1982|       |//          i4_error_code |= 1<<IVD_CORRUPTEDDATA;
 1983|      0|            return i4_error_code;
 1984|      0|        }
 1985|  29.8k|    }
 1986|      0|    else if(uc_curpictype == AFRM_PIC)
  ------------------
  |  |  356|      0|#define AFRM_PIC        0x04
  ------------------
  |  Branch (1986:13): [True: 0, False: 0]
  ------------------
 1987|      0|    {
 1988|      0|        ps_dec->pf_parse_mvdirect = ih264d_fld_to_mbaff;
 1989|      0|    }
 1990|      0|    else /* must be a field*/
 1991|      0|    {
 1992|      0|        if(uc_colpictype == FRM_PIC)
  ------------------
  |  |  352|      0|#define FRM_PIC         0x00
  ------------------
  |  Branch (1992:12): [True: 0, False: 0]
  ------------------
 1993|      0|            ps_dec->pf_parse_mvdirect = ih264d_frm_to_fld;
 1994|      0|        else if(uc_colpictype == AFRM_PIC)
  ------------------
  |  |  356|      0|#define AFRM_PIC        0x04
  ------------------
  |  Branch (1994:17): [True: 0, False: 0]
  ------------------
 1995|      0|            ps_dec->pf_parse_mvdirect = ih264d_mbaff_to_fld;
 1996|      0|        else
 1997|      0|            ps_dec->pf_parse_mvdirect = ih264d_one_to_one;
 1998|      0|    }
 1999|  29.8k|    ps_dec->ps_col_pic = ps_col_pic;
 2000|  29.8k|    return OK;
  ------------------
  |  |  114|  29.8k|#define OK        0
  ------------------
 2001|  29.8k|}
ih264d_process_bslice.c:poc_compare:
 1198|  16.9k|{
 1199|  16.9k|    struct pic_buffer_t *ps_pic1 = *(struct pic_buffer_t **) pv_pic1;
 1200|  16.9k|    struct pic_buffer_t *ps_pic2 = *(struct pic_buffer_t **) pv_pic2;
 1201|  16.9k|    if (ps_pic1->i4_poc < ps_pic2->i4_poc)
  ------------------
  |  Branch (1201:9): [True: 5.92k, False: 11.0k]
  ------------------
 1202|  5.92k|    {
 1203|  5.92k|        return -1;
 1204|  5.92k|    }
 1205|  11.0k|    else if (ps_pic1->i4_poc > ps_pic2->i4_poc)
  ------------------
  |  Branch (1205:14): [True: 9.70k, False: 1.34k]
  ------------------
 1206|  9.70k|    {
 1207|  9.70k|        return 1;
 1208|  9.70k|    }
 1209|  1.34k|    else
 1210|  1.34k|    {
 1211|  1.34k|        return 0;
 1212|  1.34k|    }
 1213|  16.9k|}

ih264d_read_intra_pred_modes:
  109|  20.9k|{
  110|  20.9k|    WORD32 i4x4_luma_blk_idx = 0, i8x8_luma_blk_idx = 0;
  111|       |
  112|  20.9k|    dec_bit_stream_t * ps_bitstrm = ps_dec->ps_bitstrm;
  113|       |
  114|  20.9k|    if(!u4_trans_form8x8)
  ------------------
  |  Branch (114:8): [True: 7.05k, False: 13.9k]
  ------------------
  115|  7.05k|    {
  116|   119k|        for(i4x4_luma_blk_idx = 0; i4x4_luma_blk_idx < 16; ++i4x4_luma_blk_idx)
  ------------------
  |  Branch (116:36): [True: 112k, False: 7.05k]
  ------------------
  117|   112k|        {
  118|   112k|            UWORD32 u4_temp;
  119|   112k|            SWITCHOFFTRACE;
  120|       |
  121|   112k|            GETBIT(u4_temp, ps_bitstrm->u4_ofst, ps_bitstrm->pu4_buffer);
  ------------------
  |  |  105|   112k|#define   GETBIT(u4_code, u4_offset, pu4_bitstream)                         \
  |  |  106|   112k|{                                                                           \
  |  |  107|   112k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  108|   112k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  109|   112k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  110|   112k|    u4_code = pu4_buf[u4_word_off] << u4_bit_off;                           \
  |  |  111|   112k|    (u4_offset)++;                                                          \
  |  |  112|   112k|    u4_code = (u4_code >> 31);                                              \
  |  |  113|   112k|}
  ------------------
  122|   112k|            *pu1_prev_intra4x4_pred_mode_flag = (UWORD8)u4_temp;
  123|   112k|            if(!(*pu1_prev_intra4x4_pred_mode_flag))
  ------------------
  |  Branch (123:16): [True: 53.7k, False: 59.0k]
  ------------------
  124|  53.7k|            {
  125|  53.7k|                GETBITS(u4_temp, ps_bitstrm->u4_ofst, ps_bitstrm->pu4_buffer, 3);
  ------------------
  |  |  120|  53.7k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  53.7k|{                                                                           \
  |  |  122|  53.7k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  53.7k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  53.7k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  53.7k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  53.7k|                                                                            \
  |  |  127|  53.7k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 52.7k, False: 1.06k]
  |  |  ------------------
  |  |  128|  53.7k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  52.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  53.7k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  53.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  53.7k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  53.7k|}                                                                           \
  ------------------
  126|       |
  127|  53.7k|                *(pu1_rem_intra4x4_pred_mode) = (UWORD8)u4_temp;
  128|  53.7k|            }
  129|       |
  130|   112k|            pu1_prev_intra4x4_pred_mode_flag++;
  131|   112k|            pu1_rem_intra4x4_pred_mode++;
  132|   112k|        }
  133|  7.05k|    }
  134|  13.9k|    else
  135|  13.9k|    {
  136|       |        /**********************************************************************/
  137|       |        /* prev_intra4x4_pred_modes to be interpreted as                      */
  138|       |        /* prev_intra8x8_pred_modes in case of transform 8x8                  */
  139|       |        /**********************************************************************/
  140|  69.6k|        for(i8x8_luma_blk_idx = 0; i8x8_luma_blk_idx < 4; i8x8_luma_blk_idx++)
  ------------------
  |  Branch (140:36): [True: 55.6k, False: 13.9k]
  ------------------
  141|  55.6k|        {
  142|  55.6k|            UWORD32 u4_temp;
  143|  55.6k|            GETBIT(u4_temp, ps_bitstrm->u4_ofst, ps_bitstrm->pu4_buffer);
  ------------------
  |  |  105|  55.6k|#define   GETBIT(u4_code, u4_offset, pu4_bitstream)                         \
  |  |  106|  55.6k|{                                                                           \
  |  |  107|  55.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  108|  55.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  109|  55.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  110|  55.6k|    u4_code = pu4_buf[u4_word_off] << u4_bit_off;                           \
  |  |  111|  55.6k|    (u4_offset)++;                                                          \
  |  |  112|  55.6k|    u4_code = (u4_code >> 31);                                              \
  |  |  113|  55.6k|}
  ------------------
  144|  55.6k|            *pu1_prev_intra4x4_pred_mode_flag = (UWORD8)u4_temp;
  145|  55.6k|            if(!(*pu1_prev_intra4x4_pred_mode_flag))
  ------------------
  |  Branch (145:16): [True: 11.6k, False: 43.9k]
  ------------------
  146|  11.6k|            {
  147|  11.6k|                GETBITS(u4_temp, ps_bitstrm->u4_ofst, ps_bitstrm->pu4_buffer, 3);
  ------------------
  |  |  120|  11.6k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  11.6k|{                                                                           \
  |  |  122|  11.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  11.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  11.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  11.6k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  11.6k|                                                                            \
  |  |  127|  11.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 10.7k, False: 907]
  |  |  ------------------
  |  |  128|  11.6k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  10.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  11.6k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  11.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  11.6k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  11.6k|}                                                                           \
  ------------------
  148|       |
  149|  11.6k|                (*pu1_rem_intra4x4_pred_mode) = (UWORD8)u4_temp;
  150|  11.6k|            }
  151|  55.6k|            pu1_prev_intra4x4_pred_mode_flag++;
  152|  55.6k|            pu1_rem_intra4x4_pred_mode++;
  153|  55.6k|        }
  154|  13.9k|    }
  155|  20.9k|    return (0);
  156|  20.9k|}
ih264d_unpack_coeff4x4_4x4blk:
  160|   428k|{
  161|   428k|    tu_sblk4x4_coeff_data_t *ps_tu_4x4 = (tu_sblk4x4_coeff_data_t *)ps_dec->pv_proc_tu_coeff_data;
  162|   428k|    UWORD16 u2_sig_coeff_map = ps_tu_4x4->u2_sig_coeff_map;
  163|   428k|    WORD32 idx = 0;
  164|   428k|    WORD16 *pi2_coeff_data = &ps_tu_4x4->ai2_level[0];
  165|   428k|    WORD32 dc_only_flag = 0;
  166|   428k|    WORD32 num_coeff = 0;
  167|       |
  168|   428k|    PROFILE_DISABLE_UNPACK_LUMA()
  ------------------
  |  |  112|   428k|#define PROFILE_DISABLE_UNPACK_LUMA() ;
  ------------------
  169|  1.48M|    while(u2_sig_coeff_map)
  ------------------
  |  Branch (169:11): [True: 1.05M, False: 428k]
  ------------------
  170|  1.05M|    {
  171|  1.05M|        idx = CLZ(u2_sig_coeff_map);
  172|       |
  173|  1.05M|        idx = 31 - idx;
  174|  1.05M|        RESET_BIT(u2_sig_coeff_map,idx);
  ------------------
  |  |  105|  1.05M|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  ------------------
  175|       |
  176|  1.05M|        idx = pu1_inv_scan[idx];
  177|  1.05M|        pi2_out_coeff_data[idx] = *pi2_coeff_data++;
  178|  1.05M|        num_coeff++;
  179|  1.05M|    }
  180|       |
  181|   428k|    if((num_coeff == 1) && (idx == 0))
  ------------------
  |  Branch (181:8): [True: 200k, False: 227k]
  |  Branch (181:28): [True: 52.4k, False: 148k]
  ------------------
  182|  52.4k|    {
  183|  52.4k|        dc_only_flag = 1;
  184|  52.4k|    }
  185|       |
  186|   428k|    {
  187|   428k|        WORD32 offset;
  188|   428k|        offset = (UWORD8 *)pi2_coeff_data - (UWORD8 *)ps_tu_4x4;
  189|   428k|        offset = ALIGN4(offset);
  ------------------
  |  |   52|   428k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  190|   428k|        ps_dec->pv_proc_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_proc_tu_coeff_data + offset);
  191|   428k|    }
  192|       |
  193|   428k|    return dc_only_flag;
  194|   428k|}
ih264d_unpack_coeff4x4_8x8blk:
  200|   272k|{
  201|   272k|    UWORD8 *pu1_inv_scan;
  202|   272k|    UWORD8 u1_mb_field_decoding_flag = ps_cur_mb_info->u1_mb_field_decodingflag;
  203|   272k|    UWORD8 u1_field_coding_flag = ps_cur_mb_info->ps_curmb->u1_mb_fld;
  204|   272k|    UWORD32 u4_luma_dc_only_csbp = 0;
  205|   272k|    WORD32 dc_only_flag = 0;
  206|       |
  207|   272k|    PROFILE_DISABLE_UNPACK_LUMA()
  ------------------
  |  |  112|   272k|#define PROFILE_DISABLE_UNPACK_LUMA() ;
  ------------------
  208|   272k|    if(u1_field_coding_flag || u1_mb_field_decoding_flag)
  ------------------
  |  Branch (208:8): [True: 0, False: 272k]
  |  Branch (208:32): [True: 0, False: 272k]
  ------------------
  209|      0|    {
  210|      0|        pu1_inv_scan = (UWORD8 *)gau1_ih264d_inv_scan_fld;
  211|      0|    }
  212|   272k|    else
  213|   272k|    {
  214|   272k|        pu1_inv_scan = (UWORD8 *)gau1_ih264d_inv_scan;
  215|   272k|    }
  216|       |
  217|       |    // sub 0
  218|   272k|    if(ui2_luma_csbp & 0x1)
  ------------------
  |  Branch (218:8): [True: 77.6k, False: 195k]
  ------------------
  219|  77.6k|    {
  220|  77.6k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  221|  77.6k|        dc_only_flag = ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  222|  77.6k|                                      pi2_out_coeff_data,
  223|  77.6k|                                      pu1_inv_scan);
  224|       |
  225|  77.6k|        INSERT_BIT(u4_luma_dc_only_csbp, 0, dc_only_flag);
  ------------------
  |  |  109|  77.6k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  77.6k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  226|  77.6k|    }
  227|       |
  228|   272k|    pi2_out_coeff_data += 16;
  229|       |    // sub 1
  230|   272k|    if(ui2_luma_csbp & 0x2)
  ------------------
  |  Branch (230:8): [True: 81.5k, False: 191k]
  ------------------
  231|  81.5k|    {
  232|  81.5k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  233|  81.5k|        dc_only_flag = ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  234|  81.5k|                                      pi2_out_coeff_data,
  235|  81.5k|                                      pu1_inv_scan);
  236|  81.5k|        INSERT_BIT(u4_luma_dc_only_csbp, 1, dc_only_flag);
  ------------------
  |  |  109|  81.5k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  81.5k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  237|  81.5k|    }
  238|       |
  239|   272k|    pi2_out_coeff_data += 16 + 32;
  240|       |    // sub 2
  241|   272k|    if(ui2_luma_csbp & 0x10)
  ------------------
  |  Branch (241:8): [True: 82.5k, False: 190k]
  ------------------
  242|  82.5k|    {
  243|  82.5k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  244|  82.5k|        dc_only_flag = ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  245|  82.5k|                                      pi2_out_coeff_data,
  246|  82.5k|                                      pu1_inv_scan);
  247|  82.5k|        INSERT_BIT(u4_luma_dc_only_csbp, 4, dc_only_flag);
  ------------------
  |  |  109|  82.5k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  82.5k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  248|  82.5k|    }
  249|       |
  250|   272k|    pi2_out_coeff_data += 16;
  251|       |    // sub 3
  252|   272k|    if(ui2_luma_csbp & 0x20)
  ------------------
  |  Branch (252:8): [True: 78.7k, False: 194k]
  ------------------
  253|  78.7k|    {
  254|  78.7k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  255|  78.7k|        dc_only_flag = ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  256|  78.7k|                                      pi2_out_coeff_data,
  257|  78.7k|                                      pu1_inv_scan);
  258|  78.7k|        INSERT_BIT(u4_luma_dc_only_csbp, 5, dc_only_flag);
  ------------------
  |  |  109|  78.7k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  78.7k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  259|  78.7k|    }
  260|   272k|    return u4_luma_dc_only_csbp;
  261|   272k|}
ih264d_unpack_coeff8x8_8x8blk_cavlc:
  266|  52.7k|{
  267|  52.7k|    UWORD8 *pu1_inv_scan;
  268|  52.7k|    UWORD8 u1_mb_field_decoding_flag = ps_cur_mb_info->u1_mb_field_decodingflag;
  269|  52.7k|    UWORD8 u1_field_coding_flag = ps_cur_mb_info->ps_curmb->u1_mb_fld;
  270|  52.7k|    WORD32 dc_only_flag = 0;
  271|       |
  272|  52.7k|    PROFILE_DISABLE_UNPACK_LUMA()
  ------------------
  |  |  112|  52.7k|#define PROFILE_DISABLE_UNPACK_LUMA() ;
  ------------------
  273|  52.7k|    if(ui2_luma_csbp & 0x33)
  ------------------
  |  Branch (273:8): [True: 30.5k, False: 22.1k]
  ------------------
  274|  30.5k|    {
  275|  30.5k|        memset(pi2_out_coeff_data,0,64*sizeof(WORD16));
  276|  30.5k|    }
  277|       |
  278|  52.7k|    if(!u1_mb_field_decoding_flag)
  ------------------
  |  Branch (278:8): [True: 52.7k, False: 0]
  ------------------
  279|  52.7k|    {
  280|  52.7k|        pu1_inv_scan =
  281|  52.7k|                        (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[0];
  282|  52.7k|    }
  283|      0|    else
  284|      0|    {
  285|      0|        pu1_inv_scan =
  286|      0|                        (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[0];
  287|      0|    }
  288|       |    // sub 0
  289|  52.7k|    if(ui2_luma_csbp & 0x1)
  ------------------
  |  Branch (289:8): [True: 9.65k, False: 43.1k]
  ------------------
  290|  9.65k|    {
  291|  9.65k|        dc_only_flag = ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  292|  9.65k|                                      pi2_out_coeff_data,
  293|  9.65k|                                      pu1_inv_scan);
  294|  9.65k|    }
  295|       |
  296|  52.7k|    if(!u1_mb_field_decoding_flag)
  ------------------
  |  Branch (296:8): [True: 52.7k, False: 0]
  ------------------
  297|  52.7k|    {
  298|  52.7k|        pu1_inv_scan =
  299|  52.7k|                        (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[1];
  300|  52.7k|    }
  301|      0|    else
  302|      0|    {
  303|      0|        pu1_inv_scan =
  304|      0|                        (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[1];
  305|      0|    }
  306|       |    // sub 1
  307|  52.7k|    if(ui2_luma_csbp & 0x2)
  ------------------
  |  Branch (307:8): [True: 11.3k, False: 41.4k]
  ------------------
  308|  11.3k|    {
  309|  11.3k|        dc_only_flag = 0;
  310|  11.3k|        ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  311|  11.3k|                                      pi2_out_coeff_data,
  312|  11.3k|                                      pu1_inv_scan);
  313|  11.3k|    }
  314|       |
  315|  52.7k|    if(!u1_mb_field_decoding_flag)
  ------------------
  |  Branch (315:8): [True: 52.7k, False: 0]
  ------------------
  316|  52.7k|    {
  317|  52.7k|        pu1_inv_scan =
  318|  52.7k|                        (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[2];
  319|  52.7k|    }
  320|      0|    else
  321|      0|    {
  322|      0|        pu1_inv_scan =
  323|      0|                        (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[2];
  324|      0|    }
  325|       |    // sub 2
  326|  52.7k|    if(ui2_luma_csbp & 0x10)
  ------------------
  |  Branch (326:8): [True: 11.2k, False: 41.5k]
  ------------------
  327|  11.2k|    {
  328|  11.2k|        dc_only_flag = 0;
  329|  11.2k|        ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  330|  11.2k|                                      pi2_out_coeff_data,
  331|  11.2k|                                      pu1_inv_scan);
  332|  11.2k|    }
  333|       |
  334|  52.7k|    if(!u1_mb_field_decoding_flag)
  ------------------
  |  Branch (334:8): [True: 52.7k, False: 0]
  ------------------
  335|  52.7k|    {
  336|  52.7k|        pu1_inv_scan =
  337|  52.7k|                        (UWORD8*)gau1_ih264d_inv_scan_prog8x8_cavlc[3];
  338|  52.7k|    }
  339|      0|    else
  340|      0|    {
  341|      0|        pu1_inv_scan =
  342|      0|                        (UWORD8*)gau1_ih264d_inv_scan_int8x8_cavlc[3];
  343|      0|    }
  344|       |    // sub 3
  345|  52.7k|    if(ui2_luma_csbp & 0x20)
  ------------------
  |  Branch (345:8): [True: 9.88k, False: 42.8k]
  ------------------
  346|  9.88k|    {
  347|  9.88k|        dc_only_flag = 0;
  348|  9.88k|        ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  349|  9.88k|                                      pi2_out_coeff_data,
  350|  9.88k|                                      pu1_inv_scan);
  351|  9.88k|    }
  352|  52.7k|    return dc_only_flag;
  353|  52.7k|}
ih264d_unpack_coeff4x4_8x8blk_chroma:
  358|  65.4k|{
  359|  65.4k|    UWORD8 *pu1_inv_scan;
  360|  65.4k|    UWORD8 u1_mb_field_decoding_flag = ps_cur_mb_info->u1_mb_field_decodingflag;
  361|  65.4k|    UWORD8 u1_field_coding_flag = ps_cur_mb_info->ps_curmb->u1_mb_fld;
  362|       |
  363|  65.4k|    PROFILE_DISABLE_UNPACK_CHROMA()
  ------------------
  |  |  113|  65.4k|#define PROFILE_DISABLE_UNPACK_CHROMA() ;
  ------------------
  364|  65.4k|    if(u1_field_coding_flag || u1_mb_field_decoding_flag)
  ------------------
  |  Branch (364:8): [True: 0, False: 65.4k]
  |  Branch (364:32): [True: 0, False: 65.4k]
  ------------------
  365|      0|    {
  366|      0|        pu1_inv_scan = (UWORD8 *)gau1_ih264d_inv_scan_fld;
  367|      0|    }
  368|  65.4k|    else
  369|  65.4k|    {
  370|  65.4k|        pu1_inv_scan = (UWORD8 *)gau1_ih264d_inv_scan;
  371|  65.4k|    }
  372|       |
  373|  65.4k|    if(ui2_chroma_csbp & 0x1)
  ------------------
  |  Branch (373:8): [True: 15.6k, False: 49.7k]
  ------------------
  374|  15.6k|    {
  375|  15.6k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  376|  15.6k|        ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  377|  15.6k|                                      pi2_out_coeff_data,
  378|  15.6k|                                      pu1_inv_scan);
  379|  15.6k|    }
  380|  65.4k|    pi2_out_coeff_data += 16;
  381|  65.4k|    if(ui2_chroma_csbp & 0x2)
  ------------------
  |  Branch (381:8): [True: 15.5k, False: 49.8k]
  ------------------
  382|  15.5k|    {
  383|  15.5k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  384|  15.5k|        ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  385|  15.5k|                                      pi2_out_coeff_data,
  386|  15.5k|                                      pu1_inv_scan);
  387|  15.5k|    }
  388|       |
  389|  65.4k|    pi2_out_coeff_data += 16;
  390|  65.4k|    if(ui2_chroma_csbp & 0x4)
  ------------------
  |  Branch (390:8): [True: 16.9k, False: 48.5k]
  ------------------
  391|  16.9k|    {
  392|  16.9k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  393|  16.9k|        ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  394|  16.9k|                                      pi2_out_coeff_data,
  395|  16.9k|                                      pu1_inv_scan);
  396|  16.9k|    }
  397|       |
  398|  65.4k|    pi2_out_coeff_data += 16;
  399|  65.4k|    if(ui2_chroma_csbp & 0x8)
  ------------------
  |  Branch (399:8): [True: 17.6k, False: 47.8k]
  ------------------
  400|  17.6k|    {
  401|  17.6k|        memset(pi2_out_coeff_data,0,16*sizeof(WORD16));
  402|  17.6k|        ih264d_unpack_coeff4x4_4x4blk(ps_dec,
  403|  17.6k|                                      pi2_out_coeff_data,
  404|  17.6k|                                      pu1_inv_scan);
  405|  17.6k|    }
  406|  65.4k|}
ih264d_unpack_luma_coeff4x4_mb:
  410|   703k|{
  411|   703k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  412|   703k|    UWORD16 ui2_luma_csbp = ps_cur_mb_info->u2_luma_csbp;
  413|   703k|    UWORD8 *pu1_inv_scan = ps_dec->pu1_inv_scan;
  414|   703k|    WORD16 *pi2_coeff_data = ps_dec->pi2_coeff_data;
  415|       |
  416|   703k|    PROFILE_DISABLE_UNPACK_LUMA()
  ------------------
  |  |  112|   703k|#define PROFILE_DISABLE_UNPACK_LUMA() ;
  ------------------
  417|   703k|    if(!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (417:8): [True: 685k, False: 18.2k]
  ------------------
  418|   685k|    {
  419|   685k|        UWORD32 u4_luma_dc_only_csbp = 0;
  420|   685k|        UWORD32 u4_temp = 0;
  421|   685k|        WORD16* pi2_dc_val = NULL;
  422|       |        /*
  423|       |         * Reserve the pointer to dc vals. The dc vals will be copied
  424|       |         * after unpacking of ac vals since memset to 0 inside.
  425|       |         */
  426|   685k|        if(intra_flag && (u1_mb_type != I_4x4_MB))
  ------------------
  |  |  417|   110k|#define I_4x4_MB    0
  ------------------
  |  Branch (426:12): [True: 110k, False: 574k]
  |  Branch (426:26): [True: 91.7k, False: 18.6k]
  ------------------
  427|  91.7k|        {
  428|  91.7k|            if(CHECKBIT(ps_cur_mb_info->u1_yuv_dc_block_flag,0))
  ------------------
  |  |   54|  91.7k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 38.8k, False: 52.8k]
  |  |  ------------------
  ------------------
  429|  38.8k|            {
  430|  38.8k|                pi2_dc_val = (WORD16 *)ps_dec->pv_proc_tu_coeff_data;
  431|       |
  432|  38.8k|                ps_dec->pv_proc_tu_coeff_data = (void *)(pi2_dc_val + 16);
  433|  38.8k|            }
  434|  91.7k|        }
  435|       |
  436|   685k|        if(ui2_luma_csbp)
  ------------------
  |  Branch (436:12): [True: 68.2k, False: 617k]
  ------------------
  437|  68.2k|        {
  438|  68.2k|            pi2_coeff_data = ps_dec->pi2_coeff_data;
  439|  68.2k|            u4_temp = ih264d_unpack_coeff4x4_8x8blk(ps_dec,
  440|  68.2k|                                          ps_cur_mb_info,
  441|  68.2k|                                          ui2_luma_csbp,
  442|  68.2k|                                          pi2_coeff_data);
  443|  68.2k|            u4_luma_dc_only_csbp = u4_temp;
  444|       |
  445|  68.2k|            pi2_coeff_data += 32;
  446|       |
  447|  68.2k|            ui2_luma_csbp = ui2_luma_csbp >> 2;
  448|  68.2k|            u4_temp = ih264d_unpack_coeff4x4_8x8blk(ps_dec,
  449|  68.2k|                                          ps_cur_mb_info,
  450|  68.2k|                                          ui2_luma_csbp,
  451|  68.2k|                                          pi2_coeff_data);
  452|       |
  453|  68.2k|            u4_luma_dc_only_csbp |= (u4_temp << 2);
  454|       |
  455|  68.2k|            pi2_coeff_data += 32 + 64;
  456|       |
  457|  68.2k|            ui2_luma_csbp = ui2_luma_csbp >> 6;
  458|  68.2k|            u4_temp = ih264d_unpack_coeff4x4_8x8blk(ps_dec,
  459|  68.2k|                                          ps_cur_mb_info,
  460|  68.2k|                                          ui2_luma_csbp,
  461|  68.2k|                                          pi2_coeff_data);
  462|       |
  463|  68.2k|            u4_luma_dc_only_csbp |= (u4_temp << 8);
  464|       |
  465|  68.2k|            pi2_coeff_data += 32;
  466|       |
  467|  68.2k|            ui2_luma_csbp = ui2_luma_csbp >> 2;
  468|  68.2k|            u4_temp = ih264d_unpack_coeff4x4_8x8blk(ps_dec,
  469|  68.2k|                                          ps_cur_mb_info,
  470|  68.2k|                                          ui2_luma_csbp,
  471|  68.2k|                                          pi2_coeff_data);
  472|  68.2k|            u4_luma_dc_only_csbp |= (u4_temp << 10);
  473|  68.2k|        }
  474|       |
  475|   685k|        if(pi2_dc_val != NULL)
  ------------------
  |  Branch (475:12): [True: 38.8k, False: 646k]
  ------------------
  476|  38.8k|        {
  477|  38.8k|            WORD32 i;
  478|  38.8k|            pi2_coeff_data = ps_dec->pi2_coeff_data;
  479|   194k|            for(i = 0; i < 4; i++)
  ------------------
  |  Branch (479:24): [True: 155k, False: 38.8k]
  ------------------
  480|   155k|            {
  481|   155k|                pi2_coeff_data[0] = pi2_dc_val[0];
  482|   155k|                pi2_coeff_data[4 * 16] = pi2_dc_val[4];
  483|   155k|                pi2_coeff_data[8 * 16] = pi2_dc_val[8];
  484|   155k|                pi2_coeff_data[12 * 16] = pi2_dc_val[12];
  485|       |
  486|   155k|                pi2_dc_val++; /* Point to next column */
  487|   155k|                pi2_coeff_data += 16;
  488|   155k|            }
  489|  38.8k|            u4_luma_dc_only_csbp = ps_cur_mb_info->u2_luma_csbp ^ 0xFFFF;
  490|  38.8k|        }
  491|   685k|        return u4_luma_dc_only_csbp;
  492|   685k|    }
  493|  18.2k|    else
  494|  18.2k|    {
  495|  18.2k|        UWORD32 u4_luma_dc_only_cbp = 0;
  496|  18.2k|        WORD32 dc_only_flag;
  497|  18.2k|        if(ui2_luma_csbp)
  ------------------
  |  Branch (497:12): [True: 13.1k, False: 5.05k]
  ------------------
  498|  13.1k|        {
  499|  13.1k|            pi2_coeff_data = ps_dec->pi2_coeff_data;
  500|  13.1k|            dc_only_flag = ih264d_unpack_coeff8x8_8x8blk_cavlc(ps_dec,
  501|  13.1k|                                          ps_cur_mb_info,
  502|  13.1k|                                          ui2_luma_csbp,
  503|  13.1k|                                          pi2_coeff_data);
  504|  13.1k|            INSERT_BIT(u4_luma_dc_only_cbp, 0, dc_only_flag);
  ------------------
  |  |  109|  13.1k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  13.1k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  505|       |
  506|  13.1k|            pi2_coeff_data += 64;
  507|       |
  508|  13.1k|            ui2_luma_csbp = ui2_luma_csbp >> 2;
  509|  13.1k|            dc_only_flag = ih264d_unpack_coeff8x8_8x8blk_cavlc(ps_dec,
  510|  13.1k|                                          ps_cur_mb_info,
  511|  13.1k|                                          ui2_luma_csbp,
  512|  13.1k|                                          pi2_coeff_data);
  513|       |
  514|  13.1k|            INSERT_BIT(u4_luma_dc_only_cbp, 1, dc_only_flag);
  ------------------
  |  |  109|  13.1k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  13.1k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  515|       |
  516|  13.1k|            pi2_coeff_data += 64;
  517|       |
  518|  13.1k|            ui2_luma_csbp = ui2_luma_csbp >> 6;
  519|  13.1k|            dc_only_flag = ih264d_unpack_coeff8x8_8x8blk_cavlc(ps_dec,
  520|  13.1k|                                          ps_cur_mb_info,
  521|  13.1k|                                          ui2_luma_csbp,
  522|  13.1k|                                          pi2_coeff_data);
  523|       |
  524|  13.1k|            INSERT_BIT(u4_luma_dc_only_cbp, 2, dc_only_flag);
  ------------------
  |  |  109|  13.1k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  13.1k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  525|       |
  526|  13.1k|            pi2_coeff_data += 64;
  527|  13.1k|            ui2_luma_csbp = ui2_luma_csbp >> 2;
  528|  13.1k|            dc_only_flag = ih264d_unpack_coeff8x8_8x8blk_cavlc(ps_dec,
  529|  13.1k|                                          ps_cur_mb_info,
  530|  13.1k|                                          ui2_luma_csbp,
  531|  13.1k|                                          pi2_coeff_data);
  532|  13.1k|            INSERT_BIT(u4_luma_dc_only_cbp, 3, dc_only_flag);
  ------------------
  |  |  109|  13.1k|#define INSERT_BIT(x, pos, bit) { RESET_BIT(x, pos); (x) = (x) | (bit << pos); }
  |  |  ------------------
  |  |  |  |  105|  13.1k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  |  |  ------------------
  ------------------
  533|  13.1k|        }
  534|  18.2k|        return u4_luma_dc_only_cbp;
  535|  18.2k|    }
  536|       |
  537|   703k|}
ih264d_unpack_chroma_coeff4x4_mb:
  541|   753k|{
  542|   753k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  543|   753k|    UWORD16 ui2_chroma_csbp = ps_cur_mb_info->u2_chroma_csbp;
  544|   753k|    UWORD8 *pu1_inv_scan = ps_dec->pu1_inv_scan;
  545|   753k|    WORD16 *pi2_coeff_data = ps_dec->pi2_coeff_data;
  546|   753k|    WORD32 i;
  547|   753k|    WORD16 *pi2_dc_val_u = NULL;
  548|   753k|    WORD16 *pi2_dc_val_v = NULL;
  549|       |
  550|   753k|    PROFILE_DISABLE_UNPACK_CHROMA()
  ------------------
  |  |  113|   753k|#define PROFILE_DISABLE_UNPACK_CHROMA() ;
  ------------------
  551|   753k|    if((ps_cur_mb_info->u1_cbp >> 4) == CBPC_ALLZERO)
  ------------------
  |  |  507|   753k|#define CBPC_ALLZERO    0
  ------------------
  |  Branch (551:8): [True: 658k, False: 95.3k]
  ------------------
  552|   658k|        return;
  553|       |
  554|       |    /*
  555|       |     * Reserve the pointers to dc vals. The dc vals will be copied
  556|       |     * after unpacking of ac vals since memset to 0 inside.
  557|       |     */
  558|  95.3k|    if(CHECKBIT(ps_cur_mb_info->u1_yuv_dc_block_flag,1))
  ------------------
  |  |   54|  95.3k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 65.6k, False: 29.7k]
  |  |  ------------------
  ------------------
  559|  65.6k|    {
  560|  65.6k|        pi2_dc_val_u = (WORD16 *)ps_dec->pv_proc_tu_coeff_data;
  561|       |
  562|  65.6k|        ps_dec->pv_proc_tu_coeff_data = (void *)(pi2_dc_val_u + 4);
  563|  65.6k|    }
  564|  95.3k|    if(CHECKBIT(ps_cur_mb_info->u1_yuv_dc_block_flag,2))
  ------------------
  |  |   54|  95.3k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 62.5k, False: 32.7k]
  |  |  ------------------
  ------------------
  565|  62.5k|    {
  566|  62.5k|        pi2_dc_val_v = (WORD16 *)ps_dec->pv_proc_tu_coeff_data;
  567|       |
  568|  62.5k|        ps_dec->pv_proc_tu_coeff_data = (void *)(pi2_dc_val_v + 4);
  569|  62.5k|    }
  570|       |
  571|  95.3k|    if((ps_cur_mb_info->u1_cbp >> 4) == CBPC_NONZERO)
  ------------------
  |  |  509|  95.3k|#define CBPC_NONZERO    2
  ------------------
  |  Branch (571:8): [True: 32.7k, False: 62.6k]
  ------------------
  572|  32.7k|    {
  573|  32.7k|        pi2_coeff_data = ps_dec->pi2_coeff_data;
  574|  32.7k|        ih264d_unpack_coeff4x4_8x8blk_chroma(ps_dec,
  575|  32.7k|                                             ps_cur_mb_info,
  576|  32.7k|                                             ui2_chroma_csbp,
  577|  32.7k|                                             pi2_coeff_data);
  578|       |
  579|  32.7k|        pi2_coeff_data += 64;
  580|  32.7k|        ui2_chroma_csbp = ui2_chroma_csbp >> 4;
  581|  32.7k|        ih264d_unpack_coeff4x4_8x8blk_chroma(ps_dec,
  582|  32.7k|                                             ps_cur_mb_info,
  583|  32.7k|                                             ui2_chroma_csbp,
  584|  32.7k|                                             pi2_coeff_data);
  585|       |
  586|  32.7k|    }
  587|       |
  588|  95.3k|    pi2_coeff_data = ps_dec->pi2_coeff_data;
  589|  95.3k|    if(pi2_dc_val_u != NULL)
  ------------------
  |  Branch (589:8): [True: 65.6k, False: 29.7k]
  ------------------
  590|  65.6k|    {
  591|  65.6k|        pi2_coeff_data[0] = *pi2_dc_val_u++;
  592|  65.6k|        pi2_coeff_data[1 * 16] = *pi2_dc_val_u++;
  593|  65.6k|        pi2_coeff_data[2 * 16] = *pi2_dc_val_u++;
  594|  65.6k|        pi2_coeff_data[3 * 16] = *pi2_dc_val_u++;
  595|  65.6k|    }
  596|  29.7k|    else
  597|  29.7k|    {
  598|  29.7k|        pi2_coeff_data[0] = 0;
  599|  29.7k|        pi2_coeff_data[1 * 16] = 0;
  600|  29.7k|        pi2_coeff_data[2 * 16] = 0;
  601|  29.7k|        pi2_coeff_data[3 * 16] = 0;
  602|  29.7k|    }
  603|  95.3k|    pi2_coeff_data += 64;
  604|  95.3k|    if(pi2_dc_val_v != NULL)
  ------------------
  |  Branch (604:8): [True: 62.5k, False: 32.7k]
  ------------------
  605|  62.5k|    {
  606|  62.5k|        pi2_coeff_data[0] = *pi2_dc_val_v++;
  607|  62.5k|        pi2_coeff_data[1 * 16] = *pi2_dc_val_v++;
  608|  62.5k|        pi2_coeff_data[2 * 16] = *pi2_dc_val_v++;
  609|  62.5k|        pi2_coeff_data[3 * 16] = *pi2_dc_val_v++;
  610|  62.5k|    }
  611|  32.7k|    else
  612|  32.7k|    {
  613|  32.7k|        pi2_coeff_data[0] = 0;
  614|  32.7k|        pi2_coeff_data[1 * 16] = 0;
  615|  32.7k|        pi2_coeff_data[2 * 16] = 0;
  616|  32.7k|        pi2_coeff_data[3 * 16] = 0;
  617|  32.7k|    }
  618|  95.3k|}
ih264d_unpack_luma_coeff8x8_mb:
  621|  50.0k|{
  622|  50.0k|    WORD32 blk_8x8_cnt;
  623|  50.0k|    WORD16 *pi2_out_coeff_data = ps_dec->pi2_coeff_data;
  624|  50.0k|    UWORD8 u1_field_coding_flag = ps_cur_mb_info->ps_curmb->u1_mb_fld;
  625|  50.0k|    UWORD8 *pu1_inv_scan;
  626|  50.0k|    UWORD32 u4_luma_dc_only_cbp = 0;
  627|       |
  628|  50.0k|    PROFILE_DISABLE_UNPACK_LUMA()
  ------------------
  |  |  112|  50.0k|#define PROFILE_DISABLE_UNPACK_LUMA() ;
  ------------------
  629|  50.0k|    if(!u1_field_coding_flag)
  ------------------
  |  Branch (629:8): [True: 50.0k, False: 0]
  ------------------
  630|  50.0k|    {
  631|       |        /*******************************************************************/
  632|       |        /* initializing inverse scan  matrices                             */
  633|       |        /*******************************************************************/
  634|  50.0k|        pu1_inv_scan = (UWORD8 *)gau1_ih264d_inv_scan_prog8x8_cabac;
  635|  50.0k|    }
  636|      0|    else
  637|      0|    {
  638|       |        /*******************************************************************/
  639|       |        /* initializing inverse scan  matrices                             */
  640|       |        /*******************************************************************/
  641|      0|        pu1_inv_scan = (UWORD8 *)gau1_ih264d_inv_scan_int8x8_cabac;
  642|      0|    }
  643|       |
  644|   250k|    for(blk_8x8_cnt = 0; blk_8x8_cnt < 4; blk_8x8_cnt++)
  ------------------
  |  Branch (644:26): [True: 200k, False: 50.0k]
  ------------------
  645|   200k|    {
  646|   200k|        if(CHECKBIT(ps_cur_mb_info->u1_cbp, blk_8x8_cnt))
  ------------------
  |  |   54|   200k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 123k, False: 76.4k]
  |  |  ------------------
  ------------------
  647|   123k|        {
  648|   123k|            tu_blk8x8_coeff_data_t *ps_tu_8x8 = (tu_blk8x8_coeff_data_t *)ps_dec->pv_proc_tu_coeff_data;
  649|   123k|            UWORD32 u4_sig_coeff_map;
  650|   123k|            WORD32 idx = 0;
  651|   123k|            WORD16 *pi2_coeff_data = &ps_tu_8x8->ai2_level[0];
  652|   123k|            WORD32 num_coeff = 0;
  653|       |
  654|       |            /* memset 64 coefficient to zero */
  655|   123k|            memset(pi2_out_coeff_data,0,64*sizeof(WORD16));
  656|       |
  657|   123k|            u4_sig_coeff_map = ps_tu_8x8->au4_sig_coeff_map[1];
  658|       |
  659|   180k|            while(u4_sig_coeff_map)
  ------------------
  |  Branch (659:19): [True: 56.2k, False: 123k]
  ------------------
  660|  56.2k|            {
  661|  56.2k|                idx = CLZ(u4_sig_coeff_map);
  662|       |
  663|  56.2k|                idx = 31 - idx;
  664|  56.2k|                RESET_BIT(u4_sig_coeff_map,idx);
  ------------------
  |  |  105|  56.2k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  ------------------
  665|       |
  666|  56.2k|                idx = pu1_inv_scan[idx + 32];
  667|  56.2k|                pi2_out_coeff_data[idx] = *pi2_coeff_data++;
  668|  56.2k|                num_coeff++;
  669|  56.2k|            }
  670|       |
  671|   123k|            u4_sig_coeff_map = ps_tu_8x8->au4_sig_coeff_map[0];
  672|   402k|            while(u4_sig_coeff_map)
  ------------------
  |  Branch (672:19): [True: 278k, False: 123k]
  ------------------
  673|   278k|            {
  674|   278k|                idx = CLZ(u4_sig_coeff_map);
  675|       |
  676|   278k|                idx = 31 - idx;
  677|   278k|                RESET_BIT(u4_sig_coeff_map,idx);
  ------------------
  |  |  105|   278k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  ------------------
  678|       |
  679|   278k|                idx = pu1_inv_scan[idx];
  680|   278k|                pi2_out_coeff_data[idx] = *pi2_coeff_data++;
  681|   278k|                num_coeff++;
  682|   278k|            }
  683|       |
  684|   123k|            if((num_coeff == 1) && (idx == 0))
  ------------------
  |  Branch (684:16): [True: 49.3k, False: 74.4k]
  |  Branch (684:36): [True: 28.0k, False: 21.2k]
  ------------------
  685|  28.0k|            {
  686|  28.0k|                SET_BIT(u4_luma_dc_only_cbp,blk_8x8_cnt);
  ------------------
  |  |  106|  28.0k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  687|  28.0k|            }
  688|       |
  689|       |
  690|   123k|            {
  691|   123k|                WORD32 offset;
  692|   123k|                offset = (UWORD8 *)pi2_coeff_data - (UWORD8 *)ps_tu_8x8;
  693|   123k|                offset = ALIGN4(offset);
  ------------------
  |  |   52|   123k|#define ALIGN4(x)   ((((x) + 3) >> 2) << 2)
  ------------------
  694|   123k|                ps_dec->pv_proc_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_proc_tu_coeff_data + offset);
  695|   123k|            }
  696|   123k|        }
  697|   200k|        pi2_out_coeff_data += 64;
  698|   200k|    }
  699|       |
  700|  50.0k|    return u4_luma_dc_only_cbp;
  701|  50.0k|}
ih264d_process_intra_mb:
  719|   147k|{
  720|   147k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  721|   147k|    UWORD8 uc_temp = ps_cur_mb_info->u1_mb_ngbr_availablity;
  722|   147k|    UWORD8 u1_top_available = BOOLEAN(uc_temp & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|   147k|#define BOOLEAN(x) (!!(x))
  ------------------
  723|   147k|    UWORD8 u1_left_available = BOOLEAN(uc_temp & LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|   147k|#define BOOLEAN(x) (!!(x))
  ------------------
  724|   147k|    UWORD8 u1_use_top_right_mb = BOOLEAN(uc_temp & TOP_RIGHT_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|   147k|#define BOOLEAN(x) (!!(x))
  ------------------
  725|   147k|    UWORD8 u1_use_top_left_mb = BOOLEAN(uc_temp & TOP_LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|   147k|#define BOOLEAN(x) (!!(x))
  ------------------
  726|   147k|    UWORD8 uc_useTopMB = u1_top_available;
  727|   147k|    UWORD16 u2_use_left_mb = u1_left_available;
  728|   147k|    UWORD16 u2_use_left_mb_pack;
  729|   147k|    UWORD8 *pu1_luma_pred_buffer;
  730|       |    /* CHANGED CODE */
  731|   147k|    UWORD8 *pu1_luma_rec_buffer;
  732|   147k|    UWORD8 *puc_top;
  733|       |
  734|   147k|    mb_neigbour_params_t *ps_left_mb;
  735|   147k|    mb_neigbour_params_t *ps_top_mb;
  736|   147k|    mb_neigbour_params_t *ps_top_right_mb;
  737|   147k|    mb_neigbour_params_t *ps_curmb;
  738|       |
  739|   147k|    UWORD16 u2_mbx = ps_cur_mb_info->u2_mbx;
  740|   147k|    UWORD32 ui_pred_width, ui_rec_width;
  741|   147k|    WORD16 *pi2_y_coeff;
  742|   147k|    UWORD8 u1_mbaff, u1_topmb, u1_mb_field_decoding_flag;
  743|   147k|    UWORD32 u4_num_pmbair;
  744|   147k|    UWORD16 ui2_luma_csbp = ps_cur_mb_info->u2_luma_csbp;
  745|   147k|    UWORD8 *pu1_yleft, *pu1_ytop_left;
  746|       |    /* Chroma variables*/
  747|   147k|    UWORD8 *pu1_top_u;
  748|   147k|    UWORD8 *pu1_uleft;
  749|   147k|    UWORD8 *pu1_u_top_left;
  750|       |    /* CHANGED CODE */
  751|   147k|    UWORD8 *pu1_mb_cb_rei1_buffer, *pu1_mb_cr_rei1_buffer;
  752|   147k|    UWORD32 u4_recwidth_cr;
  753|       |    /* CHANGED CODE */
  754|   147k|    tfr_ctxt_t *ps_frame_buf = ps_dec->ps_frame_buf_ip_recon;
  755|   147k|    UWORD32 u4_luma_dc_only_csbp = 0;
  756|   147k|    UWORD32 u4_luma_dc_only_cbp = 0;
  757|       |
  758|   147k|    UWORD8 *pu1_prev_intra4x4_pred_mode_data = (UWORD8 *)ps_dec->pv_proc_tu_coeff_data;                 //Pointer to keep track of intra4x4_pred_mode data in pv_proc_tu_coeff_data buffer
  759|   147k|    u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  760|   147k|    u1_topmb = ps_cur_mb_info->u1_topmb;
  761|   147k|    u4_num_pmbair = (u4_mb_num >> u1_mbaff);
  762|       |
  763|       |
  764|       |    /*--------------------------------------------------------------------*/
  765|       |    /* Find the current MB's mb params                                    */
  766|       |    /*--------------------------------------------------------------------*/
  767|   147k|    u1_mb_field_decoding_flag = ps_cur_mb_info->u1_mb_field_decodingflag;
  768|       |
  769|   147k|    ps_curmb = ps_cur_mb_info->ps_curmb;
  770|   147k|    ps_top_mb = ps_cur_mb_info->ps_top_mb;
  771|   147k|    ps_left_mb = ps_cur_mb_info->ps_left_mb;
  772|   147k|    ps_top_right_mb = ps_cur_mb_info->ps_top_right_mb;
  773|       |
  774|       |    /*--------------------------------------------------------------------*/
  775|       |    /* Check whether neighbouring MB is Inter MB and                      */
  776|       |    /* constrained intra pred is 1.                                       */
  777|       |    /*--------------------------------------------------------------------*/
  778|   147k|    u2_use_left_mb_pack = (u2_use_left_mb << 8) + u2_use_left_mb;
  779|       |
  780|   147k|    if(ps_dec->ps_cur_pps->u1_constrained_intra_pred_flag)
  ------------------
  |  Branch (780:8): [True: 42.8k, False: 104k]
  ------------------
  781|  42.8k|    {
  782|  42.8k|        UWORD8 u1_left = (UWORD8)u2_use_left_mb;
  783|       |
  784|  42.8k|        uc_useTopMB = uc_useTopMB
  ------------------
  |  Branch (784:23): [True: 34.8k, False: 8.05k]
  ------------------
  785|  34.8k|                        && ((ps_top_mb->u1_mb_type != P_MB)
  ------------------
  |  |  419|  34.8k|#define P_MB        2
  ------------------
  |  Branch (785:29): [True: 23.9k, False: 10.8k]
  ------------------
  786|  23.9k|                                        && (ps_top_mb->u1_mb_type != B_MB));
  ------------------
  |  |  420|  23.9k|#define B_MB        3
  ------------------
  |  Branch (786:44): [True: 22.8k, False: 1.14k]
  ------------------
  787|  42.8k|        u2_use_left_mb = u2_use_left_mb
  ------------------
  |  Branch (787:26): [True: 28.6k, False: 14.2k]
  ------------------
  788|  28.6k|                        && ((ps_left_mb->u1_mb_type != P_MB)
  ------------------
  |  |  419|  28.6k|#define P_MB        2
  ------------------
  |  Branch (788:29): [True: 20.5k, False: 8.02k]
  ------------------
  789|  20.5k|                                        && (ps_left_mb->u1_mb_type != B_MB));
  ------------------
  |  |  420|  20.5k|#define B_MB        3
  ------------------
  |  Branch (789:44): [True: 19.5k, False: 1.02k]
  ------------------
  790|       |
  791|  42.8k|        u2_use_left_mb_pack = (u2_use_left_mb << 8) + u2_use_left_mb;
  792|  42.8k|        if(u1_mbaff)
  ------------------
  |  Branch (792:12): [True: 0, False: 42.8k]
  ------------------
  793|      0|        {
  794|      0|            if(u1_mb_field_decoding_flag ^ ps_left_mb->u1_mb_fld)
  ------------------
  |  Branch (794:16): [True: 0, False: 0]
  ------------------
  795|      0|            {
  796|      0|                u1_left = u1_left
  ------------------
  |  Branch (796:27): [True: 0, False: 0]
  ------------------
  797|      0|                                && (((ps_left_mb + 1)->u1_mb_type != P_MB)
  ------------------
  |  |  419|      0|#define P_MB        2
  ------------------
  |  Branch (797:37): [True: 0, False: 0]
  ------------------
  798|      0|                                                && ((ps_left_mb + 1)->u1_mb_type
  ------------------
  |  Branch (798:52): [True: 0, False: 0]
  ------------------
  799|      0|                                                                != B_MB));
  ------------------
  |  |  420|      0|#define B_MB        3
  ------------------
  800|      0|                u2_use_left_mb = u2_use_left_mb && u1_left;
  ------------------
  |  Branch (800:34): [True: 0, False: 0]
  |  Branch (800:52): [True: 0, False: 0]
  ------------------
  801|      0|                if(u1_mb_field_decoding_flag)
  ------------------
  |  Branch (801:20): [True: 0, False: 0]
  ------------------
  802|      0|                    u2_use_left_mb_pack = (u1_left << 8)
  803|      0|                                    + (u2_use_left_mb_pack & 0xff);
  804|      0|                else
  805|      0|                    u2_use_left_mb_pack = (u2_use_left_mb << 8)
  806|      0|                                    + (u2_use_left_mb);
  807|      0|            }
  808|      0|        }
  809|  42.8k|        u1_use_top_right_mb =
  810|  42.8k|                        u1_use_top_right_mb
  ------------------
  |  Branch (810:25): [True: 24.9k, False: 17.9k]
  ------------------
  811|  24.9k|                                        && ((ps_top_right_mb->u1_mb_type != P_MB)
  ------------------
  |  |  419|  24.9k|#define P_MB        2
  ------------------
  |  Branch (811:45): [True: 20.1k, False: 4.76k]
  ------------------
  812|  20.1k|                                                        && (ps_top_right_mb->u1_mb_type
  ------------------
  |  Branch (812:60): [True: 19.3k, False: 782]
  ------------------
  813|  20.1k|                                                                        != B_MB));
  ------------------
  |  |  420|  20.1k|#define B_MB        3
  ------------------
  814|       |
  815|  42.8k|        u1_use_top_left_mb =
  816|  42.8k|                        u1_use_top_left_mb
  ------------------
  |  Branch (816:25): [True: 24.2k, False: 18.6k]
  ------------------
  817|  24.2k|                                        && ((ps_cur_mb_info->u1_topleft_mbtype != P_MB)
  ------------------
  |  |  419|  24.2k|#define P_MB        2
  ------------------
  |  Branch (817:45): [True: 19.8k, False: 4.41k]
  ------------------
  818|  19.8k|                                                        && (ps_cur_mb_info->u1_topleft_mbtype
  ------------------
  |  Branch (818:60): [True: 19.1k, False: 744]
  ------------------
  819|  19.8k|                                                                        != B_MB));
  ------------------
  |  |  420|  19.8k|#define B_MB        3
  ------------------
  820|  42.8k|    }
  821|       |
  822|       |    /*********************Common pointer calculations *************************/
  823|       |    /* CHANGED CODE */
  824|   147k|    pu1_luma_pred_buffer = ps_dec->pu1_y;
  825|   147k|    pu1_luma_rec_buffer = ps_frame_buf->pu1_dest_y + (u4_num_pmbair << 4);
  826|   147k|    pu1_mb_cb_rei1_buffer = ps_frame_buf->pu1_dest_u
  827|   147k|                    + (u4_num_pmbair << 3) * YUV420SP_FACTOR;
  ------------------
  |  |  119|   147k|#define YUV420SP_FACTOR 2
  ------------------
  828|   147k|    pu1_mb_cr_rei1_buffer = ps_frame_buf->pu1_dest_v + (u4_num_pmbair << 3);
  829|   147k|    ui_pred_width = MB_SIZE;
  ------------------
  |  |  554|   147k|#define MB_SIZE             16
  ------------------
  830|   147k|    ui_rec_width = ps_dec->u2_frm_wd_y << u1_mb_field_decoding_flag;
  831|   147k|    u4_recwidth_cr = ps_dec->u2_frm_wd_uv << u1_mb_field_decoding_flag;
  832|       |    /************* Current and top luma pointer *****************/
  833|       |
  834|   147k|    if(u1_mbaff)
  ------------------
  |  Branch (834:8): [True: 0, False: 147k]
  ------------------
  835|      0|    {
  836|      0|        if(u1_topmb == 0)
  ------------------
  |  Branch (836:12): [True: 0, False: 0]
  ------------------
  837|      0|        {
  838|      0|            pu1_luma_rec_buffer += (
  839|      0|                            u1_mb_field_decoding_flag ?
  ------------------
  |  Branch (839:29): [True: 0, False: 0]
  ------------------
  840|      0|                                            (ui_rec_width >> 1) :
  841|      0|                                            (ui_rec_width << 4));
  842|      0|            pu1_mb_cb_rei1_buffer += (
  843|      0|                            u1_mb_field_decoding_flag ?
  ------------------
  |  Branch (843:29): [True: 0, False: 0]
  ------------------
  844|      0|                                            (u4_recwidth_cr >> 1) :
  845|      0|                                            (u4_recwidth_cr << 3));
  846|      0|            pu1_mb_cr_rei1_buffer += (
  847|      0|                            u1_mb_field_decoding_flag ?
  ------------------
  |  Branch (847:29): [True: 0, False: 0]
  ------------------
  848|      0|                                            (u4_recwidth_cr >> 1) :
  849|      0|                                            (u4_recwidth_cr << 3));
  850|      0|        }
  851|      0|    }
  852|       |
  853|       |    /* CHANGED CODE */
  854|   147k|    if(ps_dec->u4_use_intrapred_line_copy == 1)
  ------------------
  |  Branch (854:8): [True: 147k, False: 0]
  ------------------
  855|   147k|    {
  856|   147k|        puc_top = ps_dec->pu1_prev_y_intra_pred_line + (ps_cur_mb_info->u2_mbx << 4);
  857|   147k|        pu1_top_u = ps_dec->pu1_prev_u_intra_pred_line
  858|   147k|                        + (ps_cur_mb_info->u2_mbx << 3) * YUV420SP_FACTOR;
  ------------------
  |  |  119|   147k|#define YUV420SP_FACTOR 2
  ------------------
  859|   147k|    }
  860|      0|    else
  861|      0|    {
  862|      0|        puc_top = pu1_luma_rec_buffer - ui_rec_width;
  863|      0|        pu1_top_u = pu1_mb_cb_rei1_buffer - u4_recwidth_cr;
  864|      0|    }
  865|       |    /* CHANGED CODE */
  866|       |
  867|       |    /************* Left pointer *****************/
  868|   147k|    pu1_yleft = pu1_luma_rec_buffer - 1;
  869|   147k|    pu1_uleft = pu1_mb_cb_rei1_buffer - 1 * YUV420SP_FACTOR;
  ------------------
  |  |  119|   147k|#define YUV420SP_FACTOR 2
  ------------------
  870|       |
  871|       |    /**************Top Left pointer calculation**********/
  872|   147k|    pu1_ytop_left = puc_top - 1;
  873|   147k|    pu1_u_top_left = pu1_top_u - 1 * YUV420SP_FACTOR;
  ------------------
  |  |  119|   147k|#define YUV420SP_FACTOR 2
  ------------------
  874|       |
  875|       |    /* CHANGED CODE */
  876|   147k|    PROFILE_DISABLE_INTRA_PRED()
  ------------------
  |  |  105|   147k|#define PROFILE_DISABLE_INTRA_PRED() ;
  ------------------
  877|   147k|    {
  878|   147k|        pu1_prev_intra4x4_pred_mode_data = (UWORD8 *)ps_dec->pv_proc_tu_coeff_data;
  879|   147k|        if(u1_mb_type == I_4x4_MB && ps_cur_mb_info->u1_tran_form8x8 == 0)
  ------------------
  |  |  417|   295k|#define I_4x4_MB    0
  ------------------
  |  Branch (879:12): [True: 55.9k, False: 91.7k]
  |  Branch (879:38): [True: 18.6k, False: 37.2k]
  ------------------
  880|  18.6k|        {
  881|  18.6k|            ps_dec->pv_proc_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_proc_tu_coeff_data + 32);
  882|       |
  883|  18.6k|        }
  884|   129k|        else if (u1_mb_type == I_4x4_MB && ps_cur_mb_info->u1_tran_form8x8 == 1)
  ------------------
  |  |  417|   258k|#define I_4x4_MB    0
  ------------------
  |  Branch (884:18): [True: 37.2k, False: 91.7k]
  |  Branch (884:44): [True: 37.2k, False: 0]
  ------------------
  885|  37.2k|        {
  886|  37.2k|            ps_dec->pv_proc_tu_coeff_data = (void *)((UWORD8 *)ps_dec->pv_proc_tu_coeff_data + 8);
  887|  37.2k|        }
  888|   147k|    }
  889|   147k|    if(!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (889:8): [True: 110k, False: 37.3k]
  ------------------
  890|   110k|    {
  891|   110k|        u4_luma_dc_only_csbp = ih264d_unpack_luma_coeff4x4_mb(ps_dec,
  892|   110k|                                       ps_cur_mb_info,
  893|   110k|                                       1);
  894|   110k|    }
  895|  37.3k|    else
  896|  37.3k|    {
  897|  37.3k|        if(!ps_dec->ps_cur_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (897:12): [True: 12.1k, False: 25.1k]
  ------------------
  898|  12.1k|        {
  899|  12.1k|            u4_luma_dc_only_cbp = ih264d_unpack_luma_coeff4x4_mb(ps_dec,
  900|  12.1k|                                           ps_cur_mb_info,
  901|  12.1k|                                           1);
  902|  12.1k|        }
  903|  25.1k|        else
  904|  25.1k|        {
  905|  25.1k|            u4_luma_dc_only_cbp = ih264d_unpack_luma_coeff8x8_mb(ps_dec,
  906|  25.1k|                                           ps_cur_mb_info);
  907|  25.1k|        }
  908|  37.3k|    }
  909|       |
  910|   147k|    pi2_y_coeff = ps_dec->pi2_coeff_data;
  911|       |
  912|   147k|    if(u1_mb_type != I_4x4_MB)
  ------------------
  |  |  417|   147k|#define I_4x4_MB    0
  ------------------
  |  Branch (912:8): [True: 91.7k, False: 55.9k]
  ------------------
  913|  91.7k|    {
  914|  91.7k|        UWORD8 u1_intrapred_mode = MB_TYPE_TO_INTRA_16x16_MODE(u1_mb_type);
  ------------------
  |  |   45|  91.7k|#define MB_TYPE_TO_INTRA_16x16_MODE(x) ((x - 1) & 0x03)
  ------------------
  915|       |        /*--------------------------------------------------------------------*/
  916|       |        /* 16x16 IntraPrediction                                              */
  917|       |        /*--------------------------------------------------------------------*/
  918|  91.7k|        {
  919|  91.7k|            UWORD8 u1_packed_modes = (u1_top_available << 1)
  920|  91.7k|                            + u1_left_available;
  921|  91.7k|            UWORD8 u1_err_code =
  922|  91.7k|                            (u1_intrapred_mode & 1) ?
  ------------------
  |  Branch (922:29): [True: 35.2k, False: 56.5k]
  ------------------
  923|  35.2k|                                            u1_intrapred_mode :
  924|  91.7k|                                            (u1_intrapred_mode ^ 2);
  925|       |
  926|  91.7k|            if((u1_err_code & u1_packed_modes) ^ u1_err_code)
  ------------------
  |  Branch (926:16): [True: 13.0k, False: 78.7k]
  ------------------
  927|  13.0k|            {
  928|  13.0k|                u1_intrapred_mode = 0;
  929|  13.0k|                ps_dec->i4_error_code = ERROR_INTRAPRED;
  930|  13.0k|            }
  931|  91.7k|        }
  932|  91.7k|        {
  933|       |            /* Align the size to multiple of 8, so that SIMD functions
  934|       |               can read 64 bits at a time. Only 33 bytes are actaully used */
  935|  91.7k|            UWORD8 au1_ngbr_pels[40];
  936|       |            /* Get neighbour pixels */
  937|       |            /* left pels */
  938|  91.7k|            if(u2_use_left_mb)
  ------------------
  |  Branch (938:16): [True: 64.4k, False: 27.3k]
  ------------------
  939|  64.4k|            {
  940|  64.4k|                WORD32 i;
  941|  1.09M|                for(i = 0; i < 16; i++)
  ------------------
  |  Branch (941:28): [True: 1.03M, False: 64.4k]
  ------------------
  942|  1.03M|                    au1_ngbr_pels[16 - 1 - i] = pu1_yleft[i * ui_rec_width];
  943|  64.4k|            }
  944|  27.3k|            else
  945|  27.3k|            {
  946|  27.3k|                memset(au1_ngbr_pels, 0, 16);
  947|  27.3k|            }
  948|       |
  949|       |            /* top left pels */
  950|  91.7k|            au1_ngbr_pels[16] = *pu1_ytop_left;
  951|       |
  952|       |            /* top pels */
  953|  91.7k|            if(uc_useTopMB)
  ------------------
  |  Branch (953:16): [True: 66.6k, False: 25.1k]
  ------------------
  954|  66.6k|            {
  955|  66.6k|                memcpy(au1_ngbr_pels + 16 + 1, puc_top, 16);
  956|  66.6k|            }
  957|  25.1k|            else
  958|  25.1k|            {
  959|  25.1k|                memset(au1_ngbr_pels + 16 + 1, 0, 16);
  960|  25.1k|            }
  961|  91.7k|            PROFILE_DISABLE_INTRA_PRED()
  ------------------
  |  |  105|  91.7k|#define PROFILE_DISABLE_INTRA_PRED() ;
  ------------------
  962|  91.7k|            ps_dec->apf_intra_pred_luma_16x16[u1_intrapred_mode](
  963|  91.7k|                            au1_ngbr_pels, pu1_luma_rec_buffer, 1, ui_rec_width,
  964|  91.7k|                            ((uc_useTopMB << 2) | u2_use_left_mb));
  965|  91.7k|        }
  966|  91.7k|        {
  967|  91.7k|            UWORD32 i;
  968|  91.7k|            WORD16 ai2_tmp[16];
  969|  1.56M|            for(i = 0; i < 16; i++)
  ------------------
  |  Branch (969:24): [True: 1.46M, False: 91.7k]
  ------------------
  970|  1.46M|            {
  971|  1.46M|                WORD16 *pi2_level = pi2_y_coeff + (i << 4);
  972|  1.46M|                UWORD8 *pu1_pred_sblk = pu1_luma_rec_buffer
  973|  1.46M|                                + ((i & 0x3) * BLK_SIZE)
  ------------------
  |  |  556|  1.46M|#define BLK_SIZE             4
  ------------------
  974|  1.46M|                                + (i >> 2) * (ui_rec_width << 2);
  975|  1.46M|                PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  1.46M|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
  976|  1.46M|                {
  977|  1.46M|                    if(CHECKBIT(ps_cur_mb_info->u2_luma_csbp, i))
  ------------------
  |  |   54|  1.46M|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 13.2k, False: 1.45M]
  |  |  ------------------
  ------------------
  978|  13.2k|                    {
  979|  13.2k|                        ps_dec->pf_iquant_itrans_recon_luma_4x4(
  980|  13.2k|                                        pi2_level,
  981|  13.2k|                                        pu1_pred_sblk,
  982|  13.2k|                                        pu1_pred_sblk,
  983|  13.2k|                                        ui_rec_width,
  984|  13.2k|                                        ui_rec_width,
  985|  13.2k|                                        gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qp_rem6],
  986|  13.2k|                                        (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[0],
  987|  13.2k|                                        ps_cur_mb_info->u1_qp_div6, ai2_tmp, 1,
  988|  13.2k|                                        pi2_level);
  989|  13.2k|                    }
  990|  1.45M|                    else if((CHECKBIT(u4_luma_dc_only_csbp, i)) && pi2_level[0] != 0)
  ------------------
  |  |   54|  1.45M|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
  |  Branch (990:29): [True: 612k, False: 842k]
  |  Branch (990:68): [True: 560k, False: 51.8k]
  ------------------
  991|   560k|                    {
  992|   560k|                        ps_dec->pf_iquant_itrans_recon_luma_4x4_dc(
  993|   560k|                                        pi2_level,
  994|   560k|                                        pu1_pred_sblk,
  995|   560k|                                        pu1_pred_sblk,
  996|   560k|                                        ui_rec_width,
  997|   560k|                                        ui_rec_width,
  998|   560k|                                        gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qp_rem6],
  999|   560k|                                        (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[0],
 1000|   560k|                                        ps_cur_mb_info->u1_qp_div6, ai2_tmp, 1,
 1001|   560k|                                        pi2_level);
 1002|   560k|                    }
 1003|  1.46M|                }
 1004|  1.46M|            }
 1005|  91.7k|        }
 1006|  91.7k|    }
 1007|  55.9k|    else if(!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (1007:13): [True: 18.6k, False: 37.2k]
  ------------------
 1008|  18.6k|    {
 1009|  18.6k|        UWORD8 u1_is_left_sub_block, u1_is_top_sub_block = uc_useTopMB;
 1010|  18.6k|        UWORD8 u1_sub_blk_x, u1_sub_blk_y, u1_sub_mb_num;
 1011|  18.6k|        WORD8 i1_top_pred_mode;
 1012|  18.6k|        WORD8 i1_left_pred_mode;
 1013|  18.6k|        UWORD8 *pu1_top, *pu1_left, *pu1_top_left, *pu1_top_right;
 1014|  18.6k|        WORD8 *pi1_cur_pred_mode, *pi1_left_pred_mode, *pc_topPredMode;
 1015|  18.6k|        UWORD16 ui2_left_pred_buf_width = 0xffff;
 1016|  18.6k|        WORD8 i1_intra_pred;
 1017|  18.6k|        UWORD8 *pu1_prev_intra4x4_pred_mode_flag = pu1_prev_intra4x4_pred_mode_data;
 1018|  18.6k|        UWORD8 *pu1_rem_intra4x4_pred_mode = pu1_prev_intra4x4_pred_mode_data + 16;
 1019|  18.6k|        WORD16 *pi2_y_coeff1;
 1020|  18.6k|        UWORD8 u1_cur_sub_block;
 1021|  18.6k|        UWORD16 ui2_top_rt_mask;
 1022|       |
 1023|       |        /*--------------------------------------------------------------------*/
 1024|       |        /* 4x4 IntraPrediction                                                */
 1025|       |        /*--------------------------------------------------------------------*/
 1026|       |        /* Calculation of Top Right subblock mask                             */
 1027|       |        /*                                                                    */
 1028|       |        /* (a) Set it to default mask                                         */
 1029|       |        /*     [It has 0 for sublocks which will never have top-right sub block] */
 1030|       |        /*                                                                    */
 1031|       |        /* (b) If top MB is not available                                     */
 1032|       |        /*      Clear the bits of the first row sub blocks                    */
 1033|       |        /*                                                                    */
 1034|       |        /* (c) Set/Clear bit for top-right sublock of MB                      */
 1035|       |        /*      [5 sub-block in decoding order] based on TOP RIGHT MB availablity */
 1036|       |        /*--------------------------------------------------------------------*/
 1037|       |
 1038|  18.6k|        pu1_top = puc_top;
 1039|       |
 1040|  18.6k|        ui2_top_rt_mask = (u1_use_top_right_mb << 3) | (0x5750);
 1041|  18.6k|        if(uc_useTopMB)
  ------------------
  |  Branch (1041:12): [True: 12.4k, False: 6.15k]
  ------------------
 1042|  12.4k|            ui2_top_rt_mask |= 0x7;
 1043|       |
 1044|       |        /*Top Related initialisations*/
 1045|       |
 1046|       |
 1047|  18.6k|        pi1_cur_pred_mode = ps_cur_mb_info->ps_curmb->pi1_intrapredmodes;
 1048|  18.6k|        pc_topPredMode = ps_cur_mb_info->ps_top_mb->pi1_intrapredmodes;
 1049|       |        /*--------------------------------------
 1050|       |         if(u1_mbaff)
 1051|       |         {
 1052|       |
 1053|       |         pi1_cur_pred_mode += (u2_mbx << 2);
 1054|       |         pc_topPredMode = pi1_cur_pred_mode + ps_cur_mb_info->i1_offset;
 1055|       |         pi1_cur_pred_mode += (u1_topmb) ? 0: 4;
 1056|       |         }*/
 1057|       |
 1058|  18.6k|        if(u1_top_available)
  ------------------
  |  Branch (1058:12): [True: 13.5k, False: 5.03k]
  ------------------
 1059|  13.5k|        {
 1060|  13.5k|            if(ps_top_mb->u1_mb_type == I_4x4_MB)
  ------------------
  |  |  417|  13.5k|#define I_4x4_MB    0
  ------------------
  |  Branch (1060:16): [True: 10.3k, False: 3.27k]
  ------------------
 1061|  10.3k|                *(WORD32*)pi1_cur_pred_mode = *(WORD32*)pc_topPredMode;
 1062|  3.27k|            else
 1063|  3.27k|                *(WORD32*)pi1_cur_pred_mode =
 1064|  3.27k|                                (uc_useTopMB) ? DC_DC_DC_DC : NOT_VALID;
  ------------------
  |  |  434|  2.15k|#define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
  ------------------
                                              (uc_useTopMB) ? DC_DC_DC_DC : NOT_VALID;
  ------------------
  |  |  433|  1.11k|#define NOT_VALID -1
  ------------------
  |  Branch (1064:33): [True: 2.15k, False: 1.11k]
  ------------------
 1065|  13.5k|        }
 1066|  5.03k|        else
 1067|  5.03k|            *(WORD32*)pi1_cur_pred_mode = NOT_VALID;
  ------------------
  |  |  433|  5.03k|#define NOT_VALID -1
  ------------------
 1068|       |        /* CHANGED CODE */
 1069|       |
 1070|       |        /* CHANGED CODE */
 1071|       |
 1072|       |        /*Left Related initialisations*/
 1073|  18.6k|        pi1_left_pred_mode = ps_dec->pi1_left_pred_mode;
 1074|  18.6k|        if(!u1_mbaff)
  ------------------
  |  Branch (1074:12): [True: 18.6k, False: 0]
  ------------------
 1075|  18.6k|        {
 1076|       |
 1077|  18.6k|            if(u1_left_available)
  ------------------
  |  Branch (1077:16): [True: 11.6k, False: 6.96k]
  ------------------
 1078|  11.6k|            {
 1079|       |
 1080|  11.6k|                if(ps_left_mb->u1_mb_type != I_4x4_MB)
  ------------------
  |  |  417|  11.6k|#define I_4x4_MB    0
  ------------------
  |  Branch (1080:20): [True: 2.38k, False: 9.26k]
  ------------------
 1081|  2.38k|                    *(WORD32*)pi1_left_pred_mode =
 1082|  2.38k|                                    (u2_use_left_mb_pack) ?
  ------------------
  |  Branch (1082:37): [True: 1.61k, False: 774]
  ------------------
 1083|  1.61k|                                    DC_DC_DC_DC :
  ------------------
  |  |  434|  1.61k|#define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
  ------------------
 1084|  2.38k|                                                            NOT_VALID;
  ------------------
  |  |  433|    774|#define NOT_VALID -1
  ------------------
 1085|       |
 1086|  11.6k|            }
 1087|  6.96k|            else
 1088|  6.96k|            {
 1089|       |
 1090|  6.96k|                *(WORD32*)pi1_left_pred_mode = NOT_VALID;
  ------------------
  |  |  433|  6.96k|#define NOT_VALID -1
  ------------------
 1091|  6.96k|            }
 1092|       |
 1093|  18.6k|        }
 1094|      0|        else
 1095|      0|        {
 1096|      0|            UWORD8 u1_curMbfld = ps_cur_mb_info->u1_mb_field_decodingflag;
 1097|      0|            UWORD8 u1_leftMbfld = ps_left_mb->u1_mb_fld;
 1098|       |
 1099|      0|            if(u1_curMbfld ^ u1_leftMbfld)
  ------------------
  |  Branch (1099:16): [True: 0, False: 0]
  ------------------
 1100|      0|            {
 1101|       |
 1102|      0|                if(u1_topmb
  ------------------
  |  Branch (1102:20): [True: 0, False: 0]
  ------------------
 1103|      0|                                | ((u1_topmb == 0)
  ------------------
  |  Branch (1103:36): [True: 0, False: 0]
  ------------------
 1104|      0|                                                && ((ps_curmb - 1)->u1_mb_type
  ------------------
  |  Branch (1104:52): [True: 0, False: 0]
  ------------------
 1105|      0|                                                                != I_4x4_MB)))
  ------------------
  |  |  417|      0|#define I_4x4_MB    0
  ------------------
 1106|      0|                {
 1107|      0|                    if(u1_left_available)
  ------------------
  |  Branch (1107:24): [True: 0, False: 0]
  ------------------
 1108|      0|                    {
 1109|      0|                        if(ps_left_mb->u1_mb_type != I_4x4_MB)
  ------------------
  |  |  417|      0|#define I_4x4_MB    0
  ------------------
  |  Branch (1109:28): [True: 0, False: 0]
  ------------------
 1110|      0|                        {
 1111|      0|                            if(CHECKBIT(u2_use_left_mb_pack,0) == 0)
  ------------------
  |  |   54|      0|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
  |  Branch (1111:32): [True: 0, False: 0]
  ------------------
 1112|      0|                                *(WORD32*)pi1_left_pred_mode = NOT_VALID;
  ------------------
  |  |  433|      0|#define NOT_VALID -1
  ------------------
 1113|      0|                            else
 1114|      0|                                *(WORD32*)pi1_left_pred_mode = DC_DC_DC_DC;
  ------------------
  |  |  434|      0|#define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
  ------------------
 1115|      0|                        }
 1116|      0|                    }
 1117|      0|                    else
 1118|      0|                        *(WORD32*)pi1_left_pred_mode = NOT_VALID;
  ------------------
  |  |  433|      0|#define NOT_VALID -1
  ------------------
 1119|       |
 1120|      0|                    if(u1_curMbfld)
  ------------------
  |  Branch (1120:24): [True: 0, False: 0]
  ------------------
 1121|      0|                    {
 1122|      0|                        if(u1_left_available)
  ------------------
  |  Branch (1122:28): [True: 0, False: 0]
  ------------------
 1123|      0|                        {
 1124|      0|                            if((ps_left_mb + 1)->u1_mb_type != I_4x4_MB)
  ------------------
  |  |  417|      0|#define I_4x4_MB    0
  ------------------
  |  Branch (1124:32): [True: 0, False: 0]
  ------------------
 1125|      0|                            {
 1126|      0|                                if(u2_use_left_mb_pack >> 8)
  ------------------
  |  Branch (1126:36): [True: 0, False: 0]
  ------------------
 1127|      0|                                    *(WORD32*)(pi1_left_pred_mode + 4) =
 1128|      0|                                                    DC_DC_DC_DC;
  ------------------
  |  |  434|      0|#define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
  ------------------
 1129|      0|                                else
 1130|      0|                                    *(WORD32*)(pi1_left_pred_mode + 4) =
 1131|      0|                                                    NOT_VALID;
  ------------------
  |  |  433|      0|#define NOT_VALID -1
  ------------------
 1132|      0|                            }
 1133|      0|                        }
 1134|      0|                        else
 1135|      0|                            *(WORD32*)(pi1_left_pred_mode + 4) = NOT_VALID;
  ------------------
  |  |  433|      0|#define NOT_VALID -1
  ------------------
 1136|      0|                        pi1_left_pred_mode[1] = pi1_left_pred_mode[2];
 1137|      0|                        pi1_left_pred_mode[2] = pi1_left_pred_mode[4];
 1138|      0|                        pi1_left_pred_mode[3] = pi1_left_pred_mode[6];
 1139|      0|                        *(WORD32*)(pi1_left_pred_mode + 4) =
 1140|      0|                                        *(WORD32*)pi1_left_pred_mode;
 1141|      0|                    }
 1142|      0|                    else
 1143|      0|                    {
 1144|       |
 1145|      0|                        pi1_left_pred_mode[7] = pi1_left_pred_mode[3];
 1146|      0|                        pi1_left_pred_mode[6] = pi1_left_pred_mode[3];
 1147|      0|                        pi1_left_pred_mode[5] = pi1_left_pred_mode[2];
 1148|      0|                        pi1_left_pred_mode[4] = pi1_left_pred_mode[2];
 1149|      0|                        pi1_left_pred_mode[3] = pi1_left_pred_mode[1];
 1150|      0|                        pi1_left_pred_mode[2] = pi1_left_pred_mode[1];
 1151|      0|                        pi1_left_pred_mode[1] = pi1_left_pred_mode[0];
 1152|      0|                    }
 1153|      0|                }
 1154|      0|                pi1_left_pred_mode += (u1_topmb) ? 0 : 4;
  ------------------
  |  Branch (1154:39): [True: 0, False: 0]
  ------------------
 1155|      0|            }
 1156|      0|            else
 1157|      0|            {
 1158|       |
 1159|      0|                pi1_left_pred_mode += (u1_topmb) ? 0 : 4;
  ------------------
  |  Branch (1159:39): [True: 0, False: 0]
  ------------------
 1160|      0|                if(u1_left_available)
  ------------------
  |  Branch (1160:20): [True: 0, False: 0]
  ------------------
 1161|      0|                {
 1162|       |
 1163|      0|                    if(ps_left_mb->u1_mb_type != I_4x4_MB)
  ------------------
  |  |  417|      0|#define I_4x4_MB    0
  ------------------
  |  Branch (1163:24): [True: 0, False: 0]
  ------------------
 1164|      0|                        *(WORD32*)pi1_left_pred_mode =
 1165|      0|                                        (u2_use_left_mb_pack) ?
  ------------------
  |  Branch (1165:41): [True: 0, False: 0]
  ------------------
 1166|      0|                                        DC_DC_DC_DC :
  ------------------
  |  |  434|      0|#define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
  ------------------
 1167|      0|                                                                NOT_VALID;
  ------------------
  |  |  433|      0|#define NOT_VALID -1
  ------------------
 1168|      0|                }
 1169|      0|                else
 1170|      0|                    *(WORD32*)pi1_left_pred_mode = NOT_VALID;
  ------------------
  |  |  433|      0|#define NOT_VALID -1
  ------------------
 1171|      0|            }
 1172|      0|        }
 1173|       |        /* One time pointer initialisations*/
 1174|  18.6k|        pi2_y_coeff1 = pi2_y_coeff;
 1175|  18.6k|        pu1_top_left = pu1_ytop_left;
 1176|       |
 1177|       |        /* Scan the sub-blocks in Raster Scan Order */
 1178|   316k|        for(u1_sub_mb_num = 0; u1_sub_mb_num < 16; u1_sub_mb_num++)
  ------------------
  |  Branch (1178:32): [True: 297k, False: 18.6k]
  ------------------
 1179|   297k|        {
 1180|       |            /* Align the size to multiple of 8, so that SIMD functions
 1181|       |               can read 64 bits at a time. Only 13 bytes are actaully used */
 1182|   297k|            UWORD8 au1_ngbr_pels[16];
 1183|       |
 1184|   297k|            u1_sub_blk_x = u1_sub_mb_num & 0x3;
 1185|   297k|            u1_sub_blk_y = u1_sub_mb_num >> 2;
 1186|   297k|            i1_top_pred_mode = pi1_cur_pred_mode[u1_sub_blk_x];
 1187|   297k|            i1_left_pred_mode = pi1_left_pred_mode[u1_sub_blk_y];
 1188|   297k|            u1_use_top_right_mb = (!!CHECKBIT(ui2_top_rt_mask, u1_sub_mb_num));
  ------------------
  |  |   54|   297k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
 1189|       |
 1190|       |            /*********** left subblock availability**********/
 1191|   297k|            if(u1_sub_blk_x)
  ------------------
  |  Branch (1191:16): [True: 223k, False: 74.4k]
  ------------------
 1192|   223k|                u1_is_left_sub_block = 1;
 1193|  74.4k|            else
 1194|  74.4k|                u1_is_left_sub_block =
 1195|  74.4k|                                (u1_sub_blk_y < 2) ?
  ------------------
  |  Branch (1195:33): [True: 37.2k, False: 37.2k]
  ------------------
 1196|  37.2k|                                                (CHECKBIT(u2_use_left_mb_pack,
  ------------------
  |  |   54|  37.2k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
 1197|  37.2k|                                                          0)) :
 1198|  74.4k|                                                (u2_use_left_mb_pack >> 8);
 1199|       |
 1200|       |            /* CHANGED CODE */
 1201|   297k|            if(u1_sub_blk_y)
  ------------------
  |  Branch (1201:16): [True: 223k, False: 74.4k]
  ------------------
 1202|   223k|                u1_is_top_sub_block = 1;
 1203|       |
 1204|       |            /* CHANGED CODE */
 1205|       |            /***************** Top *********************/
 1206|   297k|            if(ps_dec->u4_use_intrapred_line_copy == 1)
  ------------------
  |  Branch (1206:16): [True: 297k, False: 0]
  ------------------
 1207|   297k|            {
 1208|       |
 1209|   297k|                if(u1_sub_blk_y)
  ------------------
  |  Branch (1209:20): [True: 223k, False: 74.4k]
  ------------------
 1210|   223k|                    pu1_top = pu1_luma_rec_buffer - ui_rec_width;
 1211|  74.4k|                else
 1212|  74.4k|                    pu1_top = puc_top + (u1_sub_blk_x << 2);
 1213|   297k|            }
 1214|      0|            else
 1215|      0|            {
 1216|      0|                pu1_top = pu1_luma_rec_buffer - ui_rec_width;
 1217|      0|            }
 1218|       |            /***************** Top Right *********************/
 1219|   297k|            pu1_top_right = pu1_top + 4;
 1220|       |            /***************** Top Left *********************/
 1221|   297k|            pu1_top_left = pu1_top - 1;
 1222|       |            /***************** Left *********************/
 1223|   297k|            pu1_left = pu1_luma_rec_buffer - 1;
 1224|       |            /* CHANGED CODE */
 1225|       |
 1226|       |            /*---------------------------------------------------------------*/
 1227|       |            /* Calculation of Intra prediction mode                          */
 1228|       |            /*---------------------------------------------------------------*/
 1229|   297k|            i1_intra_pred = ((i1_left_pred_mode < 0) | (i1_top_pred_mode < 0)) ?
  ------------------
  |  Branch (1229:29): [True: 52.2k, False: 245k]
  ------------------
 1230|   245k|                            DC : MIN(i1_left_pred_mode, i1_top_pred_mode);
  ------------------
  |  |  431|  52.2k|#define DC      2
  ------------------
                                          DC : MIN(i1_left_pred_mode, i1_top_pred_mode);
  ------------------
  |  |   61|   543k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 40.9k, False: 204k]
  |  |  ------------------
  ------------------
 1231|   297k|            {
 1232|   297k|                UWORD8 u1_packed_modes = (u1_is_top_sub_block << 1)
 1233|   297k|                                + u1_is_left_sub_block;
 1234|   297k|                UWORD8 *pu1_intra_err_codes =
 1235|   297k|                                (UWORD8 *)gau1_ih264d_intra_pred_err_code;
 1236|   297k|                UWORD8 uc_b2b0 = ((u1_sub_mb_num & 4) >> 1) | (u1_sub_mb_num & 1);
 1237|   297k|                UWORD8 uc_b3b1 = ((u1_sub_mb_num & 8) >> 2)
 1238|   297k|                                | ((u1_sub_mb_num & 2) >> 1);
 1239|       |
 1240|   297k|                u1_cur_sub_block = (uc_b3b1 << 2) + uc_b2b0;
 1241|   297k|                PROFILE_DISABLE_INTRA_PRED()
  ------------------
  |  |  105|   297k|#define PROFILE_DISABLE_INTRA_PRED() ;
  ------------------
 1242|   297k|                if(!pu1_prev_intra4x4_pred_mode_flag[u1_cur_sub_block])
  ------------------
  |  Branch (1242:20): [True: 76.4k, False: 221k]
  ------------------
 1243|  76.4k|                {
 1244|  76.4k|                    i1_intra_pred =
 1245|  76.4k|                                    pu1_rem_intra4x4_pred_mode[u1_cur_sub_block]
 1246|  76.4k|                                                    + (pu1_rem_intra4x4_pred_mode[u1_cur_sub_block]
 1247|  76.4k|                                                                    >= i1_intra_pred);
 1248|  76.4k|                }
 1249|   297k|                i1_intra_pred = CLIP3(0, 8, i1_intra_pred);
  ------------------
  |  |   77|   297k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 735, False: 297k]
  |  |  |  Branch (77:54): [True: 313, False: 296k]
  |  |  ------------------
  ------------------
 1250|   297k|                {
 1251|   297k|                    UWORD8 u1_err_code = pu1_intra_err_codes[i1_intra_pred];
 1252|       |
 1253|   297k|                    if((u1_err_code & u1_packed_modes) ^ u1_err_code)
  ------------------
  |  Branch (1253:24): [True: 9.48k, False: 288k]
  ------------------
 1254|  9.48k|                     {
 1255|  9.48k|                        i1_intra_pred = 0;
 1256|  9.48k|                        ps_dec->i4_error_code = ERROR_INTRAPRED;
 1257|  9.48k|                     }
 1258|       |
 1259|   297k|                }
 1260|   297k|            }
 1261|   297k|            {
 1262|       |                /* Get neighbour pixels */
 1263|       |                /* left pels */
 1264|   297k|                if(u1_is_left_sub_block)
  ------------------
  |  Branch (1264:20): [True: 266k, False: 30.9k]
  ------------------
 1265|   266k|                {
 1266|   266k|                    WORD32 i;
 1267|  1.33M|                    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (1267:32): [True: 1.06M, False: 266k]
  ------------------
 1268|  1.06M|                        au1_ngbr_pels[4 - 1 - i] = pu1_left[i * ui_rec_width];
 1269|   266k|                }
 1270|  30.9k|                else
 1271|  30.9k|                {
 1272|  30.9k|                    memset(au1_ngbr_pels, 0, 4);
 1273|  30.9k|                }
 1274|       |
 1275|       |                /* top left pels */
 1276|   297k|                au1_ngbr_pels[4] = *pu1_top_left;
 1277|       |
 1278|       |                /* top pels */
 1279|   297k|                if(u1_is_top_sub_block)
  ------------------
  |  Branch (1279:20): [True: 273k, False: 24.6k]
  ------------------
 1280|   273k|                {
 1281|   273k|                    memcpy(au1_ngbr_pels + 4 + 1, pu1_top, 4);
 1282|   273k|                }
 1283|  24.6k|                else
 1284|  24.6k|                {
 1285|  24.6k|                    memset(au1_ngbr_pels + 4 + 1, 0, 4);
 1286|  24.6k|                }
 1287|       |
 1288|       |                /* top right pels */
 1289|   297k|                if(u1_use_top_right_mb)
  ------------------
  |  Branch (1289:20): [True: 176k, False: 121k]
  ------------------
 1290|   176k|                {
 1291|   176k|                    memcpy(au1_ngbr_pels + 4 * 2 + 1, pu1_top_right, 4);
 1292|   176k|                }
 1293|   121k|                else if(u1_is_top_sub_block)
  ------------------
  |  Branch (1293:25): [True: 97.1k, False: 24.0k]
  ------------------
 1294|  97.1k|                {
 1295|  97.1k|                    memset(au1_ngbr_pels + 4 * 2 + 1, au1_ngbr_pels[4 * 2], 4);
 1296|  97.1k|                }
 1297|   297k|            }
 1298|   297k|            PROFILE_DISABLE_INTRA_PRED()
  ------------------
  |  |  105|   297k|#define PROFILE_DISABLE_INTRA_PRED() ;
  ------------------
 1299|   297k|            ps_dec->apf_intra_pred_luma_4x4[i1_intra_pred](
 1300|   297k|                            au1_ngbr_pels, pu1_luma_rec_buffer, 1,
 1301|   297k|                            ui_rec_width,
 1302|   297k|                            ((u1_is_top_sub_block << 2) | u1_is_left_sub_block));
 1303|       |
 1304|       |            /* CHANGED CODE */
 1305|   297k|            if(CHECKBIT(ui2_luma_csbp, u1_sub_mb_num))
  ------------------
  |  |   54|   297k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 43.2k, False: 254k]
  |  |  ------------------
  ------------------
 1306|  43.2k|            {
 1307|  43.2k|                WORD16 ai2_tmp[16];
 1308|  43.2k|                PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  43.2k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
 1309|  43.2k|                {
 1310|  43.2k|                    if(CHECKBIT(u4_luma_dc_only_csbp, u1_sub_mb_num))
  ------------------
  |  |   54|  43.2k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 9.24k, False: 34.0k]
  |  |  ------------------
  ------------------
 1311|  9.24k|                    {
 1312|  9.24k|                        ps_dec->pf_iquant_itrans_recon_luma_4x4_dc(
 1313|  9.24k|                                        pi2_y_coeff1,
 1314|  9.24k|                                        pu1_luma_rec_buffer,
 1315|  9.24k|                                        pu1_luma_rec_buffer,
 1316|  9.24k|                                        ui_rec_width,
 1317|  9.24k|                                        ui_rec_width,
 1318|  9.24k|                                        gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qp_rem6],
 1319|  9.24k|                                        (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[0],
 1320|  9.24k|                                        ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0,
 1321|  9.24k|                                        NULL);
 1322|  9.24k|                    }
 1323|  34.0k|                    else
 1324|  34.0k|                    {
 1325|  34.0k|                        ps_dec->pf_iquant_itrans_recon_luma_4x4(
 1326|  34.0k|                                        pi2_y_coeff1,
 1327|  34.0k|                                        pu1_luma_rec_buffer,
 1328|  34.0k|                                        pu1_luma_rec_buffer,
 1329|  34.0k|                                        ui_rec_width,
 1330|  34.0k|                                        ui_rec_width,
 1331|  34.0k|                                        gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qp_rem6],
 1332|  34.0k|                                        (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[0],
 1333|  34.0k|                                        ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0,
 1334|  34.0k|                                        NULL);
 1335|  34.0k|                    }
 1336|  43.2k|                }
 1337|       |
 1338|  43.2k|            }
 1339|       |
 1340|       |            /*---------------------------------------------------------------*/
 1341|       |            /* Update sub block number                                       */
 1342|       |            /*---------------------------------------------------------------*/
 1343|   297k|            pi2_y_coeff1 += 16;
 1344|   297k|            pu1_luma_rec_buffer +=
 1345|   297k|                            (u1_sub_blk_x == 3) ? (ui_rec_width << 2) - 12 : 4;
  ------------------
  |  Branch (1345:29): [True: 74.4k, False: 223k]
  ------------------
 1346|   297k|            pu1_luma_pred_buffer +=
 1347|   297k|                            (u1_sub_blk_x == 3) ? (ui_pred_width << 2) - 12 : 4;
  ------------------
  |  Branch (1347:29): [True: 74.4k, False: 223k]
  ------------------
 1348|       |            /* CHANGED CODE */
 1349|   297k|            pi1_cur_pred_mode[u1_sub_blk_x] = i1_intra_pred;
 1350|   297k|            pi1_left_pred_mode[u1_sub_blk_y] = i1_intra_pred;
 1351|   297k|        }
 1352|  18.6k|    }
 1353|  37.2k|    else if((u1_mb_type == I_4x4_MB) && (ps_cur_mb_info->u1_tran_form8x8 == 1))
  ------------------
  |  |  417|  37.2k|#define I_4x4_MB    0
  ------------------
  |  Branch (1353:13): [True: 37.2k, False: 0]
  |  Branch (1353:41): [True: 37.2k, False: 0]
  ------------------
 1354|  37.2k|    {
 1355|  37.2k|        UWORD8 u1_is_left_sub_block, u1_is_top_sub_block = uc_useTopMB;
 1356|  37.2k|        UWORD8 u1_sub_blk_x, u1_sub_blk_y;
 1357|  37.2k|        UWORD32 u4_sub_mb_num;
 1358|  37.2k|        WORD8 i1_top_pred_mode;
 1359|  37.2k|        WORD8 i1_left_pred_mode;
 1360|  37.2k|        UWORD8 *pu1_top, *pu1_left, *pu1_top_left;
 1361|  37.2k|        WORD8 *pi1_cur_pred_mode, *pi1_left_pred_mode, *pc_topPredMode;
 1362|  37.2k|        UWORD16 ui2_left_pred_buf_width = 0xffff;
 1363|  37.2k|        WORD8 i1_intra_pred;
 1364|  37.2k|        UWORD8 *pu1_prev_intra4x4_pred_mode_flag = pu1_prev_intra4x4_pred_mode_data;
 1365|  37.2k|        UWORD8 *pu1_rem_intra4x4_pred_mode = pu1_prev_intra4x4_pred_mode_data + 4;
 1366|  37.2k|        WORD16 *pi2_y_coeff1;
 1367|  37.2k|        UWORD16 ui2_top_rt_mask;
 1368|  37.2k|        UWORD32 u4_4x4_left_offset = 0;
 1369|       |
 1370|       |        /*--------------------------------------------------------------------*/
 1371|       |        /* 8x8 IntraPrediction                                                */
 1372|       |        /*--------------------------------------------------------------------*/
 1373|       |        /* Calculation of Top Right subblock mask                             */
 1374|       |        /*                                                                    */
 1375|       |        /* (a) Set it to default mask                                         */
 1376|       |        /*  [It has 0 for sublocks which will never have top-right sub block] */
 1377|       |        /*                                                                    */
 1378|       |        /* (b) If top MB is not available                                     */
 1379|       |        /*      Clear the bits of the first row sub blocks                    */
 1380|       |        /*                                                                    */
 1381|       |        /* (c) Set/Clear bit for top-right sublock of MB                      */
 1382|       |        /*  [5 sub-block in decoding order] based on TOP RIGHT MB availablity */
 1383|       |        /*                                                                    */
 1384|       |        /* ui2_top_rt_mask: marks availibility of top right(neighbour)         */
 1385|       |        /* in the 8x8 Block ordering                                          */
 1386|       |        /*                                                                    */
 1387|       |        /*      tr0   tr1                                                     */
 1388|       |        /*   0    1   tr3                                                     */
 1389|       |        /*   2    3                                                           */
 1390|       |        /*                                                                    */
 1391|       |        /*  Top rights for 0 is in top MB                                     */
 1392|       |        /*  top right of 1 will be in top right MB                            */
 1393|       |        /*  top right of 3 in right MB and hence not available                */
 1394|       |        /*  This corresponds to ui2_top_rt_mask  having default value 0x4      */
 1395|       |        /*--------------------------------------------------------------------*/
 1396|       |
 1397|  37.2k|        ui2_top_rt_mask = (u1_use_top_right_mb << 1) | (0x4);
 1398|       |
 1399|  37.2k|        if(uc_useTopMB)
  ------------------
  |  Branch (1399:12): [True: 23.9k, False: 13.3k]
  ------------------
 1400|  23.9k|        {
 1401|  23.9k|            ui2_top_rt_mask |= 0x1;
 1402|  23.9k|        }
 1403|       |
 1404|       |        /* Top Related initialisations */
 1405|  37.2k|        pi1_cur_pred_mode = ps_cur_mb_info->ps_curmb->pi1_intrapredmodes;
 1406|  37.2k|        pc_topPredMode = ps_cur_mb_info->ps_top_mb->pi1_intrapredmodes;
 1407|       |        /*
 1408|       |         if(u1_mbaff)
 1409|       |         {
 1410|       |         pi1_cur_pred_mode += (u2_mbx << 2);
 1411|       |         pc_topPredMode = pi1_cur_pred_mode + ps_cur_mb_info->i1_offset;
 1412|       |         pi1_cur_pred_mode += (u1_topmb) ? 0: 4;
 1413|       |         }
 1414|       |         */
 1415|  37.2k|        if(u1_top_available)
  ------------------
  |  Branch (1415:12): [True: 27.1k, False: 10.1k]
  ------------------
 1416|  27.1k|        {
 1417|  27.1k|            if(ps_top_mb->u1_mb_type == I_4x4_MB)
  ------------------
  |  |  417|  27.1k|#define I_4x4_MB    0
  ------------------
  |  Branch (1417:16): [True: 19.9k, False: 7.21k]
  ------------------
 1418|  19.9k|            {
 1419|  19.9k|                *(WORD32*)pi1_cur_pred_mode = *(WORD32*)pc_topPredMode;
 1420|  19.9k|            }
 1421|  7.21k|            else
 1422|  7.21k|            {
 1423|  7.21k|                *(WORD32*)pi1_cur_pred_mode =
 1424|  7.21k|                                (uc_useTopMB) ? DC_DC_DC_DC : NOT_VALID;
  ------------------
  |  |  434|  3.98k|#define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
  ------------------
                                              (uc_useTopMB) ? DC_DC_DC_DC : NOT_VALID;
  ------------------
  |  |  433|  10.4k|#define NOT_VALID -1
  ------------------
  |  Branch (1424:33): [True: 3.98k, False: 3.23k]
  ------------------
 1425|  7.21k|            }
 1426|  27.1k|        }
 1427|  10.1k|        else
 1428|  10.1k|        {
 1429|  10.1k|            *(WORD32*)pi1_cur_pred_mode = NOT_VALID;
  ------------------
  |  |  433|  10.1k|#define NOT_VALID -1
  ------------------
 1430|  10.1k|        }
 1431|       |
 1432|  37.2k|        pu1_top = puc_top - 8;
 1433|       |
 1434|       |        /*Left Related initialisations*/
 1435|  37.2k|        pi1_left_pred_mode = ps_dec->pi1_left_pred_mode;
 1436|       |
 1437|  37.2k|        if(!u1_mbaff)
  ------------------
  |  Branch (1437:12): [True: 37.2k, False: 0]
  ------------------
 1438|  37.2k|        {
 1439|  37.2k|            if(u1_left_available)
  ------------------
  |  Branch (1439:16): [True: 28.9k, False: 8.34k]
  ------------------
 1440|  28.9k|            {
 1441|  28.9k|                if(ps_left_mb->u1_mb_type != I_4x4_MB)
  ------------------
  |  |  417|  28.9k|#define I_4x4_MB    0
  ------------------
  |  Branch (1441:20): [True: 7.20k, False: 21.7k]
  ------------------
 1442|  7.20k|                {
 1443|  7.20k|                    *(WORD32*)pi1_left_pred_mode =
 1444|  7.20k|                                    (u2_use_left_mb_pack) ?
  ------------------
  |  Branch (1444:37): [True: 4.72k, False: 2.48k]
  ------------------
 1445|  4.72k|                                    DC_DC_DC_DC :
  ------------------
  |  |  434|  4.72k|#define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
  ------------------
 1446|  7.20k|                                                            NOT_VALID;
  ------------------
  |  |  433|  9.68k|#define NOT_VALID -1
  ------------------
 1447|  7.20k|                }
 1448|  28.9k|            }
 1449|  8.34k|            else
 1450|  8.34k|            {
 1451|  8.34k|                *(WORD32*)pi1_left_pred_mode = NOT_VALID;
  ------------------
  |  |  433|  8.34k|#define NOT_VALID -1
  ------------------
 1452|  8.34k|            }
 1453|  37.2k|        }
 1454|      0|        else
 1455|      0|        {
 1456|      0|            UWORD8 u1_curMbfld = ps_cur_mb_info->u1_mb_field_decodingflag;
 1457|       |
 1458|      0|            UWORD8 u1_leftMbfld = ps_left_mb->u1_mb_fld;
 1459|       |
 1460|      0|            if((!u1_curMbfld) && (u1_leftMbfld))
  ------------------
  |  Branch (1460:16): [True: 0, False: 0]
  |  Branch (1460:34): [True: 0, False: 0]
  ------------------
 1461|      0|            {
 1462|      0|                u4_4x4_left_offset = 1;
 1463|      0|            }
 1464|       |
 1465|      0|            if(u1_curMbfld ^ u1_leftMbfld)
  ------------------
  |  Branch (1465:16): [True: 0, False: 0]
  ------------------
 1466|      0|            {
 1467|       |
 1468|      0|                if(u1_topmb
  ------------------
  |  Branch (1468:20): [True: 0, False: 0]
  ------------------
 1469|      0|                                | ((u1_topmb == 0)
  ------------------
  |  Branch (1469:36): [True: 0, False: 0]
  ------------------
 1470|      0|                                                && ((ps_curmb - 1)->u1_mb_type
  ------------------
  |  Branch (1470:52): [True: 0, False: 0]
  ------------------
 1471|      0|                                                                != I_4x4_MB)))
  ------------------
  |  |  417|      0|#define I_4x4_MB    0
  ------------------
 1472|       |
 1473|      0|                {
 1474|      0|                    if(u1_left_available)
  ------------------
  |  Branch (1474:24): [True: 0, False: 0]
  ------------------
 1475|      0|                    {
 1476|      0|                        if(ps_left_mb->u1_mb_type != I_4x4_MB)
  ------------------
  |  |  417|      0|#define I_4x4_MB    0
  ------------------
  |  Branch (1476:28): [True: 0, False: 0]
  ------------------
 1477|      0|                        {
 1478|      0|                            if(CHECKBIT(u2_use_left_mb_pack,0) == 0)
  ------------------
  |  |   54|      0|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
  |  Branch (1478:32): [True: 0, False: 0]
  ------------------
 1479|      0|                            {
 1480|      0|                                *(WORD32*)pi1_left_pred_mode = NOT_VALID;
  ------------------
  |  |  433|      0|#define NOT_VALID -1
  ------------------
 1481|      0|                            }
 1482|      0|                            else
 1483|      0|                            {
 1484|      0|                                *(WORD32*)pi1_left_pred_mode = DC_DC_DC_DC;
  ------------------
  |  |  434|      0|#define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
  ------------------
 1485|      0|                            }
 1486|      0|                        }
 1487|      0|                    }
 1488|      0|                    else
 1489|      0|                    {
 1490|      0|                        *(WORD32*)pi1_left_pred_mode = NOT_VALID;
  ------------------
  |  |  433|      0|#define NOT_VALID -1
  ------------------
 1491|      0|                    }
 1492|       |
 1493|      0|                    if(u1_curMbfld)
  ------------------
  |  Branch (1493:24): [True: 0, False: 0]
  ------------------
 1494|      0|                    {
 1495|      0|                        if(u1_left_available)
  ------------------
  |  Branch (1495:28): [True: 0, False: 0]
  ------------------
 1496|      0|                        {
 1497|      0|                            if((ps_left_mb + 1)->u1_mb_type != I_4x4_MB)
  ------------------
  |  |  417|      0|#define I_4x4_MB    0
  ------------------
  |  Branch (1497:32): [True: 0, False: 0]
  ------------------
 1498|      0|                            {
 1499|      0|                                if(u2_use_left_mb_pack >> 8)
  ------------------
  |  Branch (1499:36): [True: 0, False: 0]
  ------------------
 1500|      0|                                {
 1501|      0|                                    *(WORD32*)(pi1_left_pred_mode + 4) =
 1502|      0|                                                    DC_DC_DC_DC;
  ------------------
  |  |  434|      0|#define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
  ------------------
 1503|      0|                                }
 1504|      0|                                else
 1505|      0|                                {
 1506|      0|                                    *(WORD32*)(pi1_left_pred_mode + 4) =
 1507|      0|                                                    NOT_VALID;
  ------------------
  |  |  433|      0|#define NOT_VALID -1
  ------------------
 1508|      0|                                }
 1509|      0|                            }
 1510|      0|                        }
 1511|      0|                        else
 1512|      0|                        {
 1513|      0|                            *(WORD32*)(pi1_left_pred_mode + 4) = NOT_VALID;
  ------------------
  |  |  433|      0|#define NOT_VALID -1
  ------------------
 1514|      0|                        }
 1515|       |
 1516|      0|                        pi1_left_pred_mode[1] = pi1_left_pred_mode[2];
 1517|      0|                        pi1_left_pred_mode[2] = pi1_left_pred_mode[4];
 1518|      0|                        pi1_left_pred_mode[3] = pi1_left_pred_mode[6];
 1519|      0|                        *(WORD32*)(pi1_left_pred_mode + 4) =
 1520|      0|                                        *(WORD32*)pi1_left_pred_mode;
 1521|      0|                    }
 1522|      0|                    else
 1523|      0|                    {
 1524|      0|                        pi1_left_pred_mode[7] = pi1_left_pred_mode[3];
 1525|      0|                        pi1_left_pred_mode[6] = pi1_left_pred_mode[3];
 1526|      0|                        pi1_left_pred_mode[5] = pi1_left_pred_mode[2];
 1527|      0|                        pi1_left_pred_mode[4] = pi1_left_pred_mode[2];
 1528|      0|                        pi1_left_pred_mode[3] = pi1_left_pred_mode[1];
 1529|      0|                        pi1_left_pred_mode[2] = pi1_left_pred_mode[1];
 1530|      0|                        pi1_left_pred_mode[1] = pi1_left_pred_mode[0];
 1531|      0|                    }
 1532|      0|                }
 1533|      0|                pi1_left_pred_mode += (u1_topmb) ? 0 : 4;
  ------------------
  |  Branch (1533:39): [True: 0, False: 0]
  ------------------
 1534|      0|            }
 1535|      0|            else
 1536|      0|            {
 1537|      0|                pi1_left_pred_mode += (u1_topmb) ? 0 : 4;
  ------------------
  |  Branch (1537:39): [True: 0, False: 0]
  ------------------
 1538|       |
 1539|      0|                if(u1_left_available)
  ------------------
  |  Branch (1539:20): [True: 0, False: 0]
  ------------------
 1540|      0|                {
 1541|      0|                    if(ps_left_mb->u1_mb_type != I_4x4_MB)
  ------------------
  |  |  417|      0|#define I_4x4_MB    0
  ------------------
  |  Branch (1541:24): [True: 0, False: 0]
  ------------------
 1542|      0|                    {
 1543|      0|                        *(WORD32*)pi1_left_pred_mode =
 1544|      0|                                        (u2_use_left_mb_pack) ?
  ------------------
  |  Branch (1544:41): [True: 0, False: 0]
  ------------------
 1545|      0|                                        DC_DC_DC_DC :
  ------------------
  |  |  434|      0|#define DC_DC_DC_DC   0x02020202 /*packed 4 bytes used in Decode Intra Mb*/
  ------------------
 1546|      0|                                                                NOT_VALID;
  ------------------
  |  |  433|      0|#define NOT_VALID -1
  ------------------
 1547|      0|                    }
 1548|      0|                }
 1549|      0|                else
 1550|      0|                {
 1551|      0|                    *(WORD32*)pi1_left_pred_mode = NOT_VALID;
  ------------------
  |  |  433|      0|#define NOT_VALID -1
  ------------------
 1552|      0|                }
 1553|      0|            }
 1554|      0|        }
 1555|       |
 1556|       |        /* One time pointer initialisations*/
 1557|  37.2k|        pi2_y_coeff1 = pi2_y_coeff;
 1558|       |
 1559|  37.2k|        if(u1_use_top_left_mb)
  ------------------
  |  Branch (1559:12): [True: 19.0k, False: 18.2k]
  ------------------
 1560|  19.0k|        {
 1561|  19.0k|            pu1_top_left = pu1_ytop_left;
 1562|  19.0k|        }
 1563|  18.2k|        else
 1564|  18.2k|        {
 1565|  18.2k|            pu1_top_left = NULL;
 1566|  18.2k|        }
 1567|       |
 1568|       |        /* Scan the sub-blocks in Raster Scan Order */
 1569|   186k|        for(u4_sub_mb_num = 0; u4_sub_mb_num < 4; u4_sub_mb_num++)
  ------------------
  |  Branch (1569:32): [True: 149k, False: 37.2k]
  ------------------
 1570|   149k|        {
 1571|   149k|            u1_sub_blk_x = (u4_sub_mb_num & 0x1);
 1572|   149k|            u1_sub_blk_y = (u4_sub_mb_num >> 1);
 1573|   149k|            i1_top_pred_mode = pi1_cur_pred_mode[u1_sub_blk_x << 1];
 1574|   149k|            i1_left_pred_mode = pi1_left_pred_mode[u1_sub_blk_y << 1];
 1575|       |
 1576|   149k|            if(2 == u4_sub_mb_num)
  ------------------
  |  Branch (1576:16): [True: 37.2k, False: 111k]
  ------------------
 1577|  37.2k|            {
 1578|  37.2k|                i1_left_pred_mode = pi1_left_pred_mode[(u1_sub_blk_y << 1)
 1579|  37.2k|                                + u4_4x4_left_offset];
 1580|  37.2k|            }
 1581|       |
 1582|   149k|            u1_use_top_right_mb = (!!CHECKBIT(ui2_top_rt_mask, u4_sub_mb_num));
  ------------------
  |  |   54|   149k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
 1583|       |
 1584|       |            /*********** left subblock availability**********/
 1585|   149k|            if(u1_sub_blk_x)
  ------------------
  |  Branch (1585:16): [True: 74.5k, False: 74.5k]
  ------------------
 1586|  74.5k|            {
 1587|  74.5k|                u1_is_left_sub_block = 1;
 1588|  74.5k|            }
 1589|  74.5k|            else
 1590|  74.5k|            {
 1591|  74.5k|                u1_is_left_sub_block =
 1592|  74.5k|                                (u1_sub_blk_y < 1) ?
  ------------------
  |  Branch (1592:33): [True: 37.2k, False: 37.2k]
  ------------------
 1593|  37.2k|                                                (CHECKBIT(u2_use_left_mb_pack,
  ------------------
  |  |   54|  37.2k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
 1594|  37.2k|                                                          0)) :
 1595|  74.5k|                                                (u2_use_left_mb_pack >> 8);
 1596|  74.5k|            }
 1597|       |
 1598|       |            /***************** Top *********************/
 1599|   149k|            if(u1_sub_blk_y)
  ------------------
  |  Branch (1599:16): [True: 74.5k, False: 74.5k]
  ------------------
 1600|  74.5k|            {
 1601|  74.5k|                u1_is_top_sub_block = 1;
 1602|       |                // sushant
 1603|  74.5k|                pu1_top = /*pu1_luma_pred_buffer*/pu1_luma_rec_buffer - ui_rec_width;
 1604|  74.5k|            }
 1605|  74.5k|            else
 1606|  74.5k|            {
 1607|  74.5k|                pu1_top += 8;
 1608|  74.5k|            }
 1609|       |
 1610|       |            /***************** Left *********************/
 1611|   149k|            if((u1_sub_blk_x) | (u4_num_pmbair != 0))
  ------------------
  |  Branch (1611:16): [True: 132k, False: 16.6k]
  ------------------
 1612|   132k|            {
 1613|       |                // sushant
 1614|   132k|                pu1_left = /*pu1_luma_pred_buffer*/pu1_luma_rec_buffer - 1;
 1615|   132k|                ui2_left_pred_buf_width = ui_rec_width;
 1616|   132k|            }
 1617|  16.6k|            else
 1618|  16.6k|            {
 1619|  16.6k|                pu1_left = pu1_yleft;
 1620|  16.6k|                pu1_yleft += (ui_rec_width << 3);
 1621|  16.6k|                ui2_left_pred_buf_width = ui_rec_width;
 1622|  16.6k|            }
 1623|       |
 1624|       |            /***************** Top Left *********************/
 1625|   149k|            if(u4_sub_mb_num)
  ------------------
  |  Branch (1625:16): [True: 111k, False: 37.2k]
  ------------------
 1626|   111k|            {
 1627|   111k|                pu1_top_left = (u1_sub_blk_x) ?
  ------------------
  |  Branch (1627:32): [True: 74.5k, False: 37.2k]
  ------------------
 1628|  74.5k|                                pu1_top - 1 : pu1_left - ui_rec_width;
 1629|       |
 1630|   111k|                if((u1_sub_blk_x && (!u1_is_top_sub_block))
  ------------------
  |  Branch (1630:21): [True: 74.5k, False: 37.2k]
  |  Branch (1630:37): [True: 13.3k, False: 61.2k]
  ------------------
 1631|  98.5k|                                || ((!u1_sub_blk_x) && (!u1_is_left_sub_block)))
  ------------------
  |  Branch (1631:37): [True: 37.2k, False: 61.2k]
  |  Branch (1631:56): [True: 10.8k, False: 26.4k]
  ------------------
 1632|  24.2k|                {
 1633|  24.2k|                    pu1_top_left = NULL;
 1634|  24.2k|                }
 1635|   111k|            }
 1636|       |
 1637|       |            /*---------------------------------------------------------------*/
 1638|       |            /* Calculation of Intra prediction mode                          */
 1639|       |            /*---------------------------------------------------------------*/
 1640|   149k|            i1_intra_pred = ((i1_left_pred_mode < 0) | (i1_top_pred_mode < 0)) ?
  ------------------
  |  Branch (1640:29): [True: 45.1k, False: 104k]
  ------------------
 1641|   104k|                            DC : MIN(i1_left_pred_mode, i1_top_pred_mode);
  ------------------
  |  |  431|  45.1k|#define DC      2
  ------------------
                                          DC : MIN(i1_left_pred_mode, i1_top_pred_mode);
  ------------------
  |  |   61|   253k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 22.0k, False: 81.9k]
  |  |  ------------------
  ------------------
 1642|   149k|            {
 1643|   149k|                UWORD8 u1_packed_modes = (u1_is_top_sub_block << 1)
 1644|   149k|                                + u1_is_left_sub_block;
 1645|   149k|                UWORD8 *pu1_intra_err_codes =
 1646|   149k|                                (UWORD8 *)gau1_ih264d_intra_pred_err_code;
 1647|       |
 1648|       |                /********************************************************************/
 1649|       |                /* Same intra4x4_pred_mode array is filled with intra4x4_pred_mode  */
 1650|       |                /* for a MB with 8x8 intrapredicition                               */
 1651|       |                /********************************************************************/
 1652|   149k|                PROFILE_DISABLE_INTRA_PRED()
  ------------------
  |  |  105|   149k|#define PROFILE_DISABLE_INTRA_PRED() ;
  ------------------
 1653|   149k|                if(!pu1_prev_intra4x4_pred_mode_flag[u4_sub_mb_num])
  ------------------
  |  Branch (1653:20): [True: 37.8k, False: 111k]
  ------------------
 1654|  37.8k|                {
 1655|  37.8k|                    i1_intra_pred = pu1_rem_intra4x4_pred_mode[u4_sub_mb_num]
 1656|  37.8k|                                    + (pu1_rem_intra4x4_pred_mode[u4_sub_mb_num]
 1657|  37.8k|                                                    >= i1_intra_pred);
 1658|  37.8k|                }
 1659|   149k|                i1_intra_pred = CLIP3(0, 8, i1_intra_pred);
  ------------------
  |  |   77|   149k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 459, False: 148k]
  |  |  |  Branch (77:54): [True: 261, False: 148k]
  |  |  ------------------
  ------------------
 1660|   149k|                {
 1661|   149k|                    UWORD8 u1_err_code = pu1_intra_err_codes[i1_intra_pred];
 1662|       |
 1663|   149k|                    if((u1_err_code & u1_packed_modes) ^ u1_err_code)
  ------------------
  |  Branch (1663:24): [True: 5.17k, False: 144k]
  ------------------
 1664|  5.17k|                    {
 1665|  5.17k|                        i1_intra_pred = 0;
 1666|  5.17k|                        ps_dec->i4_error_code = ERROR_INTRAPRED;
 1667|  5.17k|                    }
 1668|   149k|                }
 1669|   149k|            }
 1670|       |
 1671|   149k|            {
 1672|       |                /* Align the size to multiple of 8, so that SIMD functions
 1673|       |                can read 64 bits at a time. Only 25 bytes are actaully used */
 1674|   149k|                UWORD8 au1_ngbr_pels[32] = {0};
 1675|   149k|                WORD32 ngbr_avail;
 1676|   149k|                ngbr_avail = u1_is_left_sub_block << 0;
 1677|   149k|                ngbr_avail |= u1_is_top_sub_block << 2;
 1678|       |
 1679|   149k|                if(pu1_top_left)
  ------------------
  |  Branch (1679:20): [True: 106k, False: 42.4k]
  ------------------
 1680|   106k|                    ngbr_avail |= 1 << 1;
 1681|       |
 1682|   149k|                ngbr_avail |= u1_use_top_right_mb << 3;
 1683|   149k|                PROFILE_DISABLE_INTRA_PRED()
  ------------------
  |  |  105|   149k|#define PROFILE_DISABLE_INTRA_PRED() ;
  ------------------
 1684|   149k|                {
 1685|   149k|                    ps_dec->pf_intra_pred_ref_filtering(pu1_left, pu1_top_left,
 1686|   149k|                                                        pu1_top, au1_ngbr_pels,
 1687|   149k|                                                        ui2_left_pred_buf_width,
 1688|   149k|                                                        ngbr_avail);
 1689|       |
 1690|   149k|                    ps_dec->apf_intra_pred_luma_8x8[i1_intra_pred](
 1691|   149k|                                    au1_ngbr_pels, pu1_luma_rec_buffer, 1,
 1692|   149k|                                    ui_rec_width,
 1693|   149k|                                    ((u1_is_top_sub_block << 2) | u1_is_left_sub_block));
 1694|   149k|                }
 1695|   149k|            }
 1696|       |
 1697|       |            /* Inverse Transform and Reconstruction */
 1698|   149k|            if(CHECKBIT(ps_cur_mb_info->u1_cbp, u4_sub_mb_num))
  ------------------
  |  |   54|   149k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 96.7k, False: 52.4k]
  |  |  ------------------
  ------------------
 1699|  96.7k|            {
 1700|  96.7k|                WORD16 *pi2_scale_matrix_ptr;
 1701|  96.7k|                WORD16 ai2_tmp[64];
 1702|       |
 1703|  96.7k|                pi2_scale_matrix_ptr =
 1704|  96.7k|                                ps_dec->s_high_profile.i2_scalinglist8x8[0];
 1705|  96.7k|                PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  96.7k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
 1706|  96.7k|                {
 1707|  96.7k|                    if(CHECKBIT(u4_luma_dc_only_cbp, u4_sub_mb_num))
  ------------------
  |  |   54|  96.7k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 21.0k, False: 75.6k]
  |  |  ------------------
  ------------------
 1708|  21.0k|                    {
 1709|  21.0k|                        ps_dec->pf_iquant_itrans_recon_luma_8x8_dc(
 1710|  21.0k|                                        pi2_y_coeff1,
 1711|  21.0k|                                        pu1_luma_rec_buffer,
 1712|  21.0k|                                        pu1_luma_rec_buffer,
 1713|  21.0k|                                        ui_rec_width,
 1714|  21.0k|                                        ui_rec_width,
 1715|  21.0k|                                        gau1_ih264d_dequant8x8_cavlc[ps_cur_mb_info->u1_qp_rem6],
 1716|  21.0k|                                        (UWORD16 *)pi2_scale_matrix_ptr,
 1717|  21.0k|                                        ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0,
 1718|  21.0k|                                        NULL);
 1719|  21.0k|                    }
 1720|  75.6k|                    else
 1721|  75.6k|                    {
 1722|  75.6k|                        ps_dec->pf_iquant_itrans_recon_luma_8x8(
 1723|  75.6k|                                        pi2_y_coeff1,
 1724|  75.6k|                                        pu1_luma_rec_buffer,
 1725|  75.6k|                                        pu1_luma_rec_buffer,
 1726|  75.6k|                                        ui_rec_width,
 1727|  75.6k|                                        ui_rec_width,
 1728|  75.6k|                                        gau1_ih264d_dequant8x8_cavlc[ps_cur_mb_info->u1_qp_rem6],
 1729|  75.6k|                                        (UWORD16 *)pi2_scale_matrix_ptr,
 1730|  75.6k|                                        ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0,
 1731|  75.6k|                                        NULL);
 1732|  75.6k|                    }
 1733|  96.7k|                }
 1734|       |
 1735|  96.7k|            }
 1736|       |
 1737|       |            /*---------------------------------------------------------------*/
 1738|       |            /* Update sub block number                                       */
 1739|       |            /*---------------------------------------------------------------*/
 1740|   149k|            pi2_y_coeff1 += 64;
 1741|       |
 1742|   149k|            pu1_luma_rec_buffer +=
 1743|   149k|                            (u1_sub_blk_x == 1) ?
  ------------------
  |  Branch (1743:29): [True: 74.5k, False: 74.5k]
  ------------------
 1744|  74.5k|                                            (ui_rec_width << 3) - (8 * 1) : 8;
 1745|       |
 1746|       |            /*---------------------------------------------------------------*/
 1747|       |            /* Pred mode filled in terms of 4x4 block so replicated in 2     */
 1748|       |            /* locations.                                                    */
 1749|       |            /*---------------------------------------------------------------*/
 1750|   149k|            pi1_cur_pred_mode[u1_sub_blk_x << 1] = i1_intra_pred;
 1751|   149k|            pi1_cur_pred_mode[(u1_sub_blk_x << 1) + 1] = i1_intra_pred;
 1752|   149k|            pi1_left_pred_mode[u1_sub_blk_y << 1] = i1_intra_pred;
 1753|   149k|            pi1_left_pred_mode[(u1_sub_blk_y << 1) + 1] = i1_intra_pred;
 1754|   149k|        }
 1755|  37.2k|    }
 1756|       |    /* Decode Chroma Block */
 1757|   147k|    ih264d_unpack_chroma_coeff4x4_mb(ps_dec,
 1758|   147k|                                     ps_cur_mb_info);
 1759|       |    /*--------------------------------------------------------------------*/
 1760|       |    /* Chroma Blocks decoding                                             */
 1761|       |    /*--------------------------------------------------------------------*/
 1762|   147k|    {
 1763|   147k|        UWORD8 u1_intra_chrom_pred_mode;
 1764|   147k|        UWORD8 u1_chroma_cbp = (UWORD8)(ps_cur_mb_info->u1_cbp >> 4);
 1765|       |
 1766|       |        /*--------------------------------------------------------------------*/
 1767|       |        /* Perform Chroma intra prediction                                    */
 1768|       |        /*--------------------------------------------------------------------*/
 1769|       |
 1770|   147k|        u1_intra_chrom_pred_mode = CHROMA_TO_LUMA_INTRA_MODE(
  ------------------
  |  |   44|   147k|#define CHROMA_TO_LUMA_INTRA_MODE(x)   (x ^ ( (!(x & 0x01)) << 1))
  ------------------
 1771|   147k|                        ps_cur_mb_info->u1_chroma_pred_mode);
 1772|       |
 1773|   147k|        {
 1774|   147k|            UWORD8 u1_packed_modes = (u1_top_available << 1)
 1775|   147k|                            + u1_left_available;
 1776|   147k|            UWORD8 u1_err_code =
 1777|   147k|                            (u1_intra_chrom_pred_mode & 1) ?
  ------------------
  |  Branch (1777:29): [True: 51.6k, False: 96.0k]
  ------------------
 1778|  51.6k|                                            u1_intra_chrom_pred_mode :
 1779|   147k|                                            (u1_intra_chrom_pred_mode ^ 2);
 1780|   147k|            if((u1_err_code & u1_packed_modes) ^ u1_err_code)
  ------------------
  |  Branch (1780:16): [True: 12.2k, False: 135k]
  ------------------
 1781|  12.2k|            {
 1782|  12.2k|                u1_intra_chrom_pred_mode = 0;
 1783|  12.2k|                ps_dec->i4_error_code = ERROR_INTRAPRED;
 1784|  12.2k|            }
 1785|   147k|        }
 1786|       |
 1787|       |        /* CHANGED CODE */
 1788|   147k|        if(u1_chroma_cbp != CBPC_ALLZERO)
  ------------------
  |  |  507|   147k|#define CBPC_ALLZERO    0
  ------------------
  |  Branch (1788:12): [True: 45.0k, False: 102k]
  ------------------
 1789|  45.0k|        {
 1790|  45.0k|            UWORD16 u2_chroma_csbp =
 1791|  45.0k|                            (u1_chroma_cbp == CBPC_ACZERO) ?
  ------------------
  |  |  508|  45.0k|#define CBPC_ACZERO     1
  ------------------
  |  Branch (1791:29): [True: 30.7k, False: 14.2k]
  ------------------
 1792|  30.7k|                                            0 : ps_cur_mb_info->u2_chroma_csbp;
 1793|  45.0k|            UWORD32 u4_scale_u;
 1794|  45.0k|            UWORD32 u4_scale_v;
 1795|       |
 1796|  45.0k|            {
 1797|  45.0k|                UWORD16 au2_ngbr_pels[33];
 1798|  45.0k|                UWORD8 *pu1_ngbr_pels = (UWORD8 *)au2_ngbr_pels;
 1799|  45.0k|                UWORD16 *pu2_left_uv;
 1800|  45.0k|                UWORD16 *pu2_topleft_uv;
 1801|  45.0k|                WORD32 use_left1 = (u2_use_left_mb_pack & 0x0ff);
 1802|  45.0k|                WORD32 use_left2 = (u2_use_left_mb_pack & 0xff00) >> 8;
 1803|       |
 1804|  45.0k|                pu2_left_uv = (UWORD16 *)pu1_uleft;
 1805|  45.0k|                pu2_topleft_uv = (UWORD16 *)pu1_u_top_left;
 1806|       |                /* Get neighbour pixels */
 1807|       |                /* left pels */
 1808|  45.0k|                if(u2_use_left_mb_pack)
  ------------------
  |  Branch (1808:20): [True: 27.1k, False: 17.8k]
  ------------------
 1809|  27.1k|                {
 1810|  27.1k|                    WORD32 i;
 1811|  27.1k|                    if(use_left1)
  ------------------
  |  Branch (1811:24): [True: 27.1k, False: 0]
  ------------------
 1812|  27.1k|                    {
 1813|   135k|                        for(i = 0; i < 4; i++)
  ------------------
  |  Branch (1813:36): [True: 108k, False: 27.1k]
  ------------------
 1814|   108k|                            au2_ngbr_pels[8 - 1 - i] = pu2_left_uv[i
 1815|   108k|                                            * u4_recwidth_cr / YUV420SP_FACTOR];
  ------------------
  |  |  119|   108k|#define YUV420SP_FACTOR 2
  ------------------
 1816|  27.1k|                    }
 1817|      0|                    else
 1818|      0|                    {
 1819|      0|                        memset(au2_ngbr_pels + 4, 0, 4 * sizeof(UWORD16));
 1820|      0|                    }
 1821|       |
 1822|  27.1k|                    if(use_left2)
  ------------------
  |  Branch (1822:24): [True: 27.1k, False: 0]
  ------------------
 1823|  27.1k|                    {
 1824|   135k|                        for(i = 4; i < 8; i++)
  ------------------
  |  Branch (1824:36): [True: 108k, False: 27.1k]
  ------------------
 1825|   108k|                            au2_ngbr_pels[8 - 1 - i] = pu2_left_uv[i
 1826|   108k|                                            * u4_recwidth_cr / YUV420SP_FACTOR];
  ------------------
  |  |  119|   108k|#define YUV420SP_FACTOR 2
  ------------------
 1827|  27.1k|                    }
 1828|      0|                    else
 1829|      0|                    {
 1830|      0|                        memset(au2_ngbr_pels, 0, 4 * sizeof(UWORD16));
 1831|      0|                    }
 1832|  27.1k|                }
 1833|  17.8k|                else
 1834|  17.8k|                {
 1835|  17.8k|                    memset(au2_ngbr_pels, 0, 8 * sizeof(UWORD16));
 1836|  17.8k|                }
 1837|       |
 1838|       |                /* top left pels */
 1839|  45.0k|                au2_ngbr_pels[8] = *pu2_topleft_uv;
 1840|       |
 1841|       |                /* top pels */
 1842|  45.0k|                if(uc_useTopMB)
  ------------------
  |  Branch (1842:20): [True: 31.3k, False: 13.6k]
  ------------------
 1843|  31.3k|                {
 1844|  31.3k|                    memcpy(au2_ngbr_pels + 8 + 1, pu1_top_u,
 1845|  31.3k|                           8 * sizeof(UWORD16));
 1846|  31.3k|                }
 1847|  13.6k|                else
 1848|  13.6k|                {
 1849|  13.6k|                    memset(au2_ngbr_pels + 8 + 1, 0, 8 * sizeof(UWORD16));
 1850|  13.6k|                }
 1851|       |
 1852|  45.0k|                PROFILE_DISABLE_INTRA_PRED()
  ------------------
  |  |  105|  45.0k|#define PROFILE_DISABLE_INTRA_PRED() ;
  ------------------
 1853|  45.0k|                ps_dec->apf_intra_pred_chroma[u1_intra_chrom_pred_mode](
 1854|  45.0k|                                pu1_ngbr_pels,
 1855|  45.0k|                                pu1_mb_cb_rei1_buffer,
 1856|  45.0k|                                1,
 1857|  45.0k|                                u4_recwidth_cr,
 1858|  45.0k|                                ((uc_useTopMB << 2) | (use_left2 << 4)
 1859|  45.0k|                                                | use_left1));
 1860|  45.0k|            }
 1861|  45.0k|            u4_scale_u = ps_cur_mb_info->u1_qpc_div6;
 1862|  45.0k|            u4_scale_v = ps_cur_mb_info->u1_qpcr_div6;
 1863|  45.0k|            pi2_y_coeff = ps_dec->pi2_coeff_data;
 1864|       |
 1865|  45.0k|            {
 1866|  45.0k|                UWORD32 i;
 1867|  45.0k|                WORD16 ai2_tmp[16];
 1868|   225k|                for(i = 0; i < 4; i++)
  ------------------
  |  Branch (1868:28): [True: 180k, False: 45.0k]
  ------------------
 1869|   180k|                {
 1870|   180k|                    WORD16 *pi2_level = pi2_y_coeff + (i << 4);
 1871|   180k|                    UWORD8 *pu1_pred_sblk = pu1_mb_cb_rei1_buffer
 1872|   180k|                                    + ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR)
  ------------------
  |  |  556|   180k|#define BLK_SIZE             4
  ------------------
                                                  + ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR)
  ------------------
  |  |  119|   180k|#define YUV420SP_FACTOR 2
  ------------------
 1873|   180k|                                    + (i >> 1) * (u4_recwidth_cr << 2);
 1874|   180k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|   180k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
 1875|   180k|                    {
 1876|   180k|                        if(CHECKBIT(u2_chroma_csbp, i))
  ------------------
  |  |   54|   180k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 11.0k, False: 169k]
  |  |  ------------------
  ------------------
 1877|  11.0k|                        {
 1878|  11.0k|                            ps_dec->pf_iquant_itrans_recon_chroma_4x4(
 1879|  11.0k|                                            pi2_level,
 1880|  11.0k|                                            pu1_pred_sblk,
 1881|  11.0k|                                            pu1_pred_sblk,
 1882|  11.0k|                                            u4_recwidth_cr,
 1883|  11.0k|                                            u4_recwidth_cr,
 1884|  11.0k|                                            gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpc_rem6],
 1885|  11.0k|                                            (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[1],
 1886|  11.0k|                                            u4_scale_u, ai2_tmp, pi2_level);
 1887|  11.0k|                        }
 1888|   169k|                        else if(pi2_level[0] != 0)
  ------------------
  |  Branch (1888:33): [True: 112k, False: 56.6k]
  ------------------
 1889|   112k|                        {
 1890|   112k|                            ps_dec->pf_iquant_itrans_recon_chroma_4x4_dc(
 1891|   112k|                                            pi2_level,
 1892|   112k|                                            pu1_pred_sblk,
 1893|   112k|                                            pu1_pred_sblk,
 1894|   112k|                                            u4_recwidth_cr,
 1895|   112k|                                            u4_recwidth_cr,
 1896|   112k|                                            gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpc_rem6],
 1897|   112k|                                            (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[1],
 1898|   112k|                                            u4_scale_u, ai2_tmp, pi2_level);
 1899|   112k|                        }
 1900|   180k|                    }
 1901|       |
 1902|   180k|                }
 1903|  45.0k|            }
 1904|       |
 1905|  45.0k|            pi2_y_coeff += MB_CHROM_SIZE;
  ------------------
  |  |  564|  45.0k|#define MB_CHROM_SIZE                 64
  ------------------
 1906|  45.0k|            u2_chroma_csbp = u2_chroma_csbp >> 4;
 1907|  45.0k|            {
 1908|  45.0k|                UWORD32 i;
 1909|  45.0k|                WORD16 ai2_tmp[16];
 1910|   225k|                for(i = 0; i < 4; i++)
  ------------------
  |  Branch (1910:28): [True: 180k, False: 45.0k]
  ------------------
 1911|   180k|                {
 1912|   180k|                    WORD16 *pi2_level = pi2_y_coeff + (i << 4);
 1913|   180k|                    UWORD8 *pu1_pred_sblk = pu1_mb_cb_rei1_buffer + 1
 1914|   180k|                                    + ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR)
  ------------------
  |  |  556|   180k|#define BLK_SIZE             4
  ------------------
                                                  + ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR)
  ------------------
  |  |  119|   180k|#define YUV420SP_FACTOR 2
  ------------------
 1915|   180k|                                    + (i >> 1) * (u4_recwidth_cr << 2);
 1916|   180k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|   180k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
 1917|   180k|                    {
 1918|   180k|                        if(CHECKBIT(u2_chroma_csbp, i))
  ------------------
  |  |   54|   180k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 13.0k, False: 166k]
  |  |  ------------------
  ------------------
 1919|  13.0k|                        {
 1920|  13.0k|                            ps_dec->pf_iquant_itrans_recon_chroma_4x4(
 1921|  13.0k|                                            pi2_level,
 1922|  13.0k|                                            pu1_pred_sblk,
 1923|  13.0k|                                            pu1_pred_sblk,
 1924|  13.0k|                                            u4_recwidth_cr,
 1925|  13.0k|                                            u4_recwidth_cr,
 1926|  13.0k|                                            gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpcr_rem6],
 1927|  13.0k|                                            (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[2],
 1928|  13.0k|                                            u4_scale_v, ai2_tmp, pi2_level);
 1929|  13.0k|                        }
 1930|   166k|                        else if(pi2_level[0] != 0)
  ------------------
  |  Branch (1930:33): [True: 96.2k, False: 70.6k]
  ------------------
 1931|  96.2k|                        {
 1932|  96.2k|                            ps_dec->pf_iquant_itrans_recon_chroma_4x4_dc(
 1933|  96.2k|                                            pi2_level,
 1934|  96.2k|                                            pu1_pred_sblk,
 1935|  96.2k|                                            pu1_pred_sblk,
 1936|  96.2k|                                            u4_recwidth_cr,
 1937|  96.2k|                                            u4_recwidth_cr,
 1938|  96.2k|                                            gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpcr_rem6],
 1939|  96.2k|                                            (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[2],
 1940|  96.2k|                                            u4_scale_v, ai2_tmp, pi2_level);
 1941|  96.2k|                        }
 1942|   180k|                    }
 1943|   180k|                }
 1944|  45.0k|            }
 1945|       |
 1946|  45.0k|        }
 1947|   102k|        else
 1948|   102k|        {
 1949|       |            /* If no inverse transform is needed, pass recon buffer pointer */
 1950|       |            /* to Intraprediction module instead of pred buffer pointer     */
 1951|   102k|            {
 1952|   102k|                UWORD16 au2_ngbr_pels[33];
 1953|   102k|                UWORD8 *pu1_ngbr_pels = (UWORD8 *)au2_ngbr_pels;
 1954|   102k|                UWORD16 *pu2_left_uv;
 1955|   102k|                UWORD16 *pu2_topleft_uv;
 1956|   102k|                WORD32 use_left1 = (u2_use_left_mb_pack & 0x0ff);
 1957|   102k|                WORD32 use_left2 = (u2_use_left_mb_pack & 0xff00) >> 8;
 1958|       |
 1959|   102k|                pu2_topleft_uv = (UWORD16 *)pu1_u_top_left;
 1960|   102k|                pu2_left_uv = (UWORD16 *)pu1_uleft;
 1961|       |
 1962|       |                /* Get neighbour pixels */
 1963|       |                /* left pels */
 1964|   102k|                if(u2_use_left_mb_pack)
  ------------------
  |  Branch (1964:20): [True: 74.6k, False: 28.0k]
  ------------------
 1965|  74.6k|                {
 1966|  74.6k|                    WORD32 i;
 1967|  74.6k|                    if(use_left1)
  ------------------
  |  Branch (1967:24): [True: 74.6k, False: 0]
  ------------------
 1968|  74.6k|                    {
 1969|   373k|                        for(i = 0; i < 4; i++)
  ------------------
  |  Branch (1969:36): [True: 298k, False: 74.6k]
  ------------------
 1970|   298k|                            au2_ngbr_pels[8 - 1 - i] = pu2_left_uv[i
 1971|   298k|                                            * u4_recwidth_cr / YUV420SP_FACTOR];
  ------------------
  |  |  119|   298k|#define YUV420SP_FACTOR 2
  ------------------
 1972|  74.6k|                    }
 1973|      0|                    else
 1974|      0|                    {
 1975|      0|                        memset(au2_ngbr_pels + 4, 0, 4 * sizeof(UWORD16));
 1976|      0|                    }
 1977|       |
 1978|  74.6k|                    if(use_left2)
  ------------------
  |  Branch (1978:24): [True: 74.6k, False: 0]
  ------------------
 1979|  74.6k|                    {
 1980|   373k|                        for(i = 4; i < 8; i++)
  ------------------
  |  Branch (1980:36): [True: 298k, False: 74.6k]
  ------------------
 1981|   298k|                            au2_ngbr_pels[8 - 1 - i] = pu2_left_uv[i
 1982|   298k|                                            * u4_recwidth_cr / YUV420SP_FACTOR];
  ------------------
  |  |  119|   298k|#define YUV420SP_FACTOR 2
  ------------------
 1983|  74.6k|                    }
 1984|      0|                    else
 1985|      0|                    {
 1986|      0|                        memset(au2_ngbr_pels, 0, 4 * sizeof(UWORD16));
 1987|      0|                    }
 1988|       |
 1989|  74.6k|                }
 1990|  28.0k|                else
 1991|  28.0k|                {
 1992|  28.0k|                    memset(au2_ngbr_pels, 0, 8 * sizeof(UWORD16));
 1993|  28.0k|                }
 1994|       |
 1995|       |                /* top left pels */
 1996|   102k|                au2_ngbr_pels[8] = *pu2_topleft_uv;
 1997|       |
 1998|       |                /* top pels */
 1999|   102k|                if(uc_useTopMB)
  ------------------
  |  Branch (1999:20): [True: 71.6k, False: 31.0k]
  ------------------
 2000|  71.6k|                {
 2001|  71.6k|                    memcpy(au2_ngbr_pels + 8 + 1, pu1_top_u,
 2002|  71.6k|                           8 * sizeof(UWORD16));
 2003|  71.6k|                }
 2004|  31.0k|                else
 2005|  31.0k|                {
 2006|  31.0k|                    memset(au2_ngbr_pels + 8 + 1, 0, 8 * sizeof(UWORD16));
 2007|  31.0k|                }
 2008|       |
 2009|   102k|                PROFILE_DISABLE_INTRA_PRED()
  ------------------
  |  |  105|   102k|#define PROFILE_DISABLE_INTRA_PRED() ;
  ------------------
 2010|   102k|                ps_dec->apf_intra_pred_chroma[u1_intra_chrom_pred_mode](
 2011|   102k|                                pu1_ngbr_pels,
 2012|   102k|                                pu1_mb_cb_rei1_buffer,
 2013|   102k|                                1,
 2014|   102k|                                u4_recwidth_cr,
 2015|   102k|                                ((uc_useTopMB << 2) | (use_left2 << 4)
 2016|   102k|                                                | use_left1));
 2017|   102k|            }
 2018|       |
 2019|   102k|        }
 2020|       |
 2021|   147k|    }
 2022|   147k|    return OK;
  ------------------
  |  |  114|   147k|#define OK        0
  ------------------
 2023|   147k|}

ih264d_insert_pic_in_ref_pic_listx:
   66|   153k|{
   67|   153k|    *ps_ref_pic_buf_lx = *ps_pic;
   68|   153k|}
ih264d_mv_pred_ref_tfr_nby2_pmb:
   73|   887k|{
   74|   887k|    parse_pmbarams_t * ps_mb_part_info;
   75|   887k|    parse_part_params_t * ps_part;
   76|   887k|    mv_pred_t *ps_mv_nmb, *ps_mv_nmb_start, *ps_mv_ntop, *ps_mv_ntop_start;
   77|   887k|    UWORD32 i, j;
   78|   887k|    const UWORD32 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
   79|   887k|    dec_mb_info_t * ps_cur_mb_info;
   80|   887k|    WORD32 i2_mv_x, i2_mv_y;
   81|   887k|    WORD32 ret;
   82|       |
   83|   887k|    ps_dec->i4_submb_ofst -= (WORD32)(u4_num_mbs - u4_mb_idx) << 4;
   84|   887k|    ps_mb_part_info = ps_dec->ps_parse_mb_data; // + u4_mb_idx;
   85|   887k|    ps_part = ps_dec->ps_parse_part_params; // + u4_mb_idx;
   86|       |
   87|       |    /* N/2 Mb MvPred and Transfer Setup Loop */
   88|  6.67M|    for(i = u4_mb_idx; i < u4_num_mbs; i++, ps_mb_part_info++)
  ------------------
  |  Branch (88:24): [True: 5.79M, False: 887k]
  ------------------
   89|  5.79M|    {
   90|  5.79M|        UWORD32 u1_colz;
   91|  5.79M|        UWORD32 u1_field;
   92|  5.79M|        mv_pred_t s_mvPred;
   93|  5.79M|        mv_pred_t *ps_mv_pred = &s_mvPred;
   94|       |
   95|       |
   96|       |
   97|  5.79M|        *ps_mv_pred = ps_dec->s_default_mv_pred;
   98|       |
   99|  5.79M|        ps_dec->i4_submb_ofst += SUB_BLK_SIZE;
  ------------------
  |  |  562|  5.79M|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  5.79M|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  5.79M|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
  100|       |
  101|       |        /* Restore the slice scratch MbX and MbY context */
  102|  5.79M|        ps_cur_mb_info = ps_dec->ps_nmb_info + i;
  103|  5.79M|        u1_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  104|       |
  105|       |
  106|       |
  107|  5.79M|        ps_mv_nmb_start = ps_dec->ps_mv_cur + (i << 4);
  108|  5.79M|        ps_dec->u2_mbx = ps_cur_mb_info->u2_mbx;
  109|  5.79M|        ps_dec->u2_mby = ps_cur_mb_info->u2_mby;
  110|  5.79M|        ps_dec->u2_mv_2mb[i & 0x1] = 0;
  111|       |
  112|       |        /* Look for MV Prediction and Reference Transfer in Non-I Mbs */
  113|  5.79M|        if(!ps_mb_part_info->u4_isI_mb)
  ------------------
  |  Branch (113:12): [True: 5.76M, False: 27.3k]
  ------------------
  114|  5.76M|        {
  115|  5.76M|            UWORD32 u1_blk_no;
  116|  5.76M|            WORD32 i1_ref_idx, i1_ref_idx1;
  117|  5.76M|            UWORD32 u1_sub_mb_x, u1_sub_mb_y, u1_sub_mb_num;
  118|  5.76M|            UWORD32 u1_num_part, u1_num_ref, u1_wd, u1_ht;
  119|  5.76M|            UWORD32 *pu4_wt_offst, **ppu4_wt_ofst;
  120|  5.76M|            UWORD32 u1_scale_ref, u4_bot_mb;
  121|  5.76M|            WORD8 *pi1_ref_idx = ps_mb_part_info->i1_ref_idx[0];
  122|  5.76M|            pic_buffer_t *ps_ref_frame, **pps_ref_frame;
  123|  5.76M|            deblk_mb_t * ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + i;
  124|       |
  125|       |            /* MB Level initialisations */
  126|  5.76M|            ps_dec->u4_num_pmbair = i >> u1_mbaff;
  127|  5.76M|            ps_dec->u4_mb_idx_mv = i;
  128|  5.76M|            ppu4_wt_ofst = ps_mb_part_info->pu4_wt_offst;
  129|  5.76M|            pps_ref_frame = ps_dec->ps_ref_pic_buf_lx[0];
  130|       |            /* CHANGED CODE */
  131|  5.76M|            ps_mv_ntop_start = ps_mv_nmb_start
  132|  5.76M|                            - (ps_dec->u2_frm_wd_in_mbs << (4 + u1_mbaff)) + 12;
  133|       |
  134|  5.76M|            u1_num_part = ps_mb_part_info->u1_num_part;
  135|  5.76M|            ps_cur_deblk_mb->u1_mb_type |= (u1_num_part > 1) << 1;
  136|  5.76M|            ps_cur_mb_info->u4_pred_info_pkd_idx = ps_dec->u4_pred_info_pkd_idx;
  137|  5.76M|            ps_cur_mb_info->u1_num_pred_parts = 0;
  138|       |
  139|       |
  140|       |            /****************************************************/
  141|       |            /* weighted u4_ofst pointer calculations, this loop  */
  142|       |            /* runs maximum 4 times, even in direct cases       */
  143|       |            /****************************************************/
  144|  5.76M|            u1_scale_ref = u1_mbaff & u1_field;
  145|       |
  146|  5.76M|            u4_bot_mb = 1 - ps_cur_mb_info->u1_topmb;
  147|  5.76M|            if(ps_dec->ps_cur_pps->u1_wted_pred_flag)
  ------------------
  |  Branch (147:16): [True: 3.34M, False: 2.41M]
  ------------------
  148|  3.34M|            {
  149|  3.34M|                u1_num_ref = MIN(u1_num_part, 4);
  ------------------
  |  |   61|  3.34M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 3.33M, False: 11.8k]
  |  |  ------------------
  ------------------
  150|  6.73M|                for(u1_blk_no = 0; u1_blk_no < u1_num_ref; u1_blk_no++)
  ------------------
  |  Branch (150:36): [True: 3.38M, False: 3.34M]
  ------------------
  151|  3.38M|                {
  152|  3.38M|                    i1_ref_idx = pi1_ref_idx[u1_blk_no];
  153|  3.38M|                    if(u1_scale_ref)
  ------------------
  |  Branch (153:24): [True: 0, False: 3.38M]
  ------------------
  154|      0|                        i1_ref_idx >>= 1;
  155|  3.38M|                    pu4_wt_offst = (UWORD32*)&ps_dec->pu4_wt_ofsts[2
  156|  3.38M|                                    * X3(i1_ref_idx)];
  ------------------
  |  |   92|  3.38M|#define X3(a)   (((a) << 1) + (a))
  ------------------
  157|  3.38M|                    ppu4_wt_ofst[u1_blk_no] = pu4_wt_offst;
  158|  3.38M|                }
  159|  3.34M|            }
  160|  2.41M|            else
  161|  2.41M|            {
  162|  2.41M|                ppu4_wt_ofst[0] = NULL;
  163|  2.41M|                ppu4_wt_ofst[1] = NULL;
  164|  2.41M|                ppu4_wt_ofst[2] = NULL;
  165|  2.41M|                ppu4_wt_ofst[3] = NULL;
  166|  2.41M|            }
  167|       |
  168|       |            /**************************************************/
  169|       |            /* Loop on Partitions                             */
  170|       |            /**************************************************/
  171|  11.6M|            for(j = 0; j < u1_num_part; j++, ps_part++)
  ------------------
  |  Branch (171:24): [True: 5.91M, False: 5.76M]
  ------------------
  172|  5.91M|            {
  173|       |
  174|  5.91M|                u1_sub_mb_num = ps_part->u1_sub_mb_num;
  175|  5.91M|                ps_dec->u1_sub_mb_num = u1_sub_mb_num;
  176|       |
  177|  5.91M|                if(PART_NOT_DIRECT != ps_part->u1_is_direct)
  ------------------
  |  |  569|  5.91M|#define PART_NOT_DIRECT                0
  ------------------
  |  Branch (177:20): [True: 5.62M, False: 282k]
  ------------------
  178|  5.62M|                {
  179|       |                    /* Mb Skip Mode */
  180|       |                    /* Setting the default and other members of MvPred Structure */
  181|  5.62M|                    s_mvPred.i2_mv[2] = -1;
  182|  5.62M|                    s_mvPred.i2_mv[3] = -1;
  183|  5.62M|                    s_mvPred.i1_ref_frame[0] = 0;
  184|  5.62M|                    i1_ref_idx = (u1_scale_ref && u4_bot_mb) ? MAX_REF_BUFS : 0;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (184:35): [True: 0, False: 5.62M]
  |  Branch (184:51): [True: 0, False: 0]
  ------------------
  185|  5.62M|                    ps_ref_frame = pps_ref_frame[i1_ref_idx];
  186|  5.62M|                    s_mvPred.u1_col_ref_pic_idx = ps_ref_frame->u1_mv_buf_id;
  187|  5.62M|                    s_mvPred.u1_pic_type = ps_ref_frame->u1_pic_type;
  188|  5.62M|                    pu4_wt_offst = (UWORD32*)&ps_dec->pu4_wt_ofsts[0];
  189|       |
  190|  5.62M|                    ps_dec->pf_mvpred(ps_dec, ps_cur_mb_info, ps_mv_nmb_start,
  191|  5.62M|                                      ps_mv_ntop_start, &s_mvPred, 0, 4, 0, 1,
  192|  5.62M|                                      MB_SKIP);
  ------------------
  |  |  456|  5.62M|#define MB_SKIP     255
  ------------------
  193|       |
  194|       |
  195|       |
  196|       |
  197|       |
  198|       |
  199|  5.62M|                    {
  200|  5.62M|                        pred_info_pkd_t *ps_pred_pkd;
  201|  5.62M|                        ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  202|  5.62M|                    ih264d_fill_pred_info (s_mvPred.i2_mv,4,4,0,PRED_L0,ps_pred_pkd,ps_ref_frame->u1_pic_buf_id,
  ------------------
  |  |  483|  5.62M|#define PRED_L0   1
  ------------------
  203|  5.62M|                                           (i1_ref_idx >> u1_scale_ref),pu4_wt_offst,
  204|  5.62M|                                           ps_ref_frame->u1_pic_type);
  205|       |
  206|       |
  207|  5.62M|                    ps_dec->u4_pred_info_pkd_idx++;
  208|  5.62M|                    ps_cur_mb_info->u1_num_pred_parts++;
  209|  5.62M|                    }
  210|       |
  211|       |
  212|       |
  213|       |                    /* Storing colocated zero information */
  214|  5.62M|                    u1_colz = ((ABS(s_mvPred.i2_mv[0]) <= 1)
  ------------------
  |  |  100|  5.62M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 8.87k, False: 5.62M]
  |  |  ------------------
  ------------------
  |  Branch (214:32): [True: 5.61M, False: 10.4k]
  ------------------
  215|  5.61M|                                    && (ABS(s_mvPred.i2_mv[1]) <= 1))
  ------------------
  |  |  100|  5.61M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 1.10k, False: 5.61M]
  |  |  ------------------
  ------------------
  |  Branch (215:40): [True: 5.61M, False: 3.41k]
  ------------------
  216|  5.62M|                                    + (u1_field << 1);
  217|       |
  218|  5.62M|                    ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0,
  219|  5.62M|                                       u1_colz, 4, 4);
  220|  5.62M|                }
  221|   282k|                else
  222|   282k|                {
  223|   282k|                    u1_sub_mb_x = u1_sub_mb_num & 0x03;
  224|   282k|                    u1_sub_mb_y = u1_sub_mb_num >> 2;
  225|   282k|                    u1_blk_no =
  226|   282k|                                    (u1_num_part < 4) ?
  ------------------
  |  Branch (226:37): [True: 169k, False: 113k]
  ------------------
  227|   169k|                                                    j :
  228|   282k|                                                    (((u1_sub_mb_y >> 1) << 1)
  229|   113k|                                                                    + (u1_sub_mb_x
  230|   113k|                                                                                    >> 1));
  231|       |
  232|   282k|                    ps_mv_ntop = ps_mv_ntop_start + u1_sub_mb_x;
  233|   282k|                    ps_mv_nmb = ps_mv_nmb_start + u1_sub_mb_num;
  234|       |
  235|   282k|                    u1_wd = ps_part->u1_partwidth;
  236|   282k|                    u1_ht = ps_part->u1_partheight;
  237|       |
  238|       |                    /* Populate the colpic info and reference frames */
  239|   282k|                    i1_ref_idx = pi1_ref_idx[u1_blk_no];
  240|   282k|                    s_mvPred.i1_ref_frame[0] = i1_ref_idx;
  241|       |
  242|       |                    /********************************************************/
  243|       |                    /* Predict Mv                                           */
  244|       |                    /* Add Mv Residuals and store back                      */
  245|       |                    /********************************************************/
  246|   282k|                    ps_dec->pf_mvpred(ps_dec, ps_cur_mb_info, ps_mv_nmb, ps_mv_ntop,
  247|   282k|                                      &s_mvPred, u1_sub_mb_num, u1_wd, 0, 1,
  248|   282k|                                      ps_cur_mb_info->u1_mb_mc_mode);
  249|   282k|                    i2_mv_x = ps_mv_nmb->i2_mv[0];
  250|   282k|                    i2_mv_y = ps_mv_nmb->i2_mv[1];
  251|   282k|                    i2_mv_x += s_mvPred.i2_mv[0];
  252|   282k|                    i2_mv_y += s_mvPred.i2_mv[1];
  253|   282k|                    s_mvPred.i2_mv[0] = i2_mv_x;
  254|   282k|                    s_mvPred.i2_mv[1] = i2_mv_y;
  255|       |
  256|       |                    /********************************************************/
  257|       |                    /* Transfer setup call                                  */
  258|       |                    /* convert RefIdx if it is MbAff                        */
  259|       |                    /* Pass Weight Offset and refFrame                      */
  260|       |                    /********************************************************/
  261|   282k|                    i1_ref_idx1 = i1_ref_idx >> u1_scale_ref;
  262|   282k|                    if(u1_scale_ref && ((i1_ref_idx & 0x01) != u4_bot_mb))
  ------------------
  |  Branch (262:24): [True: 0, False: 282k]
  |  Branch (262:40): [True: 0, False: 0]
  ------------------
  263|      0|                        i1_ref_idx1 += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  264|   282k|                    ps_ref_frame = pps_ref_frame[i1_ref_idx1];
  265|   282k|                    pu4_wt_offst = ppu4_wt_ofst[u1_blk_no];
  266|       |
  267|       |
  268|       |
  269|       |
  270|       |
  271|       |
  272|   282k|                    {
  273|   282k|                    pred_info_pkd_t *ps_pred_pkd;
  274|   282k|                    ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  275|   282k|                    ih264d_fill_pred_info (s_mvPred.i2_mv,u1_wd,u1_ht,u1_sub_mb_num,PRED_L0,ps_pred_pkd,
  ------------------
  |  |  483|   282k|#define PRED_L0   1
  ------------------
  276|   282k|                                           ps_ref_frame->u1_pic_buf_id,(i1_ref_idx >> u1_scale_ref),pu4_wt_offst,
  277|   282k|                                           ps_ref_frame->u1_pic_type);
  278|       |
  279|   282k|                    ps_dec->u4_pred_info_pkd_idx++;
  280|   282k|                    ps_cur_mb_info->u1_num_pred_parts++;
  281|   282k|                    }
  282|       |
  283|       |
  284|       |
  285|       |                    /* Fill colocated info in MvPred structure */
  286|   282k|                    s_mvPred.u1_col_ref_pic_idx = ps_ref_frame->u1_mv_buf_id;
  287|   282k|                    s_mvPred.u1_pic_type = ps_ref_frame->u1_pic_type;
  288|       |
  289|       |                    /* Calculating colocated zero information */
  290|   282k|                    u1_colz =
  291|   282k|                                    (u1_field << 1)
  292|   282k|                                                    | ((i1_ref_idx == 0)
  ------------------
  |  Branch (292:56): [True: 212k, False: 70.0k]
  ------------------
  293|   212k|                                                                    && (ABS(i2_mv_x)
  ------------------
  |  |  100|   212k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 48.7k, False: 163k]
  |  |  ------------------
  ------------------
  |  Branch (293:72): [True: 122k, False: 90.1k]
  ------------------
  294|   212k|                                                                                    <= 1)
  295|   122k|                                                                    && (ABS(i2_mv_y)
  ------------------
  |  |  100|   122k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 20.6k, False: 101k]
  |  |  ------------------
  ------------------
  |  Branch (295:72): [True: 97.5k, False: 24.6k]
  ------------------
  296|   122k|                                                                                    <= 1));
  297|   282k|                    u1_colz |= ps_mb_part_info->u1_col_info[u1_blk_no];
  298|       |
  299|       |                    /* Replicate the motion vectors and colzero u4_flag  */
  300|       |                    /* for all sub-partitions                         */
  301|       |
  302|   282k|                    ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb,
  303|   282k|                                       u1_sub_mb_num, u1_colz, u1_ht,
  304|   282k|                                       u1_wd);
  305|   282k|                }
  306|  5.91M|            }
  307|       |
  308|  5.76M|        }
  309|  27.3k|        else
  310|  27.3k|        {
  311|       |            /* Storing colocated zero information */
  312|  27.3k|            ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0,
  313|  27.3k|                               (UWORD8)(u1_field << 1), 4, 4);
  314|       |
  315|  27.3k|        }
  316|       |        /*if num _cores is set to 3,compute bs will be done in another thread*/
  317|  5.79M|        if(ps_dec->u4_num_cores < 3)
  ------------------
  |  Branch (317:12): [True: 5.79M, False: 0]
  ------------------
  318|  5.79M|        {
  319|       |
  320|  5.79M|            if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (320:16): [True: 5.79M, False: 0]
  ------------------
  321|  5.79M|                ps_dec->pf_compute_bs(ps_dec, ps_cur_mb_info,
  322|  5.79M|                                     (UWORD16)(i >> u1_mbaff));
  323|  5.79M|        }
  324|  5.79M|    }
  325|       |
  326|       |
  327|       |
  328|   887k|    return OK;
  ------------------
  |  |  114|   887k|#define OK        0
  ------------------
  329|   887k|}
ih264d_decode_recon_tfr_nmb:
  338|   889k|{
  339|   889k|    WORD32 i,j;
  340|   889k|    UWORD32 u1_end_of_row_next;
  341|   889k|    dec_mb_info_t * ps_cur_mb_info;
  342|   889k|    UWORD32 u4_update_mbaff = 0;
  343|   889k|    WORD32 ret;
  344|   889k|    const UWORD32 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  345|   889k|    const UWORD32 u1_slice_type = ps_dec->ps_cur_slice->u1_slice_type;
  346|   889k|    const WORD32 u1_skip_th = (
  347|   889k|                    (u1_slice_type != I_SLICE) ?
  ------------------
  |  |  370|   889k|#define I_SLICE  2
  ------------------
  |  Branch (347:21): [True: 881k, False: 8.33k]
  ------------------
  348|   881k|                                    (ps_dec->u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  480|   462k|#define B_8x8    22
  ------------------
                                                  (ps_dec->u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  454|   418k|#define PRED_8x8R0  4
  ------------------
  |  Branch (348:38): [True: 462k, False: 418k]
  ------------------
  349|   889k|    const UWORD32 u1_ipcm_th = (
  350|   889k|                    (u1_slice_type != I_SLICE) ? (ps_dec->u1_B ? 23 : 5) : 0);
  ------------------
  |  |  370|   889k|#define I_SLICE  2
  ------------------
  |  Branch (350:21): [True: 881k, False: 8.33k]
  |  Branch (350:51): [True: 462k, False: 418k]
  ------------------
  351|       |
  352|       |
  353|       |
  354|       |
  355|       |
  356|       |    /* N Mb MC Loop */
  357|  5.62M|    for(i = u4_mb_idx; i < u4_num_mbs; i++)
  ------------------
  |  Branch (357:24): [True: 4.73M, False: 889k]
  ------------------
  358|  4.73M|    {
  359|  4.73M|        ps_cur_mb_info = ps_dec->ps_nmb_info + i;
  360|  4.73M|        ps_dec->u4_dma_buf_idx = 0;
  361|  4.73M|        ps_dec->u4_pred_info_idx = 0;
  362|       |
  363|  4.73M|        if(ps_cur_mb_info->u1_mb_type <= u1_skip_th)
  ------------------
  |  Branch (363:12): [True: 111k, False: 4.62M]
  ------------------
  364|   111k|        {
  365|   111k|            {
  366|   111k|                WORD32 pred_cnt = 0;
  367|   111k|                pred_info_pkd_t *ps_pred_pkd;
  368|   111k|                UWORD32 u4_pred_info_pkd_idx;
  369|   111k|                WORD8 i1_pred;
  370|       |
  371|   111k|                u4_pred_info_pkd_idx = ps_cur_mb_info->u4_pred_info_pkd_idx;
  372|       |
  373|   373k|                while(pred_cnt < ps_cur_mb_info->u1_num_pred_parts)
  ------------------
  |  Branch (373:23): [True: 261k, False: 111k]
  ------------------
  374|   261k|                {
  375|       |
  376|   261k|                    ps_pred_pkd = ps_dec->ps_pred_pkd + u4_pred_info_pkd_idx;
  377|       |
  378|   261k|                     ps_dec->p_form_mb_part_info(ps_pred_pkd,ps_dec,
  379|   261k|                                               ps_cur_mb_info->u2_mbx,ps_cur_mb_info->u2_mby,(i >> u1_mbaff),
  380|   261k|                                         ps_cur_mb_info);
  381|   261k|                    u4_pred_info_pkd_idx++;
  382|   261k|                    pred_cnt++;
  383|   261k|                }
  384|   111k|            }
  385|       |
  386|   111k|            ps_dec->p_motion_compensate(ps_dec, ps_cur_mb_info);
  387|       |
  388|   111k|        }
  389|  4.62M|        else if(ps_cur_mb_info->u1_mb_type == MB_SKIP)
  ------------------
  |  |  456|  4.62M|#define MB_SKIP     255
  ------------------
  |  Branch (389:17): [True: 4.57M, False: 48.8k]
  ------------------
  390|  4.57M|        {
  391|  4.57M|            {
  392|  4.57M|                WORD32 pred_cnt = 0;
  393|  4.57M|                pred_info_pkd_t *ps_pred_pkd;
  394|  4.57M|                UWORD32 u4_pred_info_pkd_idx;
  395|  4.57M|                WORD8 i1_pred;
  396|       |
  397|  4.57M|                u4_pred_info_pkd_idx = ps_cur_mb_info->u4_pred_info_pkd_idx;
  398|       |
  399|  9.38M|                while(pred_cnt < ps_cur_mb_info->u1_num_pred_parts)
  ------------------
  |  Branch (399:23): [True: 4.81M, False: 4.57M]
  ------------------
  400|  4.81M|                {
  401|       |
  402|  4.81M|                    ps_pred_pkd = ps_dec->ps_pred_pkd + u4_pred_info_pkd_idx;
  403|       |
  404|  4.81M|                    ps_dec->p_form_mb_part_info(ps_pred_pkd,ps_dec,
  405|  4.81M|                                               ps_cur_mb_info->u2_mbx,ps_cur_mb_info->u2_mby,(i >> u1_mbaff),
  406|  4.81M|                                         ps_cur_mb_info);
  407|       |
  408|  4.81M|                    u4_pred_info_pkd_idx++;
  409|  4.81M|                    pred_cnt++;
  410|  4.81M|                }
  411|  4.57M|            }
  412|       |            /* Decode MB skip */
  413|  4.57M|            ps_dec->p_motion_compensate(ps_dec, ps_cur_mb_info);
  414|       |
  415|  4.57M|        }
  416|       |
  417|  4.73M|     }
  418|       |
  419|       |
  420|       |    /* N Mb IQ IT RECON  Loop */
  421|  5.62M|    for(j = u4_mb_idx; j < i; j++)
  ------------------
  |  Branch (421:24): [True: 4.73M, False: 889k]
  ------------------
  422|  4.73M|    {
  423|  4.73M|        ps_cur_mb_info = ps_dec->ps_nmb_info + j;
  424|       |
  425|  4.73M|        if(ps_cur_mb_info->u1_mb_type <= u1_skip_th)
  ------------------
  |  Branch (425:12): [True: 111k, False: 4.62M]
  ------------------
  426|   111k|        {
  427|   111k|            ih264d_process_inter_mb(ps_dec, ps_cur_mb_info, j);
  428|       |
  429|   111k|        }
  430|  4.62M|        else if(ps_cur_mb_info->u1_mb_type != MB_SKIP)
  ------------------
  |  |  456|  4.62M|#define MB_SKIP     255
  ------------------
  |  Branch (430:17): [True: 48.8k, False: 4.57M]
  ------------------
  431|  48.8k|        {
  432|  48.8k|            if((u1_ipcm_th + 25) != ps_cur_mb_info->u1_mb_type)
  ------------------
  |  Branch (432:16): [True: 48.5k, False: 368]
  ------------------
  433|  48.5k|            {
  434|  48.5k|                ps_cur_mb_info->u1_mb_type -= (u1_skip_th + 1);
  435|  48.5k|                ih264d_process_intra_mb(ps_dec, ps_cur_mb_info, j);
  436|  48.5k|            }
  437|  48.8k|        }
  438|       |
  439|       |
  440|  4.73M|        if(ps_dec->u4_use_intrapred_line_copy)
  ------------------
  |  Branch (440:12): [True: 4.73M, False: 0]
  ------------------
  441|  4.73M|        {
  442|  4.73M|            ih264d_copy_intra_pred_line(ps_dec, ps_cur_mb_info, j);
  443|  4.73M|        }
  444|       |
  445|  4.73M|    }
  446|       |
  447|       |    /*N MB deblocking*/
  448|   889k|    if(ps_dec->u4_nmb_deblk == 1)
  ------------------
  |  Branch (448:8): [True: 889k, False: 0]
  ------------------
  449|   889k|    {
  450|       |
  451|   889k|        UWORD32 u4_cur_mb, u4_right_mb;
  452|   889k|        UWORD32 u4_mb_x, u4_mb_y;
  453|   889k|        UWORD32 u4_wd_y, u4_wd_uv;
  454|   889k|        tfr_ctxt_t *ps_tfr_cxt = &(ps_dec->s_tran_addrecon);
  455|   889k|        UWORD8 u1_field_pic_flag = ps_dec->ps_cur_slice->u1_field_pic_flag;
  456|   889k|        const WORD32 i4_cb_qp_idx_ofst =
  457|   889k|                       ps_dec->ps_cur_pps->i1_chroma_qp_index_offset;
  458|   889k|        const WORD32 i4_cr_qp_idx_ofst =
  459|   889k|                       ps_dec->ps_cur_pps->i1_second_chroma_qp_index_offset;
  460|       |
  461|   889k|        u4_wd_y = ps_dec->u2_frm_wd_y << u1_field_pic_flag;
  462|   889k|        u4_wd_uv = ps_dec->u2_frm_wd_uv << u1_field_pic_flag;
  463|       |
  464|       |
  465|   889k|        ps_cur_mb_info = ps_dec->ps_nmb_info + u4_mb_idx;
  466|       |
  467|   889k|        ps_dec->u4_deblk_mb_x = ps_cur_mb_info->u2_mbx;
  468|   889k|        ps_dec->u4_deblk_mb_y = ps_cur_mb_info->u2_mby;
  469|       |
  470|  5.62M|        for(j = u4_mb_idx; j < i; j++)
  ------------------
  |  Branch (470:28): [True: 4.73M, False: 889k]
  ------------------
  471|  4.73M|        {
  472|       |
  473|  4.73M|            ih264d_deblock_mb_nonmbaff(ps_dec, ps_tfr_cxt,
  474|  4.73M|                                       i4_cb_qp_idx_ofst, i4_cr_qp_idx_ofst,
  475|  4.73M|                                        u4_wd_y, u4_wd_uv);
  476|       |
  477|       |
  478|  4.73M|        }
  479|       |
  480|       |
  481|       |
  482|   889k|    }
  483|       |
  484|       |
  485|       |
  486|   889k|    if(u4_tfr_n_mb)
  ------------------
  |  Branch (486:8): [True: 889k, False: 0]
  ------------------
  487|   889k|    {
  488|       |        /****************************************************************/
  489|       |        /* Check for End Of Row in Next iteration                       */
  490|       |        /****************************************************************/
  491|   889k|        u1_end_of_row_next =
  492|   889k|                        u4_num_mbs_next
  ------------------
  |  Branch (492:25): [True: 10.0k, False: 879k]
  ------------------
  493|  10.0k|                                        && (u4_num_mbs_next
  ------------------
  |  Branch (493:44): [True: 10.0k, False: 0]
  ------------------
  494|  10.0k|                                                        <= (ps_dec->u4_recon_mb_grp
  495|  10.0k|                                                                        >> u1_mbaff));
  496|       |
  497|       |        /****************************************************************/
  498|       |        /* Transfer the Following things                                */
  499|       |        /* N-Mb DeblkParams Data    ( To Ext DeblkParams Buffer )       */
  500|       |        /* N-Mb Recon Data          ( To Ext Frame Buffer )             */
  501|       |        /* N-Mb Intrapredline Data  ( Updated Internally)               */
  502|       |        /* N-Mb MV Data             ( To Ext MV Buffer )                */
  503|       |        /* N-Mb MVTop/TopRight Data ( To Int MV Top Scratch Buffers)    */
  504|       |        /****************************************************************/
  505|   889k|        ih264d_transfer_mb_group_data(ps_dec, u4_num_mbs, u4_end_of_row,
  506|   889k|                                      u1_end_of_row_next);
  507|   889k|        ps_dec->u4_num_mbs_prev_nmb = u4_num_mbs;
  508|       |
  509|   889k|        ps_dec->u4_pred_info_idx = 0;
  510|   889k|        ps_dec->u4_dma_buf_idx = 0;
  511|       |
  512|       |
  513|   889k|    }
  514|   889k|    return OK;
  ------------------
  |  |  114|   889k|#define OK        0
  ------------------
  515|   889k|}
ih264d_process_inter_mb:
  532|   364k|{
  533|       |    /* CHANGED CODE */
  534|   364k|    UWORD8 *pu1_rec_y, *pu1_rec_u, *pu1_rec_v;
  535|       |
  536|       |    /*CHANGED CODE */
  537|   364k|    UWORD32 ui_rec_width, u4_recwidth_cr;
  538|   364k|    WORD16 *pi2_y_coeff;
  539|   364k|    UWORD32 u1_mb_field_decoding_flag;
  540|   364k|    const UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  541|   364k|    UWORD32 uc_botMb;
  542|   364k|    UWORD32 u4_num_pmbair;
  543|       |    /* CHANGED CODE */
  544|   364k|    tfr_ctxt_t *ps_frame_buf = ps_dec->ps_frame_buf_ip_recon;
  545|   364k|    UWORD32 u4_luma_dc_only_csbp = 0;
  546|   364k|    UWORD32 u4_luma_dc_only_cbp = 0;
  547|       |    /* CHANGED CODE */
  548|       |
  549|   364k|    uc_botMb = 1 - ps_cur_mb_info->u1_topmb;
  550|   364k|    u4_num_pmbair = (u4_mb_num >> u1_mbaff);
  551|   364k|    u1_mb_field_decoding_flag = ps_cur_mb_info->u1_mb_field_decodingflag;
  552|       |
  553|       |
  554|       |    /* CHANGED CODE */
  555|   364k|    pu1_rec_y = ps_frame_buf->pu1_dest_y + (u4_num_pmbair << 4);
  556|   364k|    pu1_rec_u =
  557|   364k|                    ps_frame_buf->pu1_dest_u
  558|   364k|                                    + (u4_num_pmbair << 3) * YUV420SP_FACTOR;
  ------------------
  |  |  119|   364k|#define YUV420SP_FACTOR 2
  ------------------
  559|   364k|    pu1_rec_v = ps_frame_buf->pu1_dest_v + (u4_num_pmbair << 3);
  560|   364k|    ui_rec_width = ps_dec->u2_frm_wd_y << u1_mb_field_decoding_flag;
  561|   364k|    u4_recwidth_cr = ps_dec->u2_frm_wd_uv << u1_mb_field_decoding_flag;
  562|       |
  563|       |    /* CHANGED CODE */
  564|       |
  565|   364k|    if(u1_mbaff)
  ------------------
  |  Branch (565:8): [True: 0, False: 364k]
  ------------------
  566|      0|    {
  567|      0|        if(uc_botMb)
  ------------------
  |  Branch (567:12): [True: 0, False: 0]
  ------------------
  568|      0|        {
  569|      0|            pu1_rec_y += (u1_mb_field_decoding_flag ?
  ------------------
  |  Branch (569:27): [True: 0, False: 0]
  ------------------
  570|      0|                            (ui_rec_width >> 1) : (ui_rec_width << 4));
  571|      0|            pu1_rec_u += (u1_mb_field_decoding_flag ?
  ------------------
  |  Branch (571:27): [True: 0, False: 0]
  ------------------
  572|      0|                            (u4_recwidth_cr >> 1) : (u4_recwidth_cr << 3));
  573|      0|            pu1_rec_v += (u1_mb_field_decoding_flag ?
  ------------------
  |  Branch (573:27): [True: 0, False: 0]
  ------------------
  574|      0|                            (u4_recwidth_cr >> 1) : (u4_recwidth_cr << 3));
  575|      0|        }
  576|      0|    }
  577|       |
  578|   364k|    if(!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (578:8): [True: 355k, False: 9.12k]
  ------------------
  579|   355k|    {
  580|   355k|        u4_luma_dc_only_csbp = ih264d_unpack_luma_coeff4x4_mb(ps_dec,
  581|   355k|                                       ps_cur_mb_info,
  582|   355k|                                       0);
  583|   355k|    }
  584|  9.12k|    else
  585|  9.12k|    {
  586|  9.12k|        if(!ps_dec->ps_cur_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (586:12): [True: 2.68k, False: 6.44k]
  ------------------
  587|  2.68k|        {
  588|  2.68k|            u4_luma_dc_only_cbp = ih264d_unpack_luma_coeff4x4_mb(ps_dec,
  589|  2.68k|                                           ps_cur_mb_info,
  590|  2.68k|                                           0);
  591|  2.68k|        }
  592|  6.44k|        else
  593|  6.44k|        {
  594|  6.44k|            u4_luma_dc_only_cbp = ih264d_unpack_luma_coeff8x8_mb(ps_dec,
  595|  6.44k|                                           ps_cur_mb_info);
  596|  6.44k|        }
  597|  9.12k|    }
  598|       |
  599|   364k|    pi2_y_coeff = ps_dec->pi2_coeff_data;
  600|       |    /* Inverse Transform and Reconstruction */
  601|   364k|    if(ps_cur_mb_info->u1_cbp & 0x0f)
  ------------------
  |  Branch (601:8): [True: 62.9k, False: 301k]
  ------------------
  602|  62.9k|    {
  603|       |        /* CHANGED CODE */
  604|  62.9k|        if(!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (604:12): [True: 53.8k, False: 9.12k]
  ------------------
  605|  53.8k|        {
  606|  53.8k|            UWORD32 i;
  607|  53.8k|            WORD16 ai2_tmp[16];
  608|   914k|            for(i = 0; i < 16; i++)
  ------------------
  |  Branch (608:24): [True: 861k, False: 53.8k]
  ------------------
  609|   861k|            {
  610|   861k|                if(CHECKBIT(ps_cur_mb_info->u2_luma_csbp, i))
  ------------------
  |  |   54|   861k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 143k, False: 717k]
  |  |  ------------------
  ------------------
  611|   143k|                {
  612|   143k|                    WORD16 *pi2_level = pi2_y_coeff + (i << 4);
  613|   143k|                    UWORD8 *pu1_pred_sblk = pu1_rec_y + ((i & 0x3) * BLK_SIZE)
  ------------------
  |  |  556|   143k|#define BLK_SIZE             4
  ------------------
  614|   143k|                                    + (i >> 2) * (ui_rec_width << 2);
  615|   143k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|   143k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
  616|   143k|                    {
  617|   143k|                        if(CHECKBIT(u4_luma_dc_only_csbp, i))
  ------------------
  |  |   54|   143k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 24.1k, False: 119k]
  |  |  ------------------
  ------------------
  618|  24.1k|                        {
  619|  24.1k|                            ps_dec->pf_iquant_itrans_recon_luma_4x4_dc(
  620|  24.1k|                                            pi2_level,
  621|  24.1k|                                            pu1_pred_sblk,
  622|  24.1k|                                            pu1_pred_sblk,
  623|  24.1k|                                            ui_rec_width,
  624|  24.1k|                                            ui_rec_width,
  625|  24.1k|                                            gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qp_rem6],
  626|  24.1k|                                            (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[3],
  627|  24.1k|                                            ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0,
  628|  24.1k|                                            NULL);
  629|  24.1k|                        }
  630|   119k|                        else
  631|   119k|                        {
  632|   119k|                            ps_dec->pf_iquant_itrans_recon_luma_4x4(
  633|   119k|                                            pi2_level,
  634|   119k|                                            pu1_pred_sblk,
  635|   119k|                                            pu1_pred_sblk,
  636|   119k|                                            ui_rec_width,
  637|   119k|                                            ui_rec_width,
  638|   119k|                                            gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qp_rem6],
  639|   119k|                                            (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[3],
  640|   119k|                                            ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0,
  641|   119k|                                            NULL);
  642|   119k|                        }
  643|   143k|                    }
  644|   143k|                }
  645|   861k|            }
  646|  53.8k|        }
  647|  9.12k|        else
  648|  9.12k|        {
  649|  9.12k|            WORD16 *pi2_scale_matrix_ptr;
  650|  9.12k|            WORD32 i;
  651|       |
  652|  9.12k|            pi2_scale_matrix_ptr =
  653|  9.12k|                            ps_dec->s_high_profile.i2_scalinglist8x8[1];
  654|       |
  655|  45.6k|            for(i = 0; i < 4; i++)
  ------------------
  |  Branch (655:24): [True: 36.5k, False: 9.12k]
  ------------------
  656|  36.5k|            {
  657|  36.5k|                WORD16 ai2_tmp[64];
  658|  36.5k|                WORD16 *pi16_levelBlock = pi2_y_coeff + (i << 6); /* move to the next 8x8 adding 64 */
  659|       |
  660|  36.5k|                UWORD8 *pu1_pred_sblk = pu1_rec_y + ((i & 0x1) * BLK8x8SIZE)
  ------------------
  |  |  555|  36.5k|#define BLK8x8SIZE          8
  ------------------
  661|  36.5k|                                + (i >> 1) * (ui_rec_width << 3);
  662|  36.5k|                if(CHECKBIT(ps_cur_mb_info->u1_cbp, i))
  ------------------
  |  |   54|  36.5k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 21.0k, False: 15.4k]
  |  |  ------------------
  ------------------
  663|  21.0k|                {
  664|  21.0k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  21.0k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
  665|  21.0k|                    {
  666|  21.0k|                        if(CHECKBIT(u4_luma_dc_only_cbp, i))
  ------------------
  |  |   54|  21.0k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 827, False: 20.2k]
  |  |  ------------------
  ------------------
  667|    827|                        {
  668|    827|                            ps_dec->pf_iquant_itrans_recon_luma_8x8_dc(
  669|    827|                                            pi16_levelBlock,
  670|    827|                                            pu1_pred_sblk,
  671|    827|                                            pu1_pred_sblk,
  672|    827|                                            ui_rec_width,
  673|    827|                                            ui_rec_width,
  674|    827|                                            gau1_ih264d_dequant8x8_cavlc[ps_cur_mb_info->u1_qp_rem6],
  675|    827|                                            (UWORD16 *)pi2_scale_matrix_ptr,
  676|    827|                                            ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0,
  677|    827|                                            NULL);
  678|    827|                        }
  679|  20.2k|                        else
  680|  20.2k|                        {
  681|  20.2k|                            ps_dec->pf_iquant_itrans_recon_luma_8x8(
  682|  20.2k|                                            pi16_levelBlock,
  683|  20.2k|                                            pu1_pred_sblk,
  684|  20.2k|                                            pu1_pred_sblk,
  685|  20.2k|                                            ui_rec_width,
  686|  20.2k|                                            ui_rec_width,
  687|  20.2k|                                            gau1_ih264d_dequant8x8_cavlc[ps_cur_mb_info->u1_qp_rem6],
  688|  20.2k|                                            (UWORD16 *)pi2_scale_matrix_ptr,
  689|  20.2k|                                            ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0,
  690|  20.2k|                                            NULL);
  691|  20.2k|                        }
  692|  21.0k|                    }
  693|  21.0k|                }
  694|  36.5k|            }
  695|       |
  696|  9.12k|        }
  697|  62.9k|    }
  698|       |
  699|       |    /* Decode Chroma Block */
  700|   364k|    ih264d_unpack_chroma_coeff4x4_mb(ps_dec,
  701|   364k|                                     ps_cur_mb_info);
  702|       |    /*--------------------------------------------------------------------*/
  703|       |    /* Chroma Blocks decoding                                             */
  704|       |    /*--------------------------------------------------------------------*/
  705|   364k|    {
  706|   364k|        UWORD8 u1_chroma_cbp = (UWORD8)(ps_cur_mb_info->u1_cbp >> 4);
  707|       |
  708|   364k|        if(u1_chroma_cbp != CBPC_ALLZERO)
  ------------------
  |  |  507|   364k|#define CBPC_ALLZERO    0
  ------------------
  |  Branch (708:12): [True: 26.4k, False: 337k]
  ------------------
  709|  26.4k|        {
  710|  26.4k|            UWORD32 u4_scale_u = ps_cur_mb_info->u1_qpc_div6;
  711|  26.4k|            UWORD32 u4_scale_v = ps_cur_mb_info->u1_qpcr_div6;
  712|  26.4k|            UWORD16 u2_chroma_csbp = ps_cur_mb_info->u2_chroma_csbp;
  713|       |
  714|  26.4k|            pi2_y_coeff = ps_dec->pi2_coeff_data;
  715|       |
  716|  26.4k|            {
  717|  26.4k|                UWORD32 i;
  718|  26.4k|                WORD16 ai2_tmp[16];
  719|   132k|                for(i = 0; i < 4; i++)
  ------------------
  |  Branch (719:28): [True: 105k, False: 26.4k]
  ------------------
  720|   105k|                {
  721|   105k|                    WORD16 *pi2_level = pi2_y_coeff + (i << 4);
  722|   105k|                    UWORD8 *pu1_pred_sblk = pu1_rec_u
  723|   105k|                                    + ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR)
  ------------------
  |  |  556|   105k|#define BLK_SIZE             4
  ------------------
                                                  + ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR)
  ------------------
  |  |  119|   105k|#define YUV420SP_FACTOR 2
  ------------------
  724|   105k|                                    + (i >> 1) * (u4_recwidth_cr << 2);
  725|   105k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|   105k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
  726|   105k|                    {
  727|   105k|                        if(CHECKBIT(u2_chroma_csbp, i))
  ------------------
  |  |   54|   105k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 6.85k, False: 98.8k]
  |  |  ------------------
  ------------------
  728|  6.85k|                        {
  729|  6.85k|                            ps_dec->pf_iquant_itrans_recon_chroma_4x4(
  730|  6.85k|                                            pi2_level,
  731|  6.85k|                                            pu1_pred_sblk,
  732|  6.85k|                                            pu1_pred_sblk,
  733|  6.85k|                                            u4_recwidth_cr,
  734|  6.85k|                                            u4_recwidth_cr,
  735|  6.85k|                                            gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpc_rem6],
  736|  6.85k|                                            (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[4],
  737|  6.85k|                                            u4_scale_u, ai2_tmp, pi2_level);
  738|  6.85k|                        }
  739|  98.8k|                        else if(pi2_level[0] != 0)
  ------------------
  |  Branch (739:33): [True: 60.2k, False: 38.6k]
  ------------------
  740|  60.2k|                        {
  741|  60.2k|                            ps_dec->pf_iquant_itrans_recon_chroma_4x4_dc(
  742|  60.2k|                                            pi2_level,
  743|  60.2k|                                            pu1_pred_sblk,
  744|  60.2k|                                            pu1_pred_sblk,
  745|  60.2k|                                            u4_recwidth_cr,
  746|  60.2k|                                            u4_recwidth_cr,
  747|  60.2k|                                            gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpc_rem6],
  748|  60.2k|                                            (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[4],
  749|  60.2k|                                            u4_scale_u, ai2_tmp, pi2_level);
  750|  60.2k|                        }
  751|   105k|                    }
  752|   105k|                }
  753|  26.4k|            }
  754|       |
  755|  26.4k|            pi2_y_coeff += MB_CHROM_SIZE;
  ------------------
  |  |  564|  26.4k|#define MB_CHROM_SIZE                 64
  ------------------
  756|  26.4k|            u2_chroma_csbp >>= 4;
  757|       |
  758|  26.4k|            {
  759|  26.4k|                UWORD32 i;
  760|  26.4k|                WORD16 ai2_tmp[16];
  761|   132k|                for(i = 0; i < 4; i++)
  ------------------
  |  Branch (761:28): [True: 105k, False: 26.4k]
  ------------------
  762|   105k|                {
  763|   105k|                    WORD16 *pi2_level = pi2_y_coeff + (i << 4);
  764|   105k|                    UWORD8 *pu1_pred_sblk = pu1_rec_u + 1
  765|   105k|                                    + ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR)
  ------------------
  |  |  556|   105k|#define BLK_SIZE             4
  ------------------
                                                  + ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR)
  ------------------
  |  |  119|   105k|#define YUV420SP_FACTOR 2
  ------------------
  766|   105k|                                    + (i >> 1) * (u4_recwidth_cr << 2);
  767|   105k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|   105k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
  768|   105k|                    {
  769|   105k|                        if(CHECKBIT(u2_chroma_csbp, i))
  ------------------
  |  |   54|   105k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 9.59k, False: 96.1k]
  |  |  ------------------
  ------------------
  770|  9.59k|                        {
  771|  9.59k|                            ps_dec->pf_iquant_itrans_recon_chroma_4x4(
  772|  9.59k|                                            pi2_level,
  773|  9.59k|                                            pu1_pred_sblk,
  774|  9.59k|                                            pu1_pred_sblk,
  775|  9.59k|                                            u4_recwidth_cr,
  776|  9.59k|                                            u4_recwidth_cr,
  777|  9.59k|                                            gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpcr_rem6],
  778|  9.59k|                                            (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[5],
  779|  9.59k|                                            u4_scale_v, ai2_tmp, pi2_level);
  780|  9.59k|                        }
  781|  96.1k|                        else if(pi2_level[0] != 0)
  ------------------
  |  Branch (781:33): [True: 53.5k, False: 42.5k]
  ------------------
  782|  53.5k|                        {
  783|  53.5k|                            ps_dec->pf_iquant_itrans_recon_chroma_4x4_dc(
  784|  53.5k|                                            pi2_level,
  785|  53.5k|                                            pu1_pred_sblk,
  786|  53.5k|                                            pu1_pred_sblk,
  787|  53.5k|                                            u4_recwidth_cr,
  788|  53.5k|                                            u4_recwidth_cr,
  789|  53.5k|                                            gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpcr_rem6],
  790|  53.5k|                                            (UWORD16 *)ps_dec->s_high_profile.i2_scalinglist4x4[5],
  791|  53.5k|                                            u4_scale_v, ai2_tmp, pi2_level);
  792|  53.5k|                        }
  793|   105k|                    }
  794|   105k|                }
  795|  26.4k|            }
  796|  26.4k|        }
  797|   364k|    }
  798|   364k|    return (0);
  799|   364k|}
ih264d_parse_pred_weight_table:
  815|  29.5k|{
  816|  29.5k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  817|  29.5k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  818|  29.5k|    WORD8 i, cont, lx;
  819|  29.5k|    UWORD8 uc_weight_flag;
  820|  29.5k|    UWORD32 *pui32_weight_offset_lx;
  821|  29.5k|    WORD16 c_weight, c_offset;
  822|  29.5k|    UWORD32 ui32_y_def_weight_ofst, ui32_cr_def_weight_ofst;
  823|  29.5k|    UWORD32 ui32_temp;
  824|  29.5k|    UWORD8 uc_luma_log2_weight_denom;
  825|  29.5k|    UWORD8 uc_chroma_log2_weight_denom;
  826|       |
  827|       |    /* Variables for error resilience checks */
  828|  29.5k|    UWORD32 u4_temp;
  829|  29.5k|    WORD32 i_temp;
  830|       |
  831|  29.5k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  832|  29.5k|    if(u4_temp > MAX_LOG2_WEIGHT_DENOM)
  ------------------
  |  |  608|  29.5k|#define MAX_LOG2_WEIGHT_DENOM       7
  ------------------
  |  Branch (832:8): [True: 6.63k, False: 22.8k]
  ------------------
  833|  6.63k|    {
  834|  6.63k|        return ERROR_PRED_WEIGHT_TABLE_T;
  835|  6.63k|    }
  836|  22.8k|    uc_luma_log2_weight_denom = u4_temp;
  837|  22.8k|    COPYTHECONTEXT("SH: luma_log2_weight_denom",uc_luma_log2_weight_denom);
  838|  22.8k|    ui32_y_def_weight_ofst = (1 << uc_luma_log2_weight_denom);
  839|       |
  840|  22.8k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  841|  22.8k|    if(u4_temp > MAX_LOG2_WEIGHT_DENOM)
  ------------------
  |  |  608|  22.8k|#define MAX_LOG2_WEIGHT_DENOM       7
  ------------------
  |  Branch (841:8): [True: 2.15k, False: 20.7k]
  ------------------
  842|  2.15k|    {
  843|  2.15k|        return ERROR_PRED_WEIGHT_TABLE_T;
  844|  2.15k|    }
  845|  20.7k|    uc_chroma_log2_weight_denom = u4_temp;
  846|  20.7k|    COPYTHECONTEXT("SH: chroma_log2_weight_denom",uc_chroma_log2_weight_denom);
  847|  20.7k|    ui32_cr_def_weight_ofst = (1 << uc_chroma_log2_weight_denom);
  848|       |
  849|  20.7k|    ps_cur_slice->u2_log2Y_crwd = uc_luma_log2_weight_denom
  850|  20.7k|                    | (uc_chroma_log2_weight_denom << 8);
  851|       |
  852|  20.7k|    cont = (ps_cur_slice->u1_slice_type == B_SLICE);
  ------------------
  |  |  369|  20.7k|#define B_SLICE  1
  ------------------
  853|  20.7k|    lx = 0;
  854|  20.7k|    do
  855|  24.4k|    {
  856|  57.7k|        for(i = 0; i < ps_cur_slice->u1_num_ref_idx_lx_active[lx]; i++)
  ------------------
  |  Branch (856:20): [True: 36.1k, False: 21.5k]
  ------------------
  857|  36.1k|        {
  858|  36.1k|            pui32_weight_offset_lx = ps_cur_slice->u4_wt_ofst_lx[lx][i];
  859|       |
  860|  36.1k|            uc_weight_flag = ih264d_get_bit_h264(ps_bitstrm);
  861|  36.1k|            pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  862|  36.1k|            COPYTHECONTEXT("SH: luma_weight_l0_flag",uc_weight_flag);
  863|  36.1k|            if(uc_weight_flag)
  ------------------
  |  Branch (863:16): [True: 18.8k, False: 17.2k]
  ------------------
  864|  18.8k|            {
  865|  18.8k|                i_temp = ih264d_sev(pu4_bitstrm_ofst,
  866|  18.8k|                                    pu4_bitstrm_buf);
  867|  18.8k|                if((i_temp < PRED_WEIGHT_MIN) || (i_temp > PRED_WEIGHT_MAX))
  ------------------
  |  |  609|  18.8k|#define PRED_WEIGHT_MIN             (-128)
  ------------------
                              if((i_temp < PRED_WEIGHT_MIN) || (i_temp > PRED_WEIGHT_MAX))
  ------------------
  |  |  610|  18.7k|#define PRED_WEIGHT_MAX             127
  ------------------
  |  Branch (867:20): [True: 166, False: 18.7k]
  |  Branch (867:50): [True: 209, False: 18.5k]
  ------------------
  868|    375|                    return ERROR_PRED_WEIGHT_TABLE_T;
  869|  18.5k|                c_weight = i_temp;
  870|  18.5k|                COPYTHECONTEXT("SH: luma_weight_l0",c_weight);
  871|       |
  872|  18.5k|                i_temp = ih264d_sev(pu4_bitstrm_ofst,
  873|  18.5k|                                    pu4_bitstrm_buf);
  874|  18.5k|                if((i_temp < PRED_WEIGHT_MIN) || (i_temp > PRED_WEIGHT_MAX))
  ------------------
  |  |  609|  18.5k|#define PRED_WEIGHT_MIN             (-128)
  ------------------
                              if((i_temp < PRED_WEIGHT_MIN) || (i_temp > PRED_WEIGHT_MAX))
  ------------------
  |  |  610|  18.4k|#define PRED_WEIGHT_MAX             127
  ------------------
  |  Branch (874:20): [True: 110, False: 18.4k]
  |  Branch (874:50): [True: 668, False: 17.7k]
  ------------------
  875|    778|                    return ERROR_PRED_WEIGHT_TABLE_T;
  876|  17.7k|                c_offset = i_temp;
  877|  17.7k|                COPYTHECONTEXT("SH: luma_offset_l0",c_offset);
  878|       |
  879|  17.7k|                ui32_temp = (c_offset << 16) | (c_weight & 0xFFFF);
  880|  17.7k|                pui32_weight_offset_lx[0] = ui32_temp;
  881|  17.7k|            }
  882|  17.2k|            else
  883|  17.2k|            {
  884|       |
  885|  17.2k|                pui32_weight_offset_lx[0] = ui32_y_def_weight_ofst;
  886|  17.2k|            }
  887|       |
  888|  34.9k|            {
  889|  34.9k|                WORD8 c_weightCb, c_weightCr, c_offsetCb, c_offsetCr;
  890|  34.9k|                uc_weight_flag = ih264d_get_bit_h264(ps_bitstrm);
  891|  34.9k|                pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  892|  34.9k|                COPYTHECONTEXT("SH: chroma_weight_l0_flag",uc_weight_flag);
  893|  34.9k|                if(uc_weight_flag)
  ------------------
  |  Branch (893:20): [True: 18.4k, False: 16.4k]
  ------------------
  894|  18.4k|                {
  895|  18.4k|                    i_temp = ih264d_sev(pu4_bitstrm_ofst,
  896|  18.4k|                                        pu4_bitstrm_buf);
  897|  18.4k|                    if((i_temp < PRED_WEIGHT_MIN) || (i_temp > PRED_WEIGHT_MAX))
  ------------------
  |  |  609|  18.4k|#define PRED_WEIGHT_MIN             (-128)
  ------------------
                                  if((i_temp < PRED_WEIGHT_MIN) || (i_temp > PRED_WEIGHT_MAX))
  ------------------
  |  |  610|  18.3k|#define PRED_WEIGHT_MAX             127
  ------------------
  |  Branch (897:24): [True: 103, False: 18.3k]
  |  Branch (897:54): [True: 335, False: 18.0k]
  ------------------
  898|    438|                        return ERROR_PRED_WEIGHT_TABLE_T;
  899|  18.0k|                    c_weightCb = i_temp;
  900|  18.0k|                    COPYTHECONTEXT("SH: chroma_weight_l0",c_weightCb);
  901|       |
  902|  18.0k|                    i_temp = ih264d_sev(pu4_bitstrm_ofst,
  903|  18.0k|                                        pu4_bitstrm_buf);
  904|  18.0k|                    if((i_temp < PRED_WEIGHT_MIN) || (i_temp > PRED_WEIGHT_MAX))
  ------------------
  |  |  609|  18.0k|#define PRED_WEIGHT_MIN             (-128)
  ------------------
                                  if((i_temp < PRED_WEIGHT_MIN) || (i_temp > PRED_WEIGHT_MAX))
  ------------------
  |  |  610|  17.8k|#define PRED_WEIGHT_MAX             127
  ------------------
  |  Branch (904:24): [True: 163, False: 17.8k]
  |  Branch (904:54): [True: 230, False: 17.6k]
  ------------------
  905|    393|                        return ERROR_PRED_WEIGHT_TABLE_T;
  906|  17.6k|                    c_offsetCb = i_temp;
  907|  17.6k|                    COPYTHECONTEXT("SH: chroma_weight_l0",c_offsetCb);
  908|       |
  909|  17.6k|                    ui32_temp = (c_offsetCb << 16) | (c_weightCb & 0xFFFF);
  910|  17.6k|                    pui32_weight_offset_lx[1] = ui32_temp;
  911|       |
  912|  17.6k|                    i_temp = ih264d_sev(pu4_bitstrm_ofst,
  913|  17.6k|                                        pu4_bitstrm_buf);
  914|  17.6k|                    if((i_temp < PRED_WEIGHT_MIN) || (i_temp > PRED_WEIGHT_MAX))
  ------------------
  |  |  609|  17.6k|#define PRED_WEIGHT_MIN             (-128)
  ------------------
                                  if((i_temp < PRED_WEIGHT_MIN) || (i_temp > PRED_WEIGHT_MAX))
  ------------------
  |  |  610|  17.5k|#define PRED_WEIGHT_MAX             127
  ------------------
  |  Branch (914:24): [True: 147, False: 17.5k]
  |  Branch (914:54): [True: 428, False: 17.0k]
  ------------------
  915|    575|                        return ERROR_PRED_WEIGHT_TABLE_T;
  916|  17.0k|                    c_weightCr = i_temp;
  917|  17.0k|                    COPYTHECONTEXT("SH: chroma_weight_l0",c_weightCr);
  918|       |
  919|  17.0k|                    i_temp = ih264d_sev(pu4_bitstrm_ofst,
  920|  17.0k|                                        pu4_bitstrm_buf);
  921|  17.0k|                    if((i_temp < PRED_WEIGHT_MIN) || (i_temp > PRED_WEIGHT_MAX))
  ------------------
  |  |  609|  17.0k|#define PRED_WEIGHT_MIN             (-128)
  ------------------
                                  if((i_temp < PRED_WEIGHT_MIN) || (i_temp > PRED_WEIGHT_MAX))
  ------------------
  |  |  610|  16.9k|#define PRED_WEIGHT_MAX             127
  ------------------
  |  Branch (921:24): [True: 107, False: 16.9k]
  |  Branch (921:54): [True: 228, False: 16.7k]
  ------------------
  922|    335|                        return ERROR_PRED_WEIGHT_TABLE_T;
  923|  16.7k|                    c_offsetCr = i_temp;
  924|  16.7k|                    COPYTHECONTEXT("SH: chroma_weight_l0",c_offsetCr);
  925|       |
  926|  16.7k|                    ui32_temp = (c_offsetCr << 16) | (c_weightCr & 0xFFFF);
  927|  16.7k|                    pui32_weight_offset_lx[2] = ui32_temp;
  928|  16.7k|                }
  929|  16.4k|                else
  930|  16.4k|                {
  931|  16.4k|                    pui32_weight_offset_lx[1] = ui32_cr_def_weight_ofst;
  932|  16.4k|                    pui32_weight_offset_lx[2] = ui32_cr_def_weight_ofst;
  933|  16.4k|                }
  934|  34.9k|            }
  935|  34.9k|        }
  936|  21.5k|        lx++;
  937|  21.5k|    }
  938|  21.5k|    while(cont--);
  ------------------
  |  Branch (938:11): [True: 3.76k, False: 17.8k]
  ------------------
  939|       |
  940|  17.8k|    return OK;
  ------------------
  |  |  114|  17.8k|#define OK        0
  ------------------
  941|  20.7k|}
ih264d_init_ref_idx_lx_p:
  985|  81.0k|{
  986|  81.0k|    struct pic_buffer_t *ps_ref_pic_buf_lx;
  987|  81.0k|    dpb_manager_t *ps_dpb_mgr;
  988|  81.0k|    struct dpb_info_t *ps_next_dpb;
  989|  81.0k|    WORD8 i, j;
  990|  81.0k|    UWORD8 u1_max_lt_index, u1_min_lt_index;
  991|  81.0k|    UWORD32 u4_lt_index;
  992|  81.0k|    UWORD8 u1_field_pic_flag;
  993|  81.0k|    dec_slice_params_t *ps_cur_slice;
  994|  81.0k|    UWORD8 u1_L0;
  995|  81.0k|    WORD32 i4_cur_pic_num, i4_min_st_pic_num;
  996|  81.0k|    WORD32 i4_temp_pic_num, i4_ref_pic_num;
  997|  81.0k|    UWORD8 u1_num_short_term_bufs;
  998|  81.0k|    UWORD8 u1_max_ref_idx_l0;
  999|  81.0k|    struct pic_buffer_t *aps_st_pic_bufs[2 * MAX_REF_BUFS] = {NULL};
 1000|       |
 1001|  81.0k|    ps_cur_slice = ps_dec->ps_cur_slice;
 1002|  81.0k|    u1_field_pic_flag = ps_cur_slice->u1_field_pic_flag;
 1003|  81.0k|    u1_max_ref_idx_l0 = ps_cur_slice->u1_num_ref_idx_lx_active[0]
 1004|  81.0k|                    << u1_field_pic_flag;
 1005|       |
 1006|  81.0k|    ps_dpb_mgr = ps_dec->ps_dpb_mgr;
 1007|       |    /* Get the current frame number */
 1008|  81.0k|    i4_cur_pic_num = ps_dec->ps_cur_pic->i4_pic_num;
 1009|       |
 1010|       |    /* Get Min pic_num,MinLt */
 1011|  81.0k|    i4_min_st_pic_num = i4_cur_pic_num;
 1012|  81.0k|    u1_max_lt_index = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  81.0k|#define MAX_REF_BUFS    32
  ------------------
 1013|  81.0k|    u1_min_lt_index = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  81.0k|#define MAX_REF_BUFS    32
  ------------------
 1014|       |
 1015|       |    /* Start from ST head */
 1016|  81.0k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_st_head;
 1017|   139k|    for(i = 0; i < ps_dpb_mgr->u1_num_st_ref_bufs; i++)
  ------------------
  |  Branch (1017:16): [True: 58.6k, False: 81.0k]
  ------------------
 1018|  58.6k|    {
 1019|  58.6k|        i4_ref_pic_num = ps_next_dpb->ps_pic_buf->i4_pic_num;
 1020|  58.6k|        if(i4_ref_pic_num < i4_cur_pic_num)
  ------------------
  |  Branch (1020:12): [True: 21.8k, False: 36.8k]
  ------------------
 1021|  21.8k|        {
 1022|       |            /* RefPic Buf pic_num is before Current pic_num in decode order */
 1023|  21.8k|            i4_min_st_pic_num = MIN(i4_min_st_pic_num, i4_ref_pic_num);
  ------------------
  |  |   61|  21.8k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 1.28k, False: 20.5k]
  |  |  ------------------
  ------------------
 1024|  21.8k|        }
 1025|       |
 1026|       |        /* Chase the next link */
 1027|  58.6k|        ps_next_dpb = ps_next_dpb->ps_prev_short;
 1028|  58.6k|    }
 1029|       |
 1030|       |    /* Sort ST ref pocs in ascending order */
 1031|  81.0k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_st_head;
 1032|   139k|    for (j = 0; j < ps_dpb_mgr->u1_num_st_ref_bufs; j++)
  ------------------
  |  Branch (1032:17): [True: 58.6k, False: 81.0k]
  ------------------
 1033|  58.6k|    {
 1034|  58.6k|        aps_st_pic_bufs[j] = ps_next_dpb->ps_pic_buf;
 1035|  58.6k|        ps_next_dpb = ps_next_dpb->ps_prev_short;
 1036|  58.6k|    }
 1037|  81.0k|    qsort(aps_st_pic_bufs, ps_dpb_mgr->u1_num_st_ref_bufs,
 1038|  81.0k|        sizeof(aps_st_pic_bufs[0]), pic_num_compare);
 1039|       |
 1040|       |    /* Start from LT head */
 1041|  81.0k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
 1042|  81.0k|    if(ps_next_dpb)
  ------------------
  |  Branch (1042:8): [True: 10.3k, False: 70.7k]
  ------------------
 1043|  10.3k|    {
 1044|  10.3k|        u1_max_lt_index = ps_next_dpb->u1_lt_idx;
 1045|  10.3k|        u1_min_lt_index = ps_next_dpb->u1_lt_idx;
 1046|       |
 1047|  21.5k|        for(i = 0; i < ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
  ------------------
  |  Branch (1047:20): [True: 11.2k, False: 10.3k]
  ------------------
 1048|  11.2k|        {
 1049|  11.2k|            u4_lt_index = ps_next_dpb->u1_lt_idx;
 1050|  11.2k|            u1_max_lt_index = (UWORD8)(MAX(u1_max_lt_index, u4_lt_index));
  ------------------
  |  |   60|  11.2k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 11.2k]
  |  |  ------------------
  ------------------
 1051|  11.2k|            u1_min_lt_index = (UWORD8)(MIN(u1_min_lt_index, u4_lt_index));
  ------------------
  |  |   61|  11.2k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 921, False: 10.3k]
  |  |  ------------------
  ------------------
 1052|       |
 1053|       |            /* Chase the next link */
 1054|  11.2k|            ps_next_dpb = ps_next_dpb->ps_prev_long;
 1055|  11.2k|        }
 1056|  10.3k|    }
 1057|       |    /* 1. Initialize refIdxL0 */
 1058|  81.0k|    u1_L0 = 0;
 1059|  81.0k|    if(u1_field_pic_flag)
  ------------------
  |  Branch (1059:8): [True: 0, False: 81.0k]
  ------------------
 1060|      0|    {
 1061|      0|        ps_ref_pic_buf_lx = ps_dpb_mgr->ps_init_dpb[0][0];
 1062|      0|        ps_ref_pic_buf_lx += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1063|      0|        i4_temp_pic_num = i4_cur_pic_num;
 1064|      0|    }
 1065|  81.0k|    else
 1066|  81.0k|    {
 1067|  81.0k|        ps_ref_pic_buf_lx = ps_dpb_mgr->ps_init_dpb[0][0];
 1068|  81.0k|        i4_temp_pic_num = i4_cur_pic_num;
 1069|  81.0k|    }
 1070|       |    /* Arrange all short term buffers in output order as given by pic_num */
 1071|       |    /* Arrange pic_num's less than Curr pic_num in the descending pic_num */
 1072|       |    /* order starting from (Curr pic_num - 1)                             */
 1073|   139k|    for(j = ps_dpb_mgr->u1_num_st_ref_bufs - 1; j >= 0; j--)
  ------------------
  |  Branch (1073:49): [True: 58.6k, False: 81.0k]
  ------------------
 1074|  58.6k|    {
 1075|  58.6k|        if(aps_st_pic_bufs[j])
  ------------------
  |  Branch (1075:12): [True: 58.6k, False: 0]
  ------------------
 1076|  58.6k|        {
 1077|       |            /* Copy info in pic buffer */
 1078|  58.6k|            ih264d_insert_pic_in_ref_pic_listx(ps_ref_pic_buf_lx,
 1079|  58.6k|                                               aps_st_pic_bufs[j]);
 1080|  58.6k|            ps_ref_pic_buf_lx++;
 1081|  58.6k|            u1_L0++;
 1082|  58.6k|        }
 1083|  58.6k|    }
 1084|       |
 1085|       |    /* Arrange all Long term buffers in ascending order, in LongtermIndex */
 1086|       |    /* Start from LT head */
 1087|  81.0k|    u1_num_short_term_bufs = u1_L0;
 1088|   165k|    for(u4_lt_index = u1_min_lt_index; u4_lt_index <= u1_max_lt_index;
  ------------------
  |  Branch (1088:40): [True: 84.5k, False: 81.0k]
  ------------------
 1089|  84.5k|                    u4_lt_index++)
 1090|  84.5k|    {
 1091|  84.5k|        ps_next_dpb = ps_dpb_mgr->ps_dpb_ht_head;
 1092|  93.7k|        for(i = 0; i < ps_dpb_mgr->u1_num_lt_ref_bufs; i++)
  ------------------
  |  Branch (1092:20): [True: 20.3k, False: 73.3k]
  ------------------
 1093|  20.3k|        {
 1094|  20.3k|            if(ps_next_dpb->u1_lt_idx == u4_lt_index)
  ------------------
  |  Branch (1094:16): [True: 11.2k, False: 9.13k]
  ------------------
 1095|  11.2k|            {
 1096|  11.2k|                ih264d_insert_pic_in_ref_pic_listx(ps_ref_pic_buf_lx,
 1097|  11.2k|                                                   ps_next_dpb->ps_pic_buf);
 1098|       |
 1099|  11.2k|                ps_ref_pic_buf_lx->u1_long_term_pic_num =
 1100|  11.2k|                                ps_ref_pic_buf_lx->u1_long_term_frm_idx;
 1101|  11.2k|                ps_ref_pic_buf_lx++;
 1102|  11.2k|                u1_L0++;
 1103|  11.2k|                break;
 1104|  11.2k|            }
 1105|  9.13k|            ps_next_dpb = ps_next_dpb->ps_prev_long;
 1106|  9.13k|        }
 1107|  84.5k|    }
 1108|       |
 1109|  81.0k|    if(u1_field_pic_flag)
  ------------------
  |  Branch (1109:8): [True: 0, False: 81.0k]
  ------------------
 1110|      0|    {
 1111|       |        /* Initialize the rest of the entries in the */
 1112|       |        /* reference list to handle of errors        */
 1113|      0|        {
 1114|      0|            UWORD8 u1_i;
 1115|      0|            pic_buffer_t ref_pic;
 1116|       |
 1117|      0|            ref_pic = *(ps_dpb_mgr->ps_init_dpb[0][0] + MAX_REF_BUFS);
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1118|       |
 1119|      0|            if(NULL == ref_pic.pu1_buf1)
  ------------------
  |  Branch (1119:16): [True: 0, False: 0]
  ------------------
 1120|      0|            {
 1121|      0|                ref_pic = *ps_dec->ps_cur_pic;
 1122|      0|            }
 1123|      0|            for(u1_i = u1_L0; u1_i < u1_max_ref_idx_l0; u1_i++)
  ------------------
  |  Branch (1123:31): [True: 0, False: 0]
  ------------------
 1124|      0|            {
 1125|      0|                *ps_ref_pic_buf_lx = ref_pic;
 1126|      0|                ps_ref_pic_buf_lx++;
 1127|      0|            }
 1128|      0|        }
 1129|       |
 1130|      0|        ih264d_convert_frm_to_fld_list(
 1131|      0|                        ps_dpb_mgr->ps_init_dpb[0][0] + MAX_REF_BUFS, &u1_L0,
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
 1132|      0|                        ps_dec, u1_num_short_term_bufs);
 1133|       |
 1134|      0|        ps_ref_pic_buf_lx = ps_dpb_mgr->ps_init_dpb[0][0] + u1_L0;
 1135|      0|    }
 1136|       |
 1137|       |    /* Initialize the rest of the entries in the */
 1138|       |    /* reference list to handle of errors        */
 1139|  81.0k|    {
 1140|  81.0k|        UWORD8 u1_i;
 1141|  81.0k|        pic_buffer_t ref_pic;
 1142|       |
 1143|  81.0k|        ref_pic = *(ps_dpb_mgr->ps_init_dpb[0][0]);
 1144|       |
 1145|  81.0k|        if(NULL == ref_pic.pu1_buf1)
  ------------------
  |  Branch (1145:12): [True: 0, False: 81.0k]
  ------------------
 1146|      0|        {
 1147|      0|            ref_pic = *ps_dec->ps_cur_pic;
 1148|      0|        }
 1149|   185k|        for(u1_i = u1_L0; u1_i < u1_max_ref_idx_l0; u1_i++)
  ------------------
  |  Branch (1149:27): [True: 104k, False: 81.0k]
  ------------------
 1150|   104k|        {
 1151|   104k|            *ps_ref_pic_buf_lx = ref_pic;
 1152|   104k|            ps_ref_pic_buf_lx++;
 1153|   104k|        }
 1154|  81.0k|    }
 1155|  81.0k|    ps_dec->ps_cur_slice->u1_initial_list_size[0] = u1_L0;
 1156|  81.0k|}
ih264d_process_pslice.c:pic_num_compare:
  944|  7.94k|{
  945|  7.94k|    struct pic_buffer_t *ps_pic1 = *(struct pic_buffer_t **) pv_pic1;
  946|  7.94k|    struct pic_buffer_t *ps_pic2 = *(struct pic_buffer_t **) pv_pic2;
  947|  7.94k|    if (ps_pic1->i4_pic_num < ps_pic2->i4_pic_num)
  ------------------
  |  Branch (947:9): [True: 2.33k, False: 5.61k]
  ------------------
  948|  2.33k|    {
  949|  2.33k|        return -1;
  950|  2.33k|    }
  951|  5.61k|    else if (ps_pic1->i4_pic_num > ps_pic2->i4_pic_num)
  ------------------
  |  Branch (951:14): [True: 3.35k, False: 2.25k]
  ------------------
  952|  3.35k|    {
  953|  3.35k|        return 1;
  954|  3.35k|    }
  955|  2.25k|    else
  956|  2.25k|    {
  957|  2.25k|        return 0;
  958|  2.25k|    }
  959|  7.94k|}

ih264d_scaling_list:
   52|  19.9k|{
   53|  19.9k|    WORD32 i4_j, i4_delta_scale, i4_lastScale = 8, i4_nextScale = 8;
   54|  19.9k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   55|  19.9k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
   56|       |
   57|  19.9k|    *pu1_use_default_scaling_matrix_flag = 0;
   58|       |
   59|   538k|    for(i4_j = 0; i4_j < i4_size_of_scalinglist; i4_j++)
  ------------------
  |  Branch (59:19): [True: 519k, False: 19.2k]
  ------------------
   60|   519k|    {
   61|   519k|        if(i4_nextScale != 0)
  ------------------
  |  Branch (61:12): [True: 240k, False: 279k]
  ------------------
   62|   240k|        {
   63|   240k|            i4_delta_scale = ih264d_sev(pu4_bitstrm_ofst,
   64|   240k|                                        pu4_bitstrm_buf);
   65|       |
   66|   240k|            if(i4_delta_scale < MIN_H264_DELTA_SCALE ||
  ------------------
  |  |  639|   480k|#define MIN_H264_DELTA_SCALE (-128)
  ------------------
  |  Branch (66:16): [True: 157, False: 239k]
  ------------------
   67|   239k|                        i4_delta_scale > MAX_H264_DELTA_SCALE)
  ------------------
  |  |  644|   239k|#define MAX_H264_DELTA_SCALE 127
  ------------------
  |  Branch (67:25): [True: 536, False: 239k]
  ------------------
   68|    693|            {
   69|    693|                return ERROR_INV_RANGE_QP_T;
   70|    693|            }
   71|   239k|            i4_nextScale = ((i4_lastScale + i4_delta_scale + 256) & 0xff);
   72|       |
   73|   239k|            *pu1_use_default_scaling_matrix_flag = ((i4_j == 0)
  ------------------
  |  Branch (73:53): [True: 19.8k, False: 219k]
  ------------------
   74|  19.8k|                            && (i4_nextScale == 0));
  ------------------
  |  Branch (74:32): [True: 214, False: 19.6k]
  ------------------
   75|       |
   76|   239k|        }
   77|   518k|        pi2_scaling_list[i4_j] =
   78|   518k|                        (i4_nextScale == 0) ? (i4_lastScale) : (i4_nextScale);
  ------------------
  |  Branch (78:25): [True: 293k, False: 225k]
  ------------------
   79|   518k|        i4_lastScale = pi2_scaling_list[i4_j];
   80|   518k|    }
   81|  19.2k|    return OK;
  ------------------
  |  |  114|  19.2k|#define OK        0
  ------------------
   82|  19.9k|}
ih264d_form_default_scaling_matrix:
   85|   126k|{
   86|       |
   87|       |    /*************************************************************************/
   88|       |    /* perform the inverse scanning for the frame and field scaling matrices */
   89|       |    /*************************************************************************/
   90|   126k|    {
   91|   126k|        UWORD8 *pu1_inv_scan;
   92|   126k|        WORD32 i4_i, i4_j;
   93|       |
   94|   126k|        pu1_inv_scan = (UWORD8 *)gau1_ih264d_inv_scan;
   95|       |
   96|       |        /* for all 4x4 matrices */
   97|   886k|        for(i4_i = 0; i4_i < 6; i4_i++)
  ------------------
  |  Branch (97:23): [True: 759k, False: 126k]
  ------------------
   98|   759k|        {
   99|  12.9M|            for(i4_j = 0; i4_j < 16; i4_j++)
  ------------------
  |  Branch (99:27): [True: 12.1M, False: 759k]
  ------------------
  100|  12.1M|            {
  101|  12.1M|                ps_dec->s_high_profile.i2_scalinglist4x4[i4_i][pu1_inv_scan[i4_j]] =
  102|  12.1M|                                16;
  103|       |
  104|  12.1M|            }
  105|   759k|        }
  106|       |
  107|       |        /* for all 8x8 matrices */
  108|   379k|        for(i4_i = 0; i4_i < 2; i4_i++)
  ------------------
  |  Branch (108:23): [True: 253k, False: 126k]
  ------------------
  109|   253k|        {
  110|  16.4M|            for(i4_j = 0; i4_j < 64; i4_j++)
  ------------------
  |  Branch (110:27): [True: 16.2M, False: 253k]
  ------------------
  111|  16.2M|            {
  112|  16.2M|                ps_dec->s_high_profile.i2_scalinglist8x8[i4_i][gau1_ih264d_inv_scan_prog8x8_cabac[i4_j]] =
  113|  16.2M|                                16;
  114|       |
  115|  16.2M|            }
  116|   253k|        }
  117|   126k|    }
  118|   126k|    return OK;
  ------------------
  |  |  114|   126k|#define OK        0
  ------------------
  119|   126k|}
ih264d_form_scaling_matrix_picture:
  124|  10.9k|{
  125|       |    /* default scaling matrices */
  126|  10.9k|    WORD32 i4_i;
  127|       |
  128|       |    /* check the SPS first */
  129|  10.9k|    if(ps_seq->i4_seq_scaling_matrix_present_flag)
  ------------------
  |  Branch (129:8): [True: 9.68k, False: 1.24k]
  ------------------
  130|  9.68k|    {
  131|  87.1k|        for(i4_i = 0; i4_i < 8; i4_i++)
  ------------------
  |  Branch (131:23): [True: 77.4k, False: 9.68k]
  ------------------
  132|  77.4k|        {
  133|  77.4k|            if(i4_i < 6)
  ------------------
  |  Branch (133:16): [True: 58.0k, False: 19.3k]
  ------------------
  134|  58.0k|            {
  135|       |                /* fall-back rule A */
  136|  58.0k|                if(!ps_seq->u1_seq_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (136:20): [True: 31.7k, False: 26.3k]
  ------------------
  137|  31.7k|                {
  138|  31.7k|                    if((i4_i == 0) || (i4_i == 3))
  ------------------
  |  Branch (138:24): [True: 2.79k, False: 28.9k]
  |  Branch (138:39): [True: 8.01k, False: 20.9k]
  ------------------
  139|  10.8k|                    {
  140|  10.8k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  141|  10.8k|                                        (i4_i == 0) ? (WORD16 *)(gai2_ih264d_default_intra4x4) : (WORD16 *)(gai2_ih264d_default_inter4x4);
  ------------------
  |  Branch (141:41): [True: 2.79k, False: 8.01k]
  ------------------
  142|  10.8k|                    }
  143|  20.9k|                    else
  144|  20.9k|                    {
  145|  20.9k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  146|  20.9k|                                        ps_dec->s_high_profile.pi2_scale_mat[i4_i
  147|  20.9k|                                                        - 1];
  148|  20.9k|                    }
  149|  31.7k|                }
  150|  26.3k|                else
  151|  26.3k|                {
  152|  26.3k|                    if(ps_seq->u1_use_default_scaling_matrix_flag[i4_i])
  ------------------
  |  Branch (152:24): [True: 219, False: 26.1k]
  ------------------
  153|    219|                    {
  154|    219|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  155|    219|                                        (i4_i < 3) ? (WORD16 *)(gai2_ih264d_default_intra4x4) : (WORD16 *)(gai2_ih264d_default_inter4x4);
  ------------------
  |  Branch (155:41): [True: 212, False: 7]
  ------------------
  156|    219|                    }
  157|  26.1k|                    else
  158|  26.1k|                    {
  159|  26.1k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  160|  26.1k|                                        ps_seq->i2_scalinglist4x4[i4_i];
  161|  26.1k|                    }
  162|  26.3k|                }
  163|       |
  164|  58.0k|            }
  165|  19.3k|            else
  166|  19.3k|            {
  167|       |                /* fall-back rule A */
  168|  19.3k|                if((!ps_seq->u1_seq_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (168:20): [True: 11.3k, False: 7.97k]
  ------------------
  169|  7.97k|                                || (ps_seq->u1_use_default_scaling_matrix_flag[i4_i]))
  ------------------
  |  Branch (169:36): [True: 182, False: 7.79k]
  ------------------
  170|  11.5k|                {
  171|  11.5k|                    ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  172|  11.5k|                                    (i4_i == 6) ? ((WORD16*)gai2_ih264d_default_intra8x8) : ((WORD16*)gai2_ih264d_default_inter8x8);
  ------------------
  |  Branch (172:37): [True: 2.64k, False: 8.92k]
  ------------------
  173|  11.5k|                }
  174|  7.79k|                else
  175|  7.79k|                {
  176|  7.79k|                    ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  177|  7.79k|                                    ps_seq->i2_scalinglist8x8[i4_i - 6];
  178|  7.79k|                }
  179|  19.3k|            }
  180|  77.4k|        }
  181|  9.68k|    }
  182|       |
  183|       |    /* checking for the PPS */
  184|       |
  185|  10.9k|    if(ps_pic->i4_pic_scaling_matrix_present_flag)
  ------------------
  |  Branch (185:8): [True: 2.51k, False: 8.40k]
  ------------------
  186|  2.51k|    {
  187|  22.6k|        for(i4_i = 0; i4_i < 8; i4_i++)
  ------------------
  |  Branch (187:23): [True: 20.1k, False: 2.51k]
  ------------------
  188|  20.1k|        {
  189|  20.1k|            if(i4_i < 6)
  ------------------
  |  Branch (189:16): [True: 15.0k, False: 5.03k]
  ------------------
  190|  15.0k|            {
  191|       |                /* fall back rule B */
  192|  15.0k|                if(!ps_pic->u1_pic_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (192:20): [True: 11.9k, False: 3.14k]
  ------------------
  193|  11.9k|                {
  194|  11.9k|                    if((i4_i == 0) || (i4_i == 3))
  ------------------
  |  Branch (194:24): [True: 1.94k, False: 10.0k]
  |  Branch (194:39): [True: 1.80k, False: 8.19k]
  ------------------
  195|  3.75k|                    {
  196|  3.75k|                        if(!ps_seq->i4_seq_scaling_matrix_present_flag)
  ------------------
  |  Branch (196:28): [True: 1.89k, False: 1.86k]
  ------------------
  197|  1.89k|                        {
  198|  1.89k|                            ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  199|  1.89k|                                            (i4_i == 0) ? (WORD16 *)(gai2_ih264d_default_intra4x4) : (WORD16 *)(gai2_ih264d_default_inter4x4);
  ------------------
  |  Branch (199:45): [True: 961, False: 931]
  ------------------
  200|  1.89k|                        }
  201|  3.75k|                    }
  202|  8.19k|                    else
  203|  8.19k|                    {
  204|  8.19k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  205|  8.19k|                                        ps_dec->s_high_profile.pi2_scale_mat[i4_i
  206|  8.19k|                                                        - 1];
  207|  8.19k|                    }
  208|  11.9k|                }
  209|  3.14k|                else
  210|  3.14k|                {
  211|  3.14k|                    if(ps_pic->u1_pic_use_default_scaling_matrix_flag[i4_i])
  ------------------
  |  Branch (211:24): [True: 581, False: 2.56k]
  ------------------
  212|    581|                    {
  213|    581|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  214|    581|                                        (i4_i < 3) ? (WORD16 *)(gai2_ih264d_default_intra4x4) : (WORD16 *)(gai2_ih264d_default_inter4x4);
  ------------------
  |  Branch (214:41): [True: 191, False: 390]
  ------------------
  215|    581|                    }
  216|  2.56k|                    else
  217|  2.56k|                    {
  218|  2.56k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  219|  2.56k|                                        ps_pic->i2_pic_scalinglist4x4[i4_i];
  220|  2.56k|                    }
  221|  3.14k|                }
  222|  15.0k|            }
  223|  5.03k|            else
  224|  5.03k|            {
  225|  5.03k|                if(!ps_pic->u1_pic_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (225:20): [True: 4.12k, False: 910]
  ------------------
  226|  4.12k|                {
  227|  4.12k|                    if(!ps_seq->i4_seq_scaling_matrix_present_flag)
  ------------------
  |  Branch (227:24): [True: 2.26k, False: 1.85k]
  ------------------
  228|  2.26k|                    {
  229|  2.26k|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  230|  2.26k|                                        (i4_i == 6) ? ((WORD16*)gai2_ih264d_default_intra8x8) : ((WORD16*)gai2_ih264d_default_inter8x8);
  ------------------
  |  Branch (230:41): [True: 1.13k, False: 1.13k]
  ------------------
  231|  2.26k|                    }
  232|  4.12k|                }
  233|    910|                else
  234|    910|                {
  235|    910|                    if(ps_pic->u1_pic_use_default_scaling_matrix_flag[i4_i])
  ------------------
  |  Branch (235:24): [True: 177, False: 733]
  ------------------
  236|    177|                    {
  237|    177|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  238|    177|                                        (i4_i == 6) ? (WORD16 *)(gai2_ih264d_default_intra8x8) : (WORD16 *)(gai2_ih264d_default_inter8x8);
  ------------------
  |  Branch (238:41): [True: 61, False: 116]
  ------------------
  239|    177|                    }
  240|    733|                    else
  241|    733|                    {
  242|    733|                        ps_dec->s_high_profile.pi2_scale_mat[i4_i] =
  243|    733|                                        ps_pic->i2_pic_scalinglist8x8[i4_i - 6];
  244|    733|                    }
  245|    910|                }
  246|  5.03k|            }
  247|  20.1k|        }
  248|  2.51k|    }
  249|       |
  250|       |    /*************************************************************************/
  251|       |    /* perform the inverse scanning for the frame and field scaling matrices */
  252|       |    /*************************************************************************/
  253|  10.9k|    {
  254|  10.9k|        UWORD8 *pu1_inv_scan_4x4;
  255|  10.9k|        WORD32 i4_i, i4_j;
  256|       |
  257|  10.9k|        pu1_inv_scan_4x4 = (UWORD8 *)gau1_ih264d_inv_scan;
  258|       |
  259|       |        /* for all 4x4 matrices */
  260|  76.4k|        for(i4_i = 0; i4_i < 6; i4_i++)
  ------------------
  |  Branch (260:23): [True: 65.5k, False: 10.9k]
  ------------------
  261|  65.5k|        {
  262|  65.5k|            if(ps_dec->s_high_profile.pi2_scale_mat[i4_i] == NULL)
  ------------------
  |  Branch (262:16): [True: 0, False: 65.5k]
  ------------------
  263|      0|                return ERROR_CORRUPTED_SLICE;
  264|       |
  265|  1.11M|            for(i4_j = 0; i4_j < 16; i4_j++)
  ------------------
  |  Branch (265:27): [True: 1.04M, False: 65.5k]
  ------------------
  266|  1.04M|            {
  267|  1.04M|                ps_dec->s_high_profile.i2_scalinglist4x4[i4_i][pu1_inv_scan_4x4[i4_j]] =
  268|  1.04M|                                ps_dec->s_high_profile.pi2_scale_mat[i4_i][i4_j];
  269|       |
  270|  1.04M|            }
  271|  65.5k|        }
  272|       |
  273|       |        /* for all 8x8 matrices */
  274|  32.7k|        for(i4_i = 0; i4_i < 2; i4_i++)
  ------------------
  |  Branch (274:23): [True: 21.8k, False: 10.9k]
  ------------------
  275|  21.8k|        {
  276|  21.8k|            if(ps_dec->s_high_profile.pi2_scale_mat[i4_i + 6] == NULL)
  ------------------
  |  Branch (276:16): [True: 0, False: 21.8k]
  ------------------
  277|      0|                return ERROR_CORRUPTED_SLICE;
  278|       |
  279|  1.41M|            for(i4_j = 0; i4_j < 64; i4_j++)
  ------------------
  |  Branch (279:27): [True: 1.39M, False: 21.8k]
  ------------------
  280|  1.39M|            {
  281|  1.39M|                ps_dec->s_high_profile.i2_scalinglist8x8[i4_i][gau1_ih264d_inv_scan_prog8x8_cabac[i4_j]] =
  282|  1.39M|                                ps_dec->s_high_profile.pi2_scale_mat[i4_i + 6][i4_j];
  283|       |
  284|  1.39M|            }
  285|  21.8k|        }
  286|  10.9k|    }
  287|  10.9k|    return OK;
  ------------------
  |  |  114|  10.9k|#define OK        0
  ------------------
  288|  10.9k|}

ih264d_parse_buffering_period:
   74|  1.07k|{
   75|  1.07k|    UWORD8 u1_seq_parameter_set_id;
   76|  1.07k|    dec_seq_params_t *ps_seq;
   77|  1.07k|    UWORD8 u1_nal_hrd_present, u1_vcl_hrd_present;
   78|  1.07k|    UWORD32 i;
   79|  1.07k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
   80|  1.07k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   81|  1.07k|    UNUSED(ps_buf_prd);
  ------------------
  |  |   45|  1.07k|#define UNUSED(x) ((void)(x))
  ------------------
   82|  1.07k|    u1_seq_parameter_set_id = ih264d_uev(pu4_bitstrm_ofst,
   83|  1.07k|                                         pu4_bitstrm_buf);
   84|  1.07k|    if(u1_seq_parameter_set_id >= MAX_NUM_SEQ_PARAMS)
  ------------------
  |  |  521|  1.07k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  |  Branch (84:8): [True: 115, False: 962]
  ------------------
   85|    115|        return ERROR_INVALID_SEQ_PARAM;
   86|    962|    ps_seq = &ps_dec->ps_sps[u1_seq_parameter_set_id];
   87|    962|    if(TRUE != ps_seq->u1_is_valid)
  ------------------
  |  |  591|    962|#define TRUE    1
  ------------------
  |  Branch (87:8): [True: 185, False: 777]
  ------------------
   88|    185|        return ERROR_INVALID_SEQ_PARAM;
   89|       |
   90|    777|    ps_dec->ps_sei->u1_seq_param_set_id = u1_seq_parameter_set_id;
   91|    777|    ps_dec->ps_cur_sps = ps_seq;
   92|    777|    if(FALSE == ps_seq->u1_is_valid)
  ------------------
  |  |  592|    777|#define FALSE   0
  ------------------
  |  Branch (92:8): [True: 0, False: 777]
  ------------------
   93|      0|        return ERROR_INVALID_SEQ_PARAM;
   94|    777|    if(1 == ps_seq->u1_vui_parameters_present_flag)
  ------------------
  |  Branch (94:8): [True: 554, False: 223]
  ------------------
   95|    554|    {
   96|    554|        u1_nal_hrd_present = ps_seq->s_vui.u1_nal_hrd_params_present;
   97|    554|        if(u1_nal_hrd_present)
  ------------------
  |  Branch (97:12): [True: 273, False: 281]
  ------------------
   98|    273|        {
   99|  2.79k|            for(i = 0; i < ps_seq->s_vui.s_nal_hrd.u4_cpb_cnt; i++)
  ------------------
  |  Branch (99:24): [True: 2.52k, False: 273]
  ------------------
  100|  2.52k|            {
  101|  2.52k|                ih264d_get_bits_h264(
  102|  2.52k|                                ps_bitstrm,
  103|  2.52k|                                ps_seq->s_vui.s_nal_hrd.u1_initial_cpb_removal_delay);
  104|  2.52k|                ih264d_get_bits_h264(
  105|  2.52k|                                ps_bitstrm,
  106|  2.52k|                                ps_seq->s_vui.s_nal_hrd.u1_initial_cpb_removal_delay);
  107|  2.52k|            }
  108|    273|        }
  109|       |
  110|    554|        u1_vcl_hrd_present = ps_seq->s_vui.u1_vcl_hrd_params_present;
  111|    554|        if(u1_vcl_hrd_present)
  ------------------
  |  Branch (111:12): [True: 154, False: 400]
  ------------------
  112|    154|        {
  113|    594|            for(i = 0; i < ps_seq->s_vui.s_vcl_hrd.u4_cpb_cnt; i++)
  ------------------
  |  Branch (113:24): [True: 440, False: 154]
  ------------------
  114|    440|            {
  115|    440|                ih264d_get_bits_h264(
  116|    440|                                ps_bitstrm,
  117|    440|                                ps_seq->s_vui.s_vcl_hrd.u1_initial_cpb_removal_delay);
  118|    440|                ih264d_get_bits_h264(
  119|    440|                                ps_bitstrm,
  120|    440|                                ps_seq->s_vui.s_vcl_hrd.u1_initial_cpb_removal_delay);
  121|    440|            }
  122|    154|        }
  123|    554|    }
  124|    777|    return (OK);
  ------------------
  |  |  114|    777|#define OK        0
  ------------------
  125|    777|}
ih264d_parse_pic_timing:
  151|    771|{
  152|    771|    sei *ps_sei;
  153|    771|    vui_t *ps_vu4;
  154|    771|    UWORD8 u1_cpb_dpb_present;
  155|    771|    UWORD8 u1_pic_struct_present_flag;
  156|    771|    UWORD32 u4_start_offset, u4_bits_consumed;
  157|    771|    UWORD8 u1_cpb_removal_delay_length, u1_dpb_output_delay_length;
  158|       |
  159|    771|    ps_sei = (sei *)ps_dec->ps_sei;
  160|    771|    ps_vu4 = &ps_dec->ps_cur_sps->s_vui;
  161|       |
  162|    771|    u1_cpb_dpb_present = ps_vu4->u1_vcl_hrd_params_present
  163|    771|                    + ps_vu4->u1_nal_hrd_params_present;
  164|       |
  165|    771|    if(ps_vu4->u1_vcl_hrd_params_present)
  ------------------
  |  Branch (165:8): [True: 142, False: 629]
  ------------------
  166|    142|    {
  167|    142|        u1_cpb_removal_delay_length =
  168|    142|                        ps_vu4->s_vcl_hrd.u1_cpb_removal_delay_length;
  169|    142|        u1_dpb_output_delay_length =
  170|    142|                        ps_vu4->s_vcl_hrd.u1_dpb_output_delay_length;
  171|    142|    }
  172|    629|    else if(ps_vu4->u1_nal_hrd_params_present)
  ------------------
  |  Branch (172:13): [True: 217, False: 412]
  ------------------
  173|    217|    {
  174|    217|        u1_cpb_removal_delay_length =
  175|    217|                        ps_vu4->s_nal_hrd.u1_cpb_removal_delay_length;
  176|    217|        u1_dpb_output_delay_length =
  177|    217|                        ps_vu4->s_nal_hrd.u1_dpb_output_delay_length;
  178|    217|    }
  179|    412|    else
  180|    412|    {
  181|    412|        u1_cpb_removal_delay_length = 24;
  182|    412|        u1_dpb_output_delay_length = 24;
  183|       |
  184|    412|    }
  185|       |
  186|    771|    u4_start_offset = ps_bitstrm->u4_ofst;
  187|    771|    if(u1_cpb_dpb_present)
  ------------------
  |  Branch (187:8): [True: 359, False: 412]
  ------------------
  188|    359|    {
  189|    359|        ih264d_get_bits_h264(ps_bitstrm, u1_cpb_removal_delay_length);
  190|    359|        ih264d_get_bits_h264(ps_bitstrm, u1_dpb_output_delay_length);
  191|    359|    }
  192|       |
  193|    771|    u1_pic_struct_present_flag = ps_vu4->u1_pic_struct_present_flag;
  194|    771|    if(u1_pic_struct_present_flag)
  ------------------
  |  Branch (194:8): [True: 232, False: 539]
  ------------------
  195|    232|    {
  196|    232|        ps_sei->u1_pic_struct = ih264d_get_bits_h264(ps_bitstrm, 4);
  197|    232|        ps_dec->u1_pic_struct_copy = ps_sei->u1_pic_struct;
  198|    232|        ps_sei->u1_is_valid = 1;
  199|    232|    }
  200|    771|    u4_bits_consumed = ps_bitstrm->u4_ofst - u4_start_offset;
  201|       |
  202|    771|    if((ui4_payload_size << 3) < u4_bits_consumed)
  ------------------
  |  Branch (202:8): [True: 69, False: 702]
  ------------------
  203|     69|        return ERROR_CORRUPTED_SLICE;
  204|       |
  205|    702|    ih264d_flush_bits_h264(ps_bitstrm,
  206|    702|                           (ui4_payload_size << 3) - u4_bits_consumed);
  207|       |
  208|    702|    return (OK);
  ------------------
  |  |  114|    702|#define OK        0
  ------------------
  209|    771|}
ih264d_parse_recovery_point:
  235|  1.84k|{
  236|  1.84k|    sei *ps_sei = ps_dec->ps_sei;
  237|  1.84k|    dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
  238|  1.84k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  239|  1.84k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  240|  1.84k|    UNUSED(ui4_payload_size);
  ------------------
  |  |   45|  1.84k|#define UNUSED(x) ((void)(x))
  ------------------
  241|  1.84k|    ps_sei->u2_recovery_frame_cnt = ih264d_uev(pu4_bitstrm_ofst,
  242|  1.84k|                                               pu4_bitstrm_buf);
  243|  1.84k|    ps_err->u4_frm_sei_sync = ps_err->u4_cur_frm
  244|  1.84k|                    + ps_sei->u2_recovery_frame_cnt;
  245|  1.84k|    ps_sei->u1_exact_match_flag = ih264d_get_bit_h264(ps_bitstrm);
  246|  1.84k|    ps_sei->u1_broken_link_flag = ih264d_get_bit_h264(ps_bitstrm);
  247|  1.84k|    ps_sei->u1_changing_slice_grp_idc = ih264d_get_bits_h264(ps_bitstrm, 2);
  248|       |
  249|  1.84k|    return (OK);
  ------------------
  |  |  114|  1.84k|#define OK        0
  ------------------
  250|  1.84k|}
ih264d_parse_mdcv:
  276|  1.64k|{
  277|  1.64k|    sei *ps_sei = ps_dec->ps_sei_parse;
  278|  1.64k|    dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
  279|  1.64k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  280|  1.64k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  281|  1.64k|    UWORD32 u4_count;
  282|  1.64k|    UNUSED(ui4_payload_size);
  ------------------
  |  |   45|  1.64k|#define UNUSED(x) ((void)(x))
  ------------------
  283|       |
  284|  1.64k|    if((ps_dec == NULL) || (ps_sei == NULL))
  ------------------
  |  Branch (284:8): [True: 0, False: 1.64k]
  |  Branch (284:28): [True: 0, False: 1.64k]
  ------------------
  285|      0|    {
  286|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  287|      0|    }
  288|       |
  289|  1.64k|    ps_sei->u1_sei_mdcv_params_present_flag = 1;
  290|       |
  291|       |    /* display primaries x */
  292|  5.49k|    for(u4_count = 0; u4_count < NUM_SEI_MDCV_PRIMARIES; u4_count++)
  ------------------
  |  |   51|  5.49k|#define NUM_SEI_MDCV_PRIMARIES        3
  ------------------
  |  Branch (292:23): [True: 4.47k, False: 1.02k]
  ------------------
  293|  4.47k|    {
  294|  4.47k|        ps_sei->s_sei_mdcv_params.au2_display_primaries_x[u4_count] =
  295|  4.47k|                                    (UWORD16)ih264d_get_bits_h264(ps_bitstrm, 16);
  296|       |
  297|  4.47k|        if((ps_sei->s_sei_mdcv_params.au2_display_primaries_x[u4_count] >
  ------------------
  |  Branch (297:12): [True: 68, False: 4.41k]
  ------------------
  298|  4.47k|                                                DISPLAY_PRIMARIES_X_UPPER_LIMIT) ||
  ------------------
  |  |  620|  4.47k|#define DISPLAY_PRIMARIES_X_UPPER_LIMIT                37000
  ------------------
  299|  4.41k|           (ps_sei->s_sei_mdcv_params.au2_display_primaries_x[u4_count] <
  ------------------
  |  Branch (299:12): [True: 110, False: 4.30k]
  ------------------
  300|  4.41k|                                                DISPLAY_PRIMARIES_X_LOWER_LIMIT) ||
  ------------------
  |  |  621|  4.41k|#define DISPLAY_PRIMARIES_X_LOWER_LIMIT                5
  ------------------
  301|  4.30k|           ((ps_sei->s_sei_mdcv_params.au2_display_primaries_x[u4_count] %
  ------------------
  |  Branch (301:12): [True: 175, False: 4.12k]
  ------------------
  302|  4.30k|                                               DISPLAY_PRIMARIES_X_DIVISION_FACTOR) != 0))
  ------------------
  |  |  622|  4.30k|#define DISPLAY_PRIMARIES_X_DIVISION_FACTOR            5
  ------------------
  303|    353|        {
  304|    353|            ps_sei->u1_sei_mdcv_params_present_flag = 0;
  305|    353|            return ERROR_INV_SEI_MDCV_PARAMS;
  306|    353|        }
  307|       |
  308|  4.12k|        ps_sei->s_sei_mdcv_params.au2_display_primaries_y[u4_count] =
  309|  4.12k|                                    (UWORD16)ih264d_get_bits_h264(ps_bitstrm, 16);
  310|       |
  311|  4.12k|        if((ps_sei->s_sei_mdcv_params.au2_display_primaries_y[u4_count] >
  ------------------
  |  Branch (311:12): [True: 72, False: 4.05k]
  ------------------
  312|  4.12k|                                                DISPLAY_PRIMARIES_Y_UPPER_LIMIT) ||
  ------------------
  |  |  624|  4.12k|#define DISPLAY_PRIMARIES_Y_UPPER_LIMIT                42000
  ------------------
  313|  4.05k|           (ps_sei->s_sei_mdcv_params.au2_display_primaries_y[u4_count] <
  ------------------
  |  Branch (313:12): [True: 102, False: 3.95k]
  ------------------
  314|  4.05k|                                               DISPLAY_PRIMARIES_Y_LOWER_LIMIT) ||
  ------------------
  |  |  625|  4.05k|#define DISPLAY_PRIMARIES_Y_LOWER_LIMIT                5
  ------------------
  315|  3.95k|           ((ps_sei->s_sei_mdcv_params.au2_display_primaries_y[u4_count] %
  ------------------
  |  Branch (315:12): [True: 93, False: 3.85k]
  ------------------
  316|  3.95k|                                              DISPLAY_PRIMARIES_Y_DIVISION_FACTOR) != 0))
  ------------------
  |  |  626|  3.95k|#define DISPLAY_PRIMARIES_Y_DIVISION_FACTOR            5
  ------------------
  317|    267|        {
  318|    267|            ps_sei->u1_sei_mdcv_params_present_flag = 0;
  319|    267|            return ERROR_INV_SEI_MDCV_PARAMS;
  320|    267|        }
  321|  4.12k|    }
  322|       |
  323|       |    /* white point x */
  324|  1.02k|    ps_sei->s_sei_mdcv_params.u2_white_point_x = (UWORD16)ih264d_get_bits_h264(ps_bitstrm, 16);
  325|       |
  326|  1.02k|    if((ps_sei->s_sei_mdcv_params.u2_white_point_x > WHITE_POINT_X_UPPER_LIMIT) ||
  ------------------
  |  |  628|  1.02k|#define WHITE_POINT_X_UPPER_LIMIT                      37000
  ------------------
  |  Branch (326:8): [True: 83, False: 938]
  ------------------
  327|    938|       (ps_sei->s_sei_mdcv_params.u2_white_point_x < WHITE_POINT_X_LOWER_LIMIT) ||
  ------------------
  |  |  629|    938|#define WHITE_POINT_X_LOWER_LIMIT                      5
  ------------------
  |  Branch (327:8): [True: 66, False: 872]
  ------------------
  328|    872|       ((ps_sei->s_sei_mdcv_params.u2_white_point_x % WHITE_POINT_X_DIVISION_FACTOR) != 0))
  ------------------
  |  |  630|    872|#define WHITE_POINT_X_DIVISION_FACTOR                  5
  ------------------
  |  Branch (328:8): [True: 74, False: 798]
  ------------------
  329|    223|    {
  330|    223|        ps_sei->u1_sei_mdcv_params_present_flag = 0;
  331|    223|        return ERROR_INV_SEI_MDCV_PARAMS;
  332|    223|    }
  333|       |    /* white point y */
  334|    798|    ps_sei->s_sei_mdcv_params.u2_white_point_y = (UWORD16)ih264d_get_bits_h264(ps_bitstrm, 16);
  335|       |
  336|    798|    if((ps_sei->s_sei_mdcv_params.u2_white_point_y > WHITE_POINT_Y_UPPER_LIMIT) ||
  ------------------
  |  |  632|    798|#define WHITE_POINT_Y_UPPER_LIMIT                      42000
  ------------------
  |  Branch (336:8): [True: 74, False: 724]
  ------------------
  337|    724|       (ps_sei->s_sei_mdcv_params.u2_white_point_y < WHITE_POINT_Y_LOWER_LIMIT) ||
  ------------------
  |  |  633|    724|#define WHITE_POINT_Y_LOWER_LIMIT                      5
  ------------------
  |  Branch (337:8): [True: 73, False: 651]
  ------------------
  338|    651|       ((ps_sei->s_sei_mdcv_params.u2_white_point_y % WHITE_POINT_Y_DIVISION_FACTOR) != 0))
  ------------------
  |  |  634|    651|#define WHITE_POINT_Y_DIVISION_FACTOR                  5
  ------------------
  |  Branch (338:8): [True: 80, False: 571]
  ------------------
  339|    227|    {
  340|    227|        ps_sei->u1_sei_mdcv_params_present_flag = 0;
  341|    227|        return ERROR_INV_SEI_MDCV_PARAMS;
  342|    227|    }
  343|       |    /* max display mastering luminance */
  344|    571|    ps_sei->s_sei_mdcv_params.u4_max_display_mastering_luminance =
  345|    571|                                    (UWORD32)ih264d_get_bits_h264(ps_bitstrm, 32);
  346|       |
  347|    571|    if((ps_sei->s_sei_mdcv_params.u4_max_display_mastering_luminance >
  ------------------
  |  Branch (347:8): [True: 100, False: 471]
  ------------------
  348|    571|                                            MAX_DISPLAY_MASTERING_LUMINANCE_UPPER_LIMIT) ||
  ------------------
  |  |  636|    571|#define MAX_DISPLAY_MASTERING_LUMINANCE_UPPER_LIMIT        100000000
  ------------------
  349|    471|       (ps_sei->s_sei_mdcv_params.u4_max_display_mastering_luminance <
  ------------------
  |  Branch (349:8): [True: 75, False: 396]
  ------------------
  350|    471|                                            MAX_DISPLAY_MASTERING_LUMINANCE_LOWER_LIMIT) ||
  ------------------
  |  |  637|    471|#define MAX_DISPLAY_MASTERING_LUMINANCE_LOWER_LIMIT        50000
  ------------------
  351|    396|       ((ps_sei->s_sei_mdcv_params.u4_max_display_mastering_luminance %
  ------------------
  |  Branch (351:8): [True: 83, False: 313]
  ------------------
  352|    396|                                        MAX_DISPLAY_MASTERING_LUMINANCE_DIVISION_FACTOR) != 0))
  ------------------
  |  |  638|    396|#define MAX_DISPLAY_MASTERING_LUMINANCE_DIVISION_FACTOR    10000
  ------------------
  353|    258|    {
  354|    258|        ps_sei->u1_sei_mdcv_params_present_flag = 0;
  355|    258|        return ERROR_INV_SEI_MDCV_PARAMS;
  356|    258|    }
  357|       |    /* min display mastering luminance */
  358|    313|    ps_sei->s_sei_mdcv_params.u4_min_display_mastering_luminance =
  359|    313|                                    (UWORD32)ih264d_get_bits_h264(ps_bitstrm, 32);
  360|       |
  361|    313|    if((ps_sei->s_sei_mdcv_params.u4_min_display_mastering_luminance >
  ------------------
  |  Branch (361:8): [True: 98, False: 215]
  ------------------
  362|    313|                                            MIN_DISPLAY_MASTERING_LUMINANCE_UPPER_LIMIT) ||
  ------------------
  |  |  640|    313|#define MIN_DISPLAY_MASTERING_LUMINANCE_UPPER_LIMIT        50000
  ------------------
  363|    215|        (ps_sei->s_sei_mdcv_params.u4_min_display_mastering_luminance <
  ------------------
  |  Branch (363:9): [True: 66, False: 149]
  ------------------
  364|    215|                                            MIN_DISPLAY_MASTERING_LUMINANCE_LOWER_LIMIT))
  ------------------
  |  |  641|    215|#define MIN_DISPLAY_MASTERING_LUMINANCE_LOWER_LIMIT        1
  ------------------
  365|    164|    {
  366|    164|        ps_sei->u1_sei_mdcv_params_present_flag = 0;
  367|    164|        return ERROR_INV_SEI_MDCV_PARAMS;
  368|    164|    }
  369|    149|    if(ps_sei->s_sei_mdcv_params.u4_max_display_mastering_luminance <=
  ------------------
  |  Branch (369:8): [True: 66, False: 83]
  ------------------
  370|    149|            ps_sei->s_sei_mdcv_params.u4_min_display_mastering_luminance)
  371|     66|    {
  372|     66|        ps_sei->u1_sei_mdcv_params_present_flag = 0;
  373|     66|        return ERROR_INV_SEI_MDCV_PARAMS;
  374|     66|    }
  375|     83|    return (OK);
  ------------------
  |  |  114|     83|#define OK        0
  ------------------
  376|    149|}
ih264d_parse_cll:
  402|    538|{
  403|    538|    sei *ps_sei = ps_dec->ps_sei_parse;
  404|    538|    dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
  405|    538|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  406|    538|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  407|    538|    UNUSED(ui4_payload_size);
  ------------------
  |  |   45|    538|#define UNUSED(x) ((void)(x))
  ------------------
  408|       |
  409|    538|    if((ps_dec == NULL) || (ps_sei == NULL))
  ------------------
  |  Branch (409:8): [True: 0, False: 538]
  |  Branch (409:28): [True: 0, False: 538]
  ------------------
  410|      0|    {
  411|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  412|      0|    }
  413|       |
  414|    538|    ps_sei->u1_sei_cll_params_present_flag = 1;
  415|       |
  416|    538|    ps_sei->s_sei_cll_params.u2_max_content_light_level =
  417|    538|                        (UWORD16)ih264d_get_bits_h264(ps_bitstrm, 16);
  418|    538|    ps_sei->s_sei_cll_params.u2_max_pic_average_light_level =
  419|    538|                        (UWORD16)ih264d_get_bits_h264(ps_bitstrm, 16);
  420|       |    /*No any sanity checks done for CLL params*/
  421|       |
  422|    538|    return (OK);
  ------------------
  |  |  114|    538|#define OK        0
  ------------------
  423|    538|}
ih264d_parse_ave:
  449|    511|{
  450|    511|    sei *ps_sei = ps_dec->ps_sei_parse;
  451|    511|    dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
  452|    511|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  453|    511|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  454|    511|    UNUSED(ui4_payload_size);
  ------------------
  |  |   45|    511|#define UNUSED(x) ((void)(x))
  ------------------
  455|       |
  456|    511|    if((ps_dec == NULL) || (ps_sei == NULL))
  ------------------
  |  Branch (456:8): [True: 0, False: 511]
  |  Branch (456:28): [True: 0, False: 511]
  ------------------
  457|      0|    {
  458|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  459|      0|    }
  460|       |
  461|    511|    ps_sei->u1_sei_ave_params_present_flag = 1;
  462|       |
  463|    511|    ps_sei->s_sei_ave_params.u4_ambient_illuminance = (UWORD32)ih264d_get_bits_h264(ps_bitstrm, 32);
  464|    511|    if(0 == ps_sei->s_sei_ave_params.u4_ambient_illuminance)
  ------------------
  |  Branch (464:8): [True: 66, False: 445]
  ------------------
  465|     66|    {
  466|     66|        ps_sei->u1_sei_ave_params_present_flag = 0;
  467|     66|        return ERROR_INV_SEI_AVE_PARAMS;
  468|     66|    }
  469|       |
  470|    445|    ps_sei->s_sei_ave_params.u2_ambient_light_x = (UWORD16)ih264d_get_bits_h264(ps_bitstrm, 16);
  471|    445|    if(ps_sei->s_sei_ave_params.u2_ambient_light_x > AMBIENT_LIGHT_X_UPPER_LIMIT)
  ------------------
  |  |  643|    445|#define AMBIENT_LIGHT_X_UPPER_LIMIT        50000
  ------------------
  |  Branch (471:8): [True: 72, False: 373]
  ------------------
  472|     72|    {
  473|     72|        ps_sei->u1_sei_ave_params_present_flag = 0;
  474|     72|        return ERROR_INV_SEI_AVE_PARAMS;
  475|     72|    }
  476|       |
  477|    373|    ps_sei->s_sei_ave_params.u2_ambient_light_y = (UWORD16)ih264d_get_bits_h264(ps_bitstrm, 16);
  478|    373|    if(ps_sei->s_sei_ave_params.u2_ambient_light_y > AMBIENT_LIGHT_Y_UPPER_LIMIT)
  ------------------
  |  |  644|    373|#define AMBIENT_LIGHT_Y_UPPER_LIMIT        50000
  ------------------
  |  Branch (478:8): [True: 86, False: 287]
  ------------------
  479|     86|    {
  480|     86|        ps_sei->u1_sei_ave_params_present_flag = 0;
  481|     86|        return ERROR_INV_SEI_AVE_PARAMS;
  482|     86|    }
  483|    287|    return (OK);
  ------------------
  |  |  114|    287|#define OK        0
  ------------------
  484|    373|}
ih264d_parse_ccv:
  510|  27.3k|{
  511|  27.3k|    sei *ps_sei = ps_dec->ps_sei_parse;
  512|  27.3k|    dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
  513|  27.3k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  514|  27.3k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  515|  27.3k|    UWORD32 u4_count;
  516|  27.3k|    UNUSED(ui4_payload_size);
  ------------------
  |  |   45|  27.3k|#define UNUSED(x) ((void)(x))
  ------------------
  517|       |
  518|  27.3k|    if((ps_dec == NULL) || (ps_sei == NULL))
  ------------------
  |  Branch (518:8): [True: 0, False: 27.3k]
  |  Branch (518:28): [True: 0, False: 27.3k]
  ------------------
  519|      0|    {
  520|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  521|      0|    }
  522|       |
  523|  27.3k|    ps_sei->u1_sei_ccv_params_present_flag = 0;
  524|       |
  525|  27.3k|    ps_sei->s_sei_ccv_params.u1_ccv_cancel_flag = (UWORD8)ih264d_get_bit_h264(ps_bitstrm);
  526|       |
  527|  27.3k|    if(ps_sei->s_sei_ccv_params.u1_ccv_cancel_flag > 1)
  ------------------
  |  Branch (527:8): [True: 0, False: 27.3k]
  ------------------
  528|      0|    {
  529|      0|        return ERROR_INV_SEI_CCV_PARAMS;
  530|      0|    }
  531|  27.3k|    if(0 == ps_sei->s_sei_ccv_params.u1_ccv_cancel_flag)
  ------------------
  |  Branch (531:8): [True: 2.99k, False: 24.3k]
  ------------------
  532|  2.99k|    {
  533|  2.99k|        ps_sei->s_sei_ccv_params.u1_ccv_persistence_flag =
  534|  2.99k|                                                (UWORD8)ih264d_get_bit_h264(ps_bitstrm);
  535|  2.99k|        if(ps_sei->s_sei_ccv_params.u1_ccv_persistence_flag > 1)
  ------------------
  |  Branch (535:12): [True: 0, False: 2.99k]
  ------------------
  536|      0|        {
  537|      0|            return ERROR_INV_SEI_CCV_PARAMS;
  538|      0|        }
  539|  2.99k|        ps_sei->s_sei_ccv_params.u1_ccv_primaries_present_flag =
  540|  2.99k|                                                (UWORD8)ih264d_get_bit_h264(ps_bitstrm);
  541|  2.99k|        if(ps_sei->s_sei_ccv_params.u1_ccv_primaries_present_flag > 1)
  ------------------
  |  Branch (541:12): [True: 0, False: 2.99k]
  ------------------
  542|      0|        {
  543|      0|            return ERROR_INV_SEI_CCV_PARAMS;
  544|      0|        }
  545|  2.99k|        ps_sei->s_sei_ccv_params.u1_ccv_min_luminance_value_present_flag =
  546|  2.99k|                                                (UWORD8)ih264d_get_bit_h264(ps_bitstrm);
  547|  2.99k|        if(ps_sei->s_sei_ccv_params.u1_ccv_min_luminance_value_present_flag > 1)
  ------------------
  |  Branch (547:12): [True: 0, False: 2.99k]
  ------------------
  548|      0|        {
  549|      0|            return ERROR_INV_SEI_CCV_PARAMS;
  550|      0|        }
  551|  2.99k|        ps_sei->s_sei_ccv_params.u1_ccv_max_luminance_value_present_flag =
  552|  2.99k|                                                (UWORD8)ih264d_get_bit_h264(ps_bitstrm);
  553|  2.99k|        if(ps_sei->s_sei_ccv_params.u1_ccv_max_luminance_value_present_flag > 1)
  ------------------
  |  Branch (553:12): [True: 0, False: 2.99k]
  ------------------
  554|      0|        {
  555|      0|            return ERROR_INV_SEI_CCV_PARAMS;
  556|      0|        }
  557|  2.99k|        ps_sei->s_sei_ccv_params.u1_ccv_avg_luminance_value_present_flag =
  558|  2.99k|                                                (UWORD8)ih264d_get_bit_h264(ps_bitstrm);
  559|  2.99k|        if(ps_sei->s_sei_ccv_params.u1_ccv_avg_luminance_value_present_flag > 1)
  ------------------
  |  Branch (559:12): [True: 0, False: 2.99k]
  ------------------
  560|      0|        {
  561|      0|            return ERROR_INV_SEI_CCV_PARAMS;
  562|      0|        }
  563|       |
  564|  2.99k|        if((ps_sei->s_sei_ccv_params.u1_ccv_primaries_present_flag == 0) &&
  ------------------
  |  Branch (564:12): [True: 2.43k, False: 557]
  ------------------
  565|  2.43k|           (ps_sei->s_sei_ccv_params.u1_ccv_min_luminance_value_present_flag == 0) &&
  ------------------
  |  Branch (565:12): [True: 580, False: 1.85k]
  ------------------
  566|    580|           (ps_sei->s_sei_ccv_params.u1_ccv_max_luminance_value_present_flag == 0) &&
  ------------------
  |  Branch (566:12): [True: 314, False: 266]
  ------------------
  567|    314|           (ps_sei->s_sei_ccv_params.u1_ccv_avg_luminance_value_present_flag == 0))
  ------------------
  |  Branch (567:12): [True: 84, False: 230]
  ------------------
  568|     84|        {
  569|     84|            return ERROR_INV_SEI_CCV_PARAMS;
  570|     84|	 }
  571|       |
  572|  2.90k|        ps_sei->s_sei_ccv_params.u1_ccv_reserved_zero_2bits =
  573|  2.90k|                                                (UWORD8)ih264d_get_bits_h264(ps_bitstrm, 2);
  574|  2.90k|        if((ps_sei->s_sei_ccv_params.u1_ccv_reserved_zero_2bits != 0))
  ------------------
  |  Branch (574:12): [True: 96, False: 2.81k]
  ------------------
  575|     96|        {
  576|     96|            return ERROR_INV_SEI_CCV_PARAMS;
  577|     96|        }
  578|       |
  579|       |        /* ccv primaries */
  580|  2.81k|        if(1 == ps_sei->s_sei_ccv_params.u1_ccv_primaries_present_flag)
  ------------------
  |  Branch (580:12): [True: 531, False: 2.28k]
  ------------------
  581|    531|        {
  582|  1.31k|            for(u4_count = 0; u4_count < NUM_SEI_CCV_PRIMARIES; u4_count++)
  ------------------
  |  |   56|  1.31k|#define NUM_SEI_CCV_PRIMARIES         3
  ------------------
  |  Branch (582:31): [True: 1.19k, False: 115]
  ------------------
  583|  1.19k|            {
  584|  1.19k|                ps_sei->s_sei_ccv_params.ai4_ccv_primaries_x[u4_count] =
  585|  1.19k|                                                (WORD32)ih264d_get_bits_h264(ps_bitstrm, 32);
  586|  1.19k|                if((ps_sei->s_sei_ccv_params.ai4_ccv_primaries_x[u4_count] >
  ------------------
  |  Branch (586:20): [True: 86, False: 1.11k]
  ------------------
  587|  1.19k|                                                        CCV_PRIMARIES_X_UPPER_LIMIT) ||
  ------------------
  |  |  646|  1.19k|#define CCV_PRIMARIES_X_UPPER_LIMIT        5000000
  ------------------
  588|  1.11k|                   (ps_sei->s_sei_ccv_params.ai4_ccv_primaries_x[u4_count] <
  ------------------
  |  Branch (588:20): [True: 109, False: 1.00k]
  ------------------
  589|  1.11k|                                                        CCV_PRIMARIES_X_LOWER_LIMIT))
  ------------------
  |  |  647|  1.11k|#define CCV_PRIMARIES_X_LOWER_LIMIT        -5000000
  ------------------
  590|    195|                {
  591|    195|                    return ERROR_INV_SEI_CCV_PARAMS;
  592|    195|                }
  593|       |
  594|  1.00k|                ps_sei->s_sei_ccv_params.ai4_ccv_primaries_y[u4_count] =
  595|  1.00k|                                                (WORD32)ih264d_get_bits_h264(ps_bitstrm, 32);
  596|  1.00k|                if((ps_sei->s_sei_ccv_params.ai4_ccv_primaries_y[u4_count] >
  ------------------
  |  Branch (596:20): [True: 118, False: 886]
  ------------------
  597|  1.00k|                                                        CCV_PRIMARIES_Y_UPPER_LIMIT) ||
  ------------------
  |  |  648|  1.00k|#define CCV_PRIMARIES_Y_UPPER_LIMIT        5000000
  ------------------
  598|    886|                   (ps_sei->s_sei_ccv_params.ai4_ccv_primaries_y[u4_count] <
  ------------------
  |  Branch (598:20): [True: 103, False: 783]
  ------------------
  599|    886|                                                        CCV_PRIMARIES_Y_LOWER_LIMIT))
  ------------------
  |  |  649|    886|#define CCV_PRIMARIES_Y_LOWER_LIMIT        -5000000
  ------------------
  600|    221|                {
  601|    221|                    return ERROR_INV_SEI_CCV_PARAMS;
  602|    221|                }
  603|  1.00k|            }
  604|    531|        }
  605|       |
  606|  2.39k|        if(1 == ps_sei->s_sei_ccv_params.u1_ccv_min_luminance_value_present_flag)
  ------------------
  |  Branch (606:12): [True: 1.85k, False: 542]
  ------------------
  607|  1.85k|        {
  608|  1.85k|            ps_sei->s_sei_ccv_params.u4_ccv_min_luminance_value =
  609|  1.85k|                                                (UWORD32)ih264d_get_bits_h264(ps_bitstrm, 32);
  610|  1.85k|        }
  611|       |
  612|  2.39k|        if(1 == ps_sei->s_sei_ccv_params.u1_ccv_max_luminance_value_present_flag)
  ------------------
  |  Branch (612:12): [True: 2.02k, False: 375]
  ------------------
  613|  2.02k|        {
  614|  2.02k|            ps_sei->s_sei_ccv_params.u4_ccv_max_luminance_value =
  615|  2.02k|                                                (UWORD32)ih264d_get_bits_h264(ps_bitstrm, 32);
  616|  2.02k|            if((1 == ps_sei->s_sei_ccv_params.u1_ccv_min_luminance_value_present_flag) &&
  ------------------
  |  Branch (616:16): [True: 1.67k, False: 346]
  ------------------
  617|  1.67k|                (ps_sei->s_sei_ccv_params.u4_ccv_max_luminance_value <
  ------------------
  |  Branch (617:17): [True: 205, False: 1.47k]
  ------------------
  618|  1.67k|                                                ps_sei->s_sei_ccv_params.u4_ccv_min_luminance_value))
  619|    205|            {
  620|    205|                return ERROR_INV_SEI_CCV_PARAMS;
  621|    205|            }
  622|  2.02k|        }
  623|  2.19k|        if(1 == ps_sei->s_sei_ccv_params.u1_ccv_avg_luminance_value_present_flag)
  ------------------
  |  Branch (623:12): [True: 1.06k, False: 1.13k]
  ------------------
  624|  1.06k|        {
  625|  1.06k|            ps_sei->s_sei_ccv_params.u4_ccv_avg_luminance_value =
  626|  1.06k|                                                (UWORD32)ih264d_get_bits_h264(ps_bitstrm, 32);
  627|  1.06k|            if((1 == ps_sei->s_sei_ccv_params.u1_ccv_min_luminance_value_present_flag) &&
  ------------------
  |  Branch (627:16): [True: 651, False: 411]
  ------------------
  628|    651|                (ps_sei->s_sei_ccv_params.u4_ccv_avg_luminance_value <
  ------------------
  |  Branch (628:17): [True: 171, False: 480]
  ------------------
  629|    651|                                                ps_sei->s_sei_ccv_params.u4_ccv_min_luminance_value))
  630|    171|            {
  631|    171|                return ERROR_INV_SEI_CCV_PARAMS;
  632|    171|            }
  633|    891|            if((1 == ps_sei->s_sei_ccv_params.u1_ccv_max_luminance_value_present_flag) &&
  ------------------
  |  Branch (633:16): [True: 670, False: 221]
  ------------------
  634|    670|                (ps_sei->s_sei_ccv_params.u4_ccv_max_luminance_value <
  ------------------
  |  Branch (634:17): [True: 116, False: 554]
  ------------------
  635|    670|                                                ps_sei->s_sei_ccv_params.u4_ccv_avg_luminance_value))
  636|    116|            {
  637|    116|                return ERROR_INV_SEI_CCV_PARAMS;
  638|    116|            }
  639|    891|        }
  640|  2.19k|    }
  641|  26.2k|    ps_sei->u1_sei_ccv_params_present_flag = 1;
  642|  26.2k|    return (OK);
  ------------------
  |  |  114|  26.2k|#define OK        0
  ------------------
  643|  27.3k|}
ih264d_parse_sii:
  668|  2.22k|{
  669|  2.22k|    sei *ps_sei;
  670|  2.22k|    dec_err_status_t *ps_err;
  671|  2.22k|    int i;
  672|  2.22k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  673|  2.22k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  674|  2.22k|    UNUSED(ui4_payload_size);
  ------------------
  |  |   45|  2.22k|#define UNUSED(x) ((void)(x))
  ------------------
  675|       |
  676|  2.22k|    if(ps_dec == NULL)
  ------------------
  |  Branch (676:8): [True: 0, False: 2.22k]
  ------------------
  677|      0|    {
  678|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  679|      0|    }
  680|  2.22k|    ps_sei = ps_dec->ps_sei_parse;
  681|       |
  682|  2.22k|    if(ps_sei == NULL)
  ------------------
  |  Branch (682:8): [True: 0, False: 2.22k]
  ------------------
  683|      0|    {
  684|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  685|      0|    }
  686|  2.22k|    ps_err = ps_dec->ps_dec_err_status;
  687|       |
  688|  2.22k|    ps_sei->u1_sei_sii_params_present_flag = 0;
  689|  2.22k|    memset(&ps_sei->s_sei_sii_params, 0, sizeof(ps_sei->s_sei_sii_params));
  690|       |
  691|  2.22k|    ps_sei->s_sei_sii_params.u4_sii_sub_layer_idx = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  692|       |
  693|  2.22k|    if(0 == ps_sei->s_sei_sii_params.u4_sii_sub_layer_idx)
  ------------------
  |  Branch (693:8): [True: 2.11k, False: 116]
  ------------------
  694|  2.11k|    {
  695|  2.11k|        ps_sei->s_sei_sii_params.u1_shutter_interval_info_present_flag =
  696|  2.11k|            (UWORD8) ih264d_get_bit_h264(ps_bitstrm);
  697|       |
  698|  2.11k|        if(1 == ps_sei->s_sei_sii_params.u1_shutter_interval_info_present_flag)
  ------------------
  |  Branch (698:12): [True: 1.03k, False: 1.07k]
  ------------------
  699|  1.03k|        {
  700|  1.03k|            ps_sei->s_sei_sii_params.u4_sii_time_scale =
  701|  1.03k|                (UWORD32) ih264d_get_bits_h264(ps_bitstrm, 32);
  702|       |
  703|  1.03k|            ps_sei->s_sei_sii_params.u1_fixed_shutter_interval_within_cvs_flag =
  704|  1.03k|                (UWORD8) ih264d_get_bit_h264(ps_bitstrm);
  705|       |
  706|  1.03k|            if(1 == ps_sei->s_sei_sii_params.u1_fixed_shutter_interval_within_cvs_flag)
  ------------------
  |  Branch (706:16): [True: 430, False: 603]
  ------------------
  707|    430|            {
  708|    430|                ps_sei->s_sei_sii_params.u4_sii_num_units_in_shutter_interval =
  709|    430|                    (UWORD32) ih264d_get_bits_h264(ps_bitstrm, 32);
  710|    430|            }
  711|    603|            else
  712|    603|            {
  713|    603|                ps_sei->s_sei_sii_params.u1_sii_max_sub_layers_minus1 =
  714|    603|                    (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 3);
  715|  1.97k|                for(i = 0; i <= ps_sei->s_sei_sii_params.u1_sii_max_sub_layers_minus1; i++)
  ------------------
  |  Branch (715:28): [True: 1.37k, False: 603]
  ------------------
  716|  1.37k|                {
  717|  1.37k|                    ps_sei->s_sei_sii_params.au4_sub_layer_num_units_in_shutter_interval[i] =
  718|  1.37k|                        (UWORD32) ih264d_get_bits_h264(ps_bitstrm, 32);
  719|  1.37k|                }
  720|    603|            }
  721|  1.03k|        }
  722|  2.11k|    }
  723|       |
  724|  2.22k|    if((ps_sei->s_sei_sii_params.u4_sii_sub_layer_idx >
  ------------------
  |  Branch (724:8): [True: 116, False: 2.11k]
  ------------------
  725|  2.22k|        ps_sei->s_sei_sii_params.u1_sii_max_sub_layers_minus1) &&
  726|    116|       (ps_sei->s_sei_sii_params.u1_fixed_shutter_interval_within_cvs_flag == 0))
  ------------------
  |  Branch (726:8): [True: 116, False: 0]
  ------------------
  727|    116|    {
  728|    116|        return ERROR_INV_SEI_SII_PARAMS;
  729|    116|    }
  730|       |
  731|  2.11k|    ps_sei->u1_sei_sii_params_present_flag = 1;
  732|  2.11k|    return (OK);
  ------------------
  |  |  114|  2.11k|#define OK        0
  ------------------
  733|  2.22k|}
ih264d_parse_fgc:
  758|  2.78k|{
  759|  2.78k|    sei *ps_sei = ps_dec->ps_sei_parse;
  760|  2.78k|    dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
  761|  2.78k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  762|  2.78k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  763|  2.78k|    UWORD32 u4_count;
  764|  2.78k|    WORD32 i4_luma_bitdepth, i4_chroma_bitdepth;
  765|  2.78k|    UWORD32 c, i, j;
  766|  2.78k|    UNUSED(ui4_payload_size);
  ------------------
  |  |   45|  2.78k|#define UNUSED(x) ((void)(x))
  ------------------
  767|       |
  768|  2.78k|    if((ps_dec == NULL) || (ps_sei == NULL))
  ------------------
  |  Branch (768:8): [True: 0, False: 2.78k]
  |  Branch (768:28): [True: 0, False: 2.78k]
  ------------------
  769|      0|    {
  770|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  771|      0|    }
  772|       |
  773|  2.78k|    ps_sei->u1_sei_fgc_params_present_flag = 0;
  774|       |
  775|  2.78k|    ps_sei->s_sei_fgc_params.u1_film_grain_characteristics_cancel_flag =
  776|  2.78k|        (UWORD8) ih264d_get_bit_h264(ps_bitstrm);
  777|       |
  778|  2.78k|    if(0 == ps_sei->s_sei_fgc_params.u1_film_grain_characteristics_cancel_flag)
  ------------------
  |  Branch (778:8): [True: 2.12k, False: 653]
  ------------------
  779|  2.12k|    {
  780|  2.12k|        ps_sei->s_sei_fgc_params.u1_film_grain_model_id =
  781|  2.12k|            (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 2);
  782|  2.12k|        if(ps_sei->s_sei_fgc_params.u1_film_grain_model_id > 1)
  ------------------
  |  Branch (782:12): [True: 66, False: 2.06k]
  ------------------
  783|     66|        {
  784|     66|            return ERROR_INV_SEI_FGC_PARAMS;
  785|     66|        }
  786|  2.06k|        ps_sei->s_sei_fgc_params.u1_separate_colour_description_present_flag =
  787|  2.06k|            (UWORD8) ih264d_get_bit_h264(ps_bitstrm);
  788|       |
  789|  2.06k|        if(ps_sei->s_sei_fgc_params.u1_separate_colour_description_present_flag)
  ------------------
  |  Branch (789:12): [True: 1.92k, False: 142]
  ------------------
  790|  1.92k|        {
  791|  1.92k|            ps_sei->s_sei_fgc_params.u1_film_grain_bit_depth_luma_minus8 =
  792|  1.92k|                (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 3);
  793|       |
  794|  1.92k|            i4_luma_bitdepth = ps_sei->s_sei_fgc_params.u1_film_grain_bit_depth_luma_minus8 + 8;
  795|       |
  796|  1.92k|            ps_sei->s_sei_fgc_params.u1_film_grain_bit_depth_chroma_minus8 =
  797|  1.92k|                (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 3);
  798|       |
  799|  1.92k|            i4_chroma_bitdepth = ps_sei->s_sei_fgc_params.u1_film_grain_bit_depth_chroma_minus8 + 8;
  800|       |
  801|  1.92k|            ps_sei->s_sei_fgc_params.u1_film_grain_full_range_flag =
  802|  1.92k|                (UWORD8) ih264d_get_bit_h264(ps_bitstrm);
  803|       |
  804|  1.92k|            ps_sei->s_sei_fgc_params.u1_film_grain_colour_primaries =
  805|  1.92k|                (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 8);
  806|       |
  807|  1.92k|            ps_sei->s_sei_fgc_params.u1_film_grain_transfer_characteristics =
  808|  1.92k|                (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 8);
  809|       |
  810|  1.92k|            ps_sei->s_sei_fgc_params.u1_film_grain_matrix_coefficients =
  811|  1.92k|                (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 8);
  812|  1.92k|        }
  813|    142|        else
  814|    142|        {
  815|    142|            if(ps_dec->ps_cur_sps == NULL)
  ------------------
  |  Branch (815:16): [True: 73, False: 69]
  ------------------
  816|     73|            {
  817|     73|                return NOT_OK;
  ------------------
  |  |  116|     73|#define NOT_OK    -1
  ------------------
  818|     73|            }
  819|     69|            i4_luma_bitdepth = ps_dec->ps_cur_sps->i4_bit_depth_luma_minus8 + 8;
  820|     69|            i4_chroma_bitdepth = ps_dec->ps_cur_sps->i4_bit_depth_chroma_minus8 + 8;
  821|     69|        }
  822|  1.99k|        ps_sei->s_sei_fgc_params.u1_blending_mode_id = (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 2);
  823|       |
  824|  1.99k|        if(ps_sei->s_sei_fgc_params.u1_blending_mode_id > 1)
  ------------------
  |  Branch (824:12): [True: 111, False: 1.87k]
  ------------------
  825|    111|        {
  826|    111|            return ERROR_INV_SEI_FGC_PARAMS;
  827|    111|        }
  828|       |
  829|  1.87k|        ps_sei->s_sei_fgc_params.u1_log2_scale_factor =
  830|  1.87k|            (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 4);
  831|       |
  832|  7.51k|        for(c = 0; c < SEI_FGC_NUM_COLOUR_COMPONENTS; c++)
  ------------------
  |  |   63|  7.51k|#define SEI_FGC_NUM_COLOUR_COMPONENTS 3
  ------------------
  |  Branch (832:20): [True: 5.63k, False: 1.87k]
  ------------------
  833|  5.63k|        {
  834|  5.63k|            ps_sei->s_sei_fgc_params.au1_comp_model_present_flag[c] =
  835|  5.63k|                (UWORD8) ih264d_get_bit_h264(ps_bitstrm);
  836|  5.63k|        }
  837|       |
  838|  4.74k|        for(c = 0; c < SEI_FGC_NUM_COLOUR_COMPONENTS; c++)
  ------------------
  |  |   63|  4.74k|#define SEI_FGC_NUM_COLOUR_COMPONENTS 3
  ------------------
  |  Branch (838:20): [True: 4.11k, False: 628]
  ------------------
  839|  4.11k|        {
  840|  4.11k|            if(ps_sei->s_sei_fgc_params.au1_comp_model_present_flag[c])
  ------------------
  |  Branch (840:16): [True: 1.47k, False: 2.63k]
  ------------------
  841|  1.47k|            {
  842|  1.47k|                ps_sei->s_sei_fgc_params.au1_num_intensity_intervals_minus1[c] =
  843|  1.47k|                    (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 8);
  844|       |
  845|  1.47k|                ps_sei->s_sei_fgc_params.au1_num_model_values_minus1[c] =
  846|  1.47k|                    (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 3);
  847|       |
  848|  1.47k|                if(ps_sei->s_sei_fgc_params.au1_num_model_values_minus1[c] >
  ------------------
  |  Branch (848:20): [True: 75, False: 1.40k]
  ------------------
  849|  1.47k|                   (SEI_FGC_MAX_NUM_MODEL_VALUES - 1))
  ------------------
  |  |   64|  1.47k|#define SEI_FGC_MAX_NUM_MODEL_VALUES 6
  ------------------
  850|     75|                {
  851|     75|                    return ERROR_INV_SEI_FGC_PARAMS;
  852|     75|                }
  853|       |
  854|  6.85k|                for(i = 0; i <= ps_sei->s_sei_fgc_params.au1_num_intensity_intervals_minus1[c]; i++)
  ------------------
  |  Branch (854:28): [True: 6.63k, False: 224]
  ------------------
  855|  6.63k|                {
  856|       |                    /* Although the fag end of both the NALU and the bitstream buffer */
  857|       |                    /* is being parsed, not all FGC SEI symbols would have been */
  858|       |                    /* decoded semantically. The code below detects this condition */
  859|  6.63k|                    if((ps_bitstrm->u4_ofst + 8 + 8) >= ps_bitstrm->u4_max_ofst)
  ------------------
  |  Branch (859:24): [True: 142, False: 6.49k]
  ------------------
  860|    142|                    {
  861|    142|                        return ERROR_INV_SEI_FGC_PARAMS;
  862|    142|                    }
  863|       |
  864|  6.49k|                    ps_sei->s_sei_fgc_params.au1_intensity_interval_lower_bound[c][i] =
  865|  6.49k|                        (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 8);
  866|       |
  867|  6.49k|                    ps_sei->s_sei_fgc_params.au1_intensity_interval_upper_bound[c][i] =
  868|  6.49k|                        (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 8);
  869|       |
  870|  31.4k|                    for(j = 0; j <= ps_sei->s_sei_fgc_params.au1_num_model_values_minus1[c]; j++)
  ------------------
  |  Branch (870:32): [True: 26.0k, False: 5.45k]
  ------------------
  871|  26.0k|                    {
  872|  26.0k|                        ps_sei->s_sei_fgc_params.ai4_comp_model_value[c][i][j] =
  873|  26.0k|                            (WORD32) ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  874|  26.0k|                        if(0 == ps_sei->s_sei_fgc_params.u1_film_grain_model_id)
  ------------------
  |  Branch (874:28): [True: 6.52k, False: 19.5k]
  ------------------
  875|  6.52k|                        {
  876|  6.52k|                            if((1 == j) || (2 == j))
  ------------------
  |  Branch (876:32): [True: 1.33k, False: 5.18k]
  |  Branch (876:44): [True: 1.11k, False: 4.07k]
  ------------------
  877|  2.45k|                            {
  878|  2.45k|                                if((ps_sei->s_sei_fgc_params.ai4_comp_model_value[c][i][j] < 0) ||
  ------------------
  |  Branch (878:36): [True: 118, False: 2.33k]
  ------------------
  879|  2.33k|                                   (ps_sei->s_sei_fgc_params.ai4_comp_model_value[c][i][j] > 16))
  ------------------
  |  Branch (879:36): [True: 94, False: 2.24k]
  ------------------
  880|    212|                                    return ERROR_INV_SEI_FGC_PARAMS;
  881|  2.45k|                            }
  882|  4.07k|                            else if((3 == j) || (4 == j))
  ------------------
  |  Branch (882:37): [True: 927, False: 3.14k]
  |  Branch (882:49): [True: 565, False: 2.58k]
  ------------------
  883|  1.49k|                            {
  884|  1.49k|                                if((ps_sei->s_sei_fgc_params.ai4_comp_model_value[c][i][j] < 0) ||
  ------------------
  |  Branch (884:36): [True: 151, False: 1.34k]
  ------------------
  885|  1.34k|                                   (ps_sei->s_sei_fgc_params.ai4_comp_model_value[c][i][j] >
  ------------------
  |  Branch (885:36): [True: 131, False: 1.21k]
  ------------------
  886|  1.34k|                                    ps_sei->s_sei_fgc_params.ai4_comp_model_value[c][i][j - 2]))
  887|    282|                                    return ERROR_INV_SEI_FGC_PARAMS;
  888|  1.49k|                            }
  889|  2.58k|                            else
  890|  2.58k|                            {
  891|  2.58k|                                WORD32 max_lim = (c == 0) ? (1 << i4_luma_bitdepth) - 1
  ------------------
  |  Branch (891:50): [True: 805, False: 1.77k]
  ------------------
  892|  2.58k|                                                          : (1 << i4_chroma_bitdepth) - 1;
  893|       |
  894|  2.58k|                                if((ps_sei->s_sei_fgc_params.ai4_comp_model_value[c][i][j] < 0) ||
  ------------------
  |  Branch (894:36): [True: 222, False: 2.36k]
  ------------------
  895|  2.36k|                                   (ps_sei->s_sei_fgc_params.ai4_comp_model_value[c][i][j] >
  ------------------
  |  Branch (895:36): [True: 106, False: 2.25k]
  ------------------
  896|  2.36k|                                    max_lim))
  897|    328|                                {
  898|    328|                                    return ERROR_INV_SEI_FGC_PARAMS;
  899|    328|                                }
  900|  2.58k|                            }
  901|  6.52k|                        }
  902|  19.5k|                        else
  903|  19.5k|                        {
  904|  19.5k|                            WORD32 max_lim = (c == 0) ? (1 << (i4_luma_bitdepth - 1))
  ------------------
  |  Branch (904:46): [True: 4.28k, False: 15.2k]
  ------------------
  905|  19.5k|                                                      : (1 << (i4_chroma_bitdepth - 1));
  906|       |
  907|  19.5k|                            if((ps_sei->s_sei_fgc_params.ai4_comp_model_value[c][i][j] <
  ------------------
  |  Branch (907:32): [True: 79, False: 19.4k]
  ------------------
  908|  19.5k|                                -max_lim) ||
  909|  19.4k|                               (ps_sei->s_sei_fgc_params.ai4_comp_model_value[c][i][j] >= max_lim))
  ------------------
  |  Branch (909:32): [True: 133, False: 19.2k]
  ------------------
  910|    212|                            {
  911|    212|                                return ERROR_INV_SEI_FGC_PARAMS;
  912|    212|                            }
  913|  19.5k|                        }
  914|  26.0k|                    }
  915|  6.49k|                }
  916|  1.40k|            }
  917|  4.11k|        }
  918|       |
  919|    628|        ps_sei->s_sei_fgc_params.u4_film_grain_characteristics_repetition_period =
  920|    628|            (UWORD32) ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  921|       |
  922|    628|        if(ps_sei->s_sei_fgc_params.u4_film_grain_characteristics_repetition_period < 0 ||
  ------------------
  |  Branch (922:12): [True: 0, False: 628]
  ------------------
  923|    628|           ps_sei->s_sei_fgc_params.u4_film_grain_characteristics_repetition_period > 16384)
  ------------------
  |  Branch (923:12): [True: 113, False: 515]
  ------------------
  924|    113|        {
  925|    113|            return ERROR_INV_SEI_FGC_PARAMS;
  926|    113|        }
  927|       |
  928|    515|        ps_sei->u1_sei_fgc_params_present_flag = 1;
  929|    515|    }
  930|       |
  931|  1.16k|    return (OK);
  ------------------
  |  |  114|  1.16k|#define OK        0
  ------------------
  932|  2.78k|}
ih264d_parse_sei_payload:
  961|  92.1k|{
  962|  92.1k|    sei *ps_sei;
  963|  92.1k|    WORD32 i4_status = 0;
  964|  92.1k|    ps_sei = (sei *)ps_dec->ps_sei_parse;
  965|       |
  966|  92.1k|    if(ui4_payload_size == 0)
  ------------------
  |  Branch (966:8): [True: 390, False: 91.7k]
  ------------------
  967|    390|        return -1;
  968|  91.7k|    if(NULL == ps_bitstrm)
  ------------------
  |  Branch (968:8): [True: 0, False: 91.7k]
  ------------------
  969|      0|    {
  970|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  971|      0|    }
  972|       |
  973|  91.7k|    switch(ui4_payload_type)
  974|  91.7k|    {
  975|  1.07k|        case SEI_BUF_PERIOD:
  ------------------
  |  |   48|  1.07k|#define SEI_BUF_PERIOD      0
  ------------------
  |  Branch (975:9): [True: 1.07k, False: 90.6k]
  ------------------
  976|       |
  977|  1.07k|            i4_status = ih264d_parse_buffering_period(&ps_sei->s_buf_period,
  978|  1.07k|                                                      ps_bitstrm, ps_dec);
  979|  1.07k|            break;
  980|  1.01k|        case SEI_PIC_TIMING:
  ------------------
  |  |   49|  1.01k|#define SEI_PIC_TIMING      1
  ------------------
  |  Branch (980:9): [True: 1.01k, False: 90.7k]
  ------------------
  981|  1.01k|            if(NULL == ps_dec->ps_cur_sps)
  ------------------
  |  Branch (981:16): [True: 245, False: 771]
  ------------------
  982|    245|                i4_status = ih264d_flush_bits_h264(ps_bitstrm, (ui4_payload_size << 3));
  983|    771|            else
  984|    771|                i4_status = ih264d_parse_pic_timing(ps_bitstrm, ps_dec,
  985|    771|                                        ui4_payload_size);
  986|  1.01k|            break;
  987|  1.84k|        case SEI_RECOVERY_PT:
  ------------------
  |  |   54|  1.84k|#define SEI_RECOVERY_PT     6
  ------------------
  |  Branch (987:9): [True: 1.84k, False: 89.8k]
  ------------------
  988|  1.84k|            i4_status = ih264d_parse_recovery_point(ps_bitstrm, ps_dec,
  989|  1.84k|                                        ui4_payload_size);
  990|  1.84k|            break;
  991|  1.64k|        case SEI_MASTERING_DISP_COL_VOL:
  ------------------
  |  |   68|  1.64k|#define SEI_MASTERING_DISP_COL_VOL       137
  ------------------
  |  Branch (991:9): [True: 1.64k, False: 90.1k]
  ------------------
  992|       |
  993|  1.64k|            i4_status = ih264d_parse_mdcv(ps_bitstrm, ps_dec,
  994|  1.64k|                                          ui4_payload_size);
  995|  1.64k|            break;
  996|    538|        case SEI_CONTENT_LIGHT_LEVEL_DATA:
  ------------------
  |  |   69|    538|#define SEI_CONTENT_LIGHT_LEVEL_DATA     144
  ------------------
  |  Branch (996:9): [True: 538, False: 91.2k]
  ------------------
  997|       |
  998|    538|            i4_status = ih264d_parse_cll(ps_bitstrm, ps_dec,
  999|    538|                                         ui4_payload_size);
 1000|    538|            break;
 1001|    511|        case SEI_AMBIENT_VIEWING_ENVIRONMENT:
  ------------------
  |  |   70|    511|#define SEI_AMBIENT_VIEWING_ENVIRONMENT  148
  ------------------
  |  Branch (1001:9): [True: 511, False: 91.2k]
  ------------------
 1002|       |
 1003|    511|            i4_status = ih264d_parse_ave(ps_bitstrm, ps_dec,
 1004|    511|                                         ui4_payload_size);
 1005|    511|            break;
 1006|  27.3k|        case SEI_CONTENT_COLOR_VOLUME:
  ------------------
  |  |   71|  27.3k|#define SEI_CONTENT_COLOR_VOLUME         149
  ------------------
  |  Branch (1006:9): [True: 27.3k, False: 64.4k]
  ------------------
 1007|       |
 1008|  27.3k|            i4_status = ih264d_parse_ccv(ps_bitstrm, ps_dec,
 1009|  27.3k|                                         ui4_payload_size);
 1010|  27.3k|            break;
 1011|  2.22k|        case SEI_SHUTTER_INTERVAL_INFO:
  ------------------
  |  |   72|  2.22k|#define SEI_SHUTTER_INTERVAL_INFO        205
  ------------------
  |  Branch (1011:9): [True: 2.22k, False: 89.5k]
  ------------------
 1012|       |
 1013|  2.22k|            i4_status = ih264d_parse_sii(ps_bitstrm, ps_dec, ui4_payload_size);
 1014|  2.22k|            break;
 1015|       |
 1016|  2.78k|        case SEI_FILM_GRAIN_CHARACTERISTICS:
  ------------------
  |  |   67|  2.78k|#define SEI_FILM_GRAIN_CHARACTERISTICS 19
  ------------------
  |  Branch (1016:9): [True: 2.78k, False: 88.9k]
  ------------------
 1017|  2.78k|            i4_status = ih264d_parse_fgc(ps_bitstrm, ps_dec, ui4_payload_size);
 1018|       |
 1019|  2.78k|            break;
 1020|  52.7k|        default:
  ------------------
  |  Branch (1020:9): [True: 52.7k, False: 38.9k]
  ------------------
 1021|  52.7k|            i4_status = ih264d_flush_bits_h264(ps_bitstrm, (ui4_payload_size << 3));
 1022|  52.7k|            break;
 1023|  91.7k|    }
 1024|  91.7k|    return (i4_status);
 1025|  91.7k|}
ih264d_parse_sei_message:
 1051|  8.85k|{
 1052|  8.85k|    UWORD32 ui4_payload_type, ui4_payload_size;
 1053|  8.85k|    UWORD32 u4_bits;
 1054|  8.85k|    WORD32 i4_status = 0;
 1055|       |
 1056|  8.85k|    do
 1057|  93.6k|    {
 1058|  93.6k|        ui4_payload_type = 0;
 1059|       |
 1060|  93.6k|        if(!CHECK_BITS_SUFFICIENT(ps_bitstrm, 8))
  ------------------
  |  |   95|  93.6k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  ------------------
  |  Branch (1060:12): [True: 303, False: 93.3k]
  ------------------
 1061|    303|        {
 1062|    303|            return ERROR_EOB_GETBITS_T;
 1063|    303|        }
 1064|  93.3k|        u4_bits = ih264d_get_bits_h264(ps_bitstrm, 8);
 1065|   110k|        while(0xff == u4_bits && CHECK_BITS_SUFFICIENT(ps_bitstrm, 8))
  ------------------
  |  |   95|  17.5k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (95:3): [True: 17.5k, False: 34]
  |  |  ------------------
  ------------------
  |  Branch (1065:15): [True: 17.5k, False: 93.3k]
  ------------------
 1066|  17.5k|        {
 1067|  17.5k|            u4_bits = ih264d_get_bits_h264(ps_bitstrm, 8);
 1068|  17.5k|            ui4_payload_type += 255;
 1069|  17.5k|        }
 1070|  93.3k|        ui4_payload_type += u4_bits;
 1071|       |
 1072|  93.3k|        ui4_payload_size = 0;
 1073|  93.3k|        if(!CHECK_BITS_SUFFICIENT(ps_bitstrm, 8))
  ------------------
  |  |   95|  93.3k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  ------------------
  |  Branch (1073:12): [True: 257, False: 93.1k]
  ------------------
 1074|    257|        {
 1075|    257|            return ERROR_EOB_GETBITS_T;
 1076|    257|        }
 1077|  93.1k|        u4_bits = ih264d_get_bits_h264(ps_bitstrm, 8);
 1078|  93.8k|        while(0xff == u4_bits && CHECK_BITS_SUFFICIENT(ps_bitstrm, 8))
  ------------------
  |  |   95|    729|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (95:3): [True: 701, False: 28]
  |  |  ------------------
  ------------------
  |  Branch (1078:15): [True: 729, False: 93.1k]
  ------------------
 1079|    701|        {
 1080|    701|            u4_bits = ih264d_get_bits_h264(ps_bitstrm, 8);
 1081|    701|            ui4_payload_size += 255;
 1082|    701|        }
 1083|  93.1k|        ui4_payload_size += u4_bits;
 1084|       |
 1085|  93.1k|        if(!CHECK_BITS_SUFFICIENT(ps_bitstrm, (ui4_payload_size << 3)))
  ------------------
  |  |   95|  93.1k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  ------------------
  |  Branch (1085:12): [True: 999, False: 92.1k]
  ------------------
 1086|    999|        {
 1087|    999|            return ERROR_EOB_GETBITS_T;
 1088|    999|        }
 1089|  92.1k|        i4_status = ih264d_parse_sei_payload(ps_bitstrm, ui4_payload_type,
 1090|  92.1k|                                             ui4_payload_size, ps_dec);
 1091|  92.1k|        if(i4_status != OK)
  ------------------
  |  |  114|  92.1k|#define OK        0
  ------------------
  |  Branch (1091:12): [True: 5.35k, False: 86.7k]
  ------------------
 1092|  5.35k|            return i4_status;
 1093|       |
 1094|  86.7k|        if(ih264d_check_byte_aligned(ps_bitstrm) == 0)
  ------------------
  |  Branch (1094:12): [True: 30.2k, False: 56.5k]
  ------------------
 1095|  30.2k|        {
 1096|  30.2k|            u4_bits = ih264d_get_bit_h264(ps_bitstrm);
 1097|  30.2k|            if(0 == u4_bits)
  ------------------
  |  Branch (1097:16): [True: 27.7k, False: 2.43k]
  ------------------
 1098|  27.7k|            {
 1099|  27.7k|                H264_DEC_DEBUG_PRINT("\nError in parsing SEI message");
  ------------------
  |  |   39|  27.7k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 1100|  27.7k|            }
 1101|   191k|            while(0 == ih264d_check_byte_aligned(ps_bitstrm)
  ------------------
  |  Branch (1101:19): [True: 161k, False: 29.5k]
  ------------------
 1102|   161k|                            && CHECK_BITS_SUFFICIENT(ps_bitstrm, 1))
  ------------------
  |  |   95|   161k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (95:3): [True: 160k, False: 638]
  |  |  ------------------
  ------------------
 1103|   160k|            {
 1104|   160k|                u4_bits = ih264d_get_bit_h264(ps_bitstrm);
 1105|   160k|                if(u4_bits)
  ------------------
  |  Branch (1105:20): [True: 81.4k, False: 79.4k]
  ------------------
 1106|  81.4k|                {
 1107|  81.4k|                    H264_DEC_DEBUG_PRINT("\nError in parsing SEI message");
  ------------------
  |  |   39|  81.4k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 1108|  81.4k|                }
 1109|   160k|            }
 1110|  30.2k|        }
 1111|  86.7k|    }
 1112|  8.85k|    while(MORE_RBSP_DATA(ps_bitstrm));
  ------------------
  |  |   97|  86.7k|    CHECK_BITS_SUFFICIENT(ps_bitstrm, 1)
  |  |  ------------------
  |  |  |  |   95|  86.7k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (95:3): [True: 84.8k, False: 1.93k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1113|  1.93k|    return (i4_status);
 1114|  8.85k|}
ih264d_export_sei_mdcv_params:
 1137|   198k|{
 1138|   198k|    if((ps_sei_export == NULL) || (ps_sei == NULL))
  ------------------
  |  Branch (1138:8): [True: 0, False: 198k]
  |  Branch (1138:35): [True: 108k, False: 90.7k]
  ------------------
 1139|   108k|    {
 1140|   108k|        return NOT_OK;
  ------------------
  |  |  116|   108k|#define NOT_OK    -1
  ------------------
 1141|   108k|    }
 1142|       |
 1143|  90.7k|    ps_sei_export->u1_sei_mdcv_params_present_flag = ps_sei->u1_sei_mdcv_params_present_flag;
 1144|  90.7k|    ps_sei_decode_op->u1_sei_mdcv_params_present_flag = ps_sei->u1_sei_mdcv_params_present_flag;
 1145|       |
 1146|  90.7k|    if(0 == ps_sei_export->u1_sei_mdcv_params_present_flag)
  ------------------
  |  Branch (1146:8): [True: 90.6k, False: 34]
  ------------------
 1147|  90.6k|    {
 1148|  90.6k|        memset(&ps_sei_export->s_sei_mdcv_params, 0, sizeof(sei_mdcv_params_t));
 1149|  90.6k|    }
 1150|     34|    else
 1151|     34|    {
 1152|     34|        memcpy(&ps_sei_export->s_sei_mdcv_params, &ps_sei->s_sei_mdcv_params,
 1153|     34|                                                    sizeof(sei_mdcv_params_t));
 1154|     34|    }
 1155|       |
 1156|  90.7k|    return (OK);
  ------------------
  |  |  114|  90.7k|#define OK        0
  ------------------
 1157|   198k|}
ih264d_export_sei_cll_params:
 1180|   198k|{
 1181|   198k|    if((ps_sei_export == NULL) || (ps_sei == NULL))
  ------------------
  |  Branch (1181:8): [True: 0, False: 198k]
  |  Branch (1181:35): [True: 108k, False: 90.7k]
  ------------------
 1182|   108k|    {
 1183|   108k|        return NOT_OK;
  ------------------
  |  |  116|   108k|#define NOT_OK    -1
  ------------------
 1184|   108k|    }
 1185|       |
 1186|  90.7k|    ps_sei_export->u1_sei_cll_params_present_flag = ps_sei->u1_sei_cll_params_present_flag;
 1187|  90.7k|    ps_sei_decode_op->u1_sei_cll_params_present_flag = ps_sei->u1_sei_cll_params_present_flag;
 1188|       |
 1189|  90.7k|    if(0 == ps_sei_export->u1_sei_cll_params_present_flag)
  ------------------
  |  Branch (1189:8): [True: 90.6k, False: 69]
  ------------------
 1190|  90.6k|    {
 1191|  90.6k|        memset(&ps_sei_export->s_sei_cll_params, 0, sizeof(sei_cll_params_t));
 1192|  90.6k|    }
 1193|     69|    else
 1194|     69|    {
 1195|     69|        memcpy(&ps_sei_export->s_sei_cll_params, &ps_sei->s_sei_cll_params,
 1196|     69|                                                    sizeof(sei_cll_params_t));
 1197|     69|    }
 1198|  90.7k|    return (OK);
  ------------------
  |  |  114|  90.7k|#define OK        0
  ------------------
 1199|   198k|}
ih264d_export_sei_ave_params:
 1222|   198k|{
 1223|   198k|    if((ps_sei_export == NULL) || (ps_sei == NULL))
  ------------------
  |  Branch (1223:8): [True: 0, False: 198k]
  |  Branch (1223:35): [True: 108k, False: 90.7k]
  ------------------
 1224|   108k|    {
 1225|   108k|        return NOT_OK;
  ------------------
  |  |  116|   108k|#define NOT_OK    -1
  ------------------
 1226|   108k|    }
 1227|       |
 1228|  90.7k|    ps_sei_export->u1_sei_ave_params_present_flag = ps_sei->u1_sei_ave_params_present_flag;
 1229|  90.7k|    ps_sei_decode_op->u1_sei_ave_params_present_flag = ps_sei->u1_sei_ave_params_present_flag;
 1230|       |
 1231|  90.7k|    if(0 == ps_sei_export->u1_sei_ave_params_present_flag)
  ------------------
  |  Branch (1231:8): [True: 90.6k, False: 93]
  ------------------
 1232|  90.6k|    {
 1233|  90.6k|        memset(&ps_sei_export->s_sei_ave_params, 0, sizeof(sei_ave_params_t));
 1234|  90.6k|    }
 1235|     93|    else
 1236|     93|    {
 1237|     93|        memcpy(&ps_sei_export->s_sei_ave_params, &ps_sei->s_sei_ave_params,
 1238|     93|                                                    sizeof(sei_ave_params_t));
 1239|     93|    }
 1240|       |
 1241|  90.7k|    return (OK);
  ------------------
  |  |  114|  90.7k|#define OK        0
  ------------------
 1242|   198k|}
ih264d_export_sei_ccv_params:
 1265|   198k|{
 1266|   198k|    if((ps_sei_export == NULL) || (ps_sei == NULL))
  ------------------
  |  Branch (1266:8): [True: 0, False: 198k]
  |  Branch (1266:35): [True: 108k, False: 90.7k]
  ------------------
 1267|   108k|    {
 1268|   108k|        return NOT_OK;
  ------------------
  |  |  116|   108k|#define NOT_OK    -1
  ------------------
 1269|   108k|    }
 1270|       |
 1271|  90.7k|    ps_sei_export->u1_sei_ccv_params_present_flag = ps_sei->u1_sei_ccv_params_present_flag;
 1272|  90.7k|    ps_sei_decode_op->u1_sei_ccv_params_present_flag = ps_sei->u1_sei_ccv_params_present_flag;
 1273|       |
 1274|  90.7k|    if(0 == ps_sei_export->u1_sei_ccv_params_present_flag)
  ------------------
  |  Branch (1274:8): [True: 90.4k, False: 265]
  ------------------
 1275|  90.4k|    {
 1276|  90.4k|        memset(&ps_sei_export->s_sei_ccv_params, 0, sizeof(sei_ccv_params_t));
 1277|  90.4k|    }
 1278|    265|    else
 1279|    265|    {
 1280|    265|        memcpy(&ps_sei_export->s_sei_ccv_params, &ps_sei->s_sei_ccv_params,
 1281|    265|                                                    sizeof(sei_ccv_params_t));
 1282|    265|    }
 1283|  90.7k|    return (OK);
  ------------------
  |  |  114|  90.7k|#define OK        0
  ------------------
 1284|   198k|}
ih264d_export_sei_sii_params:
 1307|   198k|{
 1308|   198k|    if((ps_sei_export == NULL) || (ps_sei == NULL))
  ------------------
  |  Branch (1308:8): [True: 0, False: 198k]
  |  Branch (1308:35): [True: 108k, False: 90.7k]
  ------------------
 1309|   108k|    {
 1310|   108k|        return NOT_OK;
  ------------------
  |  |  116|   108k|#define NOT_OK    -1
  ------------------
 1311|   108k|    }
 1312|       |
 1313|  90.7k|    ps_sei_export->u1_sei_sii_params_present_flag = ps_sei->u1_sei_sii_params_present_flag;
 1314|  90.7k|    ps_sei_decode_op->u1_sei_sii_params_present_flag = ps_sei->u1_sei_sii_params_present_flag;
 1315|       |
 1316|  90.7k|    if(0 == ps_sei_export->u1_sei_sii_params_present_flag)
  ------------------
  |  Branch (1316:8): [True: 90.6k, False: 78]
  ------------------
 1317|  90.6k|    {
 1318|  90.6k|        memset(&ps_sei_export->s_sei_sii_params, 0, sizeof(sei_sii_params_t));
 1319|  90.6k|    }
 1320|     78|    else
 1321|     78|    {
 1322|     78|        memcpy(&ps_sei_export->s_sei_sii_params, &ps_sei->s_sei_sii_params,
 1323|     78|               sizeof(sei_sii_params_t));
 1324|     78|    }
 1325|  90.7k|    return (OK);
  ------------------
  |  |  114|  90.7k|#define OK        0
  ------------------
 1326|   198k|}
ih264d_export_sei_fgc_params:
 1349|   198k|{
 1350|   198k|    if((ps_sei_export == NULL) || (ps_sei == NULL))
  ------------------
  |  Branch (1350:8): [True: 0, False: 198k]
  |  Branch (1350:35): [True: 108k, False: 90.7k]
  ------------------
 1351|   108k|    {
 1352|   108k|        return NOT_OK;
  ------------------
  |  |  116|   108k|#define NOT_OK    -1
  ------------------
 1353|   108k|    }
 1354|       |
 1355|  90.7k|    ps_sei_export->u1_sei_fgc_params_present_flag = ps_sei->u1_sei_fgc_params_present_flag;
 1356|  90.7k|    ps_sei_decode_op->u1_sei_fgc_params_present_flag = ps_sei->u1_sei_fgc_params_present_flag;
 1357|       |
 1358|  90.7k|    if(0 == ps_sei_export->u1_sei_fgc_params_present_flag)
  ------------------
  |  Branch (1358:8): [True: 89.8k, False: 863]
  ------------------
 1359|  89.8k|    {
 1360|  89.8k|        memset(&ps_sei_export->s_sei_fgc_params, 0, sizeof(sei_fgc_params_t));
 1361|  89.8k|    }
 1362|    863|    else
 1363|    863|    {
 1364|    863|        memcpy(&ps_sei_export->s_sei_fgc_params, &ps_sei->s_sei_fgc_params,
 1365|    863|               sizeof(sei_fgc_params_t));
 1366|    863|    }
 1367|       |
 1368|  90.7k|    return (OK);
  ------------------
  |  |  114|  90.7k|#define OK        0
  ------------------
 1369|   198k|}

ih264d_check_mb_map_deblk:
  322|   150M|{
  323|   150M|    UWORD32 i = 0;
  324|   150M|    UWORD32 u4_mb_num;
  325|   150M|    UWORD32 u4_cond;
  326|   150M|    volatile UWORD8 *mb_map = ps_dec->pu1_recon_mb_map;
  327|   150M|    const WORD32 i4_cb_qp_idx_ofst =
  328|   150M|                    ps_dec->ps_cur_pps->i1_chroma_qp_index_offset;
  329|   150M|    const WORD32 i4_cr_qp_idx_ofst =
  330|   150M|                    ps_dec->ps_cur_pps->i1_second_chroma_qp_index_offset;
  331|       |
  332|   150M|    UWORD32 u4_wd_y, u4_wd_uv;
  333|   150M|    UWORD8 u1_field_pic_flag = ps_dec->ps_cur_slice->u1_field_pic_flag;
  334|       |
  335|       |
  336|   150M|    u4_wd_y = ps_dec->u2_frm_wd_y << u1_field_pic_flag;
  337|   150M|    u4_wd_uv = ps_dec->u2_frm_wd_uv << u1_field_pic_flag;
  338|       |
  339|       |
  340|   151M|    for(i = 0; i < deblk_mb_grp; i++)
  ------------------
  |  Branch (340:16): [True: 1.02M, False: 150M]
  ------------------
  341|  1.02M|    {
  342|  1.02M|        WORD32 nop_cnt = 8*128;
  343|  1.02M|        while(u4_check_mb_map == 1)
  ------------------
  |  Branch (343:15): [True: 0, False: 1.02M]
  ------------------
  344|      0|        {
  345|      0|            u4_mb_num = ps_dec->u4_cur_deblk_mb_num;
  346|       |            /*we wait for the right mb because of intra pred data dependency*/
  347|      0|            u4_mb_num = MIN(u4_mb_num + 1, (ps_dec->u4_deblk_mb_y + 1) * ps_dec->u2_frm_wd_in_mbs - 1);
  ------------------
  |  |   61|      0|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  348|      0|            CHECK_MB_MAP_BYTE(u4_mb_num, mb_map, u4_cond);
  ------------------
  |  |   80|      0|#define CHECK_MB_MAP_BYTE(u4_mb_num, mb_map, u4_cond)                                               \
  |  |   81|      0|{                                                                                                   \
  |  |   82|      0|        volatile UWORD8 *pu1_mb_flag;                                                               \
  |  |   83|      0|                                                                                                    \
  |  |   84|      0|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_num );                                           \
  |  |   85|      0|                                                                                                    \
  |  |   86|      0|        u4_cond = (*pu1_mb_flag);                                                                   \
  |  |   87|      0|}
  ------------------
  349|       |
  350|      0|            if(u4_cond)
  ------------------
  |  Branch (350:16): [True: 0, False: 0]
  ------------------
  351|      0|            {
  352|      0|                break;
  353|      0|            }
  354|      0|            else
  355|      0|            {
  356|      0|                if(nop_cnt > 0)
  ------------------
  |  Branch (356:20): [True: 0, False: 0]
  ------------------
  357|      0|                {
  358|      0|                    nop_cnt -= 128;
  359|      0|                    NOP(128);
  ------------------
  |  |   87|      0|#define NOP(nop_cnt) {UWORD32 nop_i; for (nop_i = 0; nop_i < nop_cnt; nop_i++) asm("nop");}
  |  |  ------------------
  |  |  |  Branch (87:54): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  360|      0|                }
  361|      0|                else
  362|      0|                {
  363|      0|                    nop_cnt = 8*128;
  364|      0|                    ithread_yield();
  365|      0|                }
  366|      0|            }
  367|      0|        }
  368|       |
  369|  1.02M|        ih264d_deblock_mb_nonmbaff(ps_dec, ps_tfr_cxt,
  370|  1.02M|                                   i4_cb_qp_idx_ofst, i4_cr_qp_idx_ofst,
  371|  1.02M|                                    u4_wd_y, u4_wd_uv);
  372|       |
  373|       |
  374|  1.02M|    }
  375|       |
  376|       |
  377|   150M|}

ih264d_parse_tfr_nmb:
   68|  1.15M|{
   69|  1.15M|    WORD32 i, u4_mb_num;
   70|       |
   71|  1.15M|    const UWORD32 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
   72|  1.15M|    UWORD32 u4_n_mb_start;
   73|       |
   74|  1.15M|    UNUSED(u4_mb_idx);
  ------------------
  |  |   45|  1.15M|#define UNUSED(x) ((void)(x))
  ------------------
   75|  1.15M|    UNUSED(u4_num_mbs_next);
  ------------------
  |  |   45|  1.15M|#define UNUSED(x) ((void)(x))
  ------------------
   76|  1.15M|    if(u4_tfr_n_mb)
  ------------------
  |  Branch (76:8): [True: 1.15M, False: 0]
  ------------------
   77|  1.15M|    {
   78|       |
   79|       |
   80|  1.15M|        u4_n_mb_start = (ps_dec->u4_cur_mb_addr + 1) - u4_num_mbs;
   81|       |
   82|       |        // copy into s_frmMbInfo
   83|       |
   84|  1.15M|        u4_mb_num = u4_n_mb_start;
   85|  1.15M|        u4_mb_num = (ps_dec->u4_cur_mb_addr + 1) - u4_num_mbs;
   86|       |
   87|  9.04M|        for(i = 0; i < u4_num_mbs; i++)
  ------------------
  |  Branch (87:20): [True: 7.88M, False: 1.15M]
  ------------------
   88|  7.88M|        {
   89|  7.88M|            UPDATE_SLICE_NUM_MAP(ps_dec->pu2_slice_num_map, u4_mb_num,
  ------------------
  |  |  148|  7.88M|#define UPDATE_SLICE_NUM_MAP(slice_map, u4_mb_number,u2_slice_num)                                                  \
  |  |  149|  7.88M|{                                                                                                   \
  |  |  150|  7.88M|        volatile UWORD16 *pu2_slice_map;                                                               \
  |  |  151|  7.88M|                                                                                                    \
  |  |  152|  7.88M|        pu2_slice_map    = (UWORD16 *)slice_map + (u4_mb_number);                                         \
  |  |  153|  7.88M|        (*pu2_slice_map) = u2_slice_num;                                                              \
  |  |  154|  7.88M|}
  ------------------
   90|  7.88M|                                 ps_dec->u2_cur_slice_num);
   91|  7.88M|            DATA_SYNC();
  ------------------
  |  |  116|  7.88M|#define DATA_SYNC()  __sync_synchronize()
  ------------------
   92|  7.88M|            UPDATE_MB_MAP_MBNUM_BYTE(ps_dec->pu1_dec_mb_map, u4_mb_num);
  ------------------
  |  |  136|  7.88M|#define UPDATE_MB_MAP_MBNUM_BYTE(mb_map, u4_mb_number)                                                  \
  |  |  137|  7.88M|{                                                                                                   \
  |  |  138|  7.88M|        volatile UWORD8 *pu1_mb_flag;                                                                       \
  |  |  139|  7.88M|                                                                                                    \
  |  |  140|  7.88M|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_number);                                                     \
  |  |  141|  7.88M|        /*                                                                                          \
  |  |  142|  7.88M|         * In case of MbAff, update the mb_map only if the entire MB is done. We can check that     \
  |  |  143|  7.88M|         * by checking if Y is odd, implying that this is the second row in the MbAff MB            \
  |  |  144|  7.88M|         */                                                                                         \
  |  |  145|  7.88M|        (*pu1_mb_flag) = 1;                                                             \
  |  |  146|  7.88M|}
  ------------------
   93|       |
   94|  7.88M|            u4_mb_num++;
   95|  7.88M|        }
   96|       |
   97|       |        /****************************************************************/
   98|       |        /* Check for End Of Row in Next iteration                       */
   99|       |        /****************************************************************/
  100|       |
  101|       |        /****************************************************************/
  102|       |        /* Transfer the Following things                                */
  103|       |        /* N-Mb DeblkParams Data    ( To Ext DeblkParams Buffer )       */
  104|       |        /* N-Mb Recon Data          ( To Ext Frame Buffer )             */
  105|       |        /* N-Mb Intrapredline Data  ( Updated Internally)               */
  106|       |        /* N-Mb MV Data             ( To Ext MV Buffer )                */
  107|       |        /* N-Mb MVTop/TopRight Data ( To Int MV Top Scratch Buffers)    */
  108|       |        /****************************************************************/
  109|       |
  110|       |        /* Swap top and current pointers */
  111|       |
  112|  1.15M|        ps_dec->s_tran_addrecon_parse.pu1_dest_y +=
  113|  1.15M|                        ps_dec->s_tran_addrecon_parse.u4_inc_y[u4_end_of_row];
  114|  1.15M|        ps_dec->s_tran_addrecon_parse.pu1_dest_u +=
  115|  1.15M|                        ps_dec->s_tran_addrecon_parse.u4_inc_uv[u4_end_of_row];
  116|  1.15M|        ps_dec->s_tran_addrecon_parse.pu1_dest_v +=
  117|  1.15M|                        ps_dec->s_tran_addrecon_parse.u4_inc_uv[u4_end_of_row];
  118|       |
  119|  1.15M|        if(u4_end_of_row)
  ------------------
  |  Branch (119:12): [True: 1.14M, False: 12.3k]
  ------------------
  120|  1.14M|        {
  121|  1.14M|            UWORD16 u2_mb_y;
  122|  1.14M|            UWORD32 u4_frame_stride, y_offset;
  123|       |
  124|  1.14M|            ps_dec->ps_top_mb_row = ps_dec->ps_cur_mb_row;
  125|  1.14M|            ps_dec->ps_cur_mb_row += ((ps_dec->u2_frm_wd_in_mbs) << u1_mbaff);
  126|       |
  127|  1.14M|            u2_mb_y = ps_dec->u2_mby + (1 + u1_mbaff);
  128|  1.14M|            u4_frame_stride = ps_dec->u2_frm_wd_y
  129|  1.14M|                            << ps_dec->ps_cur_slice->u1_field_pic_flag;
  130|  1.14M|            y_offset = (u2_mb_y * u4_frame_stride) << 4;
  131|  1.14M|            ps_dec->s_tran_addrecon_parse.pu1_dest_y =
  132|  1.14M|                            ps_dec->s_cur_pic.pu1_buf1 + y_offset;
  133|       |
  134|  1.14M|            u4_frame_stride = ps_dec->u2_frm_wd_uv
  135|  1.14M|                            << ps_dec->ps_cur_slice->u1_field_pic_flag;
  136|  1.14M|            y_offset = (u2_mb_y * u4_frame_stride) << 3;
  137|  1.14M|            ps_dec->s_tran_addrecon_parse.pu1_dest_u =
  138|  1.14M|                            ps_dec->s_cur_pic.pu1_buf2 + y_offset;
  139|  1.14M|            ps_dec->s_tran_addrecon_parse.pu1_dest_v =
  140|  1.14M|                            ps_dec->s_cur_pic.pu1_buf3 + y_offset;
  141|       |
  142|  1.14M|        }
  143|       |
  144|  1.15M|        ps_dec->ps_deblk_mbn += u4_num_mbs;
  145|       |
  146|       |        /*
  147|       |         * The Slice boundary is also a valid condition to transfer. So recalculate
  148|       |         * the Left increment, in case the number of MBs is lesser than the
  149|       |         * N MB value. c_numMbs will be equal to N of N MB if the entire N Mb is
  150|       |         * decoded.
  151|       |         */
  152|  1.15M|        ps_dec->s_tran_addrecon.u2_mv_left_inc = ((u4_num_mbs >> u1_mbaff) - 1)
  153|  1.15M|                        << (4 + u1_mbaff);
  154|  1.15M|        ps_dec->s_tran_addrecon.u2_mv_top_left_inc = (u4_num_mbs << 2) - 1
  155|  1.15M|                        - (u1_mbaff << 2);
  156|       |
  157|       |        /* reassign left MV and cur MV pointers */
  158|  1.15M|        ps_dec->ps_mv_left = ps_dec->ps_mv_cur
  159|  1.15M|                        + ps_dec->s_tran_addrecon.u2_mv_left_inc;
  160|       |
  161|  1.15M|        ps_dec->ps_mv_cur += (u4_num_mbs << 4);
  162|  1.15M|        ps_dec->u4_num_mbs_prev_nmb = u4_num_mbs;
  163|       |
  164|  1.15M|    }
  165|  1.15M|}
ih264d_decode_tfr_nmb:
  171|  1.14M|{
  172|       |
  173|  1.14M|    UWORD32 u1_end_of_row_next;
  174|       |
  175|  1.14M|    const UWORD32 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  176|       |
  177|       |    /****************************************************************/
  178|       |    /* Check for End Of Row in Next iteration                       */
  179|       |    /****************************************************************/
  180|  1.14M|    u1_end_of_row_next = u4_num_mbs_next &&
  ------------------
  |  Branch (180:26): [True: 15.4k, False: 1.13M]
  ------------------
  181|  15.4k|                        ((u4_num_mbs_next) <= (ps_dec->u4_recon_mb_grp >> u1_mbaff));
  ------------------
  |  Branch (181:25): [True: 15.4k, False: 0]
  ------------------
  182|       |
  183|       |    /****************************************************************/
  184|       |    /* Transfer the Following things                                */
  185|       |    /* N-Mb DeblkParams Data    ( To Ext DeblkParams Buffer )       */
  186|       |    /* N-Mb Recon Data          ( To Ext Frame Buffer )             */
  187|       |    /* N-Mb Intrapredline Data  ( Updated Internally)               */
  188|       |    /* N-Mb MV Data             ( To Ext MV Buffer )                */
  189|       |    /* N-Mb MVTop/TopRight Data ( To Int MV Top Scratch Buffers)    */
  190|       |    /****************************************************************/
  191|  1.14M|    if(u4_end_of_row)
  ------------------
  |  Branch (191:8): [True: 1.13M, False: 15.4k]
  ------------------
  192|  1.13M|    {
  193|  1.13M|        ps_dec->i2_dec_thread_mb_y += (1 << u1_mbaff);
  194|  1.13M|    }
  195|  1.14M|    ih264d_transfer_mb_group_data(ps_dec, u4_num_mbs, u4_end_of_row,
  196|  1.14M|                                  u1_end_of_row_next);
  197|       |
  198|  1.14M|}
ih264d_decode_recon_tfr_nmb_thread:
  204|   958k|{
  205|   958k|    WORD32 i,j;
  206|   958k|    dec_mb_info_t * ps_cur_mb_info;
  207|   958k|    UWORD32 u4_update_mbaff = 0;
  208|   958k|    const UWORD32 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  209|   958k|    UWORD32 u1_slice_type, u1_B;
  210|   958k|    WORD32 u1_skip_th;
  211|   958k|    UWORD32 u1_ipcm_th;
  212|   958k|    UWORD32 u4_cond;
  213|   958k|    UWORD16 u2_slice_num,u2_cur_dec_mb_num;
  214|   958k|    WORD32 ret;
  215|   958k|    UWORD32 u4_mb_num;
  216|   958k|    WORD32 nop_cnt = 8*128;
  217|   958k|    u1_slice_type = ps_dec->ps_decode_cur_slice->slice_type;
  218|       |
  219|   958k|    u1_B = (u1_slice_type == B_SLICE);
  ------------------
  |  |  369|   958k|#define B_SLICE  1
  ------------------
  220|       |
  221|   958k|    u1_skip_th = ((u1_slice_type != I_SLICE) ?
  ------------------
  |  |  370|   958k|#define I_SLICE  2
  ------------------
  |  Branch (221:19): [True: 950k, False: 7.80k]
  ------------------
  222|   950k|                                    (u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  480|  46.2k|#define B_8x8    22
  ------------------
                                                  (u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  454|   904k|#define PRED_8x8R0  4
  ------------------
  |  Branch (222:38): [True: 46.2k, False: 904k]
  ------------------
  223|       |
  224|   958k|    u1_ipcm_th = ((u1_slice_type != I_SLICE) ? (u1_B ? 23 : 5) : 0);
  ------------------
  |  |  370|   958k|#define I_SLICE  2
  ------------------
  |  Branch (224:19): [True: 950k, False: 7.80k]
  |  Branch (224:49): [True: 46.2k, False: 904k]
  ------------------
  225|       |
  226|   958k|    u2_cur_dec_mb_num = ps_dec->cur_dec_mb_num;
  227|       |
  228|  4.67M|    while(1)
  ------------------
  |  Branch (228:11): [True: 4.67M, Folded]
  ------------------
  229|  4.67M|    {
  230|       |
  231|  4.67M|        UWORD32 u4_max_mb = (UWORD32)(ps_dec->i2_dec_thread_mb_y + (1 << u1_mbaff)) * ps_dec->u2_frm_wd_in_mbs - 1;
  232|  4.67M|        u4_mb_num = u2_cur_dec_mb_num;
  233|       |        /*introducing 1 MB delay*/
  234|  4.67M|        u4_mb_num = MIN(u4_mb_num + u4_num_mbs + 1, u4_max_mb);
  ------------------
  |  |   61|  4.67M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 0, False: 4.67M]
  |  |  ------------------
  ------------------
  235|       |
  236|  4.67M|        CHECK_MB_MAP_BYTE(u4_mb_num, ps_dec->pu1_dec_mb_map, u4_cond);
  ------------------
  |  |   80|  4.67M|#define CHECK_MB_MAP_BYTE(u4_mb_num, mb_map, u4_cond)                                               \
  |  |   81|  4.67M|{                                                                                                   \
  |  |   82|  4.67M|        volatile UWORD8 *pu1_mb_flag;                                                               \
  |  |   83|  4.67M|                                                                                                    \
  |  |   84|  4.67M|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_num );                                           \
  |  |   85|  4.67M|                                                                                                    \
  |  |   86|  4.67M|        u4_cond = (*pu1_mb_flag);                                                                   \
  |  |   87|  4.67M|}
  ------------------
  237|  4.67M|        if(u4_cond)
  ------------------
  |  Branch (237:12): [True: 958k, False: 3.71M]
  ------------------
  238|   958k|        {
  239|   958k|            break;
  240|   958k|        }
  241|  3.71M|        else
  242|  3.71M|        {
  243|  3.71M|            if(nop_cnt > 0)
  ------------------
  |  Branch (243:16): [True: 3.29M, False: 422k]
  ------------------
  244|  3.29M|            {
  245|  3.29M|                nop_cnt -= 128;
  246|  3.29M|                NOP(128);
  ------------------
  |  |   87|   424M|#define NOP(nop_cnt) {UWORD32 nop_i; for (nop_i = 0; nop_i < nop_cnt; nop_i++) asm("nop");}
  |  |  ------------------
  |  |  |  Branch (87:54): [True: 421M, False: 3.29M]
  |  |  ------------------
  ------------------
  247|  3.29M|            }
  248|   422k|            else
  249|   422k|            {
  250|   422k|                if(ps_dec->u4_output_present && (2 == ps_dec->u4_num_cores) &&
  ------------------
  |  Branch (250:20): [True: 180k, False: 242k]
  |  Branch (250:49): [True: 180k, False: 0]
  ------------------
  251|   180k|                   (ps_dec->u4_fmt_conv_cur_row < ps_dec->s_disp_frame_info.u4_y_ht))
  ------------------
  |  Branch (251:20): [True: 73.7k, False: 106k]
  ------------------
  252|  73.7k|                {
  253|  73.7k|                    ps_dec->u4_fmt_conv_num_rows =
  254|  73.7k|                                MIN(FMT_CONV_NUM_ROWS,
  ------------------
  |  |   61|  73.7k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 71.3k, False: 2.33k]
  |  |  ------------------
  ------------------
  255|  73.7k|                                    (ps_dec->s_disp_frame_info.u4_y_ht
  256|  73.7k|                                                    - ps_dec->u4_fmt_conv_cur_row));
  257|  73.7k|                    ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op),
  258|  73.7k|                                          ps_dec->u4_fmt_conv_cur_row,
  259|  73.7k|                                          ps_dec->u4_fmt_conv_num_rows);
  260|  73.7k|                    ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
  261|  73.7k|                }
  262|   348k|                else
  263|   348k|                {
  264|   348k|                    nop_cnt = 8*128;
  265|   348k|                    ithread_yield();
  266|   348k|                }
  267|   422k|            }
  268|  3.71M|        }
  269|  4.67M|    }
  270|       |    /* N Mb MC Loop */
  271|  8.17M|    for(i = 0; i < u4_num_mbs; i++)
  ------------------
  |  Branch (271:16): [True: 7.22M, False: 949k]
  ------------------
  272|  7.22M|    {
  273|  7.22M|        u4_mb_num = u2_cur_dec_mb_num;
  274|       |
  275|  7.22M|        GET_SLICE_NUM_MAP(ps_dec->pu2_slice_num_map, u2_cur_dec_mb_num,
  ------------------
  |  |  156|  7.22M|#define GET_SLICE_NUM_MAP(slice_map, mb_number,u2_slice_num)                                                  \
  |  |  157|  7.22M|{                                                                                                   \
  |  |  158|  7.22M|        volatile UWORD16 *pu2_slice_map;                                                               \
  |  |  159|  7.22M|                                                                                                    \
  |  |  160|  7.22M|        pu2_slice_map    = (UWORD16 *)slice_map + (mb_number);                                         \
  |  |  161|  7.22M|        u2_slice_num = (*pu2_slice_map) ;                                                               \
  |  |  162|  7.22M|}
  ------------------
  276|  7.22M|                          u2_slice_num);
  277|       |
  278|  7.22M|        if(u2_slice_num != ps_dec->u2_cur_slice_num_dec_thread)
  ------------------
  |  Branch (278:12): [True: 8.43k, False: 7.21M]
  ------------------
  279|  8.43k|        {
  280|  8.43k|            ps_dec->u4_cur_slice_decode_done = 1;
  281|  8.43k|            break;
  282|  8.43k|        }
  283|       |
  284|  7.21M|        ps_cur_mb_info = &ps_dec->ps_frm_mb_info[u2_cur_dec_mb_num];
  285|       |
  286|  7.21M|        ps_dec->u4_dma_buf_idx = 0;
  287|  7.21M|        ps_dec->u4_pred_info_idx = 0;
  288|       |
  289|  7.21M|        if(ps_cur_mb_info->u1_mb_type <= u1_skip_th)
  ------------------
  |  Branch (289:12): [True: 107k, False: 7.11M]
  ------------------
  290|   107k|        {
  291|   107k|            WORD32 pred_cnt = 0;
  292|   107k|            pred_info_pkd_t *ps_pred_pkd;
  293|   107k|            UWORD32 u4_pred_info_pkd_idx;
  294|   107k|            WORD8 i1_pred;
  295|       |
  296|   107k|            u4_pred_info_pkd_idx = ps_cur_mb_info->u4_pred_info_pkd_idx;
  297|       |
  298|   405k|            while(pred_cnt < ps_cur_mb_info->u1_num_pred_parts)
  ------------------
  |  Branch (298:19): [True: 297k, False: 107k]
  ------------------
  299|   297k|            {
  300|   297k|                ps_pred_pkd = ps_dec->ps_pred_pkd + u4_pred_info_pkd_idx;
  301|       |
  302|   297k|                ps_dec->p_form_mb_part_info_thread(ps_pred_pkd,ps_dec,
  303|   297k|                                                   ps_cur_mb_info->u2_mbx,
  304|   297k|                                                   ps_cur_mb_info->u2_mby,
  305|   297k|                                                   (i >> u1_mbaff),
  306|   297k|                                                   ps_cur_mb_info);
  307|       |
  308|   297k|                u4_pred_info_pkd_idx++;
  309|   297k|                pred_cnt++;
  310|   297k|            }
  311|   107k|            ps_dec->p_mc_dec_thread(ps_dec, ps_cur_mb_info);
  312|   107k|        }
  313|  7.11M|        else if(ps_cur_mb_info->u1_mb_type == MB_SKIP)
  ------------------
  |  |  456|  7.11M|#define MB_SKIP     255
  ------------------
  |  Branch (313:17): [True: 7.06M, False: 50.8k]
  ------------------
  314|  7.06M|        {
  315|  7.06M|            WORD32 pred_cnt = 0;
  316|  7.06M|            pred_info_pkd_t *ps_pred_pkd;
  317|  7.06M|            UWORD32 u4_pred_info_pkd_idx;
  318|  7.06M|            WORD8 i1_pred;
  319|       |
  320|  7.06M|            u4_pred_info_pkd_idx = ps_cur_mb_info->u4_pred_info_pkd_idx;
  321|       |
  322|  14.4M|            while(pred_cnt < ps_cur_mb_info->u1_num_pred_parts)
  ------------------
  |  Branch (322:19): [True: 7.42M, False: 7.06M]
  ------------------
  323|  7.42M|            {
  324|  7.42M|                ps_pred_pkd = ps_dec->ps_pred_pkd + u4_pred_info_pkd_idx;
  325|       |
  326|  7.42M|                ps_dec->p_form_mb_part_info_thread(ps_pred_pkd,ps_dec,
  327|  7.42M|                                                   ps_cur_mb_info->u2_mbx,
  328|  7.42M|                                                   ps_cur_mb_info->u2_mby,
  329|  7.42M|                                                   (i >> u1_mbaff),
  330|  7.42M|                                                   ps_cur_mb_info);
  331|       |
  332|  7.42M|                u4_pred_info_pkd_idx++;
  333|  7.42M|                pred_cnt++;
  334|  7.42M|            }
  335|       |            /* Decode MB skip */
  336|  7.06M|            ps_dec->p_mc_dec_thread(ps_dec, ps_cur_mb_info);
  337|  7.06M|        }
  338|       |
  339|  7.21M|        u2_cur_dec_mb_num++;
  340|  7.21M|    }
  341|       |
  342|       |    /* N Mb IQ IT RECON  Loop */
  343|  8.17M|    for(j = 0; j < i; j++)
  ------------------
  |  Branch (343:16): [True: 7.21M, False: 958k]
  ------------------
  344|  7.21M|    {
  345|  7.21M|        ps_cur_mb_info = &ps_dec->ps_frm_mb_info[ps_dec->cur_dec_mb_num];
  346|       |
  347|  7.21M|        if((ps_dec->u4_num_cores == 2) || !ps_dec->i1_recon_in_thread3_flag)
  ------------------
  |  Branch (347:12): [True: 7.21M, False: 0]
  |  Branch (347:43): [True: 0, False: 0]
  ------------------
  348|  7.21M|        {
  349|  7.21M|            if(ps_cur_mb_info->u1_mb_type <= u1_skip_th)
  ------------------
  |  Branch (349:16): [True: 107k, False: 7.11M]
  ------------------
  350|   107k|            {
  351|   107k|                ih264d_process_inter_mb(ps_dec, ps_cur_mb_info, j);
  352|   107k|            }
  353|  7.11M|            else if(ps_cur_mb_info->u1_mb_type != MB_SKIP)
  ------------------
  |  |  456|  7.11M|#define MB_SKIP     255
  ------------------
  |  Branch (353:21): [True: 50.8k, False: 7.06M]
  ------------------
  354|  50.8k|            {
  355|  50.8k|                if((u1_ipcm_th + 25) != ps_cur_mb_info->u1_mb_type)
  ------------------
  |  Branch (355:20): [True: 50.4k, False: 414]
  ------------------
  356|  50.4k|                {
  357|  50.4k|                    ps_cur_mb_info->u1_mb_type -= (u1_skip_th + 1);
  358|  50.4k|                    ih264d_process_intra_mb(ps_dec, ps_cur_mb_info, j);
  359|  50.4k|                }
  360|  50.8k|            }
  361|       |
  362|       |
  363|  7.21M|         if(ps_dec->u4_use_intrapred_line_copy == 1)
  ------------------
  |  Branch (363:13): [True: 7.21M, False: 0]
  ------------------
  364|  7.21M|                ih264d_copy_intra_pred_line(ps_dec, ps_cur_mb_info, j);
  365|  7.21M|        }
  366|       |
  367|  7.21M|        DATA_SYNC();
  ------------------
  |  |  116|  7.21M|#define DATA_SYNC()  __sync_synchronize()
  ------------------
  368|       |
  369|  7.21M|        if(u1_mbaff)
  ------------------
  |  Branch (369:12): [True: 0, False: 7.21M]
  ------------------
  370|      0|        {
  371|      0|            if(u4_update_mbaff)
  ------------------
  |  Branch (371:16): [True: 0, False: 0]
  ------------------
  372|      0|            {
  373|      0|                UWORD32 u4_mb_num = ps_cur_mb_info->u2_mbx
  374|      0|                                + ps_dec->u2_frm_wd_in_mbs
  375|      0|                                                * (ps_cur_mb_info->u2_mby >> 1);
  376|      0|                UPDATE_MB_MAP_MBNUM_BYTE(ps_dec->pu1_recon_mb_map, u4_mb_num);
  ------------------
  |  |  136|      0|#define UPDATE_MB_MAP_MBNUM_BYTE(mb_map, u4_mb_number)                                                  \
  |  |  137|      0|{                                                                                                   \
  |  |  138|      0|        volatile UWORD8 *pu1_mb_flag;                                                                       \
  |  |  139|      0|                                                                                                    \
  |  |  140|      0|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_number);                                                     \
  |  |  141|      0|        /*                                                                                          \
  |  |  142|      0|         * In case of MbAff, update the mb_map only if the entire MB is done. We can check that     \
  |  |  143|      0|         * by checking if Y is odd, implying that this is the second row in the MbAff MB            \
  |  |  144|      0|         */                                                                                         \
  |  |  145|      0|        (*pu1_mb_flag) = 1;                                                             \
  |  |  146|      0|}
  ------------------
  377|      0|                u4_update_mbaff = 0;
  378|      0|            }
  379|      0|            else
  380|      0|            {
  381|      0|                u4_update_mbaff = 1;
  382|      0|            }
  383|      0|        }
  384|  7.21M|        else
  385|  7.21M|        {
  386|  7.21M|            UWORD32 u4_mb_num = ps_cur_mb_info->u2_mbx
  387|  7.21M|                            + ps_dec->u2_frm_wd_in_mbs * ps_cur_mb_info->u2_mby;
  388|  7.21M|            UPDATE_MB_MAP_MBNUM_BYTE(ps_dec->pu1_recon_mb_map, u4_mb_num);
  ------------------
  |  |  136|  7.21M|#define UPDATE_MB_MAP_MBNUM_BYTE(mb_map, u4_mb_number)                                                  \
  |  |  137|  7.21M|{                                                                                                   \
  |  |  138|  7.21M|        volatile UWORD8 *pu1_mb_flag;                                                                       \
  |  |  139|  7.21M|                                                                                                    \
  |  |  140|  7.21M|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_number);                                                     \
  |  |  141|  7.21M|        /*                                                                                          \
  |  |  142|  7.21M|         * In case of MbAff, update the mb_map only if the entire MB is done. We can check that     \
  |  |  143|  7.21M|         * by checking if Y is odd, implying that this is the second row in the MbAff MB            \
  |  |  144|  7.21M|         */                                                                                         \
  |  |  145|  7.21M|        (*pu1_mb_flag) = 1;                                                             \
  |  |  146|  7.21M|}
  ------------------
  389|  7.21M|        }
  390|  7.21M|        ps_dec->cur_dec_mb_num++;
  391|  7.21M|     }
  392|       |
  393|       |    /*N MB deblocking*/
  394|   958k|    if(ps_dec->u4_nmb_deblk == 1)
  ------------------
  |  Branch (394:8): [True: 0, False: 958k]
  ------------------
  395|      0|    {
  396|      0|        UWORD32 u4_wd_y, u4_wd_uv;
  397|      0|        tfr_ctxt_t *ps_tfr_cxt = &(ps_dec->s_tran_addrecon);
  398|      0|        UWORD8 u1_field_pic_flag = ps_dec->ps_cur_slice->u1_field_pic_flag;
  399|      0|        const WORD32 i4_cb_qp_idx_ofst =
  400|      0|                       ps_dec->ps_cur_pps->i1_chroma_qp_index_offset;
  401|      0|        const WORD32 i4_cr_qp_idx_ofst =
  402|      0|                       ps_dec->ps_cur_pps->i1_second_chroma_qp_index_offset;
  403|       |
  404|      0|        u4_wd_y = ps_dec->u2_frm_wd_y << u1_field_pic_flag;
  405|      0|        u4_wd_uv = ps_dec->u2_frm_wd_uv << u1_field_pic_flag;
  406|       |
  407|      0|        ps_cur_mb_info = &ps_dec->ps_frm_mb_info[ps_dec->u4_cur_deblk_mb_num];
  408|       |
  409|      0|        ps_dec->u4_deblk_mb_x = ps_cur_mb_info->u2_mbx;
  410|      0|        ps_dec->u4_deblk_mb_y = ps_cur_mb_info->u2_mby;
  411|       |
  412|       |
  413|      0|        for(j = 0; j < i; j++)
  ------------------
  |  Branch (413:20): [True: 0, False: 0]
  ------------------
  414|      0|        {
  415|      0|            ih264d_deblock_mb_nonmbaff(ps_dec, ps_tfr_cxt,
  416|      0|                                       i4_cb_qp_idx_ofst, i4_cr_qp_idx_ofst,
  417|      0|                                        u4_wd_y, u4_wd_uv);
  418|       |
  419|      0|        }
  420|      0|    }
  421|       |
  422|       |    /*handle the last mb in picture case*/
  423|   958k|    if(ps_dec->cur_dec_mb_num > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (423:8): [True: 30.2k, False: 927k]
  ------------------
  424|  30.2k|        ps_dec->u4_cur_slice_decode_done = 1;
  425|       |
  426|   958k|    if(i != u4_num_mbs)
  ------------------
  |  Branch (426:8): [True: 8.43k, False: 949k]
  ------------------
  427|  8.43k|    {
  428|  8.43k|        u4_end_of_row = 0;
  429|       |        /*Number of MB's left in row*/
  430|  8.43k|        u4_num_mbs_next = u4_num_mbs_next + ((u4_num_mbs - i) >> u1_mbaff);
  431|  8.43k|    }
  432|       |
  433|   958k|    ih264d_decode_tfr_nmb(ps_dec, (i), u4_num_mbs_next, u4_end_of_row);
  434|       |
  435|   958k|    return OK;
  ------------------
  |  |  114|   958k|#define OK        0
  ------------------
  436|   958k|}
ih264d_decode_slice_thread:
  439|  38.7k|{
  440|  38.7k|    UWORD32 u4_num_mbs_next, u4_num_mbsleft, u4_end_of_row = 0;
  441|  38.7k|    const UWORD32 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
  442|  38.7k|    UWORD32 u4_mbaff, u4_num_mbs;
  443|       |
  444|  38.7k|    UWORD16 u2_first_mb_in_slice;
  445|  38.7k|    UWORD16 i16_mb_x, i16_mb_y;
  446|  38.7k|    UWORD8 u1_field_pic;
  447|  38.7k|    UWORD32 u4_frame_stride, x_offset, y_offset;
  448|  38.7k|    WORD32 ret;
  449|       |
  450|  38.7k|    tfr_ctxt_t *ps_trns_addr;
  451|       |
  452|       |    /*check for mb map of first mb in slice to ensure slice header is parsed*/
  453|   571k|    while(1)
  ------------------
  |  Branch (453:11): [True: 571k, Folded]
  ------------------
  454|   571k|    {
  455|   571k|        UWORD32 u4_mb_num = ps_dec->cur_dec_mb_num;
  456|   571k|        UWORD32 u4_cond = 0;
  457|   571k|        WORD32 nop_cnt = 8 * 128;
  458|   571k|        CHECK_MB_MAP_BYTE(u4_mb_num, ps_dec->pu1_dec_mb_map, u4_cond);
  ------------------
  |  |   80|   571k|#define CHECK_MB_MAP_BYTE(u4_mb_num, mb_map, u4_cond)                                               \
  |  |   81|   571k|{                                                                                                   \
  |  |   82|   571k|        volatile UWORD8 *pu1_mb_flag;                                                               \
  |  |   83|   571k|                                                                                                    \
  |  |   84|   571k|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_num );                                           \
  |  |   85|   571k|                                                                                                    \
  |  |   86|   571k|        u4_cond = (*pu1_mb_flag);                                                                   \
  |  |   87|   571k|}
  ------------------
  459|   571k|        if(u4_cond)
  ------------------
  |  Branch (459:12): [True: 38.7k, False: 532k]
  ------------------
  460|  38.7k|        {
  461|  38.7k|            break;
  462|  38.7k|        }
  463|   532k|        else
  464|   532k|        {
  465|   532k|            if(nop_cnt > 0)
  ------------------
  |  Branch (465:16): [True: 532k, False: 0]
  ------------------
  466|   532k|            {
  467|   532k|                nop_cnt -= 128;
  468|   532k|                NOP(128);
  ------------------
  |  |   87|  68.6M|#define NOP(nop_cnt) {UWORD32 nop_i; for (nop_i = 0; nop_i < nop_cnt; nop_i++) asm("nop");}
  |  |  ------------------
  |  |  |  Branch (87:54): [True: 68.1M, False: 532k]
  |  |  ------------------
  ------------------
  469|   532k|            }
  470|      0|            else if(ps_dec->u4_output_present && (2 == ps_dec->u4_num_cores) &&
  ------------------
  |  Branch (470:21): [True: 0, False: 0]
  |  Branch (470:50): [True: 0, False: 0]
  ------------------
  471|      0|               (ps_dec->u4_fmt_conv_cur_row < ps_dec->s_disp_frame_info.u4_y_ht))
  ------------------
  |  Branch (471:16): [True: 0, False: 0]
  ------------------
  472|      0|            {
  473|      0|                ps_dec->u4_fmt_conv_num_rows =
  474|      0|                                MIN(FMT_CONV_NUM_ROWS,
  ------------------
  |  |   61|      0|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  475|      0|                                    (ps_dec->s_disp_frame_info.u4_y_ht
  476|      0|                                                    - ps_dec->u4_fmt_conv_cur_row));
  477|      0|                ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op),
  478|      0|                                      ps_dec->u4_fmt_conv_cur_row,
  479|      0|                                      ps_dec->u4_fmt_conv_num_rows);
  480|      0|                ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
  481|      0|            }
  482|      0|            else
  483|      0|            {
  484|      0|                nop_cnt = 8*128;
  485|      0|                ithread_yield();
  486|      0|            }
  487|   532k|            DEBUG_THREADS_PRINTF("waiting for mb mapcur_dec_mb_num = %d,ps_dec->u4_cur_mb_addr  = %d\n",u2_cur_dec_mb_num,
  488|   532k|                            ps_dec->u4_cur_mb_addr);
  489|       |
  490|   532k|        }
  491|   571k|    }
  492|       |
  493|       |
  494|       |
  495|  38.7k|    u4_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  496|       |
  497|  38.7k|    u2_first_mb_in_slice = ps_dec->ps_decode_cur_slice->u4_first_mb_in_slice;
  498|       |
  499|  38.7k|    i16_mb_x = MOD(u2_first_mb_in_slice, i2_pic_wdin_mbs);
  ------------------
  |  |   64|  38.7k|#define MOD(x,y) ((x)%(y))
  ------------------
  500|  38.7k|    i16_mb_y = DIV(u2_first_mb_in_slice, i2_pic_wdin_mbs);
  ------------------
  |  |   65|  38.7k|#define DIV(x,y) ((x)/(y))
  ------------------
  501|  38.7k|    i16_mb_y <<= u4_mbaff;
  502|  38.7k|    ps_dec->i2_dec_thread_mb_y = i16_mb_y;
  503|       |
  504|       |
  505|  38.7k|    ps_dec->cur_dec_mb_num = u2_first_mb_in_slice << u4_mbaff;
  506|       |
  507|  38.7k|    if((ps_dec->u4_num_cores == 2) || !ps_dec->i1_recon_in_thread3_flag)
  ------------------
  |  Branch (507:8): [True: 38.7k, False: 0]
  |  Branch (507:39): [True: 0, False: 0]
  ------------------
  508|  38.7k|    {
  509|  38.7k|        ps_dec->pv_proc_tu_coeff_data =
  510|  38.7k|                (void *) ps_dec->ps_decode_cur_slice->pv_tu_coeff_data_start;
  511|  38.7k|    }
  512|       |
  513|       |    // recalculate recon pointers
  514|  38.7k|    u1_field_pic = ps_dec->ps_cur_slice->u1_field_pic_flag;
  515|  38.7k|    u4_frame_stride = ps_dec->u2_frm_wd_y << u1_field_pic;
  516|  38.7k|    x_offset = i16_mb_x << 4;
  517|  38.7k|    y_offset = (i16_mb_y * u4_frame_stride) << 4;
  518|       |
  519|  38.7k|    ps_trns_addr = &(ps_dec->s_tran_addrecon);
  520|       |
  521|  38.7k|    ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1 + x_offset + y_offset;
  522|       |
  523|  38.7k|    u4_frame_stride = ps_dec->u2_frm_wd_uv << u1_field_pic;
  524|  38.7k|    x_offset >>= 1;
  525|  38.7k|    y_offset = (i16_mb_y * u4_frame_stride) << 3;
  526|       |
  527|  38.7k|    x_offset *= YUV420SP_FACTOR;
  ------------------
  |  |  119|  38.7k|#define YUV420SP_FACTOR 2
  ------------------
  528|       |
  529|  38.7k|    ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2 + x_offset + y_offset;
  530|  38.7k|    ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3 + x_offset + y_offset;
  531|       |
  532|  38.7k|    ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
  533|  38.7k|    ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
  534|  38.7k|    ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
  535|       |
  536|       |
  537|       |    /* Initialise MC and formMbPartInfo fn ptrs one time based on profile_idc */
  538|  38.7k|    {
  539|  38.7k|        ps_dec->p_mc_dec_thread = ih264d_motion_compensate_bp;
  540|  38.7k|        ps_dec->p_form_mb_part_info_thread = ih264d_form_mb_part_info_bp;
  541|  38.7k|    }
  542|  38.7k|    {
  543|  38.7k|        UWORD8 uc_nofield_nombaff;
  544|  38.7k|        uc_nofield_nombaff = ((ps_dec->ps_cur_slice->u1_field_pic_flag == 0)
  ------------------
  |  Branch (544:31): [True: 38.7k, False: 0]
  ------------------
  545|  38.7k|                        && (ps_dec->ps_cur_slice->u1_mbaff_frame_flag == 0)
  ------------------
  |  Branch (545:28): [True: 38.7k, False: 0]
  ------------------
  546|  38.7k|                        && (ps_dec->ps_decode_cur_slice->slice_type != B_SLICE)
  ------------------
  |  |  369|  38.7k|#define B_SLICE  1
  ------------------
  |  Branch (546:28): [True: 32.5k, False: 6.23k]
  ------------------
  547|  32.5k|                        && (ps_dec->ps_cur_pps->u1_wted_pred_flag == 0));
  ------------------
  |  Branch (547:28): [True: 12.6k, False: 19.9k]
  ------------------
  548|       |
  549|  38.7k|        if(uc_nofield_nombaff == 0)
  ------------------
  |  Branch (549:12): [True: 26.1k, False: 12.6k]
  ------------------
  550|  26.1k|        {
  551|  26.1k|            ps_dec->p_mc_dec_thread = ih264d_motion_compensate_mp;
  552|  26.1k|            ps_dec->p_form_mb_part_info_thread = ih264d_form_mb_part_info_mp;
  553|  26.1k|        }
  554|       |
  555|  38.7k|    }
  556|       |
  557|  38.7k|    ps_dec->u4_cur_slice_decode_done = 0;
  558|       |
  559|       |
  560|   996k|    while(ps_dec->u4_cur_slice_decode_done != 1)
  ------------------
  |  Branch (560:11): [True: 958k, False: 38.7k]
  ------------------
  561|   958k|    {
  562|       |
  563|   958k|        u4_num_mbsleft = ((i2_pic_wdin_mbs - i16_mb_x) << u4_mbaff);
  564|       |
  565|   958k|        if(u4_num_mbsleft <= ps_dec->u4_recon_mb_grp)
  ------------------
  |  Branch (565:12): [True: 958k, False: 0]
  ------------------
  566|   958k|        {
  567|   958k|            u4_num_mbs = u4_num_mbsleft;
  568|       |
  569|       |            /*Indicate number of mb's left in a row*/
  570|   958k|            u4_num_mbs_next = 0;
  571|   958k|            u4_end_of_row = 1;
  572|   958k|            i16_mb_x = 0;
  573|   958k|        }
  574|      0|        else
  575|      0|        {
  576|      0|            u4_num_mbs = ps_dec->u4_recon_mb_grp;
  577|       |
  578|       |            /*Indicate number of mb's left in a row*/
  579|      0|            u4_num_mbs_next = i2_pic_wdin_mbs - i16_mb_x
  580|      0|                            - (ps_dec->u4_recon_mb_grp >> u4_mbaff);
  581|      0|            i16_mb_x += (u4_num_mbs >> u4_mbaff);
  582|      0|            u4_end_of_row = 0;
  583|       |
  584|      0|        }
  585|   958k|        ret = ih264d_decode_recon_tfr_nmb_thread(ps_dec, u4_num_mbs, u4_num_mbs_next,
  586|   958k|                                           u4_end_of_row);
  587|   958k|        if(ret != OK)
  ------------------
  |  |  114|   958k|#define OK        0
  ------------------
  |  Branch (587:12): [True: 0, False: 958k]
  ------------------
  588|      0|            return ret;
  589|   958k|    }
  590|  38.7k|    return OK;
  ------------------
  |  |  114|  38.7k|#define OK        0
  ------------------
  591|  38.7k|}
ih264d_decode_picture_thread:
  594|  30.2k|{
  595|  30.2k|    ithread_set_name("ih264d_decode_picture_thread");
  596|       |
  597|  30.2k|    while(1)
  ------------------
  |  Branch (597:11): [True: 30.2k, Folded]
  ------------------
  598|  30.2k|    {
  599|  30.2k|        WORD32 ret;
  600|  30.2k|        if(ps_dec->i4_threads_active)
  ------------------
  |  Branch (600:12): [True: 0, False: 30.2k]
  ------------------
  601|      0|        {
  602|      0|            ret = ithread_mutex_lock(ps_dec->apv_proc_start_mutex[0]);
  603|      0|            if(OK != ret)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (603:16): [True: 0, False: 0]
  ------------------
  604|      0|                break;
  605|       |
  606|      0|            while(ps_dec->ai4_process_start[0] != PROC_START)
  ------------------
  |  Branch (606:19): [True: 0, False: 0]
  ------------------
  607|      0|            {
  608|      0|                ithread_cond_wait(ps_dec->apv_proc_start_condition[0],
  609|      0|                                  ps_dec->apv_proc_start_mutex[0]);
  610|      0|            }
  611|      0|            ps_dec->ai4_process_start[0] = PROC_IN_PROGRESS;
  612|       |
  613|      0|            ret = ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[0]);
  614|      0|            if(OK != ret || ps_dec->i4_break_threads == 1)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (614:16): [True: 0, False: 0]
  |  Branch (614:29): [True: 0, False: 0]
  ------------------
  615|      0|                break;
  616|      0|        }
  617|  38.7k|        while(1)
  ------------------
  |  Branch (617:15): [True: 38.7k, Folded]
  ------------------
  618|  38.7k|        {
  619|       |            /*Complete all writes before processing next slice*/
  620|       |
  621|  38.7k|            DEBUG_THREADS_PRINTF(" Entering decode slice\n");
  622|       |
  623|  38.7k|            ih264d_decode_slice_thread(ps_dec);
  624|  38.7k|            DEBUG_THREADS_PRINTF(" Exit  ih264d_decode_slice_thread \n");
  625|       |
  626|       |
  627|  38.7k|            if(ps_dec->cur_dec_mb_num
  ------------------
  |  Branch (627:16): [True: 30.2k, False: 8.43k]
  ------------------
  628|  38.7k|                            > ps_dec->ps_cur_sps->u4_max_mb_addr)
  629|  30.2k|            {
  630|       |                /*Last slice in frame*/
  631|  30.2k|                break;
  632|  30.2k|            }
  633|  8.43k|            else
  634|  8.43k|            {
  635|  8.43k|                ps_dec->ps_decode_cur_slice++;
  636|  8.43k|                ps_dec->u2_cur_slice_num_dec_thread++;
  637|  8.43k|            }
  638|       |
  639|  38.7k|        }
  640|  30.2k|        if(ps_dec->u4_output_present && (2 == ps_dec->u4_num_cores) &&
  ------------------
  |  Branch (640:12): [True: 6.60k, False: 23.6k]
  |  Branch (640:41): [True: 6.60k, False: 0]
  ------------------
  641|  6.60k|            (ps_dec->u4_fmt_conv_cur_row < ps_dec->s_disp_frame_info.u4_y_ht))
  ------------------
  |  Branch (641:13): [True: 4.26k, False: 2.33k]
  ------------------
  642|  4.26k|        {
  643|  4.26k|            ps_dec->u4_fmt_conv_num_rows =
  644|  4.26k|                            (ps_dec->s_disp_frame_info.u4_y_ht
  645|  4.26k|                                            - ps_dec->u4_fmt_conv_cur_row);
  646|  4.26k|            ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op),
  647|  4.26k|                                ps_dec->u4_fmt_conv_cur_row,
  648|  4.26k|                                ps_dec->u4_fmt_conv_num_rows);
  649|  4.26k|            ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
  650|  4.26k|        }
  651|       |
  652|  30.2k|        if(ps_dec->i4_threads_active)
  ------------------
  |  Branch (652:12): [True: 0, False: 30.2k]
  ------------------
  653|      0|        {
  654|      0|            ret = ithread_mutex_lock(ps_dec->apv_proc_done_mutex[0]);
  655|      0|            if(OK != ret)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (655:16): [True: 0, False: 0]
  ------------------
  656|      0|                break;
  657|       |
  658|      0|            ps_dec->ai4_process_done[0] = PROC_DONE;
  659|      0|            ithread_cond_signal(ps_dec->apv_proc_done_condition[0]);
  660|       |
  661|      0|            ret = ithread_mutex_unlock(ps_dec->apv_proc_done_mutex[0]);
  662|      0|            if(OK != ret)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (662:16): [True: 0, False: 0]
  ------------------
  663|      0|                break;
  664|      0|        }
  665|  30.2k|        else
  666|  30.2k|        {
  667|  30.2k|            break;
  668|  30.2k|        }
  669|  30.2k|    }
  670|  30.2k|}
ih264d_signal_decode_thread:
  673|  84.3k|{
  674|  84.3k|    if(ps_dec->u4_dec_thread_created == 1)
  ------------------
  |  Branch (674:8): [True: 51.6k, False: 32.6k]
  ------------------
  675|  51.6k|    {
  676|  51.6k|        if(ps_dec->i4_threads_active)
  ------------------
  |  Branch (676:12): [True: 0, False: 51.6k]
  ------------------
  677|      0|        {
  678|      0|            proc_state_t i4_process_state;
  679|      0|            ithread_mutex_lock(ps_dec->apv_proc_start_mutex[0]);
  680|      0|            i4_process_state = ps_dec->ai4_process_start[0];
  681|      0|            ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[0]);
  682|       |
  683|       |            // only wait if the thread has started decoding
  684|      0|            if(i4_process_state != PROC_INIT)
  ------------------
  |  Branch (684:16): [True: 0, False: 0]
  ------------------
  685|      0|            {
  686|      0|                ithread_mutex_lock(ps_dec->apv_proc_done_mutex[0]);
  687|       |
  688|      0|                while(ps_dec->ai4_process_done[0] != PROC_DONE)
  ------------------
  |  Branch (688:23): [True: 0, False: 0]
  ------------------
  689|      0|                {
  690|      0|                    ithread_cond_wait(ps_dec->apv_proc_done_condition[0],
  691|      0|                                        ps_dec->apv_proc_done_mutex[0]);
  692|      0|                }
  693|      0|                ps_dec->ai4_process_done[0] = PROC_INIT;
  694|      0|                ithread_mutex_unlock(ps_dec->apv_proc_done_mutex[0]);
  695|      0|            }
  696|      0|        }
  697|  51.6k|        else
  698|  51.6k|        {
  699|       |            ithread_join(ps_dec->pv_dec_thread_handle, NULL);
  700|  51.6k|            ps_dec->u4_dec_thread_created = 0;
  701|  51.6k|        }
  702|  51.6k|    }
  703|  84.3k|}

ih264d_is_end_of_pic:
   88|  4.22k|{
   89|  4.22k|    WORD8 i1_is_end_of_pic;
   90|  4.22k|    WORD8 a, b, c, d, e, f, g, h;
   91|       |
   92|  4.22k|    a = b = c = d = e = f = g = h = 0;
   93|  4.22k|    a = (ps_prev_slice->u2_frame_num != u2_frame_num);
   94|  4.22k|    b = (ps_prev_slice->u1_field_pic_flag != u1_field_pic_flag);
   95|  4.22k|    if(u1_field_pic_flag && ps_prev_slice->u1_field_pic_flag)
  ------------------
  |  Branch (95:8): [True: 0, False: 4.22k]
  |  Branch (95:29): [True: 0, False: 0]
  ------------------
   96|      0|        c = (u1_bottom_field_flag != ps_prev_slice->u1_bottom_field_flag);
   97|  4.22k|    d =
   98|  4.22k|                    (u1_nal_ref_idc == 0 && ps_prev_slice->u1_nal_ref_idc != 0)
  ------------------
  |  Branch (98:22): [True: 1.59k, False: 2.63k]
  |  Branch (98:45): [True: 0, False: 1.59k]
  ------------------
   99|  4.22k|                                    || (u1_nal_ref_idc != 0
  ------------------
  |  Branch (99:41): [True: 2.63k, False: 1.59k]
  ------------------
  100|  2.63k|                                                    && ps_prev_slice->u1_nal_ref_idc
  ------------------
  |  Branch (100:56): [True: 0, False: 2.63k]
  ------------------
  101|  2.63k|                                                                    == 0);
  102|  4.22k|    if(!a)
  ------------------
  |  Branch (102:8): [True: 4.13k, False: 85]
  ------------------
  103|  4.13k|    {
  104|  4.13k|        if((u1_pic_order_cnt_type == 0)
  ------------------
  |  Branch (104:12): [True: 3.55k, False: 581]
  ------------------
  105|  3.55k|                        && (ps_prev_slice->u1_pic_order_cnt_type == 0))
  ------------------
  |  Branch (105:28): [True: 3.55k, False: 0]
  ------------------
  106|  3.55k|        {
  107|  3.55k|            e =
  108|  3.55k|                            ((ps_cur_poc->i4_pic_order_cnt_lsb
  ------------------
  |  Branch (108:30): [True: 70, False: 3.48k]
  ------------------
  109|  3.55k|                                            != ps_prev_poc->i4_pic_order_cnt_lsb)
  110|  3.48k|                                            || (ps_cur_poc->i4_delta_pic_order_cnt_bottom
  ------------------
  |  Branch (110:48): [True: 0, False: 3.48k]
  ------------------
  111|  3.48k|                                                            != ps_prev_poc->i4_delta_pic_order_cnt_bottom));
  112|  3.55k|        }
  113|       |
  114|  4.13k|        if((u1_pic_order_cnt_type == 1)
  ------------------
  |  Branch (114:12): [True: 269, False: 3.86k]
  ------------------
  115|    269|                        && (ps_prev_slice->u1_pic_order_cnt_type == 1))
  ------------------
  |  Branch (115:28): [True: 269, False: 0]
  ------------------
  116|    269|        {
  117|    269|            f =
  118|    269|                            ((ps_cur_poc->i4_delta_pic_order_cnt[0]
  ------------------
  |  Branch (118:30): [True: 39, False: 230]
  ------------------
  119|    269|                                            != ps_prev_poc->i4_delta_pic_order_cnt[0])
  120|    230|                                            || (ps_cur_poc->i4_delta_pic_order_cnt[1]
  ------------------
  |  Branch (120:48): [True: 84, False: 146]
  ------------------
  121|    230|                                                            != ps_prev_poc->i4_delta_pic_order_cnt[1]));
  122|    269|        }
  123|  4.13k|    }
  124|       |
  125|  4.22k|    if((u1_nal_unit_type == IDR_SLICE_NAL)
  ------------------
  |  |  328|  4.22k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (125:8): [True: 2.09k, False: 2.13k]
  ------------------
  126|  2.09k|                    && (ps_prev_slice->u1_nal_unit_type == IDR_SLICE_NAL))
  ------------------
  |  |  328|  2.09k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (126:24): [True: 2.09k, False: 0]
  ------------------
  127|  2.09k|    {
  128|  2.09k|        g = (u4_idr_pic_id != ps_prev_slice->u4_idr_pic_id);
  129|  2.09k|    }
  130|       |
  131|  4.22k|    if((u1_nal_unit_type == IDR_SLICE_NAL)
  ------------------
  |  |  328|  4.22k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (131:8): [True: 2.09k, False: 2.13k]
  ------------------
  132|  2.09k|                    && (ps_prev_slice->u1_nal_unit_type != IDR_SLICE_NAL))
  ------------------
  |  |  328|  2.09k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (132:24): [True: 0, False: 2.09k]
  ------------------
  133|      0|    {
  134|      0|        h = 1;
  135|      0|    }
  136|  4.22k|    i1_is_end_of_pic = a + b + c + d + e + f + g + h;
  137|  4.22k|    return (i1_is_end_of_pic);
  138|  4.22k|}
ih264d_end_of_pic_processing:
  531|   129k|{
  532|   129k|    UWORD8 u1_pic_type, u1_nal_ref_idc;
  533|   129k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
  534|       |
  535|       |    /* If nal_ref_idc is equal to 0 for one slice or slice data partition NAL
  536|       |     unit of a particular picture, it shall be equal to 0 for all slice and
  537|       |     slice data partition NAL units of the picture. nal_ref_idc greater
  538|       |     than 0 indicates that the content of the NAL unit belongs to a decoded
  539|       |     picture that is stored and marked for use as a reference picture in the
  540|       |     decoded picture buffer. */
  541|       |
  542|       |    /* 1. Do MMCO
  543|       |     2. Add Cur Pic to list of reference pics.
  544|       |     */
  545|       |
  546|       |    /* Call MMCO */
  547|   129k|    u1_pic_type = 0;
  548|   129k|    u1_nal_ref_idc = ps_cur_slice->u1_nal_ref_idc;
  549|       |
  550|   129k|    if(u1_nal_ref_idc)
  ------------------
  |  Branch (550:8): [True: 112k, False: 17.0k]
  ------------------
  551|   112k|    {
  552|   112k|        if(ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL)
  ------------------
  |  |  328|   112k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (552:12): [True: 99.6k, False: 12.9k]
  ------------------
  553|  99.6k|        {
  554|  99.6k|            ps_dec->ps_dpb_mgr->u1_mmco_error_in_seq = 0;
  555|  99.6k|            if(ps_dec->ps_dpb_cmds->u1_long_term_reference_flag == 0)
  ------------------
  |  Branch (555:16): [True: 85.7k, False: 13.9k]
  ------------------
  556|  85.7k|            {
  557|  85.7k|                ih264d_reset_ref_bufs(ps_dec->ps_dpb_mgr);
  558|       |                /* ignore DPB errors */
  559|  85.7k|                ih264d_insert_st_node(ps_dec->ps_dpb_mgr,
  560|  85.7k|                                      ps_dec->ps_cur_pic,
  561|  85.7k|                                      ps_dec->u1_pic_buf_id,
  562|  85.7k|                                      ps_cur_slice->u2_frame_num);
  563|  85.7k|                ps_dec->ps_dpb_mgr->u1_max_lt_frame_idx = NO_LONG_TERM_INDICIES;
  ------------------
  |  |   53|  85.7k|#define NO_LONG_TERM_INDICIES      255
  ------------------
  564|  85.7k|            }
  565|  13.9k|            else
  566|  13.9k|            {
  567|       |                /* Equivalent of inserting a pic directly as longterm Pic */
  568|       |
  569|  13.9k|                {
  570|       |                    /* ignore DPB errors */
  571|  13.9k|                    ih264d_insert_st_node(ps_dec->ps_dpb_mgr,
  572|  13.9k|                                          ps_dec->ps_cur_pic,
  573|  13.9k|                                          ps_dec->u1_pic_buf_id,
  574|  13.9k|                                          ps_cur_slice->u2_frame_num);
  575|       |
  576|       |                    /* Set longTermIdx = 0, MaxLongTermFrameIdx = 0 */
  577|  13.9k|                    ih264d_delete_st_node_or_make_lt(
  578|  13.9k|                                    ps_dec->ps_dpb_mgr,
  579|  13.9k|                                    ps_cur_slice->u2_frame_num, 0,
  580|  13.9k|                                    ps_cur_slice->u1_field_pic_flag);
  581|       |
  582|  13.9k|                    ps_dec->ps_dpb_mgr->u1_max_lt_frame_idx = 0;
  583|  13.9k|                }
  584|  13.9k|            }
  585|  99.6k|        }
  586|  12.9k|        else
  587|  12.9k|        {
  588|       |
  589|  12.9k|            {
  590|  12.9k|                UWORD16 u2_pic_num = ps_cur_slice->u2_frame_num;
  591|       |
  592|  12.9k|                if(!ps_dec->ps_dpb_mgr->u1_mmco_error_in_seq)
  ------------------
  |  Branch (592:20): [True: 12.0k, False: 917]
  ------------------
  593|  12.0k|                {
  594|  12.0k|                    WORD32 ret = ih264d_do_mmco_buffer(ps_dec->ps_dpb_cmds, ps_dec->ps_dpb_mgr,
  595|  12.0k|                                               ps_dec->ps_cur_sps->u1_num_ref_frames, u2_pic_num,
  596|  12.0k|                                               (ps_dec->ps_cur_sps->u2_u4_max_pic_num_minus1),
  597|  12.0k|                                               ps_dec->u1_nal_unit_type, ps_dec->ps_cur_pic,
  598|  12.0k|                                               ps_dec->u1_pic_buf_id,
  599|  12.0k|                                               ps_cur_slice->u1_field_pic_flag,
  600|  12.0k|                                               ps_dec->e_dec_status);
  601|  12.0k|                    ps_dec->ps_dpb_mgr->u1_mmco_error_in_seq = ret != OK;
  ------------------
  |  |  114|  12.0k|#define OK        0
  ------------------
  602|  12.0k|                }
  603|  12.9k|            }
  604|  12.9k|        }
  605|   112k|        ih264d_update_default_index_list(ps_dec->ps_dpb_mgr);
  606|   112k|    }
  607|       |
  608|   129k|    if(ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (608:8): [True: 0, False: 129k]
  ------------------
  609|      0|    {
  610|      0|        if(ps_cur_slice->u1_bottom_field_flag)
  ------------------
  |  Branch (610:12): [True: 0, False: 0]
  ------------------
  611|      0|        {
  612|      0|            if(u1_nal_ref_idc)
  ------------------
  |  Branch (612:16): [True: 0, False: 0]
  ------------------
  613|      0|                u1_pic_type = u1_pic_type | BOT_REF;
  ------------------
  |  |  358|      0|#define BOT_REF         0x10
  ------------------
  614|      0|            u1_pic_type = u1_pic_type | BOT_FLD;
  ------------------
  |  |  354|      0|#define BOT_FLD         0x02
  ------------------
  615|      0|        }
  616|      0|        else
  617|      0|        {
  618|      0|            if(u1_nal_ref_idc)
  ------------------
  |  Branch (618:16): [True: 0, False: 0]
  ------------------
  619|      0|                u1_pic_type = u1_pic_type | TOP_REF;
  ------------------
  |  |  357|      0|#define TOP_REF         0x08
  ------------------
  620|      0|            u1_pic_type = u1_pic_type | TOP_FLD;
  ------------------
  |  |  353|      0|#define TOP_FLD         0x01
  ------------------
  621|      0|        }
  622|      0|    }
  623|   129k|    else
  624|   129k|        u1_pic_type = TOP_REF | BOT_REF;
  ------------------
  |  |  357|   129k|#define TOP_REF         0x08
  ------------------
                      u1_pic_type = TOP_REF | BOT_REF;
  ------------------
  |  |  358|   129k|#define BOT_REF         0x10
  ------------------
  625|   129k|    ps_dec->ps_cur_pic->u1_pic_type |= u1_pic_type;
  626|       |
  627|       |
  628|   129k|    if(ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (628:8): [True: 0, False: 129k]
  ------------------
  629|      0|    {
  630|      0|        H264_DEC_DEBUG_PRINT("Toggling secondField\n");
  ------------------
  |  |   39|      0|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
  631|      0|        ps_dec->u1_second_field = 1 - ps_dec->u1_second_field;
  632|      0|    }
  633|       |
  634|   129k|    return OK;
  ------------------
  |  |  114|   129k|#define OK        0
  ------------------
  635|   129k|}
ih264d_get_dpb_size:
  659|   154k|{
  660|   154k|    WORD32 i4_size;
  661|   154k|    UWORD8 u1_level_idc;
  662|       |
  663|   154k|    u1_level_idc = ps_seq->u1_level_idc;
  664|       |
  665|   154k|    switch(u1_level_idc)
  666|   154k|    {
  667|    678|        case 10:
  ------------------
  |  Branch (667:9): [True: 678, False: 154k]
  ------------------
  668|    678|            i4_size = 152064;
  669|    678|            break;
  670|  20.1k|        case 11:
  ------------------
  |  Branch (670:9): [True: 20.1k, False: 134k]
  ------------------
  671|  20.1k|            i4_size = 345600;
  672|  20.1k|            break;
  673|  2.51k|        case 12:
  ------------------
  |  Branch (673:9): [True: 2.51k, False: 152k]
  ------------------
  674|  2.51k|            i4_size = 912384;
  675|  2.51k|            break;
  676|    973|        case 13:
  ------------------
  |  Branch (676:9): [True: 973, False: 153k]
  ------------------
  677|    973|            i4_size = 912384;
  678|    973|            break;
  679|  25.7k|        case 20:
  ------------------
  |  Branch (679:9): [True: 25.7k, False: 129k]
  ------------------
  680|  25.7k|            i4_size = 912384;
  681|  25.7k|            break;
  682|  4.37k|        case 21:
  ------------------
  |  Branch (682:9): [True: 4.37k, False: 150k]
  ------------------
  683|  4.37k|            i4_size = 1824768;
  684|  4.37k|            break;
  685|    754|        case 22:
  ------------------
  |  Branch (685:9): [True: 754, False: 154k]
  ------------------
  686|    754|            i4_size = 3110400;
  687|    754|            break;
  688|  2.05k|        case 30:
  ------------------
  |  Branch (688:9): [True: 2.05k, False: 152k]
  ------------------
  689|  2.05k|            i4_size = 3110400;
  690|  2.05k|            break;
  691|  5.31k|        case 31:
  ------------------
  |  Branch (691:9): [True: 5.31k, False: 149k]
  ------------------
  692|  5.31k|            i4_size = 6912000;
  693|  5.31k|            break;
  694|  23.3k|        case 32:
  ------------------
  |  Branch (694:9): [True: 23.3k, False: 131k]
  ------------------
  695|  23.3k|            i4_size = 7864320;
  696|  23.3k|            break;
  697|  7.20k|        case 40:
  ------------------
  |  Branch (697:9): [True: 7.20k, False: 147k]
  ------------------
  698|  7.20k|            i4_size = 12582912;
  699|  7.20k|            break;
  700|  1.50k|        case 41:
  ------------------
  |  Branch (700:9): [True: 1.50k, False: 153k]
  ------------------
  701|  1.50k|            i4_size = 12582912;
  702|  1.50k|            break;
  703|  6.05k|        case 42:
  ------------------
  |  Branch (703:9): [True: 6.05k, False: 148k]
  ------------------
  704|  6.05k|            i4_size = 12582912;
  705|  6.05k|            break;
  706|     77|        case 50:
  ------------------
  |  Branch (706:9): [True: 77, False: 154k]
  ------------------
  707|     77|            i4_size = 42393600;
  708|     77|            break;
  709|     11|        case 51:
  ------------------
  |  Branch (709:9): [True: 11, False: 154k]
  ------------------
  710|     11|            i4_size = 70778880;
  711|     11|            break;
  712|      0|        case 52:
  ------------------
  |  Branch (712:9): [True: 0, False: 154k]
  ------------------
  713|      0|            i4_size = 70778880;
  714|      0|            break;
  715|  54.0k|        default:
  ------------------
  |  Branch (715:9): [True: 54.0k, False: 100k]
  ------------------
  716|  54.0k|            i4_size = 70778880;
  717|  54.0k|            break;
  718|   154k|    }
  719|       |
  720|   154k|    i4_size /= (ps_seq->u2_frm_wd_in_mbs * (ps_seq->u2_frm_ht_in_mbs << (1 - ps_seq->u1_frame_mbs_only_flag)));
  721|   154k|    i4_size /= 384;
  722|   154k|    i4_size = MIN(i4_size, 16);
  ------------------
  |  |   61|   154k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 10.5k, False: 144k]
  |  |  ------------------
  ------------------
  723|   154k|    i4_size = MAX(i4_size, 1);
  ------------------
  |  |   60|   154k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 154k, False: 137]
  |  |  ------------------
  ------------------
  724|   154k|    return (i4_size);
  725|   154k|}
ih264d_init_dec_mb_grp:
  737|  23.6k|{
  738|  23.6k|    dec_seq_params_t *ps_seq = ps_dec->ps_cur_sps;
  739|  23.6k|    UWORD8 u1_frm = ps_seq->u1_frame_mbs_only_flag;
  740|       |
  741|  23.6k|    ps_dec->u4_recon_mb_grp = ps_dec->u2_frm_wd_in_mbs << ps_seq->u1_mb_aff_flag;
  742|       |
  743|  23.6k|    ps_dec->u4_recon_mb_grp_pair = ps_dec->u4_recon_mb_grp >> 1;
  744|       |
  745|  23.6k|    if(!ps_dec->u4_recon_mb_grp)
  ------------------
  |  Branch (745:8): [True: 0, False: 23.6k]
  ------------------
  746|      0|    {
  747|      0|        return ERROR_MB_GROUP_ASSGN_T;
  748|      0|    }
  749|       |
  750|  23.6k|    ps_dec->u4_num_mbs_prev_nmb = ps_dec->u4_recon_mb_grp;
  751|       |
  752|  23.6k|    return OK;
  ------------------
  |  |  114|  23.6k|#define OK        0
  ------------------
  753|  23.6k|}
ih264d_get_next_display_field:
  979|   188k|{
  980|   188k|    pic_buffer_t *pic_buf;
  981|       |
  982|   188k|    UWORD8 i1_cur_fld;
  983|   188k|    WORD32 u4_api_ret = -1;
  984|   188k|    WORD32 i4_disp_buf_id;
  985|   188k|    iv_yuv_buf_t *ps_op_frm;
  986|       |
  987|       |
  988|       |
  989|   188k|    ps_op_frm = &(ps_dec->s_disp_frame_info);
  990|   188k|    H264_MUTEX_LOCK(&ps_dec->process_disp_mutex);
  991|   188k|    pic_buf = (pic_buffer_t *)ih264_disp_mgr_get(
  992|   188k|                    (disp_mgr_t *)ps_dec->pv_disp_buf_mgr, &i4_disp_buf_id);
  993|   188k|    ps_dec->u4_num_fld_in_frm = 0;
  994|   188k|    u4_api_ret = -1;
  995|   188k|    pv_disp_op->u4_ts = 0;
  996|   188k|    pv_disp_op->e_output_format = ps_dec->u1_chroma_format;
  997|       |
  998|   188k|    pv_disp_op->s_disp_frm_buf.pv_y_buf = ps_out_buffer->pu1_bufs[0];
  999|   188k|    pv_disp_op->s_disp_frm_buf.pv_u_buf = ps_out_buffer->pu1_bufs[1];
 1000|   188k|    pv_disp_op->s_disp_frm_buf.pv_v_buf = ps_out_buffer->pu1_bufs[2];
 1001|   188k|    ps_dec->i4_display_index  = DEFAULT_POC;
  ------------------
  |  |   45|   188k|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
 1002|   188k|    if(pic_buf != NULL)
  ------------------
  |  Branch (1002:8): [True: 88.0k, False: 100k]
  ------------------
 1003|  88.0k|    {
 1004|  88.0k|        ps_dec->pv_disp_sei_params = &pic_buf->s_sei_pic;
 1005|  88.0k|        pv_disp_op->e4_fld_type = 0;
 1006|  88.0k|        pv_disp_op->u4_disp_buf_id = i4_disp_buf_id;
 1007|       |
 1008|  88.0k|        ps_op_frm->u4_y_ht = pic_buf->u2_disp_height << 1;
 1009|  88.0k|        ps_op_frm->u4_u_ht = ps_op_frm->u4_v_ht = ps_op_frm->u4_y_ht >> 1;
 1010|  88.0k|        ps_op_frm->u4_y_wd = pic_buf->u2_disp_width;
 1011|       |
 1012|  88.0k|        ps_op_frm->u4_u_wd = ps_op_frm->u4_v_wd = ps_op_frm->u4_y_wd >> 1;
 1013|       |
 1014|  88.0k|        ps_op_frm->u4_y_strd = pic_buf->u2_frm_wd_y;
 1015|  88.0k|        ps_op_frm->u4_u_strd = ps_op_frm->u4_v_strd = pic_buf->u2_frm_wd_uv;
 1016|       |
 1017|       |        /* ! */
 1018|  88.0k|        pv_disp_op->u4_ts = pic_buf->u4_ts;
 1019|  88.0k|        ps_dec->i4_display_index = pic_buf->i4_poc;
 1020|       |
 1021|       |        /* set the start of the Y, U and V buffer pointer for display    */
 1022|  88.0k|        ps_op_frm->pv_y_buf = pic_buf->pu1_buf1 + pic_buf->u2_crop_offset_y;
 1023|  88.0k|        ps_op_frm->pv_u_buf = pic_buf->pu1_buf2 + pic_buf->u2_crop_offset_uv;
 1024|  88.0k|        ps_op_frm->pv_v_buf = pic_buf->pu1_buf3 + pic_buf->u2_crop_offset_uv;
 1025|  88.0k|        ps_dec->u4_num_fld_in_frm++;
 1026|  88.0k|        ps_dec->u4_num_fld_in_frm++;
 1027|  88.0k|        u4_api_ret = 0;
 1028|       |
 1029|  88.0k|        if(pic_buf->u1_picturetype == 0)
  ------------------
  |  Branch (1029:12): [True: 88.0k, False: 0]
  ------------------
 1030|  88.0k|            pv_disp_op->u4_progressive_frame_flag = 1;
 1031|      0|        else
 1032|      0|            pv_disp_op->u4_progressive_frame_flag = 0;
 1033|       |
 1034|  88.0k|    } H264_MUTEX_UNLOCK(&ps_dec->process_disp_mutex);
 1035|   188k|    pv_disp_op->u4_error_code = u4_api_ret;
 1036|   188k|    pv_disp_op->e_pic_type = 0xFFFFFFFF; //Junk;
 1037|       |
 1038|   188k|    if(u4_api_ret)
  ------------------
  |  Branch (1038:8): [True: 100k, False: 88.0k]
  ------------------
 1039|   100k|    {
 1040|   100k|        pv_disp_op->u4_error_code = 1; //put a proper error code here
 1041|   100k|    }
 1042|  88.0k|    else
 1043|  88.0k|    {
 1044|       |
 1045|       |        //Release the buffer if being sent for display
 1046|  88.0k|        UWORD32 temp;
 1047|  88.0k|        UWORD32 dest_inc_Y = 0, dest_inc_UV = 0;
 1048|       |
 1049|  88.0k|        pv_disp_op->s_disp_frm_buf.u4_y_wd = temp = MIN(ps_op_frm->u4_y_wd,
  ------------------
  |  |   61|  88.0k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 88.0k, False: 0]
  |  |  ------------------
  ------------------
 1050|  88.0k|                                                        ps_op_frm->u4_y_strd);
 1051|  88.0k|        pv_disp_op->s_disp_frm_buf.u4_u_wd = pv_disp_op->s_disp_frm_buf.u4_y_wd
 1052|  88.0k|                        >> 1;
 1053|  88.0k|        pv_disp_op->s_disp_frm_buf.u4_v_wd = pv_disp_op->s_disp_frm_buf.u4_y_wd
 1054|  88.0k|                        >> 1;
 1055|       |
 1056|  88.0k|        pv_disp_op->s_disp_frm_buf.u4_y_ht = ps_op_frm->u4_y_ht;
 1057|  88.0k|        pv_disp_op->s_disp_frm_buf.u4_u_ht = pv_disp_op->s_disp_frm_buf.u4_y_ht
 1058|  88.0k|                        >> 1;
 1059|  88.0k|        pv_disp_op->s_disp_frm_buf.u4_v_ht = pv_disp_op->s_disp_frm_buf.u4_y_ht
 1060|  88.0k|                        >> 1;
 1061|  88.0k|        if(0 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1061:12): [True: 88.0k, False: 0]
  ------------------
 1062|  88.0k|        {
 1063|  88.0k|            pv_disp_op->s_disp_frm_buf.u4_y_strd =
 1064|  88.0k|                            pv_disp_op->s_disp_frm_buf.u4_y_wd;
 1065|  88.0k|            pv_disp_op->s_disp_frm_buf.u4_u_strd =
 1066|  88.0k|                            pv_disp_op->s_disp_frm_buf.u4_y_wd >> 1;
 1067|  88.0k|            pv_disp_op->s_disp_frm_buf.u4_v_strd =
 1068|  88.0k|                            pv_disp_op->s_disp_frm_buf.u4_y_wd >> 1;
 1069|       |
 1070|  88.0k|        }
 1071|      0|        else
 1072|      0|        {
 1073|      0|            pv_disp_op->s_disp_frm_buf.u4_y_strd = ps_op_frm->u4_y_strd;
 1074|      0|        }
 1075|       |
 1076|  88.0k|        if(ps_dec->u4_app_disp_width)
  ------------------
  |  Branch (1076:12): [True: 0, False: 88.0k]
  ------------------
 1077|      0|        {
 1078|      0|            pv_disp_op->s_disp_frm_buf.u4_y_strd = MAX(
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1079|      0|                            ps_dec->u4_app_disp_width,
 1080|      0|                            pv_disp_op->s_disp_frm_buf.u4_y_strd);
 1081|      0|        }
 1082|       |
 1083|  88.0k|        pv_disp_op->u4_error_code = 0;
 1084|  88.0k|        if(pv_disp_op->e_output_format == IV_YUV_420P)
  ------------------
  |  Branch (1084:12): [True: 47.4k, False: 40.5k]
  ------------------
 1085|  47.4k|        {
 1086|  47.4k|            UWORD32 i;
 1087|  47.4k|            pv_disp_op->s_disp_frm_buf.u4_u_strd =
 1088|  47.4k|                            pv_disp_op->s_disp_frm_buf.u4_y_strd >> 1;
 1089|  47.4k|            pv_disp_op->s_disp_frm_buf.u4_v_strd =
 1090|  47.4k|                            pv_disp_op->s_disp_frm_buf.u4_y_strd >> 1;
 1091|       |
 1092|  47.4k|            pv_disp_op->s_disp_frm_buf.u4_u_wd = ps_op_frm->u4_y_wd >> 1;
 1093|  47.4k|            pv_disp_op->s_disp_frm_buf.u4_v_wd = ps_op_frm->u4_y_wd >> 1;
 1094|       |
 1095|  47.4k|            if(1 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1095:16): [True: 0, False: 47.4k]
  ------------------
 1096|      0|            {
 1097|      0|                pv_disp_op->s_disp_frm_buf.pv_y_buf = ps_op_frm->pv_y_buf;
 1098|       |
 1099|      0|                for(i = 0; i < MAX_DISP_BUFS_NEW; i++)
  ------------------
  |  |   76|      0|#define MAX_DISP_BUFS_NEW 64
  ------------------
  |  Branch (1099:28): [True: 0, False: 0]
  ------------------
 1100|      0|                {
 1101|      0|                    UWORD8 *buf = ps_dec->disp_bufs[i].buf[0];
 1102|      0|                    buf += ps_dec->disp_bufs[i].u4_ofst[0];
 1103|      0|                    if(((UWORD8 *)pv_disp_op->s_disp_frm_buf.pv_y_buf
  ------------------
  |  Branch (1103:24): [True: 0, False: 0]
  ------------------
 1104|      0|                                    - pic_buf->u2_crop_offset_y) == buf)
 1105|      0|                    {
 1106|      0|                        buf = ps_dec->disp_bufs[i].buf[1];
 1107|      0|                        buf += ps_dec->disp_bufs[i].u4_ofst[1];
 1108|      0|                        pv_disp_op->s_disp_frm_buf.pv_u_buf = buf
 1109|      0|                                        + (pic_buf->u2_crop_offset_uv
 1110|      0|                                           / YUV420SP_FACTOR);
  ------------------
  |  |  119|      0|#define YUV420SP_FACTOR 2
  ------------------
 1111|       |
 1112|      0|                        buf = ps_dec->disp_bufs[i].buf[2];
 1113|      0|                        buf += ps_dec->disp_bufs[i].u4_ofst[2];
 1114|      0|                        pv_disp_op->s_disp_frm_buf.pv_v_buf = buf
 1115|      0|                                        + (pic_buf->u2_crop_offset_uv
 1116|      0|                                           / YUV420SP_FACTOR);
  ------------------
  |  |  119|      0|#define YUV420SP_FACTOR 2
  ------------------
 1117|       |
 1118|      0|                    }
 1119|      0|                }
 1120|      0|            }
 1121|       |
 1122|  47.4k|        }
 1123|  40.5k|        else if((pv_disp_op->e_output_format == IV_YUV_420SP_UV)
  ------------------
  |  Branch (1123:17): [True: 25.9k, False: 14.5k]
  ------------------
 1124|  14.5k|                        || (pv_disp_op->e_output_format == IV_YUV_420SP_VU))
  ------------------
  |  Branch (1124:28): [True: 14.5k, False: 0]
  ------------------
 1125|  40.5k|        {
 1126|  40.5k|            pv_disp_op->s_disp_frm_buf.u4_u_strd =
 1127|  40.5k|                            pv_disp_op->s_disp_frm_buf.u4_y_strd;
 1128|  40.5k|            pv_disp_op->s_disp_frm_buf.u4_v_strd = 0;
 1129|       |
 1130|  40.5k|            if(1 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1130:16): [True: 0, False: 40.5k]
  ------------------
 1131|      0|            {
 1132|      0|                UWORD32 i;
 1133|       |
 1134|      0|                pv_disp_op->s_disp_frm_buf.pv_y_buf = ps_op_frm->pv_y_buf;
 1135|       |
 1136|      0|                for(i = 0; i < MAX_DISP_BUFS_NEW; i++)
  ------------------
  |  |   76|      0|#define MAX_DISP_BUFS_NEW 64
  ------------------
  |  Branch (1136:28): [True: 0, False: 0]
  ------------------
 1137|      0|                {
 1138|      0|                    UWORD8 *buf = ps_dec->disp_bufs[i].buf[0];
 1139|      0|                    buf += ps_dec->disp_bufs[i].u4_ofst[0];
 1140|      0|                    if((UWORD8 *)pv_disp_op->s_disp_frm_buf.pv_y_buf
  ------------------
  |  Branch (1140:24): [True: 0, False: 0]
  ------------------
 1141|      0|                                    - pic_buf->u2_crop_offset_y == buf)
 1142|      0|                    {
 1143|      0|                        buf = ps_dec->disp_bufs[i].buf[1];
 1144|      0|                        buf += ps_dec->disp_bufs[i].u4_ofst[1];
 1145|      0|                        pv_disp_op->s_disp_frm_buf.pv_u_buf = buf
 1146|      0|                                        + pic_buf->u2_crop_offset_uv;
 1147|      0|                        ;
 1148|       |
 1149|      0|                        buf = ps_dec->disp_bufs[i].buf[2];
 1150|      0|                        buf += ps_dec->disp_bufs[i].u4_ofst[2];
 1151|      0|                        pv_disp_op->s_disp_frm_buf.pv_v_buf = buf
 1152|      0|                                        + pic_buf->u2_crop_offset_uv;
 1153|      0|                        ;
 1154|      0|                    }
 1155|      0|                }
 1156|      0|            }
 1157|  40.5k|            pv_disp_op->s_disp_frm_buf.u4_u_wd =
 1158|  40.5k|                            pv_disp_op->s_disp_frm_buf.u4_y_wd;
 1159|  40.5k|            pv_disp_op->s_disp_frm_buf.u4_v_wd = 0;
 1160|       |
 1161|  40.5k|        }
 1162|      0|        else if((pv_disp_op->e_output_format == IV_RGB_565)
  ------------------
  |  Branch (1162:17): [True: 0, False: 0]
  ------------------
 1163|      0|                        || (pv_disp_op->e_output_format == IV_YUV_422ILE))
  ------------------
  |  Branch (1163:28): [True: 0, False: 0]
  ------------------
 1164|      0|        {
 1165|       |
 1166|      0|            pv_disp_op->s_disp_frm_buf.u4_u_strd = 0;
 1167|      0|            pv_disp_op->s_disp_frm_buf.u4_v_strd = 0;
 1168|      0|            pv_disp_op->s_disp_frm_buf.u4_u_wd = 0;
 1169|      0|            pv_disp_op->s_disp_frm_buf.u4_v_wd = 0;
 1170|      0|            pv_disp_op->s_disp_frm_buf.u4_u_ht = 0;
 1171|      0|            pv_disp_op->s_disp_frm_buf.u4_v_ht = 0;
 1172|       |
 1173|      0|        }
 1174|       |
 1175|       |
 1176|  88.0k|    }
 1177|       |
 1178|   188k|    return u4_api_ret;
 1179|   188k|}
ih264d_release_display_field:
 1203|   129k|{
 1204|   129k|    if(1 == pv_disp_op->u4_error_code)
  ------------------
  |  Branch (1204:8): [True: 77.8k, False: 51.7k]
  ------------------
 1205|  77.8k|    {
 1206|  77.8k|        if(1 == ps_dec->u1_flushfrm)
  ------------------
  |  Branch (1206:12): [True: 0, False: 77.8k]
  ------------------
 1207|      0|        {
 1208|      0|            UWORD32 i;
 1209|       |
 1210|      0|            if(1 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1210:16): [True: 0, False: 0]
  ------------------
 1211|      0|            {
 1212|      0|                H264_MUTEX_LOCK(&ps_dec->process_disp_mutex);
 1213|      0|                for(i = 0; i < (MAX_DISP_BUFS_NEW); i++)
  ------------------
  |  |   76|      0|#define MAX_DISP_BUFS_NEW 64
  ------------------
  |  Branch (1213:28): [True: 0, False: 0]
  ------------------
 1214|      0|                {
 1215|      0|                    if(1 == ps_dec->u4_disp_buf_mapping[i])
  ------------------
  |  Branch (1215:24): [True: 0, False: 0]
  ------------------
 1216|      0|                    {
 1217|      0|                        ih264_buf_mgr_release(
 1218|      0|                                        (buf_mgr_t *)ps_dec->pv_pic_buf_mgr, i,
 1219|      0|                                        BUF_MGR_IO);
  ------------------
  |  |   53|      0|#define BUF_MGR_IO           (1 << 3)
  ------------------
 1220|      0|                        ps_dec->u4_disp_buf_mapping[i] = 0;
 1221|      0|                    }
 1222|      0|                } H264_MUTEX_UNLOCK(&ps_dec->process_disp_mutex);
 1223|       |
 1224|      0|                memset(ps_dec->u4_disp_buf_to_be_freed, 0,
 1225|      0|                       (MAX_DISP_BUFS_NEW) * sizeof(UWORD32));
  ------------------
  |  |   76|      0|#define MAX_DISP_BUFS_NEW 64
  ------------------
 1226|      0|                for(i = 0; i < ps_dec->u1_pic_bufs; i++)
  ------------------
  |  Branch (1226:28): [True: 0, False: 0]
  ------------------
 1227|      0|                    ps_dec->u4_disp_buf_mapping[i] = 1;
 1228|      0|            }
 1229|      0|            ps_dec->u1_flushfrm = 0;
 1230|       |
 1231|      0|        }
 1232|  77.8k|    }
 1233|  51.7k|    else
 1234|  51.7k|    {
 1235|  51.7k|        H264_MUTEX_LOCK(&ps_dec->process_disp_mutex);
 1236|       |
 1237|  51.7k|        if(0 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1237:12): [True: 51.7k, False: 0]
  ------------------
 1238|  51.7k|        {
 1239|  51.7k|            ih264_buf_mgr_release((buf_mgr_t *)ps_dec->pv_pic_buf_mgr,
 1240|  51.7k|                                  pv_disp_op->u4_disp_buf_id,
 1241|  51.7k|                                  BUF_MGR_IO);
  ------------------
  |  |   53|  51.7k|#define BUF_MGR_IO           (1 << 3)
  ------------------
 1242|       |
 1243|  51.7k|        }
 1244|      0|        else
 1245|      0|        {
 1246|      0|            ps_dec->u4_disp_buf_mapping[pv_disp_op->u4_disp_buf_id] = 1;
 1247|      0|        } H264_MUTEX_UNLOCK(&ps_dec->process_disp_mutex);
 1248|       |
 1249|  51.7k|    }
 1250|   129k|}
ih264d_assign_display_seq:
 1274|   129k|{
 1275|   129k|    WORD32 i;
 1276|   129k|    WORD32 i4_min_poc;
 1277|   129k|    WORD32 i4_min_poc_buf_id;
 1278|   129k|    WORD32 i4_min_index;
 1279|   129k|    dpb_manager_t *ps_dpb_mgr = ps_dec->ps_dpb_mgr;
 1280|   129k|    WORD32 (*i4_poc_buf_id_map)[3] = ps_dpb_mgr->ai4_poc_buf_id_map;
 1281|       |
 1282|   129k|    i4_min_poc = 0x7fffffff;
 1283|   129k|    i4_min_poc_buf_id = -1;
 1284|   129k|    i4_min_index = -1;
 1285|       |
 1286|   129k|    if(ps_dpb_mgr->i1_poc_buf_id_entries >= ps_dec->i4_display_delay)
  ------------------
  |  Branch (1286:8): [True: 2.80k, False: 126k]
  ------------------
 1287|  2.80k|    {
 1288|  47.7k|        for(i = 0; i < MAX_FRAMES; i++)
  ------------------
  |  |  600|  47.7k|#define MAX_FRAMES              16
  ------------------
  |  Branch (1288:20): [True: 44.9k, False: 2.80k]
  ------------------
 1289|  44.9k|        {
 1290|  44.9k|            if((i4_poc_buf_id_map[i][0] != -1)
  ------------------
  |  Branch (1290:16): [True: 40.1k, False: 4.79k]
  ------------------
 1291|  40.1k|                            && (DO_NOT_DISP
  ------------------
  |  |  602|  40.1k|#define DO_NOT_DISP             254
  ------------------
  |  Branch (1291:32): [True: 40.1k, False: 0]
  ------------------
 1292|  40.1k|                                            != ps_dpb_mgr->ai4_poc_buf_id_map[i][0]))
 1293|  40.1k|            {
 1294|       |                /* Checking for <= is necessary to handle cases where there is one
 1295|       |                   valid buffer with poc set to 0x7FFFFFFF. */
 1296|  40.1k|                if(i4_poc_buf_id_map[i][1] <= i4_min_poc)
  ------------------
  |  Branch (1296:20): [True: 16.6k, False: 23.4k]
  ------------------
 1297|  16.6k|                {
 1298|  16.6k|                    i4_min_poc = i4_poc_buf_id_map[i][1];
 1299|  16.6k|                    i4_min_poc_buf_id = i4_poc_buf_id_map[i][0];
 1300|  16.6k|                    i4_min_index = i;
 1301|  16.6k|                }
 1302|  40.1k|            }
 1303|  44.9k|        }
 1304|       |
 1305|  2.80k|        if((i4_min_index != -1) && (DO_NOT_DISP != i4_min_poc_buf_id))
  ------------------
  |  |  602|  2.80k|#define DO_NOT_DISP             254
  ------------------
  |  Branch (1305:12): [True: 2.80k, False: 0]
  |  Branch (1305:36): [True: 2.80k, False: 0]
  ------------------
 1306|  2.80k|        {
 1307|  2.80k|            ps_dec->i4_cur_display_seq++;
 1308|  2.80k|            ih264_disp_mgr_add(
 1309|  2.80k|                            (disp_mgr_t *)ps_dec->pv_disp_buf_mgr,
 1310|  2.80k|                            i4_min_poc_buf_id, ps_dec->i4_cur_display_seq,
 1311|  2.80k|                            ps_dec->apv_buf_id_pic_buf_map[i4_min_poc_buf_id]);
 1312|  2.80k|            i4_poc_buf_id_map[i4_min_index][0] = -1;
 1313|  2.80k|            i4_poc_buf_id_map[i4_min_index][1] = 0x7fffffff;
 1314|  2.80k|            ps_dpb_mgr->i1_poc_buf_id_entries--;
 1315|  2.80k|        }
 1316|      0|        else if(DO_NOT_DISP == i4_min_poc_buf_id)
  ------------------
  |  |  602|      0|#define DO_NOT_DISP             254
  ------------------
  |  Branch (1316:17): [True: 0, False: 0]
  ------------------
 1317|      0|        {
 1318|      0|            WORD32 i4_error_code;
 1319|      0|            i4_error_code = ERROR_GAPS_IN_FRM_NUM;
 1320|       |//          i4_error_code |= 1<<IVD_CORRUPTEDDATA;
 1321|      0|            return i4_error_code;
 1322|      0|        }
 1323|  2.80k|    }
 1324|   129k|    return OK;
  ------------------
  |  |  114|   129k|#define OK        0
  ------------------
 1325|   129k|}
ih264d_release_display_bufs:
 1350|   109k|{
 1351|   109k|    WORD32 i, j;
 1352|   109k|    WORD32 i4_min_poc;
 1353|   109k|    WORD32 i4_min_poc_buf_id;
 1354|   109k|    WORD32 i4_min_index;
 1355|   109k|    WORD64 i8_temp;
 1356|   109k|    dpb_manager_t *ps_dpb_mgr = ps_dec->ps_dpb_mgr;
 1357|   109k|    WORD32 (*i4_poc_buf_id_map)[3] = ps_dpb_mgr->ai4_poc_buf_id_map;
 1358|       |
 1359|   109k|    i4_min_poc = 0x7fffffff;
 1360|   109k|    i4_min_poc_buf_id = 0;
 1361|   109k|    i4_min_index = 0;
 1362|       |
 1363|   109k|    ih264d_delete_nonref_nondisplay_pics(ps_dpb_mgr);
 1364|       |
 1365|   204k|    for(j = 0; j < ps_dpb_mgr->i1_poc_buf_id_entries; j++)
  ------------------
  |  Branch (1365:16): [True: 94.5k, False: 109k]
  ------------------
 1366|  94.5k|    {
 1367|  94.5k|        i4_min_poc = 0x7fffffff;
 1368|  1.60M|        for(i = 0; i < MAX_FRAMES; i++)
  ------------------
  |  |  600|  1.60M|#define MAX_FRAMES              16
  ------------------
  |  Branch (1368:20): [True: 1.51M, False: 94.5k]
  ------------------
 1369|  1.51M|        {
 1370|  1.51M|            if(i4_poc_buf_id_map[i][0] != -1)
  ------------------
  |  Branch (1370:16): [True: 120k, False: 1.39M]
  ------------------
 1371|   120k|            {
 1372|       |                /* Checking for <= is necessary to handle cases where there is one
 1373|       |                   valid buffer with poc set to 0x7FFFFFFF. */
 1374|   120k|                if(i4_poc_buf_id_map[i][1] <= i4_min_poc)
  ------------------
  |  Branch (1374:20): [True: 103k, False: 16.9k]
  ------------------
 1375|   103k|                {
 1376|   103k|                    i4_min_poc = i4_poc_buf_id_map[i][1];
 1377|   103k|                    i4_min_poc_buf_id = i4_poc_buf_id_map[i][0];
 1378|   103k|                    i4_min_index = i;
 1379|   103k|                }
 1380|   120k|            }
 1381|  1.51M|        }
 1382|       |
 1383|  94.5k|        if(DO_NOT_DISP != i4_min_poc_buf_id)
  ------------------
  |  |  602|  94.5k|#define DO_NOT_DISP             254
  ------------------
  |  Branch (1383:12): [True: 94.5k, False: 0]
  ------------------
 1384|  94.5k|        {
 1385|  94.5k|            ps_dec->i4_cur_display_seq++;
 1386|  94.5k|            ih264_disp_mgr_add(
 1387|  94.5k|                            (disp_mgr_t *)ps_dec->pv_disp_buf_mgr,
 1388|  94.5k|                            i4_min_poc_buf_id, ps_dec->i4_cur_display_seq,
 1389|  94.5k|                            ps_dec->apv_buf_id_pic_buf_map[i4_min_poc_buf_id]);
 1390|  94.5k|            i4_poc_buf_id_map[i4_min_index][0] = -1;
 1391|  94.5k|            i4_poc_buf_id_map[i4_min_index][1] = 0x7fffffff;
 1392|  94.5k|            ps_dpb_mgr->ai4_poc_buf_id_map[i4_min_index][2] = 0;
 1393|  94.5k|        }
 1394|      0|        else
 1395|      0|        {
 1396|      0|            i4_poc_buf_id_map[i4_min_index][0] = -1;
 1397|      0|            i4_poc_buf_id_map[i4_min_index][1] = 0x7fffffff;
 1398|      0|            ps_dpb_mgr->ai4_poc_buf_id_map[i4_min_index][2] = 0;
 1399|      0|        }
 1400|  94.5k|    }
 1401|   109k|    ps_dpb_mgr->i1_poc_buf_id_entries = 0;
 1402|   109k|    i8_temp = (WORD64)ps_dec->i4_prev_max_display_seq + ps_dec->i4_max_poc
 1403|   109k|              + ps_dec->u1_max_dec_frame_buffering + 1;
 1404|       |    /*If i4_prev_max_display_seq overflows integer range, reset it */
 1405|   109k|    ps_dec->i4_prev_max_display_seq = IS_OUT_OF_RANGE_S32(i8_temp)?
  ------------------
  |  |   58|   109k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 109k]
  |  |  |  Branch (58:54): [True: 221, False: 109k]
  |  |  ------------------
  ------------------
 1406|   109k|                                      0 : i8_temp;
 1407|   109k|    ps_dec->i4_max_poc = 0;
 1408|   109k|}
ih264d_assign_pic_num:
 1440|   137k|{
 1441|   137k|    dpb_manager_t *ps_dpb_mgr;
 1442|   137k|    struct dpb_info_t *ps_next_dpb;
 1443|   137k|    WORD8 i;
 1444|   137k|    WORD32 i4_cur_frame_num, i4_max_frame_num;
 1445|   137k|    WORD32 i4_ref_frame_num;
 1446|   137k|    UWORD8 u1_fld_pic_flag = ps_dec->ps_cur_slice->u1_field_pic_flag;
 1447|       |
 1448|   137k|    i4_max_frame_num = ps_dec->ps_cur_sps->u2_u4_max_pic_num_minus1 + 1;
 1449|   137k|    i4_cur_frame_num = ps_dec->ps_cur_pic->i4_frame_num;
 1450|   137k|    ps_dpb_mgr = ps_dec->ps_dpb_mgr;
 1451|       |
 1452|       |    /* Start from ST head */
 1453|   137k|    ps_next_dpb = ps_dpb_mgr->ps_dpb_st_head;
 1454|   241k|    for(i = 0; i < ps_dpb_mgr->u1_num_st_ref_bufs; i++)
  ------------------
  |  Branch (1454:16): [True: 103k, False: 137k]
  ------------------
 1455|   103k|    {
 1456|   103k|        WORD32 i4_pic_num;
 1457|       |
 1458|   103k|        i4_ref_frame_num = ps_next_dpb->ps_pic_buf->i4_frame_num;
 1459|   103k|        if(i4_ref_frame_num > i4_cur_frame_num)
  ------------------
  |  Branch (1459:12): [True: 27.3k, False: 76.5k]
  ------------------
 1460|  27.3k|        {
 1461|       |            /* RefPic Buf frame_num is before Current frame_num in decode order */
 1462|  27.3k|            i4_pic_num = i4_ref_frame_num - i4_max_frame_num;
 1463|  27.3k|        }
 1464|  76.5k|        else
 1465|  76.5k|        {
 1466|       |            /* RefPic Buf frame_num is after Current frame_num in decode order */
 1467|  76.5k|            i4_pic_num = i4_ref_frame_num;
 1468|  76.5k|        }
 1469|       |
 1470|   103k|        ps_next_dpb->ps_pic_buf->i4_pic_num = i4_pic_num;
 1471|   103k|        ps_next_dpb->i4_frame_num = i4_pic_num;
 1472|   103k|        ps_next_dpb->ps_pic_buf->u1_long_term_frm_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|   103k|#define MAX_REF_BUFS    32
  ------------------
 1473|   103k|        if(u1_fld_pic_flag)
  ------------------
  |  Branch (1473:12): [True: 0, False: 103k]
  ------------------
 1474|      0|        {
 1475|       |            /* Assign the pic num to top fields and bot fields */
 1476|       |
 1477|      0|            ps_next_dpb->s_top_field.i4_pic_num = i4_pic_num * 2
 1478|      0|                            + !(ps_dec->ps_cur_slice->u1_bottom_field_flag);
 1479|      0|            ps_next_dpb->s_bot_field.i4_pic_num = i4_pic_num * 2
 1480|      0|                            + ps_dec->ps_cur_slice->u1_bottom_field_flag;
 1481|      0|        }
 1482|       |        /* Chase the next link */
 1483|   103k|        ps_next_dpb = ps_next_dpb->ps_prev_short;
 1484|   103k|    }
 1485|       |
 1486|   137k|    if(ps_dec->ps_cur_sps->u1_gaps_in_frame_num_value_allowed_flag
  ------------------
  |  Branch (1486:8): [True: 0, False: 137k]
  ------------------
 1487|      0|                    && ps_dpb_mgr->u1_num_gaps)
  ------------------
  |  Branch (1487:24): [True: 0, False: 0]
  ------------------
 1488|      0|    {
 1489|      0|        WORD32 i4_start_frm, i4_end_frm;
 1490|       |        /* Assign pic numbers for gaps */
 1491|      0|        for(i = 0; i < MAX_FRAMES; i++)
  ------------------
  |  |  600|      0|#define MAX_FRAMES              16
  ------------------
  |  Branch (1491:20): [True: 0, False: 0]
  ------------------
 1492|      0|        {
 1493|      0|            i4_start_frm = ps_dpb_mgr->ai4_gaps_start_frm_num[i];
 1494|      0|            if(i4_start_frm != INVALID_FRAME_NUM)
  ------------------
  |  |  601|      0|#define INVALID_FRAME_NUM       0x0fffffff
  ------------------
  |  Branch (1494:16): [True: 0, False: 0]
  ------------------
 1495|      0|            {
 1496|      0|                if(i4_start_frm > i4_cur_frame_num)
  ------------------
  |  Branch (1496:20): [True: 0, False: 0]
  ------------------
 1497|      0|                {
 1498|       |                    /* gap's frame_num is before Current frame_num in
 1499|       |                     decode order */
 1500|      0|                    i4_start_frm -= i4_max_frame_num;
 1501|      0|                }
 1502|      0|                ps_dpb_mgr->ai4_gaps_start_frm_num[i] = i4_start_frm;
 1503|      0|                i4_end_frm = ps_dpb_mgr->ai4_gaps_end_frm_num[i];
 1504|       |
 1505|      0|                if(i4_end_frm > i4_cur_frame_num)
  ------------------
  |  Branch (1505:20): [True: 0, False: 0]
  ------------------
 1506|      0|                {
 1507|       |                    /* gap's frame_num is before Current frame_num in
 1508|       |                     decode order */
 1509|      0|                    i4_end_frm -= i4_max_frame_num;
 1510|      0|                }
 1511|      0|                ps_dpb_mgr->ai4_gaps_end_frm_num[i] = i4_end_frm;
 1512|      0|            }
 1513|      0|        }
 1514|      0|    }
 1515|   137k|}
ih264d_update_qp:
 1530|   284k|{
 1531|   284k|    WORD32 i_temp;
 1532|   284k|    i_temp = (ps_dec->u1_qp + i1_qp + 52) % 52;
 1533|       |
 1534|   284k|    if((i_temp < 0) || (i_temp > 51) || (i1_qp < -26) || (i1_qp > 25))
  ------------------
  |  Branch (1534:8): [True: 0, False: 284k]
  |  Branch (1534:24): [True: 0, False: 284k]
  |  Branch (1534:41): [True: 0, False: 284k]
  |  Branch (1534:58): [True: 0, False: 284k]
  ------------------
 1535|      0|        return ERROR_INV_RANGE_QP_T;
 1536|       |
 1537|   284k|    ps_dec->u1_qp = i_temp;
 1538|   284k|    ps_dec->u1_qp_y_rem6 = ps_dec->u1_qp % 6;
 1539|   284k|    ps_dec->u1_qp_y_div6 = ps_dec->u1_qp / 6;
 1540|   284k|    i_temp = CLIP3(0, 51, ps_dec->u1_qp + ps_dec->ps_cur_pps->i1_chroma_qp_index_offset);
  ------------------
  |  |   77|   284k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 4.25k, False: 280k]
  |  |  |  Branch (77:54): [True: 697, False: 279k]
  |  |  ------------------
  ------------------
 1541|   284k|    ps_dec->u1_qp_u_rem6 = MOD(gau1_ih264d_qp_scale_cr[12 + i_temp], 6);
  ------------------
  |  |   64|   284k|#define MOD(x,y) ((x)%(y))
  ------------------
 1542|   284k|    ps_dec->u1_qp_u_div6 = DIV(gau1_ih264d_qp_scale_cr[12 + i_temp], 6);
  ------------------
  |  |   65|   284k|#define DIV(x,y) ((x)/(y))
  ------------------
 1543|       |
 1544|   284k|    i_temp = CLIP3(0, 51, ps_dec->u1_qp + ps_dec->ps_cur_pps->i1_second_chroma_qp_index_offset);
  ------------------
  |  |   77|   284k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 1.66k, False: 282k]
  |  |  |  Branch (77:54): [True: 6.28k, False: 276k]
  |  |  ------------------
  ------------------
 1545|   284k|    ps_dec->u1_qp_v_rem6 = MOD(gau1_ih264d_qp_scale_cr[12 + i_temp], 6);
  ------------------
  |  |   64|   284k|#define MOD(x,y) ((x)%(y))
  ------------------
 1546|   284k|    ps_dec->u1_qp_v_div6 = DIV(gau1_ih264d_qp_scale_cr[12 + i_temp], 6);
  ------------------
  |  |   65|   284k|#define DIV(x,y) ((x)/(y))
  ------------------
 1547|       |
 1548|   284k|    ps_dec->pu2_quant_scale_y =
 1549|   284k|                    gau2_ih264_iquant_scale_4x4[ps_dec->u1_qp_y_rem6];
 1550|   284k|    ps_dec->pu2_quant_scale_u =
 1551|   284k|                    gau2_ih264_iquant_scale_4x4[ps_dec->u1_qp_u_rem6];
 1552|   284k|    ps_dec->pu2_quant_scale_v =
 1553|   284k|                    gau2_ih264_iquant_scale_4x4[ps_dec->u1_qp_v_rem6];
 1554|   284k|    return OK;
  ------------------
  |  |  114|   284k|#define OK        0
  ------------------
 1555|   284k|}
ih264d_create_pic_buffers:
 1750|  23.6k|{
 1751|  23.6k|    struct pic_buffer_t *ps_pic_buf;
 1752|  23.6k|    UWORD8 i;
 1753|  23.6k|    UWORD32 u4_luma_size, u4_chroma_size;
 1754|  23.6k|    UWORD8 u1_frm = ps_dec->ps_cur_sps->u1_frame_mbs_only_flag;
 1755|  23.6k|    WORD32 j;
 1756|  23.6k|    UWORD8 *pu1_buf;
 1757|       |
 1758|  23.6k|    ps_pic_buf = ps_dec->ps_pic_buf_base;
 1759|  23.6k|    ih264_disp_mgr_init((disp_mgr_t *)ps_dec->pv_disp_buf_mgr);
 1760|  23.6k|    ih264_buf_mgr_init((buf_mgr_t *)ps_dec->pv_pic_buf_mgr);
 1761|  23.6k|    u4_luma_size = ps_dec->u2_frm_wd_y * ps_dec->u2_frm_ht_y;
 1762|  23.6k|    u4_chroma_size = ps_dec->u2_frm_wd_uv * ps_dec->u2_frm_ht_uv;
 1763|       |
 1764|  23.6k|    {
 1765|  23.6k|        if(ps_dec->u4_share_disp_buf == 1)
  ------------------
  |  Branch (1765:12): [True: 0, False: 23.6k]
  ------------------
 1766|      0|        {
 1767|       |            /* In case of buffers getting shared between application and library
 1768|       |             there is no need of reference memtabs. Instead of setting the i4_size
 1769|       |             to zero, it is reduced to a small i4_size to ensure that changes
 1770|       |             in the code are minimal */
 1771|      0|            if((ps_dec->u1_chroma_format == IV_YUV_420SP_UV)
  ------------------
  |  Branch (1771:16): [True: 0, False: 0]
  ------------------
 1772|      0|                            || (ps_dec->u1_chroma_format == IV_YUV_420SP_VU)
  ------------------
  |  Branch (1772:32): [True: 0, False: 0]
  ------------------
 1773|      0|                            || (ps_dec->u1_chroma_format == IV_YUV_420P))
  ------------------
  |  Branch (1773:32): [True: 0, False: 0]
  ------------------
 1774|      0|            {
 1775|      0|                u4_luma_size = 64;
 1776|      0|            }
 1777|       |
 1778|      0|            if(ps_dec->u1_chroma_format == IV_YUV_420SP_UV)
  ------------------
  |  Branch (1778:16): [True: 0, False: 0]
  ------------------
 1779|      0|            {
 1780|      0|                u4_chroma_size = 64;
 1781|      0|            }
 1782|       |
 1783|      0|        }
 1784|  23.6k|    }
 1785|       |
 1786|  23.6k|    pu1_buf = ps_dec->pu1_pic_buf_base;
 1787|       |
 1788|       |    /* Allocate memory for refernce buffers */
 1789|   429k|    for(i = 0; i < u1_num_of_buf; i++)
  ------------------
  |  Branch (1789:16): [True: 405k, False: 23.6k]
  ------------------
 1790|   405k|    {
 1791|   405k|        UWORD32 u4_offset;
 1792|   405k|        WORD32 buf_ret;
 1793|   405k|        UWORD8 *pu1_luma, *pu1_chroma;
 1794|   405k|        void *pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1795|       |
 1796|   405k|        pu1_luma = pu1_buf;
 1797|   405k|        pu1_buf += ALIGN64(u4_luma_size);
  ------------------
  |  |   48|   405k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1798|   405k|        pu1_chroma = pu1_buf;
 1799|   405k|        pu1_buf += ALIGN64(u4_chroma_size);
  ------------------
  |  |   48|   405k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 1800|       |
 1801|       |        /* Offset to the start of the pic from the top left corner of the frame
 1802|       |         buffer */
 1803|       |
 1804|   405k|        if((0 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1804:12): [True: 405k, False: 0]
  ------------------
 1805|      0|                        || (NULL == ps_dec->disp_bufs[i].buf[0]))
  ------------------
  |  Branch (1805:28): [True: 0, False: 0]
  ------------------
 1806|   405k|        {
 1807|   405k|            UWORD32 pad_len_h, pad_len_v;
 1808|       |
 1809|   405k|            u4_offset = ps_dec->u2_frm_wd_y * (PAD_LEN_Y_V << 1) + PAD_LEN_Y_H;
  ------------------
  |  |  572|   405k|#define PAD_LEN_Y_V                   20
  ------------------
                          u4_offset = ps_dec->u2_frm_wd_y * (PAD_LEN_Y_V << 1) + PAD_LEN_Y_H;
  ------------------
  |  |  571|   405k|#define PAD_LEN_Y_H                   32
  ------------------
 1810|   405k|            ps_pic_buf->pu1_buf1 = (UWORD8 *)(pu1_luma) + u4_offset;
 1811|       |
 1812|   405k|            pad_len_h = MAX(PAD_LEN_UV_H, (PAD_LEN_Y_H >> 1));
  ------------------
  |  |   60|   405k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [Folded, False: 405k]
  |  |  ------------------
  ------------------
 1813|   405k|            pad_len_v = MAX(PAD_LEN_UV_V, PAD_LEN_Y_V);
  ------------------
  |  |   60|   405k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [Folded, False: 405k]
  |  |  ------------------
  ------------------
 1814|       |
 1815|   405k|            u4_offset = ps_dec->u2_frm_wd_uv * pad_len_v + pad_len_h;
 1816|       |
 1817|   405k|            ps_pic_buf->pu1_buf2 = (UWORD8 *)(pu1_chroma) + u4_offset;
 1818|   405k|            ps_pic_buf->pu1_buf3 = (UWORD8 *)(NULL) + u4_offset;
 1819|       |
 1820|   405k|        }
 1821|      0|        else
 1822|      0|        {
 1823|      0|            UWORD32 pad_len_h, pad_len_v;
 1824|      0|            u4_offset = ps_dec->u2_frm_wd_y * (PAD_LEN_Y_V << 1) + PAD_LEN_Y_H;
  ------------------
  |  |  572|      0|#define PAD_LEN_Y_V                   20
  ------------------
                          u4_offset = ps_dec->u2_frm_wd_y * (PAD_LEN_Y_V << 1) + PAD_LEN_Y_H;
  ------------------
  |  |  571|      0|#define PAD_LEN_Y_H                   32
  ------------------
 1825|      0|            ps_pic_buf->pu1_buf1 = (UWORD8 *)ps_dec->disp_bufs[i].buf[0]
 1826|      0|                            + u4_offset;
 1827|       |
 1828|      0|            ps_dec->disp_bufs[i].u4_ofst[0] = u4_offset;
 1829|       |
 1830|      0|            if(ps_dec->u1_chroma_format == IV_YUV_420P)
  ------------------
  |  Branch (1830:16): [True: 0, False: 0]
  ------------------
 1831|      0|            {
 1832|      0|                pad_len_h = MAX(PAD_LEN_UV_H * YUV420SP_FACTOR,
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, Folded]
  |  |  ------------------
  ------------------
 1833|      0|                                (PAD_LEN_Y_H >> 1));
 1834|      0|                pad_len_v = MAX(PAD_LEN_UV_V, PAD_LEN_Y_V);
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1835|       |
 1836|      0|                u4_offset = ps_dec->u2_frm_wd_uv * pad_len_v + pad_len_h;
 1837|      0|                ps_pic_buf->pu1_buf2 = (UWORD8 *)(pu1_chroma) + u4_offset;
 1838|      0|                ps_pic_buf->pu1_buf3 = (UWORD8 *)(NULL) + u4_offset;
 1839|       |
 1840|      0|                ps_dec->disp_bufs[i].u4_ofst[1] = u4_offset;
 1841|      0|                ps_dec->disp_bufs[i].u4_ofst[2] = u4_offset;
 1842|       |
 1843|      0|            }
 1844|      0|            else
 1845|      0|            {
 1846|      0|                pad_len_h = MAX(PAD_LEN_UV_H * YUV420SP_FACTOR,
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, Folded]
  |  |  ------------------
  ------------------
 1847|      0|                                (PAD_LEN_Y_H >> 1));
 1848|      0|                pad_len_v = MAX(PAD_LEN_UV_V, PAD_LEN_Y_V);
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1849|       |
 1850|      0|                u4_offset = ps_dec->u2_frm_wd_uv * pad_len_v + pad_len_h;
 1851|      0|                ps_pic_buf->pu1_buf2 = (UWORD8 *)(ps_dec->disp_bufs[i].buf[1])
 1852|      0|                                + u4_offset;
 1853|      0|                ps_pic_buf->pu1_buf3 = (UWORD8 *)(ps_dec->disp_bufs[i].buf[1])
 1854|      0|                                + u4_offset;
 1855|       |
 1856|      0|                ps_dec->disp_bufs[i].u4_ofst[1] = u4_offset;
 1857|      0|                ps_dec->disp_bufs[i].u4_ofst[2] = u4_offset;
 1858|      0|            }
 1859|      0|        }
 1860|       |
 1861|   405k|        ps_pic_buf->u2_frm_ht_y = ps_dec->u2_frm_ht_y;
 1862|   405k|        ps_pic_buf->u2_frm_ht_uv = ps_dec->u2_frm_ht_uv;
 1863|   405k|        ps_pic_buf->u2_frm_wd_y = ps_dec->u2_frm_wd_y;
 1864|   405k|        ps_pic_buf->u2_frm_wd_uv = ps_dec->u2_frm_wd_uv;
 1865|       |
 1866|   405k|        ps_pic_buf->u1_pic_buf_id = i;
 1867|       |
 1868|   405k|        buf_ret = ih264_buf_mgr_add((buf_mgr_t *)ps_dec->pv_pic_buf_mgr,
 1869|   405k|                                    ps_pic_buf, i);
 1870|   405k|        if(0 != buf_ret)
  ------------------
  |  Branch (1870:12): [True: 0, False: 405k]
  ------------------
 1871|      0|        {
 1872|      0|            ps_dec->i4_error_code = ERROR_BUF_MGR;
 1873|      0|            return ERROR_BUF_MGR;
 1874|      0|        }
 1875|       |
 1876|   405k|        ps_dec->apv_buf_id_pic_buf_map[i] = (void *)ps_pic_buf;
 1877|   405k|        ps_pic_buf++;
 1878|   405k|    }
 1879|       |
 1880|  23.6k|    if(1 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1880:8): [True: 0, False: 23.6k]
  ------------------
 1881|      0|    {
 1882|      0|        for(i = 0; i < u1_num_of_buf; i++)
  ------------------
  |  Branch (1882:20): [True: 0, False: 0]
  ------------------
 1883|      0|            ps_dec->u4_disp_buf_mapping[i] = 1;
 1884|      0|    }
 1885|  23.6k|    return OK;
  ------------------
  |  |  114|  23.6k|#define OK        0
  ------------------
 1886|  23.6k|}
ih264d_allocate_dynamic_bufs:
 1903|  23.6k|{
 1904|  23.6k|    struct MemReq s_MemReq;
 1905|  23.6k|    struct MemBlock *p_MemBlock;
 1906|       |
 1907|  23.6k|    pred_info_t *ps_pred_frame;
 1908|  23.6k|    dec_mb_info_t *ps_frm_mb_info;
 1909|  23.6k|    dec_slice_struct_t *ps_dec_slice_buf;
 1910|  23.6k|    UWORD8 *pu1_dec_mb_map, *pu1_recon_mb_map;
 1911|  23.6k|    UWORD16 *pu2_slice_num_map;
 1912|       |
 1913|  23.6k|    WORD16 *pi16_res_coeff;
 1914|  23.6k|    WORD16 i16_status = 0;
 1915|  23.6k|    UWORD8 uc_frmOrFld = (1 - ps_dec->ps_cur_sps->u1_frame_mbs_only_flag);
 1916|  23.6k|    UWORD16 u4_luma_wd = ps_dec->u2_frm_wd_y;
 1917|  23.6k|    UWORD16 u4_chroma_wd = ps_dec->u2_frm_wd_uv;
 1918|  23.6k|    WORD8 c_i = 0;
 1919|  23.6k|    dec_seq_params_t *ps_sps = ps_dec->ps_cur_sps;
 1920|  23.6k|    UWORD32 u4_total_mbs = ps_sps->u4_total_num_of_mbs << uc_frmOrFld;
 1921|  23.6k|    UWORD32 u4_wd_mbs = ps_dec->u2_frm_wd_in_mbs;
 1922|  23.6k|    UWORD32 u4_ht_mbs = ps_dec->u2_frm_ht_in_mbs;
 1923|  23.6k|    UWORD32 u4_blk_wd;
 1924|  23.6k|    UWORD32 ui_size = 0;
 1925|  23.6k|    UWORD32 u4_int_scratch_size = 0, u4_ref_pred_size = 0;
 1926|  23.6k|    UWORD8 *pu1_buf;
 1927|  23.6k|    WORD32 num_entries;
 1928|  23.6k|    WORD32 size;
 1929|  23.6k|    void *pv_buf;
 1930|  23.6k|    UWORD32 u4_num_bufs;
 1931|  23.6k|    UWORD32 u4_luma_size, u4_chroma_size;
 1932|  23.6k|    void *pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1933|       |
 1934|       |    /* Free any dynamic buffers that are allocated earlier. As ps_dec is memset to zero  */
 1935|       |    /* at the beginning, it is safe to call this even if no memory was allocated earlier */
 1936|  23.6k|    ih264d_free_dynamic_bufs(ps_dec);
 1937|       |
 1938|  23.6k|    size = u4_total_mbs;
 1939|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1940|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 1941|  23.6k|    memset(pv_buf, 0, size);
 1942|  23.6k|    ps_dec->pu1_dec_mb_map = pv_buf;
 1943|       |
 1944|  23.6k|    size = u4_total_mbs;
 1945|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1946|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 1947|  23.6k|    memset(pv_buf, 0, size);
 1948|  23.6k|    ps_dec->pu1_recon_mb_map = pv_buf;
 1949|       |
 1950|  23.6k|    size = u4_total_mbs * sizeof(UWORD16);
 1951|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1952|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 1953|  23.6k|    memset(pv_buf, 0, size);
 1954|  23.6k|    ps_dec->pu2_slice_num_map = pv_buf;
 1955|       |
 1956|       |    /************************************************************/
 1957|       |    /* Post allocation Initialisations                          */
 1958|       |    /************************************************************/
 1959|  23.6k|    ps_dec->ps_parse_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
 1960|  23.6k|    ps_dec->ps_decode_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
 1961|  23.6k|    ps_dec->ps_computebs_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
 1962|       |
 1963|  23.6k|    ps_dec->ps_pred_start = ps_dec->ps_pred;
 1964|       |
 1965|  23.6k|    size = sizeof(parse_pmbarams_t) * (ps_dec->u4_recon_mb_grp);
 1966|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1967|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 1968|  23.6k|    memset(pv_buf, 0, size);
 1969|  23.6k|    ps_dec->ps_parse_mb_data = pv_buf;
 1970|       |
 1971|  23.6k|    size = sizeof(parse_part_params_t)
 1972|  23.6k|                        * ((ps_dec->u4_recon_mb_grp) << 4);
 1973|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1974|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 1975|  23.6k|    memset(pv_buf, 0, size);
 1976|  23.6k|    ps_dec->ps_parse_part_params = pv_buf;
 1977|       |
 1978|  23.6k|    size = ((u4_wd_mbs * sizeof(deblkmb_neighbour_t)) << uc_frmOrFld);
 1979|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1980|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 1981|  23.6k|    memset(pv_buf, 0, size);
 1982|  23.6k|    ps_dec->ps_deblk_top_mb = pv_buf;
 1983|       |
 1984|  23.6k|    size = ((sizeof(ctxt_inc_mb_info_t))
 1985|  23.6k|                        * (((u4_wd_mbs + 1) << uc_frmOrFld) + 1));
 1986|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1987|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 1988|  23.6k|    memset(pv_buf, 0, size);
 1989|  23.6k|    ps_dec->p_ctxt_inc_mb_map = pv_buf;
 1990|       |
 1991|       |    /* 0th entry of CtxtIncMbMap will be always be containing default values
 1992|       |     for CABAC context representing MB not available */
 1993|  23.6k|    ps_dec->p_ctxt_inc_mb_map += 1;
 1994|       |
 1995|  23.6k|    size = (sizeof(mv_pred_t) * ps_dec->u4_recon_mb_grp
 1996|  23.6k|                        * 16);
 1997|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1998|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 1999|  23.6k|    memset(pv_buf, 0, size);
 2000|  23.6k|    ps_dec->ps_mv_p[0] = pv_buf;
 2001|       |
 2002|  23.6k|    size = (sizeof(mv_pred_t) * ps_dec->u4_recon_mb_grp
 2003|  23.6k|                        * 16);
 2004|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2005|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 2006|  23.6k|    memset(pv_buf, 0, size);
 2007|  23.6k|    ps_dec->ps_mv_p[1] = pv_buf;
 2008|       |
 2009|  23.6k|    {
 2010|  23.6k|        UWORD8 i;
 2011|   118k|        for(i = 0; i < MV_SCRATCH_BUFS; i++)
  ------------------
  |  |   62|   118k|#define MV_SCRATCH_BUFS             4
  ------------------
  |  Branch (2011:20): [True: 94.5k, False: 23.6k]
  ------------------
 2012|  94.5k|        {
 2013|  94.5k|            size = (sizeof(mv_pred_t)
 2014|  94.5k|                            * ps_dec->u4_recon_mb_grp * 4);
 2015|  94.5k|            pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2016|  94.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  94.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 94.5k]
  |  |  ------------------
  ------------------
 2017|  94.5k|            memset(pv_buf, 0, size);
 2018|  94.5k|            ps_dec->ps_mv_top_p[i] = pv_buf;
 2019|  94.5k|        }
 2020|  23.6k|    }
 2021|       |
 2022|  23.6k|    size = sizeof(UWORD8) * ((u4_wd_mbs + 2) * MB_SIZE) * 2;
  ------------------
  |  |  554|  23.6k|#define MB_SIZE             16
  ------------------
 2023|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2024|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 2025|  23.6k|    ps_dec->pu1_y_intra_pred_line = pv_buf;
 2026|  23.6k|    memset(ps_dec->pu1_y_intra_pred_line, 0, size);
 2027|  23.6k|    ps_dec->pu1_y_intra_pred_line += MB_SIZE;
  ------------------
  |  |  554|  23.6k|#define MB_SIZE             16
  ------------------
 2028|       |
 2029|  23.6k|    size = sizeof(UWORD8) * ((u4_wd_mbs + 2) * MB_SIZE) * 2;
  ------------------
  |  |  554|  23.6k|#define MB_SIZE             16
  ------------------
 2030|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2031|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 2032|  23.6k|    ps_dec->pu1_u_intra_pred_line = pv_buf;
 2033|  23.6k|    memset(ps_dec->pu1_u_intra_pred_line, 0, size);
 2034|  23.6k|    ps_dec->pu1_u_intra_pred_line += MB_SIZE;
  ------------------
  |  |  554|  23.6k|#define MB_SIZE             16
  ------------------
 2035|       |
 2036|  23.6k|    size = sizeof(UWORD8) * ((u4_wd_mbs + 2) * MB_SIZE) * 2;
  ------------------
  |  |  554|  23.6k|#define MB_SIZE             16
  ------------------
 2037|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2038|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 2039|  23.6k|    ps_dec->pu1_v_intra_pred_line = pv_buf;
 2040|  23.6k|    memset(ps_dec->pu1_v_intra_pred_line, 0, size);
 2041|  23.6k|    ps_dec->pu1_v_intra_pred_line += MB_SIZE;
  ------------------
  |  |  554|  23.6k|#define MB_SIZE             16
  ------------------
 2042|       |
 2043|  23.6k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2043:8): [True: 7.78k, False: 15.8k]
  ------------------
 2044|  7.78k|    {
 2045|       |        /* Needs one extra row of info, to hold top row data */
 2046|  7.78k|        size = sizeof(mb_neigbour_params_t)
 2047|  7.78k|                        * 2 * ((u4_wd_mbs + 2) * (u4_ht_mbs + 1));
 2048|  7.78k|    }
 2049|  15.8k|    else
 2050|  15.8k|    {
 2051|  15.8k|        size = sizeof(mb_neigbour_params_t)
 2052|  15.8k|                        * 2 * ((u4_wd_mbs + 2) << uc_frmOrFld);
 2053|  15.8k|    }
 2054|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2055|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 2056|       |
 2057|  23.6k|    ps_dec->ps_nbr_mb_row = pv_buf;
 2058|  23.6k|    memset(ps_dec->ps_nbr_mb_row, 0, size);
 2059|       |
 2060|       |    /* Allocate deblock MB info */
 2061|  23.6k|    size = (u4_total_mbs + u4_wd_mbs) * sizeof(deblk_mb_t);
 2062|       |
 2063|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2064|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 2065|  23.6k|    ps_dec->ps_deblk_pic = pv_buf;
 2066|       |
 2067|  23.6k|    memset(ps_dec->ps_deblk_pic, 0, size);
 2068|       |
 2069|       |    /* Allocate frame level mb info */
 2070|  23.6k|    size = sizeof(dec_mb_info_t) * u4_total_mbs;
 2071|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2072|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 2073|  23.6k|    ps_dec->ps_frm_mb_info = pv_buf;
 2074|  23.6k|    memset(ps_dec->ps_frm_mb_info, 0, size);
 2075|       |
 2076|       |    /* Allocate memory for slice headers dec_slice_struct_t */
 2077|  23.6k|    num_entries = MAX_FRAMES;
  ------------------
  |  |  600|  23.6k|#define MAX_FRAMES              16
  ------------------
 2078|  23.6k|    if((1 >= ps_dec->ps_cur_sps->u1_num_ref_frames) &&
  ------------------
  |  Branch (2078:8): [True: 19.4k, False: 4.15k]
  ------------------
 2079|  19.4k|        (0 == ps_dec->i4_display_delay))
  ------------------
  |  Branch (2079:9): [True: 0, False: 19.4k]
  ------------------
 2080|      0|    {
 2081|      0|        num_entries = 1;
 2082|      0|    }
 2083|  23.6k|    num_entries = ((2 * num_entries) + 1);
 2084|  23.6k|    num_entries *= 2;
 2085|       |
 2086|  23.6k|    size = num_entries * sizeof(void *);
 2087|  23.6k|    size += PAD_MAP_IDX_POC * sizeof(void *);
  ------------------
  |  |  100|  23.6k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 2088|  23.6k|    size *= u4_total_mbs;
 2089|  23.6k|    size += sizeof(dec_slice_struct_t) * u4_total_mbs;
 2090|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2091|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 2092|       |
 2093|  23.6k|    ps_dec->ps_dec_slice_buf = pv_buf;
 2094|  23.6k|    memset(ps_dec->ps_dec_slice_buf, 0, size);
 2095|  23.6k|    pu1_buf = (UWORD8 *)ps_dec->ps_dec_slice_buf;
 2096|  23.6k|    pu1_buf += sizeof(dec_slice_struct_t) * u4_total_mbs;
 2097|  23.6k|    ps_dec->pv_map_ref_idx_to_poc_buf = (void *)pu1_buf;
 2098|       |
 2099|       |    /* Allocate memory for packed pred info */
 2100|  23.6k|    num_entries = u4_total_mbs;
 2101|  23.6k|    num_entries *= 16 * 2;
 2102|       |
 2103|  23.6k|    size = sizeof(pred_info_pkd_t) * num_entries;
 2104|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2105|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 2106|  23.6k|    memset(pv_buf, 0, size);
 2107|  23.6k|    ps_dec->ps_pred_pkd = pv_buf;
 2108|       |
 2109|       |    /* Allocate memory for coeff data */
 2110|  23.6k|    size = MB_LUM_SIZE * sizeof(WORD16);
  ------------------
  |  |  563|  23.6k|#define MB_LUM_SIZE                   256
  ------------------
 2111|       |    /*For I16x16 MBs, 16 4x4 AC coeffs and 1 4x4 DC coeff TU blocks will be sent
 2112|       |    For all MBs along with 8 4x4 AC coeffs 2 2x2 DC coeff TU blocks will be sent
 2113|       |    So use 17 4x4 TU blocks for luma and 9 4x4 TU blocks for chroma */
 2114|  23.6k|    size += u4_total_mbs * (MAX(17 * sizeof(tu_sblk4x4_coeff_data_t),4 * sizeof(tu_blk8x8_coeff_data_t))
  ------------------
  |  |   60|  23.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 23.6k, Folded]
  |  |  ------------------
  ------------------
 2115|  23.6k|                                            + 9 * sizeof(tu_sblk4x4_coeff_data_t));
 2116|       |    //32 bytes for each mb to store u1_prev_intra4x4_pred_mode and u1_rem_intra4x4_pred_mode data
 2117|  23.6k|    size += u4_total_mbs * 32;
 2118|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2119|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 2120|  23.6k|    memset(pv_buf, 0, size);
 2121|       |
 2122|  23.6k|    ps_dec->pi2_coeff_data = pv_buf;
 2123|       |
 2124|  23.6k|    ps_dec->pv_pic_tu_coeff_data = (void *)(ps_dec->pi2_coeff_data + MB_LUM_SIZE);
  ------------------
  |  |  563|  23.6k|#define MB_LUM_SIZE                   256
  ------------------
 2125|       |
 2126|       |    /* Allocate MV bank buffer */
 2127|  23.6k|    {
 2128|  23.6k|        UWORD32 col_flag_buffer_size, mvpred_buffer_size;
 2129|       |
 2130|  23.6k|        col_flag_buffer_size = ((ps_dec->u2_pic_wd * ps_dec->u2_pic_ht) >> 4);
 2131|  23.6k|        mvpred_buffer_size = sizeof(mv_pred_t)
 2132|  23.6k|                        * ((ps_dec->u2_pic_wd * (ps_dec->u2_pic_ht + PAD_MV_BANK_ROW)) >> 4);
  ------------------
  |  |  576|  23.6k|#define PAD_MV_BANK_ROW             64
  ------------------
 2133|       |
 2134|  23.6k|        u4_num_bufs = ps_dec->ps_cur_sps->u1_num_ref_frames + 1;
 2135|       |
 2136|  23.6k|        u4_num_bufs = MIN(u4_num_bufs, ps_dec->u1_pic_bufs);
  ------------------
  |  |   61|  23.6k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 23.6k, False: 0]
  |  |  ------------------
  ------------------
 2137|  23.6k|        u4_num_bufs = MAX(u4_num_bufs, 2);
  ------------------
  |  |   60|  23.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 4.15k, False: 19.4k]
  |  |  ------------------
  ------------------
 2138|  23.6k|        size = ALIGN64(mvpred_buffer_size) + ALIGN64(col_flag_buffer_size);
  ------------------
  |  |   48|  23.6k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
                      size = ALIGN64(mvpred_buffer_size) + ALIGN64(col_flag_buffer_size);
  ------------------
  |  |   48|  23.6k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2139|  23.6k|        size *= u4_num_bufs;
 2140|  23.6k|        pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2141|  23.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 2142|  23.6k|        memset(pv_buf, 0, size);
 2143|  23.6k|        ps_dec->pu1_mv_bank_buf_base = pv_buf;
 2144|  23.6k|    }
 2145|       |
 2146|       |    /* Allocate Pic buffer */
 2147|      0|    u4_luma_size = ps_dec->u2_frm_wd_y * ps_dec->u2_frm_ht_y;
 2148|  23.6k|    u4_chroma_size = ps_dec->u2_frm_wd_uv * ps_dec->u2_frm_ht_uv;
 2149|       |
 2150|  23.6k|    {
 2151|  23.6k|        if(ps_dec->u4_share_disp_buf == 1)
  ------------------
  |  Branch (2151:12): [True: 0, False: 23.6k]
  ------------------
 2152|      0|        {
 2153|       |            /* In case of buffers getting shared between application and library
 2154|       |             there is no need of reference memtabs. Instead of setting the i4_size
 2155|       |             to zero, it is reduced to a small i4_size to ensure that changes
 2156|       |             in the code are minimal */
 2157|      0|            if((ps_dec->u1_chroma_format == IV_YUV_420SP_UV)
  ------------------
  |  Branch (2157:16): [True: 0, False: 0]
  ------------------
 2158|      0|                            || (ps_dec->u1_chroma_format == IV_YUV_420SP_VU)
  ------------------
  |  Branch (2158:32): [True: 0, False: 0]
  ------------------
 2159|      0|                            || (ps_dec->u1_chroma_format == IV_YUV_420P))
  ------------------
  |  Branch (2159:32): [True: 0, False: 0]
  ------------------
 2160|      0|            {
 2161|      0|                u4_luma_size = 64;
 2162|      0|            }
 2163|       |
 2164|      0|            if(ps_dec->u1_chroma_format == IV_YUV_420SP_UV)
  ------------------
  |  Branch (2164:16): [True: 0, False: 0]
  ------------------
 2165|      0|            {
 2166|      0|                u4_chroma_size = 64;
 2167|      0|            }
 2168|       |
 2169|      0|        }
 2170|  23.6k|    }
 2171|       |
 2172|  23.6k|    size = ALIGN64(u4_luma_size) + ALIGN64(u4_chroma_size);
  ------------------
  |  |   48|  23.6k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
                  size = ALIGN64(u4_luma_size) + ALIGN64(u4_chroma_size);
  ------------------
  |  |   48|  23.6k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2173|  23.6k|    size *= ps_dec->u1_pic_bufs;
 2174|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2175|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
 2176|  23.6k|    memset(pv_buf, 0, size);
 2177|  23.6k|    ps_dec->pu1_pic_buf_base = pv_buf;
 2178|       |
 2179|       |    /* Allocate memory for mb_info maps */
 2180|  23.6k|    if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (2180:8): [True: 0, False: 23.6k]
  ------------------
 2181|      0|    {
 2182|      0|        size = (u4_total_mbs << 2) * MAX_DISP_BUFS_NEW;
  ------------------
  |  |   76|      0|#define MAX_DISP_BUFS_NEW 64
  ------------------
 2183|       |
 2184|      0|        pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2185|      0|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|      0|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2186|      0|        memset(pv_buf, 0, size);
 2187|      0|        ps_dec->pu1_qp_map_base = pv_buf;
 2188|       |
 2189|      0|        pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2190|      0|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|      0|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2191|      0|        memset(pv_buf, 0, size);
 2192|      0|        ps_dec->pu1_mb_type_map_base = pv_buf;
 2193|      0|    }
 2194|       |
 2195|       |    /* Post allocation Increment Actions */
 2196|       |
 2197|       |    /***************************************************************************/
 2198|       |    /*Initialize cabac context pointers for every SE that has fixed contextIdx */
 2199|       |    /***************************************************************************/
 2200|  23.6k|    {
 2201|  23.6k|        bin_ctxt_model_t * const p_cabac_ctxt_table_t =
 2202|  23.6k|                        ps_dec->p_cabac_ctxt_table_t;
 2203|  23.6k|        bin_ctxt_model_t * * p_coeff_abs_level_minus1_t =
 2204|  23.6k|                        ps_dec->p_coeff_abs_level_minus1_t;
 2205|  23.6k|        bin_ctxt_model_t * * p_cbf_t = ps_dec->p_cbf_t;
 2206|       |
 2207|  23.6k|        ps_dec->p_mb_field_dec_flag_t = p_cabac_ctxt_table_t
 2208|  23.6k|                        + MB_FIELD_DECODING_FLAG;
 2209|  23.6k|        ps_dec->p_prev_intra4x4_pred_mode_flag_t = p_cabac_ctxt_table_t
 2210|  23.6k|                        + PREV_INTRA4X4_PRED_MODE_FLAG;
 2211|  23.6k|        ps_dec->p_rem_intra4x4_pred_mode_t = p_cabac_ctxt_table_t
 2212|  23.6k|                        + REM_INTRA4X4_PRED_MODE;
 2213|  23.6k|        ps_dec->p_intra_chroma_pred_mode_t = p_cabac_ctxt_table_t
 2214|  23.6k|                        + INTRA_CHROMA_PRED_MODE;
 2215|  23.6k|        ps_dec->p_mb_qp_delta_t = p_cabac_ctxt_table_t + MB_QP_DELTA;
 2216|  23.6k|        ps_dec->p_ref_idx_t = p_cabac_ctxt_table_t + REF_IDX;
 2217|  23.6k|        ps_dec->p_mvd_x_t = p_cabac_ctxt_table_t + MVD_X;
 2218|  23.6k|        ps_dec->p_mvd_y_t = p_cabac_ctxt_table_t + MVD_Y;
 2219|  23.6k|        p_cbf_t[0] = p_cabac_ctxt_table_t + CBF + 0;
 2220|  23.6k|        p_cbf_t[1] = p_cabac_ctxt_table_t + CBF + 4;
 2221|  23.6k|        p_cbf_t[2] = p_cabac_ctxt_table_t + CBF + 8;
 2222|  23.6k|        p_cbf_t[3] = p_cabac_ctxt_table_t + CBF + 12;
 2223|  23.6k|        p_cbf_t[4] = p_cabac_ctxt_table_t + CBF + 16;
 2224|  23.6k|        ps_dec->p_cbp_luma_t = p_cabac_ctxt_table_t + CBP_LUMA;
 2225|  23.6k|        ps_dec->p_cbp_chroma_t = p_cabac_ctxt_table_t + CBP_CHROMA;
 2226|       |
 2227|  23.6k|        p_coeff_abs_level_minus1_t[LUMA_DC_CTXCAT] = p_cabac_ctxt_table_t
  ------------------
  |  |   71|  23.6k|#define LUMA_DC_CTXCAT    0
  ------------------
 2228|  23.6k|                        + COEFF_ABS_LEVEL_MINUS1 + COEFF_ABS_LEVEL_CAT_0_OFFSET;
 2229|       |
 2230|  23.6k|        p_coeff_abs_level_minus1_t[LUMA_AC_CTXCAT] = p_cabac_ctxt_table_t
  ------------------
  |  |   72|  23.6k|#define LUMA_AC_CTXCAT    1
  ------------------
 2231|  23.6k|                        + COEFF_ABS_LEVEL_MINUS1 + COEFF_ABS_LEVEL_CAT_1_OFFSET;
 2232|       |
 2233|  23.6k|        p_coeff_abs_level_minus1_t[LUMA_4X4_CTXCAT] = p_cabac_ctxt_table_t
  ------------------
  |  |   73|  23.6k|#define LUMA_4X4_CTXCAT   2
  ------------------
 2234|  23.6k|                        + COEFF_ABS_LEVEL_MINUS1 + COEFF_ABS_LEVEL_CAT_2_OFFSET;
 2235|       |
 2236|  23.6k|        p_coeff_abs_level_minus1_t[CHROMA_DC_CTXCAT] = p_cabac_ctxt_table_t
  ------------------
  |  |   74|  23.6k|#define CHROMA_DC_CTXCAT  3
  ------------------
 2237|  23.6k|                        + COEFF_ABS_LEVEL_MINUS1 + COEFF_ABS_LEVEL_CAT_3_OFFSET;
 2238|       |
 2239|  23.6k|        p_coeff_abs_level_minus1_t[CHROMA_AC_CTXCAT] = p_cabac_ctxt_table_t
  ------------------
  |  |   75|  23.6k|#define CHROMA_AC_CTXCAT  4
  ------------------
 2240|  23.6k|                        + COEFF_ABS_LEVEL_MINUS1 + COEFF_ABS_LEVEL_CAT_4_OFFSET;
 2241|       |
 2242|  23.6k|        p_coeff_abs_level_minus1_t[LUMA_8X8_CTXCAT] = p_cabac_ctxt_table_t
  ------------------
  |  |   76|  23.6k|#define LUMA_8X8_CTXCAT   5
  ------------------
 2243|  23.6k|                        + COEFF_ABS_LEVEL_MINUS1_8X8
 2244|  23.6k|                        + COEFF_ABS_LEVEL_CAT_5_OFFSET;
 2245|       |
 2246|       |        /********************************************************/
 2247|       |        /* context for the high profile related syntax elements */
 2248|       |        /* This is maintained seperately in s_high_profile     */
 2249|       |        /********************************************************/
 2250|  23.6k|        {
 2251|       |
 2252|  23.6k|            ps_dec->s_high_profile.ps_transform8x8_flag = p_cabac_ctxt_table_t
 2253|  23.6k|                            + TRANSFORM_SIZE_8X8_FLAG;
 2254|       |
 2255|  23.6k|            ps_dec->s_high_profile.ps_sigcoeff_8x8_frame = p_cabac_ctxt_table_t
 2256|  23.6k|                            + SIGNIFICANT_COEFF_FLAG_8X8_FRAME;
 2257|       |
 2258|  23.6k|            ps_dec->s_high_profile.ps_last_sigcoeff_8x8_frame =
 2259|  23.6k|                            p_cabac_ctxt_table_t
 2260|  23.6k|                                            + LAST_SIGNIFICANT_COEFF_FLAG_8X8_FRAME;
 2261|       |
 2262|  23.6k|            ps_dec->s_high_profile.ps_coeff_abs_levelminus1 =
 2263|  23.6k|                            p_cabac_ctxt_table_t + COEFF_ABS_LEVEL_MINUS1_8X8;
 2264|       |
 2265|  23.6k|            ps_dec->s_high_profile.ps_sigcoeff_8x8_field = p_cabac_ctxt_table_t
 2266|  23.6k|                            + SIGNIFICANT_COEFF_FLAG_8X8_FIELD;
 2267|       |
 2268|  23.6k|            ps_dec->s_high_profile.ps_last_sigcoeff_8x8_field =
 2269|  23.6k|                            p_cabac_ctxt_table_t
 2270|  23.6k|                                            + LAST_SIGNIFICANT_COEFF_FLAG_8X8_FIELD;
 2271|  23.6k|        }
 2272|  23.6k|    }
 2273|  23.6k|    return (i16_status);
 2274|  23.6k|}
ih264d_free_dynamic_bufs:
 2291|   168k|{
 2292|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_deblk_pic);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2293|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_dec_mb_map);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2294|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_recon_mb_map);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2295|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu2_slice_num_map);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2296|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_dec_slice_buf);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2297|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_frm_mb_info);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2298|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pi2_coeff_data);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2299|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_parse_mb_data);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2300|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_parse_part_params);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2301|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_deblk_top_mb);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2302|       |
 2303|   168k|    if(ps_dec->p_ctxt_inc_mb_map)
  ------------------
  |  Branch (2303:8): [True: 23.6k, False: 144k]
  ------------------
 2304|  23.6k|    {
 2305|  23.6k|        ps_dec->p_ctxt_inc_mb_map -= 1;
 2306|  23.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->p_ctxt_inc_mb_map);
  ------------------
  |  |   43|  23.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  23.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 0]
  |  |  ------------------
  ------------------
 2307|  23.6k|    }
 2308|       |
 2309|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_mv_p[0]);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2310|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_mv_p[1]);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2311|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_pred_pkd);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2312|   168k|    {
 2313|   168k|        UWORD8 i;
 2314|   841k|        for(i = 0; i < MV_SCRATCH_BUFS; i++)
  ------------------
  |  |   62|   841k|#define MV_SCRATCH_BUFS             4
  ------------------
  |  Branch (2314:20): [True: 673k, False: 168k]
  ------------------
 2315|   673k|        {
 2316|   673k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_mv_top_p[i]);
  ------------------
  |  |   43|   673k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   673k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 94.5k, False: 578k]
  |  |  ------------------
  ------------------
 2317|   673k|        }
 2318|   168k|    }
 2319|       |
 2320|   168k|    if(ps_dec->pu1_y_intra_pred_line)
  ------------------
  |  Branch (2320:8): [True: 23.6k, False: 144k]
  ------------------
 2321|  23.6k|    {
 2322|  23.6k|        ps_dec->pu1_y_intra_pred_line -= MB_SIZE;
  ------------------
  |  |  554|  23.6k|#define MB_SIZE             16
  ------------------
 2323|  23.6k|    }
 2324|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_y_intra_pred_line);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2325|       |
 2326|   168k|    if(ps_dec->pu1_u_intra_pred_line)
  ------------------
  |  Branch (2326:8): [True: 23.6k, False: 144k]
  ------------------
 2327|  23.6k|    {
 2328|  23.6k|        ps_dec->pu1_u_intra_pred_line -= MB_SIZE;
  ------------------
  |  |  554|  23.6k|#define MB_SIZE             16
  ------------------
 2329|  23.6k|    }
 2330|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_u_intra_pred_line);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2331|       |
 2332|   168k|    if(ps_dec->pu1_v_intra_pred_line)
  ------------------
  |  Branch (2332:8): [True: 23.6k, False: 144k]
  ------------------
 2333|  23.6k|    {
 2334|  23.6k|        ps_dec->pu1_v_intra_pred_line -= MB_SIZE;
  ------------------
  |  |  554|  23.6k|#define MB_SIZE             16
  ------------------
 2335|  23.6k|    }
 2336|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_v_intra_pred_line);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2337|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_nbr_mb_row);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2338|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_mv_bank_buf_base);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2339|   168k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_pic_buf_base);
  ------------------
  |  |   43|   168k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   168k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 144k]
  |  |  ------------------
  ------------------
 2340|       |
 2341|       |    /* Free memory for mb_info maps */
 2342|   168k|    if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (2342:8): [True: 0, False: 168k]
  ------------------
 2343|      0|    {
 2344|      0|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_qp_map_base);
  ------------------
  |  |   43|      0|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|      0|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2345|       |        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_mb_type_map_base);
  ------------------
  |  |   43|      0|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|      0|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2346|      0|    }
 2347|   168k|    return 0;
 2348|   168k|}
ih264d_create_mv_bank:
 2375|  23.6k|{
 2376|  23.6k|    UWORD8  i;
 2377|  23.6k|    UWORD32 col_flag_buffer_size, mvpred_buffer_size;
 2378|  23.6k|    UWORD8 *pu1_mv_buf_mgr_base, *pu1_mv_bank_base;
 2379|  23.6k|    col_mv_buf_t *ps_col_mv;
 2380|  23.6k|    mv_pred_t *ps_mv;
 2381|  23.6k|    UWORD8 *pu1_col_zero_flag_buf;
 2382|  23.6k|    dec_struct_t *ps_dec = (dec_struct_t *)pv_dec;
 2383|  23.6k|    WORD32 buf_ret;
 2384|  23.6k|    UWORD32 u4_num_bufs;
 2385|  23.6k|    UWORD8 *pu1_buf;
 2386|  23.6k|    WORD32 size;
 2387|  23.6k|    void *pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 2388|       |
 2389|  23.6k|    col_flag_buffer_size = ((ui_width * ui_height) >> 4);
 2390|  23.6k|    mvpred_buffer_size = sizeof(mv_pred_t)
 2391|  23.6k|                    * ((ui_width * (ui_height + PAD_MV_BANK_ROW)) >> 4);
  ------------------
  |  |  576|  23.6k|#define PAD_MV_BANK_ROW             64
  ------------------
 2392|       |
 2393|  23.6k|    ih264_buf_mgr_init((buf_mgr_t *)ps_dec->pv_mv_buf_mgr);
 2394|       |
 2395|  23.6k|    ps_col_mv = ps_dec->ps_col_mv_base;
 2396|       |
 2397|  23.6k|    u4_num_bufs = ps_dec->ps_cur_sps->u1_num_ref_frames + 1;
 2398|       |
 2399|  23.6k|    u4_num_bufs = MIN(u4_num_bufs, ps_dec->u1_pic_bufs);
  ------------------
  |  |   61|  23.6k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 23.6k, False: 0]
  |  |  ------------------
  ------------------
 2400|  23.6k|    u4_num_bufs = MAX(u4_num_bufs, 2);
  ------------------
  |  |   60|  23.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 4.15k, False: 19.4k]
  |  |  ------------------
  ------------------
 2401|  23.6k|    pu1_buf = ps_dec->pu1_mv_bank_buf_base;
 2402|  90.3k|    for(i = 0 ; i < u4_num_bufs ; i++)
  ------------------
  |  Branch (2402:17): [True: 66.7k, False: 23.6k]
  ------------------
 2403|  66.7k|    {
 2404|  66.7k|        pu1_col_zero_flag_buf = pu1_buf;
 2405|  66.7k|        pu1_buf += ALIGN64(col_flag_buffer_size);
  ------------------
  |  |   48|  66.7k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2406|       |
 2407|  66.7k|        ps_mv = (mv_pred_t *)pu1_buf;
 2408|  66.7k|        pu1_buf += ALIGN64(mvpred_buffer_size);
  ------------------
  |  |   48|  66.7k|#define ALIGN64(x)  ((((x) + 63) >> 6) << 6)
  ------------------
 2409|       |
 2410|  66.7k|        memset(ps_mv, 0, ((ui_width * OFFSET_MV_BANK_ROW) >> 4) * sizeof(mv_pred_t));
  ------------------
  |  |   97|  66.7k|#define OFFSET_MV_BANK_ROW          ((PAD_MV_BANK_ROW)>>1)
  |  |  ------------------
  |  |  |  |  576|  66.7k|#define PAD_MV_BANK_ROW             64
  |  |  ------------------
  ------------------
 2411|  66.7k|        ps_mv += (ui_width*OFFSET_MV_BANK_ROW) >> 4;
  ------------------
  |  |   97|  66.7k|#define OFFSET_MV_BANK_ROW          ((PAD_MV_BANK_ROW)>>1)
  |  |  ------------------
  |  |  |  |  576|  66.7k|#define PAD_MV_BANK_ROW             64
  |  |  ------------------
  ------------------
 2412|       |
 2413|  66.7k|        ps_col_mv->pv_col_zero_flag = (void *)pu1_col_zero_flag_buf;
 2414|  66.7k|        ps_col_mv->pv_mv = (void *)ps_mv;
 2415|  66.7k|        buf_ret = ih264_buf_mgr_add((buf_mgr_t *)ps_dec->pv_mv_buf_mgr, ps_col_mv, i);
 2416|  66.7k|        if(0 != buf_ret)
  ------------------
  |  Branch (2416:12): [True: 0, False: 66.7k]
  ------------------
 2417|      0|        {
 2418|      0|            ps_dec->i4_error_code = ERROR_BUF_MGR;
 2419|      0|            return ERROR_BUF_MGR;
 2420|      0|        }
 2421|  66.7k|        ps_col_mv++;
 2422|  66.7k|    }
 2423|  23.6k|    return OK;
  ------------------
  |  |  114|  23.6k|#define OK        0
  ------------------
 2424|  23.6k|}
ih264d_unpack_coeff4x4_dc_4x4blk:
 2429|   182k|{
 2430|   182k|    UWORD16 u2_sig_coeff_map = ps_tu_4x4->u2_sig_coeff_map;
 2431|   182k|    WORD32 idx;
 2432|   182k|    WORD16 *pi2_coeff_data = &ps_tu_4x4->ai2_level[0];
 2433|       |
 2434|   459k|    while(u2_sig_coeff_map)
  ------------------
  |  Branch (2434:11): [True: 276k, False: 182k]
  ------------------
 2435|   276k|    {
 2436|   276k|        idx = CLZ(u2_sig_coeff_map);
 2437|       |
 2438|   276k|        idx = 31 - idx;
 2439|   276k|        RESET_BIT(u2_sig_coeff_map,idx);
  ------------------
  |  |  105|   276k|#define RESET_BIT(x, pos) (x) = (x) & ~(1 << pos);
  ------------------
 2440|       |
 2441|   276k|        idx = pu1_inv_scan[idx];
 2442|   276k|        pi2_out_coeff_data[idx] = *pi2_coeff_data++;
 2443|       |
 2444|   276k|    }
 2445|   182k|}

ih264d_parse_hrd_parametres:
   70|  6.73k|{
   71|  6.73k|    UWORD8 u1_index;
   72|  6.73k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
   73|  6.73k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   74|       |
   75|  6.73k|    ps_hrd->u4_cpb_cnt = 1
   76|  6.73k|                    + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
   77|  6.73k|    if(ps_hrd->u4_cpb_cnt > 31)
  ------------------
  |  Branch (77:8): [True: 343, False: 6.38k]
  ------------------
   78|    343|        return ERROR_INV_SPS_PPS_T;
   79|  6.38k|    ps_hrd->u1_bit_rate_scale = ih264d_get_bits_h264(ps_bitstrm, 4);
   80|  6.38k|    ps_hrd->u1_cpb_size_scale = ih264d_get_bits_h264(ps_bitstrm, 4);
   81|       |
   82|  21.5k|    for(u1_index = 0; u1_index < (UWORD8)ps_hrd->u4_cpb_cnt; u1_index++)
  ------------------
  |  Branch (82:23): [True: 15.1k, False: 6.38k]
  ------------------
   83|  15.1k|    {
   84|  15.1k|        ps_hrd->u4_bit_rate[u1_index] = 1
   85|  15.1k|                        + ih264d_uev(pu4_bitstrm_ofst,
   86|  15.1k|                                     pu4_bitstrm_buf);
   87|  15.1k|        ps_hrd->u4_cpb_size[u1_index] = 1
   88|  15.1k|                        + ih264d_uev(pu4_bitstrm_ofst,
   89|  15.1k|                                     pu4_bitstrm_buf);
   90|  15.1k|        ps_hrd->u1_cbr_flag[u1_index] = ih264d_get_bits_h264(ps_bitstrm, 1);
   91|  15.1k|    }
   92|       |
   93|  6.38k|    ps_hrd->u1_initial_cpb_removal_delay = 1
   94|  6.38k|                    + ih264d_get_bits_h264(ps_bitstrm, 5);
   95|  6.38k|    ps_hrd->u1_cpb_removal_delay_length = 1
   96|  6.38k|                    + ih264d_get_bits_h264(ps_bitstrm, 5);
   97|  6.38k|    ps_hrd->u1_dpb_output_delay_length = 1
   98|  6.38k|                    + ih264d_get_bits_h264(ps_bitstrm, 5);
   99|  6.38k|    ps_hrd->u1_time_offset_length = ih264d_get_bits_h264(ps_bitstrm, 5);
  100|       |
  101|  6.38k|    return OK;
  ------------------
  |  |  114|  6.38k|#define OK        0
  ------------------
  102|  6.73k|}
ih264d_parse_vui_parametres:
  127|  11.1k|{
  128|  11.1k|    UWORD8 u4_bits;
  129|  11.1k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  130|  11.1k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  131|  11.1k|    WORD32 ret;
  132|       |
  133|  11.1k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  134|  11.1k|    if(u4_bits)
  ------------------
  |  Branch (134:8): [True: 8.63k, False: 2.47k]
  ------------------
  135|  8.63k|    {
  136|  8.63k|        u4_bits = ih264d_get_bits_h264(ps_bitstrm, 8);
  137|  8.63k|        ps_vu4->u1_aspect_ratio_idc = (UWORD8)u4_bits;
  138|  8.63k|        if(VUI_EXTENDED_SAR == u4_bits)
  ------------------
  |  |   46|  8.63k|#define VUI_EXTENDED_SAR    255
  ------------------
  |  Branch (138:12): [True: 4.96k, False: 3.67k]
  ------------------
  139|  4.96k|        {
  140|  4.96k|            ps_vu4->u2_sar_width = ih264d_get_bits_h264(ps_bitstrm, 16);
  141|  4.96k|            ps_vu4->u2_sar_height = ih264d_get_bits_h264(ps_bitstrm, 16);
  142|  4.96k|        }
  143|  8.63k|    }
  144|       |
  145|  11.1k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  146|  11.1k|    if(u4_bits)
  ------------------
  |  Branch (146:8): [True: 3.99k, False: 7.11k]
  ------------------
  147|  3.99k|    {
  148|  3.99k|        ps_vu4->u1_overscan_appropriate_flag = ih264d_get_bits_h264(
  149|  3.99k|                        ps_bitstrm, 1);
  150|  3.99k|    }
  151|  11.1k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  152|       |    /* Initialize to unspecified (5 for video_format and
  153|       |       2 for colour_primaries, tfr_chars, matrix_coeffs  */
  154|  11.1k|    ps_vu4->u1_video_format = 5;
  155|  11.1k|    ps_vu4->u1_video_full_range_flag = 0;
  156|  11.1k|    ps_vu4->u1_colour_primaries = 2;
  157|  11.1k|    ps_vu4->u1_tfr_chars = 2;
  158|  11.1k|    ps_vu4->u1_matrix_coeffs = 2;
  159|       |
  160|  11.1k|    if(u4_bits)
  ------------------
  |  Branch (160:8): [True: 4.47k, False: 6.63k]
  ------------------
  161|  4.47k|    {
  162|  4.47k|        ps_vu4->u1_video_format = ih264d_get_bits_h264(ps_bitstrm, 3);
  163|  4.47k|        ps_vu4->u1_video_full_range_flag = ih264d_get_bits_h264(ps_bitstrm,
  164|  4.47k|                                                                1);
  165|  4.47k|        u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  166|  4.47k|        if(u4_bits)
  ------------------
  |  Branch (166:12): [True: 1.59k, False: 2.87k]
  ------------------
  167|  1.59k|        {
  168|  1.59k|            ps_vu4->u1_colour_primaries = ih264d_get_bits_h264(ps_bitstrm,
  169|  1.59k|                                                               8);
  170|  1.59k|            ps_vu4->u1_tfr_chars = ih264d_get_bits_h264(ps_bitstrm, 8);
  171|  1.59k|            ps_vu4->u1_matrix_coeffs = ih264d_get_bits_h264(ps_bitstrm, 8);
  172|  1.59k|        }
  173|  4.47k|    }
  174|       |
  175|  11.1k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  176|  11.1k|    if(u4_bits)
  ------------------
  |  Branch (176:8): [True: 3.35k, False: 7.75k]
  ------------------
  177|  3.35k|    {
  178|  3.35k|        ps_vu4->u1_cr_top_field = ih264d_uev(pu4_bitstrm_ofst,
  179|  3.35k|                                             pu4_bitstrm_buf);
  180|  3.35k|        ps_vu4->u1_cr_bottom_field = ih264d_uev(pu4_bitstrm_ofst,
  181|  3.35k|                                                pu4_bitstrm_buf);
  182|  3.35k|    }
  183|       |
  184|  11.1k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  185|  11.1k|    if(u4_bits)
  ------------------
  |  Branch (185:8): [True: 2.96k, False: 8.14k]
  ------------------
  186|  2.96k|    {
  187|  2.96k|        ps_vu4->u4_num_units_in_tick = ih264d_get_bits_h264(ps_bitstrm, 32);
  188|  2.96k|        ps_vu4->u4_time_scale = ih264d_get_bits_h264(ps_bitstrm, 32);
  189|  2.96k|        ps_vu4->u1_fixed_frame_rate_flag = ih264d_get_bits_h264(ps_bitstrm,
  190|  2.96k|                                                                1);
  191|  2.96k|    }
  192|       |
  193|  11.1k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  194|  11.1k|    ps_vu4->u1_nal_hrd_params_present = u4_bits;
  195|  11.1k|    if(u4_bits)
  ------------------
  |  Branch (195:8): [True: 2.13k, False: 8.97k]
  ------------------
  196|  2.13k|    {
  197|  2.13k|        ret = ih264d_parse_hrd_parametres(&ps_vu4->s_nal_hrd, ps_bitstrm);
  198|  2.13k|        if(ret != OK)
  ------------------
  |  |  114|  2.13k|#define OK        0
  ------------------
  |  Branch (198:12): [True: 100, False: 2.03k]
  ------------------
  199|    100|            return ret;
  200|  2.13k|    }
  201|  11.0k|    u4_bits = ih264d_get_bits_h264(ps_bitstrm, 1);
  202|  11.0k|    ps_vu4->u1_vcl_hrd_params_present = u4_bits;
  203|  11.0k|    if(u4_bits)
  ------------------
  |  Branch (203:8): [True: 1.64k, False: 9.36k]
  ------------------
  204|  1.64k|    {
  205|  1.64k|        ret = ih264d_parse_hrd_parametres(&ps_vu4->s_vcl_hrd, ps_bitstrm);
  206|  1.64k|        if(ret != OK)
  ------------------
  |  |  114|  1.64k|#define OK        0
  ------------------
  |  Branch (206:12): [True: 101, False: 1.54k]
  ------------------
  207|    101|            return ret;
  208|  1.64k|    }
  209|       |
  210|  10.9k|    if(ps_vu4->u1_nal_hrd_params_present || u4_bits)
  ------------------
  |  Branch (210:8): [True: 2.03k, False: 8.87k]
  |  Branch (210:45): [True: 644, False: 8.23k]
  ------------------
  211|  2.67k|    {
  212|  2.67k|        ps_vu4->u1_low_delay_hrd_flag = ih264d_get_bits_h264(ps_bitstrm, 1);
  213|  2.67k|    }
  214|  10.9k|    ps_vu4->u1_pic_struct_present_flag = ih264d_get_bits_h264(ps_bitstrm, 1);
  215|       |
  216|  10.9k|    ps_vu4->u1_bitstream_restriction_flag = ih264d_get_bits_h264(ps_bitstrm, 1);
  217|       |
  218|  10.9k|    if(ps_vu4->u1_bitstream_restriction_flag)
  ------------------
  |  Branch (218:8): [True: 1.75k, False: 9.15k]
  ------------------
  219|  1.75k|    {
  220|  1.75k|        ps_vu4->u1_mv_over_pic_boundaries_flag = ih264d_get_bits_h264(
  221|  1.75k|                        ps_bitstrm, 1);
  222|  1.75k|        ps_vu4->u4_max_bytes_per_pic_denom = ih264d_uev(pu4_bitstrm_ofst,
  223|  1.75k|                                                        pu4_bitstrm_buf);
  224|  1.75k|        ps_vu4->u4_max_bits_per_mb_denom = ih264d_uev(pu4_bitstrm_ofst,
  225|  1.75k|                                                      pu4_bitstrm_buf);
  226|  1.75k|        ps_vu4->u4_log2_max_mv_length_horz = ih264d_uev(pu4_bitstrm_ofst,
  227|  1.75k|                                                        pu4_bitstrm_buf);
  228|  1.75k|        ps_vu4->u4_log2_max_mv_length_vert = ih264d_uev(pu4_bitstrm_ofst,
  229|  1.75k|                                                        pu4_bitstrm_buf);
  230|  1.75k|        ps_vu4->u4_num_reorder_frames = ih264d_uev(pu4_bitstrm_ofst,
  231|  1.75k|                                                   pu4_bitstrm_buf);
  232|  1.75k|        ps_vu4->u4_max_dec_frame_buffering = ih264d_uev(pu4_bitstrm_ofst,
  233|  1.75k|                                                        pu4_bitstrm_buf);
  234|  1.75k|        if((ps_vu4->u4_max_dec_frame_buffering > (H264_MAX_REF_PICS * 2)) ||
  ------------------
  |  |  534|  1.75k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (234:12): [True: 121, False: 1.63k]
  ------------------
  235|  1.63k|           (ps_vu4->u4_num_reorder_frames > ps_vu4->u4_max_dec_frame_buffering))
  ------------------
  |  Branch (235:12): [True: 116, False: 1.51k]
  ------------------
  236|    237|        {
  237|    237|            return ERROR_INV_SPS_PPS_T;
  238|    237|        }
  239|  1.75k|    }
  240|  9.15k|    else
  241|  9.15k|    {
  242|       |        /* Setting this to a large value if not present */
  243|  9.15k|        ps_vu4->u4_num_reorder_frames = 64;
  244|  9.15k|        ps_vu4->u4_max_dec_frame_buffering = 64;
  245|  9.15k|    }
  246|       |
  247|  10.6k|    return OK;
  ------------------
  |  |  114|  10.6k|#define OK        0
  ------------------
  248|  10.9k|}

isvcd_set_processor:
  979|  21.5k|{
  980|  21.5k|    isvcd_ctl_set_processor_ip_t *ps_ip;
  981|  21.5k|    isvcd_ctl_set_processor_op_t *ps_op;
  982|  21.5k|    UWORD8 u1_layer_id;
  983|  21.5k|    svc_dec_lyr_struct_t *ps_codec;
  984|  21.5k|    svc_dec_ctxt_t *ps_svcd_ctxt;
  985|  21.5k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
  986|       |
  987|  21.5k|    ps_ip = (isvcd_ctl_set_processor_ip_t *) pv_api_ip;
  988|  21.5k|    ps_op = (isvcd_ctl_set_processor_op_t *) pv_api_op;
  989|       |
  990|  21.5k|    ps_svcd_ctxt->e_processor_arch = (IVD_ARCH_T) ps_ip->u4_arch;
  991|  21.5k|    ps_svcd_ctxt->e_processor_soc = (IVD_SOC_T) ps_ip->u4_soc;
  992|       |
  993|  86.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (993:26): [True: 64.6k, False: 21.5k]
  ------------------
  994|  64.6k|    {
  995|  64.6k|        ps_codec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
  996|  64.6k|        ps_codec->s_dec.e_processor_arch = (IVD_ARCH_T) ps_ip->u4_arch;
  997|  64.6k|        ps_codec->s_dec.e_processor_soc = (IVD_SOC_T) ps_ip->u4_soc;
  998|       |
  999|  64.6k|        isvcd_init_function_ptr(ps_codec);
 1000|  64.6k|    }
 1001|       |
 1002|  21.5k|    ps_op->u4_error_code = 0;
 1003|  21.5k|    return IV_SUCCESS;
 1004|  21.5k|}
isvcd_init_decoder:
 1029|  79.9k|{
 1030|  79.9k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) ps_dec_svc_lyr_params;
 1031|  79.9k|    dec_struct_t *ps_dec;
 1032|  79.9k|    dec_slice_params_t *ps_cur_slice;
 1033|  79.9k|    pocstruct_t *ps_prev_poc, *ps_cur_poc;
 1034|  79.9k|    size_t size;
 1035|  79.9k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1036|       |
 1037|  79.9k|    size = sizeof(pred_info_t) * 2 * 32;
 1038|  79.9k|    memset(ps_dec->ps_pred, 0, size);
 1039|       |
 1040|  79.9k|    size = sizeof(disp_mgr_t);
 1041|  79.9k|    memset(ps_dec->pv_disp_buf_mgr, 0, size);
 1042|       |
 1043|  79.9k|    size = ih264_buf_mgr_size();
 1044|  79.9k|    memset(ps_dec->pv_pic_buf_mgr, 0, size);
 1045|       |
 1046|  79.9k|    size = sizeof(dec_err_status_t);
 1047|  79.9k|    memset(ps_dec->ps_dec_err_status, 0, size);
 1048|       |
 1049|  79.9k|    size = sizeof(sei);
 1050|  79.9k|    memset(ps_dec->ps_sei, 0, size);
 1051|       |
 1052|  79.9k|    size = sizeof(sei);
 1053|  79.9k|    memset(ps_dec->ps_sei_parse, 0, size);
 1054|       |
 1055|  79.9k|    size = sizeof(dpb_commands_t);
 1056|  79.9k|    memset(ps_dec->ps_dpb_cmds, 0, size);
 1057|       |
 1058|  79.9k|    size = sizeof(dec_bit_stream_t);
 1059|  79.9k|    memset(ps_dec->ps_bitstrm, 0, size);
 1060|       |
 1061|  79.9k|    size = sizeof(dec_slice_params_t);
 1062|  79.9k|    memset(ps_dec->ps_cur_slice, 0, size);
 1063|       |
 1064|  79.9k|    size = MAX(sizeof(dec_seq_params_t), sizeof(dec_pic_params_t));
  ------------------
  |  |   60|  79.9k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 79.9k, Folded]
  |  |  ------------------
  ------------------
 1065|  79.9k|    memset(ps_dec->pv_scratch_sps_pps, 0, size);
 1066|       |
 1067|  79.9k|    size = sizeof(dec_svc_seq_params_t);
 1068|  79.9k|    memset(ps_svc_lyr_dec->pv_scratch_subset_sps, 0, size);
 1069|       |
 1070|  79.9k|    size = sizeof(ctxt_inc_mb_info_t);
 1071|  79.9k|    memset(ps_dec->ps_left_mb_ctxt_info, 0, size);
 1072|       |
 1073|  79.9k|    size = (sizeof(neighbouradd_t) << 2);
 1074|  79.9k|    memset(ps_dec->ps_left_mvpred_addr, 0, size);
 1075|       |
 1076|  79.9k|    size = ih264_buf_mgr_size();
 1077|  79.9k|    memset(ps_dec->pv_mv_buf_mgr, 0, size);
 1078|       |
 1079|       |    /* Free any dynamic buffers that are allocated */
 1080|  79.9k|    isvcd_free_dynamic_bufs(ps_svc_lyr_dec);
 1081|       |
 1082|  79.9k|    isvcd_init_dpb_ref_bufs(ps_dec);
 1083|       |
 1084|  79.9k|    ps_cur_slice = ps_dec->ps_cur_slice;
 1085|  79.9k|    ps_dec->init_done = 0;
 1086|       |
 1087|  79.9k|    ps_dec->u4_num_cores = 1;
 1088|  79.9k|    ps_dec->u2_pic_ht = ps_dec->u2_pic_wd = 0;
 1089|       |
 1090|  79.9k|    ps_dec->u1_separate_parse = DEFAULT_SEPARATE_PARSE;
  ------------------
  |  |  540|  79.9k|#define DEFAULT_SEPARATE_PARSE (H264_DEFAULT_NUM_CORES == 2)? 1 :0
  |  |  ------------------
  |  |  |  |  539|  79.9k|#define H264_DEFAULT_NUM_CORES 1
  |  |  ------------------
  |  |  |  Branch (540:32): [Folded, False: 79.9k]
  |  |  ------------------
  ------------------
 1091|  79.9k|    ps_dec->u4_app_disable_deblk_frm = 0;
 1092|  79.9k|    ps_dec->i4_degrade_type = 0;
 1093|  79.9k|    ps_dec->i4_degrade_pics = 0;
 1094|       |
 1095|       |    /* Initialization of function pointers ih264d_deblock_picture function*/
 1096|  79.9k|    ps_dec->p_DeblockPicture[0] = ih264d_deblock_picture_non_mbaff;
 1097|  79.9k|    ps_dec->p_DeblockPicture[1] = ih264d_deblock_picture_mbaff;
 1098|       |
 1099|  79.9k|    ps_dec->s_cab_dec_env.pv_codec_handle = ps_dec;
 1100|  79.9k|    ps_dec->u4_num_fld_in_frm = 0;
 1101|  79.9k|    ps_dec->ps_dpb_mgr->pv_codec_handle = ps_dec;
 1102|       |
 1103|       |    /* Initialize the sei validity u4_flag with zero indiacting sei is not valid*/
 1104|  79.9k|    ps_dec->ps_sei->u1_is_valid = 0;
 1105|       |
 1106|       |    /* decParams Initializations */
 1107|  79.9k|    ps_dec->ps_cur_pps = NULL;
 1108|  79.9k|    ps_dec->ps_cur_sps = NULL;
 1109|  79.9k|    ps_dec->u1_init_dec_flag = 0;
 1110|  79.9k|    ps_dec->u1_first_slice_in_stream = 1;
 1111|  79.9k|    ps_dec->u1_last_pic_not_decoded = 0;
 1112|  79.9k|    ps_dec->u4_app_disp_width = 0;
 1113|  79.9k|    ps_dec->i4_header_decoded = 0;
 1114|  79.9k|    ps_dec->u4_total_frames_decoded = 0;
 1115|       |
 1116|  79.9k|    ps_dec->i4_error_code = 0;
 1117|  79.9k|    ps_dec->i4_content_type = IV_CONTENTTYPE_NA;
 1118|  79.9k|    ps_dec->ps_cur_slice->u1_mbaff_frame_flag = 0;
 1119|       |
 1120|  79.9k|    ps_dec->ps_dec_err_status->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  600|  79.9k|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 1121|  79.9k|    ps_dec->ps_dec_err_status->u1_cur_pic_type = PIC_TYPE_UNKNOWN;
  ------------------
  |  |  607|  79.9k|#define PIC_TYPE_UNKNOWN  (0xFF)
  ------------------
 1122|  79.9k|    ps_dec->ps_dec_err_status->u4_frm_sei_sync = SYNC_FRM_DEFAULT;
  ------------------
  |  |  609|  79.9k|#define SYNC_FRM_DEFAULT  (0xFFFFFFFF)
  ------------------
 1123|  79.9k|    ps_dec->ps_dec_err_status->u4_cur_frm = INIT_FRAME;
  ------------------
  |  |  610|  79.9k|#define INIT_FRAME        (0xFFFFFF)
  ------------------
 1124|  79.9k|    ps_dec->ps_dec_err_status->u1_pic_aud_i = PIC_TYPE_UNKNOWN;
  ------------------
  |  |  607|  79.9k|#define PIC_TYPE_UNKNOWN  (0xFF)
  ------------------
 1125|       |
 1126|  79.9k|    ps_dec->u1_pr_sl_type = 0xFF;
 1127|  79.9k|    ps_dec->u2_mbx = 0xffff;
 1128|  79.9k|    ps_dec->u2_mby = 0;
 1129|  79.9k|    ps_dec->u4_total_mbs_coded = 0;
 1130|       |
 1131|       |    /* POC initializations */
 1132|  79.9k|    ps_prev_poc = &ps_dec->s_prev_pic_poc;
 1133|  79.9k|    ps_cur_poc = &ps_dec->s_cur_pic_poc;
 1134|  79.9k|    ps_prev_poc->i4_pic_order_cnt_lsb = ps_cur_poc->i4_pic_order_cnt_lsb = 0;
 1135|  79.9k|    ps_prev_poc->i4_pic_order_cnt_msb = ps_cur_poc->i4_pic_order_cnt_msb = 0;
 1136|  79.9k|    ps_prev_poc->i4_delta_pic_order_cnt_bottom = ps_cur_poc->i4_delta_pic_order_cnt_bottom = 0;
 1137|  79.9k|    ps_prev_poc->i4_delta_pic_order_cnt[0] = ps_cur_poc->i4_delta_pic_order_cnt[0] = 0;
 1138|  79.9k|    ps_prev_poc->i4_delta_pic_order_cnt[1] = ps_cur_poc->i4_delta_pic_order_cnt[1] = 0;
 1139|  79.9k|    ps_prev_poc->u1_mmco_equalto5 = ps_cur_poc->u1_mmco_equalto5 = 0;
 1140|  79.9k|    ps_prev_poc->i4_top_field_order_count = ps_cur_poc->i4_top_field_order_count = 0;
 1141|  79.9k|    ps_prev_poc->i4_bottom_field_order_count = ps_cur_poc->i4_bottom_field_order_count = 0;
 1142|  79.9k|    ps_prev_poc->u1_bot_field = ps_cur_poc->u1_bot_field = 0;
 1143|  79.9k|    ps_prev_poc->u1_mmco_equalto5 = ps_cur_poc->u1_mmco_equalto5 = 0;
 1144|  79.9k|    ps_prev_poc->i4_prev_frame_num_ofst = ps_cur_poc->i4_prev_frame_num_ofst = 0;
 1145|  79.9k|    ps_cur_slice->u1_mmco_equalto5 = 0;
 1146|  79.9k|    ps_cur_slice->u2_frame_num = 0;
 1147|       |
 1148|  79.9k|    ps_dec->i4_max_poc = 0;
 1149|  79.9k|    ps_dec->i4_prev_max_display_seq = 0;
 1150|  79.9k|    ps_dec->u4_recon_mb_grp = 4;
 1151|  79.9k|    ps_dec->i4_reorder_depth = -1;
 1152|       |
 1153|       |    /* Field PIC initializations */
 1154|  79.9k|    ps_dec->u1_second_field = 0;
 1155|  79.9k|    ps_dec->s_prev_seq_params.u1_eoseq_pending = 0;
 1156|       |
 1157|       |    /* Set the cropping parameters as zero */
 1158|  79.9k|    ps_dec->u2_crop_offset_y = 0;
 1159|  79.9k|    ps_dec->u2_crop_offset_uv = 0;
 1160|       |
 1161|       |    /* The Initial Frame Rate Info is not Present */
 1162|  79.9k|    ps_dec->i4_vui_frame_rate = -1;
 1163|  79.9k|    ps_dec->i4_pic_type = NA_SLICE;
  ------------------
  |  |  367|  79.9k|#define NA_SLICE -1
  ------------------
 1164|  79.9k|    ps_dec->i4_frametype = IV_NA_FRAME;
 1165|  79.9k|    ps_dec->i4_content_type = IV_CONTENTTYPE_NA;
 1166|       |
 1167|  79.9k|    ps_dec->u1_res_changed = 0;
 1168|       |
 1169|  79.9k|    ps_dec->u1_frame_decoded_flag = 0;
 1170|       |
 1171|       |    /* Set the default frame seek mask mode */
 1172|  79.9k|    ps_dec->u4_skip_frm_mask = SKIP_NONE;
  ------------------
  |  |  375|  79.9k|#define SKIP_NONE  (0x0)
  ------------------
 1173|       |
 1174|       |    /********************************************************/
 1175|       |    /* Initialize CAVLC residual decoding function pointers */
 1176|       |    /********************************************************/
 1177|  79.9k|    ps_dec->pf_cavlc_4x4res_block[0] = ih264d_cavlc_4x4res_block_totalcoeff_1;
 1178|  79.9k|    ps_dec->pf_cavlc_4x4res_block[1] = ih264d_cavlc_4x4res_block_totalcoeff_2to10;
 1179|  79.9k|    ps_dec->pf_cavlc_4x4res_block[2] = ih264d_cavlc_4x4res_block_totalcoeff_11to16;
 1180|       |
 1181|  79.9k|    ps_dec->pf_cavlc_parse4x4coeff[0] = ih264d_cavlc_parse4x4coeff_n0to7;
 1182|  79.9k|    ps_dec->pf_cavlc_parse4x4coeff[1] = ih264d_cavlc_parse4x4coeff_n8;
 1183|       |
 1184|  79.9k|    ps_dec->pf_cavlc_parse_8x8block[0] = ih264d_cavlc_parse_8x8block_none_available;
 1185|  79.9k|    ps_dec->pf_cavlc_parse_8x8block[1] = ih264d_cavlc_parse_8x8block_left_available;
 1186|  79.9k|    ps_dec->pf_cavlc_parse_8x8block[2] = ih264d_cavlc_parse_8x8block_top_available;
 1187|  79.9k|    ps_dec->pf_cavlc_parse_8x8block[3] = ih264d_cavlc_parse_8x8block_both_available;
 1188|       |
 1189|       |    /***************************************************************************/
 1190|       |    /* Initialize Bs calculation function pointers for P and B, 16x16/non16x16 */
 1191|       |    /***************************************************************************/
 1192|  79.9k|    ps_dec->pf_fill_bs1[0][0] = ih264d_fill_bs1_16x16mb_pslice;
 1193|  79.9k|    ps_dec->pf_fill_bs1[0][1] = ih264d_fill_bs1_non16x16mb_pslice;
 1194|       |
 1195|  79.9k|    ps_dec->pf_fill_bs1[1][0] = ih264d_fill_bs1_16x16mb_bslice;
 1196|  79.9k|    ps_dec->pf_fill_bs1[1][1] = ih264d_fill_bs1_non16x16mb_bslice;
 1197|       |
 1198|  79.9k|    ps_dec->pf_fill_bs_xtra_left_edge[0] = ih264d_fill_bs_xtra_left_edge_cur_frm;
 1199|  79.9k|    ps_dec->pf_fill_bs_xtra_left_edge[1] = ih264d_fill_bs_xtra_left_edge_cur_fld;
 1200|       |
 1201|       |    /* Initialize Reference Pic Buffers */
 1202|  79.9k|    ih264d_init_ref_bufs(ps_dec->ps_dpb_mgr);
 1203|       |
 1204|  79.9k|    ps_dec->u2_prv_frame_num = 0;
 1205|  79.9k|    ps_dec->u1_top_bottom_decoded = 0;
 1206|  79.9k|    ps_dec->u1_dangling_field = 0;
 1207|       |
 1208|  79.9k|    ps_dec->s_cab_dec_env.cabac_table = gau4_ih264d_cabac_table;
 1209|       |
 1210|  79.9k|    ps_dec->pu1_left_mv_ctxt_inc = ps_dec->u1_left_mv_ctxt_inc_arr[0];
 1211|  79.9k|    ps_dec->pi1_left_ref_idx_ctxt_inc = &ps_dec->i1_left_ref_idx_ctx_inc_arr[0][0];
 1212|  79.9k|    ps_dec->pu1_left_yuv_dc_csbp = &ps_dec->u1_yuv_dc_csbp_topmb;
 1213|       |
 1214|       |    /* ! */
 1215|       |    /* Initializing flush frame u4_flag */
 1216|  79.9k|    ps_dec->u1_flushfrm = 0;
 1217|       |
 1218|  79.9k|    ps_dec->s_cab_dec_env.pv_codec_handle = (void *) ps_dec;
 1219|  79.9k|    ps_dec->ps_bitstrm->pv_codec_handle = (void *) ps_dec;
 1220|  79.9k|    ps_dec->ps_cur_slice->pv_codec_handle = (void *) ps_dec;
 1221|  79.9k|    ps_dec->ps_dpb_mgr->pv_codec_handle = (void *) ps_dec;
 1222|       |
 1223|  79.9k|    memset(ps_dec->disp_bufs, 0, (MAX_DISP_BUFS_NEW) * sizeof(disp_buf_t));
  ------------------
  |  |   76|  79.9k|#define MAX_DISP_BUFS_NEW 64
  ------------------
 1224|  79.9k|    memset(ps_dec->u4_disp_buf_mapping, 0, (MAX_DISP_BUFS_NEW) * sizeof(UWORD32));
  ------------------
  |  |   76|  79.9k|#define MAX_DISP_BUFS_NEW 64
  ------------------
 1225|  79.9k|    memset(ps_dec->u4_disp_buf_to_be_freed, 0, (MAX_DISP_BUFS_NEW) * sizeof(UWORD32));
  ------------------
  |  |   76|  79.9k|#define MAX_DISP_BUFS_NEW 64
  ------------------
 1226|  79.9k|    memset(ps_dec->ps_cur_slice, 0, sizeof(dec_slice_params_t));
 1227|       |
 1228|  79.9k|    ih264d_init_arch(ps_dec);
 1229|  79.9k|    isvcd_init_function_ptr(ps_svc_lyr_dec);
 1230|  79.9k|    ps_dec->e_frm_out_mode = IVD_DISPLAY_FRAME_OUT;
 1231|  79.9k|    ps_dec->init_done = 1;
 1232|  79.9k|    ps_svc_lyr_dec->u1_layer_identifier = BASE_LAYER;
  ------------------
  |  |  108|  79.9k|#define BASE_LAYER 0
  ------------------
 1233|  79.9k|}
isvcd_nal_parse_ctxt_free:
 1257|  21.5k|{
 1258|  21.5k|    dec_struct_t *ps_dec;
 1259|  21.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1260|  21.5k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1261|  21.5k|    void *pv_mem_ctxt;
 1262|  21.5k|    nal_parse_ctxt_t *ps_ctxt;
 1263|  21.5k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 1264|  21.5k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1265|  21.5k|    pf_aligned_free = ps_dec->pf_aligned_free;
 1266|       |
 1267|  21.5k|    pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1268|  21.5k|    ps_ctxt = (nal_parse_ctxt_t *) ps_svcd_ctxt->pv_nal_parse_ctxt;
 1269|       |
 1270|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->s_dqid_ctxt.ps_dqid_node);
 1271|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pv_nal_header_buf);
 1272|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pv_nal_unit);
 1273|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_vcl_nal_buff);
 1274|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_non_vcl_nal_buff);
 1275|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_nal_parse_ctxt);
 1276|  21.5k|}
isvcd_residual_resample_ctxt_free:
 1299|  21.5k|{
 1300|  21.5k|    dec_struct_t *ps_dec;
 1301|  21.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1302|  21.5k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1303|  21.5k|    void *pv_mem_ctxt;
 1304|  21.5k|    residual_sampling_ctxt_t *ps_ctxt;
 1305|  21.5k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 1306|  21.5k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1307|  21.5k|    pf_aligned_free = ps_dec->pf_aligned_free;
 1308|       |
 1309|  21.5k|    pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1310|  21.5k|    ps_ctxt = (residual_sampling_ctxt_t *) ps_svcd_ctxt->pv_residual_sample_ctxt;
 1311|       |
 1312|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pi2_refarray_buffer);
 1313|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pu1_ref_x_ptr_incr);
 1314|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_offset_length);
 1315|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_offset_length);
 1316|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_pos_phase);
 1317|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_pos_phase);
 1318|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_residual_sample_ctxt);
 1319|  21.5k|}
isvcd_intra_resample_ctxt_free:
 1342|  21.5k|{
 1343|  21.5k|    dec_struct_t *ps_dec;
 1344|  21.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1345|  21.5k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1346|  21.5k|    void *pv_mem_ctxt;
 1347|  21.5k|    intra_sampling_ctxt_t *ps_ctxt;
 1348|  21.5k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 1349|  21.5k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1350|  21.5k|    pf_aligned_free = ps_dec->pf_aligned_free;
 1351|       |
 1352|  21.5k|    pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1353|  21.5k|    ps_ctxt = (intra_sampling_ctxt_t *) ps_svcd_ctxt->pv_intra_sample_ctxt;
 1354|       |
 1355|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pu1_refarray_buffer);
 1356|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pu1_refarray_cb);
 1357|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pu1_refarray_cr);
 1358|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->pi4_temp_interpolation_buffer);
 1359|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_offset_length);
 1360|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_offset_length);
 1361|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_min_max);
 1362|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_min_max);
 1363|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_x_pos_phase);
 1364|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_y_pos_phase);
 1365|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.pi2_xd_index);
 1366|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.pi2_yd_index);
 1367|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.pi2_ya_index);
 1368|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_seg_lookup_horz);
 1369|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.ps_seg_lookup_vert);
 1370|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_ctxt->as_res_lyrs[0].s_luma_map_ctxt.pu1_refarray_x_idx);
 1371|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_intra_sample_ctxt);
 1372|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_ii_pred_ctxt);
 1373|  21.5k|}
isvcd_mode_mv_resample_ctxt_free:
 1395|  21.5k|{
 1396|  21.5k|    dec_struct_t *ps_dec;
 1397|  21.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1398|  21.5k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1399|  21.5k|    void *pv_mem_ctxt;
 1400|  21.5k|    mode_motion_ctxt_t *ps_mode_motion;
 1401|       |
 1402|  21.5k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 1403|  21.5k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 1404|  21.5k|    pf_aligned_free = ps_dec->pf_aligned_free;
 1405|       |
 1406|  21.5k|    pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1407|  21.5k|    ps_mode_motion = (mode_motion_ctxt_t *) ps_svcd_ctxt->pv_mode_mv_sample_ctxt;
 1408|       |
 1409|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_mode_motion->ps_motion_pred_struct);
 1410|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_mode_motion->as_res_lyr_mem[0].pi2_ref_loc_x);
 1411|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_mode_motion->as_res_lyr_mem[0].pi2_ref_loc_y);
 1412|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_ref_lyr_offset);
 1413|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->pv_mode_mv_sample_ctxt);
 1414|  21.5k|}
isvcd_free_static_bufs:
 1437|  21.5k|{
 1438|  21.5k|    dec_struct_t *ps_dec;
 1439|  21.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1440|       |
 1441|  21.5k|    UWORD8 u1_layer_id;
 1442|  21.5k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 1443|       |
 1444|  21.5k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 1445|  21.5k|    void *pv_mem_ctxt;
 1446|       |
 1447|  21.5k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 1448|       |
 1449|  21.5k|    isvcd_intra_resample_ctxt_free(ps_svcd_ctxt);
 1450|  21.5k|    isvcd_residual_resample_ctxt_free(ps_svcd_ctxt);
 1451|  21.5k|    isvcd_mode_mv_resample_ctxt_free(ps_svcd_ctxt);
 1452|  21.5k|    isvcd_nal_parse_ctxt_free(ps_svcd_ctxt);
 1453|       |
 1454|  86.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1454:26): [True: 64.6k, False: 21.5k]
  ------------------
 1455|  64.6k|    {
 1456|  64.6k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 1457|  64.6k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 1458|  64.6k|        pf_aligned_free = ps_dec->pf_aligned_free;
 1459|  64.6k|        pv_mem_ctxt = ps_dec->pv_mem_ctxt;
 1460|       |
 1461|       |#ifdef KEEP_THREADS_ACTIVE
 1462|       |        /* Wait for threads */
 1463|       |        ps_dec->i4_break_threads = 1;
 1464|       |        if(ps_dec->u4_dec_thread_created)
 1465|       |        {
 1466|       |            ithread_mutex_lock(ps_dec->apv_proc_start_mutex[0]);
 1467|       |
 1468|       |            ps_dec->ai4_process_start[0] = PROC_START;
 1469|       |
 1470|       |            ithread_cond_signal(ps_dec->apv_proc_start_condition[0]);
 1471|       |
 1472|       |            ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[0]);
 1473|       |
 1474|       |            ithread_join(ps_dec->pv_dec_thread_handle, NULL);
 1475|       |
 1476|       |            ps_dec->u4_dec_thread_created = 0;
 1477|       |        }
 1478|       |
 1479|       |        if(ps_dec->u4_bs_deblk_thread_created)
 1480|       |        {
 1481|       |            ithread_mutex_lock(ps_dec->apv_proc_start_mutex[1]);
 1482|       |
 1483|       |            ps_dec->ai4_process_start[1] = PROC_START;
 1484|       |
 1485|       |            ithread_cond_signal(ps_dec->apv_proc_start_condition[1]);
 1486|       |
 1487|       |            ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[1]);
 1488|       |
 1489|       |            ithread_join(ps_dec->pv_bs_deblk_thread_handle, NULL);
 1490|       |
 1491|       |            ps_dec->u4_bs_deblk_thread_created = 0;
 1492|       |        }
 1493|       |
 1494|       |        // destroy mutex and condition variable for both the threads
 1495|       |        // 1. ih264d_decode_picture_thread
 1496|       |        // 2. ih264d_recon_deblk_thread
 1497|       |        {
 1498|       |            UWORD32 i;
 1499|       |            for(i = 0; i < 2; i++)
 1500|       |            {
 1501|       |                ithread_cond_destroy(ps_dec->apv_proc_start_condition[i]);
 1502|       |                ithread_cond_destroy(ps_dec->apv_proc_done_condition[i]);
 1503|       |
 1504|       |                ithread_mutex_destroy(ps_dec->apv_proc_start_mutex[i]);
 1505|       |                ithread_mutex_destroy(ps_dec->apv_proc_done_mutex[i]);
 1506|       |            }
 1507|       |        }
 1508|       |        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->apv_proc_start_mutex[0]);
 1509|       |        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->apv_proc_start_condition[0]);
 1510|       |#endif
 1511|  64.6k|        if(0 == u1_layer_id)
  ------------------
  |  Branch (1511:12): [True: 21.5k, False: 43.0k]
  ------------------
 1512|  21.5k|        {
 1513|  21.5k|            UWORD8 u1_sps_ctr;
 1514|  21.5k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_sps);
  ------------------
  |  |   43|  21.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  21.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 21.5k, False: 0]
  |  |  ------------------
  ------------------
 1515|  1.40M|            for(u1_sps_ctr = 0; u1_sps_ctr < (2 * MAX_NUM_SEQ_PARAMS); u1_sps_ctr++)
  ------------------
  |  |  521|  1.40M|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  |  Branch (1515:33): [True: 1.37M, False: 21.5k]
  ------------------
 1516|  1.37M|            {
 1517|  1.37M|                if(NULL != ps_svcd_ctxt->ps_subset_sps[u1_sps_ctr].s_sps_svc_ext.ps_svc_vui_ext)
  ------------------
  |  Branch (1517:20): [True: 446, False: 1.37M]
  ------------------
 1518|    446|                {
 1519|    446|                    PS_DEC_ALIGNED_FREE(
  ------------------
  |  |   43|    446|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|    446|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 446, False: 0]
  |  |  ------------------
  ------------------
 1520|    446|                        ps_dec,
 1521|    446|                        ps_svcd_ctxt->ps_subset_sps[u1_sps_ctr].s_sps_svc_ext.ps_svc_vui_ext);
 1522|    446|                }
 1523|  1.37M|            }
 1524|  21.5k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->ps_subset_sps);
  ------------------
  |  |   43|  21.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  21.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 21.5k, False: 0]
  |  |  ------------------
  ------------------
 1525|  21.5k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_pps);
  ------------------
  |  |   43|  21.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  21.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 21.5k, False: 0]
  |  |  ------------------
  ------------------
 1526|  21.5k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_sei);
  ------------------
  |  |   43|  21.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  21.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 21.5k, False: 0]
  |  |  ------------------
  ------------------
 1527|  21.5k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_sei_parse);
  ------------------
  |  |   43|  21.5k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  21.5k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 21.5k, False: 0]
  |  |  ------------------
  ------------------
 1528|  21.5k|        }
 1529|       |
 1530|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_dec_thread_handle);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1531|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_bs_deblk_thread_handle);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1532|       |
 1533|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_dpb_mgr);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1534|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_pred);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1535|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_disp_buf_mgr);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1536|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_pic_buf_base);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1537|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_dec_err_status);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1538|       |
 1539|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_dpb_cmds);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1540|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_bitstrm);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1541|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->ps_nal_svc_ext);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1542|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_cur_slice);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1543|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_scratch_sps_pps);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1544|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->pv_scratch_subset_sps);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1545|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_bits_buf_static);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1546|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ppv_map_ref_idx_to_poc_base);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1547|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->p_cabac_ctxt_table_t);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1548|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_left_mb_ctxt_info);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1549|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_ref_buff_base);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1550|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pi2_pred1);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1551|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_temp_mc_buffer);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1552|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_init_dpb_base);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1553|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu4_mbaff_wt_mat);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1554|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu4_wts_ofsts_mat);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1555|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_left_mvpred_addr);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1556|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->ps_col_mv_base);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1557|  64.6k|        PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1558|       |
 1559|  64.6k|        if(NULL != ps_dec->pv_pic_buf_mgr)
  ------------------
  |  Branch (1559:12): [True: 64.6k, False: 0]
  ------------------
 1560|  64.6k|        {
 1561|  64.6k|            if(u1_layer_id < ps_svcd_ctxt->u1_prev_num_res_layers)
  ------------------
  |  Branch (1561:16): [True: 35.5k, False: 29.0k]
  ------------------
 1562|  35.5k|            {
 1563|  35.5k|                if(((buf_mgr_t *) ps_dec->pv_pic_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (1563:20): [True: 22.2k, False: 13.3k]
  ------------------
 1564|  22.2k|                    ih264_buf_mgr_free(ps_dec->pv_pic_buf_mgr);
 1565|  35.5k|            }
 1566|  64.6k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_pic_buf_mgr);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1567|  64.6k|        }
 1568|  64.6k|        if(NULL != ps_dec->pv_mv_buf_mgr)
  ------------------
  |  Branch (1568:12): [True: 64.6k, False: 0]
  ------------------
 1569|  64.6k|        {
 1570|  64.6k|            if(u1_layer_id < ps_svcd_ctxt->u1_prev_num_res_layers)
  ------------------
  |  Branch (1570:16): [True: 35.5k, False: 29.0k]
  ------------------
 1571|  35.5k|            {
 1572|  35.5k|                if(((buf_mgr_t *) ps_dec->pv_mv_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (1572:20): [True: 22.2k, False: 13.3k]
  ------------------
 1573|  22.2k|                    ih264_buf_mgr_free(ps_dec->pv_mv_buf_mgr);
 1574|  35.5k|            }
 1575|  64.6k|            PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pv_mv_buf_mgr);
  ------------------
  |  |   43|  64.6k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|  64.6k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 64.6k, False: 0]
  |  |  ------------------
  ------------------
 1576|  64.6k|        }
 1577|  64.6k|    }
 1578|       |
 1579|  21.5k|    pf_aligned_free(pv_mem_ctxt, ps_svcd_ctxt->ps_svc_dec_lyr);
 1580|  21.5k|    pf_aligned_free(pv_mem_ctxt, dec_hdl->pv_codec_handle);
 1581|       |
 1582|  21.5k|    if(dec_hdl)
  ------------------
  |  Branch (1582:8): [True: 21.5k, False: 0]
  ------------------
 1583|  21.5k|    {
 1584|  21.5k|        pf_aligned_free(pv_mem_ctxt, dec_hdl);
 1585|  21.5k|    }
 1586|       |
 1587|  21.5k|    return IV_SUCCESS;
 1588|  21.5k|}
isvcd_nal_parse_ctxt_create:
 1614|  21.5k|{
 1615|  21.5k|    isvcd_create_ip_t *ps_create_ip;
 1616|  21.5k|    void *pv_buf;
 1617|  21.5k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 1618|  21.5k|    void *pv_mem_ctxt;
 1619|  21.5k|    WORD32 size;
 1620|  21.5k|    nal_parse_ctxt_t *ps_nal_parse_ctxt;
 1621|  21.5k|    UWORD8 *pu1_ptr;
 1622|  21.5k|    UNUSED(pv_api_op);
  ------------------
  |  |   45|  21.5k|#define UNUSED(x) ((void)(x))
  ------------------
 1623|       |
 1624|  21.5k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 1625|       |
 1626|  21.5k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 1627|  21.5k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 1628|       |
 1629|       |    /*-----------------------------------------------------------------------*/
 1630|       |    /* Handle                                                                */
 1631|       |    /*-----------------------------------------------------------------------*/
 1632|  21.5k|    size = sizeof(nal_parse_ctxt_t);
 1633|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1634|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1635|  21.5k|    memset(pv_buf, 0, size);
 1636|  21.5k|    ps_nal_parse_ctxt = pv_buf;
 1637|       |
 1638|       |    /* set the lowest dqid to -1 */
 1639|  21.5k|    ps_nal_parse_ctxt->i4_prev_dq_id = -1;
 1640|       |
 1641|       |    /*-----------------------------------------------------------------------*/
 1642|       |    /* DQID list buffer and initialization of vcl node buffer context        */
 1643|       |    /*-----------------------------------------------------------------------*/
 1644|  21.5k|    {
 1645|  21.5k|        WORD32 i4_lyr_idx;
 1646|  21.5k|        WORD32 i4_max_num_lyrs;
 1647|  21.5k|        vcl_node_t *ps_vcl_node;
 1648|  21.5k|        dqid_node_t *ps_dqid_node;
 1649|  21.5k|        dqid_ctxt_t *ps_dqid_ctxt;
 1650|       |
 1651|  21.5k|        size = sizeof(vcl_node_t);
 1652|  21.5k|        size += sizeof(dqid_node_t);
 1653|  21.5k|        size *= MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1654|       |
 1655|  21.5k|        ps_dqid_ctxt = &ps_nal_parse_ctxt->s_dqid_ctxt;
 1656|       |
 1657|  21.5k|        ps_dqid_ctxt->i4_max_num_lyrs = MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1658|       |
 1659|  21.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1660|  21.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1661|  21.5k|        memset(pv_buf, 0, size);
 1662|       |
 1663|  21.5k|        ps_dqid_ctxt->ps_dqid_node = pv_buf;
 1664|  21.5k|        ps_dqid_node = ps_dqid_ctxt->ps_dqid_node;
 1665|       |
 1666|  21.5k|        i4_max_num_lyrs = ps_dqid_ctxt->i4_max_num_lyrs;
 1667|       |
 1668|  21.5k|        pu1_ptr = pv_buf;
 1669|  21.5k|        pu1_ptr += sizeof(dqid_node_t) * i4_max_num_lyrs;
 1670|  21.5k|        ps_vcl_node = (vcl_node_t *) pu1_ptr;
 1671|       |
 1672|  86.1k|        for(i4_lyr_idx = 0; i4_lyr_idx < i4_max_num_lyrs; i4_lyr_idx++)
  ------------------
  |  Branch (1672:29): [True: 64.6k, False: 21.5k]
  ------------------
 1673|  64.6k|        {
 1674|  64.6k|            ps_dqid_node->ps_vcl_node = ps_vcl_node;
 1675|       |
 1676|       |            /* Loop updates */
 1677|  64.6k|            ps_vcl_node += 1;
 1678|  64.6k|            ps_dqid_node += 1;
 1679|  64.6k|        } /* Loop over all the layers */
 1680|  21.5k|    }
 1681|       |
 1682|       |    /*-----------------------------------------------------------------------*/
 1683|       |    /* Common memory                                                         */
 1684|       |    /*-----------------------------------------------------------------------*/
 1685|  21.5k|    size = UP_ALIGN_8(HEADER_BUFFER_LEN_BEFORE_EP);
  ------------------
  |  |   51|  21.5k|#define UP_ALIGN_8(x) (((((UWORD64) x) + 7) >> 3) << 3)
  ------------------
 1686|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1687|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1688|  21.5k|    memset(pv_buf, 0, size);
 1689|  21.5k|    ps_nal_parse_ctxt->pv_nal_header_buf = (void *) pv_buf;
 1690|       |
 1691|       |    /*-----------------------------------------------------------------------*/
 1692|       |    /* Layer params memory                                                   */
 1693|       |    /*-----------------------------------------------------------------------*/
 1694|  21.5k|    size = sizeof(nal_unit_t);
 1695|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1696|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1697|  21.5k|    memset(pv_buf, 0, size);
 1698|  21.5k|    ps_nal_parse_ctxt->pv_nal_unit = pv_buf;
 1699|       |
 1700|  21.5k|    size = MAX_VCL_NAL_BUFF_SIZE * sizeof(UWORD8);
  ------------------
  |  |   69|  21.5k|#define MAX_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
 1701|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1702|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1703|  21.5k|    memset(pv_buf, 0, size);
 1704|  21.5k|    ps_svcd_ctxt->pv_vcl_nal_buff = pv_buf;
 1705|       |
 1706|  21.5k|    size = MAX_NON_VCL_NAL_BUFF_SIZE * sizeof(UWORD8);
  ------------------
  |  |   70|  21.5k|#define MAX_NON_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
 1707|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1708|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1709|  21.5k|    memset(pv_buf, 0, size);
 1710|  21.5k|    ps_svcd_ctxt->pv_non_vcl_nal_buff = pv_buf;
 1711|       |
 1712|       |    /*-----------------------------------------------------------------------*/
 1713|       |    /* Registering the seq and pic prms buffer pointers                      */
 1714|       |    /*-----------------------------------------------------------------------*/
 1715|  21.5k|    if(NULL == ps_svcd_ctxt->ps_sps || NULL == ps_svcd_ctxt->ps_pps)
  ------------------
  |  Branch (1715:8): [True: 0, False: 21.5k]
  |  Branch (1715:40): [True: 0, False: 21.5k]
  ------------------
 1716|      0|    {
 1717|      0|        return IV_FAIL;
 1718|      0|    }
 1719|       |
 1720|  21.5k|    ps_svcd_ctxt->pv_nal_parse_ctxt = ps_nal_parse_ctxt;
 1721|  21.5k|    ps_nal_parse_ctxt->pv_seq_prms = ps_svcd_ctxt->ps_sps;
 1722|  21.5k|    ps_nal_parse_ctxt->pv_pic_prms = ps_svcd_ctxt->ps_pps;
 1723|       |
 1724|       |    /* register VCL and NON VCL buffer pointers */
 1725|  21.5k|    if(NULL == ps_svcd_ctxt->pv_vcl_nal_buff || NULL == ps_svcd_ctxt->pv_non_vcl_nal_buff)
  ------------------
  |  Branch (1725:8): [True: 0, False: 21.5k]
  |  Branch (1725:49): [True: 0, False: 21.5k]
  ------------------
 1726|      0|    {
 1727|      0|        return IV_FAIL;
 1728|      0|    }
 1729|       |
 1730|  21.5k|    ps_nal_parse_ctxt->pv_vcl_nal_buf = (UWORD8 *) ps_svcd_ctxt->pv_vcl_nal_buff;
 1731|  21.5k|    ps_nal_parse_ctxt->pv_non_vcl_nal_buf = (UWORD8 *) ps_svcd_ctxt->pv_non_vcl_nal_buff;
 1732|  21.5k|    isvcd_nal_parse_reset_ctxt(ANNEX_B, PARTIAL_INPUT_MODE, ps_nal_parse_ctxt);
  ------------------
  |  |   64|  21.5k|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
 1733|       |
 1734|  21.5k|    return IV_SUCCESS;
 1735|  21.5k|}
isvcd_intra_resample_ctxt_create:
 1759|  21.5k|{
 1760|  21.5k|    isvcd_create_ip_t *ps_create_ip;
 1761|  21.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 1762|  21.5k|    void *pv_buf;
 1763|  21.5k|    UWORD8 u1_layer_id;
 1764|  21.5k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 1765|  21.5k|    void *pv_mem_ctxt;
 1766|  21.5k|    WORD32 size;
 1767|  21.5k|    intra_inter_pred_ctxt_t *ps_ii_pred_ctxt;
 1768|       |
 1769|  21.5k|    intra_sampling_ctxt_t *ps_ctxt;
 1770|  21.5k|    UNUSED(pv_api_op);
  ------------------
  |  |   45|  21.5k|#define UNUSED(x) ((void)(x))
  ------------------
 1771|  21.5k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 1772|       |
 1773|  21.5k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 1774|  21.5k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 1775|       |
 1776|  21.5k|    {
 1777|  21.5k|        intra_samp_lyr_ctxt *ps_lyr_ctxt;
 1778|       |
 1779|       |        /* allocate context structure */
 1780|  21.5k|        size = ((sizeof(intra_sampling_ctxt_t) + 127) >> 7) << 7;
 1781|  21.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1782|  21.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1783|  21.5k|        memset(pv_buf, 0, size);
 1784|  21.5k|        ps_ctxt = pv_buf;
 1785|       |
 1786|       |        /* luma reference array buffer  */
 1787|  21.5k|        size = REF_ARRAY_WIDTH * REF_ARRAY_HEIGHT * sizeof(UWORD8);
  ------------------
  |  |   73|  21.5k|#define REF_ARRAY_WIDTH 48
  ------------------
                      size = REF_ARRAY_WIDTH * REF_ARRAY_HEIGHT * sizeof(UWORD8);
  ------------------
  |  |   74|  21.5k|#define REF_ARRAY_HEIGHT 48
  ------------------
 1788|  21.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1789|  21.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1790|  21.5k|        memset(pv_buf, 0, size);
 1791|  21.5k|        ps_ctxt->pu1_refarray_buffer = pv_buf;
 1792|       |
 1793|       |        /* cb reference array buffer */
 1794|  21.5k|        size = REF_ARRAY_WIDTH * REF_ARRAY_HEIGHT * sizeof(UWORD8);
  ------------------
  |  |   73|  21.5k|#define REF_ARRAY_WIDTH 48
  ------------------
                      size = REF_ARRAY_WIDTH * REF_ARRAY_HEIGHT * sizeof(UWORD8);
  ------------------
  |  |   74|  21.5k|#define REF_ARRAY_HEIGHT 48
  ------------------
 1795|  21.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1796|  21.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1797|  21.5k|        memset(pv_buf, 0, size);
 1798|  21.5k|        ps_ctxt->pu1_refarray_cb = pv_buf;
 1799|       |
 1800|       |        /* cr reference array buffer */
 1801|  21.5k|        size = ((DYADIC_REF_W_C + 2) * (DYADIC_REF_H_C + 2) * sizeof(UWORD8));
  ------------------
  |  |   58|  21.5k|#define DYADIC_REF_W_C 10
  ------------------
                      size = ((DYADIC_REF_W_C + 2) * (DYADIC_REF_H_C + 2) * sizeof(UWORD8));
  ------------------
  |  |   59|  21.5k|#define DYADIC_REF_H_C 10
  ------------------
 1802|  21.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1803|  21.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1804|  21.5k|        memset(pv_buf, 0, size);
 1805|  21.5k|        ps_ctxt->pu1_refarray_cr = pv_buf;
 1806|       |
 1807|       |        /* Temp Intermediate Buffer */
 1808|  21.5k|        size = INTERMEDIATE_BUFF_WIDTH * INTERMEDIATE_BUFF_HEIGHT * sizeof(WORD32);
  ------------------
  |  |   50|  21.5k|#define INTERMEDIATE_BUFF_WIDTH 48
  ------------------
                      size = INTERMEDIATE_BUFF_WIDTH * INTERMEDIATE_BUFF_HEIGHT * sizeof(WORD32);
  ------------------
  |  |   51|  21.5k|#define INTERMEDIATE_BUFF_HEIGHT (MB_HEIGHT + 4)
  |  |  ------------------
  |  |  |  |   68|  21.5k|#define MB_HEIGHT 16
  |  |  ------------------
  ------------------
 1809|  21.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1810|  21.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1811|  21.5k|        memset(pv_buf, 0, size);
 1812|  21.5k|        ps_ctxt->pi4_temp_interpolation_buffer = pv_buf;
 1813|       |
 1814|       |        /****************** projected locations buffers ******************/
 1815|  21.5k|        {
 1816|  21.5k|            intra_samp_map_ctxt_t *ps_luma_map;
 1817|  21.5k|            intra_samp_map_ctxt_t *ps_chroma_map;
 1818|  21.5k|            WORD32 i4_lyr_id;
 1819|  21.5k|            ref_mb_map_t *ps_off_len_map;
 1820|  21.5k|            ref_pixel_map_t *ps_pos_phase_map;
 1821|  21.5k|            ref_min_max_map_t *ps_min_max;
 1822|  21.5k|            WORD16 *pi2_mem;
 1823|  21.5k|            UWORD8 *pu1_mem;
 1824|  21.5k|            seg_lookup_desc_t *ps_seg_lookup;
 1825|       |
 1826|       |            /****************** Horz offset length ******************/
 1827|       |
 1828|  21.5k|            size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   39|  21.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                          size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1829|  21.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1830|  21.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1831|  21.5k|            memset(pv_buf, 0, size);
 1832|  21.5k|            ps_off_len_map = pv_buf;
 1833|       |
 1834|       |            /* loop over num layers -1 */
 1835|  86.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1835:32): [True: 64.6k, False: 21.5k]
  ------------------
 1836|  64.6k|            {
 1837|       |                /* derive the layer map ctxt */
 1838|  64.6k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1839|  64.6k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1840|  64.6k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1841|       |
 1842|       |                /* initialise the pointers */
 1843|  64.6k|                ps_luma_map->ps_x_offset_length = ps_off_len_map;
 1844|  64.6k|                ps_off_len_map += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  64.6k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1845|  64.6k|                ps_chroma_map->ps_x_offset_length = ps_off_len_map;
 1846|  64.6k|                ps_off_len_map += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  64.6k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1847|       |
 1848|  64.6k|            } /* end of loop over resolution layers */
 1849|       |
 1850|       |            /****************** Vert offset length ******************/
 1851|  21.5k|            size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   40|  21.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                          size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1852|  21.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1853|  21.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1854|  21.5k|            memset(pv_buf, 0, size);
 1855|  21.5k|            ps_off_len_map = pv_buf;
 1856|       |
 1857|       |            /* loop over num layers -1 */
 1858|  86.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1858:32): [True: 64.6k, False: 21.5k]
  ------------------
 1859|  64.6k|            {
 1860|       |                /* derive the layer map ctxt */
 1861|  64.6k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1862|  64.6k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1863|  64.6k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1864|       |
 1865|       |                /* initialise the pointers */
 1866|  64.6k|                ps_luma_map->ps_y_offset_length = ps_off_len_map;
 1867|  64.6k|                ps_off_len_map += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  64.6k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1868|  64.6k|                ps_chroma_map->ps_y_offset_length = ps_off_len_map;
 1869|  64.6k|                ps_off_len_map += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  64.6k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1870|       |
 1871|  64.6k|            } /* end of loop over resolution layers */
 1872|       |
 1873|       |            /****************** Horz Min Max Pos ******************/
 1874|       |
 1875|  21.5k|            size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   39|  21.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                          size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1876|  21.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1877|  21.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1878|  21.5k|            memset(pv_buf, 0, size);
 1879|  21.5k|            ps_min_max = pv_buf;
 1880|       |
 1881|       |            /* loop over num layers -1 */
 1882|  86.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1882:32): [True: 64.6k, False: 21.5k]
  ------------------
 1883|  64.6k|            {
 1884|       |                /* derive the layer map ctxt */
 1885|  64.6k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1886|  64.6k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1887|  64.6k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1888|       |
 1889|       |                /* initialise the pointers */
 1890|  64.6k|                ps_luma_map->ps_x_min_max = ps_min_max;
 1891|  64.6k|                ps_min_max += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  64.6k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1892|  64.6k|                ps_chroma_map->ps_x_min_max = ps_min_max;
 1893|  64.6k|                ps_min_max += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  64.6k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1894|  64.6k|            } /* end of loop over resolution layers */
 1895|       |
 1896|       |            /****************** Vert Min Max Pos ******************/
 1897|  21.5k|            size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   40|  21.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                          size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1898|       |
 1899|  21.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1900|  21.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1901|  21.5k|            memset(pv_buf, 0, size);
 1902|  21.5k|            ps_min_max = pv_buf;
 1903|       |
 1904|       |            /* loop over num layers -1 */
 1905|  86.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1905:32): [True: 64.6k, False: 21.5k]
  ------------------
 1906|  64.6k|            {
 1907|       |                /* derive the layer map ctxt */
 1908|  64.6k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1909|  64.6k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1910|  64.6k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1911|       |
 1912|       |                /* initialise the pointers */
 1913|  64.6k|                ps_luma_map->ps_y_min_max = ps_min_max;
 1914|  64.6k|                ps_min_max += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  64.6k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1915|  64.6k|                ps_chroma_map->ps_y_min_max = ps_min_max;
 1916|  64.6k|                ps_min_max += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  64.6k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1917|       |
 1918|  64.6k|            } /* end of loop over resolution layers */
 1919|       |
 1920|       |            /****************** Horz position phase ******************/
 1921|  21.5k|            size = (H264_MAX_FRAME_WIDTH) *MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   39|  21.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                          size = (H264_MAX_FRAME_WIDTH) *MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1922|  21.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1923|  21.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1924|  21.5k|            memset(pv_buf, 0, size);
 1925|  21.5k|            ps_pos_phase_map = pv_buf;
 1926|       |
 1927|       |            /* loop over num layers -1 */
 1928|  86.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1928:32): [True: 64.6k, False: 21.5k]
  ------------------
 1929|  64.6k|            {
 1930|       |                /* derive the layer map ctxt */
 1931|  64.6k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1932|  64.6k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1933|  64.6k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1934|       |
 1935|       |                /* initialise the pointers */
 1936|  64.6k|                ps_luma_map->ps_x_pos_phase = ps_pos_phase_map;
 1937|  64.6k|                ps_pos_phase_map += (H264_MAX_FRAME_WIDTH);
  ------------------
  |  |   39|  64.6k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1938|  64.6k|                ps_chroma_map->ps_x_pos_phase = ps_pos_phase_map;
 1939|  64.6k|                ps_pos_phase_map += (H264_MAX_FRAME_WIDTH);
  ------------------
  |  |   39|  64.6k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 1940|       |
 1941|  64.6k|            } /* end of loop over resolution layers */
 1942|       |
 1943|       |            /****************** Vert position phase ******************/
 1944|       |
 1945|  21.5k|            size = (H264_MAX_FRAME_HEIGHT) *MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   40|  21.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                          size = (H264_MAX_FRAME_HEIGHT) *MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1946|  21.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1947|  21.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1948|  21.5k|            memset(pv_buf, 0, size);
 1949|  21.5k|            ps_pos_phase_map = pv_buf;
 1950|       |
 1951|       |            /* loop over num layers -1 */
 1952|  86.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1952:32): [True: 64.6k, False: 21.5k]
  ------------------
 1953|  64.6k|            {
 1954|       |                /* derive the layer map ctxt */
 1955|  64.6k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1956|  64.6k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1957|  64.6k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1958|       |
 1959|       |                /* initialise the pointers */
 1960|  64.6k|                ps_luma_map->ps_y_pos_phase = ps_pos_phase_map;
 1961|  64.6k|                ps_pos_phase_map += (H264_MAX_FRAME_HEIGHT);
  ------------------
  |  |   40|  64.6k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1962|  64.6k|                ps_chroma_map->ps_y_pos_phase = ps_pos_phase_map;
 1963|  64.6k|                ps_pos_phase_map += (H264_MAX_FRAME_HEIGHT);
  ------------------
  |  |   40|  64.6k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 1964|       |
 1965|  64.6k|            } /* end of loop over resolution layers */
 1966|       |
 1967|       |            /**************** XD Index ******************************/
 1968|  21.5k|            size = (MB_WIDTH) *MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   67|  21.5k|#define MB_WIDTH 16
  ------------------
                          size = (MB_WIDTH) *MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1969|  21.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1970|  21.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1971|  21.5k|            memset(pv_buf, 0, size);
 1972|  21.5k|            pi2_mem = pv_buf;
 1973|       |
 1974|       |            /* loop over num layers -1 */
 1975|  86.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1975:32): [True: 64.6k, False: 21.5k]
  ------------------
 1976|  64.6k|            {
 1977|       |                /* derive the layer map ctxt */
 1978|  64.6k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 1979|  64.6k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1980|  64.6k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1981|       |
 1982|       |                /* initialise the pointers */
 1983|  64.6k|                ps_luma_map->pi2_xd_index = pi2_mem;
 1984|  64.6k|                pi2_mem += MB_WIDTH;
  ------------------
  |  |   67|  64.6k|#define MB_WIDTH 16
  ------------------
 1985|  64.6k|                ps_chroma_map->pi2_xd_index = pi2_mem;
 1986|  64.6k|                pi2_mem += MB_WIDTH;
  ------------------
  |  |   67|  64.6k|#define MB_WIDTH 16
  ------------------
 1987|       |
 1988|  64.6k|            } /* end of loop over resolution layers */
 1989|       |
 1990|       |            /**************** YD Index ******************************/
 1991|  21.5k|            size = (MB_HEIGHT) *MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   68|  21.5k|#define MB_HEIGHT 16
  ------------------
                          size = (MB_HEIGHT) *MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 1992|  21.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 1993|  21.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 1994|  21.5k|            memset(pv_buf, 0, size);
 1995|  21.5k|            pi2_mem = pv_buf;
 1996|       |
 1997|       |            /* loop over num layers -1 */
 1998|  86.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (1998:32): [True: 64.6k, False: 21.5k]
  ------------------
 1999|  64.6k|            {
 2000|       |                /* derive the layer map ctxt */
 2001|  64.6k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2002|  64.6k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2003|  64.6k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2004|       |
 2005|       |                /* initialise the pointers */
 2006|  64.6k|                ps_luma_map->pi2_yd_index = pi2_mem;
 2007|  64.6k|                pi2_mem += MB_HEIGHT;
  ------------------
  |  |   68|  64.6k|#define MB_HEIGHT 16
  ------------------
 2008|  64.6k|                ps_chroma_map->pi2_yd_index = pi2_mem;
 2009|  64.6k|                pi2_mem += MB_HEIGHT;
  ------------------
  |  |   68|  64.6k|#define MB_HEIGHT 16
  ------------------
 2010|       |
 2011|  64.6k|            } /* end of loop over resolution layers */
 2012|       |
 2013|       |            /**************** YA Index ******************************/
 2014|  21.5k|            size = MB_HEIGHT * MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   68|  21.5k|#define MB_HEIGHT 16
  ------------------
                          size = MB_HEIGHT * MAX_NUM_RES_LYRS * 2 * sizeof(WORD16);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2015|  21.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2016|  21.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2017|  21.5k|            memset(pv_buf, 0, size);
 2018|  21.5k|            pi2_mem = pv_buf;
 2019|       |
 2020|       |            /* loop over num layers -1 */
 2021|  86.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2021:32): [True: 64.6k, False: 21.5k]
  ------------------
 2022|  64.6k|            {
 2023|       |                /* derive the layer map ctxt */
 2024|  64.6k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2025|  64.6k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2026|  64.6k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2027|       |
 2028|       |                /* initialise the pointers */
 2029|  64.6k|                ps_luma_map->pi2_ya_index = pi2_mem;
 2030|  64.6k|                pi2_mem += MB_HEIGHT;
  ------------------
  |  |   68|  64.6k|#define MB_HEIGHT 16
  ------------------
 2031|  64.6k|                ps_chroma_map->pi2_ya_index = pi2_mem;
 2032|  64.6k|                pi2_mem += MB_HEIGHT;
  ------------------
  |  |   68|  64.6k|#define MB_HEIGHT 16
  ------------------
 2033|       |
 2034|  64.6k|            } /* end of loop over resolution layers */
 2035|       |
 2036|       |            /**************** Horizontal segment lookup **************************/
 2037|       |            /* (MB_WIDTH x seg_lookup_desc_t) x (num layers - 1)   (for luma   )*/
 2038|       |            /* (BLOCK_WIDTH x seg_lookup_desc_t) x (num layers - 1) (for chroma )*/
 2039|  21.5k|            size = (MB_WIDTH * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   67|  21.5k|#define MB_WIDTH 16
  ------------------
                          size = (MB_WIDTH * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2040|       |
 2041|  21.5k|            size += (BLOCK_WIDTH * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   64|  21.5k|#define BLOCK_WIDTH 8
  ------------------
                          size += (BLOCK_WIDTH * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2042|       |
 2043|  21.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2044|  21.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2045|  21.5k|            memset(pv_buf, 0, size);
 2046|  21.5k|            ps_seg_lookup = pv_buf;
 2047|       |
 2048|       |            /* loop over num layers -1 */
 2049|  86.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2049:32): [True: 64.6k, False: 21.5k]
  ------------------
 2050|  64.6k|            {
 2051|       |                /* derive the layer map ctxt */
 2052|  64.6k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2053|  64.6k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2054|  64.6k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2055|       |
 2056|       |                /* initialise the pointers */
 2057|  64.6k|                ps_luma_map->ps_seg_lookup_horz = ps_seg_lookup;
 2058|  64.6k|                ps_seg_lookup += MB_WIDTH;
  ------------------
  |  |   67|  64.6k|#define MB_WIDTH 16
  ------------------
 2059|  64.6k|                ps_chroma_map->ps_seg_lookup_horz = ps_seg_lookup;
 2060|  64.6k|                ps_seg_lookup += BLOCK_WIDTH;
  ------------------
  |  |   64|  64.6k|#define BLOCK_WIDTH 8
  ------------------
 2061|       |
 2062|  64.6k|            } /* end of loop over resolution layers */
 2063|       |
 2064|       |            /**************** Vertical segment lookup ****************************/
 2065|       |            /* (MB_HEIGHT x seg_lookup_desc_t) x (num layers - 1)    (for luma  )*/
 2066|       |            /* (BLOCK_HEIGHT x seg_lookup_desc_t) x (num layers - 1) (for chroma)*/
 2067|  21.5k|            size = (MB_HEIGHT * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   68|  21.5k|#define MB_HEIGHT 16
  ------------------
                          size = (MB_HEIGHT * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2068|       |
 2069|  21.5k|            size += (BLOCK_HEIGHT * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   65|  21.5k|#define BLOCK_HEIGHT 8
  ------------------
                          size += (BLOCK_HEIGHT * sizeof(seg_lookup_desc_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2070|       |
 2071|  21.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2072|  21.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2073|  21.5k|            memset(pv_buf, 0, size);
 2074|  21.5k|            ps_seg_lookup = pv_buf;
 2075|       |
 2076|       |            /* loop over num layers -1 */
 2077|  86.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2077:32): [True: 64.6k, False: 21.5k]
  ------------------
 2078|  64.6k|            {
 2079|       |                /* derive the layer map ctxt */
 2080|  64.6k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2081|  64.6k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2082|  64.6k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2083|       |
 2084|       |                /* initialise the pointers */
 2085|  64.6k|                ps_luma_map->ps_seg_lookup_vert = ps_seg_lookup;
 2086|  64.6k|                ps_seg_lookup += MB_HEIGHT;
  ------------------
  |  |   68|  64.6k|#define MB_HEIGHT 16
  ------------------
 2087|  64.6k|                ps_chroma_map->ps_seg_lookup_vert = ps_seg_lookup;
 2088|  64.6k|                ps_seg_lookup += BLOCK_HEIGHT;
  ------------------
  |  |   65|  64.6k|#define BLOCK_HEIGHT 8
  ------------------
 2089|       |
 2090|  64.6k|            } /* end of loop over resolution layers */
 2091|       |
 2092|       |            /**************** X and Y Reference Array Index lookup ***************/
 2093|       |            /* (MAX_REF_IDX_ARRAY) x (num layers - 1)     (for luma  x-index)     */
 2094|       |            /* (MAX_REF_IDX_ARRAY) x (num layers - 1)     (for luma  y-index)     */
 2095|       |            /* (MAX_REF_IDX_ARRAY) x (num layers - 1)     (for chroma x-index)    */
 2096|       |            /* (MAX_REF_IDX_ARRAY) x (num layers - 1)     (for chroma y-index)    */
 2097|       |            /*********************************************************************/
 2098|  21.5k|            size = (MAX_REF_IDX_ARRAY * MAX_NUM_RES_LYRS * 4);
  ------------------
  |  |   55|  21.5k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  21.5k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  21.5k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
                          size = (MAX_REF_IDX_ARRAY * MAX_NUM_RES_LYRS * 4);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2099|  21.5k|            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2100|  21.5k|            RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2101|  21.5k|            memset(pv_buf, 0, size);
 2102|  21.5k|            pu1_mem = pv_buf;
 2103|       |
 2104|       |            /* loop over num layers -1 */
 2105|  86.1k|            for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2105:32): [True: 64.6k, False: 21.5k]
  ------------------
 2106|  64.6k|            {
 2107|       |                /* derive the layer map ctxt */
 2108|  64.6k|                ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2109|  64.6k|                ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2110|  64.6k|                ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2111|       |
 2112|       |                /* initialise the pointers */
 2113|  64.6k|                ps_luma_map->pu1_refarray_x_idx = pu1_mem;
 2114|  64.6k|                pu1_mem += MAX_REF_IDX_ARRAY;
  ------------------
  |  |   55|  64.6k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  64.6k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  64.6k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
 2115|       |
 2116|  64.6k|                ps_luma_map->pu1_refarray_y_idx = pu1_mem;
 2117|  64.6k|                pu1_mem += MAX_REF_IDX_ARRAY;
  ------------------
  |  |   55|  64.6k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  64.6k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  64.6k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
 2118|       |
 2119|  64.6k|                ps_chroma_map->pu1_refarray_x_idx = pu1_mem;
 2120|  64.6k|                pu1_mem += MAX_REF_IDX_ARRAY;
  ------------------
  |  |   55|  64.6k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  64.6k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  64.6k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
 2121|       |
 2122|  64.6k|                ps_chroma_map->pu1_refarray_y_idx = pu1_mem;
 2123|  64.6k|                pu1_mem += MAX_REF_IDX_ARRAY;
  ------------------
  |  |   55|  64.6k|#define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   53|  64.6k|#define MAX_REF_ARR_WD_HT 48
  |  |  ------------------
  |  |               #define MAX_REF_IDX_ARRAY (MAX_REF_ARR_WD_HT + MB_WIDTH)
  |  |  ------------------
  |  |  |  |   67|  64.6k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
 2124|       |
 2125|  64.6k|            } /* end of loop over resolution layers */
 2126|  21.5k|        }
 2127|       |
 2128|      0|        size = ((sizeof(intra_inter_pred_ctxt_t) + 127) >> 7) << 7;
 2129|  21.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2130|  21.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2131|  21.5k|        memset(pv_buf, 0, size);
 2132|  21.5k|        ps_ii_pred_ctxt = pv_buf;
 2133|  21.5k|    }
 2134|       |
 2135|      0|    ps_svcd_ctxt->pv_intra_sample_ctxt = ps_ctxt;
 2136|  21.5k|    ps_svcd_ctxt->pv_ii_pred_ctxt = ps_ii_pred_ctxt;
 2137|       |
 2138|  86.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2138:26): [True: 64.6k, False: 21.5k]
  ------------------
 2139|  64.6k|    {
 2140|  64.6k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 2141|  64.6k|        ps_svc_lyr_dec->pv_intra_sample_ctxt = ps_svcd_ctxt->pv_intra_sample_ctxt;
 2142|  64.6k|        ps_svc_lyr_dec->pv_ii_pred_ctxt = ps_svcd_ctxt->pv_ii_pred_ctxt;
 2143|  64.6k|    }
 2144|       |
 2145|  21.5k|    return IV_SUCCESS;
 2146|  21.5k|}
isvcd_residual_resample_ctxt_create:
 2170|  21.5k|{
 2171|  21.5k|    isvcd_create_ip_t *ps_create_ip;
 2172|  21.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 2173|  21.5k|    void *pv_buf;
 2174|  21.5k|    UWORD8 u1_layer_id;
 2175|  21.5k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 2176|  21.5k|    void *pv_mem_ctxt;
 2177|  21.5k|    WORD32 size;
 2178|       |
 2179|  21.5k|    residual_sampling_ctxt_t *ps_ctxt;
 2180|  21.5k|    res_lyr_ctxt *ps_lyr_ctxt;
 2181|  21.5k|    UNUSED(pv_api_op);
  ------------------
  |  |   45|  21.5k|#define UNUSED(x) ((void)(x))
  ------------------
 2182|  21.5k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 2183|       |
 2184|  21.5k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 2185|  21.5k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 2186|       |
 2187|       |    /* allocate context structure */
 2188|  21.5k|    size = ((sizeof(residual_sampling_ctxt_t) + 127) >> 7) << 7;
 2189|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2190|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2191|  21.5k|    memset(pv_buf, 0, size);
 2192|  21.5k|    ps_ctxt = pv_buf;
 2193|       |
 2194|       |    /* reference array buffer  */
 2195|  21.5k|    size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * sizeof(WORD16);
  ------------------
  |  |   45|  21.5k|#define REF_ARRAY_WIDTH_RES_SAMP (MB_WIDTH + 6)
  |  |  ------------------
  |  |  |  |   67|  21.5k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
                  size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * sizeof(WORD16);
  ------------------
  |  |   46|  21.5k|#define REF_ARRAY_HEIGHT_RES_SAMP (MB_HEIGHT + 6)
  |  |  ------------------
  |  |  |  |   68|  21.5k|#define MB_HEIGHT 16
  |  |  ------------------
  ------------------
 2196|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2197|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2198|  21.5k|    memset(pv_buf, 0, size);
 2199|  21.5k|    ps_ctxt->pi2_refarray_buffer = pv_buf;
 2200|       |
 2201|       |    /* reference array pointer increment buffer */
 2202|  21.5k|    {
 2203|  21.5k|        WORD32 i4_size;
 2204|       |
 2205|  21.5k|        i4_size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * sizeof(UWORD8);
  ------------------
  |  |   45|  21.5k|#define REF_ARRAY_WIDTH_RES_SAMP (MB_WIDTH + 6)
  |  |  ------------------
  |  |  |  |   67|  21.5k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
                      i4_size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * sizeof(UWORD8);
  ------------------
  |  |   46|  21.5k|#define REF_ARRAY_HEIGHT_RES_SAMP (MB_HEIGHT + 6)
  |  |  ------------------
  |  |  |  |   68|  21.5k|#define MB_HEIGHT 16
  |  |  ------------------
  ------------------
 2206|  21.5k|        size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * 2 * sizeof(UWORD8);
  ------------------
  |  |   45|  21.5k|#define REF_ARRAY_WIDTH_RES_SAMP (MB_WIDTH + 6)
  |  |  ------------------
  |  |  |  |   67|  21.5k|#define MB_WIDTH 16
  |  |  ------------------
  ------------------
                      size = REF_ARRAY_WIDTH_RES_SAMP * REF_ARRAY_HEIGHT_RES_SAMP * 2 * sizeof(UWORD8);
  ------------------
  |  |   46|  21.5k|#define REF_ARRAY_HEIGHT_RES_SAMP (MB_HEIGHT + 6)
  |  |  ------------------
  |  |  |  |   68|  21.5k|#define MB_HEIGHT 16
  |  |  ------------------
  ------------------
 2207|  21.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2208|  21.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2209|  21.5k|        memset(pv_buf, 0, size);
 2210|  21.5k|        ps_ctxt->pu1_ref_x_ptr_incr = pv_buf;
 2211|  21.5k|        ps_ctxt->pu1_ref_y_ptr_incr = ps_ctxt->pu1_ref_x_ptr_incr + i4_size;
 2212|  21.5k|    }
 2213|       |
 2214|       |    /****************** projected locations buffers ******************/
 2215|      0|    {
 2216|  21.5k|        residual_samp_map_ctxt_t *ps_luma_map;
 2217|  21.5k|        residual_samp_map_ctxt_t *ps_chroma_map;
 2218|  21.5k|        WORD32 i4_lyr_id;
 2219|  21.5k|        ref_mb_map_t *ps_off_len_map;
 2220|  21.5k|        ref_pixel_map_t *ps_pos_phase_map;
 2221|       |
 2222|       |        /****************** Horz offset length ******************/
 2223|  21.5k|        size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   39|  21.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                      size = (H264_MAX_FRAME_WIDTH >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2224|  21.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2225|  21.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2226|  21.5k|        memset(pv_buf, 0, size);
 2227|  21.5k|        ps_off_len_map = pv_buf;
 2228|       |
 2229|       |        /* loop over num layers -1 */
 2230|  86.1k|        for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2230:28): [True: 64.6k, False: 21.5k]
  ------------------
 2231|  64.6k|        {
 2232|       |            /* derive the layer map ctxt */
 2233|  64.6k|            ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2234|  64.6k|            ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2235|  64.6k|            ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2236|       |
 2237|       |            /* initialise the pointers */
 2238|  64.6k|            ps_luma_map->ps_x_offset_length = ps_off_len_map;
 2239|  64.6k|            ps_off_len_map += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  64.6k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2240|  64.6k|            ps_chroma_map->ps_x_offset_length = ps_off_len_map;
 2241|  64.6k|            ps_off_len_map += (H264_MAX_FRAME_WIDTH >> 4);
  ------------------
  |  |   39|  64.6k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2242|       |
 2243|  64.6k|        } /* end of loop over resolution layers */
 2244|       |
 2245|       |        /****************** Vert offset length ******************/
 2246|  21.5k|        size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   40|  21.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                      size = (H264_MAX_FRAME_HEIGHT >> 4) * MAX_NUM_RES_LYRS * 2 * sizeof(ref_mb_map_t);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2247|  21.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2248|  21.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2249|  21.5k|        memset(pv_buf, 0, size);
 2250|  21.5k|        ps_off_len_map = pv_buf;
 2251|       |
 2252|       |        /* loop over num layers -1 */
 2253|  86.1k|        for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2253:28): [True: 64.6k, False: 21.5k]
  ------------------
 2254|  64.6k|        {
 2255|       |            /* derive the layer map ctxt */
 2256|  64.6k|            ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2257|  64.6k|            ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2258|  64.6k|            ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2259|       |
 2260|       |            /* initialise the pointers */
 2261|  64.6k|            ps_luma_map->ps_y_offset_length = ps_off_len_map;
 2262|  64.6k|            ps_off_len_map += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  64.6k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2263|  64.6k|            ps_chroma_map->ps_y_offset_length = ps_off_len_map;
 2264|  64.6k|            ps_off_len_map += (H264_MAX_FRAME_HEIGHT >> 4);
  ------------------
  |  |   40|  64.6k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2265|       |
 2266|  64.6k|        } /* end of loop over resolution layers */
 2267|       |
 2268|       |        /****************** Horz position phase ******************/
 2269|  21.5k|        size = H264_MAX_FRAME_WIDTH * MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   39|  21.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                      size = H264_MAX_FRAME_WIDTH * MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2270|  21.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2271|  21.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2272|  21.5k|        memset(pv_buf, 0, size);
 2273|  21.5k|        ps_pos_phase_map = pv_buf;
 2274|       |
 2275|       |        /* loop over num layers -1 */
 2276|  86.1k|        for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2276:28): [True: 64.6k, False: 21.5k]
  ------------------
 2277|  64.6k|        {
 2278|       |            /* derive the layer map ctxt */
 2279|  64.6k|            ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2280|  64.6k|            ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2281|  64.6k|            ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2282|       |
 2283|       |            /* initialise the pointers */
 2284|  64.6k|            ps_luma_map->ps_x_pos_phase = ps_pos_phase_map;
 2285|  64.6k|            ps_pos_phase_map += H264_MAX_FRAME_WIDTH;
  ------------------
  |  |   39|  64.6k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2286|  64.6k|            ps_chroma_map->ps_x_pos_phase = ps_pos_phase_map;
 2287|  64.6k|            ps_pos_phase_map += H264_MAX_FRAME_WIDTH;
  ------------------
  |  |   39|  64.6k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2288|       |
 2289|  64.6k|        } /* end of loop over resolution layers */
 2290|       |
 2291|       |        /****************** Vert position phase ******************/
 2292|       |
 2293|  21.5k|        size = H264_MAX_FRAME_HEIGHT * MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   40|  21.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                      size = H264_MAX_FRAME_HEIGHT * MAX_NUM_RES_LYRS * 2 * sizeof(ref_pixel_map_t);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2294|  21.5k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2295|  21.5k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2296|  21.5k|        memset(pv_buf, 0, size);
 2297|  21.5k|        ps_pos_phase_map = pv_buf;
 2298|       |
 2299|       |        /* loop over num layers -1 */
 2300|  86.1k|        for(i4_lyr_id = 0; i4_lyr_id < MAX_NUM_RES_LYRS; i4_lyr_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2300:28): [True: 64.6k, False: 21.5k]
  ------------------
 2301|  64.6k|        {
 2302|       |            /* derive the layer map ctxt */
 2303|  64.6k|            ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[i4_lyr_id];
 2304|  64.6k|            ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 2305|  64.6k|            ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2306|       |
 2307|       |            /* initialise the pointers */
 2308|  64.6k|            ps_luma_map->ps_y_pos_phase = ps_pos_phase_map;
 2309|  64.6k|            ps_pos_phase_map += H264_MAX_FRAME_HEIGHT;
  ------------------
  |  |   40|  64.6k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2310|  64.6k|            ps_chroma_map->ps_y_pos_phase = ps_pos_phase_map;
 2311|  64.6k|            ps_pos_phase_map += H264_MAX_FRAME_HEIGHT;
  ------------------
  |  |   40|  64.6k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2312|       |
 2313|  64.6k|        } /* end of loop over resolution layers */
 2314|  21.5k|    }
 2315|       |
 2316|      0|    ps_svcd_ctxt->pv_residual_sample_ctxt = ps_ctxt;
 2317|       |
 2318|  86.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2318:26): [True: 64.6k, False: 21.5k]
  ------------------
 2319|  64.6k|    {
 2320|  64.6k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 2321|  64.6k|        ps_svc_lyr_dec->pv_residual_sample_ctxt = ps_svcd_ctxt->pv_residual_sample_ctxt;
 2322|  64.6k|    }
 2323|  21.5k|    return IV_SUCCESS;
 2324|  21.5k|}
isvcd_mode_mv_resample_ctxt_create:
 2347|  21.5k|{
 2348|  21.5k|    isvcd_create_ip_t *ps_create_ip;
 2349|  21.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 2350|  21.5k|    void *pv_buf;
 2351|  21.5k|    WORD16 *pi2_mem;
 2352|  21.5k|    UWORD8 u1_layer_id;
 2353|  21.5k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 2354|  21.5k|    void *pv_mem_ctxt;
 2355|  21.5k|    WORD32 size, i4_res_id;
 2356|  21.5k|    ref_lyr_scaled_offset_t *ps_ref_pic_offsets;
 2357|  21.5k|    mode_motion_ctxt_t *ps_mode_motion;
 2358|  21.5k|    mode_motion_lyr_ctxt *ps_lyr_mem;
 2359|  21.5k|    UNUSED(pv_api_op);
  ------------------
  |  |   45|  21.5k|#define UNUSED(x) ((void)(x))
  ------------------
 2360|  21.5k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 2361|       |
 2362|  21.5k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 2363|  21.5k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 2364|       |
 2365|  21.5k|    size = ((sizeof(mode_motion_ctxt_t) + 127) >> 7) << 7;
 2366|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2367|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2368|  21.5k|    memset(pv_buf, 0, size);
 2369|  21.5k|    ps_mode_motion = pv_buf;
 2370|       |
 2371|       |    /* motion pred structure */
 2372|  21.5k|    size = 2 * NUM_MB_PARTS * NUM_SUB_MB_PARTS * sizeof(mv_pred_t);
  ------------------
  |  |   59|  21.5k|#define NUM_MB_PARTS 4
  ------------------
                  size = 2 * NUM_MB_PARTS * NUM_SUB_MB_PARTS * sizeof(mv_pred_t);
  ------------------
  |  |   60|  21.5k|#define NUM_SUB_MB_PARTS 4
  ------------------
 2373|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2374|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2375|  21.5k|    memset(pv_buf, 0, size);
 2376|  21.5k|    ps_mode_motion->ps_motion_pred_struct = (mv_pred_t *) pv_buf;
 2377|       |
 2378|       |    /* projected locations X */
 2379|  21.5k|    size = H264_MAX_FRAME_WIDTH * MAX_NUM_RES_LYRS * sizeof(WORD16);
  ------------------
  |  |   39|  21.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                  size = H264_MAX_FRAME_WIDTH * MAX_NUM_RES_LYRS * sizeof(WORD16);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2380|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2381|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2382|  21.5k|    memset(pv_buf, 0, size);
 2383|  21.5k|    pi2_mem = (WORD16 *) pv_buf;
 2384|       |
 2385|       |    /* loop over NUM resolution layers */
 2386|  86.1k|    for(i4_res_id = 0; i4_res_id < MAX_NUM_RES_LYRS; i4_res_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2386:24): [True: 64.6k, False: 21.5k]
  ------------------
 2387|  64.6k|    {
 2388|  64.6k|        ps_lyr_mem = &ps_mode_motion->as_res_lyr_mem[i4_res_id];
 2389|       |
 2390|       |        /* initialise the pointers */
 2391|  64.6k|        ps_lyr_mem->pi2_ref_loc_x = pi2_mem;
 2392|       |
 2393|       |        /* increment the buffer pointer */
 2394|  64.6k|        pi2_mem += H264_MAX_FRAME_WIDTH;
  ------------------
  |  |   39|  64.6k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
 2395|       |
 2396|  64.6k|    } /* end of loop over num resolution layers */
 2397|       |
 2398|       |    /* projected locations Y */
 2399|  21.5k|    size = H264_MAX_FRAME_HEIGHT * MAX_NUM_RES_LYRS * sizeof(WORD16);
  ------------------
  |  |   40|  21.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                  size = H264_MAX_FRAME_HEIGHT * MAX_NUM_RES_LYRS * sizeof(WORD16);
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2400|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2401|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2402|  21.5k|    memset(pv_buf, 0, size);
 2403|  21.5k|    pi2_mem = (WORD16 *) pv_buf;
 2404|       |    /* loop over NUM resolution layers */
 2405|  86.1k|    for(i4_res_id = 0; i4_res_id < MAX_NUM_RES_LYRS; i4_res_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2405:24): [True: 64.6k, False: 21.5k]
  ------------------
 2406|  64.6k|    {
 2407|  64.6k|        ps_lyr_mem = &ps_mode_motion->as_res_lyr_mem[i4_res_id];
 2408|       |
 2409|       |        /* initialise the pointers */
 2410|  64.6k|        ps_lyr_mem->pi2_ref_loc_y = pi2_mem;
 2411|       |        /* increment the buffer pointer */
 2412|  64.6k|        pi2_mem += H264_MAX_FRAME_HEIGHT;
  ------------------
  |  |   40|  64.6k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
 2413|       |
 2414|  64.6k|    } /* end of loop over num resolution layers */
 2415|       |
 2416|  21.5k|    size = sizeof(ref_lyr_scaled_offset_t) * MAX_NUM_RES_LYRS * MAX_NUM_PIC_BUFS;
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
                  size = sizeof(ref_lyr_scaled_offset_t) * MAX_NUM_RES_LYRS * MAX_NUM_PIC_BUFS;
  ------------------
  |  |   99|  21.5k|#define MAX_NUM_PIC_BUFS (32 + 1)
  ------------------
 2417|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2418|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2419|  21.5k|    memset(pv_buf, 0, size);
 2420|  21.5k|    ps_svcd_ctxt->pv_ref_lyr_offset = pv_buf;
 2421|       |
 2422|       |    /* loop over NUM resolution layers */
 2423|  21.5k|    ps_ref_pic_offsets = (ref_lyr_scaled_offset_t *) ps_svcd_ctxt->pv_ref_lyr_offset;
 2424|       |
 2425|  86.1k|    for(i4_res_id = 0; i4_res_id < MAX_NUM_RES_LYRS; i4_res_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2425:24): [True: 64.6k, False: 21.5k]
  ------------------
 2426|  64.6k|    {
 2427|  64.6k|        ps_lyr_mem = &ps_mode_motion->as_res_lyr_mem[i4_res_id];
 2428|       |
 2429|       |        /* store the current resolution layer pic offset start pointer */
 2430|  64.6k|        ps_lyr_mem->ps_ref_pic_lyr_offsets = ps_ref_pic_offsets + (i4_res_id * MAX_NUM_PIC_BUFS);
  ------------------
  |  |   99|  64.6k|#define MAX_NUM_PIC_BUFS (32 + 1)
  ------------------
 2431|       |
 2432|  64.6k|    } /* end of loop over num resolution layers */
 2433|       |
 2434|  21.5k|    ps_svcd_ctxt->pv_mode_mv_sample_ctxt = ps_mode_motion;
 2435|       |
 2436|  86.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2436:26): [True: 64.6k, False: 21.5k]
  ------------------
 2437|  64.6k|    {
 2438|  64.6k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 2439|  64.6k|        ps_svc_lyr_dec->pv_mode_mv_sample_ctxt = ps_svcd_ctxt->pv_mode_mv_sample_ctxt;
 2440|  64.6k|        ps_svc_lyr_dec->pv_ref_lyr_offset = ps_svcd_ctxt->pv_ref_lyr_offset;
 2441|  64.6k|    }
 2442|  21.5k|    return IV_SUCCESS;
 2443|  21.5k|}
isvcd_allocate_static_bufs:
 2465|  21.5k|{
 2466|  21.5k|    isvcd_create_ip_t *ps_create_ip;
 2467|  21.5k|    isvcd_create_op_t *ps_create_op;
 2468|  21.5k|    void *pv_buf;
 2469|  21.5k|    UWORD8 *pu1_buf;
 2470|  21.5k|    dec_struct_t *ps_dec;
 2471|  21.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 2472|  21.5k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 2473|  21.5k|    void *(*pf_aligned_alloc)(void *pv_mem_ctxt, WORD32 alignment, WORD32 size);
 2474|  21.5k|    void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 2475|  21.5k|    void *pv_mem_ctxt;
 2476|  21.5k|    WORD32 size;
 2477|  21.5k|    UWORD8 u1_layer_id, u1_sps_ctr;
 2478|  21.5k|    UWORD8 u1_chroma_format;
 2479|  21.5k|    WORD32 ret;
 2480|       |
 2481|  21.5k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 2482|  21.5k|    ps_create_op = (isvcd_create_op_t *) pv_api_op;
 2483|       |
 2484|  21.5k|    ps_create_op->s_ivd_create_op_t.u4_error_code = 0;
 2485|  21.5k|    pf_aligned_alloc = ps_create_ip->s_ivd_create_ip_t.pf_aligned_alloc;
 2486|  21.5k|    pf_aligned_free = ps_create_ip->s_ivd_create_ip_t.pf_aligned_free;
 2487|  21.5k|    pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 2488|  21.5k|    u1_chroma_format = (UWORD8) (ps_create_ip->s_ivd_create_ip_t.e_output_format);
 2489|       |
 2490|  21.5k|    if((u1_chroma_format != IV_YUV_420P) && (u1_chroma_format != IV_YUV_420SP_UV) &&
  ------------------
  |  Branch (2490:8): [True: 12.3k, False: 9.19k]
  |  Branch (2490:45): [True: 5.71k, False: 6.64k]
  ------------------
 2491|  5.71k|       (u1_chroma_format != IV_YUV_420SP_VU))
  ------------------
  |  Branch (2491:8): [True: 10, False: 5.70k]
  ------------------
 2492|     10|    {
 2493|     10|        ps_create_op->s_ivd_create_op_t.pv_handle = NULL;
 2494|       |
 2495|     10|        return IV_FAIL;
 2496|     10|    }
 2497|       |
 2498|       |    /* Initialize return handle to NULL */
 2499|  21.5k|    ps_create_op->s_ivd_create_op_t.pv_handle = NULL;
 2500|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, sizeof(iv_obj_t));
 2501|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2502|  21.5k|    memset(pv_buf, 0, sizeof(iv_obj_t));
 2503|  21.5k|    *dec_hdl = (iv_obj_t *) pv_buf;
 2504|  21.5k|    ps_create_op->s_ivd_create_op_t.pv_handle = *dec_hdl;
 2505|       |
 2506|  21.5k|    (*dec_hdl)->pv_codec_handle = NULL;
 2507|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, sizeof(svc_dec_ctxt_t));
 2508|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2509|  21.5k|    (*dec_hdl)->pv_codec_handle = (svc_dec_ctxt_t *) pv_buf;
 2510|  21.5k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) pv_buf;
 2511|       |
 2512|  21.5k|    memset(ps_svcd_ctxt, 0, sizeof(svc_dec_ctxt_t));
 2513|       |
 2514|  21.5k|    ps_svcd_ctxt->u1_prev_num_res_layers = UINT8_MAX;
 2515|  21.5k|    ps_svcd_ctxt->u1_pre_parse_in_flush = 1;
 2516|       |    /* set default to maximum values supported */
 2517|  21.5k|    ps_svcd_ctxt->u1_tgt_dep_id = MAX_DEPENDENCY_ID;
  ------------------
  |  |  103|  21.5k|#define MAX_DEPENDENCY_ID 4
  ------------------
 2518|  21.5k|    ps_svcd_ctxt->u1_tgt_quality_id = MAX_QUALITY_ID;
  ------------------
  |  |  102|  21.5k|#define MAX_QUALITY_ID 0
  ------------------
 2519|  21.5k|    ps_svcd_ctxt->u1_tgt_temp_id = MAX_TEMPORAL_ID;
  ------------------
  |  |  104|  21.5k|#define MAX_TEMPORAL_ID 7
  ------------------
 2520|  21.5k|    ps_svcd_ctxt->u1_tgt_priority_id = MAX_PRIORITY_ID;
  ------------------
  |  |  105|  21.5k|#define MAX_PRIORITY_ID 63
  ------------------
 2521|       |
 2522|       |    /* two sets of MAX_NUM_SEQ_PARAMS are created one for sps-base layer;  one for
 2523|       |     * subset_sps- enhancement*/
 2524|  21.5k|    size = ((sizeof(dec_seq_params_t)) * MAX_NUM_SEQ_PARAMS * 2);
  ------------------
  |  |  521|  21.5k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 2525|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2526|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2527|  21.5k|    memset(pv_buf, 0, size);
 2528|  21.5k|    ps_svcd_ctxt->ps_sps = pv_buf;
 2529|       |
 2530|       |    /* two sets of MAX_NUM_SEQ_PARAMS are created one for sps-base layer;  one for
 2531|       |     * subset_sps- enhancement*/
 2532|  21.5k|    size = ((sizeof(dec_svc_seq_params_t)) * MAX_NUM_SEQ_PARAMS * 2);
  ------------------
  |  |  521|  21.5k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 2533|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2534|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2535|  21.5k|    memset(pv_buf, 0, size);
 2536|  21.5k|    ps_svcd_ctxt->ps_subset_sps = pv_buf;
 2537|       |
 2538|  1.40M|    for(u1_sps_ctr = 0; u1_sps_ctr < (2 * MAX_NUM_SEQ_PARAMS); u1_sps_ctr++)
  ------------------
  |  |  521|  1.40M|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  |  Branch (2538:25): [True: 1.37M, False: 21.5k]
  ------------------
 2539|  1.37M|    {
 2540|  1.37M|        ps_svcd_ctxt->ps_subset_sps[u1_sps_ctr].ps_seq = &ps_svcd_ctxt->ps_sps[u1_sps_ctr];
 2541|  1.37M|    }
 2542|       |
 2543|  21.5k|    size = sizeof(sei);
 2544|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2545|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2546|  21.5k|    memset(pv_buf, 0, size);
 2547|  21.5k|    ps_svcd_ctxt->ps_sei = (sei *) pv_buf;
 2548|       |
 2549|  21.5k|    size = sizeof(sei);
 2550|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2551|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2552|  21.5k|    memset(pv_buf, 0, size);
 2553|  21.5k|    ps_svcd_ctxt->ps_sei_parse = (sei *) pv_buf;
 2554|       |
 2555|  21.5k|    size = (sizeof(dec_pic_params_t)) * MAX_NUM_PIC_PARAMS;
  ------------------
  |  |  524|  21.5k|#define MAX_NUM_PIC_PARAMS 256
  ------------------
 2556|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2557|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2558|  21.5k|    memset(pv_buf, 0, size);
 2559|  21.5k|    ps_svcd_ctxt->ps_pps = pv_buf;
 2560|       |
 2561|  21.5k|    size = (sizeof(svc_dec_lyr_struct_t)) * MAX_NUM_RES_LYRS;
  ------------------
  |  |   94|  21.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
 2562|  21.5k|    pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2563|  21.5k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  21.5k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
 2564|  21.5k|    memset(pv_buf, 0, size);
 2565|  21.5k|    ps_svcd_ctxt->ps_svc_dec_lyr = pv_buf;
 2566|  21.5k|    ps_svcd_ctxt->u1_target_layer_id = 0;
 2567|  21.5k|    ps_svcd_ctxt->u1_cur_layer_id = 0;
 2568|  21.5k|    ps_svcd_ctxt->i4_eos_flag = 0;
 2569|       |
 2570|  21.5k|    ret = isvcd_mode_mv_resample_ctxt_create(ps_svcd_ctxt, pv_api_ip, pv_api_op);
 2571|  21.5k|    if(ret != IV_SUCCESS)
  ------------------
  |  Branch (2571:8): [True: 0, False: 21.5k]
  ------------------
 2572|      0|    {
 2573|      0|        return ret;
 2574|      0|    }
 2575|  21.5k|    ret = isvcd_intra_resample_ctxt_create(ps_svcd_ctxt, pv_api_ip, pv_api_op);
 2576|  21.5k|    if(ret != IV_SUCCESS)
  ------------------
  |  Branch (2576:8): [True: 0, False: 21.5k]
  ------------------
 2577|      0|    {
 2578|      0|        return ret;
 2579|      0|    }
 2580|  21.5k|    ret = isvcd_residual_resample_ctxt_create(ps_svcd_ctxt, pv_api_ip, pv_api_op);
 2581|  21.5k|    if(ret != IV_SUCCESS)
  ------------------
  |  Branch (2581:8): [True: 0, False: 21.5k]
  ------------------
 2582|      0|    {
 2583|      0|        return ret;
 2584|      0|    }
 2585|  21.5k|    ret = isvcd_nal_parse_ctxt_create(ps_svcd_ctxt, pv_api_ip, pv_api_op);
 2586|  21.5k|    if(ret != IV_SUCCESS)
  ------------------
  |  Branch (2586:8): [True: 0, False: 21.5k]
  ------------------
 2587|      0|    {
 2588|      0|        return ret;
 2589|      0|    }
 2590|  86.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (2590:26): [True: 64.6k, False: 21.5k]
  ------------------
 2591|  64.6k|    {
 2592|  64.6k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 2593|  64.6k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 2594|       |
 2595|  64.6k|        ps_svc_lyr_dec->ps_svcd_ctxt = ps_svcd_ctxt;
 2596|  64.6k|        ps_svc_lyr_dec->u1_layer_id = u1_layer_id;
 2597|  64.6k|        ps_svc_lyr_dec->u1_dyadic_flag = 1;
 2598|  64.6k|        ps_svc_lyr_dec->u1_restricted_res_change_flag = 1;
 2599|  64.6k|        ps_svc_lyr_dec->u1_base_res_flag = 1;
 2600|  64.6k|        ps_svc_lyr_dec->u1_ref_layer_id = u1_layer_id - 1;
 2601|  64.6k|        ps_svc_lyr_dec->ps_dec_svc_ref_layer =
 2602|  64.6k|            &ps_svcd_ctxt->ps_svc_dec_lyr[ps_svc_lyr_dec->u1_ref_layer_id];
 2603|  64.6k|        ps_svc_lyr_dec->u4_pps_id_for_layer = UINT32_MAX;
 2604|       |
 2605|  64.6k|#ifndef LOGO_EN
 2606|  64.6k|        ps_dec->u4_share_disp_buf = ps_create_ip->s_ivd_create_ip_t.u4_share_disp_buf;
 2607|       |#else
 2608|       |        ps_dec->u4_share_disp_buf = 0;
 2609|       |#endif
 2610|       |
 2611|  64.6k|        ps_dec->u1_chroma_format = (UWORD8) (ps_create_ip->s_ivd_create_ip_t.e_output_format);
 2612|       |
 2613|  64.6k|        if((ps_dec->u1_chroma_format != IV_YUV_420P) &&
  ------------------
  |  Branch (2613:12): [True: 37.0k, False: 27.5k]
  ------------------
 2614|  37.0k|           (ps_dec->u1_chroma_format != IV_YUV_420SP_UV) &&
  ------------------
  |  Branch (2614:12): [True: 17.1k, False: 19.9k]
  ------------------
 2615|  17.1k|           (ps_dec->u1_chroma_format != IV_YUV_420SP_VU))
  ------------------
  |  Branch (2615:12): [True: 0, False: 17.1k]
  ------------------
 2616|      0|        {
 2617|      0|            ps_dec->u4_share_disp_buf = 0;
 2618|      0|        }
 2619|       |
 2620|  64.6k|        ps_dec->u1_enable_mb_info = ps_create_ip->u4_enable_frame_info;
 2621|  64.6k|        ps_dec->pf_aligned_alloc = pf_aligned_alloc;
 2622|  64.6k|        ps_dec->pf_aligned_free = pf_aligned_free;
 2623|  64.6k|        ps_dec->pv_mem_ctxt = pv_mem_ctxt;
 2624|       |
 2625|  64.6k|        ps_dec->ps_sps = ps_svcd_ctxt->ps_sps;
 2626|  64.6k|        ps_svc_lyr_dec->ps_subset_sps = ps_svcd_ctxt->ps_subset_sps;
 2627|  64.6k|        ps_dec->ps_pps = ps_svcd_ctxt->ps_pps;
 2628|  64.6k|        ps_dec->ps_sei = ps_svcd_ctxt->ps_sei;
 2629|  64.6k|        ps_dec->ps_sei_parse = ps_svcd_ctxt->ps_sei_parse;
 2630|       |
 2631|  64.6k|        size = ithread_get_handle_size();
 2632|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2633|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2634|  64.6k|        memset(pv_buf, 0, size);
 2635|  64.6k|        ps_dec->pv_dec_thread_handle = pv_buf;
 2636|       |
 2637|  64.6k|        size = ithread_get_handle_size();
 2638|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2639|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2640|  64.6k|        memset(pv_buf, 0, size);
 2641|  64.6k|        ps_dec->pv_bs_deblk_thread_handle = pv_buf;
 2642|       |
 2643|       |#ifdef KEEP_THREADS_ACTIVE
 2644|       |        {
 2645|       |            UWORD32 i;
 2646|       |            /* Request memory to hold mutex (start/done) for both threads */
 2647|       |            size = ithread_get_mutex_lock_size() << 2;
 2648|       |            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 8, size);
 2649|       |            RETURN_IF((NULL == pv_buf), IV_FAIL);
 2650|       |            memset(pv_buf, 0, size);
 2651|       |
 2652|       |            // init mutex variable for both the threads
 2653|       |            // 1. ih264d_decode_picture_thread
 2654|       |            // 2. ih264d_recon_deblk_thread
 2655|       |            for(i = 0; i < 2; i++)
 2656|       |            {
 2657|       |                WORD32 ret;
 2658|       |                WORD32 mutex_size = ithread_get_mutex_lock_size();
 2659|       |
 2660|       |                ps_dec->apv_proc_start_mutex[i] = (UWORD8 *) pv_buf + (2 * i * mutex_size);
 2661|       |                ps_dec->apv_proc_done_mutex[i] = (UWORD8 *) pv_buf + ((2 * i + 1) * mutex_size);
 2662|       |
 2663|       |                ret = ithread_mutex_init(ps_dec->apv_proc_start_mutex[0]);
 2664|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 2665|       |
 2666|       |                ret = ithread_mutex_init(ps_dec->apv_proc_done_mutex[i]);
 2667|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 2668|       |            }
 2669|       |
 2670|       |            size = ithread_get_cond_struct_size() << 2;
 2671|       |            pv_buf = pf_aligned_alloc(pv_mem_ctxt, 8, size);
 2672|       |            RETURN_IF((NULL == pv_buf), IV_FAIL);
 2673|       |            memset(pv_buf, 0, size);
 2674|       |
 2675|       |            // init condition variable for both the threads
 2676|       |            for(i = 0; i < 2; i++)
 2677|       |            {
 2678|       |                WORD32 ret;
 2679|       |                WORD32 cond_size = ithread_get_cond_struct_size();
 2680|       |                ps_dec->apv_proc_start_condition[i] = (UWORD8 *) pv_buf + (2 * i * cond_size);
 2681|       |                ps_dec->apv_proc_done_condition[i] = (UWORD8 *) pv_buf + ((2 * i + 1) * cond_size);
 2682|       |
 2683|       |                ret = ithread_cond_init(ps_dec->apv_proc_start_condition[i]);
 2684|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 2685|       |
 2686|       |                ret = ithread_cond_init(ps_dec->apv_proc_done_condition[i]);
 2687|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 2688|       |            }
 2689|       |        }
 2690|       |#endif
 2691|  64.6k|        size = sizeof(dpb_manager_t);
 2692|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2693|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2694|  64.6k|        memset(pv_buf, 0, size);
 2695|  64.6k|        ps_dec->ps_dpb_mgr = pv_buf;
 2696|       |
 2697|  64.6k|        size = sizeof(pred_info_t) * 2 * 32;
 2698|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2699|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2700|  64.6k|        memset(pv_buf, 0, size);
 2701|  64.6k|        ps_dec->ps_pred = pv_buf;
 2702|       |
 2703|  64.6k|        size = sizeof(disp_mgr_t);
 2704|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2705|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2706|  64.6k|        memset(pv_buf, 0, size);
 2707|  64.6k|        ps_dec->pv_disp_buf_mgr = pv_buf;
 2708|       |
 2709|  64.6k|        size = ih264_buf_mgr_size();
 2710|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2711|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2712|  64.6k|        memset(pv_buf, 0, size);
 2713|  64.6k|        ps_dec->pv_pic_buf_mgr = pv_buf;
 2714|       |
 2715|  64.6k|        size = sizeof(struct pic_buffer_t) * (H264_MAX_REF_PICS * 2);
  ------------------
  |  |  534|  64.6k|#define H264_MAX_REF_PICS         16
  ------------------
 2716|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2717|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2718|  64.6k|        memset(pv_buf, 0, size);
 2719|  64.6k|        ps_dec->ps_pic_buf_base = pv_buf;
 2720|       |
 2721|  64.6k|        size = sizeof(dec_err_status_t);
 2722|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2723|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2724|  64.6k|        memset(pv_buf, 0, size);
 2725|  64.6k|        ps_dec->ps_dec_err_status = (dec_err_status_t *) pv_buf;
 2726|       |
 2727|  64.6k|        size = sizeof(dpb_commands_t);
 2728|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2729|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2730|  64.6k|        memset(pv_buf, 0, size);
 2731|  64.6k|        ps_dec->ps_dpb_cmds = (dpb_commands_t *) pv_buf;
 2732|       |
 2733|  64.6k|        size = sizeof(dec_bit_stream_t);
 2734|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2735|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2736|  64.6k|        memset(pv_buf, 0, size);
 2737|  64.6k|        ps_dec->ps_bitstrm = (dec_bit_stream_t *) pv_buf;
 2738|       |
 2739|  64.6k|        size = sizeof(dec_nal_unit_svc_ext_params_t);
 2740|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2741|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2742|  64.6k|        memset(pv_buf, 0, size);
 2743|  64.6k|        ps_svc_lyr_dec->ps_nal_svc_ext = (dec_nal_unit_svc_ext_params_t *) pv_buf;
 2744|       |
 2745|  64.6k|        size = sizeof(dec_slice_params_t);
 2746|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2747|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2748|  64.6k|        memset(pv_buf, 0, size);
 2749|  64.6k|        ps_dec->ps_cur_slice = (dec_slice_params_t *) pv_buf;
 2750|       |
 2751|  64.6k|        size = MAX(sizeof(dec_seq_params_t), sizeof(dec_pic_params_t));
  ------------------
  |  |   60|  64.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 64.6k, Folded]
  |  |  ------------------
  ------------------
 2752|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2753|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2754|  64.6k|        memset(pv_buf, 0, size);
 2755|  64.6k|        ps_dec->pv_scratch_sps_pps = pv_buf;
 2756|       |
 2757|  64.6k|        size = sizeof(dec_svc_seq_params_t);
 2758|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2759|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2760|  64.6k|        memset(pv_buf, 0, size);
 2761|  64.6k|        ps_svc_lyr_dec->pv_scratch_subset_sps = pv_buf;
 2762|       |
 2763|  64.6k|        ps_dec->u4_static_bits_buf_size = 256000;
 2764|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, ps_dec->u4_static_bits_buf_size);
 2765|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2766|  64.6k|        memset(pv_buf, 0, ps_dec->u4_static_bits_buf_size);
 2767|  64.6k|        ps_dec->pu1_bits_buf_static = pv_buf;
 2768|       |
 2769|  64.6k|        size = ((TOTAL_LIST_ENTRIES + PAD_MAP_IDX_POC) * sizeof(void *));
  ------------------
  |  |   95|  64.6k|#define TOTAL_LIST_ENTRIES      6 * POC_LIST_L0_TO_L1_DIFF//BOT_LIST_FLD_L1 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17+17+17
  |  |  ------------------
  |  |  |  |   86|  64.6k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|  64.6k|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      size = ((TOTAL_LIST_ENTRIES + PAD_MAP_IDX_POC) * sizeof(void *));
  ------------------
  |  |  100|  64.6k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 2770|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2771|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2772|  64.6k|        ps_dec->ppv_map_ref_idx_to_poc_base = pv_buf;
 2773|  64.6k|        memset(ps_dec->ppv_map_ref_idx_to_poc_base, 0, size);
 2774|       |
 2775|  64.6k|        ps_dec->ppv_map_ref_idx_to_poc = ps_dec->ppv_map_ref_idx_to_poc_base + OFFSET_MAP_IDX_POC;
  ------------------
  |  |  103|  64.6k|#define OFFSET_MAP_IDX_POC          (1)
  ------------------
 2776|       |
 2777|  64.6k|        size = (sizeof(bin_ctxt_model_t) * NUM_CABAC_CTXTS_SVC);
  ------------------
  |  |   46|  64.6k|#define NUM_CABAC_CTXTS_SVC 467
  ------------------
 2778|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2779|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2780|  64.6k|        memset(pv_buf, 0, size);
 2781|  64.6k|        ps_dec->p_cabac_ctxt_table_t = pv_buf;
 2782|       |
 2783|  64.6k|        size = sizeof(ctxt_inc_mb_info_t);
 2784|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2785|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2786|  64.6k|        memset(pv_buf, 0, size);
 2787|  64.6k|        ps_dec->ps_left_mb_ctxt_info = pv_buf;
 2788|       |
 2789|  64.6k|        size = MAX_REF_BUF_SIZE * 2;
  ------------------
  |  |   67|  64.6k|#define MAX_REF_BUF_SIZE       (3776*2*2)
  ------------------
 2790|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2791|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2792|  64.6k|        memset(pv_buf, 0, size);
 2793|  64.6k|        ps_dec->pu1_ref_buff_base = pv_buf;
 2794|  64.6k|        ps_dec->pu1_ref_buff = ps_dec->pu1_ref_buff_base + MAX_REF_BUF_SIZE;
  ------------------
  |  |   67|  64.6k|#define MAX_REF_BUF_SIZE       (3776*2*2)
  ------------------
 2795|       |
 2796|  64.6k|        size = ((sizeof(WORD16)) * PRED_BUFFER_WIDTH * PRED_BUFFER_HEIGHT * 2);
  ------------------
  |  |   55|  64.6k|#define PRED_BUFFER_WIDTH   24*2
  ------------------
                      size = ((sizeof(WORD16)) * PRED_BUFFER_WIDTH * PRED_BUFFER_HEIGHT * 2);
  ------------------
  |  |   56|  64.6k|#define PRED_BUFFER_HEIGHT  24*2
  ------------------
 2797|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2798|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2799|  64.6k|        memset(pv_buf, 0, size);
 2800|  64.6k|        ps_dec->pi2_pred1 = pv_buf;
 2801|       |
 2802|  64.6k|        size = sizeof(UWORD8) * (MB_LUM_SIZE);
  ------------------
  |  |  563|  64.6k|#define MB_LUM_SIZE                   256
  ------------------
 2803|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2804|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2805|  64.6k|        memset(pv_buf, 0, size);
 2806|  64.6k|        ps_dec->pu1_temp_mc_buffer = pv_buf;
 2807|       |
 2808|  64.6k|        size = 8 * MAX_REF_BUFS * sizeof(struct pic_buffer_t);
  ------------------
  |  |   75|  64.6k|#define MAX_REF_BUFS    32
  ------------------
 2809|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2810|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2811|  64.6k|        memset(pv_buf, 0, size);
 2812|       |
 2813|  64.6k|        ps_dec->pu1_init_dpb_base = pv_buf;
 2814|  64.6k|        pu1_buf = pv_buf;
 2815|  64.6k|        ps_dec->ps_dpb_mgr->ps_init_dpb[0][0] = (struct pic_buffer_t *) pu1_buf;
 2816|       |
 2817|  64.6k|        pu1_buf += size / 2;
 2818|  64.6k|        ps_dec->ps_dpb_mgr->ps_init_dpb[1][0] = (struct pic_buffer_t *) pu1_buf;
 2819|       |
 2820|  64.6k|        size = (sizeof(UWORD32) * 2 * 3 * ((MAX_FRAMES << 1) * (MAX_FRAMES << 1)) * 2);
  ------------------
  |  |  600|  64.6k|#define MAX_FRAMES              16
  ------------------
                      size = (sizeof(UWORD32) * 2 * 3 * ((MAX_FRAMES << 1) * (MAX_FRAMES << 1)) * 2);
  ------------------
  |  |  600|  64.6k|#define MAX_FRAMES              16
  ------------------
 2821|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2822|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2823|  64.6k|        memset(pv_buf, 0, size);
 2824|  64.6k|        ps_dec->pu4_mbaff_wt_mat = pv_buf;
 2825|       |
 2826|  64.6k|        size = sizeof(UWORD32) * 2 * 3 * ((MAX_FRAMES << 1) * (MAX_FRAMES << 1));
  ------------------
  |  |  600|  64.6k|#define MAX_FRAMES              16
  ------------------
                      size = sizeof(UWORD32) * 2 * 3 * ((MAX_FRAMES << 1) * (MAX_FRAMES << 1));
  ------------------
  |  |  600|  64.6k|#define MAX_FRAMES              16
  ------------------
 2827|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2828|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2829|  64.6k|        memset(pv_buf, 0, size);
 2830|  64.6k|        ps_dec->pu4_wts_ofsts_mat = pv_buf;
 2831|       |
 2832|  64.6k|        size = (sizeof(neighbouradd_t) << 2);
 2833|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2834|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2835|  64.6k|        memset(pv_buf, 0, size);
 2836|  64.6k|        ps_dec->ps_left_mvpred_addr = pv_buf;
 2837|       |
 2838|  64.6k|        size = ih264_buf_mgr_size();
 2839|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2840|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2841|  64.6k|        memset(pv_buf, 0, size);
 2842|  64.6k|        ps_dec->pv_mv_buf_mgr = pv_buf;
 2843|       |
 2844|  64.6k|        size = sizeof(col_mv_buf_t) * (H264_MAX_REF_PICS * 2);
  ------------------
  |  |  534|  64.6k|#define H264_MAX_REF_PICS         16
  ------------------
 2845|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2846|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2847|  64.6k|        ps_dec->ps_col_mv_base = pv_buf;
 2848|  64.6k|        memset(ps_dec->ps_col_mv_base, 0, size);
 2849|       |
 2850|  64.6k|        size = ((MB_SIZE * MB_SIZE * 3) >> 1) + MB_SIZE;
  ------------------
  |  |  554|  64.6k|#define MB_SIZE             16
  ------------------
                      size = ((MB_SIZE * MB_SIZE * 3) >> 1) + MB_SIZE;
  ------------------
  |  |  554|  64.6k|#define MB_SIZE             16
  ------------------
                      size = ((MB_SIZE * MB_SIZE * 3) >> 1) + MB_SIZE;
  ------------------
  |  |  554|  64.6k|#define MB_SIZE             16
  ------------------
 2851|  64.6k|        pv_buf = pf_aligned_alloc(pv_mem_ctxt, 128, size);
 2852|  64.6k|        RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  64.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2853|  64.6k|        ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma = pv_buf;
 2854|  64.6k|        ps_svc_lyr_dec->pu1_ii_resamp_buffer_chroma =
 2855|  64.6k|            ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma + (MB_SIZE * MB_SIZE);
  ------------------
  |  |  554|  64.6k|#define MB_SIZE             16
  ------------------
                          ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma + (MB_SIZE * MB_SIZE);
  ------------------
  |  |  554|  64.6k|#define MB_SIZE             16
  ------------------
 2856|  64.6k|        memset(ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma, 0, size);
 2857|       |
 2858|  64.6k|        isvcd_init_decoder(ps_svc_lyr_dec);
 2859|  64.6k|    }
 2860|  21.5k|    return IV_SUCCESS;
 2861|  21.5k|}
isvcd_create:
 2884|  21.5k|{
 2885|  21.5k|    isvcd_create_ip_t *ps_create_ip;
 2886|  21.5k|    isvcd_create_op_t *ps_create_op;
 2887|  21.5k|    WORD32 ret;
 2888|       |
 2889|  21.5k|    ps_create_ip = (isvcd_create_ip_t *) pv_api_ip;
 2890|  21.5k|    ps_create_op = (isvcd_create_op_t *) pv_api_op;
 2891|       |
 2892|  21.5k|    ps_create_op->s_ivd_create_op_t.u4_error_code = 0;
 2893|  21.5k|    dec_hdl = NULL;
 2894|  21.5k|    ret = isvcd_allocate_static_bufs(&dec_hdl, pv_api_ip, pv_api_op);
 2895|       |
 2896|       |    /* If allocation of some buffer fails, then free buffers allocated till then */
 2897|  21.5k|    if(IV_FAIL == ret)
  ------------------
  |  Branch (2897:8): [True: 10, False: 21.5k]
  ------------------
 2898|     10|    {
 2899|     10|        if(dec_hdl)
  ------------------
  |  Branch (2899:12): [True: 0, False: 10]
  ------------------
 2900|      0|        {
 2901|      0|            if(dec_hdl->pv_codec_handle)
  ------------------
  |  Branch (2901:16): [True: 0, False: 0]
  ------------------
 2902|      0|            {
 2903|      0|                isvcd_free_static_bufs(dec_hdl);
 2904|      0|            }
 2905|      0|            else
 2906|      0|            {
 2907|      0|                void (*pf_aligned_free)(void *pv_mem_ctxt, void *pv_buf);
 2908|      0|                void *pv_mem_ctxt;
 2909|       |
 2910|      0|                pf_aligned_free = ps_create_ip->s_ivd_create_ip_t.pf_aligned_free;
 2911|      0|                pv_mem_ctxt = ps_create_ip->s_ivd_create_ip_t.pv_mem_ctxt;
 2912|      0|                pf_aligned_free(pv_mem_ctxt, dec_hdl);
 2913|      0|            }
 2914|      0|        }
 2915|     10|        ps_create_op->s_ivd_create_op_t.u4_error_code = IVD_MEM_ALLOC_FAILED;
 2916|     10|        ps_create_op->s_ivd_create_op_t.u4_error_code |= 1 << IVD_FATALERROR;
 2917|     10|        return IV_FAIL;
 2918|     10|    }
 2919|       |
 2920|  21.5k|    return IV_SUCCESS;
 2921|  21.5k|}
isvcd_update_dqid:
 2951|   237k|{
 2952|   237k|    vcl_node_t *ps_vcl_node;
 2953|       |
 2954|       |    /* sanity checks */
 2955|   237k|    if((NULL == ps_cur_lyr_node) || (NULL == pps_bot_lyr_node))
  ------------------
  |  Branch (2955:8): [True: 0, False: 237k]
  |  Branch (2955:37): [True: 0, False: 237k]
  ------------------
 2956|      0|    {
 2957|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 2958|      0|    }
 2959|       |
 2960|   237k|    ps_vcl_node = ps_cur_lyr_node->ps_bot_node;
 2961|   237k|    while(NULL != ps_vcl_node)
  ------------------
  |  Branch (2961:11): [True: 77.2k, False: 160k]
  ------------------
 2962|  77.2k|    {
 2963|  77.2k|        WORD32 i4_dqid;
 2964|       |
 2965|  77.2k|        i4_dqid = (ps_vcl_node->i4_dependency_id << 4) + ps_vcl_node->i4_quality_id;
 2966|       |
 2967|       |        /* if reference layer DQ ID matches */
 2968|       |        /* or reference layer is a layer below reference dq id layer */
 2969|  77.2k|        if((i4_dqid == i4_ref_lyr_dqid) ||
  ------------------
  |  Branch (2969:12): [True: 66.7k, False: 10.5k]
  ------------------
 2970|  10.5k|           (ps_vcl_node->i4_quality_id < (i4_ref_lyr_dqid & 0x0F)) ||
  ------------------
  |  Branch (2970:12): [True: 10.3k, False: 193]
  ------------------
 2971|    193|           (ps_vcl_node->i4_dependency_id < (i4_ref_lyr_dqid >> 4)))
  ------------------
  |  Branch (2971:12): [True: 74, False: 119]
  ------------------
 2972|  77.1k|        {
 2973|  77.1k|            break;
 2974|  77.1k|        }
 2975|    119|        ps_vcl_node = ps_vcl_node->ps_bot_node;
 2976|    119|    }
 2977|       |
 2978|       |    /* Update the top and bottom node of ref layer and current layer nodes */
 2979|       |
 2980|   237k|    if(NULL != ps_vcl_node)
  ------------------
  |  Branch (2980:8): [True: 77.1k, False: 160k]
  ------------------
 2981|  77.1k|    {
 2982|  77.1k|        ps_cur_lyr_node->ps_bot_node = ps_vcl_node;
 2983|  77.1k|        ps_vcl_node->ps_top_node = ps_cur_lyr_node;
 2984|  77.1k|    }
 2985|       |
 2986|       |    /* Update pointer to bottom VCL node */
 2987|   237k|    *pps_bot_lyr_node = ps_vcl_node;
 2988|   237k|    return (OK);
  ------------------
  |  |  114|   237k|#define OK        0
  ------------------
 2989|   237k|}
isvcd_detect_res_change:
 3017|   237k|{
 3018|   237k|    UWORD16 u2_scaled_ref_width_sps;
 3019|   237k|    UWORD16 u2_scaled_ref_ht_sps;
 3020|   237k|    UNUSED(ps_prev_subset_sps);
  ------------------
  |  |   45|   237k|#define UNUSED(x) ((void)(x))
  ------------------
 3021|       |
 3022|   237k|    if(NULL == ps_prev_sps)
  ------------------
  |  Branch (3022:8): [True: 160k, False: 77.0k]
  ------------------
 3023|   160k|    {
 3024|       |        /* indicates bottom most layer in Access unit */
 3025|   160k|        return (SVCD_FALSE);
  ------------------
  |  |   45|   160k|#define SVCD_FALSE 0
  ------------------
 3026|   160k|    }
 3027|       |    /* Check for the ESS idc */
 3028|  77.0k|    if(2 == ps_curr_subset_sps->s_sps_svc_ext.u1_extended_spatial_scalability_idc)
  ------------------
  |  Branch (3028:8): [True: 362, False: 76.6k]
  ------------------
 3029|    362|    {
 3030|    362|        return (SVCD_TRUE);
  ------------------
  |  |   46|    362|#define SVCD_TRUE 1
  ------------------
 3031|    362|    }
 3032|       |
 3033|       |    /* Calculate the scaled reference width and height */
 3034|  76.6k|    u2_scaled_ref_width_sps = (ps_curr_sps->u2_frm_wd_in_mbs << 4);
 3035|  76.6k|    u2_scaled_ref_width_sps -=
 3036|  76.6k|        (ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_left_offset +
 3037|  76.6k|         ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_right_offset);
 3038|       |
 3039|  76.6k|    u2_scaled_ref_ht_sps = (ps_curr_sps->u2_frm_ht_in_mbs << 4);
 3040|  76.6k|    u2_scaled_ref_ht_sps -=
 3041|  76.6k|        (ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_top_offset +
 3042|  76.6k|         ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_bottom_offset);
 3043|       |
 3044|       |    /* Check for frame width being different */
 3045|  76.6k|    if(u2_scaled_ref_width_sps != (ps_prev_sps->u2_frm_wd_in_mbs << 4))
  ------------------
  |  Branch (3045:8): [True: 53.7k, False: 22.9k]
  ------------------
 3046|  53.7k|    {
 3047|  53.7k|        return (SVCD_TRUE);
  ------------------
  |  |   46|  53.7k|#define SVCD_TRUE 1
  ------------------
 3048|  53.7k|    }
 3049|       |
 3050|       |    /* Check for frame height being different */
 3051|  22.9k|    if(u2_scaled_ref_ht_sps != (ps_prev_sps->u2_frm_ht_in_mbs << 4))
  ------------------
  |  Branch (3051:8): [True: 888, False: 22.0k]
  ------------------
 3052|    888|    {
 3053|    888|        return (SVCD_TRUE);
  ------------------
  |  |   46|    888|#define SVCD_TRUE 1
  ------------------
 3054|    888|    }
 3055|       |
 3056|       |    /* check for crop offset not MB aligned */
 3057|  22.0k|    if((0 != (ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_left_offset & 15)) ||
  ------------------
  |  Branch (3057:8): [True: 0, False: 22.0k]
  ------------------
 3058|  22.0k|       (0 != (ps_curr_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_top_offset & 15)))
  ------------------
  |  Branch (3058:8): [True: 0, False: 22.0k]
  ------------------
 3059|      0|    {
 3060|      0|        return (SVCD_TRUE);
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 3061|      0|    }
 3062|       |
 3063|       |    /* check for chroma Phase Y being different */
 3064|  22.0k|    if(ps_curr_subset_sps->s_sps_svc_ext.u1_chroma_phase_x_plus1_flag !=
  ------------------
  |  Branch (3064:8): [True: 1.06k, False: 20.9k]
  ------------------
 3065|  22.0k|       ps_curr_subset_sps->s_sps_svc_ext.u1_seq_ref_layer_chroma_phase_x_plus1_flag)
 3066|  1.06k|    {
 3067|  1.06k|        return (SVCD_TRUE);
  ------------------
  |  |   46|  1.06k|#define SVCD_TRUE 1
  ------------------
 3068|  1.06k|    }
 3069|       |
 3070|       |    /* check for chroma Phase Y being different */
 3071|  20.9k|    if(ps_curr_subset_sps->s_sps_svc_ext.u1_chroma_phase_y_plus1 !=
  ------------------
  |  Branch (3071:8): [True: 194, False: 20.7k]
  ------------------
 3072|  20.9k|       ps_curr_subset_sps->s_sps_svc_ext.u1_seq_ref_layer_chroma_phase_y_plus1)
 3073|    194|    {
 3074|    194|        return (SVCD_TRUE);
  ------------------
  |  |   46|    194|#define SVCD_TRUE 1
  ------------------
 3075|    194|    }
 3076|       |
 3077|       |    /* If none of the above are true then there is no resolution change */
 3078|  20.7k|    return (SVCD_FALSE);
  ------------------
  |  |   45|  20.7k|#define SVCD_FALSE 0
  ------------------
 3079|  20.9k|}
isvcd_parse_ref_pic_list_modify:
 3107|  48.3k|{
 3108|  48.3k|    WORD32 i4_mod_flag;
 3109|  48.3k|    UWORD16 ui_nextUev;
 3110|  48.3k|    WORD32 i4_num_sets_ctr = 0;
 3111|  48.3k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 3112|  48.3k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 3113|       |
 3114|  48.3k|    if(I_SLICE != ps_slice_prms->u1_slice_type)
  ------------------
  |  |  370|  48.3k|#define I_SLICE  2
  ------------------
  |  Branch (3114:8): [True: 38.1k, False: 10.1k]
  ------------------
 3115|  38.1k|    {
 3116|       |        /* ref_pic_list_modification_flag_l0 */
 3117|  38.1k|        i4_mod_flag = ih264d_get_bit_h264(ps_bitstrm);
 3118|       |
 3119|  38.1k|        if(0 != i4_mod_flag)
  ------------------
  |  Branch (3119:12): [True: 13.9k, False: 24.1k]
  ------------------
 3120|  13.9k|        {
 3121|  13.9k|            WORD32 i4_mod_pic_num_idc;
 3122|       |
 3123|  13.9k|            i4_num_sets_ctr = 0;
 3124|  13.9k|            do
 3125|  95.1k|            {
 3126|       |                /* modification_of_pic_nums_idc */
 3127|  95.1k|                i4_mod_pic_num_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3128|       |
 3129|  95.1k|                if((i4_mod_pic_num_idc > 3) || (i4_mod_pic_num_idc < 0))
  ------------------
  |  Branch (3129:20): [True: 6.67k, False: 88.4k]
  |  Branch (3129:48): [True: 206, False: 88.2k]
  ------------------
 3130|  6.88k|                {
 3131|  6.88k|                    return ERROR_INV_SLICE_HDR_T;
 3132|  6.88k|                }
 3133|  88.2k|                if(3 != i4_mod_pic_num_idc)
  ------------------
  |  Branch (3133:20): [True: 86.1k, False: 2.14k]
  ------------------
 3134|  86.1k|                {
 3135|       |                    /* i4_mod_pic_num_idc = 0,1 ==> abs_diff_pic_num_minus1 */
 3136|       |                    /* i4_mod_pic_num_idc = 2 ==> long_term_pic_num */
 3137|       |
 3138|  86.1k|                    ui_nextUev = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3139|  86.1k|                    if(ui_nextUev > (ps_curr_sps->u2_u4_max_pic_num_minus1 + 1))
  ------------------
  |  Branch (3139:24): [True: 1.65k, False: 84.4k]
  ------------------
 3140|  1.65k|                        return ERROR_INV_SLICE_HDR_T;
 3141|  86.1k|                }
 3142|       |
 3143|  86.6k|                i4_num_sets_ctr++;
 3144|       |
 3145|       |                /* if the number of commands recieved exceeds max limit */
 3146|  86.6k|                if((H264_MAX_REF_PICS) == i4_num_sets_ctr) break;
  ------------------
  |  |  534|  86.6k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (3146:20): [True: 3.28k, False: 83.3k]
  ------------------
 3147|       |
 3148|  86.6k|            } while(3 != i4_mod_pic_num_idc);
  ------------------
  |  Branch (3148:21): [True: 81.1k, False: 2.12k]
  ------------------
 3149|  13.9k|        }
 3150|       |
 3151|       |        /*********** if (I_SLICE != u1_slice_type) ***************************/
 3152|  38.1k|    }
 3153|       |
 3154|  39.7k|    if(B_SLICE != ps_slice_prms->u1_slice_type)
  ------------------
  |  |  369|  39.7k|#define B_SLICE  1
  ------------------
  |  Branch (3154:8): [True: 27.1k, False: 12.6k]
  ------------------
 3155|  27.1k|    {
 3156|  27.1k|        return (OK);
  ------------------
  |  |  114|  27.1k|#define OK        0
  ------------------
 3157|  27.1k|    }
 3158|       |
 3159|       |    /* ref_pic_list_modification_flag_l1 */
 3160|  12.6k|    i4_mod_flag = ih264d_get_bit_h264(ps_bitstrm);
 3161|       |
 3162|  12.6k|    if(0 != i4_mod_flag)
  ------------------
  |  Branch (3162:8): [True: 4.42k, False: 8.21k]
  ------------------
 3163|  4.42k|    {
 3164|  4.42k|        WORD32 i4_mod_pic_num_idc;
 3165|       |
 3166|  4.42k|        do
 3167|  16.1k|        {
 3168|       |            /* modification_of_pic_nums_idc */
 3169|  16.1k|            i4_mod_pic_num_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3170|       |
 3171|  16.1k|            if((i4_mod_pic_num_idc > 3) || (i4_mod_pic_num_idc < 0))
  ------------------
  |  Branch (3171:16): [True: 3.33k, False: 12.7k]
  |  Branch (3171:44): [True: 51, False: 12.7k]
  ------------------
 3172|  3.38k|            {
 3173|  3.38k|                return ERROR_INV_SLICE_HDR_T;
 3174|  3.38k|            }
 3175|  12.7k|            if(3 != i4_mod_pic_num_idc)
  ------------------
  |  Branch (3175:16): [True: 12.3k, False: 358]
  ------------------
 3176|  12.3k|            {
 3177|       |                /* i4_mod_pic_num_idc = 0,1 ==> abs_diff_pic_num_minus1 */
 3178|       |                /* i4_mod_pic_num_idc = 2 ==> long_term_pic_num */
 3179|       |
 3180|  12.3k|                ui_nextUev = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3181|  12.3k|                if(ui_nextUev > (ps_curr_sps->u2_u4_max_pic_num_minus1 + 1))
  ------------------
  |  Branch (3181:20): [True: 585, False: 11.7k]
  ------------------
 3182|    585|                    return ERROR_INV_SLICE_HDR_T;
 3183|  12.3k|            }
 3184|       |
 3185|  12.1k|            i4_num_sets_ctr++;
 3186|       |
 3187|       |            /* if the number of commands recieved exceeds max limit */
 3188|  12.1k|            if((H264_MAX_REF_PICS) == i4_num_sets_ctr) break;
  ------------------
  |  |  534|  12.1k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (3188:16): [True: 93, False: 12.0k]
  ------------------
 3189|       |
 3190|  12.1k|        } while(3 != i4_mod_pic_num_idc);
  ------------------
  |  Branch (3190:17): [True: 11.6k, False: 358]
  ------------------
 3191|  4.42k|    }
 3192|       |
 3193|  8.66k|    return (OK);
  ------------------
  |  |  114|  8.66k|#define OK        0
  ------------------
 3194|  12.6k|}
isvcd_parse_slice_hdr_refdq_id:
 3228|  57.1k|{
 3229|  57.1k|    UWORD8 u1_pps_id;
 3230|  57.1k|    WORD32 i_temp;
 3231|  57.1k|    UWORD32 u4_temp;
 3232|  57.1k|    WORD32 i4_nal_unit_type;
 3233|  57.1k|    WORD32 i4_nal_ref_idc, i4_quality_id;
 3234|  57.1k|    WORD32 i4_use_ref_base, i4_idr_pic_flag;
 3235|  57.1k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 3236|  57.1k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 3237|  57.1k|    dec_svc_seq_params_t *ps_subset_sps = NULL;
 3238|  57.1k|    WORD32 ret = OK;
  ------------------
  |  |  114|  57.1k|#define OK        0
  ------------------
 3239|       |
 3240|  57.1k|    i4_nal_unit_type = ps_vcl_node->i4_nal_unit_type;
 3241|  57.1k|    i4_nal_ref_idc = ps_vcl_node->i4_nal_ref_idc;
 3242|  57.1k|    i4_quality_id = ps_vcl_node->i4_quality_id;
 3243|  57.1k|    i4_use_ref_base = ps_vcl_node->i4_use_ref_base;
 3244|  57.1k|    i4_idr_pic_flag = ps_vcl_node->i4_idr_pic_flag;
 3245|       |
 3246|       |    /*-----------------------------------------------------------------------*/
 3247|       |    /*--------------------- first mb in slice -------------------------------*/
 3248|       |    /*-----------------------------------------------------------------------*/
 3249|  57.1k|    ps_slice_prms->u2_first_mb_in_slice = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3250|       |
 3251|       |    /*-----------------------------------------------------------------------*/
 3252|       |    /*---------------------------- slice type -------------------------------*/
 3253|       |    /*-----------------------------------------------------------------------*/
 3254|  57.1k|    ps_slice_prms->u1_slice_type = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3255|  57.1k|    if(ps_slice_prms->u1_slice_type > 4)
  ------------------
  |  Branch (3255:8): [True: 2.14k, False: 54.9k]
  ------------------
 3256|  2.14k|    {
 3257|  2.14k|        ps_slice_prms->u1_slice_type -= 5;
 3258|  2.14k|    }
 3259|       |
 3260|       |    /*-----------------------------------------------------------------------*/
 3261|       |    /*----------------------------- PPS id ----------------------------------*/
 3262|       |    /*-----------------------------------------------------------------------*/
 3263|  57.1k|    u1_pps_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3264|       |
 3265|       |    /* set correspoding sps and pps id also */
 3266|  57.1k|    ps_pps += u1_pps_id;
 3267|  57.1k|    if(FALSE == ps_pps->u1_is_valid)
  ------------------
  |  |  592|  57.1k|#define FALSE   0
  ------------------
  |  Branch (3267:8): [True: 2.89k, False: 54.2k]
  ------------------
 3268|  2.89k|    {
 3269|  2.89k|        return ERROR_INV_SLICE_HDR_T;
 3270|  2.89k|    }
 3271|  54.2k|    ps_sps = ps_pps->ps_sps;
 3272|  54.2k|    ps_subset_sps = &ps_svcd_ctxt->ps_subset_sps[ps_sps->u1_seq_parameter_set_id];
 3273|  54.2k|    if(CODED_SLICE_EXTENSION_NAL == i4_nal_unit_type)
  ------------------
  |  |   66|  54.2k|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (3273:8): [True: 53.3k, False: 877]
  ------------------
 3274|  53.3k|    {
 3275|  53.3k|        ps_sps += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  53.3k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 3276|  53.3k|        ps_subset_sps =
 3277|  53.3k|            &ps_svcd_ctxt->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_sps->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  53.3k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 3278|  53.3k|    }
 3279|       |    /*-----------------------------------------------------------------------*/
 3280|       |    /*--------------------------- frm num -----------------------------------*/
 3281|       |    /*-----------------------------------------------------------------------*/
 3282|  54.2k|    if(!ps_sps) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (3282:8): [True: 0, False: 54.2k]
  ------------------
 3283|  54.2k|    if(FALSE == ps_sps->u1_is_valid) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  592|  54.2k|#define FALSE   0
  ------------------
  |  Branch (3283:8): [True: 2.43k, False: 51.7k]
  ------------------
 3284|       |
 3285|  51.7k|    ps_slice_prms->u2_frame_num = ih264d_get_bits_h264(ps_bitstrm, ps_sps->u1_bits_in_frm_num);
 3286|       |
 3287|       |    /*-----------------------------------------------------------------------*/
 3288|       |    /*------------------ field pic flag and bottom field flag ---------------*/
 3289|       |    /*-----------------------------------------------------------------------*/
 3290|  51.7k|    if(SVCD_TRUE != ps_sps->u1_frame_mbs_only_flag)
  ------------------
  |  |   46|  51.7k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3290:8): [True: 499, False: 51.2k]
  ------------------
 3291|    499|    {
 3292|    499|        return ERROR_INV_SLICE_HDR_T;
 3293|    499|    }
 3294|       |    /*-----------------------------------------------------------------------*/
 3295|       |    /*--------------------------- IDR pic id --------------------------------*/
 3296|       |    /*-----------------------------------------------------------------------*/
 3297|  51.2k|    if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|  51.2k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3297:8): [True: 42.8k, False: 8.39k]
  ------------------
 3298|  42.8k|    {
 3299|  42.8k|        UWORD32 u4_idr_pic_id = 0;
 3300|  42.8k|        u4_idr_pic_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3301|  42.8k|        if(u4_idr_pic_id > 65535) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (3301:12): [True: 1.33k, False: 41.5k]
  ------------------
 3302|  42.8k|    }
 3303|       |
 3304|       |    /*-----------------------------------------------------------------------*/
 3305|       |    /*----------------- poc lsb and delts_poc_bottom ------------------------*/
 3306|       |    /*-----------------------------------------------------------------------*/
 3307|  49.9k|    if(0 == ps_sps->u1_pic_order_cnt_type)
  ------------------
  |  Branch (3307:8): [True: 45.5k, False: 4.39k]
  ------------------
 3308|  45.5k|    {
 3309|  45.5k|        i_temp = ih264d_get_bits_h264(ps_bitstrm, ps_sps->u1_log2_max_pic_order_cnt_lsb_minus);
 3310|       |
 3311|  45.5k|        if(i_temp < 0 || i_temp >= ps_sps->i4_max_pic_order_cntLsb) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (3311:12): [True: 0, False: 45.5k]
  |  Branch (3311:26): [True: 0, False: 45.5k]
  ------------------
 3312|  45.5k|        if(SVCD_TRUE == ps_pps->u1_pic_order_present_flag)
  ------------------
  |  |   46|  45.5k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3312:12): [True: 7.57k, False: 37.9k]
  ------------------
 3313|  7.57k|        {
 3314|  7.57k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3315|  7.57k|        }
 3316|  45.5k|    }
 3317|       |
 3318|       |    /*-----------------------------------------------------------------------*/
 3319|       |    /*---------------- delta_poc_count[0] and [1] ---------------------------*/
 3320|       |    /*-----------------------------------------------------------------------*/
 3321|  49.9k|    if((1 == ps_sps->u1_pic_order_cnt_type) && (!ps_sps->u1_delta_pic_order_always_zero_flag))
  ------------------
  |  Branch (3321:8): [True: 3.77k, False: 46.1k]
  |  Branch (3321:48): [True: 2.73k, False: 1.03k]
  ------------------
 3322|  2.73k|    {
 3323|  2.73k|        i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3324|       |
 3325|  2.73k|        if(ps_pps->u1_pic_order_present_flag)
  ------------------
  |  Branch (3325:12): [True: 1.55k, False: 1.18k]
  ------------------
 3326|  1.55k|        {
 3327|  1.55k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3328|  1.55k|        }
 3329|  2.73k|    }
 3330|       |
 3331|       |    /*-----------------------------------------------------------------------*/
 3332|       |    /*---------------------- redundant pic cnt ------------------------------*/
 3333|       |    /*-----------------------------------------------------------------------*/
 3334|  49.9k|    if(ps_pps->u1_redundant_pic_cnt_present_flag)
  ------------------
  |  Branch (3334:8): [True: 17.7k, False: 32.2k]
  ------------------
 3335|  17.7k|    {
 3336|  17.7k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3337|  17.7k|        if(u4_temp > MAX_REDUNDANT_PIC_CNT) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  611|  17.7k|#define MAX_REDUNDANT_PIC_CNT       127
  ------------------
  |  Branch (3337:12): [True: 726, False: 16.9k]
  ------------------
 3338|  17.7k|    }
 3339|       |    /*-----------------------------------------------------------------------*/
 3340|       |    /*-----------------Direct_spatial_mv_pred_flag --------------------------*/
 3341|       |    /*-----------------num ref active override flag -------------------------*/
 3342|       |    /*-----------------num_ref_idx_active_l0&1 ------------------------------*/
 3343|       |    /*-----------------------------------------------------------------------*/
 3344|  49.2k|    if(0 == i4_quality_id)
  ------------------
  |  Branch (3344:8): [True: 49.2k, False: 0]
  ------------------
 3345|  49.2k|    {
 3346|  49.2k|        if(B_SLICE == ps_slice_prms->u1_slice_type)
  ------------------
  |  |  369|  49.2k|#define B_SLICE  1
  ------------------
  |  Branch (3346:12): [True: 16.8k, False: 32.3k]
  ------------------
 3347|  16.8k|        {
 3348|  16.8k|            ps_slice_prms->u1_direct_spatial_mv_pred_flag = ih264d_get_bit_h264(ps_bitstrm);
 3349|  16.8k|        }
 3350|       |
 3351|  49.2k|        if((P_SLICE == ps_slice_prms->u1_slice_type) || (B_SLICE == ps_slice_prms->u1_slice_type))
  ------------------
  |  |  368|  49.2k|#define P_SLICE  0
  ------------------
                      if((P_SLICE == ps_slice_prms->u1_slice_type) || (B_SLICE == ps_slice_prms->u1_slice_type))
  ------------------
  |  |  369|  27.6k|#define B_SLICE  1
  ------------------
  |  Branch (3351:12): [True: 21.5k, False: 27.6k]
  |  Branch (3351:57): [True: 16.8k, False: 10.7k]
  ------------------
 3352|  38.4k|        {
 3353|  38.4k|            WORD8 i1_over_ride_flag;
 3354|  38.4k|            i1_over_ride_flag = ih264d_get_bit_h264(ps_bitstrm);
 3355|       |
 3356|  38.4k|            ps_slice_prms->u1_num_ref_idx_active_override_flag = i1_over_ride_flag;
 3357|       |
 3358|  38.4k|            if(SVCD_TRUE == i1_over_ride_flag)
  ------------------
  |  |   46|  38.4k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3358:16): [True: 20.5k, False: 17.9k]
  ------------------
 3359|  20.5k|            {
 3360|  20.5k|                UWORD8 u8_ref_idx_l0;
 3361|  20.5k|                u8_ref_idx_l0 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3362|  20.5k|                if(u8_ref_idx_l0 > H264_MAX_REF_PICS)
  ------------------
  |  |  534|  20.5k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (3362:20): [True: 542, False: 20.0k]
  ------------------
 3363|    542|                {
 3364|    542|                    return ERROR_NUM_REF;
 3365|    542|                }
 3366|  20.0k|                if(B_SLICE == ps_slice_prms->u1_slice_type)
  ------------------
  |  |  369|  20.0k|#define B_SLICE  1
  ------------------
  |  Branch (3366:20): [True: 8.21k, False: 11.8k]
  ------------------
 3367|  8.21k|                {
 3368|  8.21k|                    UWORD8 u8_ref_idx_l1;
 3369|  8.21k|                    u8_ref_idx_l1 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3370|  8.21k|                    if(u8_ref_idx_l1 > H264_MAX_REF_PICS)
  ------------------
  |  |  534|  8.21k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (3370:24): [True: 362, False: 7.84k]
  ------------------
 3371|    362|                    {
 3372|    362|                        return ERROR_NUM_REF;
 3373|    362|                    }
 3374|  8.21k|                }
 3375|  20.0k|            }
 3376|  38.4k|        }
 3377|       |
 3378|       |        /*-----------------------------------------------------------------------*/
 3379|       |        /*---------------------- ref pic list modification ----------------------*/
 3380|       |        /*-----------------------------------------------------------------------*/
 3381|  48.3k|        {
 3382|  48.3k|            ret = isvcd_parse_ref_pic_list_modify(ps_bitstrm, ps_slice_prms, ps_sps);
 3383|  48.3k|            if(OK != ret) return ret;
  ------------------
  |  |  114|  48.3k|#define OK        0
  ------------------
  |  Branch (3383:16): [True: 12.5k, False: 35.8k]
  ------------------
 3384|  48.3k|        }
 3385|       |
 3386|  35.8k|        if(((1 == ps_pps->u1_wted_pred_flag) && (P_SLICE == ps_slice_prms->u1_slice_type)) ||
  ------------------
  |  |  368|  6.73k|#define P_SLICE  0
  ------------------
  |  Branch (3386:13): [True: 6.73k, False: 29.0k]
  |  Branch (3386:49): [True: 2.36k, False: 4.36k]
  ------------------
 3387|  33.4k|           ((B_SLICE == ps_slice_prms->u1_slice_type) && (1 == ps_pps->u1_wted_bipred_idc)))
  ------------------
  |  |  369|  33.4k|#define B_SLICE  1
  ------------------
  |  Branch (3387:13): [True: 8.66k, False: 24.7k]
  |  Branch (3387:58): [True: 4.18k, False: 4.48k]
  ------------------
 3388|  6.54k|        {
 3389|  6.54k|            if((ps_slice_prms->u1_num_ref_idx_lx_active[0] >= H264_MAX_REF_IDX) ||
  ------------------
  |  |  535|  6.54k|#define H264_MAX_REF_IDX          32
  ------------------
  |  Branch (3389:16): [True: 0, False: 6.54k]
  ------------------
 3390|  6.54k|               (ps_slice_prms->u1_num_ref_idx_lx_active[1] >= H264_MAX_REF_IDX))
  ------------------
  |  |  535|  6.54k|#define H264_MAX_REF_IDX          32
  ------------------
  |  Branch (3390:16): [True: 0, False: 6.54k]
  ------------------
 3391|      0|            {
 3392|      0|                return ERROR_NUM_REF;
 3393|      0|            }
 3394|       |            /*-------------------------------------------------------------------*/
 3395|       |            /*------------------------- Pred weight table -----------------------*/
 3396|       |            /*-------------------------------------------------------------------*/
 3397|  6.54k|            if(CODED_SLICE_EXTENSION_NAL == i4_nal_unit_type)
  ------------------
  |  |   66|  6.54k|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (3397:16): [True: 6.34k, False: 198]
  ------------------
 3398|  6.34k|            {
 3399|  6.34k|                WORD32 i4_base_pred_wt_tbl_flag = 1;
 3400|       |
 3401|       |                /* base_pred_weight_table_flag */
 3402|  6.34k|                if(0 == i4_no_int_lyr_pred)
  ------------------
  |  Branch (3402:20): [True: 6.27k, False: 69]
  ------------------
 3403|  6.27k|                {
 3404|  6.27k|                    i4_base_pred_wt_tbl_flag = ih264d_get_bit_h264(ps_bitstrm);
 3405|  6.27k|                }
 3406|       |
 3407|  6.34k|                if((1 == i4_no_int_lyr_pred) || (0 == i4_base_pred_wt_tbl_flag))
  ------------------
  |  Branch (3407:20): [True: 69, False: 6.27k]
  |  Branch (3407:49): [True: 5.14k, False: 1.13k]
  ------------------
 3408|  5.21k|                {
 3409|  5.21k|                    ret = ih264d_parse_pred_weight_table(ps_slice_prms, ps_bitstrm);
 3410|  5.21k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  5.21k|#define OK        0
  ------------------
  |  Branch (3410:24): [True: 2.38k, False: 2.82k]
  ------------------
 3411|  5.21k|                }
 3412|  6.34k|            }
 3413|    198|            else
 3414|    198|            {
 3415|    198|                ret = ih264d_parse_pred_weight_table(ps_slice_prms, ps_bitstrm);
 3416|    198|                if(ret != OK) return ret;
  ------------------
  |  |  114|    198|#define OK        0
  ------------------
  |  Branch (3416:20): [True: 103, False: 95]
  ------------------
 3417|    198|            }
 3418|  6.54k|        }
 3419|       |
 3420|       |        /*-----------------------------------------------------------------------*/
 3421|       |        /*------------------------- ref pic marking -----------------------------*/
 3422|       |        /*-----------------------------------------------------------------------*/
 3423|  33.3k|        if(0 != i4_nal_ref_idc)
  ------------------
  |  Branch (3423:12): [True: 28.3k, False: 4.92k]
  ------------------
 3424|  28.3k|        {
 3425|  28.3k|            dec_struct_t *ps_dec;
 3426|  28.3k|            svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 3427|  28.3k|            UWORD8 u1_store_ref_base_pic;
 3428|  28.3k|            ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 3429|  28.3k|            ps_dec = &ps_svc_lyr_dec->s_dec;
 3430|  28.3k|            {
 3431|  28.3k|                dec_seq_params_t *ps_sps_tmp = ps_pps->ps_sps;
 3432|       |
 3433|  28.3k|                ps_dec->u1_nal_unit_type = i4_nal_unit_type;
 3434|  28.3k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag = i4_idr_pic_flag;
 3435|  28.3k|                ps_dec->ps_cur_sps = ps_sps;
 3436|  28.3k|                ps_dec->ps_cur_pps = ps_pps;
 3437|  28.3k|                ps_pps->ps_sps = ps_sps;
 3438|       |
 3439|  28.3k|                if(ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag)
  ------------------
  |  Branch (3439:20): [True: 22.1k, False: 6.21k]
  ------------------
 3440|  22.1k|                    ps_dec->u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  22.1k|#define IDR_SLICE_NAL                   5
  ------------------
 3441|       |
 3442|  28.3k|                i_temp = ih264d_read_mmco_commands(ps_dec);
 3443|  28.3k|                ps_pps->ps_sps = ps_sps_tmp;
 3444|  28.3k|                ps_dec->u1_nal_unit_type = i4_nal_unit_type;
 3445|  28.3k|                if(i_temp < 0)
  ------------------
  |  Branch (3445:20): [True: 301, False: 28.0k]
  ------------------
 3446|    301|                {
 3447|    301|                    return ERROR_DBP_MANAGER_T;
 3448|    301|                }
 3449|  28.0k|                ps_dec->u4_bitoffset = i_temp;
 3450|  28.0k|            }
 3451|       |
 3452|  28.0k|            if(0 == ps_subset_sps->s_sps_svc_ext.u1_slice_header_restriction_flag)
  ------------------
  |  Branch (3452:16): [True: 20.4k, False: 7.67k]
  ------------------
 3453|  20.4k|            {
 3454|       |                /* store_ref_base_pic_flag */
 3455|  20.4k|                u1_store_ref_base_pic = ih264d_get_bit_h264(ps_bitstrm);
 3456|  20.4k|                if(0 != u1_store_ref_base_pic)
  ------------------
  |  Branch (3456:20): [True: 4.19k, False: 16.2k]
  ------------------
 3457|  4.19k|                {
 3458|  4.19k|                    return ERROR_INV_SLICE_HDR_T;
 3459|  4.19k|                }
 3460|       |
 3461|  16.2k|                if(((1 == i4_use_ref_base) || (1 == u1_store_ref_base_pic)) &&
  ------------------
  |  Branch (3461:21): [True: 0, False: 16.2k]
  |  Branch (3461:47): [True: 0, False: 16.2k]
  ------------------
 3462|      0|                   (SVCD_FALSE == i4_idr_pic_flag))
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
  |  Branch (3462:20): [True: 0, False: 0]
  ------------------
 3463|      0|                {
 3464|      0|                    i_temp = isvcd_dec_ref_base_pic_marking(
 3465|      0|                        &ps_svc_lyr_dec->s_svc_slice_params.s_ref_base_pic_marking_svc_ext,
 3466|      0|                        ps_bitstrm);
 3467|      0|                    if(i_temp != OK)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (3467:24): [True: 0, False: 0]
  ------------------
 3468|      0|                    {
 3469|      0|                        return i_temp;
 3470|      0|                    }
 3471|      0|                }
 3472|       |                /******* End of if (SVC_VCL_NAL == i4_nal_unit_type) *********/
 3473|  16.2k|            }
 3474|       |            /******** End of if(0 != i4_nal_ref_idc) *************************/
 3475|  28.0k|        }
 3476|       |        /************* End of if(0 == i4_quality_id) *************************/
 3477|  33.3k|    }
 3478|       |
 3479|       |    /*-----------------------------------------------------------------------*/
 3480|       |    /*--------------------------- cabac int idc -----------------------------*/
 3481|       |    /*-----------------------------------------------------------------------*/
 3482|  28.8k|    if((ps_pps->u1_entropy_coding_mode == CABAC) && (I_SLICE != ps_slice_prms->u1_slice_type))
  ------------------
  |  |  339|  28.8k|#define CABAC  1
  ------------------
                  if((ps_pps->u1_entropy_coding_mode == CABAC) && (I_SLICE != ps_slice_prms->u1_slice_type))
  ------------------
  |  |  370|  5.27k|#define I_SLICE  2
  ------------------
  |  Branch (3482:8): [True: 5.27k, False: 23.5k]
  |  Branch (3482:53): [True: 3.00k, False: 2.26k]
  ------------------
 3483|  3.00k|    {
 3484|  3.00k|        ps_slice_prms->u1_cabac_init_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3485|  3.00k|        if(ps_slice_prms->u1_cabac_init_idc > MAX_CABAC_INIT_IDC)
  ------------------
  |  |  537|  3.00k|#define MAX_CABAC_INIT_IDC        2
  ------------------
  |  Branch (3485:12): [True: 2.02k, False: 977]
  ------------------
 3486|  2.02k|        {
 3487|  2.02k|            return ERROR_INV_SLICE_HDR_T;
 3488|  2.02k|        }
 3489|  3.00k|    }
 3490|       |
 3491|       |    /*-----------------------------------------------------------------------*/
 3492|       |    /*--------------------------- slice qp delta ----------------------------*/
 3493|       |    /*-----------------------------------------------------------------------*/
 3494|  26.7k|    {
 3495|  26.7k|        WORD8 i1_slice_qp_delta;
 3496|  26.7k|        i1_slice_qp_delta = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3497|  26.7k|        i1_slice_qp_delta += ps_pps->u1_pic_init_qp;
 3498|  26.7k|        if((i1_slice_qp_delta < MIN_H264_QP) || (i1_slice_qp_delta > MAX_H264_QP))
  ------------------
  |  |  629|  26.7k|#define MIN_H264_QP 0
  ------------------
                      if((i1_slice_qp_delta < MIN_H264_QP) || (i1_slice_qp_delta > MAX_H264_QP))
  ------------------
  |  |  634|  25.5k|#define MAX_H264_QP 51
  ------------------
  |  Branch (3498:12): [True: 1.19k, False: 25.5k]
  |  Branch (3498:49): [True: 781, False: 24.8k]
  ------------------
 3499|  1.97k|        {
 3500|  1.97k|            return ERROR_INV_RANGE_QP_T;
 3501|  1.97k|        }
 3502|  24.8k|        ps_slice_prms->u1_slice_qp = (UWORD8) i1_slice_qp_delta;
 3503|  24.8k|    }
 3504|       |
 3505|       |    /*-----------------------------------------------------------------------*/
 3506|       |    /*--------------------------- disable dblk filter idc -------------------*/
 3507|       |    /*-----------------------------------------------------------------------*/
 3508|       |    /* Set to default value */
 3509|       |
 3510|      0|    ps_slice_prms->u1_disable_dblk_filter_idc = 0;
 3511|  24.8k|    if(SVCD_TRUE == ps_pps->u1_deblocking_filter_parameters_present_flag)
  ------------------
  |  |   46|  24.8k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3511:8): [True: 12.6k, False: 12.2k]
  ------------------
 3512|  12.6k|    {
 3513|  12.6k|        ps_slice_prms->u1_disable_dblk_filter_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3514|       |
 3515|  12.6k|        if(ps_slice_prms->u1_disable_dblk_filter_idc > SLICE_BOUNDARY_DBLK_DISABLED)
  ------------------
  |  |  547|  12.6k|#define SLICE_BOUNDARY_DBLK_DISABLED  2
  ------------------
  |  Branch (3515:12): [True: 3.16k, False: 9.44k]
  ------------------
 3516|  3.16k|        {
 3517|  3.16k|            return ERROR_INV_SLICE_HDR_T;
 3518|  3.16k|        }
 3519|       |        /*-------------------------------------------------------------------*/
 3520|       |        /*--------------------------- slice_alpha_c0_offset_div2 ------------*/
 3521|       |        /*--------------------------- slice_beta_offset_div2 ----------------*/
 3522|       |        /*-------------------------------------------------------------------*/
 3523|  9.44k|        if(1 != ps_slice_prms->u1_disable_dblk_filter_idc)
  ------------------
  |  Branch (3523:12): [True: 7.75k, False: 1.68k]
  ------------------
 3524|  7.75k|        {
 3525|       |            /* slice_alpha_c0_offset_div2 */
 3526|  7.75k|            ps_slice_prms->i1_slice_alpha_c0_offset = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3527|  7.75k|            if((MIN_DBLK_FIL_OFF > ps_slice_prms->i1_slice_alpha_c0_offset) ||
  ------------------
  |  |  550|  7.75k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
  |  Branch (3527:16): [True: 253, False: 7.50k]
  ------------------
 3528|  7.50k|               (ps_slice_prms->i1_slice_alpha_c0_offset > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  7.50k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (3528:16): [True: 142, False: 7.36k]
  ------------------
 3529|    395|            {
 3530|    395|                return ERROR_INV_SLICE_HDR_T;
 3531|    395|            }
 3532|  7.36k|            ps_slice_prms->i1_slice_beta_offset = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3533|  7.36k|            if((MIN_DBLK_FIL_OFF > ps_slice_prms->i1_slice_beta_offset) ||
  ------------------
  |  |  550|  7.36k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
  |  Branch (3533:16): [True: 127, False: 7.23k]
  ------------------
 3534|  7.23k|               (ps_slice_prms->i1_slice_beta_offset > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  7.23k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (3534:16): [True: 279, False: 6.95k]
  ------------------
 3535|    406|            {
 3536|    406|                return ERROR_INV_SLICE_HDR_T;
 3537|    406|            }
 3538|  7.36k|        }
 3539|  9.44k|    }
 3540|       |
 3541|  20.8k|    *pi4_ref_dq_id = -1;
 3542|       |
 3543|  20.8k|    if((0 == i4_no_int_lyr_pred) && (0 == i4_quality_id))
  ------------------
  |  Branch (3543:8): [True: 20.5k, False: 335]
  |  Branch (3543:37): [True: 20.5k, False: 0]
  ------------------
 3544|  20.5k|    {
 3545|  20.5k|        WORD32 i4_inter_lyr_dblk_idc;
 3546|  20.5k|        WORD32 i4_inter_lyr_alpha_c0_offset;
 3547|  20.5k|        WORD32 i4_inter_lyr_beta_offset;
 3548|       |
 3549|       |        /*-------------------------------------------------------------------*/
 3550|       |        /*--------------------------- ref_layer_dq_id -----------------------*/
 3551|       |        /*-------------------------------------------------------------------*/
 3552|  20.5k|        *pi4_ref_dq_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3553|       |
 3554|  20.5k|        if(*pi4_ref_dq_id > MAX_REF_DEP_ID)
  ------------------
  |  |  106|  20.5k|#define MAX_REF_DEP_ID ((MAX_DEPENDENCY_ID << 4) | MAX_QUALITY_ID)
  |  |  ------------------
  |  |  |  |  103|  20.5k|#define MAX_DEPENDENCY_ID 4
  |  |  ------------------
  |  |               #define MAX_REF_DEP_ID ((MAX_DEPENDENCY_ID << 4) | MAX_QUALITY_ID)
  |  |  ------------------
  |  |  |  |  102|  20.5k|#define MAX_QUALITY_ID 0
  |  |  ------------------
  ------------------
  |  Branch (3554:12): [True: 1.65k, False: 18.8k]
  ------------------
 3555|  1.65k|        {
 3556|  1.65k|            return ERROR_INV_SLICE_HDR_T;
 3557|  1.65k|        }
 3558|       |        /* ------------------------------------------- */
 3559|       |        /* ---- Inter layer de-blocking parameters ---- */
 3560|       |        /* ------------------------------------------- */
 3561|  18.8k|        i4_inter_lyr_dblk_idc = 0;
 3562|  18.8k|        i4_inter_lyr_alpha_c0_offset = 0;
 3563|  18.8k|        i4_inter_lyr_beta_offset = 0;
 3564|  18.8k|        if(SVCD_TRUE ==
  ------------------
  |  |   46|  18.8k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3564:12): [True: 2.95k, False: 15.9k]
  ------------------
 3565|  18.8k|           ps_subset_sps->s_sps_svc_ext.u1_inter_layer_deblocking_filter_control_present_flag)
 3566|  2.95k|        {
 3567|  2.95k|            i4_inter_lyr_dblk_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3568|       |
 3569|  2.95k|            if(i4_inter_lyr_dblk_idc > 6)
  ------------------
  |  Branch (3569:16): [True: 307, False: 2.64k]
  ------------------
 3570|    307|            {
 3571|    307|                return ERROR_INV_SLICE_HDR_T;
 3572|    307|            }
 3573|  2.64k|            if(1 != i4_inter_lyr_dblk_idc)
  ------------------
  |  Branch (3573:16): [True: 2.23k, False: 409]
  ------------------
 3574|  2.23k|            {
 3575|       |                /* Alpha Offset */
 3576|  2.23k|                i4_inter_lyr_alpha_c0_offset = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3577|  2.23k|                if(i4_inter_lyr_alpha_c0_offset > 6 || i4_inter_lyr_alpha_c0_offset < -6)
  ------------------
  |  Branch (3577:20): [True: 210, False: 2.02k]
  |  Branch (3577:56): [True: 148, False: 1.88k]
  ------------------
 3578|    358|                {
 3579|    358|                    return ERROR_INV_SLICE_HDR_T;
 3580|    358|                }
 3581|  1.88k|                i4_inter_lyr_alpha_c0_offset <<= 1;
 3582|       |
 3583|       |                /* Beta Offset */
 3584|  1.88k|                i4_inter_lyr_beta_offset = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3585|  1.88k|                if(i4_inter_lyr_beta_offset > 6 || i4_inter_lyr_beta_offset < -6)
  ------------------
  |  Branch (3585:20): [True: 371, False: 1.50k]
  |  Branch (3585:52): [True: 226, False: 1.28k]
  ------------------
 3586|    597|                {
 3587|    597|                    return ERROR_INV_SLICE_HDR_T;
 3588|    597|                }
 3589|  1.28k|                i4_inter_lyr_beta_offset <<= 1;
 3590|  1.28k|            }
 3591|  2.64k|        }
 3592|  17.6k|        ps_vcl_node->i4_inter_lyr_dblk_idc = i4_inter_lyr_dblk_idc;
 3593|  17.6k|        ps_vcl_node->i4_inter_lyr_beta_offset = i4_inter_lyr_beta_offset;
 3594|  17.6k|        ps_vcl_node->i4_inter_lyr_alpha_c0_offset = i4_inter_lyr_alpha_c0_offset;
 3595|  17.6k|    }
 3596|       |
 3597|  17.9k|    return (0);
 3598|  20.8k|}
isvcd_get_ref_lyr_dqid:
 3631|  83.8k|{
 3632|  83.8k|    WORD32 i4_status;
 3633|  83.8k|    WORD32 ai4_ref_dq_id[2] = {0};
 3634|  83.8k|    WORD32 i4_num_slc_dec;
 3635|       |
 3636|       |    /* local structures */
 3637|  83.8k|    dec_slice_params_t s_slice_prms = {0};
 3638|       |
 3639|       |    /* vcl buffer */
 3640|  83.8k|    vcl_buf_hdr_t *ps_vcl_buf;
 3641|  83.8k|    dec_struct_t *ps_dec;
 3642|  83.8k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 3643|  83.8k|    UNUSED(i4_prev_au_dqid);
  ------------------
  |  |   45|  83.8k|#define UNUSED(x) ((void)(x))
  ------------------
 3644|  83.8k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 3645|       |    /* Sanity checks */
 3646|  83.8k|    if((NULL == ps_vcl_node) || (NULL == ps_sps) || (NULL == ps_pps) || (NULL == pi4_ref_lyr_dqid))
  ------------------
  |  Branch (3646:8): [True: 0, False: 83.8k]
  |  Branch (3646:33): [True: 0, False: 83.8k]
  |  Branch (3646:53): [True: 0, False: 83.8k]
  |  Branch (3646:73): [True: 0, False: 83.8k]
  ------------------
 3647|      0|    {
 3648|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3649|      0|    }
 3650|       |
 3651|  83.8k|    i4_num_slc_dec = 0;
 3652|  83.8k|    ps_vcl_buf = ps_vcl_node->ps_first_vcl_nal;
 3653|  83.8k|    i4_status = NOT_OK;
  ------------------
  |  |  116|  83.8k|#define NOT_OK    -1
  ------------------
 3654|       |
 3655|  83.8k|    while(NULL != ps_vcl_buf)
  ------------------
  |  Branch (3655:11): [True: 57.1k, False: 26.7k]
  ------------------
 3656|  57.1k|    {
 3657|  57.1k|        WORD32 i4_error;
 3658|       |
 3659|       |        /* Fill the stream context structure */
 3660|  57.1k|        ps_dec->ps_bitstrm->u4_ofst = 0;
 3661|  57.1k|        ps_dec->ps_bitstrm->pu4_buffer =
 3662|  57.1k|            (UWORD32 *) ((UWORD8 *) ps_vcl_buf + ps_vcl_buf->i4_buf_offset +
 3663|  57.1k|                         ps_vcl_buf->i4_slice_offset);
 3664|  57.1k|        ps_dec->ps_bitstrm->u4_max_ofst = ps_vcl_buf->u4_max_bits;
 3665|       |
 3666|       |        /* call the function which decodes the slice header */
 3667|  57.1k|        i4_error = isvcd_parse_slice_hdr_refdq_id(ps_vcl_node, &s_slice_prms, ps_dec->ps_bitstrm,
 3668|  57.1k|                                                  &ai4_ref_dq_id[i4_num_slc_dec], ps_sps, ps_pps,
 3669|  57.1k|                                                  ps_vcl_buf->i4_no_int_lyr_pred, ps_svcd_ctxt);
 3670|       |
 3671|       |        /* store the first error encountered */
 3672|  57.1k|        if(0 == *pi4_err_code)
  ------------------
  |  Branch (3672:12): [True: 14.4k, False: 42.6k]
  ------------------
 3673|  14.4k|        {
 3674|  14.4k|            *pi4_err_code = i4_error;
 3675|  14.4k|        }
 3676|  57.1k|        if(i4_error != 0)
  ------------------
  |  Branch (3676:12): [True: 39.1k, False: 17.9k]
  ------------------
 3677|  39.1k|        {
 3678|       |            /* check on the Error returned */
 3679|  39.1k|            return NOT_OK;
  ------------------
  |  |  116|  39.1k|#define NOT_OK    -1
  ------------------
 3680|  39.1k|        }
 3681|       |
 3682|       |        /* set the return status */
 3683|  17.9k|        i4_status = OK;
  ------------------
  |  |  114|  17.9k|#define OK        0
  ------------------
 3684|  17.9k|        break;
 3685|       |
 3686|       |        /* go to the next slice header */
 3687|      0|        ps_vcl_buf = ps_vcl_buf->ps_next;
 3688|      0|    }
 3689|       |
 3690|       |    /* set the appropriate reference dqid of the first slice */
 3691|  44.6k|    *pi4_ref_lyr_dqid = ai4_ref_dq_id[0];
 3692|       |
 3693|  44.6k|    return (i4_status);
 3694|  83.8k|}
isvcd_conceal_node_params:
 3719|  77.3k|{
 3720|  77.3k|    vcl_node_t *ps_node;
 3721|  77.3k|    WORD32 i4_conceal_lyrs;
 3722|  77.3k|    WORD32 i4_no_gaps_flag;
 3723|       |
 3724|       |    /* get the bottom node */
 3725|  77.3k|    ps_node = ps_vcl_nal->ps_bot_node;
 3726|  77.3k|    i4_conceal_lyrs = SVCD_FALSE;
  ------------------
  |  |   45|  77.3k|#define SVCD_FALSE 0
  ------------------
 3727|  77.3k|    i4_no_gaps_flag = SVCD_FALSE;
  ------------------
  |  |   45|  77.3k|#define SVCD_FALSE 0
  ------------------
 3728|       |
 3729|       |    /* loop over all nodes present in the current AU */
 3730|   231k|    while(NULL != ps_node)
  ------------------
  |  Branch (3730:11): [True: 154k, False: 77.3k]
  ------------------
 3731|   154k|    {
 3732|   154k|        WORD32 i4_dep_id = 0;
 3733|   154k|        WORD32 i4_qua_id = 0;
 3734|   154k|        UWORD16 u2_frm_num_dep = 0;
 3735|   154k|        WORD32 i4_idr_pic_flag = 0;
 3736|   154k|        WORD32 i4_idr_pic_num = 0;
 3737|   154k|        WORD32 i4_nal_ref_idc = 0;
 3738|   154k|        WORD32 i4_poc_syntax = 0;
 3739|   154k|        WORD32 i4_qua_zero_lyr_sts = 0;
 3740|       |
 3741|   154k|        i4_dep_id = ps_node->i4_dependency_id;
 3742|   154k|        i4_qua_id = ps_node->i4_quality_id;
 3743|       |
 3744|       |        /* reset the quality 0 layer updated status */
 3745|   154k|        if(0 == i4_qua_id)
  ------------------
  |  Branch (3745:12): [True: 154k, False: 0]
  ------------------
 3746|   154k|        {
 3747|   154k|            i4_qua_zero_lyr_sts = SVCD_FALSE;
  ------------------
  |  |   45|   154k|#define SVCD_FALSE 0
  ------------------
 3748|   154k|        }
 3749|       |
 3750|       |        /* process the quality id 0 layers */
 3751|   154k|        if((0 == i4_qua_id) && (NULL != ps_node->ps_first_vcl_nal))
  ------------------
  |  Branch (3751:12): [True: 154k, False: 0]
  |  Branch (3751:32): [True: 123k, False: 31.0k]
  ------------------
 3752|   123k|        {
 3753|       |            /* if current and previous are reference pictures */
 3754|   123k|            if((0 != ps_prev_au_prms[i4_dep_id].i4_nal_ref_id) && (0 != ps_node->i4_nal_ref_idc))
  ------------------
  |  Branch (3754:16): [True: 96.2k, False: 27.4k]
  |  Branch (3754:67): [True: 89.0k, False: 7.12k]
  ------------------
 3755|  89.0k|            {
 3756|  89.0k|                if(ps_prev_au_prms[i4_dep_id].u2_frm_num == ps_node->u2_frm_num)
  ------------------
  |  Branch (3756:20): [True: 26.6k, False: 62.3k]
  ------------------
 3757|  26.6k|                {
 3758|       |                    /* frame number is concealed */
 3759|  26.6k|                    ps_node->u2_frm_num++;
 3760|  26.6k|                    i4_conceal_lyrs = SVCD_TRUE;
  ------------------
  |  |   46|  26.6k|#define SVCD_TRUE 1
  ------------------
 3761|  26.6k|                }
 3762|  62.3k|                else if((SVCD_TRUE == i4_conceal_lyrs) || (SVCD_TRUE == i4_no_gaps_flag))
  ------------------
  |  |   46|  62.3k|#define SVCD_TRUE 1
  ------------------
                              else if((SVCD_TRUE == i4_conceal_lyrs) || (SVCD_TRUE == i4_no_gaps_flag))
  ------------------
  |  |   46|  53.1k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3762:25): [True: 9.25k, False: 53.1k]
  |  Branch (3762:59): [True: 6.69k, False: 46.4k]
  ------------------
 3763|  15.9k|                {
 3764|       |                    /* if the current au frm_num is less than prev */
 3765|       |                    /* or the difference is greater than 1         */
 3766|  15.9k|                    if((ps_prev_au_prms[i4_dep_id].u2_frm_num > ps_node->u2_frm_num) ||
  ------------------
  |  Branch (3766:24): [True: 418, False: 15.5k]
  ------------------
 3767|  15.5k|                       ((ps_node->u2_frm_num - ps_prev_au_prms[i4_dep_id].u2_frm_num) > 1))
  ------------------
  |  Branch (3767:24): [True: 15.2k, False: 232]
  ------------------
 3768|  15.7k|                    {
 3769|       |                        /* frame number is concealed */
 3770|  15.7k|                        ps_node->u2_frm_num = ps_prev_au_prms[i4_dep_id].u2_frm_num + 1;
 3771|  15.7k|                    }
 3772|  15.9k|                }
 3773|       |
 3774|       |                /* set the no gaps flag */
 3775|  89.0k|                if(1 == (ps_node->u2_frm_num - ps_prev_au_prms[i4_dep_id].u2_frm_num))
  ------------------
  |  Branch (3775:20): [True: 58.8k, False: 30.2k]
  ------------------
 3776|  58.8k|                {
 3777|  58.8k|                    i4_no_gaps_flag = SVCD_TRUE;
  ------------------
  |  |   46|  58.8k|#define SVCD_TRUE 1
  ------------------
 3778|  58.8k|                }
 3779|  89.0k|            }
 3780|       |
 3781|       |            /* store the final frame number */
 3782|   123k|            u2_frm_num_dep = ps_node->u2_frm_num;
 3783|   123k|            i4_idr_pic_flag = ps_node->i4_idr_pic_flag;
 3784|   123k|            i4_idr_pic_num = ps_node->i4_idr_pic_num;
 3785|   123k|            i4_nal_ref_idc = ps_node->i4_nal_ref_idc;
 3786|   123k|            i4_poc_syntax = ps_node->i4_poc_syntax;
 3787|   123k|            i4_qua_zero_lyr_sts = SVCD_TRUE;
  ------------------
  |  |   46|   123k|#define SVCD_TRUE 1
  ------------------
 3788|   123k|        }
 3789|  31.0k|        else
 3790|  31.0k|        {
 3791|  31.0k|            if(SVCD_TRUE == i4_qua_zero_lyr_sts)
  ------------------
  |  |   46|  31.0k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3791:16): [True: 0, False: 31.0k]
  ------------------
 3792|      0|            {
 3793|       |                /* for higher quality layers store the same value */
 3794|       |                /* present in the quality id 0 layer              */
 3795|      0|                ps_node->u2_frm_num = u2_frm_num_dep;
 3796|      0|                ps_node->i4_idr_pic_flag = i4_idr_pic_flag;
 3797|      0|                ps_node->i4_idr_pic_num = i4_idr_pic_num;
 3798|      0|                ps_node->i4_nal_ref_idc = i4_nal_ref_idc;
 3799|      0|                ps_node->i4_poc_syntax = i4_poc_syntax;
 3800|      0|            }
 3801|  31.0k|        }
 3802|       |
 3803|       |        /* get the upper node pointer */
 3804|   154k|        ps_node = ps_node->ps_top_node;
 3805|   154k|    }
 3806|  77.3k|}
isvcd_refine_dep_list:
 3840|   162k|{
 3841|   162k|    vcl_nal_t *ps_vcl_nal;
 3842|   162k|    vcl_node_t *ps_vcl_node;
 3843|   162k|    WORD32 i4_idr_pic_flag;
 3844|   162k|    WORD32 i4_nal_ref_idc;
 3845|   162k|    WORD32 i4_idr_pic_num;
 3846|   162k|    WORD32 i4_num_res_lyrs_bup;
 3847|   162k|    WORD32 i4_restore_prms_flag;
 3848|   162k|    vcl_node_t *ps_node_bup;
 3849|   162k|    WORD32 ai4_dep_id[MAX_NUM_RES_LYRS] = {0};
 3850|       |
 3851|       |    /* used for checking the init prms */
 3852|   162k|    dec_seq_params_t *ps_sps_tgt_minus1_lyr = NULL;
 3853|   162k|    dec_seq_params_t *ps_sps_tgt_minus2_lyr = NULL;
 3854|   162k|    UNUSED(pi4_err_code);
  ------------------
  |  |   45|   162k|#define UNUSED(x) ((void)(x))
  ------------------
 3855|       |    /* sanity checks */
 3856|   162k|    if((NULL == pv_out_vcl_ctxt) || (NULL == ps_sps) || (NULL == ps_pps))
  ------------------
  |  Branch (3856:8): [True: 0, False: 162k]
  |  Branch (3856:37): [True: 0, False: 162k]
  |  Branch (3856:57): [True: 0, False: 162k]
  ------------------
 3857|      0|    {
 3858|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3859|      0|    }
 3860|       |
 3861|   162k|    ps_vcl_nal = (vcl_nal_t *) pv_out_vcl_ctxt;
 3862|       |
 3863|       |    /*  no node is present */
 3864|   162k|    if(NULL == ps_vcl_nal->ps_bot_node)
  ------------------
  |  Branch (3864:8): [True: 1.26k, False: 161k]
  ------------------
 3865|  1.26k|    {
 3866|  1.26k|        return (NOT_OK);
  ------------------
  |  |  116|  1.26k|#define NOT_OK    -1
  ------------------
 3867|  1.26k|    }
 3868|       |
 3869|       |    /* set the single layer flag if top node and bottom node are same */
 3870|   161k|    if((ps_vcl_nal->ps_bot_node == ps_vcl_nal->ps_top_node) &&
  ------------------
  |  Branch (3870:8): [True: 83.7k, False: 77.3k]
  ------------------
 3871|  83.7k|       (0 == ps_vcl_nal->ps_bot_node->i4_dependency_id))
  ------------------
  |  Branch (3871:8): [True: 83.7k, False: 0]
  ------------------
 3872|  83.7k|    {
 3873|  83.7k|    }
 3874|  77.3k|    else
 3875|  77.3k|    {
 3876|       |        /* call the function which corrects the frame number of each node */
 3877|       |        /* based on previous access unit frame number                     */
 3878|  77.3k|        isvcd_conceal_node_params(ps_vcl_nal, ps_prev_au_prms);
 3879|  77.3k|    }
 3880|       |    /* get the top most node */
 3881|   161k|    ps_vcl_node = ps_vcl_nal->ps_top_node;
 3882|       |
 3883|       |    /* get the IDR picture flag for top most layer in current AU */
 3884|       |    /* if not valid then set the value present in the first valid node */
 3885|   161k|    {
 3886|   161k|        vcl_node_t *ps_node;
 3887|   161k|        WORD32 i4_node_present_flag;
 3888|       |
 3889|   161k|        ps_node = ps_vcl_node;
 3890|   161k|        i4_node_present_flag = SVCD_FALSE;
  ------------------
  |  |   45|   161k|#define SVCD_FALSE 0
  ------------------
 3891|       |
 3892|       |        /* store default values */
 3893|   161k|        i4_idr_pic_flag = SVCD_FALSE;
  ------------------
  |  |   45|   161k|#define SVCD_FALSE 0
  ------------------
 3894|   161k|        i4_nal_ref_idc = 0;
 3895|   161k|        i4_idr_pic_num = 0;
 3896|       |
 3897|       |        /* loop until valid node */
 3898|   164k|        while(NULL != ps_node)
  ------------------
  |  Branch (3898:15): [True: 163k, False: 557]
  ------------------
 3899|   163k|        {
 3900|   163k|            if(NULL != ps_node->ps_first_vcl_nal)
  ------------------
  |  Branch (3900:16): [True: 133k, False: 30.4k]
  ------------------
 3901|   133k|            {
 3902|   133k|                i4_idr_pic_flag = ps_node->i4_idr_pic_flag;
 3903|   133k|                i4_nal_ref_idc = ps_node->i4_nal_ref_idc;
 3904|   133k|                i4_idr_pic_num = ps_node->i4_idr_pic_num;
 3905|   133k|                i4_node_present_flag = SVCD_TRUE;
  ------------------
  |  |   46|   133k|#define SVCD_TRUE 1
  ------------------
 3906|   133k|                break;
 3907|   133k|            }
 3908|  30.4k|            else if(SVCD_TRUE == ps_node->i4_idr_pic_flag)
  ------------------
  |  |   46|  30.4k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3908:21): [True: 27.1k, False: 3.27k]
  ------------------
 3909|  27.1k|            {
 3910|  27.1k|                i4_idr_pic_flag = ps_node->i4_idr_pic_flag;
 3911|  27.1k|                i4_nal_ref_idc = ps_node->i4_nal_ref_idc;
 3912|  27.1k|                i4_idr_pic_num = ps_node->i4_idr_pic_num;
 3913|  27.1k|                i4_node_present_flag = SVCD_TRUE;
  ------------------
  |  |   46|  27.1k|#define SVCD_TRUE 1
  ------------------
 3914|  27.1k|                break;
 3915|  27.1k|            }
 3916|       |            /* point to next node */
 3917|  3.27k|            ps_node = ps_node->ps_bot_node;
 3918|  3.27k|        }
 3919|       |
 3920|       |        /* alteast one node should be present */
 3921|   161k|        if(SVCD_FALSE == i4_node_present_flag)
  ------------------
  |  |   45|   161k|#define SVCD_FALSE 0
  ------------------
  |  Branch (3921:12): [True: 557, False: 160k]
  ------------------
 3922|    557|        {
 3923|    557|            return (NOT_OK);
  ------------------
  |  |  116|    557|#define NOT_OK    -1
  ------------------
 3924|    557|        }
 3925|   161k|    }
 3926|       |
 3927|       |    /* initially the access unit is considered to have a single resolution */
 3928|   160k|    ai4_dep_id[0] = 0;
 3929|   160k|    ps_vcl_nal->i4_num_res_lyrs = 1;
 3930|   160k|    i4_restore_prms_flag = SVCD_FALSE;
  ------------------
  |  |   45|   160k|#define SVCD_FALSE 0
  ------------------
 3931|       |
 3932|       |    /*-----------------------------------------------------------------------*/
 3933|       |    /* loop until all the nodes are processed                                */
 3934|       |    /*-----------------------------------------------------------------------*/
 3935|   397k|    while(NULL != ps_vcl_node)
  ------------------
  |  Branch (3935:11): [True: 237k, False: 160k]
  ------------------
 3936|   237k|    {
 3937|   237k|        WORD32 i4_ref_lyr_dqid, i4_status;
 3938|   237k|        vcl_node_t *ps_bot_vcl_node;
 3939|   237k|        WORD32 i4_res_chnge_flag = SVCD_FALSE;
  ------------------
  |  |   45|   237k|#define SVCD_FALSE 0
  ------------------
 3940|   237k|        WORD32 i4_dep_id, i4_qua_id;
 3941|   237k|        WORD32 i4_prev_sps_pps_valid;
 3942|   237k|        WORD32 i4_prev_au_prms_valid;
 3943|       |
 3944|       |        /* set the reference layer DQID to -1 */
 3945|   237k|        i4_ref_lyr_dqid = -1;
 3946|       |
 3947|       |        /* get the current layer dependency and quality id */
 3948|   237k|        i4_dep_id = ps_vcl_node->i4_dependency_id;
 3949|   237k|        i4_qua_id = ps_vcl_node->i4_quality_id;
 3950|       |
 3951|       |        /* get the valid status of prev access unit params */
 3952|   237k|        i4_prev_au_prms_valid = ps_prev_au_prms[i4_dep_id].i4_updated_sts;
 3953|   237k|        i4_prev_sps_pps_valid = ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].i4_updated_sts;
 3954|       |
 3955|       |        /* missing layer handling */
 3956|   237k|        if(NULL == ps_vcl_node->ps_first_vcl_nal)
  ------------------
  |  Branch (3956:12): [True: 33.9k, False: 203k]
  ------------------
 3957|  33.9k|        {
 3958|       |            /* store the params appropriately */
 3959|  33.9k|            ps_vcl_node->i4_idr_pic_flag = i4_idr_pic_flag;
 3960|  33.9k|            ps_vcl_node->i4_nal_ref_idc = i4_nal_ref_idc;
 3961|  33.9k|            ps_vcl_node->i4_idr_pic_num = i4_idr_pic_num;
 3962|  33.9k|            ps_vcl_node->i4_num_slices = 0;
 3963|  33.9k|            ps_vcl_node->i4_use_ref_base = 0;
 3964|  33.9k|            ps_vcl_node->i4_temporal_id = 0;
 3965|       |
 3966|  33.9k|            if((0 != i4_dep_id) || (0 != i4_qua_id))
  ------------------
  |  Branch (3966:16): [True: 26.7k, False: 7.16k]
  |  Branch (3966:36): [True: 0, False: 7.16k]
  ------------------
 3967|  26.7k|            {
 3968|  26.7k|                ps_vcl_node->i4_nal_unit_type = CODED_SLICE_EXTENSION_NAL;
  ------------------
  |  |   66|  26.7k|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
 3969|  26.7k|                ps_vcl_node->u1_acc_no_int_pred = 0;
 3970|  26.7k|            }
 3971|  7.16k|            else if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|  7.16k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3971:21): [True: 6.23k, False: 927]
  ------------------
 3972|  6.23k|            {
 3973|  6.23k|                ps_vcl_node->i4_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  6.23k|#define IDR_SLICE_NAL                   5
  ------------------
 3974|  6.23k|                ps_vcl_node->u1_acc_no_int_pred = 1;
 3975|  6.23k|            }
 3976|    927|            else
 3977|    927|            {
 3978|    927|                ps_vcl_node->i4_nal_unit_type = SLICE_NAL;
  ------------------
  |  |  324|    927|#define SLICE_NAL                       1
  ------------------
 3979|    927|                ps_vcl_node->u1_acc_no_int_pred = 1;
 3980|    927|            }
 3981|       |
 3982|  33.9k|            if(SVCD_FALSE == i4_idr_pic_flag)
  ------------------
  |  |   45|  33.9k|#define SVCD_FALSE 0
  ------------------
  |  Branch (3982:16): [True: 2.11k, False: 31.7k]
  ------------------
 3983|  2.11k|            {
 3984|       |                /* pick the other params form previous access unit */
 3985|  2.11k|                if(SVCD_TRUE == i4_prev_sps_pps_valid)
  ------------------
  |  |   46|  2.11k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3985:20): [True: 2.11k, False: 0]
  ------------------
 3986|  2.11k|                {
 3987|  2.11k|                    ps_vcl_node->u1_pps_id =
 3988|  2.11k|                        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_pps_id;
 3989|       |
 3990|  2.11k|                    ps_vcl_node->u1_sps_id =
 3991|  2.11k|                        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_sps_id;
 3992|  2.11k|                }
 3993|       |
 3994|  2.11k|                if(SVCD_TRUE == i4_prev_au_prms_valid)
  ------------------
  |  |   46|  2.11k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3994:20): [True: 2.10k, False: 7]
  ------------------
 3995|  2.10k|                {
 3996|  2.10k|                    if(0 == ps_vcl_node->i4_nal_ref_idc)
  ------------------
  |  Branch (3996:24): [True: 718, False: 1.38k]
  ------------------
 3997|    718|                    {
 3998|    718|                        ps_vcl_node->u2_frm_num = ps_prev_au_prms[i4_dep_id].u2_frm_num;
 3999|    718|                    }
 4000|  1.38k|                    else
 4001|  1.38k|                    {
 4002|  1.38k|                        ps_vcl_node->u2_frm_num = ps_prev_au_prms[i4_dep_id].u2_frm_num + 1;
 4003|  1.38k|                    }
 4004|  2.10k|                }
 4005|  2.11k|            }
 4006|  33.9k|        }
 4007|       |
 4008|       |        /* SPS id cannot change unless its an IDR pic */
 4009|   237k|        if(SVCD_FALSE == ps_vcl_node->i4_idr_pic_flag)
  ------------------
  |  |   45|   237k|#define SVCD_FALSE 0
  ------------------
  |  Branch (4009:12): [True: 42.3k, False: 195k]
  ------------------
 4010|  42.3k|        {
 4011|  42.3k|            if(SVCD_TRUE == i4_prev_sps_pps_valid)
  ------------------
  |  |   46|  42.3k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4011:16): [True: 42.2k, False: 63]
  ------------------
 4012|  42.2k|            {
 4013|       |                /* store the SPS id of the current layer */
 4014|  42.2k|                ps_vcl_node->u1_sps_id = ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_sps_id;
 4015|  42.2k|            }
 4016|  42.3k|        }
 4017|       |
 4018|       |        /* store the PPS id and SPS id of the current layer */
 4019|   237k|        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_pps_id = ps_vcl_node->u1_pps_id;
 4020|   237k|        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].u1_sps_id = ps_vcl_node->u1_sps_id;
 4021|   237k|        ps_pps_sps_prev[(i4_dep_id << 4) + i4_qua_id].i4_updated_sts = SVCD_TRUE;
  ------------------
  |  |   46|   237k|#define SVCD_TRUE 1
  ------------------
 4022|       |
 4023|       |        /* handling of no_inter_layer_pred_flag 1 cases */
 4024|   237k|        if((1 == ps_vcl_node->u1_acc_no_int_pred) && (NULL != ps_vcl_node->ps_bot_node))
  ------------------
  |  Branch (4024:12): [True: 153k, False: 83.8k]
  |  Branch (4024:54): [True: 371, False: 153k]
  ------------------
 4025|    371|        {
 4026|    371|            if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|    371|#define SVCD_TRUE 1
  ------------------
  |  Branch (4026:16): [True: 275, False: 96]
  ------------------
 4027|    275|            {
 4028|       |                /* take a back up of the parameters till the current node. */
 4029|       |                /* these parameters will be restored at the end of loop */
 4030|       |
 4031|    275|                if(SVCD_FALSE == i4_restore_prms_flag)
  ------------------
  |  |   45|    275|#define SVCD_FALSE 0
  ------------------
  |  Branch (4031:20): [True: 275, False: 0]
  ------------------
 4032|    275|                {
 4033|       |                    /* get the number of resolution detected so far */
 4034|    275|                    i4_num_res_lyrs_bup = ps_vcl_nal->i4_num_res_lyrs;
 4035|       |
 4036|    275|                    ps_node_bup = ps_vcl_node;
 4037|       |
 4038|       |                    /* set the restore params flag */
 4039|    275|                    i4_restore_prms_flag = SVCD_TRUE;
  ------------------
  |  |   46|    275|#define SVCD_TRUE 1
  ------------------
 4040|    275|                }
 4041|    275|            }
 4042|     96|            else
 4043|     96|            {
 4044|     96|                ps_vcl_node->i4_ref_dq_id = -1;
 4045|     96|                ps_vcl_node->i4_res_change_flag = i4_res_chnge_flag;
 4046|       |
 4047|       |                /* store the reference DQID for current dependency */
 4048|     96|                ps_prev_au_prms[i4_dep_id].i4_ref_dq_id = -1;
 4049|     96|                ps_prev_au_prms[i4_dep_id].u2_frm_num = ps_vcl_node->u2_frm_num;
 4050|     96|                ps_prev_au_prms[i4_dep_id].i4_nal_ref_id = ps_vcl_node->i4_nal_ref_idc;
 4051|       |
 4052|       |                /* the bottom node is set to NULL */
 4053|     96|                ps_vcl_node->ps_bot_node = NULL;
 4054|     96|                break;
 4055|     96|            }
 4056|    371|        }
 4057|       |
 4058|       |        /* derive the reference layer DQID for quality id equal to 0 */
 4059|   237k|        if(0 == i4_qua_id)
  ------------------
  |  Branch (4059:12): [True: 237k, False: 0]
  ------------------
 4060|   237k|        {
 4061|   237k|            dec_seq_params_t *ps_curr_sps;
 4062|   237k|            dec_svc_seq_params_t *ps_curr_subset_sps;
 4063|       |
 4064|       |            /* derive current SPS */
 4065|   237k|            ps_curr_sps = ps_sps + ps_vcl_node->u1_sps_id;
 4066|   237k|            ps_curr_subset_sps = ps_subset_sps + ps_vcl_node->u1_sps_id;
 4067|       |
 4068|   237k|            {
 4069|   237k|                WORD32 i4_max_frm_num;
 4070|       |
 4071|       |                /* get the maximum value of frame number */
 4072|   237k|                i4_max_frm_num = (1 << (ps_curr_sps->u1_bits_in_frm_num + 1));
 4073|   237k|                ps_vcl_node->u2_frm_num = ps_vcl_node->u2_frm_num % i4_max_frm_num;
 4074|   237k|                if(SVCD_TRUE == ps_vcl_node->i4_idr_pic_flag)
  ------------------
  |  |   46|   237k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4074:20): [True: 195k, False: 42.2k]
  ------------------
 4075|   195k|                {
 4076|       |                    /* if idr then frm num should be 0 */
 4077|   195k|                    ps_vcl_node->u2_frm_num = 0;
 4078|   195k|                }
 4079|   237k|            }
 4080|       |
 4081|       |            /* store default params to inter layer deblocking params */
 4082|   237k|            ps_vcl_node->i4_inter_lyr_dblk_idc = 0;
 4083|   237k|            ps_vcl_node->i4_inter_lyr_beta_offset = 0;
 4084|   237k|            ps_vcl_node->i4_inter_lyr_alpha_c0_offset = 0;
 4085|       |            /* No SEI support for scalability info*/
 4086|   237k|            i4_status = NOT_OK;
  ------------------
  |  |  116|   237k|#define NOT_OK    -1
  ------------------
 4087|       |
 4088|       |            /* if no inter layer pred flag is present set the   */
 4089|       |            /* status to fail since the slices will not contain */
 4090|       |            /* reference layer Dqid                             */
 4091|   237k|            if(1 == ps_vcl_node->u1_acc_no_int_pred)
  ------------------
  |  Branch (4091:16): [True: 153k, False: 83.8k]
  ------------------
 4092|   153k|            {
 4093|   153k|                i4_status = NOT_OK;
  ------------------
  |  |  116|   153k|#define NOT_OK    -1
  ------------------
 4094|   153k|            }
 4095|  83.8k|            else
 4096|  83.8k|            {
 4097|  83.8k|                WORD32 *pi4_ref_dq_id;
 4098|  83.8k|                WORD32 i4_ref_dq_id_temp;
 4099|       |
 4100|       |                /* check if the SEI message has given the ref_dq_id */
 4101|  83.8k|                if(NOT_OK == i4_status)
  ------------------
  |  |  116|  83.8k|#define NOT_OK    -1
  ------------------
  |  Branch (4101:20): [True: 83.8k, False: 0]
  ------------------
 4102|  83.8k|                {
 4103|  83.8k|                    pi4_ref_dq_id = &i4_ref_lyr_dqid;
 4104|  83.8k|                }
 4105|      0|                else
 4106|      0|                {
 4107|      0|                    pi4_ref_dq_id = &i4_ref_dq_id_temp;
 4108|      0|                }
 4109|       |
 4110|  83.8k|                i4_status = isvcd_get_ref_lyr_dqid(ps_vcl_node, ps_sps, ps_pps, pi4_ref_dq_id,
 4111|  83.8k|                                                   ps_prev_au_prms[i4_dep_id].i4_ref_dq_id,
 4112|  83.8k|                                                   &ps_svcd_ctxt->i4_error_code, ps_svcd_ctxt);
 4113|  83.8k|            }
 4114|       |
 4115|       |            /* no slice in the layer has been successfully decoded */
 4116|   237k|            if(NOT_OK == i4_status)
  ------------------
  |  |  116|   237k|#define NOT_OK    -1
  ------------------
  |  Branch (4116:16): [True: 219k, False: 17.9k]
  ------------------
 4117|   219k|            {
 4118|       |                /* check for IDR picture */
 4119|   219k|                if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|   219k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4119:20): [True: 179k, False: 40.5k]
  ------------------
 4120|   179k|                {
 4121|       |                    /* set the next lower layer as the reference layer */
 4122|   179k|                    if(NULL != ps_vcl_node->ps_bot_node)
  ------------------
  |  Branch (4122:24): [True: 53.2k, False: 125k]
  ------------------
 4123|  53.2k|                    {
 4124|  53.2k|                        i4_ref_lyr_dqid = ps_vcl_node->ps_bot_node->i4_dependency_id << 4;
 4125|       |
 4126|  53.2k|                        i4_ref_lyr_dqid += ps_vcl_node->ps_bot_node->i4_quality_id;
 4127|  53.2k|                    }
 4128|   125k|                    else
 4129|   125k|                    {
 4130|   125k|                        i4_ref_lyr_dqid = -1;
 4131|   125k|                    }
 4132|   179k|                }
 4133|  40.5k|                else
 4134|  40.5k|                {
 4135|       |                    /* take the reference dq id from previous access unit */
 4136|  40.5k|                    i4_ref_lyr_dqid = ps_prev_au_prms[i4_dep_id].i4_ref_dq_id;
 4137|  40.5k|                }
 4138|   219k|            }
 4139|       |
 4140|       |            /* Update the DQID list based on ref DQID.     */
 4141|       |            /* This routine also updates the ref_dq_id     */
 4142|       |            /* in case the actual layer is completely lost */
 4143|   237k|            i4_status = isvcd_update_dqid(i4_ref_lyr_dqid, ps_vcl_node, &ps_bot_vcl_node);
 4144|       |
 4145|   237k|            if(!(OK == i4_status))
  ------------------
  |  |  114|   237k|#define OK        0
  ------------------
  |  Branch (4145:16): [True: 0, False: 237k]
  ------------------
 4146|      0|            {
 4147|      0|                return i4_status;
 4148|      0|            }
 4149|       |
 4150|       |            /* store the reference DQID for current depedency and */
 4151|       |            /* quality id 0 layer                                 */
 4152|   237k|            ps_prev_au_prms[i4_dep_id].i4_ref_dq_id = i4_ref_lyr_dqid;
 4153|   237k|            ps_prev_au_prms[i4_dep_id].i4_nal_ref_id = ps_vcl_node->i4_nal_ref_idc;
 4154|   237k|            ps_prev_au_prms[i4_dep_id].u2_frm_num = ps_vcl_node->u2_frm_num;
 4155|   237k|            ps_prev_au_prms[i4_dep_id].i4_updated_sts = SVCD_TRUE;
  ------------------
  |  |   46|   237k|#define SVCD_TRUE 1
  ------------------
 4156|       |
 4157|       |            /* ------- Detect Resolution Change ---------------- */
 4158|   237k|            {
 4159|   237k|                dec_seq_params_t *ps_lower_sps = NULL;
 4160|   237k|                dec_svc_seq_params_t *ps_lower_subset_sps = NULL;
 4161|       |
 4162|   237k|                if(NULL != ps_bot_vcl_node)
  ------------------
  |  Branch (4162:20): [True: 77.1k, False: 160k]
  ------------------
 4163|  77.1k|                {
 4164|  77.1k|                    if((NULL != ps_bot_vcl_node->ps_first_vcl_nal) ||
  ------------------
  |  Branch (4164:24): [True: 72.9k, False: 4.17k]
  ------------------
 4165|  4.17k|                       (SVCD_TRUE == i4_idr_pic_flag))
  ------------------
  |  |   46|  4.17k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4165:24): [True: 3.17k, False: 997]
  ------------------
 4166|  76.1k|                    {
 4167|       |                        /* get the SPS of layer */
 4168|  76.1k|                        ps_lower_sps = ps_sps + ps_bot_vcl_node->u1_sps_id;
 4169|  76.1k|                        ps_lower_subset_sps = ps_subset_sps + ps_bot_vcl_node->u1_sps_id;
 4170|  76.1k|                    }
 4171|    997|                    else
 4172|    997|                    {
 4173|       |                        /* if the bottom layer is completely missed */
 4174|    997|                        WORD32 i4_bot_dep_id, i4_bot_qua_id;
 4175|    997|                        UWORD8 u1_sps_id = 0;
 4176|       |
 4177|       |                        /* sps id is picked from previous access unit */
 4178|    997|                        i4_bot_dep_id = ps_bot_vcl_node->i4_dependency_id;
 4179|    997|                        i4_bot_qua_id = ps_bot_vcl_node->i4_quality_id;
 4180|       |
 4181|    997|                        if(SVCD_TRUE ==
  ------------------
  |  |   46|    997|#define SVCD_TRUE 1
  ------------------
  |  Branch (4181:28): [True: 927, False: 70]
  ------------------
 4182|    997|                           ps_pps_sps_prev[(i4_bot_dep_id << 4) + i4_bot_qua_id].i4_updated_sts)
 4183|    927|                        {
 4184|    927|                            u1_sps_id =
 4185|    927|                                ps_pps_sps_prev[(i4_bot_dep_id << 4) + i4_bot_qua_id].u1_sps_id;
 4186|    927|                        }
 4187|     70|                        else
 4188|     70|                        {
 4189|       |                            /* should not enter here */
 4190|     70|                            return NOT_OK;
  ------------------
  |  |  116|     70|#define NOT_OK    -1
  ------------------
 4191|     70|                        }
 4192|       |
 4193|       |                        /* get the SPS of lower layer */
 4194|    927|                        ps_lower_sps = ps_sps + u1_sps_id;
 4195|    927|                        ps_lower_subset_sps = ps_subset_sps + u1_sps_id;
 4196|    927|                    }
 4197|  77.1k|                }
 4198|       |
 4199|       |                /* call the function which detects resolution change */
 4200|   237k|                i4_res_chnge_flag = isvcd_detect_res_change(
 4201|   237k|                    ps_curr_sps, ps_lower_sps, ps_curr_subset_sps, ps_lower_subset_sps);
 4202|       |
 4203|       |                /* if a resolution exists below current resolution */
 4204|   237k|                if(SVCD_TRUE == i4_res_chnge_flag)
  ------------------
  |  |   46|   237k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4204:20): [True: 56.2k, False: 181k]
  ------------------
 4205|  56.2k|                {
 4206|       |                    /* if current picture id IDR */
 4207|  56.2k|                    if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|  56.2k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4207:24): [True: 49.4k, False: 6.83k]
  ------------------
 4208|  49.4k|                    {
 4209|       |                        /* store the depedency id of bottom most layer in current resolution */
 4210|  49.4k|                        ai4_dep_id[ps_vcl_nal->i4_num_res_lyrs - 1] = i4_dep_id;
 4211|  49.4k|                    }
 4212|       |
 4213|       |                    /* increment the num resolution layer counter */
 4214|  56.2k|                    ps_vcl_nal->i4_num_res_lyrs++;
 4215|       |
 4216|       |                    /* store the SPS of target -1 and -2 resolution layers */
 4217|  56.2k|                    if(2 == ps_vcl_nal->i4_num_res_lyrs)
  ------------------
  |  Branch (4217:24): [True: 56.2k, False: 0]
  ------------------
 4218|  56.2k|                    {
 4219|  56.2k|                        ps_sps_tgt_minus1_lyr = ps_curr_sps;
 4220|  56.2k|                    }
 4221|      0|                    else if(3 == ps_vcl_nal->i4_num_res_lyrs)
  ------------------
  |  Branch (4221:29): [True: 0, False: 0]
  ------------------
 4222|      0|                    {
 4223|      0|                        ps_sps_tgt_minus2_lyr = ps_curr_sps;
 4224|      0|                    }
 4225|      0|                    else if(ps_vcl_nal->i4_num_res_lyrs > MAX_NUM_RES_LYRS)
  ------------------
  |  |   94|      0|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (4225:29): [True: 0, False: 0]
  ------------------
 4226|      0|                    {
 4227|      0|                        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 4228|      0|                    }
 4229|  56.2k|                }
 4230|   237k|            }
 4231|       |
 4232|       |            /* -------- end of resolution change detection -------- */
 4233|   237k|        }
 4234|      0|        else
 4235|      0|        {
 4236|      0|            i4_ref_lyr_dqid = (i4_dep_id << 4);
 4237|      0|            i4_ref_lyr_dqid += (i4_qua_id - 1);
 4238|       |
 4239|       |            /* Update the DQID list based on ref DQID.     */
 4240|       |            /* This routine also updates the ref_dq_id     */
 4241|       |            /* in case the actual layer is completely lost */
 4242|      0|            i4_status = isvcd_update_dqid(i4_ref_lyr_dqid, ps_vcl_node, &ps_bot_vcl_node);
 4243|       |
 4244|      0|            if(!(OK == i4_status))
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (4244:16): [True: 0, False: 0]
  ------------------
 4245|      0|            {
 4246|      0|                return i4_status;
 4247|      0|            }
 4248|      0|            if(SVCD_TRUE == ps_vcl_node->i4_idr_pic_flag)
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
  |  Branch (4248:16): [True: 0, False: 0]
  ------------------
 4249|      0|            {
 4250|       |                /* if idr then frm num should be 0 */
 4251|      0|                ps_vcl_node->u2_frm_num = 0;
 4252|      0|            }
 4253|      0|        }
 4254|       |
 4255|       |        /* Update resolution change flag inside VCL    */
 4256|       |        /* node structure. This parameter is later used*/
 4257|       |        /* in detecting the top most layer in the      */
 4258|       |        /* resolution currently being decoded          */
 4259|   237k|        ps_vcl_node->i4_res_change_flag = i4_res_chnge_flag;
 4260|   237k|        ps_vcl_node->i4_ref_dq_id = i4_ref_lyr_dqid;
 4261|       |
 4262|       |        /* go to the next node */
 4263|   237k|        ps_vcl_node = ps_bot_vcl_node;
 4264|   237k|    }
 4265|       |
 4266|       |    /* update the Dependency array for each resolution */
 4267|   160k|    if(SVCD_TRUE == i4_idr_pic_flag)
  ------------------
  |  |   46|   160k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4267:8): [True: 126k, False: 33.7k]
  ------------------
 4268|   126k|    {
 4269|   126k|        WORD32 i4_idx;
 4270|       |
 4271|   126k|        ai4_dep_id[ps_vcl_nal->i4_num_res_lyrs - 1] = 0;
 4272|       |
 4273|       |        /* loop over number of resolutions detected */
 4274|   302k|        for(i4_idx = 0; i4_idx < ps_vcl_nal->i4_num_res_lyrs; i4_idx++)
  ------------------
  |  Branch (4274:25): [True: 176k, False: 126k]
  ------------------
 4275|   176k|        {
 4276|   176k|            pi4_dep_id_map[i4_idx] = ai4_dep_id[ps_vcl_nal->i4_num_res_lyrs - 1 - i4_idx];
 4277|   176k|        }
 4278|   126k|    }
 4279|       |
 4280|   160k|    if(SVCD_TRUE == i4_restore_prms_flag)
  ------------------
  |  |   46|   160k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4280:8): [True: 275, False: 160k]
  ------------------
 4281|    275|    {
 4282|       |        /* restore the number of resolutions */
 4283|    275|        ps_vcl_nal->i4_num_res_lyrs = i4_num_res_lyrs_bup;
 4284|       |
 4285|    275|        ps_vcl_node = ps_node_bup;
 4286|       |
 4287|       |        /* set the bottom node to NULL */
 4288|    275|        ps_vcl_node->ps_bot_node = NULL;
 4289|       |
 4290|    275|        ps_vcl_node->i4_ref_dq_id = -1;
 4291|    275|        ps_vcl_node->i4_res_change_flag = SVCD_FALSE;
  ------------------
  |  |   45|    275|#define SVCD_FALSE 0
  ------------------
 4292|       |
 4293|       |        /* store the reference DQID for current dependency */
 4294|    275|        ps_prev_au_prms[ps_vcl_node->i4_dependency_id].i4_ref_dq_id = -1;
 4295|       |
 4296|    275|        ps_prev_au_prms[ps_vcl_node->i4_dependency_id].u2_frm_num = ps_vcl_node->u2_frm_num;
 4297|       |
 4298|    275|        ps_prev_au_prms[ps_vcl_node->i4_dependency_id].i4_nal_ref_id = ps_vcl_node->i4_nal_ref_idc;
 4299|    275|    }
 4300|       |
 4301|       |    /* Finally update the bottom most node in the current access unit */
 4302|   160k|    ps_vcl_node = ps_vcl_nal->ps_top_node;
 4303|       |
 4304|   237k|    while(NULL != ps_vcl_node->ps_bot_node)
  ------------------
  |  Branch (4304:11): [True: 76.8k, False: 160k]
  ------------------
 4305|  76.8k|    {
 4306|  76.8k|        ps_vcl_node = ps_vcl_node->ps_bot_node;
 4307|  76.8k|    }
 4308|       |
 4309|   160k|    ps_vcl_nal->ps_bot_node = ps_vcl_node;
 4310|       |
 4311|       |    /* check on validity of Target Layer -1 and -2 dimensions */
 4312|   160k|    if((NULL != ps_sps_tgt_minus1_lyr) && (0 == ps_sps_tgt_minus1_lyr->u1_is_valid))
  ------------------
  |  Branch (4312:8): [True: 56.2k, False: 104k]
  |  Branch (4312:43): [True: 5.02k, False: 51.2k]
  ------------------
 4313|  5.02k|    {
 4314|  5.02k|        if((H264_MAX_FRAME_WIDTH < (WORD32) (ps_sps_tgt_minus1_lyr->u2_frm_wd_in_mbs << 4)) ||
  ------------------
  |  |   39|  5.02k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (4314:12): [True: 0, False: 5.02k]
  ------------------
 4315|  5.02k|           (H264_MAX_FRAME_HEIGHT < (WORD32) (ps_sps_tgt_minus1_lyr->u2_frm_ht_in_mbs << 4)))
  ------------------
  |  |   40|  5.02k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (4315:12): [True: 0, False: 5.02k]
  ------------------
 4316|      0|        {
 4317|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 4318|      0|        }
 4319|  5.02k|    }
 4320|       |
 4321|   160k|    if((NULL != ps_sps_tgt_minus2_lyr) && (0 == ps_sps_tgt_minus2_lyr->u1_is_valid))
  ------------------
  |  Branch (4321:8): [True: 0, False: 160k]
  |  Branch (4321:43): [True: 0, False: 0]
  ------------------
 4322|      0|    {
 4323|      0|        if((H264_MAX_FRAME_WIDTH < (WORD32) (ps_sps_tgt_minus2_lyr->u2_frm_wd_in_mbs << 4)) ||
  ------------------
  |  |   39|      0|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (4323:12): [True: 0, False: 0]
  ------------------
 4324|      0|           (H264_MAX_FRAME_HEIGHT < (WORD32) (ps_sps_tgt_minus2_lyr->u2_frm_ht_in_mbs << 4)))
  ------------------
  |  |   40|      0|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (4324:12): [True: 0, False: 0]
  ------------------
 4325|      0|        {
 4326|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 4327|      0|        }
 4328|      0|    }
 4329|       |
 4330|   160k|    return (OK);
  ------------------
  |  |  114|   160k|#define OK        0
  ------------------
 4331|   160k|}
isvcd_dec_non_vcl:
 4361|   147k|{
 4362|       |    /* local varibles */
 4363|   147k|    non_vcl_nal_t *ps_non_vcl;
 4364|   147k|    WORD32 i4_unit_indx;
 4365|   147k|    non_vcl_buf_hdr_t *ps_non_vcl_buf;
 4366|   147k|    WORD32 i_status = OK;
  ------------------
  |  |  114|   147k|#define OK        0
  ------------------
 4367|   147k|    dec_struct_t *ps_dec;
 4368|   147k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 4369|   147k|    dec_bit_stream_t *ps_bitstrm;
 4370|       |
 4371|   147k|    if((NULL == pv_out_non_vcl) || (NULL == pv_seq_params) || (NULL == pv_pic_params))
  ------------------
  |  Branch (4371:8): [True: 0, False: 147k]
  |  Branch (4371:36): [True: 0, False: 147k]
  |  Branch (4371:63): [True: 0, False: 147k]
  ------------------
 4372|      0|    {
 4373|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 4374|      0|    }
 4375|   147k|    UNUSED(pv_seq_params);
  ------------------
  |  |   45|   147k|#define UNUSED(x) ((void)(x))
  ------------------
 4376|   147k|    UNUSED(pv_pic_params);
  ------------------
  |  |   45|   147k|#define UNUSED(x) ((void)(x))
  ------------------
 4377|       |
 4378|       |    /* currently SEI decoding is not supported */
 4379|       |    /* derive the local variables */
 4380|   147k|    ps_non_vcl = (non_vcl_nal_t *) pv_out_non_vcl;
 4381|   147k|    ps_non_vcl_buf = ps_non_vcl->ps_first_non_vcl_nal;
 4382|   147k|    if(NULL == ps_non_vcl_buf) return (NOT_OK);
  ------------------
  |  |  116|  29.7k|#define NOT_OK    -1
  ------------------
  |  Branch (4382:8): [True: 29.7k, False: 117k]
  ------------------
 4383|       |
 4384|       |    /* loop until all NON VCL NAL are decoded */
 4385|   449k|    for(i4_unit_indx = 0; i4_unit_indx < ps_non_vcl->i4_num_non_vcl_nals; i4_unit_indx++)
  ------------------
  |  Branch (4385:27): [True: 360k, False: 88.2k]
  ------------------
 4386|   360k|    {
 4387|   360k|        UWORD32 u4_nal_unit_type;
 4388|   360k|        ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 4389|   360k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 4390|   360k|        if(NULL == ps_non_vcl_buf) return (NOT_OK);
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (4390:12): [True: 0, False: 360k]
  ------------------
 4391|       |        /* get the current NAL unit type */
 4392|   360k|        u4_nal_unit_type = (UWORD32) ps_non_vcl_buf->i4_nal_unit_type;
 4393|   360k|        if(u4_nal_unit_type > MAX_SVC_NAL_UNIT_TYPE) return (NOT_OK);
  ------------------
  |  |   73|   360k|#define MAX_SVC_NAL_UNIT_TYPE 31
  ------------------
                      if(u4_nal_unit_type > MAX_SVC_NAL_UNIT_TYPE) return (NOT_OK);
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (4393:12): [True: 0, False: 360k]
  ------------------
 4394|   360k|        ps_dec->u1_nal_unit_type = u4_nal_unit_type;
 4395|       |
 4396|   360k|        ps_dec->ps_bitstrm->pu4_buffer =
 4397|   360k|            (UWORD32 *) ((UWORD8 *) ps_non_vcl_buf + ps_non_vcl_buf->i4_buf_offset);
 4398|   360k|        ps_dec->ps_bitstrm->u4_ofst = 0;
 4399|   360k|        ps_dec->ps_bitstrm->u4_max_ofst = isvcd_nal_rbsp_to_sodb(
 4400|   360k|            (UWORD8 *) ps_dec->ps_bitstrm->pu4_buffer, ps_non_vcl_buf->i4_buf_size, 0);
 4401|   360k|        if(ps_dec->ps_bitstrm->u4_max_ofst <= 0) return (NOT_OK);
  ------------------
  |  |  116|  2.02k|#define NOT_OK    -1
  ------------------
  |  Branch (4401:12): [True: 2.02k, False: 358k]
  ------------------
 4402|       |
 4403|   358k|        ps_bitstrm = ps_dec->ps_bitstrm;
 4404|       |
 4405|       |        /* call the processing module based on nal unit type */
 4406|   358k|        switch(u4_nal_unit_type)
 4407|   358k|        {
 4408|   123k|            case SEQ_PARAM_NAL:
  ------------------
  |  |  330|   123k|#define SEQ_PARAM_NAL                   7
  ------------------
  |  Branch (4408:13): [True: 123k, False: 235k]
  ------------------
 4409|       |
 4410|   123k|                i_status = isvcd_parse_sps(ps_svc_lyr_dec, ps_bitstrm);
 4411|       |
 4412|   123k|                if(!i_status)
  ------------------
  |  Branch (4412:20): [True: 112k, False: 10.8k]
  ------------------
 4413|   112k|                {
 4414|   112k|                    ps_dec->i4_header_decoded |= 0x1;
 4415|   112k|                    ps_svcd_ctxt->u4_num_sps_ctr++;
 4416|       |
 4417|   112k|                    if(ps_svcd_ctxt->pic_width < ps_svc_lyr_dec->pic_width)
  ------------------
  |  Branch (4417:24): [True: 12.3k, False: 100k]
  ------------------
 4418|  12.3k|                    {
 4419|  12.3k|                        ps_svcd_ctxt->pic_width = ps_svc_lyr_dec->pic_width;
 4420|  12.3k|                    }
 4421|   112k|                    if(ps_svcd_ctxt->pic_height < ps_svc_lyr_dec->pic_height)
  ------------------
  |  Branch (4421:24): [True: 12.4k, False: 100k]
  ------------------
 4422|  12.4k|                    {
 4423|  12.4k|                        ps_svcd_ctxt->pic_height = ps_svc_lyr_dec->pic_height;
 4424|  12.4k|                    }
 4425|   112k|                }
 4426|       |
 4427|   123k|                if(i_status) return i_status;
  ------------------
  |  Branch (4427:20): [True: 10.8k, False: 112k]
  ------------------
 4428|       |
 4429|   112k|                break;
 4430|   112k|            case SUBSET_SPS_NAL:
  ------------------
  |  |   65|  24.7k|#define SUBSET_SPS_NAL 15
  ------------------
  |  Branch (4430:13): [True: 24.7k, False: 334k]
  ------------------
 4431|       |
 4432|  24.7k|                i_status = isvcd_parse_subset_sps(ps_svc_lyr_dec, ps_bitstrm);
 4433|       |
 4434|  24.7k|                if(!i_status)
  ------------------
  |  Branch (4434:20): [True: 17.8k, False: 6.96k]
  ------------------
 4435|  17.8k|                {
 4436|  17.8k|                    ps_svcd_ctxt->u4_num_sps_ctr++;
 4437|  17.8k|                    ps_dec->i4_header_decoded |= 0x1;
 4438|       |
 4439|  17.8k|                    if(ps_svcd_ctxt->pic_width < ps_svc_lyr_dec->pic_width)
  ------------------
  |  Branch (4439:24): [True: 7.00k, False: 10.8k]
  ------------------
 4440|  7.00k|                    {
 4441|  7.00k|                        ps_svcd_ctxt->pic_width = ps_svc_lyr_dec->pic_width;
 4442|  7.00k|                    }
 4443|  17.8k|                    if(ps_svcd_ctxt->pic_height < ps_svc_lyr_dec->pic_height)
  ------------------
  |  Branch (4443:24): [True: 7.04k, False: 10.7k]
  ------------------
 4444|  7.04k|                    {
 4445|  7.04k|                        ps_svcd_ctxt->pic_height = ps_svc_lyr_dec->pic_height;
 4446|  7.04k|                    }
 4447|  17.8k|                }
 4448|  24.7k|                if(i_status) return i_status;
  ------------------
  |  Branch (4448:20): [True: 6.96k, False: 17.8k]
  ------------------
 4449|       |
 4450|  17.8k|                break;
 4451|       |
 4452|   107k|            case PIC_PARAM_NAL:
  ------------------
  |  |  331|   107k|#define PIC_PARAM_NAL                   8
  ------------------
  |  Branch (4452:13): [True: 107k, False: 251k]
  ------------------
 4453|       |
 4454|   107k|                i_status = isvcd_parse_pps(ps_svc_lyr_dec, ps_bitstrm);
 4455|   107k|                if(!i_status)
  ------------------
  |  Branch (4455:20): [True: 104k, False: 2.79k]
  ------------------
 4456|   104k|                {
 4457|   104k|                    ps_dec->i4_header_decoded |= 0x2;
 4458|   104k|                    ps_svcd_ctxt->u4_num_pps_ctr++;
 4459|   104k|                }
 4460|   107k|                if(i_status) return i_status;
  ------------------
  |  Branch (4460:20): [True: 2.79k, False: 104k]
  ------------------
 4461|   104k|                break;
 4462|   104k|            case SEI_NAL:
  ------------------
  |  |  329|  8.85k|#define SEI_NAL                         6
  ------------------
  |  Branch (4462:13): [True: 8.85k, False: 350k]
  ------------------
 4463|  8.85k|            {
 4464|  8.85k|                i_status = ih264d_parse_sei_message(ps_dec, ps_bitstrm);
 4465|  8.85k|                if(i_status) return i_status;
  ------------------
  |  Branch (4465:20): [True: 6.91k, False: 1.93k]
  ------------------
 4466|  1.93k|                ih264d_parse_sei(ps_dec, ps_bitstrm);
 4467|  1.93k|            }
 4468|      0|            break;
 4469|  93.8k|            default:
  ------------------
  |  Branch (4469:13): [True: 93.8k, False: 265k]
  ------------------
 4470|       |                /* no other NON VCL UNIT is supported */
 4471|  93.8k|                break;
 4472|   358k|        }
 4473|       |
 4474|       |        /* get the next non vcl bufffer */
 4475|   331k|        ps_non_vcl_buf = ps_non_vcl_buf->ps_next;
 4476|       |
 4477|   331k|    } /* end of loop over all NAL units */
 4478|       |
 4479|  88.2k|    return (OK);
  ------------------
  |  |  114|  88.2k|#define OK        0
  ------------------
 4480|   117k|}
isvcd_seq_hdr_dec:
 4505|   112k|{
 4506|   112k|    WORD32 i4_status;
 4507|       |
 4508|       |    /* Decode all non VCL NAL till first VCL NAL is encountered */
 4509|   112k|    ps_svcd_ctxt->s_non_vcl_nal.i4_num_non_vcl_nals = 0;
 4510|   112k|    i4_status = isvcd_nal_parse_non_vcl_nal(
 4511|   112k|        ps_svcd_ctxt->pv_nal_parse_ctxt, ps_in_bufs->pv_stream_buffer, &ps_svcd_ctxt->s_non_vcl_nal,
 4512|   112k|        pu4_bytes_consumed, &ps_in_bufs->u4_num_Bytes);
 4513|       |
 4514|       |    /* Note: The bitstream extraction module expects updated  */
 4515|       |    /* pointer whenever a new call to this module has been    */
 4516|       |    /* made. Hence the buffer pointer has to be incremented   */
 4517|       |    /* by bytes consumed                                      */
 4518|   112k|    ps_in_bufs->u4_num_Bytes -= *pu4_bytes_consumed;
 4519|       |
 4520|       |    /* ------------------------------------------------------ */
 4521|       |    /* Decoding of non VCL data. As current implementation it */
 4522|       |    /* decodes the followings:                                */
 4523|       |    /*          1. Sequence parameter set                     */
 4524|       |    /*          2. Picture parameter set                      */
 4525|       |    /*          3. SEI message                                */
 4526|       |    /* ------------------------------------------------------ */
 4527|   112k|    i4_status = isvcd_dec_non_vcl(&ps_svcd_ctxt->s_non_vcl_nal, ps_svcd_ctxt->ps_sps, ps_svcd_ctxt->ps_pps,
 4528|   112k|                      ps_svcd_ctxt);
 4529|       |
 4530|   112k|    return (i4_status);
 4531|   112k|}
isvcd_pre_parse_refine_au:
 4560|   671k|{
 4561|   671k|    WORD32 i4_status = 0, i4_non_vcl_status;
 4562|   671k|    UWORD32 u4_bytes_consumed = 0;
 4563|   671k|    dec_struct_t *ps_dec;
 4564|   671k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 4565|   671k|    ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 4566|   671k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 4567|       |
 4568|       |    /* Sequence header decode:                                 */
 4569|       |    /* If sequence header is not decoded then decode  the seq  */
 4570|       |    /* uence header                                            */
 4571|       |
 4572|   671k|    if(SVCD_FALSE == ps_dec->i4_header_decoded)
  ------------------
  |  |   45|   671k|#define SVCD_FALSE 0
  ------------------
  |  Branch (4572:8): [True: 112k, False: 558k]
  ------------------
 4573|   112k|    {
 4574|   112k|        i4_status = isvcd_seq_hdr_dec(ps_svcd_ctxt, ps_in_bufs, &u4_bytes_consumed);
 4575|       |
 4576|   112k|        if((VCL_NAL_FOUND_TRUE == i4_status) && (ps_svcd_ctxt->u4_num_sps_ctr != 0) &&
  ------------------
  |  Branch (4576:12): [True: 0, False: 112k]
  |  Branch (4576:49): [True: 0, False: 0]
  ------------------
 4577|      0|           (ps_svcd_ctxt->u4_num_pps_ctr != 0))
  ------------------
  |  Branch (4577:12): [True: 0, False: 0]
  ------------------
 4578|      0|        {
 4579|       |            /* set the header decoded flag */
 4580|      0|            ps_dec->i4_header_decoded = 3;
 4581|      0|        }
 4582|   112k|    }
 4583|   671k|    *pu4_bytes_consumed = u4_bytes_consumed;
 4584|   671k|    if (i4_status)
  ------------------
  |  Branch (4584:9): [True: 49.2k, False: 621k]
  ------------------
 4585|  49.2k|    {
 4586|  49.2k|        return NOT_OK;
  ------------------
  |  |  116|  49.2k|#define NOT_OK    -1
  ------------------
 4587|  49.2k|    }
 4588|   621k|    if(1 == ps_dec->i4_decode_header)
  ------------------
  |  Branch (4588:8): [True: 434k, False: 187k]
  ------------------
 4589|   434k|    {
 4590|   434k|        return OK;
  ------------------
  |  |  114|   434k|#define OK        0
  ------------------
 4591|   434k|    }
 4592|       |    /* Bit-stream Parsing. It performs following tasks:        */
 4593|       |    /*          1. NAL hader decoder                           */
 4594|       |    /*          2. Emulation prevention and byte swap          */
 4595|       |    /*             (During this process data to moved to output*/
 4596|       |    /*              buffer)                                    */
 4597|       |    /*          3. Dependency list creation based on NAL header*/
 4598|       |    /*          4. Detection of picture boundary               */
 4599|       |    /* NOTE1:                                                  */
 4600|       |    /*       Output buffers for VCL and non VCL data are       */
 4601|       |    /*       different. VCL data can be retrieved through      */
 4602|       |    /*       dependency list. Whereas non VCL data is stored in*/
 4603|       |    /*       one single buffer, which is accessed through NON  */
 4604|       |    /*       VCL structure                                     */
 4605|       |    /* NOTE2:Partial input case for nal parsing requires a     */
 4606|       |    /*       flush API to be called when end of bitstream      */
 4607|       |    /*       occurs                                            */
 4608|       |
 4609|   187k|    if(SVCD_FALSE == ps_svcd_ctxt->i4_eos_flag)
  ------------------
  |  |   45|   187k|#define SVCD_FALSE 0
  ------------------
  |  Branch (4609:8): [True: 187k, False: 0]
  ------------------
 4610|   187k|    {
 4611|   187k|        if(ps_dec->i4_header_decoded == 3)
  ------------------
  |  Branch (4611:12): [True: 167k, False: 20.0k]
  ------------------
 4612|   167k|        {
 4613|   167k|            i4_status = isvcd_nal_parse_vcl_nal_partial(
 4614|   167k|                ps_svcd_ctxt->pv_nal_parse_ctxt, ps_in_bufs->pv_stream_buffer,
 4615|   167k|                &ps_svcd_ctxt->s_non_vcl_nal, &ps_svcd_ctxt->s_vcl_nal, &u4_bytes_consumed,
 4616|   167k|                &ps_in_bufs->u4_num_Bytes);
 4617|   167k|        }
 4618|  20.0k|        else
 4619|  20.0k|        {
 4620|  20.0k|            return NOT_OK;
  ------------------
  |  |  116|  20.0k|#define NOT_OK    -1
  ------------------
 4621|  20.0k|        }
 4622|   187k|    }
 4623|      0|    else
 4624|      0|    {
 4625|      0|        void *pv_nal_parse_ctxt;
 4626|      0|        pv_nal_parse_ctxt = ps_svcd_ctxt->pv_nal_parse_ctxt;
 4627|       |
 4628|      0|        i4_status = isvcd_nal_parse_partial_signal_eos(pv_nal_parse_ctxt, &ps_svcd_ctxt->s_vcl_nal,
 4629|      0|                                                       &ps_svcd_ctxt->s_non_vcl_nal);
 4630|       |
 4631|      0|        u4_bytes_consumed = 0;
 4632|      0|    }
 4633|       |
 4634|   167k|    *pu4_bytes_consumed += u4_bytes_consumed;
 4635|       |
 4636|       |    /* Picture Boundary detected: Go ahead and do the decoding  */
 4637|       |    /* Picture boundary not detected: Otherwsie retrun from this*/
 4638|       |    /* function and update the bytes consumed variable. This    */
 4639|       |    /* should be repeated till we get a picture boundary        */
 4640|       |
 4641|   167k|    if(PIC_BOUNDARY_FALSE == i4_status)
  ------------------
  |  Branch (4641:8): [True: 4.82k, False: 162k]
  ------------------
 4642|  4.82k|    {
 4643|  4.82k|        return (NOT_OK);
  ------------------
  |  |  116|  4.82k|#define NOT_OK    -1
  ------------------
 4644|  4.82k|    }
 4645|       |
 4646|   162k|    else if(FLUSH_DECODED_PICTURE == i4_status)
  ------------------
  |  Branch (4646:13): [True: 11, False: 162k]
  ------------------
 4647|     11|    {
 4648|       |        /* No more data is expected to come. Pictures decoded   */
 4649|       |        /* so far needs to be sent for display                  */
 4650|     11|        return (FLUSH);
  ------------------
  |  |   50|     11|#define FLUSH 2
  ------------------
 4651|     11|    }
 4652|       |
 4653|   162k|    if(PIC_BOUNDARY_TRUE != i4_status)
  ------------------
  |  Branch (4653:8): [True: 0, False: 162k]
  ------------------
 4654|      0|    {
 4655|      0|        return (NOT_OK);
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 4656|      0|    }
 4657|       |
 4658|       |    /* check if the application has set any of the skip modes       */
 4659|       |    /* add the support for P and B skip modes                       */
 4660|       |    /* if(ps_dec_ctxt->s_dyn_prms.u1_frame_skip_mode)               */
 4661|       |
 4662|       |    /* Parse slice header to decode reference layer dQId and refine */
 4663|       |    /* the dependency list                                          */
 4664|       |    /* NOTE: Yes, this processing could be moved into NAL parsing   */
 4665|       |    /*       routine to avoid unneccessary emulation prevention and */
 4666|       |    /*       byte swapping over discardable data. This Optimization */
 4667|       |    /*       has been deferred for some time. In future if we found */
 4668|       |    /*       that there are many such streams which doesn't set     */
 4669|       |    /*       'discard_flag' correctly in NAL header, we will take a */
 4670|       |    /*       hit to optimize it.                                    */
 4671|       |
 4672|       |    /* At present this routine also performs the following          */
 4673|       |    /* 1. Refine DQID list based on reference layer DQID            */
 4674|       |    /* 2. Calculates the POC for the target layer                   */
 4675|       |
 4676|   162k|    {
 4677|   162k|        i4_status = isvcd_refine_dep_list(
 4678|   162k|            &ps_svcd_ctxt->s_vcl_nal, ps_svcd_ctxt->ps_sps, ps_svcd_ctxt->ps_subset_sps,
 4679|   162k|            ps_svcd_ctxt->ps_pps, &ps_svcd_ctxt->ai4_dq_id_map[0], &ps_svcd_ctxt->as_au_prms_dep[0],
 4680|   162k|            &ps_svcd_ctxt->as_pps_sps_prev_au[0], &ps_svcd_ctxt->i4_error_code, ps_svcd_ctxt);
 4681|   162k|    }
 4682|       |
 4683|   162k|    if(0 != ps_svcd_ctxt->s_non_vcl_nal.i4_num_non_vcl_nals)
  ------------------
  |  Branch (4683:8): [True: 34.6k, False: 127k]
  ------------------
 4684|  34.6k|    {
 4685|       |        /* Decoding of non VCL data. In current implementation it  */
 4686|       |        /* decodes the followings:                                 */
 4687|       |        /*          1. Sequence parameter set                      */
 4688|       |        /*          2. Picture parameter set                       */
 4689|       |        /*          3. SEI message                                 */
 4690|  34.6k|        i4_non_vcl_status = isvcd_dec_non_vcl(&ps_svcd_ctxt->s_non_vcl_nal, ps_svcd_ctxt->ps_sps,
 4691|  34.6k|                                              ps_svcd_ctxt->ps_pps, ps_svcd_ctxt);
 4692|       |
 4693|  34.6k|        if(OK != i4_non_vcl_status) return i4_non_vcl_status;
  ------------------
  |  |  114|  34.6k|#define OK        0
  ------------------
  |  Branch (4693:12): [True: 9.98k, False: 24.6k]
  ------------------
 4694|  34.6k|    }
 4695|   152k|    if(OK != i4_status) return (i4_status);
  ------------------
  |  |  114|   152k|#define OK        0
  ------------------
  |  Branch (4695:8): [True: 1.55k, False: 150k]
  ------------------
 4696|   150k|    return (OK);
  ------------------
  |  |  114|   150k|#define OK        0
  ------------------
 4697|   152k|}
isvcd_video_decode:
 4721|   738k|{
 4722|   738k|    dec_struct_t *ps_dec;
 4723|   738k|    dec_struct_t *ps_dec_zero_lyr;
 4724|   738k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 4725|   738k|    svc_dec_lyr_struct_t *ps_svc_lyr_zero_dec;
 4726|       |
 4727|   738k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 4728|   738k|    WORD32 i4_err_status = 0;
 4729|       |
 4730|   738k|    UWORD32 bytes_consumed = 0;
 4731|   738k|    WORD32 ret = 0, api_ret_value = IV_SUCCESS;
 4732|   738k|    isvcd_video_decode_ip_t *ps_h264d_dec_ip;
 4733|   738k|    isvcd_video_decode_op_t *ps_h264d_dec_op;
 4734|   738k|    ivd_video_decode_ip_t *ps_dec_ip;
 4735|   738k|    ivd_video_decode_op_t *ps_dec_op;
 4736|   738k|    UWORD8 u1_res_id;
 4737|       |
 4738|   738k|    ithread_set_name((void *) "Parse_thread");
 4739|       |
 4740|   738k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) (dec_hdl->pv_codec_handle);
 4741|   738k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
 4742|   738k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 4743|       |
 4744|   738k|    ps_h264d_dec_ip = (isvcd_video_decode_ip_t *) pv_api_ip;
 4745|   738k|    ps_h264d_dec_op = (isvcd_video_decode_op_t *) pv_api_op;
 4746|   738k|    ps_dec_ip = &ps_h264d_dec_ip->s_ivd_video_decode_ip_t;
 4747|   738k|    ps_dec_op = &ps_h264d_dec_op->s_ivd_video_decode_op_t;
 4748|       |
 4749|   738k|    {
 4750|   738k|        UWORD32 u4_size;
 4751|   738k|        u4_size = ps_dec_op->u4_size;
 4752|   738k|        memset(ps_h264d_dec_op, 0, sizeof(isvcd_video_decode_op_t));
 4753|   738k|        ps_dec_op->u4_size = u4_size;
 4754|   738k|    }
 4755|       |
 4756|   738k|    ps_dec->pv_dec_out = ps_dec_op;
 4757|   738k|    if(ps_dec->init_done != 1)
  ------------------
  |  Branch (4757:8): [True: 0, False: 738k]
  ------------------
 4758|      0|    {
 4759|      0|        return IV_FAIL;
 4760|      0|    }
 4761|       |
 4762|       |    /*Data memory barries instruction,so that bitstream write by the application
 4763|       |     * is complete*/
 4764|   738k|    DATA_SYNC();
  ------------------
  |  |  116|   738k|#define DATA_SYNC()  __sync_synchronize()
  ------------------
 4765|       |
 4766|   738k|    if(0 == ps_dec->u1_flushfrm)
  ------------------
  |  Branch (4766:8): [True: 738k, False: 0]
  ------------------
 4767|   738k|    {
 4768|   738k|        if(ps_dec_ip->pv_stream_buffer == NULL)
  ------------------
  |  Branch (4768:12): [True: 0, False: 738k]
  ------------------
 4769|      0|        {
 4770|      0|            ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
 4771|      0|            ps_dec_op->u4_error_code |= IVD_DEC_FRM_BS_BUF_NULL;
 4772|      0|            return IV_FAIL;
 4773|      0|        }
 4774|   738k|        if(ps_dec_ip->u4_num_Bytes <= 16)
  ------------------
  |  Branch (4774:12): [True: 67.0k, False: 671k]
  ------------------
 4775|  67.0k|        {
 4776|  67.0k|            ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
 4777|  67.0k|            ps_dec_op->u4_error_code |= IVD_DEC_NUMBYTES_INV;
 4778|  67.0k|            return IV_FAIL;
 4779|  67.0k|        }
 4780|   738k|    }
 4781|       |#ifdef KEEP_THREADS_ACTIVE
 4782|       |    {
 4783|       |        UWORD32 i;
 4784|       |        ps_dec->i4_break_threads = 0;
 4785|       |        for(i = 0; i < 2; i++)
 4786|       |        {
 4787|       |            ret = ithread_mutex_lock(ps_dec->apv_proc_start_mutex[i]);
 4788|       |            RETURN_IF((ret != IV_SUCCESS), ret);
 4789|       |
 4790|       |            ps_dec->ai4_process_start[i] = PROC_INIT;
 4791|       |
 4792|       |            ret = ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[i]);
 4793|       |            RETURN_IF((ret != IV_SUCCESS), ret);
 4794|       |        }
 4795|       |    }
 4796|       |#else
 4797|   671k|    ps_dec->u4_dec_thread_created = 0;
 4798|   671k|    ps_dec->u4_bs_deblk_thread_created = 0;
 4799|   671k|#endif
 4800|   671k|    ps_dec_op->u4_num_bytes_consumed = 0;
 4801|   671k|    ps_dec_op->i4_reorder_depth = -1;
 4802|   671k|    ps_dec_op->i4_display_index = DEFAULT_POC;
  ------------------
  |  |   45|   671k|#define DEFAULT_POC 0x7FFFFFFF
  ------------------
 4803|       |
 4804|   671k|    ps_dec->ps_out_buffer = NULL;
 4805|   671k|    if(ps_dec_ip->u4_size >= offsetof(ivd_video_decode_ip_t, s_out_buffer))
  ------------------
  |  Branch (4805:8): [True: 671k, False: 0]
  ------------------
 4806|   671k|        ps_dec->ps_out_buffer = &ps_dec_ip->s_out_buffer;
 4807|       |
 4808|   671k|    if(0 == ps_dec->u4_share_disp_buf && ps_dec->i4_decode_header == 0)
  ------------------
  |  Branch (4808:8): [True: 671k, False: 0]
  |  Branch (4808:42): [True: 197k, False: 473k]
  ------------------
 4809|   197k|    {
 4810|   197k|        UWORD32 i;
 4811|   197k|        if((ps_dec->ps_out_buffer->u4_num_bufs == 0) ||
  ------------------
  |  Branch (4811:12): [True: 0, False: 197k]
  ------------------
 4812|   197k|           (ps_dec->ps_out_buffer->u4_num_bufs > IVD_VIDDEC_MAX_IO_BUFFERS))
  ------------------
  |  |   45|   197k|#define IVD_VIDDEC_MAX_IO_BUFFERS 64
  ------------------
  |  Branch (4812:12): [True: 0, False: 197k]
  ------------------
 4813|      0|        {
 4814|      0|            ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
 4815|      0|            ps_dec_op->u4_error_code |= IVD_DISP_FRM_ZERO_OP_BUFS;
 4816|      0|            return IV_FAIL;
 4817|      0|        }
 4818|       |
 4819|   692k|        for(i = 0; i < ps_dec->ps_out_buffer->u4_num_bufs; i++)
  ------------------
  |  Branch (4819:20): [True: 494k, False: 197k]
  ------------------
 4820|   494k|        {
 4821|   494k|            if(ps_dec->ps_out_buffer->pu1_bufs[i] == NULL)
  ------------------
  |  Branch (4821:16): [True: 0, False: 494k]
  ------------------
 4822|      0|            {
 4823|      0|                ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
 4824|      0|                ps_dec_op->u4_error_code |= IVD_DISP_FRM_OP_BUF_NULL;
 4825|      0|                return IV_FAIL;
 4826|      0|            }
 4827|       |
 4828|   494k|            if(ps_dec->ps_out_buffer->u4_min_out_buf_size[i] == 0)
  ------------------
  |  Branch (4828:16): [True: 0, False: 494k]
  ------------------
 4829|      0|            {
 4830|      0|                ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
 4831|      0|                ps_dec_op->u4_error_code |= IVD_DISP_FRM_ZERO_OP_BUF_SIZE;
 4832|      0|                return IV_FAIL;
 4833|      0|            }
 4834|   494k|        }
 4835|   197k|    }
 4836|       |
 4837|   671k|    if(ps_dec->u4_total_frames_decoded >= NUM_FRAMES_LIMIT)
  ------------------
  |  |  157|   671k|#define NUM_FRAMES_LIMIT 0x7FFFFFFF
  ------------------
  |  Branch (4837:8): [True: 0, False: 671k]
  ------------------
 4838|      0|    {
 4839|      0|        ps_dec_op->u4_error_code = ERROR_FRAME_LIMIT_OVER;
 4840|      0|        return IV_FAIL;
 4841|      0|    }
 4842|       |
 4843|   671k|    ps_dec_op->u4_error_code = 0;
 4844|   671k|    ps_dec_op->e_pic_type = IV_NA_FRAME;
 4845|   671k|    ps_dec_op->u4_output_present = 0;
 4846|   671k|    ps_dec_op->u4_frame_decoded_flag = 0;
 4847|       |
 4848|       |    /* In case the decoder is not in flush mode(in shared mode),
 4849|       |     then decoder has to pick up a buffer to write current frame.
 4850|       |     Check if a frame is available in such cases */
 4851|   671k|    if(ps_dec->u1_init_dec_flag == 1 && ps_dec->u4_share_disp_buf == 1 && ps_dec->u1_flushfrm == 0)
  ------------------
  |  Branch (4851:8): [True: 123k, False: 547k]
  |  Branch (4851:41): [True: 0, False: 123k]
  |  Branch (4851:75): [True: 0, False: 0]
  ------------------
 4852|      0|    {
 4853|      0|        UWORD32 i;
 4854|      0|        WORD32 disp_avail = 0, free_id;
 4855|       |
 4856|       |        /* Check if at least one buffer is available with the codec */
 4857|       |        /* If not then return to application with error */
 4858|      0|        for(i = 0; i < ps_dec->u1_pic_bufs; i++)
  ------------------
  |  Branch (4858:20): [True: 0, False: 0]
  ------------------
 4859|      0|        {
 4860|      0|            if(0 == ps_dec->u4_disp_buf_mapping[i] || 1 == ps_dec->u4_disp_buf_to_be_freed[i])
  ------------------
  |  Branch (4860:16): [True: 0, False: 0]
  |  Branch (4860:55): [True: 0, False: 0]
  ------------------
 4861|      0|            {
 4862|      0|                disp_avail = 1;
 4863|      0|                break;
 4864|      0|            }
 4865|      0|        }
 4866|       |
 4867|      0|        if(0 == disp_avail)
  ------------------
  |  Branch (4867:12): [True: 0, False: 0]
  ------------------
 4868|      0|        {
 4869|       |            /* If something is queued for display wait for that buffer to be returned
 4870|       |             */
 4871|       |
 4872|      0|            ps_dec_op->u4_error_code = IVD_DEC_REF_BUF_NULL;
 4873|      0|            ps_dec_op->u4_error_code |= (1 << IVD_UNSUPPORTEDPARAM);
 4874|      0|            return (IV_FAIL);
 4875|      0|        }
 4876|       |
 4877|      0|        while(1)
  ------------------
  |  Branch (4877:15): [True: 0, Folded]
  ------------------
 4878|      0|        {
 4879|      0|            pic_buffer_t *ps_pic_buf;
 4880|      0|            ps_pic_buf = (pic_buffer_t *) ih264_buf_mgr_get_next_free(
 4881|      0|                (buf_mgr_t *) ps_dec->pv_pic_buf_mgr, &free_id);
 4882|       |
 4883|      0|            if(ps_pic_buf == NULL)
  ------------------
  |  Branch (4883:16): [True: 0, False: 0]
  ------------------
 4884|      0|            {
 4885|      0|                UWORD32 display_queued = 0;
 4886|       |
 4887|       |                /* check if any buffer was given for display which is not returned yet */
 4888|      0|                for(i = 0; i < (MAX_DISP_BUFS_NEW); i++)
  ------------------
  |  |   76|      0|#define MAX_DISP_BUFS_NEW 64
  ------------------
  |  Branch (4888:28): [True: 0, False: 0]
  ------------------
 4889|      0|                {
 4890|      0|                    if(0 != ps_dec->u4_disp_buf_mapping[i])
  ------------------
  |  Branch (4890:24): [True: 0, False: 0]
  ------------------
 4891|      0|                    {
 4892|      0|                        display_queued = 1;
 4893|      0|                        break;
 4894|      0|                    }
 4895|      0|                }
 4896|       |                /* If some buffer is queued for display, then codec has to singal an
 4897|       |                 error and wait for that buffer to be returned. If nothing is queued for
 4898|       |                 display then codec has ownership of all display buffers and it can
 4899|       |                 reuse any of the existing buffers and continue decoding */
 4900|       |
 4901|      0|                if(1 == display_queued)
  ------------------
  |  Branch (4901:20): [True: 0, False: 0]
  ------------------
 4902|      0|                {
 4903|       |                    /* If something is queued for display wait for that buffer to be
 4904|       |                     * returned */
 4905|      0|                    ps_dec_op->u4_error_code = IVD_DEC_REF_BUF_NULL;
 4906|      0|                    ps_dec_op->u4_error_code |= (1 << IVD_UNSUPPORTEDPARAM);
 4907|      0|                    return (IV_FAIL);
 4908|      0|                }
 4909|      0|            }
 4910|      0|            else
 4911|      0|            {
 4912|       |                /* If the buffer is with display, then mark it as in use and then look
 4913|       |                 * for a buffer again */
 4914|      0|                if(1 == ps_dec->u4_disp_buf_mapping[free_id])
  ------------------
  |  Branch (4914:20): [True: 0, False: 0]
  ------------------
 4915|      0|                {
 4916|      0|                    ih264_buf_mgr_set_status((buf_mgr_t *) ps_dec->pv_pic_buf_mgr, free_id,
 4917|      0|                                             BUF_MGR_IO);
  ------------------
  |  |   53|      0|#define BUF_MGR_IO           (1 << 3)
  ------------------
 4918|      0|                }
 4919|      0|                else
 4920|      0|                {
 4921|       |                    /**
 4922|       |                     *  Found a free buffer for present call. Release it now.
 4923|       |                     *  Will be again obtained later.
 4924|       |                     */
 4925|      0|                    ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_pic_buf_mgr, free_id,
 4926|      0|                                          BUF_MGR_IO);
  ------------------
  |  |   53|      0|#define BUF_MGR_IO           (1 << 3)
  ------------------
 4927|      0|                    break;
 4928|      0|                }
 4929|      0|            }
 4930|      0|        }
 4931|      0|    }
 4932|       |
 4933|   671k|    if(ps_dec->u1_enable_mb_info && (ps_dec->i4_header_decoded & DECODED_SPS_MASK))
  ------------------
  |  |  125|      0|#define DECODED_SPS_MASK 1
  ------------------
  |  Branch (4933:8): [True: 0, False: 671k]
  |  Branch (4933:37): [True: 0, False: 0]
  ------------------
 4934|      0|    {
 4935|      0|        UWORD32 blk_qp_map_size = ps_h264d_dec_ip->u4_8x8_blk_qp_map_size;
 4936|      0|        UWORD32 blk_type_map_size = ps_h264d_dec_ip->u4_8x8_blk_type_map_size;
 4937|      0|        UWORD32 blk_8x8_map_size = ps_dec->u4_total_mbs << 2;
 4938|      0|        if((ps_h264d_dec_ip->pu1_8x8_blk_qp_map && blk_qp_map_size < blk_8x8_map_size) ||
  ------------------
  |  Branch (4938:13): [True: 0, False: 0]
  |  Branch (4938:52): [True: 0, False: 0]
  ------------------
 4939|      0|           (ps_h264d_dec_ip->pu1_8x8_blk_type_map && blk_type_map_size < blk_8x8_map_size))
  ------------------
  |  Branch (4939:13): [True: 0, False: 0]
  |  Branch (4939:54): [True: 0, False: 0]
  ------------------
 4940|      0|        {
 4941|      0|            ps_dec_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
 4942|      0|            ps_dec_op->u4_error_code |= IH264D_INSUFFICIENT_METADATA_BUFFER;
 4943|      0|            return IV_FAIL;
 4944|      0|        }
 4945|      0|    }
 4946|       |
 4947|   671k|    if(ps_dec->u1_flushfrm && (1 == ps_svcd_ctxt->u1_pre_parse_in_flush))
  ------------------
  |  Branch (4947:8): [True: 0, False: 671k]
  |  Branch (4947:31): [True: 0, False: 0]
  ------------------
 4948|      0|    {
 4949|      0|        if(ps_dec->u1_init_dec_flag == 0)
  ------------------
  |  Branch (4949:12): [True: 0, False: 0]
  ------------------
 4950|      0|        {
 4951|      0|            ps_dec->u1_flushfrm = 0;
 4952|      0|            return (IV_FAIL);
 4953|      0|        }
 4954|       |
 4955|      0|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[ps_svcd_ctxt->s_vcl_nal.i4_num_res_lyrs - 1];
 4956|      0|        ps_dec = &ps_svc_lyr_dec->s_dec;
 4957|      0|        ps_dec->u4_fmt_conv_cur_row = 0;
 4958|      0|        ps_dec->u4_output_present = 0;
 4959|      0|        ps_dec->s_disp_op.u4_error_code = 1;
 4960|       |
 4961|      0|        ps_dec->ps_out_buffer = NULL;
 4962|      0|        if(ps_dec_ip->u4_size >= offsetof(ivd_video_decode_ip_t, s_out_buffer))
  ------------------
  |  Branch (4962:12): [True: 0, False: 0]
  ------------------
 4963|      0|        {
 4964|      0|            ps_dec->ps_out_buffer = &ps_dec_ip->s_out_buffer;
 4965|      0|        }
 4966|      0|        ih264d_get_next_display_field(ps_dec, ps_dec->ps_out_buffer, &(ps_dec->s_disp_op));
 4967|      0|        if(0 == ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (4967:12): [True: 0, False: 0]
  ------------------
 4968|      0|        {
 4969|       |            /* check output buffer size given by the application */
 4970|      0|            if(check_app_out_buf_size(ps_dec) != IV_SUCCESS)
  ------------------
  |  Branch (4970:16): [True: 0, False: 0]
  ------------------
 4971|      0|            {
 4972|      0|                ps_dec_op->u4_error_code = IVD_DISP_FRM_ZERO_OP_BUF_SIZE;
 4973|      0|                return (IV_FAIL);
 4974|      0|            }
 4975|       |
 4976|      0|            ps_dec->u4_fmt_conv_cur_row = 0;
 4977|      0|            ps_dec->u4_fmt_conv_num_rows = ps_dec->s_disp_frame_info.u4_y_ht;
 4978|      0|            ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op), ps_dec->u4_fmt_conv_cur_row,
 4979|      0|                                  ps_dec->u4_fmt_conv_num_rows);
 4980|      0|            ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
 4981|      0|            ps_dec->u4_output_present = 1;
 4982|      0|            if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (4982:16): [True: 0, False: 0]
  ------------------
 4983|      0|            {
 4984|      0|                UWORD32 disp_buf_id = ps_dec->s_disp_op.u4_disp_buf_id;
 4985|      0|                if(ps_h264d_dec_ip->pu1_8x8_blk_qp_map)
  ------------------
  |  Branch (4985:20): [True: 0, False: 0]
  ------------------
 4986|      0|                {
 4987|      0|                    ps_h264d_dec_op->pu1_8x8_blk_qp_map = ps_h264d_dec_ip->pu1_8x8_blk_qp_map;
 4988|      0|                    ps_h264d_dec_op->u4_8x8_blk_qp_map_size = ps_dec->u4_total_mbs << 2;
 4989|      0|                    memcpy(ps_h264d_dec_op->pu1_8x8_blk_qp_map,
 4990|      0|                                 ps_dec->as_buf_id_info_map[disp_buf_id].pu1_qp_map,
 4991|      0|                                 ps_dec->u4_total_mbs << 2);
 4992|      0|                }
 4993|      0|                if(ps_h264d_dec_ip->pu1_8x8_blk_type_map)
  ------------------
  |  Branch (4993:20): [True: 0, False: 0]
  ------------------
 4994|      0|                {
 4995|      0|                    ps_h264d_dec_op->pu1_8x8_blk_type_map = ps_h264d_dec_ip->pu1_8x8_blk_type_map;
 4996|      0|                    ps_h264d_dec_op->u4_8x8_blk_type_map_size = ps_dec->u4_total_mbs << 2;
 4997|      0|                    memcpy(ps_h264d_dec_op->pu1_8x8_blk_type_map,
 4998|      0|                                 ps_dec->as_buf_id_info_map[disp_buf_id].pu1_mb_type_map,
 4999|      0|                                 ps_dec->u4_total_mbs << 2);
 5000|      0|                }
 5001|      0|            }
 5002|      0|        }
 5003|      0|        ih264d_export_sei_params(&ps_dec_op->s_sei_decode_op, ps_dec);
 5004|       |
 5005|      0|        ih264d_release_display_field(ps_dec, &(ps_dec->s_disp_op));
 5006|       |
 5007|      0|        ps_dec_op->u4_pic_wd = (UWORD32) ps_dec->u2_disp_width;
 5008|      0|        ps_dec_op->u4_pic_ht = (UWORD32) ps_dec->u2_disp_height;
 5009|      0|        ps_dec_op->i4_reorder_depth = ps_dec->i4_reorder_depth;
 5010|      0|        ps_dec_op->i4_display_index = ps_dec->i4_display_index;
 5011|      0|        ps_dec_op->u4_new_seq = 0;
 5012|       |
 5013|      0|        ps_dec_op->u4_output_present = ps_dec->u4_output_present;
 5014|      0|        ps_dec_op->u4_progressive_frame_flag = ps_dec->s_disp_op.u4_progressive_frame_flag;
 5015|      0|        ps_dec_op->e_output_format = ps_dec->s_disp_op.e_output_format;
 5016|      0|        ps_dec_op->s_disp_frm_buf = ps_dec->s_disp_op.s_disp_frm_buf;
 5017|      0|        ps_dec_op->e4_fld_type = ps_dec->s_disp_op.e4_fld_type;
 5018|      0|        ps_dec_op->u4_ts = ps_dec->s_disp_op.u4_ts;
 5019|      0|        ps_dec_op->u4_disp_buf_id = ps_dec->s_disp_op.u4_disp_buf_id;
 5020|       |
 5021|       |        /*In the case of flush ,since no frame is decoded set pic type as invalid*/
 5022|      0|        ps_dec_op->u4_is_ref_flag = UINT32_MAX;
 5023|      0|        ps_dec_op->e_pic_type = IV_NA_FRAME;
 5024|      0|        ps_dec_op->u4_frame_decoded_flag = 0;
 5025|       |
 5026|      0|        if(0 == ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (5026:12): [True: 0, False: 0]
  ------------------
 5027|      0|        {
 5028|      0|            return (IV_SUCCESS);
 5029|      0|        }
 5030|      0|        else
 5031|      0|            return (IV_FAIL);
 5032|      0|    }
 5033|       |
 5034|   671k|    if(ps_dec->u1_res_changed == 1)
  ------------------
  |  Branch (5034:8): [True: 2.99k, False: 668k]
  ------------------
 5035|  2.99k|    {
 5036|       |        /*if resolution has changed and all buffers have been flushed, reset
 5037|       |         * decoder*/
 5038|  2.99k|        if(((buf_mgr_t *) ps_dec->pv_pic_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (5038:12): [True: 147, False: 2.84k]
  ------------------
 5039|    147|            ih264_buf_mgr_free(ps_dec->pv_pic_buf_mgr);
 5040|  2.99k|        if(((buf_mgr_t *) ps_dec->pv_mv_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (5040:12): [True: 147, False: 2.84k]
  ------------------
 5041|    147|            ih264_buf_mgr_free(ps_dec->pv_mv_buf_mgr);
 5042|       |
 5043|  2.99k|        isvcd_init_decoder(ps_svc_lyr_dec);
 5044|  2.99k|    }
 5045|       |
 5046|   671k|    DEBUG_THREADS_PRINTF(" Starting process call\n");
 5047|       |
 5048|   671k|    {
 5049|   671k|        vcl_node_t *ps_cur_node;
 5050|   671k|        UWORD8 u1_num_res_lyrs;
 5051|   671k|        vcl_buf_hdr_t *ps_vcl_buf;
 5052|   671k|        UWORD8 flush_decode = 1;
 5053|   671k|        ps_svcd_ctxt->u1_pre_parse_in_flush = 0;
 5054|       |
 5055|   671k|        ret = isvcd_pre_parse_refine_au(ps_svcd_ctxt, ps_dec_ip, &ps_dec_op->u4_num_bytes_consumed);
 5056|   671k|        ps_svcd_ctxt->u1_pre_parse_in_flush = (ret == FLUSH);
  ------------------
  |  |   50|   671k|#define FLUSH 2
  ------------------
 5057|       |
 5058|   671k|        if(ret != OK)
  ------------------
  |  |  114|   671k|#define OK        0
  ------------------
  |  Branch (5058:12): [True: 85.6k, False: 585k]
  ------------------
 5059|  85.6k|        {
 5060|  85.6k|            UWORD32 error = ih264d_map_error((UWORD32) ret);
 5061|  85.6k|            if(ret != NOT_OK)
  ------------------
  |  |  116|  85.6k|#define NOT_OK    -1
  ------------------
  |  Branch (5061:16): [True: 9.16k, False: 76.5k]
  ------------------
 5062|  9.16k|            {
 5063|  9.16k|                ps_dec_op->u4_error_code = error | ret;
 5064|  9.16k|            }
 5065|  85.6k|            if((ps_dec_op->u4_error_code >> IVD_FATALERROR) & 1)
  ------------------
  |  Branch (5065:16): [True: 1.09k, False: 84.5k]
  ------------------
 5066|  1.09k|            {
 5067|  1.09k|                ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5068|  1.09k|            }
 5069|  85.6k|            api_ret_value = IV_FAIL;
 5070|  85.6k|            if((ret == IVD_RES_CHANGED) || (ret == IVD_MEM_ALLOC_FAILED) ||
  ------------------
  |  Branch (5070:16): [True: 5.98k, False: 79.7k]
  |  Branch (5070:44): [True: 0, False: 79.7k]
  ------------------
 5071|  79.7k|               (ret == ERROR_UNAVAIL_PICBUF_T) || (ret == ERROR_UNAVAIL_MVBUF_T) ||
  ------------------
  |  Branch (5071:16): [True: 0, False: 79.7k]
  |  Branch (5071:51): [True: 0, False: 79.7k]
  ------------------
 5072|  79.7k|               (ret == ERROR_INV_SPS_PPS_T) || (ret == ERROR_FEATURE_UNAVAIL) ||
  ------------------
  |  Branch (5072:16): [True: 892, False: 78.8k]
  |  Branch (5072:48): [True: 605, False: 78.2k]
  ------------------
 5073|  78.2k|               (ret == IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED) ||
  ------------------
  |  Branch (5073:16): [True: 494, False: 77.7k]
  ------------------
 5074|  77.7k|               (ret == IVD_DISP_FRM_ZERO_OP_BUF_SIZE))
  ------------------
  |  Branch (5074:16): [True: 0, False: 77.7k]
  ------------------
 5075|  7.97k|            {
 5076|  7.97k|                ps_dec->u4_slice_start_code_found = 0;
 5077|  7.97k|            }
 5078|  85.6k|            if((ret == ERROR_INCOMPLETE_FRAME) || (ret == ERROR_DANGLING_FIELD_IN_PIC))
  ------------------
  |  Branch (5078:16): [True: 0, False: 85.6k]
  |  Branch (5078:51): [True: 0, False: 85.6k]
  ------------------
 5079|      0|            {
 5080|      0|                api_ret_value = IV_FAIL;
 5081|      0|            }
 5082|       |
 5083|  85.6k|            if(ret == ERROR_IN_LAST_SLICE_OF_PIC)
  ------------------
  |  Branch (5083:16): [True: 0, False: 85.6k]
  ------------------
 5084|      0|            {
 5085|      0|                api_ret_value = IV_FAIL;
 5086|      0|            }
 5087|  85.6k|        }
 5088|       |
 5089|   671k|        if(NOT_OK == ret)
  ------------------
  |  |  116|   671k|#define NOT_OK    -1
  ------------------
  |  Branch (5089:12): [True: 76.5k, False: 594k]
  ------------------
 5090|  76.5k|        {
 5091|  76.5k|            if(ps_dec->u4_pic_buf_got == 0)
  ------------------
  |  Branch (5091:16): [True: 69.1k, False: 7.41k]
  ------------------
 5092|  69.1k|            {
 5093|  69.1k|                ps_dec->i4_error_code = ERROR_START_CODE_NOT_FOUND;
 5094|  69.1k|                ps_dec_op->u4_error_code |= 1 << IVD_INSUFFICIENTDATA;
 5095|       |
 5096|  69.1k|                isvcd_fill_output_struct_from_context(ps_svc_lyr_dec, ps_dec_op);
 5097|       |
 5098|  69.1k|                ps_dec_op->u4_error_code = ps_dec->i4_error_code;
 5099|  69.1k|                ps_dec_op->u4_frame_decoded_flag = 0;
 5100|  69.1k|                return (IV_FAIL);
 5101|  69.1k|            }
 5102|  7.41k|            return (IV_SUCCESS);
 5103|  76.5k|        }
 5104|       |
 5105|   594k|        u1_num_res_lyrs = ps_svcd_ctxt->s_vcl_nal.i4_num_res_lyrs;
 5106|       |
 5107|       |        /* error concelment: exit till next IDR if any of Non Target layers are
 5108|       |         * corrupted */
 5109|   594k|        {
 5110|   594k|            ps_cur_node = ps_svcd_ctxt->s_vcl_nal.ps_bot_node;
 5111|       |
 5112|   594k|            if(NULL != ps_cur_node)
  ------------------
  |  Branch (5112:16): [True: 159k, False: 435k]
  ------------------
 5113|   159k|            {
 5114|   159k|                if(!ps_cur_node->i4_idr_pic_flag)
  ------------------
  |  Branch (5114:20): [True: 33.4k, False: 126k]
  ------------------
 5115|  33.4k|                {
 5116|  33.4k|                    if(u1_num_res_lyrs != ps_svcd_ctxt->u1_prev_num_res_layers)
  ------------------
  |  Branch (5116:24): [True: 5.06k, False: 28.4k]
  ------------------
 5117|  5.06k|                    {
 5118|  5.06k|                        ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5119|  5.06k|                        ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5120|  5.06k|                        return IV_FAIL;
 5121|  5.06k|                    }
 5122|  33.4k|                }
 5123|   126k|                else
 5124|   126k|                {
 5125|   126k|                    if(u1_num_res_lyrs != ps_svcd_ctxt->u1_prev_num_res_layers)
  ------------------
  |  Branch (5125:24): [True: 45.4k, False: 80.6k]
  ------------------
 5126|  45.4k|                    {
 5127|  45.4k|                        ps_svcd_ctxt->u1_prev_num_res_layers = u1_num_res_lyrs;
 5128|  45.4k|                    }
 5129|   126k|                }
 5130|   159k|            }
 5131|   594k|        }
 5132|   589k|        if(ps_svcd_ctxt->u1_prev_num_res_layers != u1_num_res_lyrs && (u1_num_res_lyrs != 0))
  ------------------
  |  Branch (5132:12): [True: 435k, False: 154k]
  |  Branch (5132:71): [True: 69, False: 434k]
  ------------------
 5133|     69|        {
 5134|     69|            ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr + u1_num_res_lyrs - 1;
 5135|     69|            ps_dec = &ps_svc_lyr_dec->s_dec;
 5136|       |
 5137|     69|            if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (5137:16): [True: 3, False: 66]
  ------------------
 5138|      3|            {
 5139|      3|                ih264d_release_pics_in_dpb((void *) ps_dec, ps_dec->u1_pic_bufs);
 5140|      3|                ih264d_release_display_bufs(ps_dec);
 5141|      3|                ih264_disp_mgr_init((disp_mgr_t *) ps_dec->pv_disp_buf_mgr);
 5142|       |
 5143|      3|                ih264_buf_mgr_reset(ps_dec->pv_pic_buf_mgr);
 5144|      3|                ih264_buf_mgr_reset(ps_dec->pv_mv_buf_mgr);
 5145|      3|                ih264d_init_ref_bufs(ps_dec->ps_dpb_mgr);
 5146|      3|            }
 5147|       |
 5148|       |            // ps_svcd_ctxt->u1_prev_num_res_layers = u1_num_res_lyrs;
 5149|     69|        }
 5150|   589k|        ps_svcd_ctxt->u1_parse_nal_unit_error = 0;
 5151|       |
 5152|   589k|        if((1 == ps_svcd_ctxt->u1_exit_till_next_IDR) &&
  ------------------
  |  Branch (5152:12): [True: 57.0k, False: 532k]
  ------------------
 5153|  57.0k|           (ps_svcd_ctxt->s_vcl_nal.ps_bot_node != NULL))
  ------------------
  |  Branch (5153:12): [True: 56.8k, False: 192]
  ------------------
 5154|  56.8k|        {
 5155|  56.8k|            if(1 == ps_svcd_ctxt->s_vcl_nal.ps_bot_node->i4_idr_pic_flag)
  ------------------
  |  Branch (5155:16): [True: 51.1k, False: 5.71k]
  ------------------
 5156|  51.1k|            {
 5157|  51.1k|                ps_svcd_ctxt->u1_exit_till_next_IDR = 0;
 5158|       |
 5159|   133k|                for(u1_res_id = 0; u1_res_id < u1_num_res_lyrs; u1_res_id++)
  ------------------
  |  Branch (5159:36): [True: 82.8k, False: 51.1k]
  ------------------
 5160|  82.8k|                {
 5161|  82.8k|                    ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr + u1_res_id;
 5162|  82.8k|                    ps_dec = &ps_svc_lyr_dec->s_dec;
 5163|  82.8k|                    ih264_buf_mgr_reset(ps_dec->pv_pic_buf_mgr);
 5164|  82.8k|                    ih264_buf_mgr_reset(ps_dec->pv_mv_buf_mgr);
 5165|  82.8k|                }
 5166|  51.1k|            }
 5167|  5.71k|            else
 5168|  5.71k|            {
 5169|  5.71k|                ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5170|  5.71k|                return IV_FAIL;
 5171|  5.71k|            }
 5172|  56.8k|        }
 5173|       |
 5174|   583k|        if((0 == ps_dec->i4_decode_header) && (OK == ret))
  ------------------
  |  |  114|   149k|#define OK        0
  ------------------
  |  Branch (5174:12): [True: 149k, False: 434k]
  |  Branch (5174:47): [True: 140k, False: 8.47k]
  ------------------
 5175|   140k|        {
 5176|   140k|            flush_decode = 0;
 5177|   140k|            ps_cur_node = ps_svcd_ctxt->s_vcl_nal.ps_bot_node;
 5178|   140k|            ps_svc_lyr_zero_dec = ps_svcd_ctxt->ps_svc_dec_lyr;
 5179|   140k|            ps_dec_zero_lyr = &ps_svc_lyr_zero_dec->s_dec;
 5180|       |            /* master loop */
 5181|       |
 5182|   270k|            for(u1_res_id = 0; u1_res_id < u1_num_res_lyrs; u1_res_id++)
  ------------------
  |  Branch (5182:32): [True: 180k, False: 90.0k]
  ------------------
 5183|   180k|            {
 5184|   180k|                UWORD8 u1_layer_nal_data_present = 0;
 5185|   180k|                ps_svcd_ctxt->u1_cur_layer_id = u1_res_id;
 5186|   180k|                ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr + u1_res_id;
 5187|   180k|                ps_svc_lyr_dec->u1_res_init_done = 0;
 5188|   180k|                ps_dec = &ps_svc_lyr_dec->s_dec;
 5189|       |
 5190|   180k|                ps_dec->i4_decode_header = ps_dec_zero_lyr->i4_decode_header;
 5191|   180k|                ps_dec->i4_header_decoded = ps_dec_zero_lyr->i4_header_decoded;
 5192|   180k|                ps_dec->u1_pic_decode_done = 0;
 5193|   180k|                ps_dec->u4_fmt_conv_cur_row = 0;
 5194|       |
 5195|   180k|                ps_dec->u4_output_present = 0;
 5196|   180k|                ps_dec->s_disp_op.u4_error_code = 1;
 5197|   180k|                ps_dec->u4_fmt_conv_num_rows = FMT_CONV_NUM_ROWS;
  ------------------
  |  |   46|   180k|#define FMT_CONV_NUM_ROWS       16
  ------------------
 5198|   180k|                ps_dec->u4_ts = ps_dec_ip->u4_ts;
 5199|   180k|                ps_dec->i4_frametype = IV_NA_FRAME;
 5200|   180k|                ps_dec->i4_content_type = IV_CONTENTTYPE_NA;
 5201|       |
 5202|   180k|                ps_dec->u4_slice_start_code_found = 0;
 5203|   180k|                ps_dec->u4_cur_mb_addr = 0;
 5204|   180k|                ps_dec->u4_total_mbs_coded = 0;
 5205|   180k|                ps_dec->u2_cur_slice_num = 0;
 5206|   180k|                ps_dec->cur_dec_mb_num = 0;
 5207|   180k|                ps_dec->cur_recon_mb_num = 0;
 5208|   180k|                ps_dec->u4_first_slice_in_pic = 1;
 5209|   180k|                ps_dec->u1_slice_header_done = 0;
 5210|   180k|                ps_dec->u1_dangling_field = 0;
 5211|       |
 5212|   180k|                ps_dec->u4_dec_thread_created = 0;
 5213|   180k|                ps_dec->u4_bs_deblk_thread_created = 0;
 5214|   180k|                ps_dec->u4_cur_bs_mb_num = 0;
 5215|   180k|                ps_dec->u4_cur_deblk_mb_num = 0;
 5216|   180k|                ps_dec->u4_start_recon_deblk = 0;
 5217|   180k|                ps_dec->u4_sps_cnt_in_process = 0;
 5218|   180k|                ps_dec->u4_pic_buf_got = 0;
 5219|   180k|                ps_dec->pv_dec_out = ps_dec_op;
 5220|       |
 5221|   180k|                if(ps_dec_ip->u4_size >= offsetof(ivd_video_decode_ip_t, s_out_buffer))
  ------------------
  |  Branch (5221:20): [True: 180k, False: 0]
  ------------------
 5222|   180k|                    ps_dec->ps_out_buffer = &ps_dec_ip->s_out_buffer;
 5223|       |
 5224|   180k|                ps_dec->u1_nal_unit_type = ps_cur_node->i4_nal_unit_type;
 5225|   180k|                ps_dec->u1_separate_parse = 0;
 5226|   180k|                if(u1_res_id == (u1_num_res_lyrs - 1))
  ------------------
  |  Branch (5226:20): [True: 129k, False: 50.7k]
  ------------------
 5227|   129k|                {
 5228|   129k|                    ps_svc_lyr_dec->u1_layer_identifier = TARGET_LAYER;
  ------------------
  |  |  110|   129k|#define TARGET_LAYER 2
  ------------------
 5229|   129k|                    if(ps_dec->u4_num_cores >= 2)
  ------------------
  |  Branch (5229:24): [True: 65.2k, False: 64.2k]
  ------------------
 5230|  65.2k|                    {
 5231|  65.2k|                        ps_dec->u4_num_cores = 2;
 5232|  65.2k|                        ps_dec->u1_separate_parse = 1;
 5233|  65.2k|                    }
 5234|   129k|                }
 5235|  50.7k|                else if(u1_res_id == 0)
  ------------------
  |  Branch (5235:25): [True: 50.7k, False: 0]
  ------------------
 5236|  50.7k|                {
 5237|  50.7k|                    ps_svc_lyr_dec->u1_layer_identifier = BASE_LAYER;
  ------------------
  |  |  108|  50.7k|#define BASE_LAYER 0
  ------------------
 5238|  50.7k|                    ps_dec->u1_separate_parse = 0;
 5239|  50.7k|                    ps_dec->u4_num_cores = 1;
 5240|  50.7k|                }
 5241|      0|                else if(u1_res_id != 0)
  ------------------
  |  Branch (5241:25): [True: 0, False: 0]
  ------------------
 5242|      0|                {
 5243|      0|                    ps_svc_lyr_dec->u1_layer_identifier = MEDIAL_ENHANCEMENT_LAYER;
  ------------------
  |  |  109|      0|#define MEDIAL_ENHANCEMENT_LAYER 1
  ------------------
 5244|      0|                    ps_dec->u1_separate_parse = 0;
 5245|      0|                    ps_dec->u4_num_cores = 1;
 5246|      0|                }
 5247|      0|                else
 5248|      0|                {
 5249|      0|                    return IV_FAIL;
 5250|      0|                }
 5251|       |
 5252|   180k|                ps_svc_lyr_dec->u1_base_res_flag = (0 == u1_res_id);
 5253|   180k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag = ps_cur_node->i4_idr_pic_flag;
 5254|   180k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_dependency_id = ps_cur_node->i4_dependency_id;
 5255|   180k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_priority_id = ps_cur_node->i4_priority_id;
 5256|   180k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_no_inter_layer_pred_flag =
 5257|   180k|                    ps_cur_node->u1_acc_no_int_pred;
 5258|       |
 5259|   180k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id = ps_cur_node->i4_quality_id;
 5260|   180k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_temporal_id = ps_cur_node->i4_temporal_id;
 5261|       |
 5262|   180k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_use_ref_base_pic_flag =
 5263|   180k|                    ps_cur_node->i4_use_ref_base;
 5264|   180k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_discardable_flag = 0;
 5265|   180k|                ps_svc_lyr_dec->ps_nal_svc_ext->u1_svc_ext_flag = (u1_res_id > 1);
 5266|   180k|                ps_svc_lyr_dec->u4_pps_id_for_layer = UINT32_MAX;
 5267|   180k|                ps_vcl_buf = ps_cur_node->ps_first_vcl_nal;
 5268|   180k|                ps_svc_lyr_dec->u1_error_in_cur_frame = 0;
 5269|       |
 5270|       |                /* Only for Non target Layers*/
 5271|   180k|                if(NULL != ps_cur_node->ps_top_node)
  ------------------
  |  Branch (5271:20): [True: 65.3k, False: 114k]
  ------------------
 5272|  65.3k|                {
 5273|  65.3k|                    ps_svc_lyr_dec->u1_inter_lyr_disable_dblk_filter_idc =
 5274|  65.3k|                        ps_cur_node->ps_top_node->i4_inter_lyr_dblk_idc;
 5275|  65.3k|                    ps_svc_lyr_dec->i1_inter_lyr_slice_alpha_c0_offset =
 5276|  65.3k|                        ps_cur_node->ps_top_node->i4_inter_lyr_alpha_c0_offset;
 5277|  65.3k|                    ps_svc_lyr_dec->i1_inter_lyr_slice_beta_offset =
 5278|  65.3k|                        ps_cur_node->ps_top_node->i4_inter_lyr_beta_offset;
 5279|  65.3k|                }
 5280|       |
 5281|   247k|                while(NULL != ps_vcl_buf)
  ------------------
  |  Branch (5281:23): [True: 178k, False: 69.2k]
  ------------------
 5282|   178k|                {
 5283|   178k|                    u1_layer_nal_data_present = 1;
 5284|   178k|                    ps_dec->ps_bitstrm->u4_ofst = 0;
 5285|   178k|                    ps_dec->ps_bitstrm->pu4_buffer =
 5286|   178k|                        (UWORD32 *) ((UWORD8 *) ps_vcl_buf + ps_vcl_buf->i4_buf_offset +
 5287|   178k|                                     ps_vcl_buf->i4_slice_offset);
 5288|       |
 5289|   178k|                    ps_dec->ps_bitstrm->u4_max_ofst = ps_vcl_buf->u4_max_bits;
 5290|       |
 5291|   178k|                    ps_dec_op->u4_frame_decoded_flag = 0;
 5292|   178k|                    ret = isvcd_parse_nal_unit(ps_svc_lyr_dec, ps_cur_node->i4_nal_ref_idc);
 5293|   178k|                    if(ret != OK)
  ------------------
  |  |  114|   178k|#define OK        0
  ------------------
  |  Branch (5293:24): [True: 111k, False: 67.2k]
  ------------------
 5294|   111k|                    {
 5295|   111k|                        ps_svcd_ctxt->u1_parse_nal_unit_error = 1;
 5296|   111k|                        break;
 5297|   111k|                    }
 5298|       |
 5299|       |                    /* go to the next slice */
 5300|  67.2k|                    ps_vcl_buf = ps_vcl_buf->ps_next;
 5301|  67.2k|                }
 5302|       |                /* error concelment: exit till next IDR if a Layer data is missing */
 5303|   180k|                if(0 == u1_layer_nal_data_present)
  ------------------
  |  Branch (5303:20): [True: 7.44k, False: 172k]
  ------------------
 5304|  7.44k|                {
 5305|  7.44k|                    ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5306|  7.44k|                    ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5307|  7.44k|                    return IV_FAIL;
 5308|  7.44k|                }
 5309|       |                /* error concelment: exit till next IDR if any of Non Target layers are
 5310|       |                 * corrupted */
 5311|   172k|                if((ret != OK) && (u1_res_id != (u1_num_res_lyrs - 1)))
  ------------------
  |  |  114|   172k|#define OK        0
  ------------------
  |  Branch (5311:20): [True: 111k, False: 61.8k]
  |  Branch (5311:35): [True: 10.2k, False: 100k]
  ------------------
 5312|  10.2k|                {
 5313|  10.2k|                    ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5314|  10.2k|                    ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5315|  10.2k|                    return IV_FAIL;
 5316|  10.2k|                }
 5317|       |
 5318|   162k|                if((ret != OK) && (u1_res_id == (u1_num_res_lyrs - 1)))
  ------------------
  |  |  114|   162k|#define OK        0
  ------------------
  |  Branch (5318:20): [True: 100k, False: 61.8k]
  |  Branch (5318:35): [True: 100k, False: 0]
  ------------------
 5319|   100k|                {
 5320|   100k|                    ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr + u1_num_res_lyrs - 1;
 5321|   100k|                    ps_dec = &ps_svc_lyr_dec->s_dec;
 5322|       |
 5323|   100k|                    if((0 == ps_svcd_ctxt->u4_num_sps_ctr) || (0 == ps_svcd_ctxt->u4_num_pps_ctr) ||
  ------------------
  |  Branch (5323:24): [True: 0, False: 100k]
  |  Branch (5323:63): [True: 0, False: 100k]
  ------------------
 5324|   100k|                       (NULL == ps_dec->ps_cur_pps) || (ps_svc_lyr_dec->u1_res_init_done == 0))
  ------------------
  |  Branch (5324:24): [True: 13.1k, False: 87.6k]
  |  Branch (5324:56): [True: 19.1k, False: 68.5k]
  ------------------
 5325|  32.2k|                    {
 5326|  32.2k|                        ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5327|  32.2k|                        ps_dec_op->u4_error_code = ERROR_UNKNOWN_NAL;
 5328|  32.2k|                        ih264d_signal_decode_thread(ps_dec);
 5329|  32.2k|                        return IV_FAIL;
 5330|  32.2k|                    }
 5331|   100k|                }
 5332|   130k|                ps_cur_node = ps_cur_node->ps_top_node;
 5333|       |
 5334|   130k|                if((ps_dec->u4_pic_buf_got == 1) && (ret != IVD_MEM_ALLOC_FAILED) &&
  ------------------
  |  Branch (5334:20): [True: 130k, False: 0]
  |  Branch (5334:53): [True: 130k, False: 0]
  ------------------
 5335|   130k|                   ps_dec->u4_total_mbs_coded < ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs)
  ------------------
  |  Branch (5335:20): [True: 96.8k, False: 33.4k]
  ------------------
 5336|  96.8k|                {
 5337|       |                    // last slice - missing/corruption
 5338|  96.8k|                    WORD32 num_mb_skipped;
 5339|  96.8k|                    WORD32 prev_slice_err;
 5340|  96.8k|                    pocstruct_t temp_poc;
 5341|  96.8k|                    WORD32 ret1;
 5342|  96.8k|                    WORD32 ht_in_mbs;
 5343|  96.8k|                    ht_in_mbs = ps_dec->u2_pic_ht >> (4 + ps_dec->ps_cur_slice->u1_field_pic_flag);
 5344|  96.8k|                    num_mb_skipped =
 5345|  96.8k|                        (ht_in_mbs * ps_dec->u2_frm_wd_in_mbs) - ps_dec->u4_total_mbs_coded;
 5346|       |
 5347|  96.8k|                    if(ps_dec->u4_first_slice_in_pic && (ps_dec->u4_pic_buf_got == 0))
  ------------------
  |  Branch (5347:24): [True: 0, False: 96.8k]
  |  Branch (5347:57): [True: 0, False: 0]
  ------------------
 5348|      0|                        prev_slice_err = 1;
 5349|  96.8k|                    else
 5350|  96.8k|                        prev_slice_err = 2;
 5351|       |
 5352|  96.8k|                    if(ps_dec->u4_total_mbs_coded == 0)
  ------------------
  |  Branch (5352:24): [True: 51.3k, False: 45.4k]
  ------------------
 5353|  51.3k|                    {
 5354|  51.3k|                        prev_slice_err = 1;
 5355|  51.3k|                    }
 5356|  96.8k|                    ret1 = isvcd_mark_err_slice_skip(
 5357|  96.8k|                        ps_svc_lyr_dec, num_mb_skipped, ps_dec->u1_nal_unit_type == IDR_SLICE_NAL,
  ------------------
  |  |  328|  96.8k|#define IDR_SLICE_NAL                   5
  ------------------
 5358|  96.8k|                        ps_dec->ps_cur_slice->u2_frame_num, &temp_poc, prev_slice_err);
 5359|       |
 5360|  96.8k|                    if((ret1 == ERROR_UNAVAIL_PICBUF_T) || (ret1 == ERROR_UNAVAIL_MVBUF_T) ||
  ------------------
  |  Branch (5360:24): [True: 0, False: 96.8k]
  |  Branch (5360:60): [True: 0, False: 96.8k]
  ------------------
 5361|  96.8k|                       (ret1 == ERROR_INV_SPS_PPS_T) || (ret1 == ERROR_CORRUPTED_SLICE) ||
  ------------------
  |  Branch (5361:24): [True: 0, False: 96.8k]
  |  Branch (5361:57): [True: 0, False: 96.8k]
  ------------------
 5362|  96.8k|                       (ret == NOT_OK))
  ------------------
  |  |  116|  96.8k|#define NOT_OK    -1
  ------------------
  |  Branch (5362:24): [True: 1.55k, False: 95.3k]
  ------------------
 5363|  1.55k|                    {
 5364|  1.55k|                        ret = ret1;
 5365|  1.55k|                    }
 5366|  96.8k|                }
 5367|       |
 5368|   130k|                if((ret == IVD_RES_CHANGED) || (ret == IVD_MEM_ALLOC_FAILED) ||
  ------------------
  |  Branch (5368:20): [True: 0, False: 130k]
  |  Branch (5368:48): [True: 0, False: 130k]
  ------------------
 5369|   130k|                   (ret == ERROR_UNAVAIL_PICBUF_T) || (ret == ERROR_UNAVAIL_MVBUF_T) ||
  ------------------
  |  Branch (5369:20): [True: 0, False: 130k]
  |  Branch (5369:55): [True: 0, False: 130k]
  ------------------
 5370|   130k|                   (ret == ERROR_INV_SPS_PPS_T) || (ret == ERROR_CORRUPTED_SLICE) ||
  ------------------
  |  Branch (5370:20): [True: 0, False: 130k]
  |  Branch (5370:52): [True: 635, False: 129k]
  ------------------
 5371|   129k|                   (ret == IVD_DISP_FRM_ZERO_OP_BUF_SIZE) || (ret == NOT_OK))
  ------------------
  |  |  116|   129k|#define NOT_OK    -1
  ------------------
  |  Branch (5371:20): [True: 0, False: 129k]
  |  Branch (5371:62): [True: 87, False: 129k]
  ------------------
 5372|    722|                {
 5373|    722|                    ps_svcd_ctxt->u1_exit_till_next_IDR = 1;
 5374|       |                    /* signal the decode thread */
 5375|    722|                    ih264d_signal_decode_thread(ps_dec);
 5376|       |                    /* dont consume bitstream for change in resolution case */
 5377|    722|                    if(ret == IVD_RES_CHANGED)
  ------------------
  |  Branch (5377:24): [True: 0, False: 722]
  ------------------
 5378|      0|                    {
 5379|      0|                        ps_dec_op->u4_num_bytes_consumed -= bytes_consumed;
 5380|      0|                    }
 5381|    722|                    return IV_FAIL;
 5382|    722|                }
 5383|       |
 5384|       |                /* Multi thread - for target Layer decoding*/
 5385|   129k|                if((ps_dec->u1_separate_parse) &&
  ------------------
  |  Branch (5385:20): [True: 51.4k, False: 78.1k]
  ------------------
 5386|  51.4k|                   (ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) &&
  ------------------
  |  |  110|  51.4k|#define TARGET_LAYER 2
  ------------------
  |  Branch (5386:20): [True: 51.4k, False: 0]
  ------------------
 5387|  51.4k|                   (0 == ps_svc_lyr_dec->u1_error_in_cur_frame))
  ------------------
  |  Branch (5387:20): [True: 7.06k, False: 44.3k]
  ------------------
 5388|  7.06k|                {
 5389|       |                    /* If Format conversion is not complete,
 5390|       |                     complete it here */
 5391|  7.06k|                    if(ps_dec->u4_num_cores == 2)
  ------------------
  |  Branch (5391:24): [True: 7.06k, False: 0]
  ------------------
 5392|  7.06k|                    {
 5393|       |                        /*do deblocking of all mbs*/
 5394|  7.06k|                        if((ps_dec->u4_nmb_deblk == 0) && (ps_dec->u4_start_recon_deblk == 1) &&
  ------------------
  |  Branch (5394:28): [True: 7.06k, False: 0]
  |  Branch (5394:59): [True: 7.06k, False: 0]
  ------------------
 5395|  7.06k|                           (ps_dec->ps_cur_sps->u1_mb_aff_flag == 0))
  ------------------
  |  Branch (5395:28): [True: 7.06k, False: 0]
  ------------------
 5396|  7.06k|                        {
 5397|  7.06k|                            UWORD8 u1_end_of_row = 0;
 5398|  7.06k|                            UWORD32 u4_max_addr;
 5399|  7.06k|                            tfr_ctxt_t s_tfr_ctxt = {0};
 5400|  7.06k|                            tfr_ctxt_t *ps_tfr_cxt = &s_tfr_ctxt;
 5401|  7.06k|                            pad_mgr_t *ps_pad_mgr = &ps_dec->s_pad_mgr;
 5402|  7.06k|                            UWORD32 u4_slice_end = 0;
 5403|       |
 5404|       |                            /*BS is done for all mbs while parsing*/
 5405|  7.06k|                            u4_max_addr = (ps_dec->u2_frm_wd_in_mbs * ps_dec->u2_frm_ht_in_mbs) - 1;
 5406|       |                            /* BS is moved post recon gen in SVC ext*/
 5407|       |
 5408|  7.06k|                            ih264d_init_deblk_tfr_ctxt(ps_dec, ps_pad_mgr, ps_tfr_cxt,
 5409|  7.06k|                                                       ps_dec->u2_frm_wd_in_mbs, 0);
 5410|       |
 5411|  7.06k|                            {
 5412|   150M|                                while(u4_slice_end != 1)
  ------------------
  |  Branch (5412:39): [True: 150M, False: 7.06k]
  ------------------
 5413|   150M|                                {
 5414|   150M|                                    dec_mb_info_t *p_cur_mb;
 5415|   150M|                                    WORD32 i, bs_mb_grp;
 5416|   150M|                                    bs_mb_grp = ps_dec->cur_dec_mb_num - ps_dec->u4_cur_bs_mb_num;
 5417|       |
 5418|   151M|                                    for(i = 0; i < bs_mb_grp; i++)
  ------------------
  |  Branch (5418:48): [True: 1.02M, False: 150M]
  ------------------
 5419|  1.02M|                                    {
 5420|  1.02M|                                        p_cur_mb =
 5421|  1.02M|                                            &ps_dec->ps_frm_mb_info[ps_dec->u4_cur_bs_mb_num];
 5422|       |
 5423|  1.02M|                                        DEBUG_THREADS_PRINTF("ps_dec->u4_cur_bs_mb_num = %d\n",
 5424|  1.02M|                                                             ps_dec->u4_cur_bs_mb_num);
 5425|  1.02M|                                        isvcd_compute_bs_non_mbaff_thread(ps_svc_lyr_dec, p_cur_mb,
 5426|  1.02M|                                                                          ps_dec->u4_cur_bs_mb_num);
 5427|       |
 5428|  1.02M|                                        ps_dec->u4_cur_bs_mb_num++;
 5429|  1.02M|                                        ps_dec->u4_bs_cur_slice_num_mbs++;
 5430|  1.02M|                                    }
 5431|   150M|                                    if(ps_dec->u4_cur_bs_mb_num > u4_max_addr)
  ------------------
  |  Branch (5431:40): [True: 7.06k, False: 150M]
  ------------------
 5432|  7.06k|                                    {
 5433|  7.06k|                                        u4_slice_end = 1;
 5434|  7.06k|                                        u1_end_of_row = 1;
 5435|  7.06k|                                    }
 5436|       |                                    /*deblock MB group*/
 5437|   150M|                                    {
 5438|   150M|                                        UWORD32 u4_num_mbs;
 5439|       |
 5440|   150M|                                        if(ps_dec->u4_cur_bs_mb_num > ps_dec->u4_cur_deblk_mb_num)
  ------------------
  |  Branch (5440:44): [True: 126M, False: 24.1M]
  ------------------
 5441|   126M|                                        {
 5442|   126M|                                            if(u1_end_of_row)
  ------------------
  |  Branch (5442:48): [True: 7.06k, False: 126M]
  ------------------
 5443|  7.06k|                                            {
 5444|  7.06k|                                                u4_num_mbs = ps_dec->u4_cur_bs_mb_num -
 5445|  7.06k|                                                             ps_dec->u4_cur_deblk_mb_num;
 5446|  7.06k|                                            }
 5447|   126M|                                            else
 5448|   126M|                                            {
 5449|   126M|                                                u4_num_mbs = ps_dec->u4_cur_bs_mb_num -
 5450|   126M|                                                             ps_dec->u4_cur_deblk_mb_num - 1;
 5451|   126M|                                            }
 5452|   126M|                                        }
 5453|  24.1M|                                        else
 5454|  24.1M|                                            u4_num_mbs = 0;
 5455|       |
 5456|   150M|                                        ih264d_check_mb_map_deblk(ps_dec, u4_num_mbs, ps_tfr_cxt,
 5457|   150M|                                                                  0);
 5458|   150M|                                    }
 5459|   150M|                                }
 5460|  7.06k|                            }
 5461|  7.06k|                        }
 5462|  7.06k|                    }
 5463|       |
 5464|       |                    /*signal the decode thread*/
 5465|  7.06k|                    ih264d_signal_decode_thread(ps_dec);
 5466|  7.06k|                }
 5467|   122k|                else if((ps_dec->u1_separate_parse) &&
  ------------------
  |  Branch (5467:25): [True: 44.3k, False: 78.1k]
  ------------------
 5468|  44.3k|                        (ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER))
  ------------------
  |  |  110|  44.3k|#define TARGET_LAYER 2
  ------------------
  |  Branch (5468:25): [True: 44.3k, False: 0]
  ------------------
 5469|  44.3k|                {
 5470|       |                    /*signal the decode thread*/
 5471|  44.3k|                    ih264d_signal_decode_thread(ps_dec);
 5472|  44.3k|                }
 5473|       |
 5474|   129k|                DATA_SYNC();
  ------------------
  |  |  116|   129k|#define DATA_SYNC()  __sync_synchronize()
  ------------------
 5475|       |
 5476|   129k|                if((ps_dec_op->u4_error_code & 0xff) != ERROR_DYNAMIC_RESOLUTION_NOT_SUPPORTED)
  ------------------
  |  Branch (5476:20): [True: 129k, False: 0]
  ------------------
 5477|   129k|                {
 5478|   129k|                    ps_dec_op->u4_pic_wd = (UWORD32) ps_dec->u2_disp_width;
 5479|   129k|                    ps_dec_op->u4_pic_ht = (UWORD32) ps_dec->u2_disp_height;
 5480|   129k|                    ps_dec_op->i4_reorder_depth = ps_dec->i4_reorder_depth;
 5481|   129k|                }
 5482|       |
 5483|       |                // Report if header (sps and pps) has not been decoded yet
 5484|   129k|                if(ps_dec->i4_decode_header == 1 && ps_dec->i4_header_decoded != 3)
  ------------------
  |  Branch (5484:20): [True: 0, False: 129k]
  |  Branch (5484:53): [True: 0, False: 0]
  ------------------
 5485|      0|                {
 5486|      0|                    ps_dec_op->u4_error_code |= (1 << IVD_INSUFFICIENTDATA);
 5487|      0|                    api_ret_value = IV_FAIL;
 5488|      0|                }
 5489|       |
 5490|   129k|                if((ps_dec->u4_pic_buf_got == 1) && (ERROR_DANGLING_FIELD_IN_PIC != i4_err_status))
  ------------------
  |  Branch (5490:20): [True: 129k, False: 0]
  |  Branch (5490:53): [True: 129k, False: 0]
  ------------------
 5491|   129k|                {
 5492|       |                    /* For field pictures, set bottom and top picture decoded u4_flag correctly */
 5493|       |
 5494|   129k|                    if(ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (5494:24): [True: 0, False: 129k]
  ------------------
 5495|      0|                    {
 5496|      0|                        if(1 == ps_dec->ps_cur_slice->u1_bottom_field_flag)
  ------------------
  |  Branch (5496:28): [True: 0, False: 0]
  ------------------
 5497|      0|                        {
 5498|      0|                            ps_dec->u1_top_bottom_decoded |= BOT_FIELD_ONLY;
  ------------------
  |  |   65|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
 5499|      0|                        }
 5500|      0|                        else
 5501|      0|                        {
 5502|      0|                            ps_dec->u1_top_bottom_decoded |= TOP_FIELD_ONLY;
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
 5503|      0|                        }
 5504|      0|                    }
 5505|   129k|                    else
 5506|   129k|                    {
 5507|   129k|                        ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   64|   129k|#define TOP_FIELD_ONLY      0x02
  ------------------
                                      ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   65|   129k|#define BOT_FIELD_ONLY      0x01
  ------------------
 5508|   129k|                    }
 5509|       |
 5510|       |                    /* if new frame in not found (if we are still getting slices from
 5511|       |                     * previous frame) ih264d_deblock_display is not called. Such frames
 5512|       |                     * will not be added to reference /display
 5513|       |                     */
 5514|   129k|                    if((ps_dec->ps_dec_err_status->u1_err_flag & REJECT_CUR_PIC) == 0)
  ------------------
  |  |  601|   129k|#define REJECT_CUR_PIC    (0x01)
  ------------------
  |  Branch (5514:24): [True: 129k, False: 0]
  ------------------
 5515|   129k|                    {
 5516|       |                        /* Calling Function to deblock Picture and Display */
 5517|   129k|                        ret = ih264d_deblock_display(ps_dec);
 5518|   129k|                    }
 5519|       |
 5520|       |                    /*set to complete ,as we dont support partial frame decode*/
 5521|   129k|                    if(ps_dec->i4_header_decoded == 3)
  ------------------
  |  Branch (5521:24): [True: 129k, False: 0]
  ------------------
 5522|   129k|                    {
 5523|   129k|                        ps_dec->u4_total_mbs_coded = ps_dec->ps_cur_sps->u4_max_mb_addr + 1;
 5524|   129k|                    }
 5525|       |
 5526|       |                    /*Update the i4_frametype at the end of picture*/
 5527|   129k|                    if(ps_dec->ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL)
  ------------------
  |  |  328|   129k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (5527:24): [True: 107k, False: 22.1k]
  ------------------
 5528|   107k|                    {
 5529|   107k|                        ps_dec->i4_frametype = IV_IDR_FRAME;
 5530|   107k|                    }
 5531|  22.1k|                    else if(ps_dec->i4_pic_type == B_SLICE)
  ------------------
  |  |  369|  22.1k|#define B_SLICE  1
  ------------------
  |  Branch (5531:29): [True: 15.4k, False: 6.68k]
  ------------------
 5532|  15.4k|                    {
 5533|  15.4k|                        ps_dec->i4_frametype = IV_B_FRAME;
 5534|  15.4k|                    }
 5535|  6.68k|                    else if(ps_dec->i4_pic_type == P_SLICE)
  ------------------
  |  |  368|  6.68k|#define P_SLICE  0
  ------------------
  |  Branch (5535:29): [True: 3.74k, False: 2.94k]
  ------------------
 5536|  3.74k|                    {
 5537|  3.74k|                        ps_dec->i4_frametype = IV_P_FRAME;
 5538|  3.74k|                    }
 5539|  2.94k|                    else if(ps_dec->i4_pic_type == I_SLICE)
  ------------------
  |  |  370|  2.94k|#define I_SLICE  2
  ------------------
  |  Branch (5539:29): [True: 2.71k, False: 230]
  ------------------
 5540|  2.71k|                    {
 5541|  2.71k|                        ps_dec->i4_frametype = IV_I_FRAME;
 5542|  2.71k|                    }
 5543|    230|                    else
 5544|    230|                    {
 5545|    230|                        H264_DEC_DEBUG_PRINT("Shouldn't come here\n");
  ------------------
  |  |   39|    230|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 5546|    230|                    }
 5547|       |
 5548|       |                    // Update the content type
 5549|   129k|                    ps_dec->i4_content_type = ps_dec->ps_cur_slice->u1_field_pic_flag;
 5550|       |
 5551|   129k|                    ps_dec->u4_total_frames_decoded = ps_dec->u4_total_frames_decoded + 2;
 5552|   129k|                    ps_dec->u4_total_frames_decoded =
 5553|   129k|                        ps_dec->u4_total_frames_decoded - ps_dec->ps_cur_slice->u1_field_pic_flag;
 5554|   129k|                }
 5555|       |
 5556|       |                /* In case the decoder is configured to run in low delay mode,
 5557|       |                 * then get display buffer and then format convert.
 5558|       |                 * Note in this mode, format conversion does not run paralelly in a
 5559|       |                 * thread and adds to the codec cycles
 5560|       |                 */
 5561|   129k|                if((IVD_DECODE_FRAME_OUT == ps_dec->e_frm_out_mode) && ps_dec->u1_init_dec_flag)
  ------------------
  |  Branch (5561:20): [True: 0, False: 129k]
  |  Branch (5561:72): [True: 0, False: 0]
  ------------------
 5562|      0|                {
 5563|      0|                    ih264d_get_next_display_field(ps_dec, ps_dec->ps_out_buffer,
 5564|      0|                                                  &(ps_dec->s_disp_op));
 5565|       |
 5566|      0|                    if(0 == ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (5566:24): [True: 0, False: 0]
  ------------------
 5567|      0|                    {
 5568|      0|                        ps_dec->u4_fmt_conv_cur_row = 0;
 5569|      0|                        ps_dec->u4_output_present = 1;
 5570|      0|                    }
 5571|      0|                    else
 5572|      0|                    {
 5573|      0|                        ps_dec->u4_output_present = 0;
 5574|      0|                    }
 5575|      0|                }
 5576|       |
 5577|   129k|                isvcd_fill_output_struct_from_context(ps_svc_lyr_dec, ps_dec_op);
 5578|       |
 5579|       |                /* If Format conversion is not complete,
 5580|       |                 complete it here */
 5581|       |                /* For Non -target Layers , Buffers are retrived but not displayed*/
 5582|       |
 5583|   129k|                if((ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) &&
  ------------------
  |  |  110|   129k|#define TARGET_LAYER 2
  ------------------
  |  Branch (5583:20): [True: 90.0k, False: 39.5k]
  ------------------
 5584|  90.0k|                   ps_dec->u4_output_present &&
  ------------------
  |  Branch (5584:20): [True: 24.8k, False: 65.1k]
  ------------------
 5585|  24.8k|                   (ps_dec->u4_fmt_conv_cur_row < ps_dec->s_disp_frame_info.u4_y_ht))
  ------------------
  |  Branch (5585:20): [True: 9.59k, False: 15.2k]
  ------------------
 5586|  9.59k|                {
 5587|  9.59k|                    ps_dec->u4_fmt_conv_num_rows =
 5588|  9.59k|                        ps_dec->s_disp_frame_info.u4_y_ht - ps_dec->u4_fmt_conv_cur_row;
 5589|  9.59k|                    ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op), ps_dec->u4_fmt_conv_cur_row,
 5590|  9.59k|                                          ps_dec->u4_fmt_conv_num_rows);
 5591|  9.59k|                    ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
 5592|  9.59k|                }
 5593|       |
 5594|   129k|                ih264d_release_display_field(ps_dec, &(ps_dec->s_disp_op));
 5595|       |
 5596|   129k|                if(ps_dec->i4_decode_header == 1 && (ps_dec->i4_header_decoded & 1) == 1)
  ------------------
  |  Branch (5596:20): [True: 0, False: 129k]
  |  Branch (5596:53): [True: 0, False: 0]
  ------------------
 5597|      0|                {
 5598|      0|                    ps_dec_op->u4_progressive_frame_flag = 1;
 5599|      0|                    if((NULL != ps_dec->ps_cur_sps) && (1 == (ps_dec->ps_cur_sps->u1_is_valid)))
  ------------------
  |  Branch (5599:24): [True: 0, False: 0]
  |  Branch (5599:56): [True: 0, False: 0]
  ------------------
 5600|      0|                    {
 5601|      0|                        if((0 == ps_dec->ps_sps->u1_frame_mbs_only_flag) &&
  ------------------
  |  Branch (5601:28): [True: 0, False: 0]
  ------------------
 5602|      0|                           (0 == ps_dec->ps_sps->u1_mb_aff_flag))
  ------------------
  |  Branch (5602:28): [True: 0, False: 0]
  ------------------
 5603|      0|                            ps_dec_op->u4_progressive_frame_flag = 0;
 5604|      0|                    }
 5605|      0|                }
 5606|       |
 5607|   129k|                if((TOP_FIELD_ONLY | BOT_FIELD_ONLY) == ps_dec->u1_top_bottom_decoded)
  ------------------
  |  |   64|   129k|#define TOP_FIELD_ONLY      0x02
  ------------------
                              if((TOP_FIELD_ONLY | BOT_FIELD_ONLY) == ps_dec->u1_top_bottom_decoded)
  ------------------
  |  |   65|   129k|#define BOT_FIELD_ONLY      0x01
  ------------------
  |  Branch (5607:20): [True: 129k, False: 0]
  ------------------
 5608|   129k|                {
 5609|   129k|                    ps_dec->u1_top_bottom_decoded = 0;
 5610|   129k|                }
 5611|       |                /*--------------------------------------------------------------------*/
 5612|       |                /* Do End of Pic processing.                                          */
 5613|       |                /* Should be called only if frame was decoded in previous process call*/
 5614|       |                /*--------------------------------------------------------------------*/
 5615|   129k|                if(ps_dec->u4_pic_buf_got == 1)
  ------------------
  |  Branch (5615:20): [True: 129k, False: 0]
  ------------------
 5616|   129k|                {
 5617|   129k|                    if(1 == ps_dec->u1_last_pic_not_decoded)
  ------------------
  |  Branch (5617:24): [True: 0, False: 129k]
  ------------------
 5618|      0|                    {
 5619|      0|                        ret = ih264d_end_of_pic_dispbuf_mgr(ps_dec);
 5620|       |
 5621|      0|                        if(ret != OK) return ret;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (5621:28): [True: 0, False: 0]
  ------------------
 5622|       |
 5623|      0|                        ret = ih264d_end_of_pic(ps_dec);
 5624|      0|                        if(ret != OK) return ret;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (5624:28): [True: 0, False: 0]
  ------------------
 5625|      0|                    }
 5626|   129k|                    else
 5627|   129k|                    {
 5628|   129k|                        ret = ih264d_end_of_pic(ps_dec);
 5629|   129k|                        if(ret != OK) return ret;
  ------------------
  |  |  114|   129k|#define OK        0
  ------------------
  |  Branch (5629:28): [True: 0, False: 129k]
  ------------------
 5630|   129k|                    }
 5631|   129k|                }
 5632|       |
 5633|   129k|                if(ps_dec->u1_enable_mb_info && ps_dec->u4_output_present)
  ------------------
  |  Branch (5633:20): [True: 0, False: 129k]
  |  Branch (5633:49): [True: 0, False: 0]
  ------------------
 5634|      0|                {
 5635|      0|                    UWORD32 disp_buf_id = ps_dec->s_disp_op.u4_disp_buf_id;
 5636|      0|                    if(ps_h264d_dec_ip->pu1_8x8_blk_qp_map)
  ------------------
  |  Branch (5636:24): [True: 0, False: 0]
  ------------------
 5637|      0|                    {
 5638|      0|                        ps_h264d_dec_op->pu1_8x8_blk_qp_map = ps_h264d_dec_ip->pu1_8x8_blk_qp_map;
 5639|      0|                        ps_h264d_dec_op->u4_8x8_blk_qp_map_size = ps_dec->u4_total_mbs << 2;
 5640|      0|                        memcpy(ps_h264d_dec_op->pu1_8x8_blk_qp_map,
 5641|      0|                                     ps_dec->as_buf_id_info_map[disp_buf_id].pu1_qp_map,
 5642|      0|                                     ps_dec->u4_total_mbs << 2);
 5643|      0|                    }
 5644|      0|                    if(ps_h264d_dec_ip->pu1_8x8_blk_type_map)
  ------------------
  |  Branch (5644:24): [True: 0, False: 0]
  ------------------
 5645|      0|                    {
 5646|      0|                        ps_h264d_dec_op->pu1_8x8_blk_type_map =
 5647|      0|                            ps_h264d_dec_ip->pu1_8x8_blk_type_map;
 5648|      0|                        ps_h264d_dec_op->u4_8x8_blk_type_map_size = ps_dec->u4_total_mbs << 2;
 5649|      0|                        memcpy(ps_h264d_dec_op->pu1_8x8_blk_type_map,
 5650|      0|                                     ps_dec->as_buf_id_info_map[disp_buf_id].pu1_mb_type_map,
 5651|      0|                                     ps_dec->u4_total_mbs << 2);
 5652|      0|                    }
 5653|      0|                }
 5654|       |                /*Data memory barrier instruction,so that yuv write by the library is
 5655|       |                 * complete*/
 5656|   129k|                DATA_SYNC();
  ------------------
  |  |  116|   129k|#define DATA_SYNC()  __sync_synchronize()
  ------------------
 5657|       |
 5658|   129k|                H264_DEC_DEBUG_PRINT("The num bytes consumed: %d\n",
  ------------------
  |  |   39|   129k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 5659|   129k|                                     ps_dec_op->u4_num_bytes_consumed);
 5660|   129k|            }
 5661|   140k|        }
 5662|       |        /* highest layer for flush validation */
 5663|       |
 5664|   533k|        if((ps_dec->u1_flushfrm) && (1 == flush_decode))
  ------------------
  |  Branch (5664:12): [True: 0, False: 533k]
  |  Branch (5664:37): [True: 0, False: 0]
  ------------------
 5665|      0|        {
 5666|      0|            u1_res_id = u1_num_res_lyrs - 1;
 5667|      0|            ps_svc_lyr_dec = ps_svcd_ctxt->ps_svc_dec_lyr + u1_res_id;
 5668|      0|            ps_dec = &ps_svc_lyr_dec->s_dec;
 5669|       |
 5670|      0|            ih264d_get_next_display_field(ps_dec, ps_dec->ps_out_buffer, &(ps_dec->s_disp_op));
 5671|      0|            if(0 == ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (5671:16): [True: 0, False: 0]
  ------------------
 5672|      0|            {
 5673|       |                /* check output buffer size given by the application */
 5674|      0|                if(check_app_out_buf_size(ps_dec) != IV_SUCCESS)
  ------------------
  |  Branch (5674:20): [True: 0, False: 0]
  ------------------
 5675|      0|                {
 5676|      0|                    ps_dec_op->u4_error_code = IVD_DISP_FRM_ZERO_OP_BUF_SIZE;
 5677|      0|                    return (IV_FAIL);
 5678|      0|                }
 5679|       |
 5680|      0|                ps_dec->u4_fmt_conv_cur_row = 0;
 5681|      0|                ps_dec->u4_fmt_conv_num_rows = ps_dec->s_disp_frame_info.u4_y_ht;
 5682|      0|                ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op), ps_dec->u4_fmt_conv_cur_row,
 5683|      0|                                      ps_dec->u4_fmt_conv_num_rows);
 5684|      0|                ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
 5685|      0|                ps_dec->u4_output_present = 1;
 5686|      0|            }
 5687|      0|            else
 5688|      0|            {
 5689|      0|                ps_dec->u4_output_present = 0;
 5690|      0|            }
 5691|      0|            ih264d_export_sei_params(&ps_dec_op->s_sei_decode_op, ps_dec);
 5692|       |
 5693|      0|            ih264d_release_display_field(ps_dec, &(ps_dec->s_disp_op));
 5694|       |
 5695|      0|            ps_dec_op->u4_pic_wd = (UWORD32) ps_dec->u2_disp_width;
 5696|      0|            ps_dec_op->u4_pic_ht = (UWORD32) ps_dec->u2_disp_height;
 5697|      0|            ps_dec_op->i4_reorder_depth = ps_dec->i4_reorder_depth;
 5698|      0|            ps_dec_op->i4_display_index = ps_dec->i4_display_index;
 5699|       |
 5700|      0|            ps_dec_op->u4_new_seq = 0;
 5701|      0|            ps_dec_op->u4_output_present = (ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|      0|#define TARGET_LAYER 2
  ------------------
  |  Branch (5701:44): [True: 0, False: 0]
  ------------------
 5702|      0|                                               ? ps_dec->u4_output_present
 5703|      0|                                               : 0;
 5704|      0|            ps_dec_op->u4_progressive_frame_flag = ps_dec->s_disp_op.u4_progressive_frame_flag;
 5705|      0|            ps_dec_op->e_output_format = ps_dec->s_disp_op.e_output_format;
 5706|      0|            ps_dec_op->s_disp_frm_buf = ps_dec->s_disp_op.s_disp_frm_buf;
 5707|      0|            ps_dec_op->e4_fld_type = ps_dec->s_disp_op.e4_fld_type;
 5708|      0|            ps_dec_op->u4_ts = ps_dec->s_disp_op.u4_ts;
 5709|      0|            ps_dec_op->u4_disp_buf_id = ps_dec->s_disp_op.u4_disp_buf_id;
 5710|       |
 5711|       |            /*In the case of flush ,since no frame is decoded set pic type as invalid*/
 5712|      0|            ps_dec_op->u4_is_ref_flag = UINT32_MAX;
 5713|      0|            ps_dec_op->e_pic_type = IV_NA_FRAME;
 5714|      0|            ps_dec_op->u4_frame_decoded_flag = 0;
 5715|       |
 5716|      0|            if(0 == ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (5716:16): [True: 0, False: 0]
  ------------------
 5717|      0|            {
 5718|      0|                return (IV_SUCCESS);
 5719|      0|            }
 5720|      0|            else
 5721|      0|                return (IV_FAIL);
 5722|      0|        }
 5723|   533k|    }
 5724|       |
 5725|   533k|    if((ps_dec_op->u4_error_code & 0xff) != ERROR_DYNAMIC_RESOLUTION_NOT_SUPPORTED)
  ------------------
  |  Branch (5725:8): [True: 533k, False: 0]
  ------------------
 5726|   533k|    {
 5727|   533k|        ps_dec_op->u4_pic_wd = (UWORD32) ps_dec->u2_disp_width;
 5728|   533k|        ps_dec_op->u4_pic_ht = (UWORD32) ps_dec->u2_disp_height;
 5729|   533k|        ps_dec_op->i4_reorder_depth = ps_dec->i4_reorder_depth;
 5730|   533k|    }
 5731|   533k|    return api_ret_value;
 5732|   533k|}
isvcd_set_params:
 6163|  43.0k|{
 6164|  43.0k|    dec_struct_t *ps_dec;
 6165|  43.0k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 6166|  43.0k|    WORD32 ret = IV_SUCCESS;
 6167|  43.0k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6168|  43.0k|    WORD32 u1_layer_id;
 6169|       |
 6170|  43.0k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6171|  43.0k|    ps_svcd_ctxt->i4_eos_flag = 0;
 6172|   172k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|   172k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (6172:26): [True: 129k, False: 43.0k]
  ------------------
 6173|   129k|    {
 6174|   129k|        isvcd_ctl_set_config_ip_t *ps_h264d_ctl_ip = (isvcd_ctl_set_config_ip_t *) pv_api_ip;
 6175|   129k|        isvcd_ctl_set_config_op_t *ps_h264d_ctl_op = (isvcd_ctl_set_config_op_t *) pv_api_op;
 6176|   129k|        ivd_ctl_set_config_ip_t *ps_ctl_ip = &ps_h264d_ctl_ip->s_ivd_ctl_set_config_ip_t;
 6177|   129k|        ivd_ctl_set_config_op_t *ps_ctl_op = &ps_h264d_ctl_op->s_ivd_ctl_set_config_op_t;
 6178|       |
 6179|   129k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 6180|   129k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 6181|       |
 6182|   129k|        ps_dec->u1_flushfrm = 0;
 6183|   129k|        ps_dec->u4_skip_frm_mask = 0;
 6184|   129k|        ps_ctl_op->u4_error_code = 0;
 6185|       |
 6186|   129k|        if(ps_ctl_ip->e_frm_skip_mode != IVD_SKIP_NONE)
  ------------------
  |  Branch (6186:12): [True: 0, False: 129k]
  ------------------
 6187|      0|        {
 6188|      0|            ps_ctl_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 6189|      0|            ret = IV_FAIL;
 6190|      0|        }
 6191|       |
 6192|   129k|        if(ps_ctl_ip->u4_disp_wd >= ps_dec->u2_disp_width)
  ------------------
  |  Branch (6192:12): [True: 129k, False: 0]
  ------------------
 6193|   129k|        {
 6194|   129k|            ps_dec->u4_app_disp_width = ps_ctl_ip->u4_disp_wd;
 6195|   129k|        }
 6196|      0|        else if(0 == ps_dec->i4_header_decoded)
  ------------------
  |  Branch (6196:17): [True: 0, False: 0]
  ------------------
 6197|      0|        {
 6198|      0|            ps_dec->u4_app_disp_width = ps_ctl_ip->u4_disp_wd;
 6199|      0|        }
 6200|      0|        else if(ps_ctl_ip->u4_disp_wd == 0)
  ------------------
  |  Branch (6200:17): [True: 0, False: 0]
  ------------------
 6201|      0|        {
 6202|      0|            ps_dec->u4_app_disp_width = 0;
 6203|      0|        }
 6204|      0|        else
 6205|      0|        {
 6206|       |            /*
 6207|       |             * Set the display width to zero. This will ensure that the wrong value we
 6208|       |             * had stored (0xFFFFFFFF) does not propogate.
 6209|       |             */
 6210|      0|            ps_dec->u4_app_disp_width = 0;
 6211|      0|            ps_ctl_op->u4_error_code |= (1 << IVD_UNSUPPORTEDPARAM);
 6212|      0|            ps_ctl_op->u4_error_code |= ERROR_DISP_WIDTH_INVALID;
 6213|      0|            ret = IV_FAIL;
 6214|      0|        }
 6215|       |
 6216|   129k|        if(ps_ctl_ip->e_vid_dec_mode == IVD_DECODE_FRAME)
  ------------------
  |  Branch (6216:12): [True: 64.6k, False: 64.6k]
  ------------------
 6217|  64.6k|            ps_dec->i4_decode_header = 0;
 6218|  64.6k|        else if(ps_ctl_ip->e_vid_dec_mode == IVD_DECODE_HEADER)
  ------------------
  |  Branch (6218:17): [True: 64.6k, False: 0]
  ------------------
 6219|  64.6k|            ps_dec->i4_decode_header = 1;
 6220|      0|        else
 6221|      0|        {
 6222|      0|            ps_ctl_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 6223|      0|            ps_dec->i4_decode_header = 1;
 6224|      0|            ret = IV_FAIL;
 6225|      0|        }
 6226|   129k|        ps_dec->e_frm_out_mode = IVD_DISPLAY_FRAME_OUT;
 6227|       |
 6228|   129k|        if((ps_ctl_ip->e_frm_out_mode != IVD_DECODE_FRAME_OUT) &&
  ------------------
  |  Branch (6228:12): [True: 129k, False: 0]
  ------------------
 6229|   129k|           (ps_ctl_ip->e_frm_out_mode != IVD_DISPLAY_FRAME_OUT))
  ------------------
  |  Branch (6229:12): [True: 0, False: 129k]
  ------------------
 6230|      0|        {
 6231|      0|            ps_ctl_op->u4_error_code = (1 << IVD_UNSUPPORTEDPARAM);
 6232|      0|            ret = IV_FAIL;
 6233|      0|        }
 6234|   129k|        ps_dec->e_frm_out_mode = ps_ctl_ip->e_frm_out_mode;
 6235|   129k|    }
 6236|  43.0k|    return ret;
 6237|  43.0k|}
isvcd_set_target_layer:
 6260|  21.5k|{
 6261|  21.5k|    WORD32 ret = IV_SUCCESS;
 6262|       |
 6263|  21.5k|    isvcd_set_target_layer_ip_t *ps_ip;
 6264|  21.5k|    isvcd_set_target_layer_op_t *ps_op;
 6265|  21.5k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6266|  21.5k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6267|       |
 6268|  21.5k|    ps_ip = (isvcd_set_target_layer_ip_t *) pv_api_ip;
 6269|  21.5k|    ps_op = (isvcd_set_target_layer_op_t *) pv_api_op;
 6270|       |
 6271|  21.5k|    ps_svcd_ctxt->u1_tgt_dep_id = ps_ip->u1_tgt_dep_id;
 6272|  21.5k|    ps_svcd_ctxt->u1_tgt_quality_id = ps_ip->u1_tgt_quality_id;
 6273|  21.5k|    ps_svcd_ctxt->u1_tgt_temp_id = ps_ip->u1_tgt_temp_id;
 6274|  21.5k|    ps_svcd_ctxt->u1_tgt_priority_id = ps_ip->u1_tgt_priority_id;
 6275|       |
 6276|  21.5k|    ret = isvcd_nal_parse_set_target_attr(ps_ip->u1_tgt_quality_id, ps_ip->u1_tgt_dep_id,
 6277|  21.5k|                                          ps_ip->u1_tgt_temp_id, ps_ip->u1_tgt_priority_id,
 6278|  21.5k|                                          ps_svcd_ctxt->pv_nal_parse_ctxt);
 6279|  21.5k|    ps_op->u4_error_code = 0;
 6280|       |
 6281|  21.5k|    return ret;
 6282|  21.5k|}
isvcd_delete:
 6351|  21.5k|{
 6352|  21.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 6353|  21.5k|    isvcd_delete_ip_t *ps_ip = (isvcd_delete_ip_t *) pv_api_ip;
 6354|  21.5k|    isvcd_delete_op_t *ps_op = (isvcd_delete_op_t *) pv_api_op;
 6355|       |
 6356|  21.5k|    UWORD8 u1_layer_id;
 6357|  21.5k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6358|  21.5k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6359|  21.5k|    UNUSED(ps_ip);
  ------------------
  |  |   45|  21.5k|#define UNUSED(x) ((void)(x))
  ------------------
 6360|       |
 6361|  86.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (6361:26): [True: 64.6k, False: 21.5k]
  ------------------
 6362|  64.6k|    {
 6363|  64.6k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 6364|  64.6k|        isvcd_free_dynamic_bufs(ps_svc_lyr_dec);
 6365|  64.6k|    }
 6366|  21.5k|    isvcd_free_static_bufs(dec_hdl);
 6367|  21.5k|    ps_op->s_ivd_delete_op_t.u4_error_code = 0;
 6368|       |
 6369|  21.5k|    return IV_SUCCESS;
 6370|  21.5k|}
isvcd_reset:
 6393|  4.12k|{
 6394|  4.12k|    dec_struct_t *ps_dec;
 6395|  4.12k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 6396|  4.12k|    ivd_ctl_reset_op_t *ps_ctl_op = (ivd_ctl_reset_op_t *) pv_api_op;
 6397|  4.12k|    UWORD8 u1_layer_id;
 6398|  4.12k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6399|  4.12k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6400|  4.12k|    UNUSED(pv_api_ip);
  ------------------
  |  |   45|  4.12k|#define UNUSED(x) ((void)(x))
  ------------------
 6401|  4.12k|    ps_ctl_op->u4_error_code = 0;
 6402|       |
 6403|  4.12k|    ps_svcd_ctxt->i4_eos_flag = 0;
 6404|  4.12k|    ps_svcd_ctxt->u4_num_sps_ctr = 0;
 6405|  4.12k|    ps_svcd_ctxt->u4_num_pps_ctr = 0;
 6406|  4.12k|    ps_svcd_ctxt->u1_pre_parse_in_flush = 1;
 6407|  16.5k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  16.5k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (6407:26): [True: 12.3k, False: 4.12k]
  ------------------
 6408|  12.3k|    {
 6409|  12.3k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 6410|  12.3k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 6411|  12.3k|        if(ps_dec != NULL)
  ------------------
  |  Branch (6411:12): [True: 12.3k, False: 0]
  ------------------
 6412|  12.3k|        {
 6413|  12.3k|            if(((buf_mgr_t *) ps_dec->pv_pic_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (6413:16): [True: 912, False: 11.4k]
  ------------------
 6414|    912|                ih264_buf_mgr_free(ps_dec->pv_pic_buf_mgr);
 6415|  12.3k|            if(((buf_mgr_t *) ps_dec->pv_mv_buf_mgr)->pv_mutex != NULL)
  ------------------
  |  Branch (6415:16): [True: 912, False: 11.4k]
  ------------------
 6416|    912|                ih264_buf_mgr_free(ps_dec->pv_mv_buf_mgr);
 6417|       |
 6418|  12.3k|            isvcd_init_decoder(ps_svc_lyr_dec);
 6419|  12.3k|            ps_dec->u1_flushfrm = 0;
 6420|  12.3k|        }
 6421|      0|        else
 6422|      0|        {
 6423|      0|            H264_DEC_DEBUG_PRINT("\nReset called without Initializing the decoder\n");
  ------------------
  |  |   39|      0|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 6424|      0|            ps_ctl_op->u4_error_code = ERROR_INIT_NOT_DONE;
 6425|      0|        }
 6426|  12.3k|    }
 6427|  4.12k|    return IV_SUCCESS;
 6428|  4.12k|}
isvcd_ctl:
 6451|   111k|{
 6452|   111k|    ivd_ctl_set_config_ip_t *ps_ctl_ip;
 6453|   111k|    ivd_ctl_set_config_op_t *ps_ctl_op;
 6454|   111k|    WORD32 ret = IV_SUCCESS;
 6455|   111k|    UWORD32 subcommand;
 6456|   111k|    dec_struct_t *ps_dec;
 6457|   111k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 6458|   111k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 6459|   111k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 6460|   111k|    ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[ps_svcd_ctxt->u1_target_layer_id];
 6461|   111k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 6462|   111k|    if(ps_dec->init_done != 1)
  ------------------
  |  Branch (6462:8): [True: 0, False: 111k]
  ------------------
 6463|      0|    {
 6464|      0|        return IV_FAIL;
 6465|      0|    }
 6466|   111k|    ps_ctl_ip = (ivd_ctl_set_config_ip_t *) pv_api_ip;
 6467|   111k|    ps_ctl_op = (ivd_ctl_set_config_op_t *) pv_api_op;
 6468|   111k|    ps_ctl_op->u4_error_code = 0;
 6469|   111k|    subcommand = ps_ctl_ip->e_sub_cmd;
 6470|       |
 6471|   111k|    switch(subcommand)
 6472|   111k|    {
 6473|      0|        case IVD_CMD_CTL_GETPARAMS:
  ------------------
  |  Branch (6473:9): [True: 0, False: 111k]
  ------------------
 6474|      0|            ret = isvcd_get_status(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6475|      0|            break;
 6476|  43.0k|        case IVD_CMD_CTL_SETPARAMS:
  ------------------
  |  Branch (6476:9): [True: 43.0k, False: 68.7k]
  ------------------
 6477|  43.0k|            ret = isvcd_set_params(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6478|  43.0k|            break;
 6479|  4.12k|        case IVD_CMD_CTL_RESET:
  ------------------
  |  Branch (6479:9): [True: 4.12k, False: 107k]
  ------------------
 6480|  4.12k|            ret = isvcd_reset(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6481|  4.12k|            break;
 6482|      0|        case IVD_CMD_CTL_SETDEFAULT:
  ------------------
  |  Branch (6482:9): [True: 0, False: 111k]
  ------------------
 6483|      0|            ret = isvcd_set_default_params(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6484|      0|            break;
 6485|      0|        case IVD_CMD_CTL_FLUSH:
  ------------------
  |  Branch (6485:9): [True: 0, False: 111k]
  ------------------
 6486|      0|            ret = isvcd_set_flush_mode(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6487|      0|            break;
 6488|      0|        case IVD_CMD_CTL_GETBUFINFO:
  ------------------
  |  Branch (6488:9): [True: 0, False: 111k]
  ------------------
 6489|      0|            ret = isvcd_get_buf_info(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6490|      0|            break;
 6491|      0|        case IVD_CMD_CTL_GETVERSION:
  ------------------
  |  Branch (6491:9): [True: 0, False: 111k]
  ------------------
 6492|      0|            ret = ih264d_get_version(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6493|      0|            break;
 6494|      0|        case IH264D_CMD_CTL_DEGRADE:
  ------------------
  |  Branch (6494:9): [True: 0, False: 111k]
  ------------------
 6495|      0|            ret = isvcd_set_degrade(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6496|      0|            break;
 6497|       |
 6498|  21.5k|        case IH264D_CMD_CTL_SET_NUM_CORES:
  ------------------
  |  Branch (6498:9): [True: 21.5k, False: 90.2k]
  ------------------
 6499|  21.5k|            ret = isvcd_set_num_cores(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6500|  21.5k|            break;
 6501|      0|        case IH264D_CMD_CTL_GET_BUFFER_DIMENSIONS:
  ------------------
  |  Branch (6501:9): [True: 0, False: 111k]
  ------------------
 6502|      0|            ret = isvcd_get_frame_dimensions(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6503|      0|            break;
 6504|      0|        case IH264D_CMD_CTL_GET_VUI_PARAMS:
  ------------------
  |  Branch (6504:9): [True: 0, False: 111k]
  ------------------
 6505|      0|            ret = isvcd_get_vui_params(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6506|      0|            break;
 6507|      0|        case IH264D_CMD_CTL_GET_SEI_MDCV_PARAMS:
  ------------------
  |  Branch (6507:9): [True: 0, False: 111k]
  ------------------
 6508|      0|            ret = isvcd_get_sei_mdcv_params(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6509|      0|            break;
 6510|      0|        case IH264D_CMD_CTL_GET_SEI_CLL_PARAMS:
  ------------------
  |  Branch (6510:9): [True: 0, False: 111k]
  ------------------
 6511|      0|            ret = isvcd_get_sei_cll_params(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6512|      0|            break;
 6513|      0|        case IH264D_CMD_CTL_GET_SEI_AVE_PARAMS:
  ------------------
  |  Branch (6513:9): [True: 0, False: 111k]
  ------------------
 6514|      0|            ret = isvcd_get_sei_ave_params(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6515|      0|            break;
 6516|      0|        case IH264D_CMD_CTL_GET_SEI_CCV_PARAMS:
  ------------------
  |  Branch (6516:9): [True: 0, False: 111k]
  ------------------
 6517|      0|            ret = isvcd_get_sei_ccv_params(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6518|      0|            break;
 6519|  21.5k|        case IH264D_CMD_CTL_SET_PROCESSOR:
  ------------------
  |  Branch (6519:9): [True: 21.5k, False: 90.2k]
  ------------------
 6520|  21.5k|            ret = isvcd_set_processor(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6521|  21.5k|            break;
 6522|  21.5k|        case ISVCD_CMD_CTL_SET_TGT_LAYER:
  ------------------
  |  Branch (6522:9): [True: 21.5k, False: 90.2k]
  ------------------
 6523|  21.5k|            ret = isvcd_set_target_layer(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 6524|  21.5k|            break;
 6525|      0|        default:
  ------------------
  |  Branch (6525:9): [True: 0, False: 111k]
  ------------------
 6526|      0|            H264_DEC_DEBUG_PRINT("\ndo nothing\n");
  ------------------
  |  |   39|      0|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 6527|      0|            break;
 6528|   111k|    }
 6529|       |
 6530|   111k|    return ret;
 6531|   111k|}
isvcd_set_num_cores:
 7120|  21.5k|{
 7121|  21.5k|    UWORD8 u1_layer_id;
 7122|  21.5k|    isvcd_ctl_set_num_cores_ip_t *ps_ip;
 7123|  21.5k|    isvcd_ctl_set_num_cores_op_t *ps_op;
 7124|  21.5k|    dec_struct_t *ps_dec;
 7125|  21.5k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 7126|  21.5k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 7127|  21.5k|    ps_svcd_ctxt = (svc_dec_ctxt_t *) dec_hdl->pv_codec_handle;
 7128|       |
 7129|  21.5k|    ps_ip = (isvcd_ctl_set_num_cores_ip_t *) pv_api_ip;
 7130|  21.5k|    ps_op = (isvcd_ctl_set_num_cores_op_t *) pv_api_op;
 7131|  21.5k|    ps_op->u4_error_code = 0;
 7132|  86.1k|    for(u1_layer_id = 0; u1_layer_id < MAX_NUM_RES_LYRS; u1_layer_id++)
  ------------------
  |  |   94|  86.1k|#define MAX_NUM_RES_LYRS 3
  ------------------
  |  Branch (7132:26): [True: 64.6k, False: 21.5k]
  ------------------
 7133|  64.6k|    {
 7134|  64.6k|        ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[u1_layer_id];
 7135|  64.6k|        ps_dec = &ps_svc_lyr_dec->s_dec;
 7136|  64.6k|        ps_dec->u4_num_cores = ps_ip->u4_num_cores;
 7137|       |
 7138|  64.6k|        if(ps_dec->u4_num_cores == 1)
  ------------------
  |  Branch (7138:12): [True: 32.0k, False: 32.5k]
  ------------------
 7139|  32.0k|        {
 7140|  32.0k|            ps_dec->u1_separate_parse = 0;
 7141|  32.0k|        }
 7142|  32.5k|        else
 7143|  32.5k|        {
 7144|  32.5k|            ps_dec->u1_separate_parse = 1;
 7145|  32.5k|        }
 7146|       |
 7147|       |        /*using only upto three threads currently*/
 7148|  64.6k|        if(ps_dec->u4_num_cores > 3) ps_dec->u4_num_cores = 3;
  ------------------
  |  Branch (7148:12): [True: 16.7k, False: 47.8k]
  ------------------
 7149|  64.6k|    }
 7150|  21.5k|    return IV_SUCCESS;
 7151|  21.5k|}
isvcd_fill_output_struct_from_context:
 7175|   198k|{
 7176|   198k|    dec_struct_t *ps_dec;
 7177|   198k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 7178|   198k|    if((ps_dec_op->u4_error_code & 0xff) != ERROR_DYNAMIC_RESOLUTION_NOT_SUPPORTED)
  ------------------
  |  Branch (7178:8): [True: 198k, False: 0]
  ------------------
 7179|   198k|    {
 7180|   198k|        ps_dec_op->u4_pic_wd = (UWORD32) ps_dec->u2_disp_width;
 7181|   198k|        ps_dec_op->u4_pic_ht = (UWORD32) ps_dec->u2_disp_height;
 7182|   198k|    }
 7183|   198k|    ps_dec_op->i4_reorder_depth = ps_dec->i4_reorder_depth;
 7184|   198k|    ps_dec_op->i4_display_index = ps_dec->i4_display_index;
 7185|   198k|    ps_dec_op->e_pic_type = ps_dec->i4_frametype;
 7186|       |
 7187|   198k|    ps_dec_op->u4_new_seq = 0;
 7188|   198k|    ps_dec_op->u4_output_present =
 7189|   198k|        (ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) ? ps_dec->u4_output_present : 0;
  ------------------
  |  |  110|   198k|#define TARGET_LAYER 2
  ------------------
  |  Branch (7189:9): [True: 91.4k, False: 107k]
  ------------------
 7190|   198k|    ps_dec_op->u4_progressive_frame_flag = ps_dec->s_disp_op.u4_progressive_frame_flag;
 7191|       |
 7192|   198k|    ps_dec_op->u4_is_ref_flag = 1;
 7193|   198k|    if(ps_dec_op->u4_frame_decoded_flag)
  ------------------
  |  Branch (7193:8): [True: 129k, False: 69.1k]
  ------------------
 7194|   129k|    {
 7195|   129k|        if(ps_dec->ps_cur_slice->u1_nal_ref_idc == 0) ps_dec_op->u4_is_ref_flag = 0;
  ------------------
  |  Branch (7195:12): [True: 17.0k, False: 112k]
  ------------------
 7196|   129k|    }
 7197|       |
 7198|   198k|    ps_dec_op->e_output_format = ps_dec->s_disp_op.e_output_format;
 7199|   198k|    ps_dec_op->s_disp_frm_buf = ps_dec->s_disp_op.s_disp_frm_buf;
 7200|   198k|    ps_dec_op->e4_fld_type = ps_dec->s_disp_op.e4_fld_type;
 7201|   198k|    ps_dec_op->u4_ts = ps_dec->s_disp_op.u4_ts;
 7202|   198k|    ps_dec_op->u4_disp_buf_id = ps_dec->s_disp_op.u4_disp_buf_id;
 7203|       |
 7204|   198k|    ih264d_export_sei_params(&ps_dec_op->s_sei_decode_op, ps_dec);
 7205|   198k|}
isvcd_api_function:
 7228|   894k|{
 7229|   894k|    UWORD32 command;
 7230|   894k|    UWORD32 *pu2_ptr_cmd;
 7231|   894k|    UWORD32 u4_api_ret;
 7232|   894k|    IV_API_CALL_STATUS_T e_status;
 7233|   894k|    e_status = api_check_struct_sanity(dec_hdl, pv_api_ip, pv_api_op);
 7234|       |
 7235|   894k|    if(e_status != IV_SUCCESS)
  ------------------
  |  Branch (7235:8): [True: 1.02k, False: 893k]
  ------------------
 7236|  1.02k|    {
 7237|  1.02k|        UWORD32 *ptr_err;
 7238|       |
 7239|  1.02k|        ptr_err = (UWORD32 *) pv_api_op;
 7240|  1.02k|        UNUSED(ptr_err);
  ------------------
  |  |   45|  1.02k|#define UNUSED(x) ((void)(x))
  ------------------
 7241|  1.02k|        H264_DEC_DEBUG_PRINT("error code = %d\n", *(ptr_err + 1));
  ------------------
  |  |   39|  1.02k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 7242|  1.02k|        return IV_FAIL;
 7243|  1.02k|    }
 7244|       |
 7245|   893k|    pu2_ptr_cmd = (UWORD32 *) pv_api_ip;
 7246|   893k|    pu2_ptr_cmd++;
 7247|       |
 7248|   893k|    command = *pu2_ptr_cmd;
 7249|   893k|    switch(command)
 7250|   893k|    {
 7251|  21.5k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (7251:9): [True: 21.5k, False: 871k]
  ------------------
 7252|  21.5k|            u4_api_ret = isvcd_create(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7253|  21.5k|            break;
 7254|  21.5k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (7254:9): [True: 21.5k, False: 871k]
  ------------------
 7255|  21.5k|            u4_api_ret = isvcd_delete(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7256|  21.5k|            break;
 7257|       |
 7258|   738k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (7258:9): [True: 738k, False: 154k]
  ------------------
 7259|   738k|            u4_api_ret = isvcd_video_decode(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7260|   738k|            break;
 7261|       |
 7262|      0|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (7262:9): [True: 0, False: 893k]
  ------------------
 7263|      0|            u4_api_ret = ih264d_get_display_frame(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7264|       |
 7265|      0|            break;
 7266|       |
 7267|      0|        case IVD_CMD_SET_DISPLAY_FRAME:
  ------------------
  |  Branch (7267:9): [True: 0, False: 893k]
  ------------------
 7268|      0|            u4_api_ret = isvcd_set_display_frame(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7269|       |
 7270|      0|            break;
 7271|       |
 7272|      0|        case IVD_CMD_REL_DISPLAY_FRAME:
  ------------------
  |  Branch (7272:9): [True: 0, False: 893k]
  ------------------
 7273|      0|            u4_api_ret = isvcd_rel_display_frame(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7274|      0|            break;
 7275|       |
 7276|   111k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (7276:9): [True: 111k, False: 781k]
  ------------------
 7277|   111k|            u4_api_ret = isvcd_ctl(dec_hdl, (void *) pv_api_ip, (void *) pv_api_op);
 7278|   111k|            break;
 7279|      0|        default:
  ------------------
  |  Branch (7279:9): [True: 0, False: 893k]
  ------------------
 7280|      0|            u4_api_ret = IV_FAIL;
 7281|      0|            break;
 7282|   893k|    }
 7283|       |
 7284|   893k|    return u4_api_ret;
 7285|   893k|}
isvcd_api.c:api_check_struct_sanity:
  188|   894k|{
  189|   894k|    IVD_API_COMMAND_TYPE_T e_cmd;
  190|   894k|    UWORD32 *pu4_api_ip;
  191|   894k|    UWORD32 *pu4_api_op;
  192|   894k|    UWORD32 i;
  193|       |
  194|   894k|    if(NULL == pv_api_op) return (IV_FAIL);
  ------------------
  |  Branch (194:8): [True: 0, False: 894k]
  ------------------
  195|       |
  196|   894k|    if(NULL == pv_api_ip) return (IV_FAIL);
  ------------------
  |  Branch (196:8): [True: 0, False: 894k]
  ------------------
  197|       |
  198|   894k|    pu4_api_ip = (UWORD32 *) pv_api_ip;
  199|   894k|    pu4_api_op = (UWORD32 *) pv_api_op;
  200|   894k|    e_cmd = *(pu4_api_ip + 1);
  201|       |
  202|       |    /* error checks on handle */
  203|   894k|    switch((WORD32) e_cmd)
  204|   894k|    {
  205|  21.5k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (205:9): [True: 21.5k, False: 872k]
  ------------------
  206|  21.5k|            break;
  207|       |
  208|      0|        case IVD_CMD_REL_DISPLAY_FRAME:
  ------------------
  |  Branch (208:9): [True: 0, False: 894k]
  ------------------
  209|      0|        case IVD_CMD_SET_DISPLAY_FRAME:
  ------------------
  |  Branch (209:9): [True: 0, False: 894k]
  ------------------
  210|      0|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (210:9): [True: 0, False: 894k]
  ------------------
  211|   739k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (211:9): [True: 739k, False: 155k]
  ------------------
  212|   760k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (212:9): [True: 21.5k, False: 872k]
  ------------------
  213|   872k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (213:9): [True: 111k, False: 782k]
  ------------------
  214|   872k|            if(ps_handle == NULL)
  ------------------
  |  Branch (214:16): [True: 1.01k, False: 871k]
  ------------------
  215|  1.01k|            {
  216|  1.01k|                *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  217|  1.01k|                *(pu4_api_op + 1) |= IVD_HANDLE_NULL;
  218|  1.01k|                return IV_FAIL;
  219|  1.01k|            }
  220|       |
  221|   871k|            if(ps_handle->u4_size != sizeof(iv_obj_t))
  ------------------
  |  Branch (221:16): [True: 0, False: 871k]
  ------------------
  222|      0|            {
  223|      0|                *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  224|      0|                *(pu4_api_op + 1) |= IVD_HANDLE_STRUCT_SIZE_INCORRECT;
  225|      0|                return IV_FAIL;
  226|      0|            }
  227|       |
  228|   871k|            if(ps_handle->pv_fxns != isvcd_api_function)
  ------------------
  |  Branch (228:16): [True: 0, False: 871k]
  ------------------
  229|      0|            {
  230|      0|                *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  231|      0|                *(pu4_api_op + 1) |= IVD_INVALID_HANDLE_NULL;
  232|      0|                return IV_FAIL;
  233|      0|            }
  234|       |
  235|   871k|            if(ps_handle->pv_codec_handle == NULL)
  ------------------
  |  Branch (235:16): [True: 0, False: 871k]
  ------------------
  236|      0|            {
  237|      0|                *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  238|      0|                *(pu4_api_op + 1) |= IVD_INVALID_HANDLE_NULL;
  239|      0|                return IV_FAIL;
  240|      0|            }
  241|   871k|            break;
  242|   871k|        default:
  ------------------
  |  Branch (242:9): [True: 0, False: 894k]
  ------------------
  243|      0|            *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  244|      0|            *(pu4_api_op + 1) |= IVD_INVALID_API_CMD;
  245|      0|            return IV_FAIL;
  246|   894k|    }
  247|       |
  248|   893k|    switch((WORD32) e_cmd)
  ------------------
  |  Branch (248:12): [True: 893k, False: 0]
  ------------------
  249|   893k|    {
  250|  21.5k|        case IVD_CMD_CREATE:
  ------------------
  |  Branch (250:9): [True: 21.5k, False: 871k]
  ------------------
  251|  21.5k|        {
  252|  21.5k|            isvcd_create_ip_t *ps_ip = (isvcd_create_ip_t *) pv_api_ip;
  253|  21.5k|            isvcd_create_op_t *ps_op = (isvcd_create_op_t *) pv_api_op;
  254|       |
  255|  21.5k|            ps_op->s_ivd_create_op_t.u4_error_code = 0;
  256|       |
  257|  21.5k|            if((ps_ip->s_ivd_create_ip_t.u4_size > sizeof(isvcd_create_ip_t)) ||
  ------------------
  |  Branch (257:16): [True: 0, False: 21.5k]
  ------------------
  258|  21.5k|               (ps_ip->s_ivd_create_ip_t.u4_size < sizeof(ivd_create_ip_t)))
  ------------------
  |  Branch (258:16): [True: 0, False: 21.5k]
  ------------------
  259|      0|            {
  260|      0|                ps_op->s_ivd_create_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  261|      0|                ps_op->s_ivd_create_op_t.u4_error_code |= IVD_IP_API_STRUCT_SIZE_INCORRECT;
  262|      0|                H264_DEC_DEBUG_PRINT("\n");
  ------------------
  |  |   39|      0|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
  263|      0|                return (IV_FAIL);
  264|      0|            }
  265|       |
  266|  21.5k|            if((ps_op->s_ivd_create_op_t.u4_size != sizeof(isvcd_create_op_t)) &&
  ------------------
  |  Branch (266:16): [True: 0, False: 21.5k]
  ------------------
  267|      0|               (ps_op->s_ivd_create_op_t.u4_size != sizeof(ivd_create_op_t)))
  ------------------
  |  Branch (267:16): [True: 0, False: 0]
  ------------------
  268|      0|            {
  269|      0|                ps_op->s_ivd_create_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  270|      0|                ps_op->s_ivd_create_op_t.u4_error_code |= IVD_OP_API_STRUCT_SIZE_INCORRECT;
  271|      0|                H264_DEC_DEBUG_PRINT("\n");
  ------------------
  |  |   39|      0|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
  272|      0|                return (IV_FAIL);
  273|      0|            }
  274|       |
  275|  21.5k|            if((ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420P) &&
  ------------------
  |  Branch (275:16): [True: 12.3k, False: 9.19k]
  ------------------
  276|  12.3k|               (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_422ILE) &&
  ------------------
  |  Branch (276:16): [True: 12.3k, False: 8]
  ------------------
  277|  12.3k|               (ps_ip->s_ivd_create_ip_t.e_output_format != IV_RGB_565) &&
  ------------------
  |  Branch (277:16): [True: 12.3k, False: 2]
  ------------------
  278|  12.3k|               (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_UV) &&
  ------------------
  |  Branch (278:16): [True: 5.71k, False: 6.64k]
  ------------------
  279|  5.71k|               (ps_ip->s_ivd_create_ip_t.e_output_format != IV_YUV_420SP_VU))
  ------------------
  |  Branch (279:16): [True: 9, False: 5.70k]
  ------------------
  280|      9|            {
  281|      9|                ps_op->s_ivd_create_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  282|      9|                ps_op->s_ivd_create_op_t.u4_error_code |= IVD_INIT_DEC_COL_FMT_NOT_SUPPORTED;
  283|      9|                H264_DEC_DEBUG_PRINT("\n");
  ------------------
  |  |   39|      9|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
  284|      9|                return (IV_FAIL);
  285|      9|            }
  286|  21.5k|        }
  287|  21.5k|        break;
  288|       |
  289|  21.5k|        case IVD_CMD_GET_DISPLAY_FRAME:
  ------------------
  |  Branch (289:9): [True: 0, False: 893k]
  ------------------
  290|      0|        {
  291|      0|            isvcd_get_display_frame_ip_t *ps_ip = (isvcd_get_display_frame_ip_t *) pv_api_ip;
  292|      0|            isvcd_get_display_frame_op_t *ps_op = (isvcd_get_display_frame_op_t *) pv_api_op;
  293|       |
  294|      0|            ps_op->s_ivd_get_display_frame_op_t.u4_error_code = 0;
  295|       |
  296|      0|            if((ps_ip->s_ivd_get_display_frame_ip_t.u4_size !=
  ------------------
  |  Branch (296:16): [True: 0, False: 0]
  ------------------
  297|      0|                sizeof(isvcd_get_display_frame_ip_t)) &&
  298|      0|               (ps_ip->s_ivd_get_display_frame_ip_t.u4_size != sizeof(ivd_get_display_frame_ip_t)))
  ------------------
  |  Branch (298:16): [True: 0, False: 0]
  ------------------
  299|      0|            {
  300|      0|                ps_op->s_ivd_get_display_frame_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  301|      0|                ps_op->s_ivd_get_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_get_display_frame_op_t.u4_size !=
  ------------------
  |  Branch (306:16): [True: 0, False: 0]
  ------------------
  307|      0|                sizeof(isvcd_get_display_frame_op_t)) &&
  308|      0|               (ps_op->s_ivd_get_display_frame_op_t.u4_size != sizeof(ivd_get_display_frame_op_t)))
  ------------------
  |  Branch (308:16): [True: 0, False: 0]
  ------------------
  309|      0|            {
  310|      0|                ps_op->s_ivd_get_display_frame_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  311|      0|                ps_op->s_ivd_get_display_frame_op_t.u4_error_code |=
  312|      0|                    IVD_OP_API_STRUCT_SIZE_INCORRECT;
  313|      0|                return (IV_FAIL);
  314|      0|            }
  315|      0|        }
  316|      0|        break;
  317|       |
  318|      0|        case IVD_CMD_REL_DISPLAY_FRAME:
  ------------------
  |  Branch (318:9): [True: 0, False: 893k]
  ------------------
  319|      0|        {
  320|      0|            isvcd_rel_display_frame_ip_t *ps_ip = (isvcd_rel_display_frame_ip_t *) pv_api_ip;
  321|      0|            isvcd_rel_display_frame_op_t *ps_op = (isvcd_rel_display_frame_op_t *) pv_api_op;
  322|       |
  323|      0|            ps_op->s_ivd_rel_display_frame_op_t.u4_error_code = 0;
  324|       |
  325|      0|            if((ps_ip->s_ivd_rel_display_frame_ip_t.u4_size !=
  ------------------
  |  Branch (325:16): [True: 0, False: 0]
  ------------------
  326|      0|                sizeof(isvcd_rel_display_frame_ip_t)) &&
  327|      0|               (ps_ip->s_ivd_rel_display_frame_ip_t.u4_size != sizeof(ivd_rel_display_frame_ip_t)))
  ------------------
  |  Branch (327:16): [True: 0, False: 0]
  ------------------
  328|      0|            {
  329|      0|                ps_op->s_ivd_rel_display_frame_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  330|      0|                ps_op->s_ivd_rel_display_frame_op_t.u4_error_code |=
  331|      0|                    IVD_IP_API_STRUCT_SIZE_INCORRECT;
  332|      0|                return (IV_FAIL);
  333|      0|            }
  334|       |
  335|      0|            if((ps_op->s_ivd_rel_display_frame_op_t.u4_size !=
  ------------------
  |  Branch (335:16): [True: 0, False: 0]
  ------------------
  336|      0|                sizeof(isvcd_rel_display_frame_op_t)) &&
  337|      0|               (ps_op->s_ivd_rel_display_frame_op_t.u4_size != sizeof(ivd_rel_display_frame_op_t)))
  ------------------
  |  Branch (337:16): [True: 0, False: 0]
  ------------------
  338|      0|            {
  339|      0|                ps_op->s_ivd_rel_display_frame_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  340|      0|                ps_op->s_ivd_rel_display_frame_op_t.u4_error_code |=
  341|      0|                    IVD_OP_API_STRUCT_SIZE_INCORRECT;
  342|      0|                return (IV_FAIL);
  343|      0|            }
  344|      0|        }
  345|      0|        break;
  346|       |
  347|      0|        case IVD_CMD_SET_DISPLAY_FRAME:
  ------------------
  |  Branch (347:9): [True: 0, False: 893k]
  ------------------
  348|      0|        {
  349|      0|            isvcd_set_display_frame_ip_t *ps_ip = (isvcd_set_display_frame_ip_t *) pv_api_ip;
  350|      0|            isvcd_set_display_frame_op_t *ps_op = (isvcd_set_display_frame_op_t *) pv_api_op;
  351|      0|            UWORD32 j;
  352|       |
  353|      0|            ps_op->s_ivd_set_display_frame_op_t.u4_error_code = 0;
  354|       |
  355|      0|            if((ps_ip->s_ivd_set_display_frame_ip_t.u4_size !=
  ------------------
  |  Branch (355:16): [True: 0, False: 0]
  ------------------
  356|      0|                sizeof(isvcd_set_display_frame_ip_t)) &&
  357|      0|               (ps_ip->s_ivd_set_display_frame_ip_t.u4_size != sizeof(ivd_set_display_frame_ip_t)))
  ------------------
  |  Branch (357:16): [True: 0, False: 0]
  ------------------
  358|      0|            {
  359|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  360|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  361|      0|                    IVD_IP_API_STRUCT_SIZE_INCORRECT;
  362|      0|                return (IV_FAIL);
  363|      0|            }
  364|       |
  365|      0|            if((ps_op->s_ivd_set_display_frame_op_t.u4_size !=
  ------------------
  |  Branch (365:16): [True: 0, False: 0]
  ------------------
  366|      0|                sizeof(isvcd_set_display_frame_op_t)) &&
  367|      0|               (ps_op->s_ivd_set_display_frame_op_t.u4_size != sizeof(ivd_set_display_frame_op_t)))
  ------------------
  |  Branch (367:16): [True: 0, False: 0]
  ------------------
  368|      0|            {
  369|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  370|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  371|      0|                    IVD_OP_API_STRUCT_SIZE_INCORRECT;
  372|      0|                return (IV_FAIL);
  373|      0|            }
  374|       |
  375|      0|            if(ps_ip->s_ivd_set_display_frame_ip_t.num_disp_bufs == 0)
  ------------------
  |  Branch (375:16): [True: 0, False: 0]
  ------------------
  376|      0|            {
  377|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  378|      0|                ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= IVD_DISP_FRM_ZERO_OP_BUFS;
  379|      0|                return IV_FAIL;
  380|      0|            }
  381|       |
  382|      0|            for(j = 0; j < ps_ip->s_ivd_set_display_frame_ip_t.num_disp_bufs; j++)
  ------------------
  |  Branch (382:24): [True: 0, False: 0]
  ------------------
  383|      0|            {
  384|      0|                if(ps_ip->s_ivd_set_display_frame_ip_t.s_disp_buffer[j].u4_num_bufs == 0)
  ------------------
  |  Branch (384:20): [True: 0, False: 0]
  ------------------
  385|      0|                {
  386|      0|                    ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  387|      0|                    ps_op->s_ivd_set_display_frame_op_t.u4_error_code |= IVD_DISP_FRM_ZERO_OP_BUFS;
  388|      0|                    return IV_FAIL;
  389|      0|                }
  390|       |
  391|      0|                for(i = 0; i < ps_ip->s_ivd_set_display_frame_ip_t.s_disp_buffer[j].u4_num_bufs;
  ------------------
  |  Branch (391:28): [True: 0, False: 0]
  ------------------
  392|      0|                    i++)
  393|      0|                {
  394|      0|                    if(ps_ip->s_ivd_set_display_frame_ip_t.s_disp_buffer[j].pu1_bufs[i] == NULL)
  ------------------
  |  Branch (394:24): [True: 0, False: 0]
  ------------------
  395|      0|                    {
  396|      0|                        ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  397|      0|                            1 << IVD_UNSUPPORTEDPARAM;
  398|      0|                        ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  399|      0|                            IVD_DISP_FRM_OP_BUF_NULL;
  400|      0|                        return IV_FAIL;
  401|      0|                    }
  402|       |
  403|      0|                    if(ps_ip->s_ivd_set_display_frame_ip_t.s_disp_buffer[j]
  ------------------
  |  Branch (403:24): [True: 0, False: 0]
  ------------------
  404|      0|                           .u4_min_out_buf_size[i] == 0)
  405|      0|                    {
  406|      0|                        ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  407|      0|                            1 << IVD_UNSUPPORTEDPARAM;
  408|      0|                        ps_op->s_ivd_set_display_frame_op_t.u4_error_code |=
  409|      0|                            IVD_DISP_FRM_ZERO_OP_BUF_SIZE;
  410|      0|                        return IV_FAIL;
  411|      0|                    }
  412|      0|                }
  413|      0|            }
  414|      0|        }
  415|      0|        break;
  416|       |
  417|   738k|        case IVD_CMD_VIDEO_DECODE:
  ------------------
  |  Branch (417:9): [True: 738k, False: 154k]
  ------------------
  418|   738k|        {
  419|   738k|            isvcd_video_decode_ip_t *ps_ip = (isvcd_video_decode_ip_t *) pv_api_ip;
  420|   738k|            isvcd_video_decode_op_t *ps_op = (isvcd_video_decode_op_t *) pv_api_op;
  421|       |
  422|   738k|            H264_DEC_DEBUG_PRINT("The input bytes is: %d",
  ------------------
  |  |   39|   738k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
  423|   738k|                                 ps_ip->s_ivd_video_decode_ip_t.u4_num_Bytes);
  424|   738k|            ps_op->s_ivd_video_decode_op_t.u4_error_code = 0;
  425|       |
  426|   738k|            if(ps_ip->s_ivd_video_decode_ip_t.u4_size != sizeof(isvcd_video_decode_ip_t) &&
  ------------------
  |  Branch (426:16): [True: 0, False: 738k]
  ------------------
  427|      0|               ps_ip->s_ivd_video_decode_ip_t.u4_size !=
  ------------------
  |  Branch (427:16): [True: 0, False: 0]
  ------------------
  428|      0|                   offsetof(ivd_video_decode_ip_t, s_out_buffer))
  429|      0|            {
  430|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  431|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |= IVD_IP_API_STRUCT_SIZE_INCORRECT;
  432|      0|                return (IV_FAIL);
  433|      0|            }
  434|       |
  435|   738k|            if(ps_op->s_ivd_video_decode_op_t.u4_size != sizeof(isvcd_video_decode_op_t) &&
  ------------------
  |  Branch (435:16): [True: 0, False: 738k]
  ------------------
  436|      0|               ps_op->s_ivd_video_decode_op_t.u4_size !=
  ------------------
  |  Branch (436:16): [True: 0, False: 0]
  ------------------
  437|      0|                   offsetof(ivd_video_decode_op_t, u4_output_present))
  438|      0|            {
  439|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  440|      0|                ps_op->s_ivd_video_decode_op_t.u4_error_code |= IVD_OP_API_STRUCT_SIZE_INCORRECT;
  441|      0|                return (IV_FAIL);
  442|      0|            }
  443|   738k|            {
  444|   738k|                svc_dec_ctxt_t *ps_svcd_ctxt;
  445|   738k|                svc_dec_lyr_struct_t *ps_svc_lyr_dec;
  446|   738k|                dec_struct_t *ps_dec;
  447|   738k|                ps_svcd_ctxt = (svc_dec_ctxt_t *) (ps_handle->pv_codec_handle);
  448|   738k|                ps_svc_lyr_dec = &ps_svcd_ctxt->ps_svc_dec_lyr[0];
  449|   738k|                ps_dec = &ps_svc_lyr_dec->s_dec;
  450|   738k|                if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (450:20): [True: 0, False: 738k]
  ------------------
  451|      0|                {
  452|      0|                    if(!ps_ip->pu1_8x8_blk_qp_map && !ps_ip->pu1_8x8_blk_type_map)
  ------------------
  |  Branch (452:24): [True: 0, False: 0]
  |  Branch (452:54): [True: 0, False: 0]
  ------------------
  453|      0|                    {
  454|      0|                        ps_op->s_ivd_video_decode_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  455|      0|                        ps_op->s_ivd_video_decode_op_t.u4_error_code |=
  456|      0|                            IH264D_FRAME_INFO_OP_BUF_NULL;
  457|      0|                        return IV_FAIL;
  458|      0|                    }
  459|      0|                }
  460|   738k|            }
  461|   738k|        }
  462|   738k|        break;
  463|       |
  464|   738k|        case IVD_CMD_DELETE:
  ------------------
  |  Branch (464:9): [True: 21.5k, False: 871k]
  ------------------
  465|  21.5k|        {
  466|  21.5k|            isvcd_delete_ip_t *ps_ip = (isvcd_delete_ip_t *) pv_api_ip;
  467|  21.5k|            isvcd_delete_op_t *ps_op = (isvcd_delete_op_t *) pv_api_op;
  468|       |
  469|  21.5k|            ps_op->s_ivd_delete_op_t.u4_error_code = 0;
  470|       |
  471|  21.5k|            if(ps_ip->s_ivd_delete_ip_t.u4_size != sizeof(isvcd_delete_ip_t))
  ------------------
  |  Branch (471:16): [True: 0, False: 21.5k]
  ------------------
  472|      0|            {
  473|      0|                ps_op->s_ivd_delete_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  474|      0|                ps_op->s_ivd_delete_op_t.u4_error_code |= IVD_IP_API_STRUCT_SIZE_INCORRECT;
  475|      0|                return (IV_FAIL);
  476|      0|            }
  477|       |
  478|  21.5k|            if(ps_op->s_ivd_delete_op_t.u4_size != sizeof(isvcd_delete_op_t))
  ------------------
  |  Branch (478:16): [True: 0, False: 21.5k]
  ------------------
  479|      0|            {
  480|      0|                ps_op->s_ivd_delete_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  481|      0|                ps_op->s_ivd_delete_op_t.u4_error_code |= IVD_OP_API_STRUCT_SIZE_INCORRECT;
  482|      0|                return (IV_FAIL);
  483|      0|            }
  484|  21.5k|        }
  485|  21.5k|        break;
  486|       |
  487|   111k|        case IVD_CMD_VIDEO_CTL:
  ------------------
  |  Branch (487:9): [True: 111k, False: 781k]
  ------------------
  488|   111k|        {
  489|   111k|            UWORD32 *pu4_ptr_cmd;
  490|   111k|            UWORD32 sub_command;
  491|       |
  492|   111k|            pu4_ptr_cmd = (UWORD32 *) pv_api_ip;
  493|   111k|            pu4_ptr_cmd += 2;
  494|   111k|            sub_command = *pu4_ptr_cmd;
  495|       |
  496|   111k|            switch(sub_command)
  497|   111k|            {
  498|  43.0k|                case IVD_CMD_CTL_SETPARAMS:
  ------------------
  |  Branch (498:17): [True: 43.0k, False: 68.7k]
  ------------------
  499|  43.0k|                {
  500|  43.0k|                    isvcd_ctl_set_config_ip_t *ps_ip;
  501|  43.0k|                    isvcd_ctl_set_config_op_t *ps_op;
  502|  43.0k|                    ps_ip = (isvcd_ctl_set_config_ip_t *) pv_api_ip;
  503|  43.0k|                    ps_op = (isvcd_ctl_set_config_op_t *) pv_api_op;
  504|       |
  505|  43.0k|                    if(ps_ip->s_ivd_ctl_set_config_ip_t.u4_size !=
  ------------------
  |  Branch (505:24): [True: 0, False: 43.0k]
  ------------------
  506|  43.0k|                       sizeof(isvcd_ctl_set_config_ip_t))
  507|      0|                    {
  508|      0|                        ps_op->s_ivd_ctl_set_config_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  509|      0|                        ps_op->s_ivd_ctl_set_config_op_t.u4_error_code |=
  510|      0|                            IVD_IP_API_STRUCT_SIZE_INCORRECT;
  511|      0|                        return IV_FAIL;
  512|      0|                    }
  513|  43.0k|                }
  514|  43.0k|                break;
  515|       |
  516|  43.0k|                case IVD_CMD_CTL_SETDEFAULT:
  ------------------
  |  Branch (516:17): [True: 0, False: 111k]
  ------------------
  517|      0|                {
  518|      0|                    isvcd_ctl_set_config_op_t *ps_op;
  519|      0|                    ps_op = (isvcd_ctl_set_config_op_t *) pv_api_op;
  520|      0|                    if(ps_op->s_ivd_ctl_set_config_op_t.u4_size !=
  ------------------
  |  Branch (520:24): [True: 0, False: 0]
  ------------------
  521|      0|                       sizeof(isvcd_ctl_set_config_op_t))
  522|      0|                    {
  523|      0|                        ps_op->s_ivd_ctl_set_config_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  524|      0|                        ps_op->s_ivd_ctl_set_config_op_t.u4_error_code |=
  525|      0|                            IVD_OP_API_STRUCT_SIZE_INCORRECT;
  526|      0|                        return IV_FAIL;
  527|      0|                    }
  528|      0|                }
  529|      0|                break;
  530|       |
  531|      0|                case IVD_CMD_CTL_GETPARAMS:
  ------------------
  |  Branch (531:17): [True: 0, False: 111k]
  ------------------
  532|      0|                {
  533|      0|                    isvcd_ctl_getstatus_ip_t *ps_ip;
  534|      0|                    isvcd_ctl_getstatus_op_t *ps_op;
  535|       |
  536|      0|                    ps_ip = (isvcd_ctl_getstatus_ip_t *) pv_api_ip;
  537|      0|                    ps_op = (isvcd_ctl_getstatus_op_t *) pv_api_op;
  538|      0|                    if(ps_ip->s_ivd_ctl_getstatus_ip_t.u4_size != sizeof(isvcd_ctl_getstatus_ip_t))
  ------------------
  |  Branch (538:24): [True: 0, False: 0]
  ------------------
  539|      0|                    {
  540|      0|                        ps_op->s_ivd_ctl_getstatus_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  541|      0|                        ps_op->s_ivd_ctl_getstatus_op_t.u4_error_code |=
  542|      0|                            IVD_IP_API_STRUCT_SIZE_INCORRECT;
  543|      0|                        return IV_FAIL;
  544|      0|                    }
  545|      0|                    if(ps_op->s_ivd_ctl_getstatus_op_t.u4_size != sizeof(isvcd_ctl_getstatus_op_t))
  ------------------
  |  Branch (545:24): [True: 0, False: 0]
  ------------------
  546|      0|                    {
  547|      0|                        ps_op->s_ivd_ctl_getstatus_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  548|      0|                        ps_op->s_ivd_ctl_getstatus_op_t.u4_error_code |=
  549|      0|                            IVD_OP_API_STRUCT_SIZE_INCORRECT;
  550|      0|                        return IV_FAIL;
  551|      0|                    }
  552|      0|                }
  553|      0|                break;
  554|       |
  555|      0|                case IVD_CMD_CTL_GETBUFINFO:
  ------------------
  |  Branch (555:17): [True: 0, False: 111k]
  ------------------
  556|      0|                {
  557|      0|                    isvcd_ctl_getbufinfo_ip_t *ps_ip;
  558|      0|                    isvcd_ctl_getbufinfo_op_t *ps_op;
  559|      0|                    ps_ip = (isvcd_ctl_getbufinfo_ip_t *) pv_api_ip;
  560|      0|                    ps_op = (isvcd_ctl_getbufinfo_op_t *) pv_api_op;
  561|       |
  562|      0|                    if(ps_ip->s_ivd_ctl_getbufinfo_ip_t.u4_size !=
  ------------------
  |  Branch (562:24): [True: 0, False: 0]
  ------------------
  563|      0|                       sizeof(isvcd_ctl_getbufinfo_ip_t))
  564|      0|                    {
  565|      0|                        ps_op->s_ivd_ctl_getbufinfo_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  566|      0|                        ps_op->s_ivd_ctl_getbufinfo_op_t.u4_error_code |=
  567|      0|                            IVD_IP_API_STRUCT_SIZE_INCORRECT;
  568|      0|                        return IV_FAIL;
  569|      0|                    }
  570|      0|                    if(ps_op->s_ivd_ctl_getbufinfo_op_t.u4_size !=
  ------------------
  |  Branch (570:24): [True: 0, False: 0]
  ------------------
  571|      0|                       sizeof(isvcd_ctl_getbufinfo_op_t))
  572|      0|                    {
  573|      0|                        ps_op->s_ivd_ctl_getbufinfo_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  574|      0|                        ps_op->s_ivd_ctl_getbufinfo_op_t.u4_error_code |=
  575|      0|                            IVD_OP_API_STRUCT_SIZE_INCORRECT;
  576|      0|                        return IV_FAIL;
  577|      0|                    }
  578|      0|                }
  579|      0|                break;
  580|       |
  581|      0|                case IVD_CMD_CTL_GETVERSION:
  ------------------
  |  Branch (581:17): [True: 0, False: 111k]
  ------------------
  582|      0|                {
  583|      0|                    isvcd_ctl_getversioninfo_ip_t *ps_ip;
  584|      0|                    isvcd_ctl_getversioninfo_op_t *ps_op;
  585|      0|                    ps_ip = (isvcd_ctl_getversioninfo_ip_t *) pv_api_ip;
  586|      0|                    ps_op = (isvcd_ctl_getversioninfo_op_t *) pv_api_op;
  587|      0|                    if(ps_ip->s_ivd_ctl_getversioninfo_ip_t.u4_size !=
  ------------------
  |  Branch (587:24): [True: 0, False: 0]
  ------------------
  588|      0|                       sizeof(isvcd_ctl_getversioninfo_ip_t))
  589|      0|                    {
  590|      0|                        ps_op->s_ivd_ctl_getversioninfo_op_t.u4_error_code |=
  591|      0|                            1 << IVD_UNSUPPORTEDPARAM;
  592|      0|                        ps_op->s_ivd_ctl_getversioninfo_op_t.u4_error_code |=
  593|      0|                            IVD_IP_API_STRUCT_SIZE_INCORRECT;
  594|      0|                        return IV_FAIL;
  595|      0|                    }
  596|      0|                    if(ps_op->s_ivd_ctl_getversioninfo_op_t.u4_size !=
  ------------------
  |  Branch (596:24): [True: 0, False: 0]
  ------------------
  597|      0|                       sizeof(isvcd_ctl_getversioninfo_op_t))
  598|      0|                    {
  599|      0|                        ps_op->s_ivd_ctl_getversioninfo_op_t.u4_error_code |=
  600|      0|                            1 << IVD_UNSUPPORTEDPARAM;
  601|      0|                        ps_op->s_ivd_ctl_getversioninfo_op_t.u4_error_code |=
  602|      0|                            IVD_OP_API_STRUCT_SIZE_INCORRECT;
  603|      0|                        return IV_FAIL;
  604|      0|                    }
  605|      0|                }
  606|      0|                break;
  607|       |
  608|      0|                case IVD_CMD_CTL_FLUSH:
  ------------------
  |  Branch (608:17): [True: 0, False: 111k]
  ------------------
  609|      0|                {
  610|      0|                    isvcd_ctl_flush_ip_t *ps_ip;
  611|      0|                    isvcd_ctl_flush_op_t *ps_op;
  612|      0|                    ps_ip = (isvcd_ctl_flush_ip_t *) pv_api_ip;
  613|      0|                    ps_op = (isvcd_ctl_flush_op_t *) pv_api_op;
  614|      0|                    if(ps_ip->s_ivd_ctl_flush_ip_t.u4_size != sizeof(isvcd_ctl_flush_ip_t))
  ------------------
  |  Branch (614:24): [True: 0, False: 0]
  ------------------
  615|      0|                    {
  616|      0|                        ps_op->s_ivd_ctl_flush_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  617|      0|                        ps_op->s_ivd_ctl_flush_op_t.u4_error_code |=
  618|      0|                            IVD_IP_API_STRUCT_SIZE_INCORRECT;
  619|      0|                        return IV_FAIL;
  620|      0|                    }
  621|      0|                    if(ps_op->s_ivd_ctl_flush_op_t.u4_size != sizeof(isvcd_ctl_flush_op_t))
  ------------------
  |  Branch (621:24): [True: 0, False: 0]
  ------------------
  622|      0|                    {
  623|      0|                        ps_op->s_ivd_ctl_flush_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  624|      0|                        ps_op->s_ivd_ctl_flush_op_t.u4_error_code |=
  625|      0|                            IVD_OP_API_STRUCT_SIZE_INCORRECT;
  626|      0|                        return IV_FAIL;
  627|      0|                    }
  628|      0|                }
  629|      0|                break;
  630|       |
  631|  4.12k|                case IVD_CMD_CTL_RESET:
  ------------------
  |  Branch (631:17): [True: 4.12k, False: 107k]
  ------------------
  632|  4.12k|                {
  633|  4.12k|                    isvcd_ctl_reset_ip_t *ps_ip;
  634|  4.12k|                    isvcd_ctl_reset_op_t *ps_op;
  635|  4.12k|                    ps_ip = (isvcd_ctl_reset_ip_t *) pv_api_ip;
  636|  4.12k|                    ps_op = (isvcd_ctl_reset_op_t *) pv_api_op;
  637|  4.12k|                    if(ps_ip->s_ivd_ctl_reset_ip_t.u4_size != sizeof(isvcd_ctl_reset_ip_t))
  ------------------
  |  Branch (637:24): [True: 0, False: 4.12k]
  ------------------
  638|      0|                    {
  639|      0|                        ps_op->s_ivd_ctl_reset_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  640|      0|                        ps_op->s_ivd_ctl_reset_op_t.u4_error_code |=
  641|      0|                            IVD_IP_API_STRUCT_SIZE_INCORRECT;
  642|      0|                        return IV_FAIL;
  643|      0|                    }
  644|  4.12k|                    if(ps_op->s_ivd_ctl_reset_op_t.u4_size != sizeof(isvcd_ctl_reset_op_t))
  ------------------
  |  Branch (644:24): [True: 0, False: 4.12k]
  ------------------
  645|      0|                    {
  646|      0|                        ps_op->s_ivd_ctl_reset_op_t.u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  647|      0|                        ps_op->s_ivd_ctl_reset_op_t.u4_error_code |=
  648|      0|                            IVD_OP_API_STRUCT_SIZE_INCORRECT;
  649|      0|                        return IV_FAIL;
  650|      0|                    }
  651|  4.12k|                }
  652|  4.12k|                break;
  653|       |
  654|  4.12k|                case IH264D_CMD_CTL_DEGRADE:
  ------------------
  |  Branch (654:17): [True: 0, False: 111k]
  ------------------
  655|      0|                {
  656|      0|                    isvcd_ctl_degrade_ip_t *ps_ip;
  657|      0|                    isvcd_ctl_degrade_op_t *ps_op;
  658|       |
  659|      0|                    ps_ip = (isvcd_ctl_degrade_ip_t *) pv_api_ip;
  660|      0|                    ps_op = (isvcd_ctl_degrade_op_t *) pv_api_op;
  661|       |
  662|      0|                    if(ps_ip->u4_size != sizeof(isvcd_ctl_degrade_ip_t))
  ------------------
  |  Branch (662:24): [True: 0, False: 0]
  ------------------
  663|      0|                    {
  664|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  665|      0|                        ps_op->u4_error_code |= IVD_IP_API_STRUCT_SIZE_INCORRECT;
  666|      0|                        return IV_FAIL;
  667|      0|                    }
  668|       |
  669|      0|                    if(ps_op->u4_size != sizeof(isvcd_ctl_degrade_op_t))
  ------------------
  |  Branch (669:24): [True: 0, False: 0]
  ------------------
  670|      0|                    {
  671|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  672|      0|                        ps_op->u4_error_code |= IVD_OP_API_STRUCT_SIZE_INCORRECT;
  673|      0|                        return IV_FAIL;
  674|      0|                    }
  675|       |
  676|      0|                    if((ps_ip->i4_degrade_pics < 0) || (ps_ip->i4_degrade_pics > 4) ||
  ------------------
  |  Branch (676:24): [True: 0, False: 0]
  |  Branch (676:56): [True: 0, False: 0]
  ------------------
  677|      0|                       (ps_ip->i4_nondegrade_interval < 0) || (ps_ip->i4_degrade_type < 0) ||
  ------------------
  |  Branch (677:24): [True: 0, False: 0]
  |  Branch (677:63): [True: 0, False: 0]
  ------------------
  678|      0|                       (ps_ip->i4_degrade_type > 15))
  ------------------
  |  Branch (678:24): [True: 0, False: 0]
  ------------------
  679|      0|                    {
  680|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  681|      0|                        return IV_FAIL;
  682|      0|                    }
  683|       |
  684|      0|                    break;
  685|      0|                }
  686|       |
  687|      0|                case IH264D_CMD_CTL_GET_BUFFER_DIMENSIONS:
  ------------------
  |  Branch (687:17): [True: 0, False: 111k]
  ------------------
  688|      0|                {
  689|      0|                    isvcd_ctl_get_frame_dimensions_ip_t *ps_ip;
  690|      0|                    isvcd_ctl_get_frame_dimensions_op_t *ps_op;
  691|       |
  692|      0|                    ps_ip = (isvcd_ctl_get_frame_dimensions_ip_t *) pv_api_ip;
  693|      0|                    ps_op = (isvcd_ctl_get_frame_dimensions_op_t *) pv_api_op;
  694|       |
  695|      0|                    if(ps_ip->u4_size != sizeof(isvcd_ctl_get_frame_dimensions_ip_t))
  ------------------
  |  Branch (695:24): [True: 0, False: 0]
  ------------------
  696|      0|                    {
  697|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  698|      0|                        ps_op->u4_error_code |= IVD_IP_API_STRUCT_SIZE_INCORRECT;
  699|      0|                        return IV_FAIL;
  700|      0|                    }
  701|       |
  702|      0|                    if(ps_op->u4_size != sizeof(isvcd_ctl_get_frame_dimensions_op_t))
  ------------------
  |  Branch (702:24): [True: 0, False: 0]
  ------------------
  703|      0|                    {
  704|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  705|      0|                        ps_op->u4_error_code |= IVD_OP_API_STRUCT_SIZE_INCORRECT;
  706|      0|                        return IV_FAIL;
  707|      0|                    }
  708|       |
  709|      0|                    break;
  710|      0|                }
  711|      0|                case IH264D_CMD_CTL_GET_VUI_PARAMS:
  ------------------
  |  Branch (711:17): [True: 0, False: 111k]
  ------------------
  712|      0|                {
  713|      0|                    isvcd_ctl_get_vui_params_ip_t *ps_ip;
  714|      0|                    isvcd_ctl_get_vui_params_op_t *ps_op;
  715|       |
  716|      0|                    ps_ip = (isvcd_ctl_get_vui_params_ip_t *) pv_api_ip;
  717|      0|                    ps_op = (isvcd_ctl_get_vui_params_op_t *) pv_api_op;
  718|       |
  719|      0|                    if(ps_ip->u4_size != sizeof(isvcd_ctl_get_vui_params_ip_t))
  ------------------
  |  Branch (719:24): [True: 0, False: 0]
  ------------------
  720|      0|                    {
  721|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  722|      0|                        ps_op->u4_error_code |= IVD_IP_API_STRUCT_SIZE_INCORRECT;
  723|      0|                        return IV_FAIL;
  724|      0|                    }
  725|       |
  726|      0|                    if(ps_op->u4_size != sizeof(isvcd_ctl_get_vui_params_op_t))
  ------------------
  |  Branch (726:24): [True: 0, False: 0]
  ------------------
  727|      0|                    {
  728|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  729|      0|                        ps_op->u4_error_code |= IVD_OP_API_STRUCT_SIZE_INCORRECT;
  730|      0|                        return IV_FAIL;
  731|      0|                    }
  732|       |
  733|      0|                    break;
  734|      0|                }
  735|      0|                case IH264D_CMD_CTL_GET_SEI_MDCV_PARAMS:
  ------------------
  |  Branch (735:17): [True: 0, False: 111k]
  ------------------
  736|      0|                {
  737|      0|                    isvcd_ctl_get_sei_mdcv_params_ip_t *ps_ip;
  738|      0|                    isvcd_ctl_get_sei_mdcv_params_op_t *ps_op;
  739|       |
  740|      0|                    ps_ip = (isvcd_ctl_get_sei_mdcv_params_ip_t *) pv_api_ip;
  741|      0|                    ps_op = (isvcd_ctl_get_sei_mdcv_params_op_t *) pv_api_op;
  742|       |
  743|      0|                    if(ps_ip->u4_size != sizeof(isvcd_ctl_get_sei_mdcv_params_ip_t))
  ------------------
  |  Branch (743:24): [True: 0, False: 0]
  ------------------
  744|      0|                    {
  745|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  746|      0|                        ps_op->u4_error_code |= IVD_IP_API_STRUCT_SIZE_INCORRECT;
  747|      0|                        return IV_FAIL;
  748|      0|                    }
  749|       |
  750|      0|                    if(ps_op->u4_size != sizeof(isvcd_ctl_get_sei_mdcv_params_op_t))
  ------------------
  |  Branch (750:24): [True: 0, False: 0]
  ------------------
  751|      0|                    {
  752|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  753|      0|                        ps_op->u4_error_code |= IVD_OP_API_STRUCT_SIZE_INCORRECT;
  754|      0|                        return IV_FAIL;
  755|      0|                    }
  756|       |
  757|      0|                    break;
  758|      0|                }
  759|       |
  760|      0|                case IH264D_CMD_CTL_GET_SEI_CLL_PARAMS:
  ------------------
  |  Branch (760:17): [True: 0, False: 111k]
  ------------------
  761|      0|                {
  762|      0|                    isvcd_ctl_get_sei_cll_params_ip_t *ps_ip;
  763|      0|                    isvcd_ctl_get_sei_cll_params_op_t *ps_op;
  764|       |
  765|      0|                    ps_ip = (isvcd_ctl_get_sei_cll_params_ip_t *) pv_api_ip;
  766|      0|                    ps_op = (isvcd_ctl_get_sei_cll_params_op_t *) pv_api_op;
  767|       |
  768|      0|                    if(ps_ip->u4_size != sizeof(isvcd_ctl_get_sei_cll_params_ip_t))
  ------------------
  |  Branch (768:24): [True: 0, False: 0]
  ------------------
  769|      0|                    {
  770|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  771|      0|                        ps_op->u4_error_code |= IVD_IP_API_STRUCT_SIZE_INCORRECT;
  772|      0|                        return IV_FAIL;
  773|      0|                    }
  774|       |
  775|      0|                    if(ps_op->u4_size != sizeof(isvcd_ctl_get_sei_cll_params_op_t))
  ------------------
  |  Branch (775:24): [True: 0, False: 0]
  ------------------
  776|      0|                    {
  777|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  778|      0|                        ps_op->u4_error_code |= IVD_OP_API_STRUCT_SIZE_INCORRECT;
  779|      0|                        return IV_FAIL;
  780|      0|                    }
  781|       |
  782|      0|                    break;
  783|      0|                }
  784|       |
  785|      0|                case IH264D_CMD_CTL_GET_SEI_AVE_PARAMS:
  ------------------
  |  Branch (785:17): [True: 0, False: 111k]
  ------------------
  786|      0|                {
  787|      0|                    isvcd_ctl_get_sei_ave_params_ip_t *ps_ip;
  788|      0|                    isvcd_ctl_get_sei_ave_params_op_t *ps_op;
  789|       |
  790|      0|                    ps_ip = (isvcd_ctl_get_sei_ave_params_ip_t *) pv_api_ip;
  791|      0|                    ps_op = (isvcd_ctl_get_sei_ave_params_op_t *) pv_api_op;
  792|       |
  793|      0|                    if(ps_ip->u4_size != sizeof(isvcd_ctl_get_sei_ave_params_ip_t))
  ------------------
  |  Branch (793:24): [True: 0, False: 0]
  ------------------
  794|      0|                    {
  795|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  796|      0|                        ps_op->u4_error_code |= IVD_IP_API_STRUCT_SIZE_INCORRECT;
  797|      0|                        return IV_FAIL;
  798|      0|                    }
  799|       |
  800|      0|                    if(ps_op->u4_size != sizeof(isvcd_ctl_get_sei_ave_params_op_t))
  ------------------
  |  Branch (800:24): [True: 0, False: 0]
  ------------------
  801|      0|                    {
  802|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  803|      0|                        ps_op->u4_error_code |= IVD_OP_API_STRUCT_SIZE_INCORRECT;
  804|      0|                        return IV_FAIL;
  805|      0|                    }
  806|       |
  807|      0|                    break;
  808|      0|                }
  809|       |
  810|      0|                case IH264D_CMD_CTL_GET_SEI_CCV_PARAMS:
  ------------------
  |  Branch (810:17): [True: 0, False: 111k]
  ------------------
  811|      0|                {
  812|      0|                    isvcd_ctl_get_sei_ccv_params_ip_t *ps_ip;
  813|      0|                    isvcd_ctl_get_sei_ccv_params_op_t *ps_op;
  814|       |
  815|      0|                    ps_ip = (isvcd_ctl_get_sei_ccv_params_ip_t *) pv_api_ip;
  816|      0|                    ps_op = (isvcd_ctl_get_sei_ccv_params_op_t *) pv_api_op;
  817|       |
  818|      0|                    if(ps_ip->u4_size != sizeof(isvcd_ctl_get_sei_ccv_params_ip_t))
  ------------------
  |  Branch (818:24): [True: 0, False: 0]
  ------------------
  819|      0|                    {
  820|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  821|      0|                        ps_op->u4_error_code |= IVD_IP_API_STRUCT_SIZE_INCORRECT;
  822|      0|                        return IV_FAIL;
  823|      0|                    }
  824|       |
  825|      0|                    if(ps_op->u4_size != sizeof(isvcd_ctl_get_sei_ccv_params_op_t))
  ------------------
  |  Branch (825:24): [True: 0, False: 0]
  ------------------
  826|      0|                    {
  827|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  828|      0|                        ps_op->u4_error_code |= IVD_OP_API_STRUCT_SIZE_INCORRECT;
  829|      0|                        return IV_FAIL;
  830|      0|                    }
  831|       |
  832|      0|                    break;
  833|      0|                }
  834|       |
  835|  21.5k|                case IH264D_CMD_CTL_SET_NUM_CORES:
  ------------------
  |  Branch (835:17): [True: 21.5k, False: 90.2k]
  ------------------
  836|  21.5k|                {
  837|  21.5k|                    isvcd_ctl_set_num_cores_ip_t *ps_ip;
  838|  21.5k|                    isvcd_ctl_set_num_cores_op_t *ps_op;
  839|       |
  840|  21.5k|                    ps_ip = (isvcd_ctl_set_num_cores_ip_t *) pv_api_ip;
  841|  21.5k|                    ps_op = (isvcd_ctl_set_num_cores_op_t *) pv_api_op;
  842|       |
  843|  21.5k|                    if(ps_ip->u4_size != sizeof(isvcd_ctl_set_num_cores_ip_t))
  ------------------
  |  Branch (843:24): [True: 0, False: 21.5k]
  ------------------
  844|      0|                    {
  845|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  846|      0|                        ps_op->u4_error_code |= IVD_IP_API_STRUCT_SIZE_INCORRECT;
  847|      0|                        return IV_FAIL;
  848|      0|                    }
  849|       |
  850|  21.5k|                    if(ps_op->u4_size != sizeof(isvcd_ctl_set_num_cores_op_t))
  ------------------
  |  Branch (850:24): [True: 0, False: 21.5k]
  ------------------
  851|      0|                    {
  852|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  853|      0|                        ps_op->u4_error_code |= IVD_OP_API_STRUCT_SIZE_INCORRECT;
  854|      0|                        return IV_FAIL;
  855|      0|                    }
  856|       |
  857|  21.5k|                    if((ps_ip->u4_num_cores != 1) && (ps_ip->u4_num_cores != 2) &&
  ------------------
  |  Branch (857:24): [True: 10.8k, False: 10.6k]
  |  Branch (857:54): [True: 7.25k, False: 3.59k]
  ------------------
  858|  7.25k|                       (ps_ip->u4_num_cores != 3) && (ps_ip->u4_num_cores != 4))
  ------------------
  |  Branch (858:24): [True: 5.58k, False: 1.67k]
  |  Branch (858:54): [True: 0, False: 5.58k]
  ------------------
  859|      0|                    {
  860|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  861|      0|                        return IV_FAIL;
  862|      0|                    }
  863|  21.5k|                    break;
  864|  21.5k|                }
  865|  21.5k|                case IH264D_CMD_CTL_SET_PROCESSOR:
  ------------------
  |  Branch (865:17): [True: 21.5k, False: 90.2k]
  ------------------
  866|  21.5k|                {
  867|  21.5k|                    isvcd_ctl_set_processor_ip_t *ps_ip;
  868|  21.5k|                    isvcd_ctl_set_processor_op_t *ps_op;
  869|       |
  870|  21.5k|                    ps_ip = (isvcd_ctl_set_processor_ip_t *) pv_api_ip;
  871|  21.5k|                    ps_op = (isvcd_ctl_set_processor_op_t *) pv_api_op;
  872|       |
  873|  21.5k|                    if(ps_ip->u4_size != sizeof(isvcd_ctl_set_processor_ip_t))
  ------------------
  |  Branch (873:24): [True: 0, False: 21.5k]
  ------------------
  874|      0|                    {
  875|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  876|      0|                        ps_op->u4_error_code |= IVD_IP_API_STRUCT_SIZE_INCORRECT;
  877|      0|                        return IV_FAIL;
  878|      0|                    }
  879|       |
  880|  21.5k|                    if(ps_op->u4_size != sizeof(isvcd_ctl_set_processor_op_t))
  ------------------
  |  Branch (880:24): [True: 0, False: 21.5k]
  ------------------
  881|      0|                    {
  882|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  883|      0|                        ps_op->u4_error_code |= IVD_OP_API_STRUCT_SIZE_INCORRECT;
  884|      0|                        return IV_FAIL;
  885|      0|                    }
  886|       |
  887|  21.5k|                    break;
  888|  21.5k|                }
  889|       |
  890|  21.5k|                case ISVCD_CMD_CTL_SET_TGT_LAYER:
  ------------------
  |  Branch (890:17): [True: 21.5k, False: 90.2k]
  ------------------
  891|  21.5k|                {
  892|  21.5k|                    isvcd_set_target_layer_ip_t *ps_ip;
  893|  21.5k|                    isvcd_set_target_layer_op_t *ps_op;
  894|       |
  895|  21.5k|                    ps_ip = (isvcd_set_target_layer_ip_t *) pv_api_ip;
  896|  21.5k|                    ps_op = (isvcd_set_target_layer_op_t *) pv_api_op;
  897|       |
  898|  21.5k|                    if(ps_ip->u4_size != sizeof(isvcd_set_target_layer_ip_t))
  ------------------
  |  Branch (898:24): [True: 0, False: 21.5k]
  ------------------
  899|      0|                    {
  900|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  901|      0|                        ps_op->u4_error_code |= IVD_IP_API_STRUCT_SIZE_INCORRECT;
  902|      0|                        return IV_FAIL;
  903|      0|                    }
  904|       |
  905|  21.5k|                    if(ps_ip->u1_tgt_dep_id > MAX_DEPENDENCY_ID)
  ------------------
  |  |  103|  21.5k|#define MAX_DEPENDENCY_ID 4
  ------------------
  |  Branch (905:24): [True: 0, False: 21.5k]
  ------------------
  906|      0|                    {
  907|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  908|      0|                        return IV_FAIL;
  909|      0|                    }
  910|       |
  911|  21.5k|                    if(ps_ip->u1_tgt_temp_id > MAX_TEMPORAL_ID)
  ------------------
  |  |  104|  21.5k|#define MAX_TEMPORAL_ID 7
  ------------------
  |  Branch (911:24): [True: 0, False: 21.5k]
  ------------------
  912|      0|                    {
  913|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  914|      0|                        return IV_FAIL;
  915|      0|                    }
  916|       |
  917|  21.5k|                    if(ps_ip->u1_tgt_quality_id > MAX_QUALITY_ID)
  ------------------
  |  |  102|  21.5k|#define MAX_QUALITY_ID 0
  ------------------
  |  Branch (917:24): [True: 0, False: 21.5k]
  ------------------
  918|      0|                    {
  919|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  920|      0|                        return IV_FAIL;
  921|      0|                    }
  922|       |
  923|  21.5k|                    if(ps_ip->u1_tgt_priority_id > MAX_PRIORITY_ID)
  ------------------
  |  |  105|  21.5k|#define MAX_PRIORITY_ID 63
  ------------------
  |  Branch (923:24): [True: 0, False: 21.5k]
  ------------------
  924|      0|                    {
  925|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  926|      0|                        return IV_FAIL;
  927|      0|                    }
  928|       |
  929|  21.5k|                    if(ps_op->u4_size != sizeof(isvcd_set_target_layer_op_t))
  ------------------
  |  Branch (929:24): [True: 0, False: 21.5k]
  ------------------
  930|      0|                    {
  931|      0|                        ps_op->u4_error_code |= 1 << IVD_UNSUPPORTEDPARAM;
  932|      0|                        ps_op->u4_error_code |= IVD_OP_API_STRUCT_SIZE_INCORRECT;
  933|      0|                        return IV_FAIL;
  934|      0|                    }
  935|       |
  936|  21.5k|                    break;
  937|  21.5k|                }
  938|       |
  939|  21.5k|                default:
  ------------------
  |  Branch (939:17): [True: 0, False: 111k]
  ------------------
  940|      0|                    *(pu4_api_op + 1) |= 1 << IVD_UNSUPPORTEDPARAM;
  941|      0|                    *(pu4_api_op + 1) |= IVD_UNSUPPORTED_API_CMD;
  942|      0|                    return IV_FAIL;
  943|      0|                    break;
  944|   111k|            }
  945|   111k|        }
  946|   111k|        break;
  947|   893k|    }
  948|       |
  949|   893k|    return IV_SUCCESS;
  950|   893k|}

isvcd_init_cabac_contexts:
   77|  5.52k|{
   78|  5.52k|    bin_ctxt_model_t *p_cabac_ctxt_table_t = ps_dec->p_cabac_ctxt_table_t;
   79|  5.52k|    UWORD8 u1_qp_y = ps_dec->ps_cur_slice->u1_slice_qp;
   80|  5.52k|    UWORD8 u1_cabac_init_Idc = 0;
   81|       |
   82|  5.52k|    if(I_SLICE != u1_slice_type)
  ------------------
  |  |  370|  5.52k|#define I_SLICE  2
  ------------------
  |  Branch (82:8): [True: 4.43k, False: 1.09k]
  ------------------
   83|  4.43k|    {
   84|  4.43k|        u1_cabac_init_Idc = ps_dec->ps_cur_slice->u1_cabac_init_idc;
   85|  4.43k|    }
   86|       |
   87|  5.52k|    {
   88|       |        /* MAKING ps_dec->p_ctxt_inc_mb_map a scratch buffer */
   89|       |        /* 0th entry of CtxtIncMbMap will be always be containing default values
   90|       |         for CABAC context representing MB not available */
   91|  5.52k|        ctxt_inc_mb_info_t *p_DefCtxt = ps_dec->p_ctxt_inc_mb_map - 1;
   92|  5.52k|        UWORD8 *pu1_temp;
   93|  5.52k|        WORD8 i;
   94|  5.52k|        p_DefCtxt->u1_mb_type = CAB_SKIP;
  ------------------
  |  |  402|  5.52k|#define CAB_SKIP          0x10 /* 0001 0000 */
  ------------------
   95|  5.52k|        p_DefCtxt->u1_cbp = 0x0f;
   96|  5.52k|        p_DefCtxt->u1_intra_chroma_pred_mode = 0;
   97|  5.52k|        p_DefCtxt->u1_yuv_dc_csbp = 0x7;
   98|  5.52k|        p_DefCtxt->u1_transform8x8_ctxt = 0;
   99|       |
  100|  5.52k|        pu1_temp = (UWORD8 *) p_DefCtxt->i1_ref_idx;
  101|  27.6k|        for(i = 0; i < 4; i++, pu1_temp++) (*pu1_temp) = 0;
  ------------------
  |  Branch (101:20): [True: 22.1k, False: 5.52k]
  ------------------
  102|  5.52k|        pu1_temp = (UWORD8 *) p_DefCtxt->u1_mv;
  103|  93.9k|        for(i = 0; i < 16; i++, pu1_temp++) (*pu1_temp) = 0;
  ------------------
  |  Branch (103:20): [True: 88.4k, False: 5.52k]
  ------------------
  104|  5.52k|        ps_dec->ps_def_ctxt_mb_info = p_DefCtxt;
  105|  5.52k|    }
  106|       |
  107|  5.52k|    if(u1_slice_type == I_SLICE)
  ------------------
  |  |  370|  5.52k|#define I_SLICE  2
  ------------------
  |  Branch (107:8): [True: 1.09k, False: 4.43k]
  ------------------
  108|  1.09k|    {
  109|  1.09k|        u1_cabac_init_Idc = 3;
  110|  1.09k|        ps_dec->p_mb_type_t = p_cabac_ctxt_table_t + MB_TYPE_I_SLICE;
  111|  1.09k|    }
  112|  4.43k|    else if(u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  4.43k|#define P_SLICE  0
  ------------------
  |  Branch (112:13): [True: 2.22k, False: 2.20k]
  ------------------
  113|  2.22k|    {
  114|  2.22k|        ps_dec->p_mb_type_t = p_cabac_ctxt_table_t + MB_TYPE_P_SLICE;
  115|  2.22k|        ps_dec->p_mb_skip_flag_t = p_cabac_ctxt_table_t + MB_SKIP_FLAG_P_SLICE;
  116|  2.22k|        ps_dec->p_sub_mb_type_t = p_cabac_ctxt_table_t + SUB_MB_TYPE_P_SLICE;
  117|  2.22k|    }
  118|  2.20k|    else if(u1_slice_type == B_SLICE)
  ------------------
  |  |  369|  2.20k|#define B_SLICE  1
  ------------------
  |  Branch (118:13): [True: 2.20k, False: 0]
  ------------------
  119|  2.20k|    {
  120|  2.20k|        ps_dec->p_mb_type_t = p_cabac_ctxt_table_t + MB_TYPE_B_SLICE;
  121|  2.20k|        ps_dec->p_mb_skip_flag_t = p_cabac_ctxt_table_t + MB_SKIP_FLAG_B_SLICE;
  122|  2.20k|        ps_dec->p_sub_mb_type_t = p_cabac_ctxt_table_t + SUB_MB_TYPE_B_SLICE;
  123|  2.20k|    }
  124|  5.52k|    {
  125|  5.52k|        bin_ctxt_model_t *p_cabac_ctxt_table_t_tmp = p_cabac_ctxt_table_t;
  126|  5.52k|        if(ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (126:12): [True: 0, False: 5.52k]
  ------------------
  127|      0|        {
  128|      0|            p_cabac_ctxt_table_t_tmp += SIGNIFICANT_COEFF_FLAG_FLD;
  129|      0|        }
  130|  5.52k|        else
  131|  5.52k|        {
  132|  5.52k|            p_cabac_ctxt_table_t_tmp += SIGNIFICANT_COEFF_FLAG_FRAME;
  133|  5.52k|        }
  134|  5.52k|        {
  135|  5.52k|            bin_ctxt_model_t **p_significant_coeff_flag_t = ps_dec->p_significant_coeff_flag_t;
  136|  5.52k|            p_significant_coeff_flag_t[0] = p_cabac_ctxt_table_t_tmp + SIG_COEFF_CTXT_CAT_0_OFFSET;
  137|  5.52k|            p_significant_coeff_flag_t[1] = p_cabac_ctxt_table_t_tmp + SIG_COEFF_CTXT_CAT_1_OFFSET;
  138|  5.52k|            p_significant_coeff_flag_t[2] = p_cabac_ctxt_table_t_tmp + SIG_COEFF_CTXT_CAT_2_OFFSET;
  139|  5.52k|            p_significant_coeff_flag_t[3] = p_cabac_ctxt_table_t_tmp + SIG_COEFF_CTXT_CAT_3_OFFSET;
  140|  5.52k|            p_significant_coeff_flag_t[4] = p_cabac_ctxt_table_t_tmp + SIG_COEFF_CTXT_CAT_4_OFFSET;
  141|       |
  142|  5.52k|            p_significant_coeff_flag_t[5] = p_cabac_ctxt_table_t_tmp + SIG_COEFF_CTXT_CAT_5_OFFSET;
  143|  5.52k|        }
  144|  5.52k|    }
  145|       |
  146|  5.52k|    memcpy(p_cabac_ctxt_table_t, gau1_isvcd_cabac_ctxt_init_table[u1_cabac_init_Idc][u1_qp_y],
  147|  5.52k|           NUM_CABAC_CTXTS_SVC * sizeof(bin_ctxt_model_t));
  ------------------
  |  |   46|  5.52k|#define NUM_CABAC_CTXTS_SVC 467
  ------------------
  148|  5.52k|}

isvcd_deblk_extract_bit_flags:
   65|  59.8k|{
   66|  59.8k|    WORD32 i4_i;
   67|  59.8k|    WORD32 i4_bit_mask;
   68|  59.8k|    UWORD16 u2_result = 0;
   69|       |
   70|  59.8k|    i4_bit_mask = i4_initial_bit_mask;
   71|       |
   72|   299k|    for(i4_i = 0; i4_i < NUM_SUB_MB_PARTS; i4_i++)
  ------------------
  |  |   60|   299k|#define NUM_SUB_MB_PARTS 4
  ------------------
  |  Branch (72:19): [True: 239k, False: 59.8k]
  ------------------
   73|   239k|    {
   74|   239k|        WORD32 i4_bit;
   75|       |        /* extract the bits of the last column 4x4 blocks */
   76|   239k|        if(0 == (i4_bit_mask & u2_bit_field))
  ------------------
  |  Branch (76:12): [True: 229k, False: 10.0k]
  ------------------
   77|   229k|        {
   78|   229k|            i4_bit = 0;
   79|   229k|        }
   80|  10.0k|        else
   81|  10.0k|        {
   82|  10.0k|            i4_bit = 1;
   83|  10.0k|        }
   84|       |        /* store the result */
   85|   239k|        u2_result |= i4_bit << i4_i;
   86|   239k|        i4_bit_mask <<= 4;
   87|       |
   88|   239k|    } /* end of loop over num sub Mb parts */
   89|  59.8k|    return (u2_result);
   90|  59.8k|}
isvcd_fill_bs_ibl:
   96|  1.14M|{
   97|       |    /*! Flow of the module is as follows                                  */
   98|       |    /*! 1. checks if MB edge is falling on IBL boundary                   */
   99|       |    /*! 2. if only Mb edge then it fills the BS based on INTRA or INTER
  100|       |           stauts                                                         */
  101|       |    /*! 3. if the current MB is IBL and neighbours are also neighbours
  102|       |           then it uses the current layer t_coeff flag to decide the
  103|       |           BS of a particular edge                                        */
  104|       |    /*!4. fills the BS for all the edges in curretn MB if IBL             */
  105|       |
  106|  1.14M|    UWORD16 u2_top_horz_nnz;
  107|  1.14M|    UWORD8 u1_top_mb_ibl, u1_left_mb_ibl;
  108|  1.14M|    UWORD32 i4_i, i4_edge;
  109|  1.14M|    UWORD8 u1_bs;
  110|  1.14M|    UWORD8 u1_cnd;
  111|  1.14M|    UWORD8 u1_top_intra;
  112|  1.14M|    UWORD8 u1_left_intra;
  113|  1.14M|    UWORD8 u1_p_nnz, u1_q_nnz;
  114|  1.14M|    UWORD8 u1_curr_mb_ibl;
  115|  1.14M|    UWORD32 *pu4_bs_table;
  116|  1.14M|    UWORD16 u2_curr_nnz;
  117|  1.14M|    UWORD8 u1_left_mb_nnz = 0, u1_left_nnz;
  118|  1.14M|    WORD32 i4_horz_start = 0;
  119|  1.14M|    WORD32 i4_vertical_start = 0;
  120|       |
  121|  1.14M|    pu4_bs_table = &(ps_deblk_mb->u4_bs_table[0]);
  122|       |
  123|  1.14M|    u1_top_mb_ibl = u1_top_mb_type & D_INTRA_IBL;
  ------------------
  |  |   72|  1.14M|#define D_INTRA_IBL 16
  ------------------
  124|  1.14M|    u1_left_mb_ibl = u1_left_mb_type & D_INTRA_IBL;
  ------------------
  |  |   72|  1.14M|#define D_INTRA_IBL 16
  ------------------
  125|       |
  126|  1.14M|    u1_curr_mb_ibl = ps_deblk_mb->u1_mb_type & D_INTRA_IBL;
  ------------------
  |  |   72|  1.14M|#define D_INTRA_IBL 16
  ------------------
  127|       |
  128|  1.14M|    u1_top_intra = u1_top_mb_type & D_INTRA_MB;
  ------------------
  |  |  382|  1.14M|#define D_INTRA_MB        1
  ------------------
  129|  1.14M|    u1_left_intra = u1_left_mb_type & D_INTRA_MB;
  ------------------
  |  |  382|  1.14M|#define D_INTRA_MB        1
  ------------------
  130|       |
  131|       |    /* return if none of the current top and left is IBL */
  132|  1.14M|    if((0 == u1_curr_mb_ibl) && (0 == u1_top_mb_ibl) && (0 == u1_left_mb_ibl))
  ------------------
  |  Branch (132:8): [True: 1.09M, False: 47.7k]
  |  Branch (132:33): [True: 1.08M, False: 8.36k]
  |  Branch (132:57): [True: 1.08M, False: 3.72k]
  ------------------
  133|  1.08M|    {
  134|  1.08M|        return;
  135|  1.08M|    }
  136|       |
  137|       |    /* set up the vertical and horz MB edge skip flags */
  138|  59.8k|    if(0 != u1_curr_mb_ibl)
  ------------------
  |  Branch (138:8): [True: 47.7k, False: 12.0k]
  ------------------
  139|  47.7k|    {
  140|       |        /* if top is not IBL */
  141|  47.7k|        if(0 == u1_top_mb_ibl)
  ------------------
  |  Branch (141:12): [True: 17.8k, False: 29.8k]
  ------------------
  142|  17.8k|        {
  143|  17.8k|            i4_horz_start = 1;
  144|  17.8k|        }
  145|       |
  146|       |        /* if left in not IBL */
  147|  47.7k|        if(0 == u1_left_mb_ibl)
  ------------------
  |  Branch (147:12): [True: 21.7k, False: 26.0k]
  ------------------
  148|  21.7k|        {
  149|  21.7k|            i4_vertical_start = 1;
  150|  21.7k|        }
  151|  47.7k|    }
  152|       |
  153|       |    /*******************************************************/
  154|       |    /* Fill BS for mb egdex assuming non IBL case          */
  155|       |    /*******************************************************/
  156|       |
  157|       |    /* only the  MB edges fall across IBL boundary */
  158|  59.8k|    if((0 != u1_curr_mb_ibl) || (0 != u1_top_mb_ibl) || (0 != u1_left_mb_ibl))
  ------------------
  |  Branch (158:8): [True: 47.7k, False: 12.0k]
  |  Branch (158:33): [True: 8.36k, False: 3.72k]
  |  Branch (158:57): [True: 3.72k, False: 0]
  ------------------
  159|  59.8k|    {
  160|  59.8k|        UWORD16 u2_temp, u2_i;
  161|  59.8k|        u2_temp = *pu2_left_res_luma_csbp;
  162|   299k|        for(u2_i = 0; u2_i < 4; u2_i++)
  ------------------
  |  Branch (162:23): [True: 239k, False: 59.8k]
  ------------------
  163|   239k|        {
  164|   239k|            u1_left_mb_nnz |= ((u2_temp & 0x08) >> (3 - u2_i));
  165|   239k|            u2_temp >>= 4;
  166|   239k|        }
  167|  59.8k|        u2_curr_nnz = *pu2_curr_res_luma_csbp;
  168|  59.8k|        u2_top_horz_nnz = *pu2_top_res_luma_csbp >> 12;
  169|       |
  170|       |        /* top is intra and not ibl */
  171|  59.8k|        if(0 != u1_top_intra)
  ------------------
  |  Branch (171:12): [True: 3.36k, False: 56.4k]
  ------------------
  172|  3.36k|        {
  173|  3.36k|            pu4_bs_table[0] = 0x04040404;
  174|  3.36k|        }
  175|       |        /* left is intra and not ibl */
  176|  59.8k|        if(0 != u1_left_intra)
  ------------------
  |  Branch (176:12): [True: 2.77k, False: 57.0k]
  ------------------
  177|  2.77k|        {
  178|  2.77k|            pu4_bs_table[4] = 0x04040404;
  179|  2.77k|        }
  180|       |
  181|       |        /* assume neighbours are inter and update bs */
  182|       |
  183|       |        /* Edge = 0 means Vert Edges and Edge = 1 means Horz edges */
  184|   179k|        for(i4_edge = 0; i4_edge < 2; i4_edge++)
  ------------------
  |  Branch (184:26): [True: 119k, False: 59.8k]
  ------------------
  185|   119k|        {
  186|   119k|            UWORD8 u1_p_nnz, u1_q_nnz;
  187|   119k|            UWORD32 u4_bs_edge = 0;
  188|   119k|            WORD32 i4_bit_mask;
  189|   119k|            WORD32 i4_curr_intra_flag;
  190|   119k|            WORD32 i4_neibor_intra_flag;
  191|       |
  192|   119k|            i4_curr_intra_flag = (0 != u1_curr_mb_ibl);
  193|       |
  194|   119k|            if(0 != i4_edge)
  ------------------
  |  Branch (194:16): [True: 59.8k, False: 59.8k]
  ------------------
  195|  59.8k|            {
  196|       |                /* Initialize for the TOP edge */
  197|  59.8k|                u1_p_nnz = (UWORD8) u2_top_horz_nnz;
  198|  59.8k|                u1_q_nnz = (UWORD8) (u2_curr_nnz & g_au4_extract_set[0]);
  199|  59.8k|                i4_neibor_intra_flag = (u1_top_mb_ibl || u1_top_intra);
  ------------------
  |  Branch (199:41): [True: 38.2k, False: 21.5k]
  |  Branch (199:58): [True: 3.36k, False: 18.2k]
  ------------------
  200|  59.8k|            }
  201|  59.8k|            else
  202|  59.8k|            {
  203|  59.8k|                u1_p_nnz = u1_left_mb_nnz;
  204|  59.8k|                u1_q_nnz = (UWORD8) isvcd_deblk_extract_bit_flags(u2_curr_nnz, 0x01);
  205|  59.8k|                i4_neibor_intra_flag = (u1_left_mb_ibl || u1_left_intra);
  ------------------
  |  Branch (205:41): [True: 30.7k, False: 29.1k]
  |  Branch (205:59): [True: 2.77k, False: 26.3k]
  ------------------
  206|  59.8k|            }
  207|       |
  208|   119k|            i4_bit_mask = 1;
  209|       |            /* find bs of 4 edges */
  210|   598k|            for(i4_i = 0; i4_i < 4; i4_i++)
  ------------------
  |  Branch (210:27): [True: 478k, False: 119k]
  ------------------
  211|   478k|            {
  212|   478k|                UWORD8 u1_p_nnz_temp, u1_q_nnz_temp;
  213|       |
  214|   478k|                u1_p_nnz_temp = (u1_p_nnz & i4_bit_mask);
  215|   478k|                u1_q_nnz_temp = (u1_q_nnz & i4_bit_mask);
  216|       |
  217|   478k|                u1_cnd = ((u1_p_nnz_temp && (!i4_neibor_intra_flag)) ||
  ------------------
  |  Branch (217:28): [True: 8.33k, False: 470k]
  |  Branch (217:45): [True: 4.03k, False: 4.29k]
  ------------------
  218|   474k|                          (u1_q_nnz_temp && (!i4_curr_intra_flag)));
  ------------------
  |  Branch (218:28): [True: 16.0k, False: 458k]
  |  Branch (218:45): [True: 1.50k, False: 14.4k]
  ------------------
  219|       |
  220|   478k|                u1_bs = u1_cnd ? 2 : 1;
  ------------------
  |  Branch (220:25): [True: 5.54k, False: 473k]
  ------------------
  221|       |
  222|       |                /* update the bs of the edge */
  223|   478k|                u4_bs_edge = (u4_bs_edge << 8) + u1_bs;
  224|   478k|                i4_bit_mask <<= 1;
  225|       |
  226|   478k|            } /* end of loop over blk edges */
  227|       |
  228|       |            /* update the bs of edges */
  229|   119k|            if(i4_edge && !u1_top_intra)
  ------------------
  |  Branch (229:16): [True: 59.8k, False: 59.8k]
  |  Branch (229:27): [True: 56.4k, False: 3.36k]
  ------------------
  230|  56.4k|            {
  231|  56.4k|                pu4_bs_table[0] = u4_bs_edge;
  232|  56.4k|            }
  233|  63.1k|            else if(!i4_edge && !u1_left_intra)
  ------------------
  |  Branch (233:21): [True: 59.8k, False: 3.36k]
  |  Branch (233:33): [True: 57.0k, False: 2.77k]
  ------------------
  234|  57.0k|            {
  235|  57.0k|                pu4_bs_table[4] = u4_bs_edge;
  236|  57.0k|            }
  237|   119k|        } /* end of loop over v1 vetical and horizontal edge */
  238|  59.8k|    }
  239|       |    /* current MB is IBL */
  240|  59.8k|    if(0 != u1_curr_mb_ibl)
  ------------------
  |  Branch (240:8): [True: 47.7k, False: 12.0k]
  ------------------
  241|  47.7k|    {
  242|  47.7k|        UWORD16 u2_temp, u2_i;
  243|  47.7k|        WORD32 i4_bit_mask_edge = 1;
  244|       |
  245|  47.7k|        u1_left_mb_nnz = 0;
  246|  47.7k|        u2_temp = ps_cur_mb_info->ps_left_mb->u2_luma_csbp;
  247|   238k|        for(u2_i = 0; u2_i < 4; u2_i++)
  ------------------
  |  Branch (247:23): [True: 190k, False: 47.7k]
  ------------------
  248|   190k|        {
  249|   190k|            u1_left_mb_nnz |= ((u2_temp & 0x08) >> (3 - u2_i));
  250|   190k|            u2_temp >>= 4;
  251|   190k|        }
  252|  47.7k|        u2_curr_nnz = ps_cur_mb_info->ps_curmb->u2_luma_csbp;
  253|  47.7k|        u2_top_horz_nnz = ps_cur_mb_info->ps_top_mb->u2_luma_csbp >> 12;
  254|       |        /* all are IBL edges then use only t_coeff of current layer*/
  255|       |        /* loop over all edges */
  256|   238k|        for(i4_edge = 0; i4_edge < 4; i4_edge++)
  ------------------
  |  Branch (256:26): [True: 190k, False: 47.7k]
  ------------------
  257|   190k|        {
  258|   190k|            UWORD16 u2_curr_horz_nnz = 0;
  259|   190k|            WORD32 i4_bit_mask = 1;
  260|       |
  261|   190k|            u2_curr_horz_nnz = u2_curr_nnz & g_au4_extract_set[i4_edge];
  262|       |
  263|   190k|            u2_curr_horz_nnz = (u2_curr_horz_nnz >> (i4_edge * 4));
  264|       |
  265|   190k|            u1_left_nnz = (u1_left_mb_nnz & i4_bit_mask_edge);
  266|       |
  267|   954k|            for(i4_i = 0; i4_i < 4; i4_i++)
  ------------------
  |  Branch (267:27): [True: 763k, False: 190k]
  ------------------
  268|   763k|            {
  269|   763k|                UWORD8 u1_curr_nnz, u1_top_nnz;
  270|       |
  271|   763k|                u1_curr_nnz = (u2_curr_horz_nnz & i4_bit_mask);
  272|   763k|                u1_top_nnz = (u2_top_horz_nnz & i4_bit_mask);
  273|       |                /* update bs horizontal */
  274|       |
  275|   763k|                if(!((1 == i4_horz_start) && (0 == i4_edge)))
  ------------------
  |  Branch (275:22): [True: 285k, False: 478k]
  |  Branch (275:46): [True: 71.4k, False: 214k]
  ------------------
  276|   692k|                {
  277|   692k|                    u1_p_nnz = u1_top_nnz;
  278|   692k|                    u1_q_nnz = u1_curr_nnz;
  279|   692k|                    u1_cnd = !(u1_p_nnz || u1_q_nnz);
  ------------------
  |  Branch (279:32): [True: 25.9k, False: 666k]
  |  Branch (279:44): [True: 4.17k, False: 662k]
  ------------------
  280|   692k|                    u1_bs = u1_cnd ? 0 : 1;
  ------------------
  |  Branch (280:29): [True: 662k, False: 30.0k]
  ------------------
  281|   692k|                    pu4_bs_table[i4_edge] = (pu4_bs_table[i4_edge] << 8) + u1_bs;
  282|   692k|                }
  283|       |
  284|       |                /* update bs vertical */
  285|   763k|                if(!((1 == i4_vertical_start) && (0 == i4_i)))
  ------------------
  |  Branch (285:22): [True: 347k, False: 416k]
  |  Branch (285:50): [True: 86.9k, False: 260k]
  ------------------
  286|   676k|                {
  287|   676k|                    u1_p_nnz = u1_left_nnz;
  288|   676k|                    u1_q_nnz = u1_curr_nnz;
  289|   676k|                    u1_cnd = !(u1_p_nnz || u1_q_nnz);
  ------------------
  |  Branch (289:32): [True: 25.9k, False: 650k]
  |  Branch (289:44): [True: 2.52k, False: 648k]
  ------------------
  290|   676k|                    u1_bs = u1_cnd ? 0 : 1;
  ------------------
  |  Branch (290:29): [True: 648k, False: 28.5k]
  ------------------
  291|   676k|                    pu4_bs_table[i4_i + 4] = (pu4_bs_table[i4_i + 4] << 8) + u1_bs;
  292|   676k|                }
  293|       |                /* store the current nnz to left nnz */
  294|   763k|                u1_left_nnz = u1_curr_nnz;
  295|   763k|                i4_bit_mask <<= 1;
  296|   763k|            }
  297|       |            /* store the current row nnz to top row nnz */
  298|   190k|            u2_top_horz_nnz = u2_curr_horz_nnz;
  299|   190k|            i4_bit_mask_edge <<= 1;
  300|   190k|        }
  301|  47.7k|    }
  302|  59.8k|    return;
  303|  1.14M|}
isvcd_compute_bs_non_mbaff_target_lyr_no_inter_layer:
  327|  94.1k|{
  328|  94.1k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  329|       |    /* Mvpred and Nnz for top and Courrent */
  330|  94.1k|    mv_pred_t *ps_cur_mv_pred, *ps_top_mv_pred = NULL, *ps_left_mv_pred;
  331|       |    /* deblk_mb_t Params */
  332|  94.1k|    deblk_mb_t *ps_cur_mb_params; /*< Parameters of current MacroBlock */
  333|  94.1k|    deblkmb_neighbour_t *ps_deblk_top_mb;
  334|       |
  335|       |    /* Reference Index to POC mapping*/
  336|  94.1k|    void **apv_map_ref_idx_to_poc;
  337|  94.1k|    UWORD32 u4_leftmbtype;
  338|       |
  339|  94.1k|    UWORD16 u2_left_csbp, u2_top_csbp, u2_cur_csbp;
  340|       |
  341|       |    /* Set of flags */
  342|  94.1k|    UWORD32 u4_cur_mb_intra, u1_top_mb_typ, u4_cur_mb_fld;
  343|  94.1k|    UWORD32 u1_cur_mb_type;
  344|  94.1k|    UWORD32 *pu4_bs_table;
  345|       |
  346|       |    /* Neighbour availability */
  347|       |    /* Initialization */
  348|  94.1k|    const UWORD32 u2_mbx = ps_cur_mb_info->u2_mbx;
  349|  94.1k|    const UWORD32 u2_mby = ps_cur_mb_info->u2_mby;
  350|  94.1k|    const UWORD32 u1_pingpong = u2_mbx & 0x01;
  351|       |
  352|  94.1k|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  94.1k|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  353|       |
  354|  94.1k|    ps_deblk_top_mb = ps_dec->ps_deblk_top_mb + u2_mbx;
  355|       |
  356|       |    /* Pointer assignment for Current DeblkMB, Current Mv Pred  */
  357|  94.1k|    ps_cur_mb_params = ps_dec->ps_deblk_mbn + u2_mbxn_mb;
  358|  94.1k|    ps_cur_mv_pred = ps_dec->ps_mv_cur + (u2_mbxn_mb << 4);
  359|       |
  360|  94.1k|    apv_map_ref_idx_to_poc = ps_dec->ppv_map_ref_idx_to_poc + 1;
  361|  94.1k|    u1_cur_mb_type = ps_cur_mb_params->u1_mb_type;
  362|  94.1k|    u1_top_mb_typ = ps_deblk_top_mb->u1_mb_type;
  363|  94.1k|    ps_deblk_top_mb->u1_mb_type = u1_cur_mb_type;
  364|       |
  365|  94.1k|    ps_cur_mb_params->u1_topmb_qp = ps_deblk_top_mb->u1_mb_qp;
  366|  94.1k|    ps_deblk_top_mb->u1_mb_qp = ps_cur_mb_params->u1_mb_qp;
  367|  94.1k|    ps_cur_mb_params->u1_left_mb_qp = ps_dec->deblk_left_mb[1].u1_mb_qp;
  368|  94.1k|    ps_dec->deblk_left_mb[1].u1_mb_qp = ps_cur_mb_params->u1_mb_qp;
  369|       |
  370|       |    /* if no deblocking required for current Mb then continue */
  371|       |    /* Check next Mbs   in Mb group                           */
  372|  94.1k|    if(ps_cur_mb_params->u1_deblocking_mode & MB_DISABLE_FILTERING)
  ------------------
  |  |   70|  94.1k|#define MB_DISABLE_FILTERING          0x01
  ------------------
  |  Branch (372:8): [True: 4.24k, False: 89.9k]
  ------------------
  373|  4.24k|    {
  374|  4.24k|        void **pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  4.24k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  4.24k|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  375|  4.24k|        {
  376|       |            /* Store Parameter for Top MvPred refernce frame Address */
  377|       |
  378|  4.24k|            void **ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
  379|  4.24k|            WORD8 *p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
  380|  4.24k|            WORD8 *p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
  381|       |
  382|       |            /* Store Left addresses for Next Mb   */
  383|  4.24k|            void **ppv_left_mv_pred_addr = ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
  384|  4.24k|            WORD8 *p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
  385|       |
  386|  4.24k|            ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
  387|  4.24k|            ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
  388|       |
  389|  4.24k|            ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  390|  4.24k|            ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  391|  4.24k|            ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  392|  4.24k|            ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  393|       |
  394|  4.24k|            ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
  395|  4.24k|            ppv_left_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refleft0[1]];
  396|       |            /* Storing the leftMbtype for next Mb */
  397|  4.24k|            ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
  398|  4.24k|        }
  399|       |
  400|  4.24k|        return;
  401|  4.24k|    }
  402|       |
  403|       |    /* Flag for extra left Edge */
  404|  89.9k|    ps_cur_mb_params->u1_single_call = 1;
  405|       |
  406|       |    /* Update the Left deblk_mb_t and Left MvPred Parameters           */
  407|  89.9k|    if(!u2_mbx)
  ------------------
  |  Branch (407:8): [True: 14.9k, False: 74.9k]
  ------------------
  408|  14.9k|    {
  409|  14.9k|        u4_leftmbtype = 0;
  410|       |
  411|       |        /* Initialize the ps_left_mv_pred with Junk but Valid Location */
  412|       |        /* to avoid invalid memory access                           */
  413|       |        /* this is read only pointer                                */
  414|  14.9k|        ps_left_mv_pred = ps_dec->ps_mv_cur + 3;
  415|  14.9k|    }
  416|  74.9k|    else
  417|  74.9k|    {
  418|  74.9k|        u4_leftmbtype = ps_dec->deblk_left_mb[1].u1_mb_type;
  419|       |
  420|       |        /* Come to Left Most Edge of the MB */
  421|  74.9k|        ps_left_mv_pred =
  422|  74.9k|            (u2_mbxn_mb) ? ps_dec->ps_mv_cur + ((u2_mbxn_mb - 1) << 4) + 3 : ps_dec->ps_mv_left + 3;
  ------------------
  |  Branch (422:13): [True: 74.7k, False: 243]
  ------------------
  423|  74.9k|    }
  424|       |
  425|  89.9k|    if(!u2_mby) u1_top_mb_typ = 0;
  ------------------
  |  Branch (425:8): [True: 22.1k, False: 67.8k]
  ------------------
  426|       |
  427|       |    /* MvPred Pointer Calculation */
  428|  89.9k|    ps_top_mv_pred = ps_cur_mv_pred - (ps_dec->u2_frm_wd_in_mbs << 4) + 12;
  429|       |
  430|  89.9k|    u4_cur_mb_intra = u1_cur_mb_type & D_INTRA_MB;
  ------------------
  |  |  382|  89.9k|#define D_INTRA_MB        1
  ------------------
  431|  89.9k|    u4_cur_mb_fld = !!(u1_cur_mb_type & D_FLD_MB);
  ------------------
  |  |  386|  89.9k|#define D_FLD_MB          0x80
  ------------------
  432|       |    /* Compute BS function */
  433|  89.9k|    pu4_bs_table = ps_cur_mb_params->u4_bs_table;
  434|       |
  435|  89.9k|    u2_cur_csbp = ps_cur_mb_info->ps_curmb->u2_luma_csbp;
  436|  89.9k|    u2_left_csbp = ps_cur_mb_info->ps_left_mb->u2_luma_csbp;
  437|  89.9k|    u2_top_csbp = ps_cur_mb_info->ps_top_mb->u2_luma_csbp;
  438|       |    /* Compute BS function */
  439|  89.9k|    if((ps_dec->ps_cur_sps->u1_profile_idc == HIGH_PROFILE_IDC) ||
  ------------------
  |  |  278|  89.9k|#define HIGH_PROFILE_IDC   100
  ------------------
  |  Branch (439:8): [True: 43.8k, False: 46.0k]
  ------------------
  440|  46.0k|       (ps_dec->ps_cur_sps->u1_profile_idc == SCALABLE_HIGH_PROFILE_IDC) ||
  ------------------
  |  |   60|  46.0k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (440:8): [True: 0, False: 46.0k]
  ------------------
  441|  46.0k|       (ps_dec->ps_cur_sps->u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC))
  ------------------
  |  |   59|  46.0k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (441:8): [True: 0, False: 46.0k]
  ------------------
  442|  43.8k|    {
  443|  43.8k|        if(ps_cur_mb_info->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (443:12): [True: 24.7k, False: 19.1k]
  ------------------
  444|  24.7k|        {
  445|  24.7k|            u2_cur_csbp = ih264d_update_csbp_8x8(ps_cur_mb_info->ps_curmb->u2_luma_csbp);
  446|  24.7k|        }
  447|       |
  448|  43.8k|        if(ps_cur_mb_info->ps_left_mb->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (448:12): [True: 22.0k, False: 21.7k]
  ------------------
  449|  22.0k|        {
  450|  22.0k|            u2_left_csbp = ih264d_update_csbp_8x8(ps_cur_mb_info->ps_left_mb->u2_luma_csbp);
  451|  22.0k|        }
  452|       |
  453|  43.8k|        if(ps_cur_mb_info->ps_top_mb->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (453:12): [True: 15.9k, False: 27.9k]
  ------------------
  454|  15.9k|        {
  455|  15.9k|            u2_top_csbp = ih264d_update_csbp_8x8(ps_cur_mb_info->ps_top_mb->u2_luma_csbp);
  456|  15.9k|        }
  457|  43.8k|    }
  458|  89.9k|    if(u4_cur_mb_intra)
  ------------------
  |  Branch (458:8): [True: 89.9k, False: 0]
  ------------------
  459|  89.9k|    {
  460|  89.9k|        pu4_bs_table[4] = 0x04040404;
  461|  89.9k|        pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  Branch (461:27): [True: 0, False: 89.9k]
  ------------------
  462|  89.9k|        pu4_bs_table[1] = 0x03030303;
  463|  89.9k|        pu4_bs_table[2] = 0x03030303;
  464|  89.9k|        pu4_bs_table[3] = 0x03030303;
  465|  89.9k|        pu4_bs_table[5] = 0x03030303;
  466|  89.9k|        pu4_bs_table[6] = 0x03030303;
  467|  89.9k|        pu4_bs_table[7] = 0x03030303;
  468|  89.9k|    }
  469|      0|    else
  470|      0|    {
  471|      0|        UWORD32 u4_is_non16x16 = !!(u1_cur_mb_type & D_PRED_NON_16x16);
  ------------------
  |  |  383|      0|#define D_PRED_NON_16x16  2
  ------------------
  472|      0|        UWORD32 u4_is_b = ps_dec->u1_B;
  473|       |
  474|      0|        ih264d_fill_bs2_horz_vert(pu4_bs_table, u2_left_csbp, u2_top_csbp, u2_cur_csbp,
  475|      0|                                  (const UWORD32 *) (gau4_ih264d_packed_bs2),
  476|      0|                                  (const UWORD16 *) (gau2_ih264d_4x4_v2h_reorder));
  477|       |
  478|      0|        if(u4_leftmbtype & D_INTRA_MB) pu4_bs_table[4] = 0x04040404;
  ------------------
  |  |  382|      0|#define D_INTRA_MB        1
  ------------------
  |  Branch (478:12): [True: 0, False: 0]
  ------------------
  479|       |
  480|      0|        if(u1_top_mb_typ & D_INTRA_MB) pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  |  382|      0|#define D_INTRA_MB        1
  ------------------
  |  Branch (480:12): [True: 0, False: 0]
  |  Branch (480:58): [True: 0, False: 0]
  ------------------
  481|       |
  482|      0|        ps_dec->pf_fill_bs1[u4_is_b][u4_is_non16x16](
  483|      0|            ps_cur_mv_pred, ps_top_mv_pred, apv_map_ref_idx_to_poc, pu4_bs_table, ps_left_mv_pred,
  484|      0|            &(ps_dec->ps_left_mvpred_addr[u1_pingpong][1]),
  485|      0|            ps_cur_mb_info->ps_top_mb->u4_pic_addrress, (4 >> u4_cur_mb_fld));
  486|      0|    }
  487|       |
  488|  89.9k|    {
  489|  89.9k|        void **pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  89.9k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  89.9k|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  490|  89.9k|        {
  491|       |            /* Store Parameter for Top MvPred refernce frame Address */
  492|       |
  493|  89.9k|            void **ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
  494|  89.9k|            WORD8 *p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
  495|  89.9k|            WORD8 *p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
  496|       |
  497|       |            /* Store Left addresses for Next Mb   */
  498|  89.9k|            void **ppv_left_mv_pred_addr = ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
  499|  89.9k|            WORD8 *p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
  500|       |
  501|  89.9k|            ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
  502|  89.9k|            ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
  503|       |
  504|  89.9k|            ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  505|  89.9k|            ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  506|  89.9k|            ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  507|  89.9k|            ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  508|       |
  509|  89.9k|            ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
  510|  89.9k|            ppv_left_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refleft0[1]];
  511|       |
  512|       |            /* Storing the leftMbtype for next Mb */
  513|  89.9k|            ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
  514|  89.9k|        }
  515|  89.9k|    }
  516|       |
  517|       |    /* For transform 8x8 disable deblocking of the intrernal edges of a 8x8 block */
  518|  89.9k|    if(ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (518:8): [True: 24.7k, False: 65.2k]
  ------------------
  519|  24.7k|    {
  520|  24.7k|        pu4_bs_table[1] = 0;
  521|  24.7k|        pu4_bs_table[3] = 0;
  522|  24.7k|        pu4_bs_table[5] = 0;
  523|  24.7k|        pu4_bs_table[7] = 0;
  524|  24.7k|    }
  525|  89.9k|}
isvcd_compute_bs_non_mbaff:
  547|  6.39k|{
  548|  6.39k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  549|  6.39k|    ps_dec->pf_compute_bs(ps_dec, ps_cur_mb_info, u2_mbxn_mb);
  550|  6.39k|}
isvcd_compute_bs_non_mbaff_target_lyr:
  572|   151k|{
  573|   151k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  574|       |    /* Mvpred and Nnz for top and Courrent */
  575|   151k|    mv_pred_t *ps_cur_mv_pred, *ps_top_mv_pred = NULL, *ps_left_mv_pred;
  576|       |    /* deblk_mb_t Params */
  577|   151k|    deblk_mb_t *ps_cur_mb_params; /*< Parameters of current MacroBlock */
  578|   151k|    deblkmb_neighbour_t *ps_deblk_top_mb;
  579|       |
  580|       |    /* Reference Index to POC mapping*/
  581|   151k|    void **apv_map_ref_idx_to_poc;
  582|   151k|    UWORD32 u4_leftmbtype;
  583|   151k|    UWORD16 u2_left_csbp, u2_top_csbp, u2_cur_csbp;
  584|       |
  585|       |    /* Set of flags */
  586|   151k|    UWORD32 u4_cur_mb_intra, u1_top_mb_typ, u4_cur_mb_fld;
  587|   151k|    UWORD32 u4_cur_mb_ibl;
  588|   151k|    UWORD32 u1_cur_mb_type;
  589|   151k|    UWORD32 *pu4_bs_table;
  590|       |
  591|   151k|    UWORD16 *pu2_curr_res_luma_csbp;
  592|   151k|    UWORD16 *pu2_left_res_luma_csbp;
  593|   151k|    UWORD16 *pu2_top_res_luma_csbp;
  594|       |
  595|       |    /* Neighbour availability */
  596|       |    /* Initialization */
  597|   151k|    const UWORD32 u2_mbx = ps_cur_mb_info->u2_mbx;
  598|   151k|    const UWORD32 u2_mby = ps_cur_mb_info->u2_mby;
  599|   151k|    const UWORD32 u1_pingpong = u2_mbx & 0x01;
  600|       |
  601|   151k|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|   151k|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  602|       |
  603|   151k|    ps_deblk_top_mb = ps_dec->ps_deblk_top_mb + u2_mbx;
  604|       |
  605|       |    /* Pointer assignment for Current DeblkMB, Current Mv Pred  */
  606|   151k|    ps_cur_mb_params = ps_dec->ps_deblk_mbn + u2_mbxn_mb;
  607|   151k|    ps_cur_mv_pred = ps_dec->ps_mv_cur + (u2_mbxn_mb << 4);
  608|       |
  609|       |    /*Pointer assignment for Residual NNZ */
  610|   151k|    pu2_curr_res_luma_csbp = ps_svc_lyr_dec->pu2_frm_res_luma_csbp + ps_cur_mb_info->u2_mbx;
  611|   151k|    pu2_curr_res_luma_csbp += ps_cur_mb_info->u2_mby * ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride;
  612|       |
  613|   151k|    pu2_left_res_luma_csbp = pu2_curr_res_luma_csbp - (ps_cur_mb_info->u2_mbx != 0);
  614|   151k|    pu2_top_res_luma_csbp = pu2_curr_res_luma_csbp - ((ps_cur_mb_info->u2_mby != 0) *
  615|   151k|                                                      ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride);
  616|       |
  617|   151k|    apv_map_ref_idx_to_poc = ps_dec->ppv_map_ref_idx_to_poc + 1;
  618|   151k|    u1_cur_mb_type = ps_cur_mb_params->u1_mb_type;
  619|   151k|    u1_top_mb_typ = ps_deblk_top_mb->u1_mb_type;
  620|   151k|    ps_deblk_top_mb->u1_mb_type = u1_cur_mb_type;
  621|       |
  622|   151k|    ps_cur_mb_params->u1_topmb_qp = ps_deblk_top_mb->u1_mb_qp;
  623|   151k|    ps_deblk_top_mb->u1_mb_qp = ps_cur_mb_params->u1_mb_qp;
  624|   151k|    ps_cur_mb_params->u1_left_mb_qp = ps_dec->deblk_left_mb[1].u1_mb_qp;
  625|   151k|    ps_dec->deblk_left_mb[1].u1_mb_qp = ps_cur_mb_params->u1_mb_qp;
  626|       |
  627|       |    /* if no deblocking required for current Mb then continue */
  628|       |    /* Check next Mbs   in Mb group                           */
  629|   151k|    if(ps_cur_mb_params->u1_deblocking_mode & MB_DISABLE_FILTERING)
  ------------------
  |  |   70|   151k|#define MB_DISABLE_FILTERING          0x01
  ------------------
  |  Branch (629:8): [True: 7.50k, False: 144k]
  ------------------
  630|  7.50k|    {
  631|  7.50k|        void **pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  7.50k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  7.50k|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  632|       |
  633|       |        /* Store Parameter for Top MvPred refernce frame Address */
  634|  7.50k|        void **ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
  635|  7.50k|        WORD8 *p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
  636|  7.50k|        WORD8 *p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
  637|       |
  638|       |        /* Store Left addresses for Next Mb   */
  639|  7.50k|        void **ppv_left_mv_pred_addr = ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
  640|  7.50k|        WORD8 *p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
  641|       |
  642|  7.50k|        ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
  643|  7.50k|        ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
  644|       |
  645|  7.50k|        ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  646|  7.50k|        ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  647|  7.50k|        ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  648|  7.50k|        ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  649|       |
  650|  7.50k|        ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
  651|  7.50k|        ppv_left_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refleft0[1]];
  652|       |        /* Storing the leftMbtype for next Mb */
  653|  7.50k|        ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
  654|       |
  655|  7.50k|        return;
  656|  7.50k|    }
  657|       |
  658|       |    /* Flag for extra left Edge */
  659|   144k|    ps_cur_mb_params->u1_single_call = 1;
  660|       |
  661|       |    /* Update the Left deblk_mb_t and Left MvPred Parameters           */
  662|   144k|    if(!u2_mbx)
  ------------------
  |  Branch (662:8): [True: 41.3k, False: 102k]
  ------------------
  663|  41.3k|    {
  664|  41.3k|        u4_leftmbtype = 0;
  665|       |
  666|       |        /* Initialize the ps_left_mv_pred with Junk but Valid Location */
  667|       |        /* to avoid invalid memory access                           */
  668|       |        /* this is read only pointer                                */
  669|  41.3k|        ps_left_mv_pred = ps_dec->ps_mv_cur + 3;
  670|  41.3k|    }
  671|   102k|    else
  672|   102k|    {
  673|   102k|        u4_leftmbtype = ps_dec->deblk_left_mb[1].u1_mb_type;
  674|       |
  675|       |        /* Come to Left Most Edge of the MB */
  676|   102k|        ps_left_mv_pred =
  677|   102k|            (u2_mbxn_mb) ? ps_dec->ps_mv_cur + ((u2_mbxn_mb - 1) << 4) + 3 : ps_dec->ps_mv_left + 3;
  ------------------
  |  Branch (677:13): [True: 102k, False: 313]
  ------------------
  678|   102k|    }
  679|       |
  680|   144k|    if(!u2_mby) u1_top_mb_typ = 0;
  ------------------
  |  Branch (680:8): [True: 21.9k, False: 122k]
  ------------------
  681|       |
  682|       |    /* MvPred Pointer Calculation */
  683|   144k|    ps_top_mv_pred = ps_cur_mv_pred - (ps_dec->u2_frm_wd_in_mbs << 4) + 12;
  684|   144k|    u4_cur_mb_intra = u1_cur_mb_type & D_INTRA_MB;
  ------------------
  |  |  382|   144k|#define D_INTRA_MB        1
  ------------------
  685|   144k|    u4_cur_mb_ibl = u1_cur_mb_type & D_INTRA_IBL;
  ------------------
  |  |   72|   144k|#define D_INTRA_IBL 16
  ------------------
  686|   144k|    u4_cur_mb_fld = !!(u1_cur_mb_type & D_FLD_MB);
  ------------------
  |  |  386|   144k|#define D_FLD_MB          0x80
  ------------------
  687|       |    /* Compute BS function */
  688|   144k|    pu4_bs_table = ps_cur_mb_params->u4_bs_table;
  689|       |
  690|   144k|    u2_cur_csbp = ps_cur_mb_info->ps_curmb->u2_luma_csbp;
  691|   144k|    u2_left_csbp = ps_cur_mb_info->ps_left_mb->u2_luma_csbp;
  692|   144k|    u2_top_csbp = ps_cur_mb_info->ps_top_mb->u2_luma_csbp;
  693|       |    /* Compute BS function */
  694|   144k|    if((ps_dec->ps_cur_sps->u1_profile_idc == HIGH_PROFILE_IDC) ||
  ------------------
  |  |  278|   144k|#define HIGH_PROFILE_IDC   100
  ------------------
  |  Branch (694:8): [True: 3.30k, False: 140k]
  ------------------
  695|   140k|       (ps_dec->ps_cur_sps->u1_profile_idc == SCALABLE_HIGH_PROFILE_IDC) ||
  ------------------
  |  |   60|   140k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (695:8): [True: 26.1k, False: 114k]
  ------------------
  696|   114k|       (ps_dec->ps_cur_sps->u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC))
  ------------------
  |  |   59|   114k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (696:8): [True: 29.1k, False: 85.5k]
  ------------------
  697|  58.5k|    {
  698|  58.5k|        if(ps_cur_mb_info->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (698:12): [True: 4.99k, False: 53.5k]
  ------------------
  699|  4.99k|        {
  700|  4.99k|            u2_cur_csbp = ih264d_update_csbp_8x8(ps_cur_mb_info->ps_curmb->u2_luma_csbp);
  701|  4.99k|            ps_cur_mb_info->ps_curmb->u2_luma_csbp = u2_cur_csbp;
  702|  4.99k|        }
  703|  58.5k|    }
  704|   144k|    u2_cur_csbp |= *pu2_curr_res_luma_csbp;
  705|   144k|    u2_left_csbp |= *pu2_left_res_luma_csbp;
  706|   144k|    u2_top_csbp |= *pu2_top_res_luma_csbp;
  707|       |
  708|   144k|    if(u4_cur_mb_intra)
  ------------------
  |  Branch (708:8): [True: 11.3k, False: 132k]
  ------------------
  709|  11.3k|    {
  710|  11.3k|        pu4_bs_table[4] = 0x04040404;
  711|  11.3k|        pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  Branch (711:27): [True: 0, False: 11.3k]
  ------------------
  712|  11.3k|        pu4_bs_table[1] = 0x03030303;
  713|  11.3k|        pu4_bs_table[2] = 0x03030303;
  714|  11.3k|        pu4_bs_table[3] = 0x03030303;
  715|  11.3k|        pu4_bs_table[5] = 0x03030303;
  716|  11.3k|        pu4_bs_table[6] = 0x03030303;
  717|  11.3k|        pu4_bs_table[7] = 0x03030303;
  718|  11.3k|    }
  719|   132k|    else
  720|   132k|    {
  721|   132k|        isvcd_fill_bs_ibl(ps_cur_mb_params, u1_top_mb_typ, u4_leftmbtype, ps_cur_mb_info,
  722|   132k|                          pu2_curr_res_luma_csbp, pu2_left_res_luma_csbp, pu2_top_res_luma_csbp);
  723|       |
  724|   132k|        if(!u4_cur_mb_ibl)
  ------------------
  |  Branch (724:12): [True: 103k, False: 29.3k]
  ------------------
  725|   103k|        {
  726|   103k|            UWORD32 u4_is_non16x16 = !!(u1_cur_mb_type & D_PRED_NON_16x16);
  ------------------
  |  |  383|   103k|#define D_PRED_NON_16x16  2
  ------------------
  727|   103k|            UWORD32 u4_is_b = ps_dec->u1_B;
  728|   103k|            UWORD32 u4_bs_0, u4_bs_4;
  729|       |
  730|   103k|            u4_bs_0 = pu4_bs_table[0];
  731|   103k|            u4_bs_4 = pu4_bs_table[4];
  732|       |
  733|   103k|            ih264d_fill_bs2_horz_vert(pu4_bs_table, u2_left_csbp, u2_top_csbp, u2_cur_csbp,
  734|   103k|                                      (const UWORD32 *) (gau4_ih264d_packed_bs2),
  735|   103k|                                      (const UWORD16 *) (gau2_ih264d_4x4_v2h_reorder));
  736|       |
  737|   103k|            if(u4_leftmbtype & D_INTRA_MB)
  ------------------
  |  |  382|   103k|#define D_INTRA_MB        1
  ------------------
  |  Branch (737:16): [True: 1.02k, False: 102k]
  ------------------
  738|  1.02k|            {
  739|  1.02k|                pu4_bs_table[4] = 0x04040404;
  740|  1.02k|            }
  741|   102k|            else if(u4_leftmbtype & D_INTRA_IBL)
  ------------------
  |  |   72|   102k|#define D_INTRA_IBL 16
  ------------------
  |  Branch (741:21): [True: 2.13k, False: 100k]
  ------------------
  742|  2.13k|            {
  743|  2.13k|                pu4_bs_table[4] = u4_bs_4;
  744|  2.13k|            }
  745|       |
  746|   103k|            if(u1_top_mb_typ & D_INTRA_MB)
  ------------------
  |  |  382|   103k|#define D_INTRA_MB        1
  ------------------
  |  Branch (746:16): [True: 1.50k, False: 101k]
  ------------------
  747|  1.50k|            {
  748|  1.50k|                pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  Branch (748:35): [True: 0, False: 1.50k]
  ------------------
  749|  1.50k|            }
  750|   101k|            else if(u1_top_mb_typ & D_INTRA_IBL)
  ------------------
  |  |   72|   101k|#define D_INTRA_IBL 16
  ------------------
  |  Branch (750:21): [True: 3.05k, False: 98.8k]
  ------------------
  751|  3.05k|            {
  752|  3.05k|                pu4_bs_table[0] = u4_bs_0;
  753|  3.05k|            }
  754|       |
  755|   103k|            ps_dec->pf_fill_bs1[u4_is_b][u4_is_non16x16](
  756|   103k|                ps_cur_mv_pred, ps_top_mv_pred, apv_map_ref_idx_to_poc, pu4_bs_table,
  757|   103k|                ps_left_mv_pred, &(ps_dec->ps_left_mvpred_addr[u1_pingpong][1]),
  758|   103k|                ps_cur_mb_info->ps_top_mb->u4_pic_addrress, (4 >> u4_cur_mb_fld));
  759|   103k|        }
  760|   132k|    }
  761|       |
  762|   144k|    {
  763|   144k|        void **pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|   144k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|   144k|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  764|       |        /* Store Parameter for Top MvPred refernce frame Address */
  765|   144k|        void **ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
  766|   144k|        WORD8 *p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
  767|   144k|        WORD8 *p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
  768|       |
  769|       |        /* Store Left addresses for Next Mb   */
  770|   144k|        void **ppv_left_mv_pred_addr = ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
  771|   144k|        WORD8 *p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
  772|       |
  773|   144k|        ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
  774|   144k|        ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
  775|       |
  776|   144k|        ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  777|   144k|        ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  778|   144k|        ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  779|   144k|        ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  780|       |
  781|   144k|        ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
  782|   144k|        ppv_left_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refleft0[1]];
  783|       |
  784|       |        /* Storing the leftMbtype for next Mb */
  785|   144k|        ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
  786|   144k|    }
  787|       |
  788|       |    /* For transform 8x8 disable deblocking of the intrernal edges of a 8x8 block */
  789|   144k|    if(ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (789:8): [True: 13.9k, False: 130k]
  ------------------
  790|  13.9k|    {
  791|  13.9k|        pu4_bs_table[1] = 0;
  792|  13.9k|        pu4_bs_table[3] = 0;
  793|  13.9k|        pu4_bs_table[5] = 0;
  794|  13.9k|        pu4_bs_table[7] = 0;
  795|  13.9k|    }
  796|   144k|}

isvcd_init_function_ptr_generic:
   85|   168k|{
   86|   168k|    residual_sampling_ctxt_t *ps_resd_samp_ctx;
   87|   168k|    intra_sampling_ctxt_t *ps_intra_samp_ctxt;
   88|   168k|    dec_struct_t *ps_codec = &ps_svc_lyr_dec->s_dec;
   89|       |
   90|       |    /* call the ih264 init ptr generic fn*/
   91|   168k|    ih264d_init_function_ptr_generic(ps_codec);
   92|       |
   93|   168k|    ps_resd_samp_ctx = (residual_sampling_ctxt_t *) ps_svc_lyr_dec->pv_residual_sample_ctxt;
   94|   168k|    ps_intra_samp_ctxt = (intra_sampling_ctxt_t *) ps_svc_lyr_dec->pv_intra_sample_ctxt;
   95|       |
   96|   168k|    ps_svc_lyr_dec->pf_pred_residual_recon_luma_4x4 = isvcd_pred_residual_recon_4x4;
   97|   168k|    ps_svc_lyr_dec->pf_pred_residual_recon_luma_8x8 = isvcd_pred_residual_recon_8x8;
   98|   168k|    ps_svc_lyr_dec->pf_pred_residual_recon_luma_16x16 = isvcd_pred_residual_recon_16x16;
   99|   168k|    ps_svc_lyr_dec->pf_pred_residual_recon_chroma_4x4 = isvcd_pred_residual_recon_chroma_4x4;
  100|   168k|    ps_svc_lyr_dec->pf_pred_residual_recon_chroma_8x8 = isvcd_pred_residual_recon_chroma_8x8;
  101|       |
  102|   168k|    ps_svc_lyr_dec->pf_residual_luma_4x4 = isvcd_residual_luma_4x4;
  103|   168k|    ps_svc_lyr_dec->pf_residual_luma_8x8 = isvcd_residual_luma_8x8;
  104|   168k|    ps_svc_lyr_dec->pf_residual_luma_16x16 = isvcd_residual_luma_16x16;
  105|   168k|    ps_svc_lyr_dec->pf_residual_chroma_cb_cr_8x8 = isvcd_residual_chroma_cb_cr_8x8;
  106|       |
  107|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_luma_4x4 =
  108|   168k|        isvcd_iquant_itrans_residual_recon_4x4;
  109|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_luma_4x4_dc =
  110|   168k|        isvcd_iquant_itrans_residual_recon_4x4_dc;
  111|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_luma_8x8 =
  112|   168k|        isvcd_iquant_itrans_residual_recon_8x8;
  113|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_luma_8x8_dc =
  114|   168k|        isvcd_iquant_itrans_residual_recon_8x8_dc;
  115|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_chroma_4x4 =
  116|   168k|        isvcd_iquant_itrans_residual_recon_chroma_4x4;
  117|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_chroma_4x4_dc =
  118|   168k|        isvcd_iquant_itrans_residual_recon_chroma_4x4_dc;
  119|       |
  120|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_luma_4x4 = isvcd_iquant_itrans_residual_4x4;
  121|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_luma_4x4_dc = isvcd_iquant_itrans_residual_4x4_dc;
  122|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_luma_8x8 = isvcd_iquant_itrans_residual_8x8;
  123|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_luma_8x8_dc = isvcd_iquant_itrans_residual_8x8_dc;
  124|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_chroma_4x4 = isvcd_iquant_itrans_residual_chroma_4x4;
  125|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_chroma_4x4_dc =
  126|   168k|        isvcd_iquant_itrans_residual_chroma_4x4_dc;
  127|       |
  128|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_luma_4x4 = isvcd_iquant_itrans_4x4;
  129|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_luma_4x4_dc = isvcd_iquant_itrans_4x4_dc;
  130|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_luma_8x8 = isvcd_iquant_itrans_8x8;
  131|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_luma_8x8_dc = isvcd_iquant_itrans_8x8_dc;
  132|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_chroma_4x4 = isvcd_iquant_itrans_chroma_4x4;
  133|   168k|    ps_svc_lyr_dec->pf_iquant_itrans_chroma_4x4_dc = isvcd_iquant_itrans_chroma_4x4_dc;
  134|       |
  135|   168k|    ps_intra_samp_ctxt->pf_interpolate_base_luma_dyadic = isvcd_interpolate_base_luma_dyadic;
  136|   168k|    ps_intra_samp_ctxt->pf_interpolate_intra_base = isvcd_interpolate_intra_base;
  137|   168k|    ps_intra_samp_ctxt->pf_vert_chroma_interpol[0] = isvcd_vert_interpol_chroma_dyadic_1;
  138|   168k|    ps_intra_samp_ctxt->pf_vert_chroma_interpol[1] = isvcd_vert_interpol_chroma_dyadic_2;
  139|   168k|    ps_intra_samp_ctxt->pf_vert_chroma_interpol[2] = isvcd_vert_interpol_chroma_dyadic_3;
  140|       |
  141|   168k|    ps_intra_samp_ctxt->pf_horz_chroma_interpol[0] = isvcd_horz_interpol_chroma_dyadic_1;
  142|   168k|    ps_intra_samp_ctxt->pf_horz_chroma_interpol[1] = isvcd_horz_interpol_chroma_dyadic_2;
  143|       |
  144|       |    /*Dyadic Residual Resampling*/
  145|   168k|    ps_resd_samp_ctx->pf_residual_luma_dyadic = isvcd_residual_luma_dyadic;
  146|   168k|    ps_resd_samp_ctx->pf_residual_chroma_dyadic = isvcd_residual_chroma_dyadic;
  147|   168k|    ps_resd_samp_ctx->pf_residual_chroma_dyadic_alt = isvcd_residual_chroma_dyadic_alt;
  148|       |
  149|       |    /*Non-dyadic Residual Resampling*/
  150|   168k|    ps_resd_samp_ctx->pf_interpolate_residual = isvcd_interpolate_residual;
  151|       |
  152|   168k|    ps_resd_samp_ctx->pf_residual_reflayer_const_non_boundary_mb =
  153|   168k|        isvcd_residual_reflayer_const_non_boundary_mb;
  154|   168k|    ps_resd_samp_ctx->pf_residual_reflayer_const_boundary_mb =
  155|   168k|        isvcd_residual_reflayer_const_boundary_mb;
  156|       |
  157|   168k|    return;
  158|   168k|}

isvcd_ii_pred_res_init:
  100|   137k|{
  101|       |    /* local vaiables */
  102|   137k|    intra_inter_pred_ctxt_t *ps_ii_pred_ctxt;
  103|   137k|    mode_motion_ctxt_t *ps_ctxt;
  104|   137k|    mode_motion_lyr_ctxt *ps_lyr_mem;
  105|   137k|    WORD32 i4_base_res_flag;
  106|   137k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) pv_svc_dec;
  107|       |
  108|   137k|    res_prms_t *ps_res_prms = &ps_svc_lyr_dec->s_res_prms;
  109|   137k|    ps_ii_pred_ctxt = (intra_inter_pred_ctxt_t *) ps_svc_lyr_dec->pv_ii_pred_ctxt;
  110|   137k|    ps_ctxt = (mode_motion_ctxt_t *) ps_svc_lyr_dec->pv_mode_mv_sample_ctxt;
  111|   137k|    i4_base_res_flag = ps_svc_lyr_dec->u1_base_res_flag;
  112|       |
  113|   137k|    if((0 != ps_svc_lyr_dec->u1_layer_id) && (SVCD_FALSE == i4_base_res_flag))
  ------------------
  |  |   45|  34.5k|#define SVCD_FALSE 0
  ------------------
  |  Branch (113:8): [True: 34.5k, False: 102k]
  |  Branch (113:46): [True: 34.5k, False: 0]
  ------------------
  114|  34.5k|    {
  115|       |        /* if not first resolution layer */
  116|  34.5k|        ps_ii_pred_ctxt->i4_ref_res_lyr_wd = ps_ii_pred_ctxt->i4_cur_res_lyr_wd;
  117|  34.5k|        ps_ii_pred_ctxt->i4_ref_res_lyr_ht = ps_ii_pred_ctxt->i4_cur_res_lyr_ht;
  118|  34.5k|    }
  119|       |
  120|   137k|    if ((ps_ctxt->i4_res_id >= 0) && (ps_ctxt->i4_res_id <= 2))
  ------------------
  |  Branch (120:9): [True: 34.5k, False: 102k]
  |  Branch (120:38): [True: 34.5k, False: 0]
  ------------------
  121|  34.5k|    {
  122|  34.5k|        ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
  123|       |
  124|  34.5k|        ps_ii_pred_ctxt->pi2_ref_loc_x = ps_lyr_mem->pi2_ref_loc_x;
  125|  34.5k|        ps_ii_pred_ctxt->pi2_ref_loc_y = ps_lyr_mem->pi2_ref_loc_y;
  126|  34.5k|    }
  127|       |    /* Store the dimensions */
  128|   137k|    ps_ii_pred_ctxt->i4_cur_res_lyr_wd = ps_res_prms->i4_res_width;
  129|   137k|    ps_ii_pred_ctxt->i4_cur_res_lyr_ht = ps_res_prms->i4_res_height;
  130|       |
  131|   137k|    return (OK);
  ------------------
  |  |  114|   137k|#define OK        0
  ------------------
  132|   137k|}
isvcd_ii_get_ref_mb_mode:
  161|   447k|{
  162|   447k|    WORD32 i4_mb_x, i4_mb_y;
  163|   447k|    inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms;
  164|   447k|    WORD8 i1_mb_mode;
  165|       |
  166|   447k|    i4_mb_x = (i4_x_ref >> MB_WIDTH_SHIFT);
  ------------------
  |  |   70|   447k|#define MB_WIDTH_SHIFT 4
  ------------------
  167|   447k|    i4_mb_y = (i4_y_ref >> MB_HEIGHT_SHIFT);
  ------------------
  |  |   71|   447k|#define MB_HEIGHT_SHIFT 4
  ------------------
  168|       |
  169|       |    /* get the location of the byte which has the current mb mode */
  170|   447k|    pi1_ref_mb_modes += (i4_mb_y * i4_ref_mode_stride * i4_ref_mode_size);
  171|   447k|    pi1_ref_mb_modes += (i4_mb_x * i4_ref_mode_size);
  172|   447k|    ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) pi1_ref_mb_modes;
  173|   447k|    i1_mb_mode = ps_inter_lyr_mb_prms->i1_mb_mode;
  174|       |
  175|   447k|    if(i1_mb_mode <= SVC_INTER_MB)
  ------------------
  |  |  114|   447k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (175:8): [True: 417k, False: 29.7k]
  ------------------
  176|   417k|    {
  177|       |        /* INTER */
  178|   417k|        return (SVCD_FALSE);
  ------------------
  |  |   45|   417k|#define SVCD_FALSE 0
  ------------------
  179|   417k|    }
  180|  29.7k|    else
  181|  29.7k|    {
  182|       |        /* INTRA */
  183|  29.7k|        return (SVCD_TRUE);
  ------------------
  |  |   46|  29.7k|#define SVCD_TRUE 1
  ------------------
  184|  29.7k|    }
  185|   447k|}
isvcd_ii_get_ref_projections:
  216|   111k|{
  217|   111k|    WORD16 *pi2_ref_loc_x;
  218|   111k|    WORD16 *pi2_ref_loc_y;
  219|   111k|    WORD8 *pi1_ref_mb_mode;
  220|   111k|    WORD32 i4_ref_mode_stride;
  221|   111k|    WORD32 i4_element_size;
  222|   111k|    WORD32 i4_ref_x, i4_ref_y;
  223|   111k|    WORD32 i4_frame_x, i4_frame_y;
  224|   111k|    WORD32 i4_flag;
  225|       |
  226|   111k|    pi2_ref_loc_x = ps_ctxt->pi2_ref_loc_x;
  227|   111k|    pi2_ref_loc_y = ps_ctxt->pi2_ref_loc_y;
  228|       |
  229|   111k|    pi1_ref_mb_mode = (WORD8 *) ps_ref_mb_mode->pv_buffer;
  230|   111k|    i4_ref_mode_stride = ps_ref_mb_mode->i4_num_element_stride;
  231|   111k|    i4_element_size = ps_ref_mb_mode->i4_element_size;
  232|       |
  233|       |    /* get the current MB frame positions */
  234|   111k|    i4_frame_x = i4_mb_x << 4;
  235|   111k|    i4_frame_y = i4_mb_y << 4;
  236|       |
  237|       |    /* reset the flag */
  238|   111k|    i4_flag = SVCD_FALSE;
  ------------------
  |  |   45|   111k|#define SVCD_FALSE 0
  ------------------
  239|       |
  240|       |    /* project the (0,0) of current MB and get the ref MB mode */
  241|   111k|    i4_ref_x = pi2_ref_loc_x[i4_frame_x];
  242|   111k|    i4_ref_y = pi2_ref_loc_y[i4_frame_y];
  243|       |
  244|   111k|    if((i4_ref_x < ps_ctxt->i4_ref_res_lyr_wd) && (i4_ref_y < ps_ctxt->i4_ref_res_lyr_ht))
  ------------------
  |  Branch (244:8): [True: 111k, False: 0]
  |  Branch (244:51): [True: 111k, False: 0]
  ------------------
  245|   111k|    {
  246|   111k|        ps_ii_mb_ctxt->u1_top_left_intra_flag = isvcd_ii_get_ref_mb_mode(
  247|   111k|            pi1_ref_mb_mode, i4_ref_mode_stride, i4_element_size, i4_ref_x, i4_ref_y);
  248|   111k|    }
  249|      0|    else
  250|      0|    {
  251|       |        /* If projection is outside the picture boundary */
  252|      0|        ps_ii_mb_ctxt->u1_top_left_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
  253|      0|    }
  254|       |    /* project the (15,0) of current MB and get the ref MB mode */
  255|   111k|    i4_ref_x = pi2_ref_loc_x[i4_frame_x + 15];
  256|   111k|    i4_ref_y = pi2_ref_loc_y[i4_frame_y];
  257|       |
  258|   111k|    if((i4_ref_x < ps_ctxt->i4_ref_res_lyr_wd) && (i4_ref_y < ps_ctxt->i4_ref_res_lyr_ht))
  ------------------
  |  Branch (258:8): [True: 111k, False: 0]
  |  Branch (258:51): [True: 111k, False: 0]
  ------------------
  259|   111k|    {
  260|   111k|        ps_ii_mb_ctxt->u1_top_rt_intra_flag = isvcd_ii_get_ref_mb_mode(
  261|   111k|            pi1_ref_mb_mode, i4_ref_mode_stride, i4_element_size, i4_ref_x, i4_ref_y);
  262|   111k|    }
  263|      0|    else
  264|      0|    {
  265|      0|        ps_ii_mb_ctxt->u1_top_rt_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
  266|      0|    }
  267|       |
  268|       |    /* project the (0,15) of current MB and get the ref MB mode */
  269|   111k|    i4_ref_x = pi2_ref_loc_x[i4_frame_x];
  270|   111k|    i4_ref_y = pi2_ref_loc_y[i4_frame_y + 15];
  271|       |
  272|   111k|    if((i4_ref_x < ps_ctxt->i4_ref_res_lyr_wd) && (i4_ref_y < ps_ctxt->i4_ref_res_lyr_ht))
  ------------------
  |  Branch (272:8): [True: 111k, False: 0]
  |  Branch (272:51): [True: 111k, False: 0]
  ------------------
  273|   111k|    {
  274|   111k|        ps_ii_mb_ctxt->u1_bot_left_intra_flag = isvcd_ii_get_ref_mb_mode(
  275|   111k|            pi1_ref_mb_mode, i4_ref_mode_stride, i4_element_size, i4_ref_x, i4_ref_y);
  276|   111k|    }
  277|      0|    else
  278|      0|    {
  279|      0|        ps_ii_mb_ctxt->u1_bot_left_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
  280|      0|    }
  281|       |
  282|       |    /* project the (15,15) of current MB and get the ref MB mode */
  283|   111k|    i4_ref_x = pi2_ref_loc_x[i4_frame_x + 15];
  284|   111k|    i4_ref_y = pi2_ref_loc_y[i4_frame_y + 15];
  285|       |
  286|   111k|    if((i4_ref_x < ps_ctxt->i4_ref_res_lyr_wd) && (i4_ref_y < ps_ctxt->i4_ref_res_lyr_ht))
  ------------------
  |  Branch (286:8): [True: 111k, False: 0]
  |  Branch (286:51): [True: 111k, False: 0]
  ------------------
  287|   111k|    {
  288|   111k|        ps_ii_mb_ctxt->u1_bot_rt_intra_flag = isvcd_ii_get_ref_mb_mode(
  289|   111k|            pi1_ref_mb_mode, i4_ref_mode_stride, i4_element_size, i4_ref_x, i4_ref_y);
  290|   111k|    }
  291|      0|    else
  292|      0|    {
  293|      0|        ps_ii_mb_ctxt->u1_bot_rt_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
  294|      0|    }
  295|       |
  296|       |    /* if any of the 4 cormers are falling into intra region
  297|       |      set the INTRA INTER Flag */
  298|   111k|    if((SVCD_TRUE == ps_ii_mb_ctxt->u1_top_left_intra_flag) ||
  ------------------
  |  |   46|   111k|#define SVCD_TRUE 1
  ------------------
  |  Branch (298:8): [True: 6.95k, False: 104k]
  ------------------
  299|   104k|       (SVCD_TRUE == ps_ii_mb_ctxt->u1_top_rt_intra_flag) ||
  ------------------
  |  |   46|   104k|#define SVCD_TRUE 1
  ------------------
  |  Branch (299:8): [True: 4.69k, False: 100k]
  ------------------
  300|   100k|       (SVCD_TRUE == ps_ii_mb_ctxt->u1_bot_left_intra_flag) ||
  ------------------
  |  |   46|   100k|#define SVCD_TRUE 1
  ------------------
  |  Branch (300:8): [True: 2.95k, False: 97.1k]
  ------------------
  301|  97.1k|       (SVCD_TRUE == ps_ii_mb_ctxt->u1_bot_rt_intra_flag))
  ------------------
  |  |   46|  97.1k|#define SVCD_TRUE 1
  ------------------
  |  Branch (301:8): [True: 568, False: 96.5k]
  ------------------
  302|  15.1k|    {
  303|  15.1k|        i4_flag = SVCD_TRUE;
  ------------------
  |  |   46|  15.1k|#define SVCD_TRUE 1
  ------------------
  304|  15.1k|    }
  305|       |
  306|       |    /* derive the intersection point of MB boundaries */
  307|   111k|    if(SVCD_TRUE == i4_flag)
  ------------------
  |  |   46|   111k|#define SVCD_TRUE 1
  ------------------
  |  Branch (307:8): [True: 15.1k, False: 96.5k]
  ------------------
  308|  15.1k|    {
  309|  15.1k|        WORD32 i4_intr_x, i4_intr_y;
  310|  15.1k|        WORD32 i4_ref_mb_init_x, i4_ref_mb_init_y;
  311|  15.1k|        WORD32 i4_ctr;
  312|       |
  313|       |        /* set the variables to initial values */
  314|  15.1k|        i4_intr_x = 0;
  315|  15.1k|        i4_intr_y = 0;
  316|  15.1k|        i4_ref_mb_init_x = pi2_ref_loc_x[i4_frame_x] >> MB_WIDTH_SHIFT;
  ------------------
  |  |   70|  15.1k|#define MB_WIDTH_SHIFT 4
  ------------------
  317|  15.1k|        i4_ref_mb_init_y = pi2_ref_loc_y[i4_frame_y] >> MB_HEIGHT_SHIFT;
  ------------------
  |  |   71|  15.1k|#define MB_HEIGHT_SHIFT 4
  ------------------
  318|       |
  319|       |        /* loop until an Mb boundary is found in horizontal direction */
  320|   181k|        for(i4_ctr = 0; i4_ctr < MB_WIDTH; i4_ctr++)
  ------------------
  |  |   67|   181k|#define MB_WIDTH 16
  ------------------
  |  Branch (320:25): [True: 175k, False: 5.57k]
  ------------------
  321|   175k|        {
  322|   175k|            i4_ref_x = pi2_ref_loc_x[i4_frame_x + i4_ctr];
  323|   175k|            i4_ref_x >>= MB_WIDTH_SHIFT;
  ------------------
  |  |   70|   175k|#define MB_WIDTH_SHIFT 4
  ------------------
  324|       |
  325|       |            /* check if the locations are falling into same MB */
  326|   175k|            if(i4_ref_x != i4_ref_mb_init_x)
  ------------------
  |  Branch (326:16): [True: 9.58k, False: 165k]
  ------------------
  327|  9.58k|            {
  328|  9.58k|                break;
  329|  9.58k|            }
  330|       |            /* increment the position */
  331|   165k|            i4_intr_x++;
  332|   165k|        }
  333|       |
  334|       |        /* loop until an Mb boundary is found in vertical direction */
  335|   179k|        for(i4_ctr = 0; i4_ctr < MB_HEIGHT; i4_ctr++)
  ------------------
  |  |   68|   179k|#define MB_HEIGHT 16
  ------------------
  |  Branch (335:25): [True: 174k, False: 5.36k]
  ------------------
  336|   174k|        {
  337|   174k|            i4_ref_y = pi2_ref_loc_y[i4_frame_y + i4_ctr];
  338|   174k|            i4_ref_y >>= MB_HEIGHT_SHIFT;
  ------------------
  |  |   71|   174k|#define MB_HEIGHT_SHIFT 4
  ------------------
  339|       |
  340|       |            /* check if the locations are falling into same MB */
  341|   174k|            if(i4_ref_y != i4_ref_mb_init_y)
  ------------------
  |  Branch (341:16): [True: 9.80k, False: 164k]
  ------------------
  342|  9.80k|            {
  343|  9.80k|                break;
  344|  9.80k|            }
  345|       |            /* increment the position */
  346|   164k|            i4_intr_y++;
  347|   164k|        }
  348|       |        /* store the intersection points */
  349|  15.1k|        ps_ii_mb_ctxt->u1_intersection_x = i4_intr_x;
  350|  15.1k|        ps_ii_mb_ctxt->u1_intersection_y = i4_intr_y;
  351|  15.1k|    }
  352|  96.5k|    else
  353|  96.5k|    {
  354|       |        /* set to default value */
  355|  96.5k|        ps_ii_mb_ctxt->u1_intersection_x = 0;
  356|  96.5k|        ps_ii_mb_ctxt->u1_intersection_y = 0;
  357|  96.5k|    }
  358|       |
  359|   111k|    return (i4_flag);
  360|   111k|}
isvcd_ii_pred_compute_flags_mb:
  386|   133k|{
  387|   133k|    intra_inter_pred_ctxt_t *ps_ctxt;
  388|   133k|    WORD32 i4_mb_x, i4_mb_y;
  389|   133k|    dec_svc_mb_info_t *ps_svc_mb_prms;
  390|   133k|    UNUSED(pv_mb_prms);
  ------------------
  |  |   45|   133k|#define UNUSED(x) ((void)(x))
  ------------------
  391|       |
  392|   133k|    if((NULL == pv_ii_pred_ctxt) || (NULL == ps_ref_mb_mode) || (NULL == ps_coord) ||
  ------------------
  |  Branch (392:8): [True: 0, False: 133k]
  |  Branch (392:37): [True: 0, False: 133k]
  |  Branch (392:65): [True: 0, False: 133k]
  ------------------
  393|   133k|       (NULL == pu1_ii_mb_mode))
  ------------------
  |  Branch (393:8): [True: 0, False: 133k]
  ------------------
  394|      0|    {
  395|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  396|      0|    }
  397|       |
  398|   133k|    ps_ctxt = (intra_inter_pred_ctxt_t *) pv_ii_pred_ctxt;
  399|   133k|    ps_svc_mb_prms = (dec_svc_mb_info_t *) pv_svc_mb_prms;
  400|       |
  401|       |    /* get mb co-ordinates */
  402|   133k|    i4_mb_x = ps_coord->u2_mb_x;
  403|   133k|    i4_mb_y = ps_coord->u2_mb_y;
  404|       |
  405|   133k|    {
  406|   133k|        intra_inter_mb_t *ps_ii_mb_ctxt;
  407|   133k|        WORD32 i4_ii_flag;
  408|       |
  409|       |        /* get the current MB strcuture pointer */
  410|   133k|        ps_ii_mb_ctxt = &ps_ctxt->s_intra_inter_mb_prms;
  411|       |
  412|       |        /* reset the Intra Inter qualified flag for current MB */
  413|   133k|        i4_ii_flag = SVCD_FALSE;
  ------------------
  |  |   45|   133k|#define SVCD_FALSE 0
  ------------------
  414|       |
  415|       |        /* check for base mode flag and Inter MB status */
  416|   133k|        if(1 == ps_svc_mb_prms->u1_base_mode_flag)
  ------------------
  |  Branch (416:12): [True: 111k, False: 21.3k]
  ------------------
  417|   111k|        {
  418|       |            /* call the function which calculates the projections
  419|       |               and returns whether current MB has to under go
  420|       |               Inter Intra Prediction */
  421|   111k|            i4_ii_flag = isvcd_ii_get_ref_projections(ps_ctxt, ps_ii_mb_ctxt, ps_ref_mb_mode,
  422|   111k|                                                      i4_mb_x, i4_mb_y);
  423|   111k|        }
  424|       |
  425|       |        /* If the current MB requires Intra Inter prediction */
  426|   133k|        if(SVCD_TRUE == i4_ii_flag)
  ------------------
  |  |   46|   133k|#define SVCD_TRUE 1
  ------------------
  |  Branch (426:12): [True: 15.1k, False: 117k]
  ------------------
  427|  15.1k|        {
  428|       |            /* set the mb mode */
  429|  15.1k|            *pu1_ii_mb_mode = SVC_INTRA_INTER_MB;
  ------------------
  |  |  118|  15.1k|#define SVC_INTRA_INTER_MB (1 << 4) /*!< Intra Inter MB */
  ------------------
  430|  15.1k|        }
  431|   117k|        else
  432|   117k|        {
  433|       |            /* set all MB params to default values */
  434|   117k|            ps_ii_mb_ctxt->u1_bot_left_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|   117k|#define SVCD_FALSE 0
  ------------------
  435|   117k|            ps_ii_mb_ctxt->u1_bot_rt_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|   117k|#define SVCD_FALSE 0
  ------------------
  436|   117k|            ps_ii_mb_ctxt->u1_top_left_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|   117k|#define SVCD_FALSE 0
  ------------------
  437|   117k|            ps_ii_mb_ctxt->u1_top_rt_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|   117k|#define SVCD_FALSE 0
  ------------------
  438|   117k|            ps_ii_mb_ctxt->u1_intersection_x = 0;
  439|   117k|            ps_ii_mb_ctxt->u1_intersection_y = 0;
  440|       |
  441|       |            /* set the mb mode to 0 (which has no interpretation) */
  442|   117k|            *pu1_ii_mb_mode = 0;
  443|   117k|        }
  444|   133k|    }
  445|   133k|    return (OK);
  ------------------
  |  |  114|   133k|#define OK        0
  ------------------
  446|   133k|}
isvcd_ii_pred_mb:
  472|  15.1k|{
  473|  15.1k|    intra_inter_mb_t *ps_mb_ctxt;
  474|  15.1k|    UWORD8 *pu1_rec_y, *pu1_rec_uv;
  475|  15.1k|    UWORD8 *pu1_recon_luma;
  476|  15.1k|    WORD32 i4_recon_luma_stride;
  477|  15.1k|    UWORD8 *pu1_recon_chroma;
  478|  15.1k|    WORD32 i4_recon_chroma_stride;
  479|  15.1k|    UWORD8 *pu1_pred_luma;
  480|  15.1k|    UWORD8 *pu1_pred_chroma;
  481|  15.1k|    WORD32 i4_pred_luma_stride;
  482|  15.1k|    WORD32 i4_pred_chroma_stride;
  483|  15.1k|    WORD32 i4_intr_x, i4_intr_y;
  484|  15.1k|    intra_inter_pred_ctxt_t *ps_ctxt;
  485|  15.1k|    pic_buffer_t *ps_frame_buf;
  486|  15.1k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) pv_svc_dec;
  487|  15.1k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  488|       |
  489|  15.1k|    ps_ctxt = (intra_inter_pred_ctxt_t *) ps_svc_lyr_dec->pv_ii_pred_ctxt;
  490|  15.1k|    ps_mb_ctxt = &ps_ctxt->s_intra_inter_mb_prms;
  491|  15.1k|    ps_frame_buf = ps_dec->ps_cur_pic;
  492|  15.1k|    i4_recon_luma_stride = ps_dec->u2_frm_wd_y;
  493|  15.1k|    i4_recon_chroma_stride = ps_dec->u2_frm_wd_uv;
  494|       |
  495|       |    /* derive the intersection point */
  496|  15.1k|    i4_intr_x = ps_mb_ctxt->u1_intersection_x;
  497|  15.1k|    i4_intr_y = ps_mb_ctxt->u1_intersection_y;
  498|       |
  499|  15.1k|    pu1_rec_y = ps_frame_buf->pu1_buf1 + (ps_cur_mb_info->u2_mbx << 4) +
  500|  15.1k|                (i4_recon_luma_stride * (ps_cur_mb_info->u2_mby << 4));
  501|       |
  502|  15.1k|    pu1_rec_uv = ps_frame_buf->pu1_buf2 + (ps_cur_mb_info->u2_mbx << 3) * YUV420SP_FACTOR +
  ------------------
  |  |  119|  15.1k|#define YUV420SP_FACTOR 2
  ------------------
  503|  15.1k|                 (i4_recon_chroma_stride * (ps_cur_mb_info->u2_mby << 3));
  504|       |
  505|  15.1k|    pu1_pred_luma = ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma;
  506|  15.1k|    pu1_pred_chroma = ps_svc_lyr_dec->pu1_ii_resamp_buffer_chroma;
  507|  15.1k|    i4_pred_luma_stride = MB_SIZE;
  ------------------
  |  |  554|  15.1k|#define MB_SIZE             16
  ------------------
  508|  15.1k|    i4_pred_chroma_stride = MB_SIZE;
  ------------------
  |  |  554|  15.1k|#define MB_SIZE             16
  ------------------
  509|       |
  510|       |    /* get the recon and residual buffer pointer */
  511|  15.1k|    pu1_recon_luma = pu1_rec_y;
  512|  15.1k|    pu1_recon_chroma = pu1_rec_uv;
  513|       |
  514|       |    /*-----------------------------------------------------------------------*/
  515|       |    /* Reconstruct TOP_LEFT Partition                                        */
  516|       |    /*-----------------------------------------------------------------------*/
  517|  15.1k|    {
  518|  15.1k|        WORD32 i4_width, i4_height;
  519|       |
  520|       |        /* assign the appropriate buffer params based on Intra status */
  521|  15.1k|        if(SVCD_TRUE == ps_mb_ctxt->u1_top_left_intra_flag)
  ------------------
  |  |   46|  15.1k|#define SVCD_TRUE 1
  ------------------
  |  Branch (521:12): [True: 6.95k, False: 8.21k]
  ------------------
  522|  6.95k|        {
  523|       |            /* Luma Processing */
  524|  6.95k|            isvcd_copy_data(pu1_pred_luma, i4_pred_luma_stride, pu1_recon_luma,
  525|  6.95k|                            i4_recon_luma_stride, i4_intr_x, i4_intr_y);
  526|       |
  527|       |            /* assign appropriate width and height for chroma */
  528|  6.95k|            i4_width = (((i4_intr_x + 1) >> 1) << 1);
  529|  6.95k|            i4_height = ((i4_intr_y + 1) & ~1);
  530|  6.95k|            i4_height >>= 1;
  531|       |            /* Chroma Processing (cb and cr interleaved) */
  532|  6.95k|            isvcd_copy_data(pu1_pred_chroma, i4_pred_chroma_stride, pu1_recon_chroma,
  533|  6.95k|                            i4_recon_chroma_stride, i4_width, i4_height);
  534|  6.95k|        }
  535|  15.1k|    }
  536|       |
  537|       |    /*-----------------------------------------------------------------------*/
  538|       |    /* Reconstruct TOP_RIGHT Partition                                       */
  539|       |    /*-----------------------------------------------------------------------*/
  540|  15.1k|    {
  541|  15.1k|        WORD32 i4_width, i4_height;
  542|       |
  543|       |        /* assign the appropriate buffer params based on Intra status */
  544|  15.1k|        if(SVCD_TRUE == ps_mb_ctxt->u1_top_rt_intra_flag)
  ------------------
  |  |   46|  15.1k|#define SVCD_TRUE 1
  ------------------
  |  Branch (544:12): [True: 8.10k, False: 7.06k]
  ------------------
  545|  8.10k|        {
  546|  8.10k|            pu1_pred_luma += i4_intr_x;
  547|  8.10k|            pu1_pred_chroma += (((i4_intr_x + 1) >> 1) << 1);
  548|       |
  549|       |            /* ----------------------- Luma ------------------------ */
  550|       |            /* get the recon and residual buffer pointer */
  551|  8.10k|            pu1_recon_luma = pu1_rec_y + i4_intr_x;
  552|       |
  553|       |            /* assign appropriate width and height for luma */
  554|  8.10k|            i4_width = MB_WIDTH - i4_intr_x;
  ------------------
  |  |   67|  8.10k|#define MB_WIDTH 16
  ------------------
  555|  8.10k|            i4_height = i4_intr_y;
  556|       |
  557|       |            /* Luma Processing */
  558|       |            /* Luma Processing */
  559|  8.10k|            isvcd_copy_data(pu1_pred_luma, i4_pred_luma_stride, pu1_recon_luma,
  560|  8.10k|                            i4_recon_luma_stride, i4_width, i4_height);
  561|       |
  562|       |            /* ----------------------- Chroma ----------------------- */
  563|       |            /* assign appropriate width and height for luma */
  564|  8.10k|            i4_width = (BLOCK_WIDTH - ((i4_intr_x + 1) >> 1)) << 1;
  ------------------
  |  |   64|  8.10k|#define BLOCK_WIDTH 8
  ------------------
  565|       |
  566|       |            /* Height includes for both Cb & Cr */
  567|  8.10k|            i4_height = ((i4_intr_y + 1) & ~1);
  568|  8.10k|            i4_height >>= 1;
  569|       |            /* get the recon and residual buffer pointer */
  570|  8.10k|            pu1_recon_chroma = pu1_rec_uv;
  571|  8.10k|            {
  572|  8.10k|                WORD32 i4_temp;
  573|  8.10k|                i4_temp = (((i4_intr_x + 1) >> 1) << 1);
  574|  8.10k|                pu1_recon_chroma += i4_temp;
  575|  8.10k|            }
  576|       |
  577|       |            /* Chroma Processing (cb and cr  interleaved) */
  578|  8.10k|            isvcd_copy_data(pu1_pred_chroma, i4_pred_chroma_stride, pu1_recon_chroma,
  579|  8.10k|                            i4_recon_chroma_stride, i4_width, i4_height);
  580|  8.10k|        }
  581|  15.1k|    }
  582|       |
  583|       |    /*-----------------------------------------------------------------------*/
  584|       |    /* Reconstruct BOTTOM_LEFT Partition                                     */
  585|       |    /*-----------------------------------------------------------------------*/
  586|  15.1k|    {
  587|  15.1k|        WORD32 i4_width, i4_height;
  588|       |
  589|       |        /* assign the appropriate buffer params based on Intra status */
  590|  15.1k|        if(SVCD_TRUE == ps_mb_ctxt->u1_bot_left_intra_flag)
  ------------------
  |  |   46|  15.1k|#define SVCD_TRUE 1
  ------------------
  |  Branch (590:12): [True: 6.61k, False: 8.55k]
  ------------------
  591|  6.61k|        {
  592|  6.61k|            pu1_pred_luma = ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma;
  593|  6.61k|            pu1_pred_chroma = ps_svc_lyr_dec->pu1_ii_resamp_buffer_chroma;
  594|       |
  595|       |            /* increment to current vertical offset */
  596|  6.61k|            pu1_pred_luma += i4_intr_y * i4_pred_luma_stride;
  597|  6.61k|            pu1_pred_chroma += (((i4_intr_y + 1) & ~1) >> 1) * i4_pred_chroma_stride;
  598|       |
  599|       |            /* ----------------------- Luma ----------------------- */
  600|       |            /* get the recon and residual buffer pointer */
  601|  6.61k|            pu1_recon_luma = pu1_rec_y;
  602|  6.61k|            pu1_recon_luma += i4_intr_y * i4_recon_luma_stride;
  603|       |
  604|       |            /* assign appropriate width and height */
  605|  6.61k|            i4_width = i4_intr_x;
  606|  6.61k|            i4_height = MB_HEIGHT - i4_intr_y;
  ------------------
  |  |   68|  6.61k|#define MB_HEIGHT 16
  ------------------
  607|       |
  608|       |            /* Luma Processing */
  609|  6.61k|            isvcd_copy_data(pu1_pred_luma, i4_pred_luma_stride, pu1_recon_luma,
  610|  6.61k|                            i4_recon_luma_stride, i4_width, i4_height);
  611|       |
  612|       |            /* ----------------------- Chroma ----------------------- */
  613|  6.61k|            pu1_recon_chroma = pu1_rec_uv;
  614|  6.61k|            {
  615|  6.61k|                WORD32 i4_temp;
  616|  6.61k|                i4_temp = ((i4_intr_y + 1) & ~1) >> 1;
  617|  6.61k|                pu1_recon_chroma += (i4_temp * i4_recon_chroma_stride);
  618|  6.61k|            }
  619|       |            /* assign appropriate width and height */
  620|  6.61k|            i4_width = ((i4_intr_x + 1) >> 1) << 1;
  621|  6.61k|            i4_height = MB_HEIGHT - (i4_intr_y & ~1);
  ------------------
  |  |   68|  6.61k|#define MB_HEIGHT 16
  ------------------
  622|  6.61k|            i4_height >>= 1;
  623|       |            /* Chroma Processing (cb and cr interleaved) */
  624|  6.61k|            isvcd_copy_data(pu1_pred_chroma, i4_pred_chroma_stride, pu1_recon_chroma,
  625|  6.61k|                            i4_recon_chroma_stride, i4_width, i4_height);
  626|  6.61k|        }
  627|  15.1k|    }
  628|       |
  629|       |    /*-----------------------------------------------------------------------*/
  630|       |    /* Reconstruct BOTTOM_RIGHT Partition                                    */
  631|       |    /*-----------------------------------------------------------------------*/
  632|  15.1k|    {
  633|  15.1k|        WORD32 i4_width, i4_height;
  634|       |
  635|       |        /* assign the appropriate buffer params based on Intra status */
  636|  15.1k|        if(SVCD_TRUE == ps_mb_ctxt->u1_bot_rt_intra_flag)
  ------------------
  |  |   46|  15.1k|#define SVCD_TRUE 1
  ------------------
  |  Branch (636:12): [True: 8.03k, False: 7.13k]
  ------------------
  637|  8.03k|        {
  638|  8.03k|            pu1_pred_luma = ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma;
  639|  8.03k|            pu1_pred_chroma = ps_svc_lyr_dec->pu1_ii_resamp_buffer_chroma;
  640|       |
  641|       |            /* increment to current vertical offset */
  642|  8.03k|            pu1_pred_luma += i4_intr_x;
  643|  8.03k|            pu1_pred_luma += i4_intr_y * i4_pred_luma_stride;
  644|  8.03k|            pu1_pred_chroma += (((i4_intr_y + 1) & ~1) >> 1) * i4_pred_chroma_stride;
  645|  8.03k|            pu1_pred_chroma += ((i4_intr_x + 1) >> 1) << 1;
  646|       |
  647|       |            /* ----------------------- Luma ----------------------- */
  648|       |            /* get the recon and residual buffer pointer horz */
  649|  8.03k|            pu1_recon_luma = pu1_rec_y + i4_intr_x;
  650|       |
  651|       |            /* get the recon and residual buffer pointer vertical */
  652|  8.03k|            pu1_recon_luma += (i4_intr_y * i4_recon_luma_stride);
  653|       |
  654|       |            /* assign appropriate width and height */
  655|  8.03k|            i4_width = MB_WIDTH - i4_intr_x;
  ------------------
  |  |   67|  8.03k|#define MB_WIDTH 16
  ------------------
  656|  8.03k|            i4_height = MB_HEIGHT - i4_intr_y;
  ------------------
  |  |   68|  8.03k|#define MB_HEIGHT 16
  ------------------
  657|       |
  658|       |            /* Luma Processing */
  659|  8.03k|            isvcd_copy_data(pu1_pred_luma, i4_pred_luma_stride, pu1_recon_luma,
  660|  8.03k|                            i4_recon_luma_stride, i4_width, i4_height);
  661|       |
  662|       |            /* ----------------------- Chroma ----------------------- */
  663|       |            /* get the recon and residual buffer pointer horz */
  664|  8.03k|            pu1_recon_chroma = pu1_rec_uv;
  665|  8.03k|            {
  666|  8.03k|                WORD32 i4_temp;
  667|  8.03k|                i4_temp = ((i4_intr_y + 1) & ~1) >> 1;
  668|  8.03k|                i4_temp *= i4_recon_chroma_stride;
  669|  8.03k|                i4_temp += (((i4_intr_x + 1) >> 1) << 1);
  670|  8.03k|                pu1_recon_chroma += i4_temp;
  671|  8.03k|            }
  672|       |
  673|       |            /* assign appropriate width and height */
  674|  8.03k|            i4_width = (BLOCK_WIDTH - ((i4_intr_x + 1) >> 1)) << 1;
  ------------------
  |  |   64|  8.03k|#define BLOCK_WIDTH 8
  ------------------
  675|  8.03k|            i4_height = MB_HEIGHT - (i4_intr_y & ~1);
  ------------------
  |  |   68|  8.03k|#define MB_HEIGHT 16
  ------------------
  676|  8.03k|            i4_height >>= 1;
  677|       |            /* Chroma Processing (cb and cr interleaved) */
  678|  8.03k|            isvcd_copy_data(pu1_pred_chroma, i4_pred_chroma_stride, pu1_recon_chroma,
  679|  8.03k|                            i4_recon_chroma_stride, i4_width, i4_height);
  680|  8.03k|        }
  681|  15.1k|    }
  682|  15.1k|    return;
  683|  15.1k|}

isvcd_get_ceil_log2:
  269|  26.1k|{
  270|  26.1k|    WORD32 i4_bits = 0;
  271|       |
  272|  26.1k|    i4_input--;
  273|   167k|    while(i4_input > 0)
  ------------------
  |  Branch (273:11): [True: 141k, False: 26.1k]
  ------------------
  274|   141k|    {
  275|   141k|        i4_bits++;
  276|   141k|        i4_input >>= 1;
  277|   141k|    }
  278|  26.1k|    return (i4_bits);
  279|  26.1k|}
isvcd_copy_data:
  350|   157k|{
  351|   157k|    WORD32 i4_vert_lines;
  352|       |
  353|       |    /* loop for copy all the lines requried */
  354|  2.47M|    for(i4_vert_lines = 0; i4_vert_lines < i4_num_lines; i4_vert_lines++)
  ------------------
  |  Branch (354:28): [True: 2.31M, False: 157k]
  ------------------
  355|  2.31M|    {
  356|  2.31M|        memcpy(pu1_dst, pu1_src, i4_num_bytes);
  357|  2.31M|        pu1_src += i4_src_stride;
  358|  2.31M|        pu1_dst += i4_dst_stride;
  359|  2.31M|    }
  360|   157k|    return;
  361|   157k|}
isvcd_copy_data_semiplanr:
  393|  97.7k|{
  394|  97.7k|    WORD32 i4_vert_lines, u4_i;
  395|       |
  396|       |    /* loop for copy all the lines requried */
  397|  1.29M|    for(i4_vert_lines = 0; i4_vert_lines < i4_num_lines; i4_vert_lines++)
  ------------------
  |  Branch (397:28): [True: 1.20M, False: 97.7k]
  ------------------
  398|  1.20M|    {
  399|  15.4M|        for(u4_i = 0; u4_i < i4_num_bytes; u4_i++)
  ------------------
  |  Branch (399:23): [True: 14.2M, False: 1.20M]
  ------------------
  400|  14.2M|        {
  401|  14.2M|            *(pu1_dst1 + u4_i) = *(pu1_src + (2 * u4_i));
  402|  14.2M|            *(pu1_dst2 + u4_i) = *(pu1_src + (2 * u4_i) + 1);
  403|  14.2M|        }
  404|       |
  405|  1.20M|        pu1_src += i4_src_stride;
  406|  1.20M|        pu1_dst1 += i4_dst_stride;
  407|  1.20M|        pu1_dst2 += i4_dst_stride;
  408|  1.20M|    }
  409|  97.7k|    return;
  410|  97.7k|}
isvcd_get_ref_layer_avlblty_dyadic:
  445|   294k|{
  446|   294k|    inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms;
  447|   294k|    WORD8 i1_mb_mode;
  448|       |
  449|       |    /* get the location of the byte which has the current mb mode */
  450|   294k|    pi1_ref_mb_modes += (i4_ref_mb_y * i4_ref_mode_stride * i4_element_size);
  451|   294k|    pi1_ref_mb_modes += (i4_ref_mb_x * i4_element_size);
  452|   294k|    ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) pi1_ref_mb_modes;
  453|   294k|    i1_mb_mode = ps_inter_lyr_mb_prms->i1_mb_mode;
  454|       |
  455|   294k|    if(i1_mb_mode <= SVC_INTER_MB)
  ------------------
  |  |  114|   294k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (455:8): [True: 247k, False: 46.8k]
  ------------------
  456|   247k|    {
  457|       |        /* INTER */
  458|   247k|        *pi4_avlblty = 0;
  459|   247k|    }
  460|  46.8k|    else
  461|  46.8k|    {
  462|       |        /* INTRA */
  463|  46.8k|        *pi4_avlblty = 1;
  464|  46.8k|    }
  465|       |
  466|       |    /* if constrained intra flag is 1 then check for same slice id */
  467|   294k|    if(1 == i1_cons_intr_samp_flag)
  ------------------
  |  Branch (467:8): [True: 156k, False: 138k]
  ------------------
  468|   156k|    {
  469|   156k|        if(1 == *pi4_avlblty)
  ------------------
  |  Branch (469:12): [True: 21.3k, False: 134k]
  ------------------
  470|  21.3k|        {
  471|       |            /* check for different slice idc */
  472|  21.3k|            if(ps_inter_lyr_mb_prms->i1_slice_id != i1_curr_slice_id)
  ------------------
  |  Branch (472:16): [True: 3.04k, False: 18.3k]
  ------------------
  473|  3.04k|            {
  474|       |                /* store the mode as not available for upsampling */
  475|  3.04k|                *pi4_avlblty = 0;
  476|  3.04k|            }
  477|  21.3k|        }
  478|   156k|    }
  479|   294k|}
isvcd_diagonal_construct_dyadic:
  509|   337k|{
  510|   337k|    WORD32 i4_diff_hor_ver, i4_sgn_xy;
  511|   337k|    WORD32 i4_xc, i4_yc;
  512|   337k|    WORD32 i4_samp1, i4_samp2, i4_samp3;
  513|   337k|    WORD32 i4_result;
  514|   337k|    UWORD8 *pu1_tmp;
  515|       |
  516|   337k|    i4_diff_hor_ver = ABS(i4_xd_index) - ABS(i4_yd_index);
  ------------------
  |  |  100|   337k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 169k, False: 168k]
  |  |  ------------------
  ------------------
                  i4_diff_hor_ver = ABS(i4_xd_index) - ABS(i4_yd_index);
  ------------------
  |  |  100|   337k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 170k, False: 166k]
  |  |  ------------------
  ------------------
  517|   337k|    i4_sgn_xy = SIGN(i4_xd_index * i4_yd_index);
  ------------------
  |  |  103|   337k|#define SIGN(x)     (((x) >= 0) ? (((x) > 0) ? 1 : 0) : -1)
  |  |  ------------------
  |  |  |  Branch (103:22): [True: 166k, False: 171k]
  |  |  |  Branch (103:36): [True: 166k, False: 0]
  |  |  ------------------
  ------------------
  518|       |
  519|   337k|    if(i4_diff_hor_ver > 0)
  ------------------
  |  Branch (519:8): [True: 137k, False: 199k]
  ------------------
  520|   137k|    {
  521|   137k|        i4_xc = i4_x - (i4_sgn_xy * i4_yd_index);
  522|   137k|        i4_yc = i4_y - i4_yd_index;
  523|   137k|        pu1_tmp = pu1_refarray + (i4_yc * i4_refarray_wd);
  524|   137k|        i4_samp1 = pu1_tmp[i4_xc - 1];
  525|   137k|        i4_samp2 = pu1_tmp[i4_xc];
  526|   137k|        i4_samp3 = pu1_tmp[i4_xc + 1];
  527|   137k|    }
  528|   199k|    else if(i4_diff_hor_ver < 0)
  ------------------
  |  Branch (528:13): [True: 143k, False: 55.9k]
  ------------------
  529|   143k|    {
  530|   143k|        i4_xc = i4_x - i4_xd_index;
  531|   143k|        i4_yc = i4_y - (i4_sgn_xy * i4_xd_index);
  532|   143k|        pu1_tmp = pu1_refarray + ((i4_yc - 1) * i4_refarray_wd);
  533|   143k|        i4_samp1 = pu1_tmp[i4_xc];
  534|   143k|        pu1_tmp += i4_refarray_wd;
  535|   143k|        i4_samp2 = pu1_tmp[i4_xc];
  536|   143k|        pu1_tmp += i4_refarray_wd;
  537|   143k|        i4_samp3 = pu1_tmp[i4_xc];
  538|   143k|    }
  539|  55.9k|    else
  540|  55.9k|    {
  541|  55.9k|        WORD32 i4_ref_xd, i4_ref_yd;
  542|       |
  543|  55.9k|        i4_ref_xd = i4_x - i4_xd_index;
  544|  55.9k|        i4_ref_yd = i4_y - i4_yd_index;
  545|  55.9k|        i4_xc = i4_ref_xd + SIGN(i4_xd_index);
  ------------------
  |  |  103|  55.9k|#define SIGN(x)     (((x) >= 0) ? (((x) > 0) ? 1 : 0) : -1)
  |  |  ------------------
  |  |  |  Branch (103:22): [True: 27.8k, False: 28.0k]
  |  |  |  Branch (103:36): [True: 27.8k, False: 0]
  |  |  ------------------
  ------------------
  546|  55.9k|        i4_yc = i4_ref_yd + SIGN(i4_yd_index);
  ------------------
  |  |  103|  55.9k|#define SIGN(x)     (((x) >= 0) ? (((x) > 0) ? 1 : 0) : -1)
  |  |  ------------------
  |  |  |  Branch (103:22): [True: 27.9k, False: 27.9k]
  |  |  |  Branch (103:36): [True: 27.9k, False: 0]
  |  |  ------------------
  ------------------
  547|  55.9k|        pu1_tmp = pu1_refarray + (i4_ref_yd * i4_refarray_wd);
  548|  55.9k|        i4_samp1 = pu1_tmp[i4_xc];
  549|  55.9k|        i4_samp2 = pu1_tmp[i4_ref_xd];
  550|  55.9k|        pu1_tmp = pu1_refarray + (i4_yc * i4_refarray_wd);
  551|  55.9k|        i4_samp3 = pu1_tmp[i4_ref_xd];
  552|  55.9k|    }
  553|       |
  554|   337k|    i4_result = (i4_samp1 + (i4_samp2 << 1) + i4_samp3 + 2) >> 2;
  555|   337k|    pu1_tmp = pu1_refarray + (i4_y * i4_refarray_wd);
  556|       |    /* Store the filled sample */
  557|   337k|    pu1_tmp[i4_x] = i4_result;
  558|       |
  559|   337k|    return (i4_result);
  560|   337k|}
isvcd_left_right_padding:
  584|  31.5k|{
  585|  31.5k|    WORD32 i4_idx_i;
  586|  31.5k|    UWORD8 *pu1_src, *pu1_dst;
  587|       |
  588|  31.5k|    UNUSED(i1_yd_index);
  ------------------
  |  |   45|  31.5k|#define UNUSED(x) ((void)(x))
  ------------------
  589|  31.5k|    UNUSED(pu1_refarray_2);
  ------------------
  |  |   45|  31.5k|#define UNUSED(x) ((void)(x))
  ------------------
  590|  31.5k|    UNUSED(i4_mb_adjoin_x);
  ------------------
  |  |   45|  31.5k|#define UNUSED(x) ((void)(x))
  ------------------
  591|  31.5k|    UNUSED(i4_mb_adjoin_y);
  ------------------
  |  |   45|  31.5k|#define UNUSED(x) ((void)(x))
  ------------------
  592|  31.5k|    UNUSED(i4_corner_pixel_available);
  ------------------
  |  |   45|  31.5k|#define UNUSED(x) ((void)(x))
  ------------------
  593|       |
  594|  31.5k|    pu1_dst = pu1_refarray_1 + i4_x + (i4_y * i4_refarray_stride);
  595|  31.5k|    pu1_src = pu1_dst + i1_xd_index;
  596|  31.5k|    i1_xd_index = MIN(i1_xd_index, MAX_PIX_FILL_LUMA);
  ------------------
  |  |   61|  31.5k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 26.9k, False: 4.58k]
  |  |  ------------------
  ------------------
  597|  31.5k|    u1_seg_wd = MIN(u1_seg_wd, MAX_PIX_FILL_LUMA);
  ------------------
  |  |   61|  31.5k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 25.0k, False: 6.54k]
  |  |  ------------------
  ------------------
  598|  31.5k|    pu1_dst = pu1_src - i1_xd_index;
  599|       |
  600|   240k|    for(i4_idx_i = 0; i4_idx_i < u1_seg_ht; i4_idx_i++)
  ------------------
  |  Branch (600:23): [True: 208k, False: 31.5k]
  ------------------
  601|   208k|    {
  602|   208k|        memset(pu1_dst, *pu1_src, u1_seg_wd);
  603|   208k|        pu1_dst += i4_refarray_stride;
  604|   208k|        pu1_src += i4_refarray_stride;
  605|   208k|    }
  606|  31.5k|}
isvcd_left_right_padding_chroma:
  629|  31.8k|{
  630|  31.8k|    WORD32 i4_idx_i;
  631|  31.8k|    UWORD8 *pu1_src_cb, *pu1_dst_cb;
  632|  31.8k|    UWORD8 *pu1_src_cr, *pu1_dst_cr;
  633|  31.8k|    WORD32 i4_tmp;
  634|       |
  635|  31.8k|    UNUSED(i1_yd_index);
  ------------------
  |  |   45|  31.8k|#define UNUSED(x) ((void)(x))
  ------------------
  636|  31.8k|    UNUSED(i4_mb_adjoin_x);
  ------------------
  |  |   45|  31.8k|#define UNUSED(x) ((void)(x))
  ------------------
  637|  31.8k|    UNUSED(i4_mb_adjoin_y);
  ------------------
  |  |   45|  31.8k|#define UNUSED(x) ((void)(x))
  ------------------
  638|  31.8k|    UNUSED(i4_corner_pixel_available);
  ------------------
  |  |   45|  31.8k|#define UNUSED(x) ((void)(x))
  ------------------
  639|       |
  640|  31.8k|    i4_tmp = i4_x + (i4_y * i4_refarray_stride);
  641|  31.8k|    pu1_dst_cb = pu1_refarray_1 + i4_tmp;
  642|  31.8k|    pu1_src_cb = pu1_dst_cb + i1_xd_index;
  643|  31.8k|    pu1_dst_cr = pu1_refarray_2 + i4_tmp;
  644|  31.8k|    pu1_src_cr = pu1_dst_cr + i1_xd_index;
  645|       |
  646|  31.8k|    i1_xd_index = MIN(i1_xd_index, MAX_PIX_FILL_CHROMA);
  ------------------
  |  |   61|  31.8k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 15.4k, False: 16.3k]
  |  |  ------------------
  ------------------
  647|  31.8k|    u1_seg_wd = MIN(u1_seg_wd, MAX_PIX_FILL_CHROMA);
  ------------------
  |  |   61|  31.8k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 13.4k, False: 18.4k]
  |  |  ------------------
  ------------------
  648|  31.8k|    pu1_dst_cb = pu1_src_cb - i1_xd_index;
  649|  31.8k|    pu1_dst_cr = pu1_src_cr - i1_xd_index;
  650|       |
  651|   141k|    for(i4_idx_i = 0; i4_idx_i < u1_seg_ht; i4_idx_i++)
  ------------------
  |  Branch (651:23): [True: 109k, False: 31.8k]
  ------------------
  652|   109k|    {
  653|   109k|        memset(pu1_dst_cb, *pu1_src_cb, u1_seg_wd);
  654|   109k|        pu1_dst_cb += i4_refarray_stride;
  655|   109k|        pu1_src_cb += i4_refarray_stride;
  656|   109k|        memset(pu1_dst_cr, *pu1_src_cr, u1_seg_wd);
  657|   109k|        pu1_dst_cr += i4_refarray_stride;
  658|   109k|        pu1_src_cr += i4_refarray_stride;
  659|   109k|    }
  660|  31.8k|}
isvcd_top_bot_padding:
  683|  27.1k|{
  684|  27.1k|    WORD32 i4_idx_i;
  685|  27.1k|    UWORD8 *pu1_src, *pu1_dst;
  686|       |
  687|  27.1k|    UNUSED(i1_xd_index);
  ------------------
  |  |   45|  27.1k|#define UNUSED(x) ((void)(x))
  ------------------
  688|  27.1k|    UNUSED(pu1_refarray_2);
  ------------------
  |  |   45|  27.1k|#define UNUSED(x) ((void)(x))
  ------------------
  689|  27.1k|    UNUSED(i4_mb_adjoin_x);
  ------------------
  |  |   45|  27.1k|#define UNUSED(x) ((void)(x))
  ------------------
  690|  27.1k|    UNUSED(i4_mb_adjoin_y);
  ------------------
  |  |   45|  27.1k|#define UNUSED(x) ((void)(x))
  ------------------
  691|  27.1k|    UNUSED(i4_corner_pixel_available);
  ------------------
  |  |   45|  27.1k|#define UNUSED(x) ((void)(x))
  ------------------
  692|       |
  693|  27.1k|    pu1_dst = pu1_refarray_1 + i4_x + (i4_y * i4_refarray_stride);
  694|  27.1k|    pu1_src = pu1_dst + (i1_yd_index * i4_refarray_stride);
  695|  27.1k|    i1_yd_index = MIN(i1_yd_index, MAX_PIX_FILL_LUMA);
  ------------------
  |  |   61|  27.1k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 21.5k, False: 5.60k]
  |  |  ------------------
  ------------------
  696|  27.1k|    u1_seg_ht = MIN(u1_seg_ht, MAX_PIX_FILL_LUMA);
  ------------------
  |  |   61|  27.1k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 15.7k, False: 11.3k]
  |  |  ------------------
  ------------------
  697|  27.1k|    pu1_dst = pu1_src - (i1_yd_index * i4_refarray_stride);
  698|       |
  699|   112k|    for(i4_idx_i = 0; i4_idx_i < u1_seg_ht; i4_idx_i++)
  ------------------
  |  Branch (699:23): [True: 85.7k, False: 27.1k]
  ------------------
  700|  85.7k|    {
  701|  85.7k|        memcpy(pu1_dst, pu1_src, u1_seg_wd);
  702|  85.7k|        pu1_dst += i4_refarray_stride;
  703|  85.7k|    }
  704|  27.1k|}
isvcd_top_bot_padding_chroma:
  728|  27.1k|{
  729|  27.1k|    WORD32 i4_idx_i;
  730|  27.1k|    UWORD8 *pu1_src_cb, *pu1_dst_cb;
  731|  27.1k|    UWORD8 *pu1_src_cr, *pu1_dst_cr;
  732|  27.1k|    WORD32 i4_tmp;
  733|       |
  734|  27.1k|    UNUSED(i1_xd_index);
  ------------------
  |  |   45|  27.1k|#define UNUSED(x) ((void)(x))
  ------------------
  735|  27.1k|    UNUSED(pu1_refarray_2);
  ------------------
  |  |   45|  27.1k|#define UNUSED(x) ((void)(x))
  ------------------
  736|  27.1k|    UNUSED(i4_mb_adjoin_x);
  ------------------
  |  |   45|  27.1k|#define UNUSED(x) ((void)(x))
  ------------------
  737|  27.1k|    UNUSED(i4_mb_adjoin_y);
  ------------------
  |  |   45|  27.1k|#define UNUSED(x) ((void)(x))
  ------------------
  738|  27.1k|    UNUSED(i4_corner_pixel_available);
  ------------------
  |  |   45|  27.1k|#define UNUSED(x) ((void)(x))
  ------------------
  739|       |
  740|  27.1k|    i4_tmp = i4_x + (i4_y * i4_refarray_stride);
  741|  27.1k|    pu1_dst_cb = pu1_refarray_1 + i4_tmp;
  742|  27.1k|    pu1_dst_cr = pu1_refarray_2 + i4_tmp;
  743|       |
  744|  27.1k|    i4_tmp = (i1_yd_index * i4_refarray_stride);
  745|  27.1k|    pu1_src_cb = pu1_dst_cb + i4_tmp;
  746|  27.1k|    pu1_src_cr = pu1_dst_cr + i4_tmp;
  747|  27.1k|    i1_yd_index = MIN(i1_yd_index, MAX_PIX_FILL_CHROMA);
  ------------------
  |  |   61|  27.1k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 12.9k, False: 14.2k]
  |  |  ------------------
  ------------------
  748|  27.1k|    u1_seg_ht = MIN(u1_seg_ht, MAX_PIX_FILL_CHROMA);
  ------------------
  |  |   61|  27.1k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 7.14k, False: 19.9k]
  |  |  ------------------
  ------------------
  749|       |
  750|  27.1k|    i4_tmp = (i1_yd_index * i4_refarray_stride);
  751|  27.1k|    pu1_dst_cb = pu1_src_cb - i4_tmp;
  752|  27.1k|    pu1_dst_cr = pu1_src_cr - i4_tmp;
  753|       |
  754|  74.1k|    for(i4_idx_i = 0; i4_idx_i < u1_seg_ht; i4_idx_i++)
  ------------------
  |  Branch (754:23): [True: 47.0k, False: 27.1k]
  ------------------
  755|  47.0k|    {
  756|  47.0k|        memcpy(pu1_dst_cb, pu1_src_cb, u1_seg_wd);
  757|  47.0k|        pu1_dst_cb += i4_refarray_stride;
  758|  47.0k|        memcpy(pu1_dst_cr, pu1_src_cr, u1_seg_wd);
  759|  47.0k|        pu1_dst_cr += i4_refarray_stride;
  760|  47.0k|    }
  761|  27.1k|}
isvcd_diag_reconstruction:
  785|  23.6k|{
  786|  23.6k|    WORD32 i4_i;
  787|  23.6k|    UWORD8 *pu1_src_1, *pu1_src_2, *pu1_dst;
  788|  23.6k|    UWORD8 u1_filter_delay_buf[18] = {0};
  789|  23.6k|    UWORD8 u1_out_buf[16] = {0};
  790|  23.6k|    WORD32 i4_width, i4_height;
  791|  23.6k|    WORD32 i4_x_off, i4_y_off;
  792|  23.6k|    WORD32 i4_block_size = BLOCK_WIDTH;
  ------------------
  |  |   64|  23.6k|#define BLOCK_WIDTH 8
  ------------------
  793|       |
  794|  23.6k|    UNUSED(pu1_refarray_2);
  ------------------
  |  |   45|  23.6k|#define UNUSED(x) ((void)(x))
  ------------------
  795|       |
  796|  23.6k|    pu1_dst = pu1_refarray_1 + i4_x + (i4_y * i4_refarray_stride);
  797|  23.6k|    pu1_src_1 = pu1_dst + i1_xd_index;
  798|  23.6k|    pu1_src_2 = pu1_dst + (i1_yd_index * i4_refarray_stride);
  799|       |
  800|  23.6k|    i4_width = MAX(u1_seg_wd, (((i4_mb_adjoin_x >> 3) ^ 1) * i4_block_size));
  ------------------
  |  |   60|  23.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 16.0k, False: 7.58k]
  |  |  ------------------
  ------------------
  801|  23.6k|    i4_height = MAX(u1_seg_ht, (((i4_mb_adjoin_y >> 4) ^ 1) * i4_block_size));
  ------------------
  |  |   60|  23.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 18.5k, False: 5.07k]
  |  |  ------------------
  ------------------
  802|  23.6k|    i4_x_off = (i4_width - u1_seg_wd);
  803|  23.6k|    i4_y_off = (i4_height - u1_seg_ht);
  804|       |
  805|  23.6k|    if(i1_xd_index < 0 && i1_yd_index > 0)
  ------------------
  |  Branch (805:8): [True: 11.2k, False: 12.4k]
  |  Branch (805:27): [True: 5.95k, False: 5.30k]
  ------------------
  806|  5.95k|    {
  807|       |        /* Quadrant 1 Processing load the pixel in the filter delay buffer */
  808|  52.6k|        for(i4_i = 0; i4_i < (i4_height + 1); i4_i++)
  ------------------
  |  Branch (808:23): [True: 46.7k, False: 5.95k]
  ------------------
  809|  46.7k|        {
  810|  46.7k|            u1_filter_delay_buf[i4_i] = *pu1_src_1;
  811|  46.7k|            pu1_src_1 += i4_refarray_stride;
  812|  46.7k|        }
  813|       |
  814|  5.95k|        pu1_src_2 -= i4_x_off;
  815|  5.95k|        memcpy(&u1_filter_delay_buf[i4_i], pu1_src_2, i4_width);
  816|       |
  817|  5.95k|        if(0 == i4_corner_pixel_available)
  ------------------
  |  Branch (817:12): [True: 5.56k, False: 388]
  ------------------
  818|  5.56k|        {
  819|       |            /* interpolate the unavailable corner pixel */
  820|  5.56k|            u1_filter_delay_buf[i4_i - 1] =
  821|  5.56k|                (u1_filter_delay_buf[i4_i] + u1_filter_delay_buf[i4_i - 2] + 1) >> 1;
  822|  5.56k|        }
  823|       |
  824|  84.0k|        for(i4_i = 0; i4_i < (i4_width + i4_height - 1); i4_i++)
  ------------------
  |  Branch (824:23): [True: 78.1k, False: 5.95k]
  ------------------
  825|  78.1k|        {
  826|       |            /* get the filtered output */
  827|  78.1k|            u1_out_buf[i4_i] = ((u1_filter_delay_buf[i4_i]) + (u1_filter_delay_buf[i4_i + 1] * 2) +
  828|  78.1k|                                (u1_filter_delay_buf[i4_i + 2]) + 2) >>
  829|  78.1k|                               2;
  830|  78.1k|        }
  831|       |
  832|       |        /* fill the segment with diagonal reconstructed output */
  833|  40.5k|        for(i4_i = 0; i4_i < u1_seg_ht; i4_i++)
  ------------------
  |  Branch (833:23): [True: 34.6k, False: 5.95k]
  ------------------
  834|  34.6k|        {
  835|  34.6k|            memcpy(pu1_dst, &u1_out_buf[i4_x_off + i4_i], u1_seg_wd);
  836|  34.6k|            pu1_dst += i4_refarray_stride;
  837|  34.6k|        }
  838|  5.95k|    }
  839|  17.7k|    else if(i1_xd_index > 0 && i1_yd_index > 0)
  ------------------
  |  Branch (839:13): [True: 12.4k, False: 5.30k]
  |  Branch (839:32): [True: 6.00k, False: 6.40k]
  ------------------
  840|  6.00k|    {
  841|       |        /* Quadrant 2 Processing */
  842|       |        /* load the pixel in the filter delay buffer  */
  843|  6.00k|        memcpy(&u1_filter_delay_buf[0], pu1_src_2, (i4_width + 1));
  844|  46.0k|        for(i4_i = i4_height; i4_i > 0; i4_i--)
  ------------------
  |  Branch (844:31): [True: 39.9k, False: 6.00k]
  ------------------
  845|  39.9k|        {
  846|  39.9k|            u1_filter_delay_buf[i4_width + i4_i] = *pu1_src_1;
  847|  39.9k|            pu1_src_1 += i4_refarray_stride;
  848|  39.9k|        }
  849|       |
  850|  6.00k|        if(0 == i4_corner_pixel_available)
  ------------------
  |  Branch (850:12): [True: 5.30k, False: 707]
  ------------------
  851|  5.30k|        {
  852|       |            /* interpolate the unavailable corner pixel */
  853|  5.30k|            u1_filter_delay_buf[i4_width] =
  854|  5.30k|                (u1_filter_delay_buf[i4_width - 1] + u1_filter_delay_buf[i4_width + 1] + 1) >> 1;
  855|  5.30k|        }
  856|       |
  857|  88.0k|        for(i4_i = 0; i4_i < (i4_width + i4_height - 1); i4_i++)
  ------------------
  |  Branch (857:23): [True: 82.0k, False: 6.00k]
  ------------------
  858|  82.0k|        {
  859|       |            /* get the filtered output */
  860|  82.0k|            u1_out_buf[i4_i] = ((u1_filter_delay_buf[i4_i]) + (u1_filter_delay_buf[i4_i + 1] * 2) +
  861|  82.0k|                                (u1_filter_delay_buf[i4_i + 2]) + 2) >>
  862|  82.0k|                               2;
  863|  82.0k|        }
  864|       |
  865|       |        /* fill the segment with diagonal reconstructed output */
  866|  41.2k|        for(i4_i = 1; i4_i <= u1_seg_ht; i4_i++)
  ------------------
  |  Branch (866:23): [True: 35.2k, False: 6.00k]
  ------------------
  867|  35.2k|        {
  868|  35.2k|            memcpy(pu1_dst, &u1_out_buf[i4_height - i4_i], u1_seg_wd);
  869|  35.2k|            pu1_dst += i4_refarray_stride;
  870|  35.2k|        }
  871|  6.00k|    }
  872|  11.7k|    else if(i1_xd_index > 0 && i1_yd_index < 0)
  ------------------
  |  Branch (872:13): [True: 6.40k, False: 5.30k]
  |  Branch (872:32): [True: 6.40k, False: 0]
  ------------------
  873|  6.40k|    {
  874|       |        /* Quadrant 3 Processing */
  875|       |        /* load the pixel in the filter delay buffer  */
  876|  6.40k|        memcpy(&u1_filter_delay_buf[0], pu1_src_2, (i4_width + 1));
  877|       |
  878|  6.40k|        pu1_src_1 -= (i4_y_off * i4_refarray_stride);
  879|  45.7k|        for(i4_i = 1; i4_i <= i4_height; i4_i++)
  ------------------
  |  Branch (879:23): [True: 39.3k, False: 6.40k]
  ------------------
  880|  39.3k|        {
  881|  39.3k|            u1_filter_delay_buf[i4_width + i4_i] = *pu1_src_1;
  882|  39.3k|            pu1_src_1 += i4_refarray_stride;
  883|  39.3k|        }
  884|       |
  885|  6.40k|        if(0 == i4_corner_pixel_available)
  ------------------
  |  Branch (885:12): [True: 5.80k, False: 599]
  ------------------
  886|  5.80k|        {
  887|       |            /* interpolate the unavailable corner pixel */
  888|  5.80k|            u1_filter_delay_buf[i4_width] =
  889|  5.80k|                (u1_filter_delay_buf[i4_width - 1] + u1_filter_delay_buf[i4_width + 1] + 1) >> 1;
  890|  5.80k|        }
  891|       |
  892|  90.6k|        for(i4_i = 0; i4_i < (i4_width + i4_height - 1); i4_i++)
  ------------------
  |  Branch (892:23): [True: 84.2k, False: 6.40k]
  ------------------
  893|  84.2k|        {
  894|       |            /* get the filtered output */
  895|  84.2k|            u1_out_buf[i4_i] = ((u1_filter_delay_buf[i4_i]) + (u1_filter_delay_buf[i4_i + 1] * 2) +
  896|  84.2k|                                (u1_filter_delay_buf[i4_i + 2]) + 2) >>
  897|  84.2k|                               2;
  898|  84.2k|        }
  899|       |
  900|       |        /* fill the segment with diagonal reconstructed output */
  901|  41.4k|        for(i4_i = 0; i4_i < u1_seg_ht; i4_i++)
  ------------------
  |  Branch (901:23): [True: 35.0k, False: 6.40k]
  ------------------
  902|  35.0k|        {
  903|  35.0k|            memcpy(pu1_dst, &u1_out_buf[i4_y_off + i4_i], u1_seg_wd);
  904|  35.0k|            pu1_dst += i4_refarray_stride;
  905|  35.0k|        }
  906|  6.40k|    }
  907|  5.30k|    else
  908|  5.30k|    {
  909|       |        /* Quadrant 4 Processing */
  910|       |        /* load the pixel in the filter delay buffer  */
  911|  5.30k|        pu1_src_1 += ((u1_seg_ht - 1) * i4_refarray_stride);
  912|  42.7k|        for(i4_i = 0; i4_i <= i4_height; i4_i++)
  ------------------
  |  Branch (912:23): [True: 37.4k, False: 5.30k]
  ------------------
  913|  37.4k|        {
  914|  37.4k|            u1_filter_delay_buf[i4_i] = *pu1_src_1;
  915|  37.4k|            pu1_src_1 -= i4_refarray_stride;
  916|  37.4k|        }
  917|       |
  918|  5.30k|        pu1_src_2 -= i4_x_off;
  919|  5.30k|        memcpy(&u1_filter_delay_buf[i4_i], pu1_src_2, i4_width);
  920|       |
  921|  5.30k|        if(0 == i4_corner_pixel_available)
  ------------------
  |  Branch (921:12): [True: 4.87k, False: 429]
  ------------------
  922|  4.87k|        {
  923|       |            /* interpolate the unavailable corner pixel */
  924|  4.87k|            u1_filter_delay_buf[i4_i - 1] =
  925|  4.87k|                (u1_filter_delay_buf[i4_i] + u1_filter_delay_buf[i4_i - 2] + 1) >> 1;
  926|  4.87k|        }
  927|       |
  928|  71.0k|        for(i4_i = 0; i4_i < (i4_width + i4_height - 1); i4_i++)
  ------------------
  |  Branch (928:23): [True: 65.7k, False: 5.30k]
  ------------------
  929|  65.7k|        {
  930|       |            /* get the filtered output */
  931|  65.7k|            u1_out_buf[i4_i] = ((u1_filter_delay_buf[i4_i]) + (u1_filter_delay_buf[i4_i + 1] * 2) +
  932|  65.7k|                                (u1_filter_delay_buf[i4_i + 2]) + 2) >>
  933|  65.7k|                               2;
  934|  65.7k|        }
  935|       |
  936|       |        /* fill the segment with diagonal reconstructed output */
  937|  34.7k|        for(i4_i = 1; i4_i <= u1_seg_ht; i4_i++)
  ------------------
  |  Branch (937:23): [True: 29.4k, False: 5.30k]
  ------------------
  938|  29.4k|        {
  939|  29.4k|            memcpy(pu1_dst, &u1_out_buf[(u1_seg_ht + i4_x_off) - i4_i], u1_seg_wd);
  940|  29.4k|            pu1_dst += i4_refarray_stride;
  941|  29.4k|        }
  942|  5.30k|    }
  943|  23.6k|}
isvcd_diag_reconstruction_chroma:
  966|  23.6k|{
  967|  23.6k|    WORD32 i4_i;
  968|  23.6k|    UWORD8 u1_filter_delay_buf_cb[18] = {0};
  969|  23.6k|    UWORD8 u1_filter_delay_buf_cr[18] = {0};
  970|  23.6k|    UWORD8 u1_out_buf_cb[16] = {0};
  971|  23.6k|    UWORD8 u1_out_buf_cr[16] = {0};
  972|  23.6k|    WORD32 i4_width, i4_height;
  973|  23.6k|    WORD32 i4_x_off, i4_y_off;
  974|  23.6k|    WORD32 i4_block_size = BLOCK_WIDTH >> 1;
  ------------------
  |  |   64|  23.6k|#define BLOCK_WIDTH 8
  ------------------
  975|  23.6k|    UWORD8 *pu1_src_1_cb, *pu1_src_2_cb, *pu1_dst_cb;
  976|  23.6k|    UWORD8 *pu1_src_1_cr, *pu1_src_2_cr, *pu1_dst_cr;
  977|  23.6k|    WORD32 i4_tmp;
  978|       |
  979|  23.6k|    i4_tmp = i4_x + (i4_y * i4_refarray_stride);
  980|  23.6k|    pu1_dst_cb = pu1_refarray_1 + i4_tmp;
  981|  23.6k|    pu1_dst_cr = pu1_refarray_2 + i4_tmp;
  982|       |
  983|  23.6k|    pu1_src_1_cb = pu1_dst_cb + i1_xd_index;
  984|  23.6k|    pu1_src_1_cr = pu1_dst_cr + i1_xd_index;
  985|  23.6k|    i4_tmp = (i1_yd_index * i4_refarray_stride);
  986|  23.6k|    pu1_src_2_cb = pu1_dst_cb + i4_tmp;
  987|  23.6k|    pu1_src_2_cr = pu1_dst_cr + i4_tmp;
  988|       |
  989|  23.6k|    i4_width = MAX(u1_seg_wd, (((i4_mb_adjoin_x >> 3) ^ 1) * i4_block_size));
  ------------------
  |  |   60|  23.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 16.1k, False: 7.58k]
  |  |  ------------------
  ------------------
  990|  23.6k|    i4_height = MAX(u1_seg_ht, (((i4_mb_adjoin_y >> 4) ^ 1) * i4_block_size));
  ------------------
  |  |   60|  23.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 18.5k, False: 5.09k]
  |  |  ------------------
  ------------------
  991|  23.6k|    i4_x_off = (i4_width - u1_seg_wd);
  992|  23.6k|    i4_y_off = (i4_height - u1_seg_ht);
  993|       |
  994|  23.6k|    if(i1_xd_index < 0 && i1_yd_index > 0)
  ------------------
  |  Branch (994:8): [True: 11.2k, False: 12.4k]
  |  Branch (994:27): [True: 5.95k, False: 5.31k]
  ------------------
  995|  5.95k|    {
  996|       |        /* Quadrant 1 Processing load the pixel in the filter delay buffer */
  997|  32.9k|        for(i4_i = 0; i4_i < (i4_height + 1); i4_i++)
  ------------------
  |  Branch (997:23): [True: 27.0k, False: 5.95k]
  ------------------
  998|  27.0k|        {
  999|  27.0k|            u1_filter_delay_buf_cb[i4_i] = *pu1_src_1_cb;
 1000|  27.0k|            pu1_src_1_cb += i4_refarray_stride;
 1001|  27.0k|            u1_filter_delay_buf_cr[i4_i] = *pu1_src_1_cr;
 1002|  27.0k|            pu1_src_1_cr += i4_refarray_stride;
 1003|  27.0k|        }
 1004|       |
 1005|  5.95k|        pu1_src_2_cb -= i4_x_off;
 1006|  5.95k|        pu1_src_2_cr -= i4_x_off;
 1007|  5.95k|        memcpy(&u1_filter_delay_buf_cb[i4_i], pu1_src_2_cb, i4_width);
 1008|  5.95k|        memcpy(&u1_filter_delay_buf_cr[i4_i], pu1_src_2_cr, i4_width);
 1009|       |
 1010|  5.95k|        if(0 == i4_corner_pixel_available)
  ------------------
  |  Branch (1010:12): [True: 5.56k, False: 388]
  ------------------
 1011|  5.56k|        {
 1012|       |            /* interpolate the unavailable corner pixel */
 1013|  5.56k|            u1_filter_delay_buf_cb[i4_i - 1] =
 1014|  5.56k|                (u1_filter_delay_buf_cb[i4_i] + u1_filter_delay_buf_cb[i4_i - 2] + 1) >> 1;
 1015|       |
 1016|  5.56k|            u1_filter_delay_buf_cr[i4_i - 1] =
 1017|  5.56k|                (u1_filter_delay_buf_cr[i4_i] + u1_filter_delay_buf_cr[i4_i - 2] + 1) >> 1;
 1018|  5.56k|        }
 1019|       |
 1020|  44.8k|        for(i4_i = 0; i4_i < (i4_width + i4_height - 1); i4_i++)
  ------------------
  |  Branch (1020:23): [True: 38.9k, False: 5.95k]
  ------------------
 1021|  38.9k|        {
 1022|       |            /* get the filtered output */
 1023|  38.9k|            u1_out_buf_cb[i4_i] =
 1024|  38.9k|                ((u1_filter_delay_buf_cb[i4_i]) + (u1_filter_delay_buf_cb[i4_i + 1] * 2) +
 1025|  38.9k|                 (u1_filter_delay_buf_cb[i4_i + 2]) + 2) >>
 1026|  38.9k|                2;
 1027|       |
 1028|  38.9k|            u1_out_buf_cr[i4_i] =
 1029|  38.9k|                ((u1_filter_delay_buf_cr[i4_i]) + (u1_filter_delay_buf_cr[i4_i + 1] * 2) +
 1030|  38.9k|                 (u1_filter_delay_buf_cr[i4_i + 2]) + 2) >>
 1031|  38.9k|                2;
 1032|  38.9k|        }
 1033|       |
 1034|       |        /* fill the segment with diagonal reconstructed output */
 1035|  24.0k|        for(i4_i = 0; i4_i < u1_seg_ht; i4_i++)
  ------------------
  |  Branch (1035:23): [True: 18.0k, False: 5.95k]
  ------------------
 1036|  18.0k|        {
 1037|  18.0k|            memcpy(pu1_dst_cb, &u1_out_buf_cb[i4_x_off + i4_i], u1_seg_wd);
 1038|  18.0k|            pu1_dst_cb += i4_refarray_stride;
 1039|  18.0k|            memcpy(pu1_dst_cr, &u1_out_buf_cr[i4_x_off + i4_i], u1_seg_wd);
 1040|  18.0k|            pu1_dst_cr += i4_refarray_stride;
 1041|  18.0k|        }
 1042|  5.95k|    }
 1043|  17.7k|    else if(i1_xd_index > 0 && i1_yd_index > 0)
  ------------------
  |  Branch (1043:13): [True: 12.4k, False: 5.31k]
  |  Branch (1043:32): [True: 6.00k, False: 6.40k]
  ------------------
 1044|  6.00k|    {
 1045|       |        /* Quadrant 2 Processing load the pixel in the filter delay buffer  */
 1046|  6.00k|        memcpy(&u1_filter_delay_buf_cb[0], pu1_src_2_cb, (i4_width + 1));
 1047|  6.00k|        memcpy(&u1_filter_delay_buf_cr[0], pu1_src_2_cr, (i4_width + 1));
 1048|       |
 1049|  26.7k|        for(i4_i = i4_height; i4_i > 0; i4_i--)
  ------------------
  |  Branch (1049:31): [True: 20.7k, False: 6.00k]
  ------------------
 1050|  20.7k|        {
 1051|  20.7k|            u1_filter_delay_buf_cb[i4_width + i4_i] = *pu1_src_1_cb;
 1052|  20.7k|            pu1_src_1_cb += i4_refarray_stride;
 1053|       |
 1054|  20.7k|            u1_filter_delay_buf_cr[i4_width + i4_i] = *pu1_src_1_cr;
 1055|  20.7k|            pu1_src_1_cr += i4_refarray_stride;
 1056|  20.7k|        }
 1057|       |
 1058|  6.00k|        if(0 == i4_corner_pixel_available)
  ------------------
  |  Branch (1058:12): [True: 5.30k, False: 707]
  ------------------
 1059|  5.30k|        {
 1060|       |            /* interpolate the unavailable corner pixel */
 1061|  5.30k|            u1_filter_delay_buf_cb[i4_width] =
 1062|  5.30k|                (u1_filter_delay_buf_cb[i4_width - 1] + u1_filter_delay_buf_cb[i4_width + 1] + 1) >>
 1063|  5.30k|                1;
 1064|       |
 1065|  5.30k|            u1_filter_delay_buf_cr[i4_width] =
 1066|  5.30k|                (u1_filter_delay_buf_cr[i4_width - 1] + u1_filter_delay_buf_cr[i4_width + 1] + 1) >>
 1067|  5.30k|                1;
 1068|  5.30k|        }
 1069|       |
 1070|  44.8k|        for(i4_i = 0; i4_i < (i4_width + i4_height - 1); i4_i++)
  ------------------
  |  Branch (1070:23): [True: 38.7k, False: 6.00k]
  ------------------
 1071|  38.7k|        {
 1072|       |            /* get the filtered output */
 1073|  38.7k|            u1_out_buf_cb[i4_i] =
 1074|  38.7k|                ((u1_filter_delay_buf_cb[i4_i]) + (u1_filter_delay_buf_cb[i4_i + 1] * 2) +
 1075|  38.7k|                 (u1_filter_delay_buf_cb[i4_i + 2]) + 2) >>
 1076|  38.7k|                2;
 1077|       |
 1078|  38.7k|            u1_out_buf_cr[i4_i] =
 1079|  38.7k|                ((u1_filter_delay_buf_cr[i4_i]) + (u1_filter_delay_buf_cr[i4_i + 1] * 2) +
 1080|  38.7k|                 (u1_filter_delay_buf_cr[i4_i + 2]) + 2) >>
 1081|  38.7k|                2;
 1082|  38.7k|        }
 1083|       |
 1084|       |        /* fill the segment with diagonal reconstructed output */
 1085|  24.3k|        for(i4_i = 1; i4_i <= u1_seg_ht; i4_i++)
  ------------------
  |  Branch (1085:23): [True: 18.3k, False: 6.00k]
  ------------------
 1086|  18.3k|        {
 1087|  18.3k|            memcpy(pu1_dst_cb, &u1_out_buf_cb[i4_height - i4_i], u1_seg_wd);
 1088|  18.3k|            pu1_dst_cb += i4_refarray_stride;
 1089|       |
 1090|  18.3k|            memcpy(pu1_dst_cr, &u1_out_buf_cr[i4_height - i4_i], u1_seg_wd);
 1091|  18.3k|            pu1_dst_cr += i4_refarray_stride;
 1092|  18.3k|        }
 1093|  6.00k|    }
 1094|  11.7k|    else if(i1_xd_index > 0 && i1_yd_index < 0)
  ------------------
  |  Branch (1094:13): [True: 6.40k, False: 5.31k]
  |  Branch (1094:32): [True: 6.40k, False: 0]
  ------------------
 1095|  6.40k|    {
 1096|       |        /* Quadrant 3 Processing load the pixel in the filter delay buffer  */
 1097|  6.40k|        memcpy(&u1_filter_delay_buf_cb[0], pu1_src_2_cb, (i4_width + 1));
 1098|  6.40k|        memcpy(&u1_filter_delay_buf_cr[0], pu1_src_2_cr, (i4_width + 1));
 1099|       |
 1100|  6.40k|        i4_tmp = (i4_y_off * i4_refarray_stride);
 1101|  6.40k|        pu1_src_1_cb -= i4_tmp;
 1102|  6.40k|        pu1_src_1_cr -= i4_tmp;
 1103|  27.3k|        for(i4_i = 1; i4_i <= i4_height; i4_i++)
  ------------------
  |  Branch (1103:23): [True: 20.9k, False: 6.40k]
  ------------------
 1104|  20.9k|        {
 1105|  20.9k|            u1_filter_delay_buf_cb[i4_width + i4_i] = *pu1_src_1_cb;
 1106|  20.9k|            pu1_src_1_cb += i4_refarray_stride;
 1107|       |
 1108|  20.9k|            u1_filter_delay_buf_cr[i4_width + i4_i] = *pu1_src_1_cr;
 1109|  20.9k|            pu1_src_1_cr += i4_refarray_stride;
 1110|  20.9k|        }
 1111|       |
 1112|  6.40k|        if(0 == i4_corner_pixel_available)
  ------------------
  |  Branch (1112:12): [True: 5.80k, False: 599]
  ------------------
 1113|  5.80k|        {
 1114|       |            /* interpolate the unavailable corner pixel */
 1115|  5.80k|            u1_filter_delay_buf_cb[i4_width] =
 1116|  5.80k|                (u1_filter_delay_buf_cb[i4_width - 1] + u1_filter_delay_buf_cb[i4_width + 1] + 1) >>
 1117|  5.80k|                1;
 1118|       |
 1119|  5.80k|            u1_filter_delay_buf_cr[i4_width] =
 1120|  5.80k|                (u1_filter_delay_buf_cr[i4_width - 1] + u1_filter_delay_buf_cr[i4_width + 1] + 1) >>
 1121|  5.80k|                1;
 1122|  5.80k|        }
 1123|       |
 1124|  46.5k|        for(i4_i = 0; i4_i < (i4_width + i4_height - 1); i4_i++)
  ------------------
  |  Branch (1124:23): [True: 40.1k, False: 6.40k]
  ------------------
 1125|  40.1k|        {
 1126|       |            /* get the filtered output */
 1127|  40.1k|            u1_out_buf_cb[i4_i] =
 1128|  40.1k|                ((u1_filter_delay_buf_cb[i4_i]) + (u1_filter_delay_buf_cb[i4_i + 1] * 2) +
 1129|  40.1k|                 (u1_filter_delay_buf_cb[i4_i + 2]) + 2) >>
 1130|  40.1k|                2;
 1131|       |
 1132|  40.1k|            u1_out_buf_cr[i4_i] =
 1133|  40.1k|                ((u1_filter_delay_buf_cr[i4_i]) + (u1_filter_delay_buf_cr[i4_i + 1] * 2) +
 1134|  40.1k|                 (u1_filter_delay_buf_cr[i4_i + 2]) + 2) >>
 1135|  40.1k|                2;
 1136|  40.1k|        }
 1137|       |
 1138|       |        /* fill the segment with diagonal reconstructed output */
 1139|  25.9k|        for(i4_i = 0; i4_i < u1_seg_ht; i4_i++)
  ------------------
  |  Branch (1139:23): [True: 19.5k, False: 6.40k]
  ------------------
 1140|  19.5k|        {
 1141|  19.5k|            memcpy(pu1_dst_cb, &u1_out_buf_cb[i4_y_off + i4_i], u1_seg_wd);
 1142|  19.5k|            pu1_dst_cb += i4_refarray_stride;
 1143|  19.5k|            memcpy(pu1_dst_cr, &u1_out_buf_cr[i4_y_off + i4_i], u1_seg_wd);
 1144|  19.5k|            pu1_dst_cr += i4_refarray_stride;
 1145|  19.5k|        }
 1146|  6.40k|    }
 1147|  5.31k|    else
 1148|  5.31k|    {
 1149|       |        /* Quadrant 4 Processing load the pixel in the filter delay buffer  */
 1150|  5.31k|        i4_tmp = ((u1_seg_ht - 1) * i4_refarray_stride);
 1151|  5.31k|        pu1_src_1_cb += i4_tmp;
 1152|  5.31k|        pu1_src_1_cr += i4_tmp;
 1153|       |
 1154|  27.8k|        for(i4_i = 0; i4_i <= i4_height; i4_i++)
  ------------------
  |  Branch (1154:23): [True: 22.5k, False: 5.31k]
  ------------------
 1155|  22.5k|        {
 1156|  22.5k|            u1_filter_delay_buf_cb[i4_i] = *pu1_src_1_cb;
 1157|  22.5k|            pu1_src_1_cb -= i4_refarray_stride;
 1158|       |
 1159|  22.5k|            u1_filter_delay_buf_cr[i4_i] = *pu1_src_1_cr;
 1160|  22.5k|            pu1_src_1_cr -= i4_refarray_stride;
 1161|  22.5k|        }
 1162|       |
 1163|  5.31k|        pu1_src_2_cb -= i4_x_off;
 1164|  5.31k|        pu1_src_2_cr -= i4_x_off;
 1165|  5.31k|        memcpy(&u1_filter_delay_buf_cb[i4_i], pu1_src_2_cb, i4_width);
 1166|  5.31k|        memcpy(&u1_filter_delay_buf_cr[i4_i], pu1_src_2_cr, i4_width);
 1167|       |
 1168|  5.31k|        if(0 == i4_corner_pixel_available)
  ------------------
  |  Branch (1168:12): [True: 4.88k, False: 429]
  ------------------
 1169|  4.88k|        {
 1170|       |            /* interpolate the unavailable corner pixel */
 1171|  4.88k|            u1_filter_delay_buf_cb[i4_i - 1] =
 1172|  4.88k|                (u1_filter_delay_buf_cb[i4_i] + u1_filter_delay_buf_cb[i4_i - 2] + 1) >> 1;
 1173|       |
 1174|  4.88k|            u1_filter_delay_buf_cr[i4_i - 1] =
 1175|  4.88k|                (u1_filter_delay_buf_cr[i4_i] + u1_filter_delay_buf_cr[i4_i - 2] + 1) >> 1;
 1176|  4.88k|        }
 1177|       |
 1178|  38.4k|        for(i4_i = 0; i4_i < (i4_width + i4_height - 1); i4_i++)
  ------------------
  |  Branch (1178:23): [True: 33.1k, False: 5.31k]
  ------------------
 1179|  33.1k|        {
 1180|       |            /* get the filtered output */
 1181|  33.1k|            u1_out_buf_cb[i4_i] =
 1182|  33.1k|                ((u1_filter_delay_buf_cb[i4_i]) + (u1_filter_delay_buf_cb[i4_i + 1] * 2) +
 1183|  33.1k|                 (u1_filter_delay_buf_cb[i4_i + 2]) + 2) >>
 1184|  33.1k|                2;
 1185|       |
 1186|  33.1k|            u1_out_buf_cr[i4_i] =
 1187|  33.1k|                ((u1_filter_delay_buf_cr[i4_i]) + (u1_filter_delay_buf_cr[i4_i + 1] * 2) +
 1188|  33.1k|                 (u1_filter_delay_buf_cr[i4_i + 2]) + 2) >>
 1189|  33.1k|                2;
 1190|  33.1k|        }
 1191|       |
 1192|       |        /* fill the segment with diagonal reconstructed output */
 1193|  21.5k|        for(i4_i = 1; i4_i <= u1_seg_ht; i4_i++)
  ------------------
  |  Branch (1193:23): [True: 16.2k, False: 5.31k]
  ------------------
 1194|  16.2k|        {
 1195|  16.2k|            memcpy(pu1_dst_cb, &u1_out_buf_cb[(u1_seg_ht + i4_x_off) - i4_i], u1_seg_wd);
 1196|  16.2k|            pu1_dst_cb += i4_refarray_stride;
 1197|  16.2k|            memcpy(pu1_dst_cr, &u1_out_buf_cr[(u1_seg_ht + i4_x_off) - i4_i], u1_seg_wd);
 1198|  16.2k|            pu1_dst_cr += i4_refarray_stride;
 1199|  16.2k|        }
 1200|  5.31k|    }
 1201|  23.6k|}
isvcd_diag_padding:
 1224|  18.7k|{
 1225|  18.7k|    WORD32 i4_idx_i;
 1226|  18.7k|    UWORD8 *pu1_src, *pu1_dst;
 1227|       |
 1228|  18.7k|    UNUSED(pu1_refarray_2);
  ------------------
  |  |   45|  18.7k|#define UNUSED(x) ((void)(x))
  ------------------
 1229|  18.7k|    UNUSED(i4_mb_adjoin_x);
  ------------------
  |  |   45|  18.7k|#define UNUSED(x) ((void)(x))
  ------------------
 1230|  18.7k|    UNUSED(i4_mb_adjoin_y);
  ------------------
  |  |   45|  18.7k|#define UNUSED(x) ((void)(x))
  ------------------
 1231|  18.7k|    UNUSED(i4_corner_pixel_available);
  ------------------
  |  |   45|  18.7k|#define UNUSED(x) ((void)(x))
  ------------------
 1232|       |
 1233|  18.7k|    pu1_dst = pu1_refarray_1 + i4_x + (i4_y * i4_refarray_stride);
 1234|  18.7k|    pu1_src = pu1_dst + i1_xd_index + (i1_yd_index * i4_refarray_stride);
 1235|  18.7k|    i1_xd_index = MIN(i1_xd_index, MAX_PIX_FILL_LUMA);
  ------------------
  |  |   61|  18.7k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 15.5k, False: 3.27k]
  |  |  ------------------
  ------------------
 1236|  18.7k|    u1_seg_wd = MIN(u1_seg_wd, MAX_PIX_FILL_LUMA);
  ------------------
  |  |   61|  18.7k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 13.9k, False: 4.85k]
  |  |  ------------------
  ------------------
 1237|  18.7k|    i1_yd_index = MIN(i1_yd_index, MAX_PIX_FILL_LUMA);
  ------------------
  |  |   61|  18.7k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 14.7k, False: 4.06k]
  |  |  ------------------
  ------------------
 1238|  18.7k|    u1_seg_ht = MIN(u1_seg_ht, MAX_PIX_FILL_LUMA);
  ------------------
  |  |   61|  18.7k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 10.3k, False: 8.39k]
  |  |  ------------------
  ------------------
 1239|  18.7k|    pu1_dst = pu1_src - i1_xd_index - (i1_yd_index * i4_refarray_stride);
 1240|       |
 1241|  78.9k|    for(i4_idx_i = 0; i4_idx_i < u1_seg_ht; i4_idx_i++)
  ------------------
  |  Branch (1241:23): [True: 60.1k, False: 18.7k]
  ------------------
 1242|  60.1k|    {
 1243|  60.1k|        memset(pu1_dst, *pu1_src, u1_seg_wd);
 1244|  60.1k|        pu1_dst += i4_refarray_stride;
 1245|  60.1k|    }
 1246|  18.7k|}
isvcd_diag_padding_chroma:
 1271|  18.7k|{
 1272|  18.7k|    WORD32 i4_idx_i;
 1273|  18.7k|    UWORD8 *pu1_src_cb, *pu1_dst_cb;
 1274|  18.7k|    UWORD8 *pu1_src_cr, *pu1_dst_cr;
 1275|  18.7k|    WORD32 i4_tmp;
 1276|       |
 1277|  18.7k|    UNUSED(i4_mb_adjoin_x);
  ------------------
  |  |   45|  18.7k|#define UNUSED(x) ((void)(x))
  ------------------
 1278|  18.7k|    UNUSED(i4_mb_adjoin_y);
  ------------------
  |  |   45|  18.7k|#define UNUSED(x) ((void)(x))
  ------------------
 1279|  18.7k|    UNUSED(i4_corner_pixel_available);
  ------------------
  |  |   45|  18.7k|#define UNUSED(x) ((void)(x))
  ------------------
 1280|       |
 1281|  18.7k|    i4_tmp = i4_x + (i4_y * i4_refarray_stride);
 1282|  18.7k|    pu1_dst_cb = pu1_refarray_1 + i4_tmp;
 1283|  18.7k|    pu1_dst_cr = pu1_refarray_2 + i4_tmp;
 1284|  18.7k|    i4_tmp = i1_xd_index + (i1_yd_index * i4_refarray_stride);
 1285|  18.7k|    pu1_src_cb = pu1_dst_cb + i4_tmp;
 1286|  18.7k|    pu1_src_cr = pu1_dst_cr + i4_tmp;
 1287|       |
 1288|  18.7k|    i1_xd_index = MIN(i1_xd_index, MAX_PIX_FILL_LUMA);
  ------------------
  |  |   61|  18.7k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 15.5k, False: 3.27k]
  |  |  ------------------
  ------------------
 1289|  18.7k|    u1_seg_wd = MIN(u1_seg_wd, MAX_PIX_FILL_LUMA);
  ------------------
  |  |   61|  18.7k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 13.9k, False: 4.85k]
  |  |  ------------------
  ------------------
 1290|  18.7k|    i1_yd_index = MIN(i1_yd_index, MAX_PIX_FILL_LUMA);
  ------------------
  |  |   61|  18.7k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 14.7k, False: 4.06k]
  |  |  ------------------
  ------------------
 1291|  18.7k|    u1_seg_ht = MIN(u1_seg_ht, MAX_PIX_FILL_LUMA);
  ------------------
  |  |   61|  18.7k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 10.5k, False: 8.19k]
  |  |  ------------------
  ------------------
 1292|       |
 1293|  18.7k|    i4_tmp = (i1_xd_index + (i1_yd_index * i4_refarray_stride));
 1294|  18.7k|    pu1_dst_cb = pu1_src_cb - i4_tmp;
 1295|  18.7k|    pu1_dst_cr = pu1_src_cr - i4_tmp;
 1296|       |
 1297|  68.2k|    for(i4_idx_i = 0; i4_idx_i < u1_seg_ht; i4_idx_i++)
  ------------------
  |  Branch (1297:23): [True: 49.4k, False: 18.7k]
  ------------------
 1298|  49.4k|    {
 1299|  49.4k|        memset(pu1_dst_cb, *pu1_src_cb, u1_seg_wd);
 1300|  49.4k|        pu1_dst_cb += i4_refarray_stride;
 1301|  49.4k|        memset(pu1_dst_cr, *pu1_src_cr, u1_seg_wd);
 1302|  49.4k|        pu1_dst_cr += i4_refarray_stride;
 1303|  49.4k|    }
 1304|  18.7k|}
isvcd_corner_samp_dyadic:
 1335|  25.3k|{
 1336|  25.3k|    WORD32 i4_ref_xD, i4_ref_yD;
 1337|  25.3k|    WORD32 i4_c_ref_xD, i4_c_ref_yD;
 1338|  25.3k|    WORD32 i4_xc, i4_yc;
 1339|  25.3k|    WORD32 i4_c_xc, i4_c_yc;
 1340|  25.3k|    WORD32 i4_samp1, i4_samp2;
 1341|  25.3k|    UWORD8 *pu1_tmp_src, *pu1_tmp_dst;
 1342|       |
 1343|  25.3k|    i4_ref_xD = i4_x - i4_xD;
 1344|  25.3k|    i4_ref_yD = i4_y - i4_yD;
 1345|  25.3k|    i4_xc = i4_ref_xD + SIGN(i4_xD);
  ------------------
  |  |  103|  25.3k|#define SIGN(x)     (((x) >= 0) ? (((x) > 0) ? 1 : 0) : -1)
  |  |  ------------------
  |  |  |  Branch (103:22): [True: 12.5k, False: 12.7k]
  |  |  |  Branch (103:36): [True: 12.5k, False: 0]
  |  |  ------------------
  ------------------
 1346|  25.3k|    i4_yc = i4_ref_yD + SIGN(i4_yD);
  ------------------
  |  |  103|  25.3k|#define SIGN(x)     (((x) >= 0) ? (((x) > 0) ? 1 : 0) : -1)
  |  |  ------------------
  |  |  |  Branch (103:22): [True: 12.4k, False: 12.8k]
  |  |  |  Branch (103:36): [True: 12.4k, False: 0]
  |  |  ------------------
  ------------------
 1347|       |
 1348|       |    /* Luma */
 1349|  25.3k|    pu1_tmp_src = pu1_refarray_y + (i4_yc * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  25.3k|#define DYADIC_REF_W_Y 20
  ------------------
 1350|  25.3k|    i4_samp1 = pu1_tmp_src[i4_ref_xD];
 1351|  25.3k|    pu1_tmp_src = pu1_refarray_y + (i4_ref_yD * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  25.3k|#define DYADIC_REF_W_Y 20
  ------------------
 1352|  25.3k|    i4_samp2 = pu1_tmp_src[i4_xc];
 1353|  25.3k|    pu1_tmp_dst = pu1_tmp_src;
 1354|  25.3k|    pu1_tmp_dst[i4_ref_xD] = (i4_samp1 + i4_samp2 + 1) >> 1;
 1355|       |
 1356|       |    /* Chroma */
 1357|  25.3k|    i4_c_ref_xD = i4_ref_xD >> 1;
 1358|  25.3k|    i4_c_ref_yD = i4_ref_yD >> 1;
 1359|  25.3k|    i4_c_xc = i4_c_ref_xD + SIGN(i4_xD);
  ------------------
  |  |  103|  25.3k|#define SIGN(x)     (((x) >= 0) ? (((x) > 0) ? 1 : 0) : -1)
  |  |  ------------------
  |  |  |  Branch (103:22): [True: 12.5k, False: 12.7k]
  |  |  |  Branch (103:36): [True: 12.5k, False: 0]
  |  |  ------------------
  ------------------
 1360|  25.3k|    i4_c_yc = i4_c_ref_yD + SIGN(i4_yD);
  ------------------
  |  |  103|  25.3k|#define SIGN(x)     (((x) >= 0) ? (((x) > 0) ? 1 : 0) : -1)
  |  |  ------------------
  |  |  |  Branch (103:22): [True: 12.4k, False: 12.8k]
  |  |  |  Branch (103:36): [True: 12.4k, False: 0]
  |  |  ------------------
  ------------------
 1361|       |
 1362|       |    /* Cb */
 1363|  25.3k|    pu1_tmp_src = pu1_refarray_cb + (i4_c_yc * DYADIC_REF_W_C);
  ------------------
  |  |   58|  25.3k|#define DYADIC_REF_W_C 10
  ------------------
 1364|  25.3k|    i4_samp1 = pu1_tmp_src[i4_c_ref_xD];
 1365|  25.3k|    pu1_tmp_src = pu1_refarray_cb + (i4_c_ref_yD * DYADIC_REF_W_C);
  ------------------
  |  |   58|  25.3k|#define DYADIC_REF_W_C 10
  ------------------
 1366|  25.3k|    i4_samp2 = pu1_tmp_src[i4_c_xc];
 1367|  25.3k|    pu1_tmp_dst = pu1_tmp_src;
 1368|  25.3k|    pu1_tmp_dst[i4_c_ref_xD] = (i4_samp1 + i4_samp2 + 1) >> 1;
 1369|       |
 1370|       |    /* Cr */
 1371|  25.3k|    pu1_tmp_src = pu1_refarray_cr + (i4_c_yc * DYADIC_REF_W_C);
  ------------------
  |  |   58|  25.3k|#define DYADIC_REF_W_C 10
  ------------------
 1372|  25.3k|    i4_samp1 = pu1_tmp_src[i4_c_ref_xD];
 1373|  25.3k|    pu1_tmp_src = pu1_refarray_cr + (i4_c_ref_yD * DYADIC_REF_W_C);
  ------------------
  |  |   58|  25.3k|#define DYADIC_REF_W_C 10
  ------------------
 1374|  25.3k|    i4_samp2 = pu1_tmp_src[i4_c_xc];
 1375|  25.3k|    pu1_tmp_dst = pu1_tmp_src;
 1376|  25.3k|    pu1_tmp_dst[i4_c_ref_xD] = (i4_samp1 + i4_samp2 + 1) >> 1;
 1377|  25.3k|}
isvcd_fill_non_avail_pixel:
 1408|  82.6k|{
 1409|       |    /* --------------------------------------------------------------------- */
 1410|       |    /* Index Variables                                                         */
 1411|       |    /* --------------------------------------------------------------------- */
 1412|  82.6k|    intra_samp_map_ctxt_t *ps_map_ctxt;
 1413|  82.6k|    ref_mb_map_t *ps_x_off_len;
 1414|  82.6k|    ref_mb_map_t *ps_y_off_len;
 1415|  82.6k|    WORD32 i4_x, i4_y;
 1416|  82.6k|    WORD32 i4_corner_pixel_available;
 1417|       |
 1418|       |    /* --------------------------------------------------------------------- */
 1419|       |    /* Local Pointer Declaration for Segment lookup                             */
 1420|       |    /* --------------------------------------------------------------------- */
 1421|  82.6k|    seg_lookup_desc_t *ps_segments_x;
 1422|  82.6k|    seg_lookup_desc_t *ps_segments_y;
 1423|  82.6k|    seg_description_t *ps_seg_desc_x, *ps_seg_desc_y;
 1424|  82.6k|    seg_description_t *ps_seg_x_tmp, *ps_seg_y_tmp;
 1425|  82.6k|    UWORD8 u1_num_sgmts_x, u1_num_sgmts_y;
 1426|       |
 1427|       |    /* --------------------------------------------------------------------- */
 1428|       |    /* Temp Variables for Mapping context                                     */
 1429|       |    /* --------------------------------------------------------------------- */
 1430|  82.6k|    WORD32 i4_x_offset;
 1431|  82.6k|    WORD32 i4_y_offset;
 1432|  82.6k|    WORD32 i4_refmb_wd;
 1433|  82.6k|    WORD32 i4_refmb_ht;
 1434|  82.6k|    WORD32 i4_mbaddr_x;
 1435|  82.6k|    WORD32 i4_mbaddr_y;
 1436|  82.6k|    WORD32 i4_xr_index, i4_yr_index;
 1437|  82.6k|    WORD32 i4_j, i4_i;
 1438|  82.6k|    WORD32 i4_cur_x;
 1439|  82.6k|    UWORD32 u4_lookup_4bit, u4_lookup_5bit, u4_4thbit;
 1440|  82.6k|    WORD32 i4_pad_size;
 1441|  82.6k|    WORD32 i4_x_min;
 1442|  82.6k|    WORD32 i4_y_min;
 1443|  82.6k|    WORD32 i4_x_start_pos, i4_y_start_pos;
 1444|  82.6k|    ref_min_max_map_t *ps_x_min_max;
 1445|  82.6k|    ref_min_max_map_t *ps_y_min_max;
 1446|  82.6k|    UWORD8 *pu1_ref_idx_x, *pu1_ref_idx_y;
 1447|  82.6k|    ftype_intra_samp_padding *pf_intra_samp_padding;
 1448|  82.6k|    ftype_intra_samp_padding **pf_intra_samp_lookup;
 1449|       |
 1450|  82.6k|    ps_map_ctxt = (intra_samp_map_ctxt_t *) pv_map_ctxt;
 1451|  82.6k|    ps_x_min_max = ps_map_ctxt->ps_x_min_max;
 1452|  82.6k|    ps_y_min_max = ps_map_ctxt->ps_y_min_max;
 1453|  82.6k|    ps_x_off_len = ps_map_ctxt->ps_x_offset_length;
 1454|  82.6k|    ps_y_off_len = ps_map_ctxt->ps_y_offset_length;
 1455|  82.6k|    i4_mbaddr_y = ps_mb_coord->u2_mb_y;
 1456|  82.6k|    i4_mbaddr_x = ps_mb_coord->u2_mb_x;
 1457|  82.6k|    i4_x_offset = ps_x_off_len[i4_mbaddr_x].i2_offset;
 1458|  82.6k|    i4_y_offset = ps_y_off_len[i4_mbaddr_y].i2_offset;
 1459|  82.6k|    i4_refmb_wd = (MB_WIDTH >> i4_chroma_flag) - 1;
  ------------------
  |  |   67|  82.6k|#define MB_WIDTH 16
  ------------------
 1460|  82.6k|    i4_refmb_ht = (MB_HEIGHT >> i4_chroma_flag) - 1;
  ------------------
  |  |   68|  82.6k|#define MB_HEIGHT 16
  ------------------
 1461|       |
 1462|  82.6k|    if(0 == i4_chroma_flag)
  ------------------
  |  Branch (1462:8): [True: 41.1k, False: 41.4k]
  ------------------
 1463|  41.1k|    {
 1464|  41.1k|        pf_intra_samp_lookup = gpf_lookup_fxns_luma;
 1465|  41.1k|    }
 1466|  41.4k|    else
 1467|  41.4k|    {
 1468|  41.4k|        pf_intra_samp_lookup = gpf_lookup_fxns_chroma;
 1469|  41.4k|    }
 1470|       |
 1471|       |    /* get the min and max positions */
 1472|  82.6k|    i4_x_min = ps_x_min_max[i4_mbaddr_x].i2_min_pos;
 1473|  82.6k|    i4_y_min = ps_y_min_max[i4_mbaddr_y].i2_min_pos;
 1474|       |
 1475|       |    /* get the start position of the MB in reference layer */
 1476|  82.6k|    i4_pad_size = 2 >> i4_chroma_flag;
 1477|  82.6k|    i4_x_start_pos = (i4_x_min - i4_pad_size);
 1478|  82.6k|    i4_y_start_pos = (i4_y_min - i4_pad_size);
 1479|  82.6k|    i4_xr_index = (i4_x_start_pos + i4_x_offset) & i4_refmb_wd;
 1480|  82.6k|    i4_yr_index = (i4_y_start_pos + i4_y_offset) & i4_refmb_ht;
 1481|       |
 1482|       |    /* Find the number of segments in x and y direction */
 1483|  82.6k|    ps_segments_x = (ps_map_ctxt->ps_seg_lookup_horz + i4_xr_index);
 1484|  82.6k|    ps_segments_y = (ps_map_ctxt->ps_seg_lookup_vert + i4_yr_index);
 1485|  82.6k|    u1_num_sgmts_x = ps_segments_x->u1_num_segments;
 1486|  82.6k|    u1_num_sgmts_y = ps_segments_y->u1_num_segments;
 1487|  82.6k|    ps_seg_desc_x = ps_segments_x->s_segments;
 1488|  82.6k|    ps_seg_desc_y = ps_segments_y->s_segments;
 1489|  82.6k|    pu1_ref_idx_x = ps_map_ctxt->pu1_refarray_x_idx;
 1490|  82.6k|    pu1_ref_idx_y = ps_map_ctxt->pu1_refarray_y_idx;
 1491|  82.6k|    i4_cur_x = pu1_ref_idx_x[i4_x_start_pos];
 1492|  82.6k|    u4_4thbit = ps_segments_x->u4_start_pos;
 1493|       |
 1494|   297k|    for(i4_j = 0; i4_j < u1_num_sgmts_y; i4_j++)
  ------------------
  |  Branch (1494:19): [True: 215k, False: 82.6k]
  ------------------
 1495|   215k|    {
 1496|   215k|        UWORD8 i4_idx_a, i4_idx_b;
 1497|   215k|        UWORD8 u1_seg_ht, u1_seg_wd;
 1498|   215k|        UWORD8 u1_mb_adjoin_x, u1_mb_adjoin_y;
 1499|   215k|        WORD8 i1_nearst_mb_bdry_x, i1_nearst_mb_bdry_y;
 1500|   215k|        UWORD32 u4_num_valid_segs;
 1501|   215k|        WORD32 i4_idx_a_plus_ny, i4_idx_b_plus_nx, i4_index;
 1502|   215k|        WORD8 i1_yd_index, i1_xd_index;
 1503|       |
 1504|   215k|        ps_seg_y_tmp = &ps_seg_desc_y[i4_j];
 1505|   215k|        i4_y = i4_y_start_pos + ps_seg_y_tmp->u1_seg_off;
 1506|   215k|        u1_seg_ht = ps_seg_y_tmp->u1_seg_dim;
 1507|   215k|        i1_yd_index = ps_seg_y_tmp->i1_dist_idx;
 1508|   215k|        i1_nearst_mb_bdry_y = ps_seg_y_tmp->i1_nearst_mb_bdry;
 1509|   215k|        u1_mb_adjoin_y = ps_seg_y_tmp->u1_mb_adjoin;
 1510|   215k|        i4_idx_a = pu1_ref_idx_y[i4_y];
 1511|   215k|        i4_idx_a_plus_ny = (i4_idx_a + i1_nearst_mb_bdry_y);
 1512|       |
 1513|       |        /* Pack the availabilities of the next three horizontal MBs in 3bit
 1514|       |           format and 4th bit indicating if the start position is greater than the mb_width/2 */
 1515|   215k|        u4_lookup_4bit = u4_4thbit | u1_avail_map[i4_idx_a][i4_cur_x + 2] << 2 |
 1516|   215k|                         u1_avail_map[i4_idx_a][i4_cur_x + 1] << 1 |
 1517|   215k|                         u1_avail_map[i4_idx_a][i4_cur_x];
 1518|       |
 1519|   215k|        u4_num_valid_segs = gu4_valid_segs_lookup[u4_lookup_4bit];
 1520|   215k|        i4_i = isvcd_left_most_bit_detect(u4_num_valid_segs);
 1521|   215k|        u4_num_valid_segs <<= (i4_i + 1);
 1522|       |
 1523|   617k|        for(; i4_i < u1_num_sgmts_x; i4_i++)
  ------------------
  |  Branch (1523:15): [True: 402k, False: 215k]
  ------------------
 1524|   402k|        {
 1525|   402k|            ps_seg_x_tmp = &ps_seg_desc_x[i4_i];
 1526|   402k|            i4_x = i4_x_start_pos + ps_seg_x_tmp->u1_seg_off;
 1527|   402k|            i4_idx_b = pu1_ref_idx_x[i4_x];
 1528|   402k|            u1_seg_wd = ps_seg_x_tmp->u1_seg_dim;
 1529|   402k|            i1_xd_index = ps_seg_x_tmp->i1_dist_idx;
 1530|   402k|            i1_nearst_mb_bdry_x = ps_seg_x_tmp->i1_nearst_mb_bdry;
 1531|   402k|            u1_mb_adjoin_x = ps_seg_x_tmp->u1_mb_adjoin;
 1532|   402k|            i4_idx_b_plus_nx = (i4_idx_b + i1_nearst_mb_bdry_x);
 1533|       |
 1534|       |            /* Find the avalability of (x,y-Yd),(x-Xd,y),(x-Xd,y-Yd) and pack it to 3 bits */
 1535|   402k|            u4_lookup_5bit = u1_avail_map[i4_idx_a_plus_ny][i4_idx_b_plus_nx] << 2 |
 1536|   402k|                             u1_avail_map[i4_idx_a_plus_ny][i4_idx_b] << 1 |
 1537|   402k|                             u1_avail_map[i4_idx_a][i4_idx_b_plus_nx] | u1_mb_adjoin_x |
 1538|   402k|                             u1_mb_adjoin_y;
 1539|       |
 1540|   402k|            i4_corner_pixel_available = u1_avail_map[i4_idx_a_plus_ny][i4_idx_b_plus_nx];
 1541|       |
 1542|       |            /* Function pointer table from lookup to get Left,Top,Bottom,Right,Diagonal padding */
 1543|   402k|            if(u4_lookup_5bit > 31)
  ------------------
  |  Branch (1543:16): [True: 0, False: 402k]
  ------------------
 1544|      0|            {
 1545|      0|                u4_lookup_5bit = 0;
 1546|      0|            }
 1547|   402k|            pf_intra_samp_padding = pf_intra_samp_lookup[u4_lookup_5bit];
 1548|       |
 1549|   402k|            if(pf_intra_samp_padding != NULL)
  ------------------
  |  Branch (1549:16): [True: 202k, False: 199k]
  ------------------
 1550|   202k|            {
 1551|   202k|                pf_intra_samp_padding(i4_x, i4_y, i1_xd_index, i1_yd_index, u1_seg_wd, u1_seg_ht,
 1552|   202k|                                      pu1_refarray_1, pu1_refarray_2, i4_refarray_stride,
 1553|   202k|                                      u1_mb_adjoin_x, u1_mb_adjoin_y, i4_corner_pixel_available);
 1554|   202k|            }
 1555|       |
 1556|       |            /* increment to the next unavailable segment */
 1557|   402k|            i4_index = isvcd_left_most_bit_detect(u4_num_valid_segs);
 1558|   402k|            u4_num_valid_segs <<= (i4_index + 1);
 1559|   402k|            i4_i += i4_index;
 1560|       |
 1561|   402k|        } /* end of loop over ref array width */
 1562|       |
 1563|   215k|    }     /* end of loop over ref array height */
 1564|  82.6k|    return;
 1565|  82.6k|}
isvcd_get_ref_layer_mbtype:
 1597|   814k|{
 1598|   814k|    WORD8 i1_intra_slice_id;
 1599|   814k|    inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms;
 1600|   814k|    WORD8 i1_mb_mode;
 1601|       |
 1602|   814k|    ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) pi1_ref_mb_modes;
 1603|   814k|    i1_mb_mode = ps_inter_lyr_mb_prms->i1_mb_mode;
 1604|       |
 1605|   814k|    if(i1_mb_mode <= SVC_INTER_MB)
  ------------------
  |  |  114|   814k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (1605:8): [True: 655k, False: 158k]
  ------------------
 1606|   655k|    {
 1607|       |        /* INTER */
 1608|   655k|        *pi4_mb_type = SVC_INTER_MB;
  ------------------
  |  |  114|   655k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
 1609|   655k|        i1_intra_slice_id = -1;
 1610|   655k|    }
 1611|   158k|    else
 1612|   158k|    {
 1613|       |        /* INTRA */
 1614|   158k|        *pi4_mb_type = SVC_INTRA_MB;
  ------------------
  |  |  115|   158k|#define SVC_INTRA_MB (1 << 1)       /*!< P or B MBs decoded or inferred*/
  ------------------
 1615|   158k|        i1_intra_slice_id = ps_inter_lyr_mb_prms->i1_slice_id;
 1616|       |
 1617|   158k|        if(1 == i1_cons_intr_samp_flag)
  ------------------
  |  Branch (1617:12): [True: 17.0k, False: 141k]
  ------------------
 1618|  17.0k|        {
 1619|       |            /* check for different slice idc */
 1620|  17.0k|            if(ps_inter_lyr_mb_prms->i1_slice_id != i1_curr_slice_id)
  ------------------
  |  Branch (1620:16): [True: 4.88k, False: 12.1k]
  ------------------
 1621|  4.88k|            {
 1622|       |                /* store the mode as INTER (not available for upsampling) */
 1623|  4.88k|                *pi4_mb_type = SVC_INTER_MB;
  ------------------
  |  |  114|  4.88k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
 1624|  4.88k|            }
 1625|  17.0k|        }
 1626|   158k|    }
 1627|       |
 1628|       |    /* if contarained intra flag is 1 then check for same mb mode */
 1629|   814k|    return (i1_intra_slice_id);
 1630|   814k|}
isvcd_reflayer_construction:
 1666|  82.9k|{
 1667|  82.9k|    WORD32 i4_x, i4_y;
 1668|       |
 1669|       |    /* --------------------------------------------------------------------- */
 1670|       |    /* Context and reference layer realted varaibles                         */
 1671|       |    /* --------------------------------------------------------------------- */
 1672|  82.9k|    intra_sampling_ctxt_t *ps_ctxt;
 1673|  82.9k|    intra_samp_map_ctxt_t *ps_map_ctxt;
 1674|  82.9k|    intra_samp_lyr_ctxt *ps_lyr_ctxt;
 1675|  82.9k|    WORD8 *pi1_ref_mb_modes, *pi1_ref_mb_modes_bkp_1;
 1676|  82.9k|    WORD32 i4_ref_mode_stride;
 1677|  82.9k|    WORD32 i4_element_size;
 1678|  82.9k|    ref_mb_map_t *ps_x_off_len;
 1679|  82.9k|    ref_mb_map_t *ps_y_off_len;
 1680|  82.9k|    WORD32 i4_mbaddr_y;
 1681|  82.9k|    WORD32 i4_mbaddr_x;
 1682|  82.9k|    WORD32 i4_mb_ht, i4_mb_wd;
 1683|  82.9k|    UWORD8 u1_map_buf[4][4] = {0}; /*!< 4x4 mb grid buffer to store the mb availablity */
 1684|       |    /* --------------------------------------------------------------------- */
 1685|       |    /* Temp Variables for Mapping context                                     */
 1686|       |    /* --------------------------------------------------------------------- */
 1687|  82.9k|    WORD32 i4_ref_wd;
 1688|  82.9k|    WORD32 i4_ref_ht;
 1689|  82.9k|    WORD32 i4_x_offset;
 1690|  82.9k|    WORD32 i4_y_offset;
 1691|  82.9k|    WORD32 i4_refarray_wd;
 1692|  82.9k|    WORD32 i4_refarray_ht;
 1693|  82.9k|    WORD32 i4_mb_type;
 1694|  82.9k|    WORD8 i1_cons_intr_samp_flag;
 1695|  82.9k|    WORD8 i1_slice_id = 0;
 1696|  82.9k|    WORD32 i4_mb_wd_sft, i4_mb_ht_sft;
 1697|       |
 1698|       |    /* --------------------------------------------------------------------- */
 1699|       |    /* Local Pointer Declaration for arrays in Mapping context                 */
 1700|       |    /* --------------------------------------------------------------------- */
 1701|       |
 1702|  82.9k|    WORD32 i4_unfill_check;
 1703|  82.9k|    UWORD8 *pu1_refarray_1, *pu1_refarray_2;
 1704|       |
 1705|  82.9k|    UNUSED(pu1_inp_2);
  ------------------
  |  |   45|  82.9k|#define UNUSED(x) ((void)(x))
  ------------------
 1706|       |
 1707|  82.9k|    ps_ctxt = (intra_sampling_ctxt_t *) pv_intra_samp_ctxt;
 1708|  82.9k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_ctxt->i4_res_lyr_id];
 1709|  82.9k|    pi1_ref_mb_modes = (WORD8 *) ps_ref_mb_mode_map->pv_buffer;
 1710|  82.9k|    i4_ref_mode_stride = ps_ref_mb_mode_map->i4_num_element_stride;
 1711|  82.9k|    i4_element_size = ps_ref_mb_mode_map->i4_element_size;
 1712|       |
 1713|       |    /* get the condtrained intra sampling flag */
 1714|  82.9k|    i1_cons_intr_samp_flag = ps_lyr_ctxt->i1_constrained_intra_rsmpl_flag;
 1715|       |
 1716|  82.9k|    if(NULL == pi1_ref_mb_modes)
  ------------------
  |  Branch (1716:8): [True: 0, False: 82.9k]
  ------------------
 1717|      0|    {
 1718|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1719|      0|    }
 1720|       |
 1721|       |    /* --------------------------------------------------------------------- */
 1722|       |    /* Based on Chroma and Luma, extracting the context information struct     */
 1723|       |    /* --------------------------------------------------------------------- */
 1724|  82.9k|    if(1 == i4_chroma_flag)
  ------------------
  |  Branch (1724:8): [True: 41.4k, False: 41.4k]
  ------------------
 1725|  41.4k|        ps_map_ctxt = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1726|  41.4k|    else
 1727|  41.4k|        ps_map_ctxt = &ps_lyr_ctxt->s_luma_map_ctxt;
 1728|       |
 1729|  82.9k|    ps_x_off_len = ps_map_ctxt->ps_x_offset_length;
 1730|  82.9k|    ps_y_off_len = ps_map_ctxt->ps_y_offset_length;
 1731|       |
 1732|       |    /* --------------------------------------------------------------------- */
 1733|       |    /* Deriving the parameters required for further processing                 */
 1734|       |    /* --------------------------------------------------------------------- */
 1735|  82.9k|    {
 1736|  82.9k|        WORD32 i4_base_width = ps_lyr_ctxt->i4_ref_width;
 1737|  82.9k|        WORD32 i4_base_height = ps_lyr_ctxt->i4_ref_height;
 1738|       |
 1739|  82.9k|        i4_ref_wd = i4_base_width >> i4_chroma_flag;
 1740|  82.9k|        i4_ref_ht = i4_base_height >> i4_chroma_flag;
 1741|  82.9k|        i4_mb_wd_sft = (MB_WIDTH_SHIFT - i4_chroma_flag);
  ------------------
  |  |   70|  82.9k|#define MB_WIDTH_SHIFT 4
  ------------------
 1742|  82.9k|        i4_mb_ht_sft = (MB_HEIGHT_SHIFT - i4_chroma_flag);
  ------------------
  |  |   71|  82.9k|#define MB_HEIGHT_SHIFT 4
  ------------------
 1743|  82.9k|    }
 1744|       |
 1745|       |    /* --------------------------------------------------------------------- */
 1746|       |    /* Local variables based on the MB address                                 */
 1747|       |    /* --------------------------------------------------------------------- */
 1748|  82.9k|    i4_mbaddr_y = ps_coord->u2_mb_y;
 1749|  82.9k|    i4_mbaddr_x = ps_coord->u2_mb_x;
 1750|  82.9k|    i4_x_offset = ps_x_off_len[i4_mbaddr_x].i2_offset;
 1751|  82.9k|    i4_y_offset = ps_y_off_len[i4_mbaddr_y].i2_offset;
 1752|  82.9k|    i4_refarray_wd = ps_x_off_len[i4_mbaddr_x].i2_length;
 1753|  82.9k|    i4_refarray_ht = ps_y_off_len[i4_mbaddr_y].i2_length;
 1754|  82.9k|    i4_mb_wd = (MB_WIDTH >> i4_chroma_flag);
  ------------------
  |  |   67|  82.9k|#define MB_WIDTH 16
  ------------------
 1755|  82.9k|    i4_mb_ht = (MB_HEIGHT >> i4_chroma_flag);
  ------------------
  |  |   68|  82.9k|#define MB_HEIGHT 16
  ------------------
 1756|       |
 1757|       |    /* --------------------------------------------------------------------- */
 1758|       |    /* Derivation of ref slice MB idc                                         */
 1759|       |    /* --------------------------------------------------------------------- */
 1760|  82.9k|    if(1 == i1_cons_intr_samp_flag)
  ------------------
  |  Branch (1760:8): [True: 31.6k, False: 51.2k]
  ------------------
 1761|  31.6k|    {
 1762|  31.6k|        WORD32 i4_x_min, i4_x_max;
 1763|  31.6k|        WORD32 i4_y_min, i4_y_max;
 1764|  31.6k|        ref_min_max_map_t *ps_x_min_max;
 1765|  31.6k|        ref_min_max_map_t *ps_y_min_max;
 1766|       |
 1767|  31.6k|        ps_x_min_max = ps_map_ctxt->ps_x_min_max;
 1768|  31.6k|        ps_y_min_max = ps_map_ctxt->ps_y_min_max;
 1769|       |
 1770|       |        /* get the min and max positions */
 1771|  31.6k|        i4_x_min = ps_x_min_max[i4_mbaddr_x].i2_min_pos;
 1772|  31.6k|        i4_x_max = ps_x_min_max[i4_mbaddr_x].i2_max_pos;
 1773|  31.6k|        i4_y_min = ps_y_min_max[i4_mbaddr_y].i2_min_pos;
 1774|  31.6k|        i4_y_max = ps_y_min_max[i4_mbaddr_y].i2_max_pos;
 1775|       |
 1776|       |        /* default initialization */
 1777|  31.6k|        i4_mb_type = SVC_INTER_MB;
  ------------------
  |  |  114|  31.6k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
 1778|       |
 1779|  31.6k|        {
 1780|  31.6k|            WORD32 i4_x_ref;
 1781|  31.6k|            WORD32 i4_y_ref;
 1782|  31.6k|            WORD32 i4_mb_x, i4_mb_y;
 1783|       |
 1784|  31.6k|            i4_y_ref = (i4_y_min + 1) + i4_y_offset;
 1785|  31.6k|            i4_x_ref = (i4_x_min + 1) + i4_x_offset;
 1786|  31.6k|            i4_mb_x = (i4_x_ref >> i4_mb_wd_sft);
 1787|  31.6k|            i4_mb_y = (i4_y_ref >> i4_mb_ht_sft);
 1788|  31.6k|            pi1_ref_mb_modes = (WORD8 *) ps_ref_mb_mode_map->pv_buffer;
 1789|       |
 1790|       |            /* get the location of the byte which has the current mb mode */
 1791|  31.6k|            pi1_ref_mb_modes += (i4_mb_y * i4_ref_mode_stride * i4_element_size);
 1792|  31.6k|            pi1_ref_mb_modes += (i4_mb_x * i4_element_size);
 1793|  31.6k|        }
 1794|       |
 1795|  66.4k|        for(i4_y = (i4_y_min + 1); i4_y <= (i4_y_max - 1);)
  ------------------
  |  Branch (1795:36): [True: 41.9k, False: 24.5k]
  ------------------
 1796|  41.9k|        {
 1797|  41.9k|            WORD32 i4_x_ref;
 1798|  41.9k|            WORD32 i4_y_ref;
 1799|  41.9k|            WORD32 i4_distleftX, i4_rangeX;
 1800|  41.9k|            WORD32 i4_disttopY, i4_rangeY;
 1801|       |
 1802|  41.9k|            i4_y_ref = (i4_y + i4_y_offset);
 1803|  41.9k|            i4_disttopY = (i4_y_ref) & (i4_mb_ht - 1);
 1804|  41.9k|            i4_rangeY = (i4_mb_ht - i4_disttopY);
 1805|       |
 1806|  41.9k|            pi1_ref_mb_modes_bkp_1 = pi1_ref_mb_modes;
 1807|       |
 1808|  90.0k|            for(i4_x = (i4_x_min + 1); i4_x <= (i4_x_max - 1);)
  ------------------
  |  Branch (1808:40): [True: 55.2k, False: 34.8k]
  ------------------
 1809|  55.2k|            {
 1810|  55.2k|                i4_x_ref = (i4_x + i4_x_offset);
 1811|  55.2k|                i4_distleftX = (i4_x_ref) & (i4_mb_wd - 1);
 1812|  55.2k|                i4_rangeX = (i4_mb_wd - i4_distleftX);
 1813|       |
 1814|       |                /* get the referecne layer mb type */
 1815|  55.2k|                i1_slice_id =
 1816|  55.2k|                    isvcd_get_ref_layer_mbtype(pi1_ref_mb_modes_bkp_1, &i4_mb_type, i1_slice_id, 0);
 1817|  55.2k|                if(SVC_INTRA_MB == i4_mb_type)
  ------------------
  |  |  115|  55.2k|#define SVC_INTRA_MB (1 << 1)       /*!< P or B MBs decoded or inferred*/
  ------------------
  |  Branch (1817:20): [True: 7.13k, False: 48.0k]
  ------------------
 1818|  7.13k|                {
 1819|       |                    /* if an Intra MB is returned then break the loop */
 1820|  7.13k|                    break;
 1821|  7.13k|                }
 1822|       |
 1823|  48.0k|                i4_x += i4_rangeX;
 1824|  48.0k|                pi1_ref_mb_modes_bkp_1 += i4_element_size;
 1825|  48.0k|            } /* end of loop in horizontal direction */
 1826|       |
 1827|  41.9k|            if(SVC_INTRA_MB == i4_mb_type)
  ------------------
  |  |  115|  41.9k|#define SVC_INTRA_MB (1 << 1)       /*!< P or B MBs decoded or inferred*/
  ------------------
  |  Branch (1827:16): [True: 7.13k, False: 34.8k]
  ------------------
 1828|  7.13k|            {
 1829|       |                /* if an Intra MB is returned then break the loop */
 1830|  7.13k|                break;
 1831|  7.13k|            }
 1832|       |
 1833|  34.8k|            i4_y += i4_rangeY;
 1834|  34.8k|            pi1_ref_mb_modes += (i4_ref_mode_stride * i4_element_size);
 1835|       |
 1836|  34.8k|        } /* end of loop in vertical direction */
 1837|  31.6k|    }
 1838|  51.2k|    else
 1839|  51.2k|    {
 1840|       |        /* set to non valid value */
 1841|  51.2k|        i1_slice_id = -1;
 1842|  51.2k|    }
 1843|       |
 1844|  82.9k|    i4_unfill_check = 0;
 1845|       |
 1846|       |    /* --------------------------------------------------------------------- */
 1847|       |    /* Copying the data from recon buffer to refSample Array.                */
 1848|       |    /* NOTE: The copying of the data from recon buffer to refSample Array    */
 1849|       |    /*       can be optimized by bring in data at N-MB level,thus taking     */
 1850|       |    /*       advantage of the overlapping data which now gets copied every MB*/
 1851|       |    /* --------------------------------------------------------------------- */
 1852|  82.9k|    {
 1853|  82.9k|        WORD32 i4_x_ref_start, i4_x_ref_end;
 1854|  82.9k|        WORD32 i4_y_ref_start, i4_y_ref_end;
 1855|  82.9k|        WORD32 i4_rangeW, i4_rangeH;
 1856|  82.9k|        WORD32 i4_offset;
 1857|  82.9k|        UWORD8 *pu1_src, *pu1_dst;
 1858|  82.9k|        UWORD8 *pu1_dst1, *pu1_dst2;
 1859|       |
 1860|       |        /* Copy (refW x refH) dimension into reference sample array */
 1861|  82.9k|        i4_x_ref_start = MAX(0, MIN((i4_ref_wd - 1), i4_x_offset));
  ------------------
  |  |   60|   165k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 40.8k, False: 42.1k]
  |  |  |  Branch (60:24): [True: 0, False: 82.9k]
  |  |  |  Branch (60:32): [True: 0, False: 42.1k]
  |  |  ------------------
  ------------------
 1862|  82.9k|        i4_x_ref_end = MAX(0, MIN((i4_ref_wd - 1), (i4_refarray_wd - 1) + i4_x_offset));
  ------------------
  |  |   60|   165k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 82.9k]
  |  |  |  Branch (60:24): [True: 42.1k, False: 40.8k]
  |  |  |  Branch (60:32): [True: 42.1k, False: 40.8k]
  |  |  ------------------
  ------------------
 1863|  82.9k|        i4_y_ref_start = MAX(0, MIN((i4_ref_ht - 1), i4_y_offset));
  ------------------
  |  |   60|   165k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 16.3k, False: 66.5k]
  |  |  |  Branch (60:24): [True: 0, False: 82.9k]
  |  |  |  Branch (60:32): [True: 0, False: 66.5k]
  |  |  ------------------
  ------------------
 1864|  82.9k|        i4_y_ref_end = MAX(0, MIN((i4_ref_ht - 1), (i4_refarray_ht - 1) + i4_y_offset));
  ------------------
  |  |   60|   165k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 82.9k]
  |  |  |  Branch (60:24): [True: 10.7k, False: 72.2k]
  |  |  |  Branch (60:32): [True: 10.7k, False: 72.2k]
  |  |  ------------------
  ------------------
 1865|       |
 1866|       |        /* find the actual data to be copied */
 1867|  82.9k|        i4_rangeW = (i4_x_ref_end - i4_x_ref_start + 1);
 1868|  82.9k|        i4_rangeH = (i4_y_ref_end - i4_y_ref_start + 1);
 1869|       |
 1870|       |        /* get the reconbuffer pointer and ref sample array pointer */
 1871|  82.9k|        i4_offset =
 1872|  82.9k|            (i4_x_ref_start - i4_x_offset) + ((i4_y_ref_start - i4_y_offset) * i4_refarray_stride);
 1873|       |
 1874|  82.9k|        if(0 == i4_chroma_flag)
  ------------------
  |  Branch (1874:12): [True: 41.4k, False: 41.4k]
  ------------------
 1875|  41.4k|        {
 1876|  41.4k|            pu1_refarray_1 = ps_ctxt->pu1_refarray_buffer;
 1877|  41.4k|            pu1_refarray_2 = NULL;
 1878|  41.4k|            pu1_src = pu1_inp_1;
 1879|  41.4k|            pu1_dst = pu1_refarray_1 + i4_offset;
 1880|       |
 1881|       |            /* Copy luma data into refsample array */
 1882|  41.4k|            isvcd_copy_data(pu1_src, i4_inp_stride, pu1_dst, i4_refarray_stride, i4_rangeW,
 1883|  41.4k|                            i4_rangeH);
 1884|  41.4k|        }
 1885|  41.4k|        else
 1886|  41.4k|        {
 1887|  41.4k|            pu1_refarray_1 = ps_ctxt->pu1_refarray_buffer;
 1888|  41.4k|            pu1_refarray_2 = ps_ctxt->pu1_refarray_cb;
 1889|  41.4k|            pu1_src = pu1_inp_1;
 1890|  41.4k|            pu1_dst1 = pu1_refarray_1 + i4_offset;
 1891|  41.4k|            pu1_dst2 = pu1_refarray_2 + i4_offset;
 1892|  41.4k|            isvcd_copy_data_semiplanr(pu1_src, i4_inp_stride, pu1_dst1, pu1_dst2,
 1893|  41.4k|                                      i4_refarray_stride, i4_rangeW, i4_rangeH);
 1894|  41.4k|        }
 1895|  82.9k|    }
 1896|       |
 1897|       |    /* --------------------------------------------------------------------- */
 1898|       |    /* Loop to fill ref sample array and corresponding map for interpolation */
 1899|       |    /* --------------------------------------------------------------------- */
 1900|  82.9k|    {
 1901|  82.9k|        WORD32 i4_i, i4_j;
 1902|  82.9k|        UWORD8 *pu1_ref_idx_x, *pu1_ref_idx_y;
 1903|  82.9k|        WORD32 i4_x_ref;
 1904|  82.9k|        WORD32 i4_y_ref;
 1905|  82.9k|        WORD32 i4_mb_x, i4_mb_y;
 1906|       |
 1907|  82.9k|        i4_y_ref = i4_y_offset;
 1908|  82.9k|        i4_x_ref = i4_x_offset;
 1909|  82.9k|        i4_mb_x = (i4_x_ref >> i4_mb_wd_sft);
 1910|  82.9k|        i4_mb_y = (i4_y_ref >> i4_mb_ht_sft);
 1911|  82.9k|        pi1_ref_mb_modes = (WORD8 *) ps_ref_mb_mode_map->pv_buffer;
 1912|       |
 1913|       |        /* get the location of the byte which has the current mb mode */
 1914|  82.9k|        pi1_ref_mb_modes += (i4_mb_y * i4_ref_mode_stride * i4_element_size);
 1915|  82.9k|        pi1_ref_mb_modes += (i4_mb_x * i4_element_size);
 1916|  82.9k|        pu1_ref_idx_x = ps_map_ctxt->pu1_refarray_x_idx;
 1917|  82.9k|        pu1_ref_idx_y = ps_map_ctxt->pu1_refarray_y_idx;
 1918|       |
 1919|  82.9k|        i4_j = 0;
 1920|   331k|        for(i4_y = 0; i4_y < i4_refarray_ht;)
  ------------------
  |  Branch (1920:23): [True: 248k, False: 82.9k]
  ------------------
 1921|   248k|        {
 1922|   248k|            WORD32 i4_x_ref;
 1923|   248k|            WORD32 i4_y_ref;
 1924|   248k|            WORD32 i4_distleftX, i4_rangeX;
 1925|   248k|            WORD32 i4_disttopY, i4_rangeY;
 1926|       |
 1927|   248k|            i4_y_ref = i4_y + i4_y_offset;
 1928|   248k|            i4_disttopY = (i4_y_ref) & (i4_mb_ht - 1);
 1929|   248k|            i4_rangeY = (i4_mb_ht - i4_disttopY);
 1930|       |
 1931|       |            /* find the y-index lookup */
 1932|   248k|            memset(pu1_ref_idx_y, i4_j, i4_rangeY);
 1933|   248k|            pu1_ref_idx_y += i4_rangeY;
 1934|       |
 1935|   248k|            i4_i = 0;
 1936|   248k|            pi1_ref_mb_modes_bkp_1 = pi1_ref_mb_modes;
 1937|  1.00M|            for(i4_x = 0; i4_x < i4_refarray_wd;)
  ------------------
  |  Branch (1937:27): [True: 758k, False: 248k]
  ------------------
 1938|   758k|            {
 1939|   758k|                i4_x_ref = i4_x + i4_x_offset;
 1940|   758k|                i4_distleftX = (i4_x_ref) & (i4_mb_wd - 1);
 1941|   758k|                i4_rangeX = (i4_mb_wd - i4_distleftX);
 1942|       |
 1943|   758k|                if(0 == i4_j)
  ------------------
  |  Branch (1943:20): [True: 248k, False: 510k]
  ------------------
 1944|   248k|                {
 1945|       |                    /* find the x-index lookup */
 1946|   248k|                    memset(pu1_ref_idx_x, i4_i, i4_rangeX);
 1947|   248k|                    pu1_ref_idx_x += i4_rangeX;
 1948|   248k|                }
 1949|       |
 1950|       |                /* get the referecne layer mb type */
 1951|   758k|                isvcd_get_ref_layer_mbtype(pi1_ref_mb_modes_bkp_1, &i4_mb_type, i1_slice_id,
 1952|   758k|                                           i1_cons_intr_samp_flag);
 1953|       |
 1954|   758k|                if(SVC_INTRA_MB == i4_mb_type)
  ------------------
  |  |  115|   758k|#define SVC_INTRA_MB (1 << 1)       /*!< P or B MBs decoded or inferred*/
  ------------------
  |  Branch (1954:20): [True: 146k, False: 612k]
  ------------------
 1955|   146k|                {
 1956|   146k|                    u1_map_buf[i4_j][i4_i] = 1;
 1957|   146k|                }
 1958|   612k|                else
 1959|   612k|                {
 1960|   612k|                    i4_unfill_check = 1;
 1961|   612k|                }
 1962|       |
 1963|   758k|                i4_x = i4_x + i4_rangeX;
 1964|   758k|                i4_i++;
 1965|   758k|                pi1_ref_mb_modes_bkp_1 += i4_element_size;
 1966|       |
 1967|   758k|            } /* end of loop over ref array width */
 1968|       |
 1969|   248k|            i4_j++;
 1970|   248k|            i4_y = i4_y + i4_rangeY;
 1971|   248k|            pi1_ref_mb_modes += (i4_ref_mode_stride * i4_element_size);
 1972|   248k|        } /* end of loop over ref array height */
 1973|  82.9k|    }
 1974|       |
 1975|       |    /* --------------------------------------------------------------------- */
 1976|       |    /* Calling boundary extension algorithm to fill unfilled pixels             */
 1977|       |    /* --------------------------------------------------------------------- */
 1978|  82.9k|    if(i4_unfill_check == 1)
  ------------------
  |  Branch (1978:8): [True: 82.6k, False: 343]
  ------------------
 1979|  82.6k|    {
 1980|  82.6k|        isvcd_fill_non_avail_pixel(ps_map_ctxt, pu1_refarray_1, pu1_refarray_2, i4_refarray_stride,
 1981|  82.6k|                                   ps_coord, i4_chroma_flag, u1_map_buf);
 1982|  82.6k|    }
 1983|  82.9k|    return OK;
  ------------------
  |  |  114|  82.9k|#define OK        0
  ------------------
 1984|  82.9k|}
isvcd_reflayer_construction_dyadic:
 2025|  56.2k|{
 2026|       |    /* Index variables */
 2027|  56.2k|    WORD32 i4_x, i4_y;
 2028|  56.2k|    WORD32 i4_x0, i4_y0;
 2029|  56.2k|    WORD32 i4_xc0, i4_yc0;
 2030|  56.2k|    WORD32 i4_ref_xD, i4_ref_yD;
 2031|  56.2k|    WORD32 i4_c_ref_xD, i4_c_ref_yD;
 2032|       |
 2033|       |    /* --------------------------------------------------------------------- */
 2034|       |    /* Context and reference layer related variables                         */
 2035|       |    /* --------------------------------------------------------------------- */
 2036|  56.2k|    intra_sampling_ctxt_t *ps_ctxt;
 2037|  56.2k|    intra_samp_lyr_ctxt *ps_lyr_ctxt;
 2038|  56.2k|    WORD8 *pi1_ref_mb_modes;
 2039|  56.2k|    WORD32 i4_ref_mode_stride;
 2040|  56.2k|    WORD32 i4_element_size;
 2041|  56.2k|    WORD32 i4_mbaddr_y;
 2042|  56.2k|    WORD32 i4_mbaddr_x;
 2043|       |
 2044|       |    /* --------------------------------------------------------------------- */
 2045|       |    /* Temp Variables for Mapping context                                     */
 2046|       |    /* --------------------------------------------------------------------- */
 2047|  56.2k|    WORD32 i4_refarray_wd_luma, i4_refarray_wd_chroma;
 2048|  56.2k|    WORD32 i4_refarray_ht_luma, i4_refarray_ht_chroma;
 2049|  56.2k|    WORD32 i4_avlblty;
 2050|  56.2k|    WORD8 i1_cons_intr_samp_flag;
 2051|  56.2k|    WORD8 i1_slice_id;
 2052|  56.2k|    WORD8 i1_corner_samp_avlbl_flag;
 2053|  56.2k|    UWORD8 u1_ny_avlblty;
 2054|       |
 2055|       |    /* --------------------------------------------------------------------- */
 2056|       |    /* Local Pointer Declaration for arrays in Mapping context                 */
 2057|       |    /* --------------------------------------------------------------------- */
 2058|  56.2k|    UWORD8 *pu1_refarray_luma;
 2059|  56.2k|    UWORD8 *pu1_refarray_cb, *pu1_refarray_cr;
 2060|       |
 2061|       |    /* --------------------------------------------------------------------- */
 2062|       |    /* Derivation of local variables                                         */
 2063|       |    /* --------------------------------------------------------------------- */
 2064|  56.2k|    ps_ctxt = (intra_sampling_ctxt_t *) pv_intra_samp_ctxt;
 2065|  56.2k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_ctxt->i4_res_lyr_id];
 2066|  56.2k|    pi1_ref_mb_modes = (WORD8 *) ps_ref_mb_mode_map->pv_buffer;
 2067|  56.2k|    i4_ref_mode_stride = ps_ref_mb_mode_map->i4_num_element_stride;
 2068|  56.2k|    i4_element_size = ps_ref_mb_mode_map->i4_element_size;
 2069|       |
 2070|       |    /* --------------------------------------------------------------------- */
 2071|       |    /* get the constrained intra resampling flag                             */
 2072|       |    /* --------------------------------------------------------------------- */
 2073|  56.2k|    i1_cons_intr_samp_flag = ps_lyr_ctxt->i1_constrained_intra_rsmpl_flag;
 2074|  56.2k|    if(NULL == pi1_ref_mb_modes)
  ------------------
  |  Branch (2074:8): [True: 0, False: 56.2k]
  ------------------
 2075|      0|    {
 2076|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 2077|      0|    }
 2078|       |
 2079|  56.2k|    pu1_refarray_luma = ps_ctxt->pu1_refarray_buffer;
 2080|  56.2k|    pu1_refarray_cb = ps_ctxt->pu1_refarray_cb;
 2081|  56.2k|    pu1_refarray_cr = ps_ctxt->pu1_refarray_cr;
 2082|       |
 2083|       |    /* --------------------------------------------------------------------- */
 2084|       |    /* Get the coordinates of the reference layer MB                         */
 2085|       |    /* --------------------------------------------------------------------- */
 2086|  56.2k|    i4_mbaddr_x = u2_mb_x;
 2087|  56.2k|    i4_mbaddr_y = u2_mb_y;
 2088|       |
 2089|       |    /* --------------------------------------------------------------------- */
 2090|       |    /* Getting the size of the valid area of ref array to be brought in         */
 2091|       |    /* --------------------------------------------------------------------- */
 2092|  56.2k|    i4_refarray_wd_luma = 20;
 2093|  56.2k|    i4_refarray_ht_luma = 20;
 2094|  56.2k|    i4_refarray_wd_chroma = i4_refarray_wd_luma >> 1;
 2095|  56.2k|    i4_refarray_ht_chroma = i4_refarray_ht_luma >> 1;
 2096|       |
 2097|       |    /* --------------------------------------------------------------------- */
 2098|       |    /* Derivation of ref slice MB idc                                         */
 2099|       |    /* --------------------------------------------------------------------- */
 2100|  56.2k|    if(1 == i1_cons_intr_samp_flag)
  ------------------
  |  Branch (2100:8): [True: 30.0k, False: 26.2k]
  ------------------
 2101|  30.0k|    {
 2102|  30.0k|        inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms;
 2103|  30.0k|        WORD8 *pi1_ref_mb_mode_tmp;
 2104|  30.0k|        WORD8 i1_mb_mode;
 2105|       |
 2106|       |        /* get the location of the byte which has the current mb mode */
 2107|  30.0k|        pi1_ref_mb_mode_tmp = pi1_ref_mb_modes;
 2108|  30.0k|        pi1_ref_mb_mode_tmp += (i4_mbaddr_y * i4_ref_mode_stride * i4_element_size);
 2109|  30.0k|        pi1_ref_mb_mode_tmp += (i4_mbaddr_x * i4_element_size);
 2110|  30.0k|        ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) pi1_ref_mb_mode_tmp;
 2111|  30.0k|        i1_mb_mode = ps_inter_lyr_mb_prms->i1_mb_mode;
 2112|       |
 2113|       |        /* The reference layer MB should be intra */
 2114|  30.0k|        UNUSED(i1_mb_mode);
  ------------------
  |  |   45|  30.0k|#define UNUSED(x) ((void)(x))
  ------------------
 2115|       |
 2116|  30.0k|        i1_slice_id = ps_inter_lyr_mb_prms->i1_slice_id;
 2117|  30.0k|    }
 2118|  26.2k|    else
 2119|  26.2k|    {
 2120|       |        /* set to non valid value */
 2121|  26.2k|        i1_slice_id = -1;
 2122|  26.2k|    }
 2123|       |
 2124|       |    /* --------------------------------------------------------------------- */
 2125|       |    /* Bring in the reference array                                          */
 2126|       |    /* --------------------------------------------------------------------- */
 2127|  56.2k|    {
 2128|  56.2k|        UWORD8 *pu1_src, *pu1_dst;
 2129|  56.2k|        WORD32 i4_src_stride, i4_dst_stride;
 2130|       |
 2131|       |        /* Copy luma */
 2132|  56.2k|        i4_src_stride = i4_inp_luma_stride;
 2133|  56.2k|        i4_dst_stride = DYADIC_REF_W_Y;
  ------------------
  |  |   56|  56.2k|#define DYADIC_REF_W_Y 20
  ------------------
 2134|  56.2k|        pu1_src = pu1_inp_luma;
 2135|  56.2k|        pu1_dst = pu1_refarray_luma;
 2136|  56.2k|        isvcd_copy_data(pu1_src, i4_src_stride, pu1_dst, i4_dst_stride, i4_refarray_wd_luma,
 2137|  56.2k|                        i4_refarray_ht_luma);
 2138|       |        // Semi planar
 2139|  56.2k|        i4_src_stride = i4_inp_chroma_stride;
 2140|  56.2k|        i4_dst_stride = DYADIC_REF_W_C;
  ------------------
  |  |   58|  56.2k|#define DYADIC_REF_W_C 10
  ------------------
 2141|  56.2k|        pu1_src = pu1_inp_chroma;
 2142|  56.2k|        isvcd_copy_data_semiplanr(pu1_src, i4_src_stride, pu1_refarray_cb, pu1_refarray_cr,
 2143|  56.2k|                                  i4_dst_stride, i4_refarray_wd_chroma, i4_refarray_ht_chroma);
 2144|  56.2k|    }
 2145|       |
 2146|       |    /* --------------------------------------------------------------------- */
 2147|       |    /* Get the availability of 5 neighboring MBs                             */
 2148|       |    /* --------------------------------------------------------------------- */
 2149|  56.2k|    {
 2150|       |        /* mb_x + left, mb_y + top */
 2151|  56.2k|        isvcd_get_ref_layer_avlblty_dyadic(pi1_ref_mb_modes, i4_ref_mode_stride, i4_element_size,
 2152|  56.2k|                                           i4_mbaddr_x + i4_left, i4_mbaddr_y + i4_top, &i4_avlblty,
 2153|  56.2k|                                           i1_slice_id, i1_cons_intr_samp_flag);
 2154|  56.2k|        u1_ny_avlblty = i4_avlblty;
 2155|       |
 2156|       |        /* mb_x + left, mb_y */
 2157|  56.2k|        isvcd_get_ref_layer_avlblty_dyadic(pi1_ref_mb_modes, i4_ref_mode_stride, i4_element_size,
 2158|  56.2k|                                           i4_mbaddr_x + i4_left, i4_mbaddr_y, &i4_avlblty,
 2159|  56.2k|                                           i1_slice_id, i1_cons_intr_samp_flag);
 2160|  56.2k|        u1_ny_avlblty += (i4_avlblty << 1);
 2161|       |
 2162|       |        /* mb_x, mb_y + top */
 2163|  56.2k|        isvcd_get_ref_layer_avlblty_dyadic(pi1_ref_mb_modes, i4_ref_mode_stride, i4_element_size,
 2164|  56.2k|                                           i4_mbaddr_x, i4_mbaddr_y + i4_top, &i4_avlblty,
 2165|  56.2k|                                           i1_slice_id, i1_cons_intr_samp_flag);
 2166|  56.2k|        u1_ny_avlblty += (i4_avlblty << 2);
 2167|       |
 2168|       |        /* mb_x - left, mb_y + top */
 2169|  56.2k|        isvcd_get_ref_layer_avlblty_dyadic(pi1_ref_mb_modes, i4_ref_mode_stride, i4_element_size,
 2170|  56.2k|                                           i4_mbaddr_x - i4_left, i4_mbaddr_y + i4_top, &i4_avlblty,
 2171|  56.2k|                                           i1_slice_id, i1_cons_intr_samp_flag);
 2172|  56.2k|        u1_ny_avlblty += (i4_avlblty << 3);
 2173|       |
 2174|       |        /* mb_x + left, mb_y - top */
 2175|  56.2k|        isvcd_get_ref_layer_avlblty_dyadic(pi1_ref_mb_modes, i4_ref_mode_stride, i4_element_size,
 2176|  56.2k|                                           i4_mbaddr_x + i4_left, i4_mbaddr_y - i4_top, &i4_avlblty,
 2177|  56.2k|                                           i1_slice_id, i1_cons_intr_samp_flag);
 2178|  56.2k|        u1_ny_avlblty += (i4_avlblty << 4);
 2179|  56.2k|    }
 2180|       |
 2181|       |    /* --------------------------------------------------------------------- */
 2182|       |    /* Filling the unavailable samples, if any                                 */
 2183|       |    /* --------------------------------------------------------------------- */
 2184|  56.2k|    if(0x7 == u1_ny_avlblty)
  ------------------
  |  Branch (2184:8): [True: 352, False: 55.9k]
  ------------------
 2185|    352|    {
 2186|       |        /* All are available, exit */
 2187|    352|        return OK;
  ------------------
  |  |  114|    352|#define OK        0
  ------------------
 2188|    352|    }
 2189|       |
 2190|  55.9k|    if(!(u1_ny_avlblty & 0x7))
  ------------------
  |  Branch (2190:8): [True: 36.0k, False: 19.8k]
  ------------------
 2191|  36.0k|    {
 2192|  36.0k|        UWORD8 *pu1_tmp_src, *pu1_tmp_dst1, *pu1_tmp_dst2;
 2193|  36.0k|        UWORD8 *pu1_tmp_src1, *pu1_tmp_src2;
 2194|       |
 2195|       |        /* Set the 4 corner samples to (x-xD,y-yD) */
 2196|  36.0k|        i4_x0 = 9 + (i4_left << 3) + i4_left;
 2197|  36.0k|        i4_y0 = 9 + (i4_top << 3) + i4_top;
 2198|       |
 2199|  36.0k|        i4_ref_xD = i4_x0 - i4_left - (i4_left >> 1);
 2200|  36.0k|        i4_ref_yD = i4_y0 - i4_top - (i4_top >> 1);
 2201|       |
 2202|  36.0k|        pu1_tmp_src = pu1_refarray_luma + (i4_ref_yD * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  36.0k|#define DYADIC_REF_W_Y 20
  ------------------
 2203|  36.0k|        pu1_tmp_dst1 = pu1_refarray_luma + (i4_y0 * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  36.0k|#define DYADIC_REF_W_Y 20
  ------------------
 2204|  36.0k|        pu1_tmp_dst2 = pu1_tmp_dst1 + DYADIC_REF_W_Y;
  ------------------
  |  |   56|  36.0k|#define DYADIC_REF_W_Y 20
  ------------------
 2205|  36.0k|        pu1_tmp_dst1[i4_x0] = pu1_tmp_src[i4_ref_xD];
 2206|  36.0k|        pu1_tmp_dst1[i4_x0 + 1] = pu1_tmp_src[i4_ref_xD];
 2207|  36.0k|        pu1_tmp_dst2[i4_x0] = pu1_tmp_src[i4_ref_xD];
 2208|  36.0k|        pu1_tmp_dst2[i4_x0 + 1] = pu1_tmp_src[i4_ref_xD];
 2209|       |
 2210|       |        /* Set the corner sample of Cb and Cr to (x-xD,y-yD) */
 2211|  36.0k|        i4_xc0 = i4_x0 >> 1;
 2212|  36.0k|        i4_yc0 = i4_y0 >> 1;
 2213|  36.0k|        i4_c_ref_yD = i4_ref_yD >> 1;
 2214|  36.0k|        i4_c_ref_xD = i4_ref_xD >> 1;
 2215|  36.0k|        pu1_tmp_src1 = pu1_refarray_cb + (i4_c_ref_yD * DYADIC_REF_W_C);
  ------------------
  |  |   58|  36.0k|#define DYADIC_REF_W_C 10
  ------------------
 2216|  36.0k|        pu1_tmp_dst1 = pu1_refarray_cb + (i4_yc0 * DYADIC_REF_W_C);
  ------------------
  |  |   58|  36.0k|#define DYADIC_REF_W_C 10
  ------------------
 2217|  36.0k|        pu1_tmp_dst1[i4_xc0] = pu1_tmp_src1[i4_c_ref_xD];
 2218|  36.0k|        pu1_tmp_src2 = pu1_refarray_cr + (i4_c_ref_yD * DYADIC_REF_W_C);
  ------------------
  |  |   58|  36.0k|#define DYADIC_REF_W_C 10
  ------------------
 2219|  36.0k|        pu1_tmp_dst2 = pu1_refarray_cr + (i4_yc0 * DYADIC_REF_W_C);
  ------------------
  |  |   58|  36.0k|#define DYADIC_REF_W_C 10
  ------------------
 2220|  36.0k|        pu1_tmp_dst2[i4_xc0] = pu1_tmp_src2[i4_c_ref_xD];
 2221|  36.0k|    }
 2222|       |
 2223|  55.9k|    if(!(u1_ny_avlblty & 0x5))
  ------------------
  |  Branch (2223:8): [True: 38.2k, False: 17.6k]
  ------------------
 2224|  38.2k|    {
 2225|  38.2k|        UWORD8 *pu1_tmp_src, *pu1_tmp_dst1, *pu1_tmp_dst2;
 2226|  38.2k|        UWORD8 *pu1_tmp_src1, *pu1_tmp_src2;
 2227|       |
 2228|       |        /* Copy (x0,ref_yD), (x0+1,ref_yD), ..., (x0+7,ref_yD) to */
 2229|       |        /* (x0,y0), (x0+1,y0), ..., (x0+7,y0) and   */
 2230|       |        /* (x0,y0+1), (x0+1,y0+1), ..., (x0+7,y0+1) */
 2231|  38.2k|        i4_x0 = 2;
 2232|  38.2k|        i4_y0 = 9 + (i4_top << 3) + i4_top;
 2233|  38.2k|        if(i4_left > 0)
  ------------------
  |  Branch (2233:12): [True: 18.7k, False: 19.5k]
  ------------------
 2234|  18.7k|        {
 2235|  18.7k|            i4_x0 += 8;
 2236|  18.7k|        }
 2237|  38.2k|        i4_ref_yD = i4_y0 - i4_top - (i4_top >> 1);
 2238|       |
 2239|  38.2k|        pu1_tmp_src = pu1_refarray_luma + (i4_ref_yD * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  38.2k|#define DYADIC_REF_W_Y 20
  ------------------
 2240|  38.2k|        pu1_tmp_dst1 = pu1_refarray_luma + (i4_y0 * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  38.2k|#define DYADIC_REF_W_Y 20
  ------------------
 2241|  38.2k|        pu1_tmp_dst2 = pu1_tmp_dst1 + DYADIC_REF_W_Y;
  ------------------
  |  |   56|  38.2k|#define DYADIC_REF_W_Y 20
  ------------------
 2242|       |
 2243|   344k|        for(i4_x = i4_x0; i4_x < i4_x0 + 8; i4_x++)
  ------------------
  |  Branch (2243:27): [True: 306k, False: 38.2k]
  ------------------
 2244|   306k|        {
 2245|   306k|            pu1_tmp_dst1[i4_x] = pu1_tmp_src[i4_x];
 2246|   306k|            pu1_tmp_dst2[i4_x] = pu1_tmp_src[i4_x];
 2247|   306k|        }
 2248|       |
 2249|       |        /* Cb and Cr copy */
 2250|  38.2k|        i4_xc0 = i4_x0 >> 1;
 2251|  38.2k|        i4_yc0 = i4_y0 >> 1;
 2252|  38.2k|        i4_c_ref_yD = i4_ref_yD >> 1;
 2253|  38.2k|        pu1_tmp_src1 = pu1_refarray_cb + (i4_c_ref_yD * DYADIC_REF_W_C);
  ------------------
  |  |   58|  38.2k|#define DYADIC_REF_W_C 10
  ------------------
 2254|  38.2k|        pu1_tmp_dst1 = pu1_refarray_cb + (i4_yc0 * DYADIC_REF_W_C);
  ------------------
  |  |   58|  38.2k|#define DYADIC_REF_W_C 10
  ------------------
 2255|  38.2k|        pu1_tmp_src2 = pu1_refarray_cr + (i4_c_ref_yD * DYADIC_REF_W_C);
  ------------------
  |  |   58|  38.2k|#define DYADIC_REF_W_C 10
  ------------------
 2256|  38.2k|        pu1_tmp_dst2 = pu1_refarray_cr + (i4_yc0 * DYADIC_REF_W_C);
  ------------------
  |  |   58|  38.2k|#define DYADIC_REF_W_C 10
  ------------------
 2257|       |
 2258|   191k|        for(i4_x = i4_xc0; i4_x < i4_xc0 + 4; i4_x++)
  ------------------
  |  Branch (2258:28): [True: 153k, False: 38.2k]
  ------------------
 2259|   153k|        {
 2260|   153k|            pu1_tmp_dst1[i4_x] = pu1_tmp_src1[i4_x];
 2261|   153k|            pu1_tmp_dst2[i4_x] = pu1_tmp_src2[i4_x];
 2262|   153k|        }
 2263|  38.2k|    }
 2264|       |
 2265|  55.9k|    if(!(u1_ny_avlblty & 0x3))
  ------------------
  |  Branch (2265:8): [True: 42.0k, False: 13.8k]
  ------------------
 2266|  42.0k|    {
 2267|  42.0k|        UWORD8 *pu1_tmp_src, *pu1_tmp_dst1, *pu1_tmp_dst2;
 2268|  42.0k|        UWORD8 *pu1_tmp_src1, *pu1_tmp_src2;
 2269|       |
 2270|       |        /* Copy (ref_xD,y0) to (x0,y0) and (x0+1,y0); */
 2271|       |        /* copy (ref_xD,y0+1) to (x0,y0+1) and (x0+1,y0+1); ... ;*/
 2272|       |        /* copy (ref_xD,y0+7) to (x0,y0+7) and (x0+1,y0+7) */
 2273|  42.0k|        i4_x0 = 9 + (i4_left << 3) + i4_left;
 2274|  42.0k|        i4_y0 = 2;
 2275|  42.0k|        if(i4_top > 0)
  ------------------
  |  Branch (2275:12): [True: 20.0k, False: 22.0k]
  ------------------
 2276|  20.0k|        {
 2277|  20.0k|            i4_y0 += 8;
 2278|  20.0k|        }
 2279|  42.0k|        i4_ref_xD = i4_x0 - i4_left - (i4_left >> 1);
 2280|       |
 2281|  42.0k|        pu1_tmp_src = pu1_refarray_luma + (i4_y0 * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  42.0k|#define DYADIC_REF_W_Y 20
  ------------------
 2282|  42.0k|        pu1_tmp_dst1 = pu1_tmp_src;
 2283|       |
 2284|   378k|        for(i4_y = i4_y0; i4_y < i4_y0 + 8; i4_y++)
  ------------------
  |  Branch (2284:27): [True: 336k, False: 42.0k]
  ------------------
 2285|   336k|        {
 2286|   336k|            pu1_tmp_dst1[i4_x0] = pu1_tmp_src[i4_ref_xD];
 2287|   336k|            pu1_tmp_dst1[i4_x0 + 1] = pu1_tmp_src[i4_ref_xD];
 2288|   336k|            pu1_tmp_src += DYADIC_REF_W_Y;
  ------------------
  |  |   56|   336k|#define DYADIC_REF_W_Y 20
  ------------------
 2289|   336k|            pu1_tmp_dst1 += DYADIC_REF_W_Y;
  ------------------
  |  |   56|   336k|#define DYADIC_REF_W_Y 20
  ------------------
 2290|   336k|        }
 2291|       |
 2292|       |        /* Cb and Cr copy */
 2293|  42.0k|        i4_xc0 = i4_x0 >> 1;
 2294|  42.0k|        i4_yc0 = i4_y0 >> 1;
 2295|  42.0k|        i4_c_ref_xD = i4_ref_xD >> 1;
 2296|  42.0k|        pu1_tmp_src1 = pu1_refarray_cb + (i4_yc0 * DYADIC_REF_W_C);
  ------------------
  |  |   58|  42.0k|#define DYADIC_REF_W_C 10
  ------------------
 2297|  42.0k|        pu1_tmp_dst1 = pu1_tmp_src1;
 2298|  42.0k|        pu1_tmp_src2 = pu1_refarray_cr + (i4_yc0 * DYADIC_REF_W_C);
  ------------------
  |  |   58|  42.0k|#define DYADIC_REF_W_C 10
  ------------------
 2299|  42.0k|        pu1_tmp_dst2 = pu1_tmp_src2;
 2300|       |
 2301|   210k|        for(i4_y = i4_yc0; i4_y < i4_yc0 + 4; i4_y++)
  ------------------
  |  Branch (2301:28): [True: 168k, False: 42.0k]
  ------------------
 2302|   168k|        {
 2303|   168k|            pu1_tmp_dst1[i4_xc0] = pu1_tmp_src1[i4_c_ref_xD];
 2304|   168k|            pu1_tmp_dst2[i4_xc0] = pu1_tmp_src2[i4_c_ref_xD];
 2305|   168k|            pu1_tmp_src1 += DYADIC_REF_W_C;
  ------------------
  |  |   58|   168k|#define DYADIC_REF_W_C 10
  ------------------
 2306|   168k|            pu1_tmp_src2 += DYADIC_REF_W_C;
  ------------------
  |  |   58|   168k|#define DYADIC_REF_W_C 10
  ------------------
 2307|   168k|            pu1_tmp_dst1 += DYADIC_REF_W_C;
  ------------------
  |  |   58|   168k|#define DYADIC_REF_W_C 10
  ------------------
 2308|   168k|            pu1_tmp_dst2 += DYADIC_REF_W_C;
  ------------------
  |  |   58|   168k|#define DYADIC_REF_W_C 10
  ------------------
 2309|   168k|        }
 2310|  42.0k|    }
 2311|       |
 2312|  55.9k|    if(!(u1_ny_avlblty & 0x4))
  ------------------
  |  Branch (2312:8): [True: 45.0k, False: 10.9k]
  ------------------
 2313|  45.0k|    {
 2314|  45.0k|        if(!(u1_ny_avlblty & 0x8))
  ------------------
  |  Branch (2314:12): [True: 38.3k, False: 6.64k]
  ------------------
 2315|  38.3k|        {
 2316|       |            /* (mb_x-left,mb_y+top) not available */
 2317|  38.3k|            UWORD8 *pu1_tmp_src, *pu1_tmp_dst;
 2318|       |
 2319|  38.3k|            i4_x0 = 9 - i4_left;
 2320|  38.3k|            i4_y0 = 9 + (i4_top << 3) + i4_top;
 2321|       |
 2322|  38.3k|            i4_ref_yD = i4_y0 - i4_top - (i4_top >> 1);
 2323|       |
 2324|       |            /* Copy (x0,ref_yD) and (x0+1,ref_yD) to (x0,y0) and (x0+1,y0), and */
 2325|       |            /* to (x0,y0+1) and (x0+1,y0+1) */
 2326|  38.3k|            pu1_tmp_src = pu1_refarray_luma + (i4_ref_yD * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  38.3k|#define DYADIC_REF_W_Y 20
  ------------------
 2327|  38.3k|            pu1_tmp_dst = pu1_refarray_luma + (i4_y0 * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  38.3k|#define DYADIC_REF_W_Y 20
  ------------------
 2328|  38.3k|            pu1_tmp_dst[i4_x0] = pu1_tmp_src[i4_x0];
 2329|  38.3k|            pu1_tmp_dst[i4_x0 + 1] = pu1_tmp_src[i4_x0 + 1];
 2330|  38.3k|            pu1_tmp_dst += DYADIC_REF_W_Y;
  ------------------
  |  |   56|  38.3k|#define DYADIC_REF_W_Y 20
  ------------------
 2331|  38.3k|            pu1_tmp_dst[i4_x0] = pu1_tmp_src[i4_x0];
 2332|  38.3k|            pu1_tmp_dst[i4_x0 + 1] = pu1_tmp_src[i4_x0 + 1];
 2333|       |
 2334|       |            /* Cb copy */
 2335|  38.3k|            i4_xc0 = i4_x0 >> 1;
 2336|  38.3k|            i4_yc0 = i4_y0 >> 1;
 2337|  38.3k|            i4_c_ref_yD = i4_ref_yD >> 1;
 2338|  38.3k|            pu1_tmp_src = pu1_refarray_cb + (i4_c_ref_yD * DYADIC_REF_W_C);
  ------------------
  |  |   58|  38.3k|#define DYADIC_REF_W_C 10
  ------------------
 2339|  38.3k|            pu1_tmp_dst = pu1_refarray_cb + (i4_yc0 * DYADIC_REF_W_C);
  ------------------
  |  |   58|  38.3k|#define DYADIC_REF_W_C 10
  ------------------
 2340|  38.3k|            pu1_tmp_dst[i4_xc0] = pu1_tmp_src[i4_xc0];
 2341|       |
 2342|       |            /* Cr copy */
 2343|  38.3k|            pu1_tmp_src = pu1_refarray_cr + (i4_c_ref_yD * DYADIC_REF_W_C);
  ------------------
  |  |   58|  38.3k|#define DYADIC_REF_W_C 10
  ------------------
 2344|  38.3k|            pu1_tmp_dst = pu1_refarray_cr + (i4_yc0 * DYADIC_REF_W_C);
  ------------------
  |  |   58|  38.3k|#define DYADIC_REF_W_C 10
  ------------------
 2345|  38.3k|            pu1_tmp_dst[i4_xc0] = pu1_tmp_src[i4_xc0];
 2346|       |
 2347|  38.3k|        } /* if (mb_x-left,mb_y+top) not available */
 2348|  6.64k|        else
 2349|  6.64k|        {
 2350|  6.64k|            WORD32 i4_xD, i4_yD;
 2351|  6.64k|            WORD32 i4_c_xD, i4_c_yD;
 2352|       |
 2353|  6.64k|            isvcd_get_ref_layer_avlblty_dyadic(pi1_ref_mb_modes, i4_ref_mode_stride,
 2354|  6.64k|                                               i4_element_size, i4_mbaddr_x - i4_left, i4_mbaddr_y,
 2355|  6.64k|                                               &i4_avlblty, i1_slice_id, i1_cons_intr_samp_flag);
 2356|  6.64k|            i1_corner_samp_avlbl_flag = i4_avlblty;
 2357|       |
 2358|  6.64k|            i4_x0 = 9 - i4_left;
 2359|  6.64k|            i4_y0 = 9 + (i4_top << 3) + i4_top;
 2360|  6.64k|            i4_xc0 = i4_x0 >> 1;
 2361|  6.64k|            i4_yc0 = i4_y0 >> 1;
 2362|  6.64k|            i4_ref_yD = i4_y0 - i4_top - (i4_top >> 1);
 2363|  6.64k|            i4_ref_xD = i4_x0 - (i4_left * 7) - (i4_left >> 1);
 2364|  6.64k|            i4_c_ref_xD = i4_ref_xD >> 1;
 2365|  6.64k|            i4_c_ref_yD = i4_ref_yD >> 1;
 2366|  6.64k|            i4_xD = i4_x0 - i4_ref_xD;
 2367|  6.64k|            i4_yD = i4_y0 - i4_ref_yD;
 2368|  6.64k|            i4_c_xD = i4_xc0 - i4_c_ref_xD;
 2369|  6.64k|            i4_c_yD = i4_yc0 - i4_c_ref_yD;
 2370|       |
 2371|       |            /* Fill corner sample if not available */
 2372|  6.64k|            if(!i1_corner_samp_avlbl_flag)
  ------------------
  |  Branch (2372:16): [True: 6.36k, False: 283]
  ------------------
 2373|  6.36k|            {
 2374|  6.36k|                isvcd_corner_samp_dyadic(i4_x0, i4_y0, i4_xD, i4_yD, pu1_refarray_luma,
 2375|  6.36k|                                         pu1_refarray_cb, pu1_refarray_cr);
 2376|  6.36k|            }
 2377|       |
 2378|       |            /* Call diagonal construction for luma */
 2379|  19.9k|            for(i4_y = i4_y0; i4_y < i4_y0 + 2; i4_y++)
  ------------------
  |  Branch (2379:31): [True: 13.2k, False: 6.64k]
  ------------------
 2380|  13.2k|            {
 2381|  39.8k|                for(i4_x = i4_x0; i4_x < i4_x0 + 2; i4_x++)
  ------------------
  |  Branch (2381:35): [True: 26.5k, False: 13.2k]
  ------------------
 2382|  26.5k|                {
 2383|  26.5k|                    isvcd_diagonal_construct_dyadic(i4_x, i4_y, i4_xD, i4_yD, pu1_refarray_luma,
 2384|  26.5k|                                                    DYADIC_REF_W_Y);
  ------------------
  |  |   56|  26.5k|#define DYADIC_REF_W_Y 20
  ------------------
 2385|  26.5k|                    i4_xD++;
 2386|  26.5k|                }
 2387|  13.2k|                i4_yD++;
 2388|  13.2k|                i4_xD -= 2;
 2389|  13.2k|            }
 2390|       |
 2391|       |            /* Call diagonal construction for chroma */
 2392|  6.64k|            isvcd_diagonal_construct_dyadic(i4_xc0, i4_yc0, i4_c_xD, i4_c_yD, pu1_refarray_cb,
 2393|  6.64k|                                            DYADIC_REF_W_C);
  ------------------
  |  |   58|  6.64k|#define DYADIC_REF_W_C 10
  ------------------
 2394|       |
 2395|  6.64k|            isvcd_diagonal_construct_dyadic(i4_xc0, i4_yc0, i4_c_xD, i4_c_yD, pu1_refarray_cr,
 2396|  6.64k|                                            DYADIC_REF_W_C);
  ------------------
  |  |   58|  6.64k|#define DYADIC_REF_W_C 10
  ------------------
 2397|  6.64k|        }
 2398|  45.0k|    }
 2399|       |
 2400|  55.9k|    if(!(u1_ny_avlblty & 0x2))
  ------------------
  |  Branch (2400:8): [True: 49.2k, False: 6.71k]
  ------------------
 2401|  49.2k|    {
 2402|  49.2k|        if(!(u1_ny_avlblty & 0x10))
  ------------------
  |  Branch (2402:12): [True: 42.4k, False: 6.79k]
  ------------------
 2403|  42.4k|        {
 2404|  42.4k|            UWORD8 *pu1_tmp_src, *pu1_tmp_dst;
 2405|       |
 2406|  42.4k|            i4_x0 = 9 + (i4_left << 3) + i4_left;
 2407|  42.4k|            i4_y0 = 9 - i4_top;
 2408|  42.4k|            i4_ref_xD = i4_x0 - i4_left - (i4_left >> 1);
 2409|       |
 2410|       |            /* Copy (ref_xD,y0) to (x0,y0), (x0+1,y0), and  */
 2411|       |            /* copy (ref_xD,y0+1) to (x0,y0+1), (x0+1,y0+1) */
 2412|  42.4k|            pu1_tmp_src = pu1_refarray_luma + (i4_y0 * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  42.4k|#define DYADIC_REF_W_Y 20
  ------------------
 2413|  42.4k|            pu1_tmp_dst = pu1_tmp_src;
 2414|  42.4k|            pu1_tmp_dst[i4_x0] = pu1_tmp_src[i4_ref_xD];
 2415|  42.4k|            pu1_tmp_dst[i4_x0 + 1] = pu1_tmp_src[i4_ref_xD];
 2416|  42.4k|            pu1_tmp_src += DYADIC_REF_W_Y;
  ------------------
  |  |   56|  42.4k|#define DYADIC_REF_W_Y 20
  ------------------
 2417|  42.4k|            pu1_tmp_dst += DYADIC_REF_W_Y;
  ------------------
  |  |   56|  42.4k|#define DYADIC_REF_W_Y 20
  ------------------
 2418|  42.4k|            pu1_tmp_dst[i4_x0] = pu1_tmp_src[i4_ref_xD];
 2419|  42.4k|            pu1_tmp_dst[i4_x0 + 1] = pu1_tmp_src[i4_ref_xD];
 2420|       |
 2421|       |            /* Cb copy */
 2422|  42.4k|            i4_xc0 = i4_x0 >> 1;
 2423|  42.4k|            i4_yc0 = i4_y0 >> 1;
 2424|  42.4k|            i4_c_ref_xD = i4_ref_xD >> 1;
 2425|  42.4k|            pu1_tmp_src = pu1_refarray_cb + (i4_yc0 * DYADIC_REF_W_C);
  ------------------
  |  |   58|  42.4k|#define DYADIC_REF_W_C 10
  ------------------
 2426|  42.4k|            pu1_tmp_dst = pu1_tmp_src;
 2427|  42.4k|            pu1_tmp_dst[i4_xc0] = pu1_tmp_src[i4_c_ref_xD];
 2428|       |
 2429|       |            /* Cr copy */
 2430|  42.4k|            pu1_tmp_src = pu1_refarray_cr + (i4_yc0 * DYADIC_REF_W_C);
  ------------------
  |  |   58|  42.4k|#define DYADIC_REF_W_C 10
  ------------------
 2431|  42.4k|            pu1_tmp_dst = pu1_tmp_src;
 2432|  42.4k|            pu1_tmp_dst[i4_xc0] = pu1_tmp_src[i4_c_ref_xD];
 2433|       |
 2434|  42.4k|        } /* if (mb_x+left,mb_y-top) not available */
 2435|  6.79k|        else
 2436|  6.79k|        {
 2437|  6.79k|            WORD32 i4_xD, i4_yD;
 2438|  6.79k|            WORD32 i4_c_xD, i4_c_yD;
 2439|       |
 2440|  6.79k|            isvcd_get_ref_layer_avlblty_dyadic(pi1_ref_mb_modes, i4_ref_mode_stride,
 2441|  6.79k|                                               i4_element_size, i4_mbaddr_x, i4_mbaddr_y - i4_top,
 2442|  6.79k|                                               &i4_avlblty, i1_slice_id, i1_cons_intr_samp_flag);
 2443|  6.79k|            i1_corner_samp_avlbl_flag = i4_avlblty;
 2444|       |
 2445|  6.79k|            i4_x0 = 9 + (i4_left << 3) + i4_left;
 2446|  6.79k|            i4_y0 = 9 - i4_top;
 2447|  6.79k|            i4_xc0 = i4_x0 >> 1;
 2448|  6.79k|            i4_yc0 = i4_y0 >> 1;
 2449|  6.79k|            i4_ref_xD = i4_x0 - i4_left - (i4_left >> 1);
 2450|  6.79k|            i4_ref_yD = i4_y0 - (i4_top * 7) - (i4_top >> 1);
 2451|  6.79k|            i4_c_ref_xD = i4_ref_xD >> 1;
 2452|  6.79k|            i4_c_ref_yD = i4_ref_yD >> 1;
 2453|  6.79k|            i4_xD = i4_x0 - i4_ref_xD;
 2454|  6.79k|            i4_yD = i4_y0 - i4_ref_yD;
 2455|  6.79k|            i4_c_xD = i4_xc0 - i4_c_ref_xD;
 2456|  6.79k|            i4_c_yD = i4_yc0 - i4_c_ref_yD;
 2457|       |
 2458|  6.79k|            if(!i1_corner_samp_avlbl_flag)
  ------------------
  |  Branch (2458:16): [True: 6.08k, False: 710]
  ------------------
 2459|  6.08k|            {
 2460|  6.08k|                isvcd_corner_samp_dyadic(i4_x0, i4_y0, i4_xD, i4_yD, pu1_refarray_luma,
 2461|  6.08k|                                         pu1_refarray_cb, pu1_refarray_cr);
 2462|  6.08k|            }
 2463|       |
 2464|       |            /* Call diagonal consrtuction for luma */
 2465|  20.3k|            for(i4_y = i4_y0; i4_y < i4_y0 + 2; i4_y++)
  ------------------
  |  Branch (2465:31): [True: 13.5k, False: 6.79k]
  ------------------
 2466|  13.5k|            {
 2467|  40.7k|                for(i4_x = i4_x0; i4_x < i4_x0 + 2; i4_x++)
  ------------------
  |  Branch (2467:35): [True: 27.1k, False: 13.5k]
  ------------------
 2468|  27.1k|                {
 2469|  27.1k|                    isvcd_diagonal_construct_dyadic(i4_x, i4_y, i4_xD, i4_yD, pu1_refarray_luma,
 2470|  27.1k|                                                    DYADIC_REF_W_Y);
  ------------------
  |  |   56|  27.1k|#define DYADIC_REF_W_Y 20
  ------------------
 2471|  27.1k|                    i4_xD++;
 2472|  27.1k|                }
 2473|  13.5k|                i4_yD++;
 2474|  13.5k|                i4_xD -= 2;
 2475|  13.5k|            }
 2476|       |
 2477|       |            /* Call diagonal construction for chroma */
 2478|  6.79k|            isvcd_diagonal_construct_dyadic(i4_xc0, i4_yc0, i4_c_xD, i4_c_yD, pu1_refarray_cb,
 2479|  6.79k|                                            DYADIC_REF_W_C);
  ------------------
  |  |   58|  6.79k|#define DYADIC_REF_W_C 10
  ------------------
 2480|       |
 2481|  6.79k|            isvcd_diagonal_construct_dyadic(i4_xc0, i4_yc0, i4_c_xD, i4_c_yD, pu1_refarray_cr,
 2482|  6.79k|                                            DYADIC_REF_W_C);
  ------------------
  |  |   58|  6.79k|#define DYADIC_REF_W_C 10
  ------------------
 2483|  6.79k|        }
 2484|  49.2k|    }
 2485|       |
 2486|  55.9k|    if(u1_ny_avlblty & 1)
  ------------------
  |  Branch (2486:8): [True: 8.06k, False: 47.8k]
  ------------------
 2487|  8.06k|    {
 2488|  8.06k|        if(!(u1_ny_avlblty & 2))
  ------------------
  |  Branch (2488:12): [True: 7.14k, False: 923]
  ------------------
 2489|  7.14k|        {
 2490|       |            /* (mb_x+left,mb_y) is unavailable */
 2491|  7.14k|            WORD32 i4_xD, i4_yD;
 2492|  7.14k|            WORD32 i4_c_xD, i4_c_yD;
 2493|  7.14k|            UWORD8 *pu1_tmp_dst;
 2494|  7.14k|            UWORD8 u1_filled_samp;
 2495|       |
 2496|  7.14k|            i1_corner_samp_avlbl_flag = (u1_ny_avlblty & 4) >> 2;
 2497|       |
 2498|  7.14k|            i4_x0 = 9 + (i4_left << 3) + i4_left;
 2499|  7.14k|            i4_y0 = 2;
 2500|  7.14k|            i4_ref_yD = 1;
 2501|  7.14k|            if(i4_top > 0)
  ------------------
  |  Branch (2501:16): [True: 3.44k, False: 3.69k]
  ------------------
 2502|  3.44k|            {
 2503|  3.44k|                i4_y0 += 8;
 2504|  3.44k|                i4_ref_yD = 18;
 2505|  3.44k|            }
 2506|       |
 2507|  7.14k|            i4_ref_xD = i4_x0 - (i4_left) - (i4_left >> 1);
 2508|  7.14k|            i4_xD = i4_x0 - i4_ref_xD;
 2509|  7.14k|            i4_yD = i4_y0 - i4_ref_yD;
 2510|  7.14k|            i4_xc0 = i4_x0 >> 1;
 2511|  7.14k|            i4_yc0 = i4_y0 >> 1;
 2512|  7.14k|            i4_c_ref_xD = i4_ref_xD >> 1;
 2513|  7.14k|            i4_c_ref_yD = i4_ref_yD >> 1;
 2514|  7.14k|            i4_c_xD = i4_xc0 - i4_c_ref_xD;
 2515|  7.14k|            i4_c_yD = i4_yc0 - i4_c_ref_yD;
 2516|       |
 2517|       |            /* Fill corner sample if unavailable */
 2518|  7.14k|            if(!i1_corner_samp_avlbl_flag)
  ------------------
  |  Branch (2518:16): [True: 6.44k, False: 700]
  ------------------
 2519|  6.44k|            {
 2520|  6.44k|                isvcd_corner_samp_dyadic(i4_x0, i4_y0, i4_xD, i4_yD, pu1_refarray_luma,
 2521|  6.44k|                                         pu1_refarray_cb, pu1_refarray_cr);
 2522|  6.44k|            }
 2523|       |
 2524|       |            /* Call the diagonal construction for the 8 rows */
 2525|  7.14k|            if(i4_top == i4_left)
  ------------------
  |  Branch (2525:16): [True: 3.65k, False: 3.48k]
  ------------------
 2526|  3.65k|            {
 2527|       |                /* if top * left = 1 (x0,y0) */
 2528|  3.65k|                u1_filled_samp = isvcd_diagonal_construct_dyadic(i4_x0, i4_y0, i4_xD, i4_yD,
 2529|  3.65k|                                                                 pu1_refarray_luma, DYADIC_REF_W_Y);
  ------------------
  |  |   56|  3.65k|#define DYADIC_REF_W_Y 20
  ------------------
 2530|       |
 2531|  3.65k|                pu1_tmp_dst = pu1_refarray_luma + (i4_y0 * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  3.65k|#define DYADIC_REF_W_Y 20
  ------------------
 2532|       |
 2533|       |                /* (x0,y0+1), ..., (x0,y0+7) and */
 2534|       |                /* (x0+1,y0), ..., (x0+1,y0+6)   */
 2535|  29.2k|                for(i4_y = i4_y0 + 1; i4_y < i4_y0 + 8; i4_y++)
  ------------------
  |  Branch (2535:39): [True: 25.5k, False: 3.65k]
  ------------------
 2536|  25.5k|                {
 2537|  25.5k|                    i4_yD++;
 2538|  25.5k|                    u1_filled_samp = isvcd_diagonal_construct_dyadic(
 2539|  25.5k|                        i4_x0, i4_y, i4_xD, i4_yD, pu1_refarray_luma, DYADIC_REF_W_Y);
  ------------------
  |  |   56|  25.5k|#define DYADIC_REF_W_Y 20
  ------------------
 2540|  25.5k|                    pu1_tmp_dst[i4_x0 + 1] = u1_filled_samp;
 2541|  25.5k|                    pu1_tmp_dst += DYADIC_REF_W_Y;
  ------------------
  |  |   56|  25.5k|#define DYADIC_REF_W_Y 20
  ------------------
 2542|  25.5k|                }
 2543|       |
 2544|       |                /* (x0+1,y0+7) */
 2545|  3.65k|                u1_filled_samp = isvcd_diagonal_construct_dyadic(
 2546|  3.65k|                    i4_x0 + 1, i4_y0 + 7, i4_xD + 1, i4_yD, pu1_refarray_luma, DYADIC_REF_W_Y);
  ------------------
  |  |   56|  3.65k|#define DYADIC_REF_W_Y 20
  ------------------
 2547|  3.65k|            }
 2548|  3.48k|            else
 2549|  3.48k|            {
 2550|       |                /* top * left = -1 (x0+1,y0) */
 2551|  3.48k|                u1_filled_samp = isvcd_diagonal_construct_dyadic(i4_x0 + 1, i4_y0, i4_xD + 1, i4_yD,
 2552|  3.48k|                                                                 pu1_refarray_luma, DYADIC_REF_W_Y);
  ------------------
  |  |   56|  3.48k|#define DYADIC_REF_W_Y 20
  ------------------
 2553|       |
 2554|  3.48k|                pu1_tmp_dst = pu1_refarray_luma + (i4_y0 * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  3.48k|#define DYADIC_REF_W_Y 20
  ------------------
 2555|       |
 2556|       |                /* (x0,y0), ..., (x0,y0+6) and   */
 2557|       |                /* (x0+1,y0+1), ..., (x0+1,y0+7) */
 2558|  27.8k|                for(i4_y = i4_y0; i4_y < i4_y0 + 7; i4_y++)
  ------------------
  |  Branch (2558:35): [True: 24.4k, False: 3.48k]
  ------------------
 2559|  24.4k|                {
 2560|  24.4k|                    u1_filled_samp = isvcd_diagonal_construct_dyadic(
 2561|  24.4k|                        i4_x0, i4_y, i4_xD, i4_yD, pu1_refarray_luma, DYADIC_REF_W_Y);
  ------------------
  |  |   56|  24.4k|#define DYADIC_REF_W_Y 20
  ------------------
 2562|       |
 2563|  24.4k|                    pu1_tmp_dst += DYADIC_REF_W_Y;
  ------------------
  |  |   56|  24.4k|#define DYADIC_REF_W_Y 20
  ------------------
 2564|  24.4k|                    pu1_tmp_dst[i4_x0 + 1] = u1_filled_samp;
 2565|  24.4k|                    i4_yD++;
 2566|  24.4k|                }
 2567|       |
 2568|       |                /* (x0,y0+7) */
 2569|  3.48k|                u1_filled_samp = isvcd_diagonal_construct_dyadic(i4_x0, i4_y0 + 7, i4_xD, i4_yD,
 2570|  3.48k|                                                                 pu1_refarray_luma, DYADIC_REF_W_Y);
  ------------------
  |  |   56|  3.48k|#define DYADIC_REF_W_Y 20
  ------------------
 2571|  3.48k|            }
 2572|       |
 2573|       |            /* For Cb and Cr */
 2574|  35.7k|            for(i4_y = i4_yc0; i4_y < i4_yc0 + 4; i4_y++)
  ------------------
  |  Branch (2574:32): [True: 28.5k, False: 7.14k]
  ------------------
 2575|  28.5k|            {
 2576|  28.5k|                u1_filled_samp = isvcd_diagonal_construct_dyadic(i4_xc0, i4_y, i4_c_xD, i4_c_yD,
 2577|  28.5k|                                                                 pu1_refarray_cb, DYADIC_REF_W_C);
  ------------------
  |  |   58|  28.5k|#define DYADIC_REF_W_C 10
  ------------------
 2578|  28.5k|                u1_filled_samp = isvcd_diagonal_construct_dyadic(i4_xc0, i4_y, i4_c_xD, i4_c_yD,
 2579|  28.5k|                                                                 pu1_refarray_cr, DYADIC_REF_W_C);
  ------------------
  |  |   58|  28.5k|#define DYADIC_REF_W_C 10
  ------------------
 2580|  28.5k|                i4_c_yD++;
 2581|  28.5k|            }
 2582|       |
 2583|  7.14k|        } /* (mb_x+left,mb_y) is unavailable */
 2584|       |
 2585|  8.06k|        if(!(u1_ny_avlblty & 4))
  ------------------
  |  Branch (2585:12): [True: 6.72k, False: 1.34k]
  ------------------
 2586|  6.72k|        {
 2587|       |            /* (mb_x,mb_y+top) is unavailable */
 2588|  6.72k|            WORD32 i4_xD, i4_yD;
 2589|  6.72k|            WORD32 i4_c_xD, i4_c_yD;
 2590|  6.72k|            UWORD8 *pu1_tmp_dst;
 2591|  6.72k|            UWORD8 u1_filled_samp;
 2592|       |
 2593|  6.72k|            i1_corner_samp_avlbl_flag = (u1_ny_avlblty & 2) >> 1;
 2594|  6.72k|            i4_y0 = 9 + (i4_top << 3) + (i4_top);
 2595|  6.72k|            i4_x0 = 2;
 2596|  6.72k|            i4_ref_xD = 1;
 2597|  6.72k|            if(i4_left > 0)
  ------------------
  |  Branch (2597:16): [True: 3.57k, False: 3.14k]
  ------------------
 2598|  3.57k|            {
 2599|  3.57k|                i4_x0 += 8;
 2600|  3.57k|                i4_ref_xD = 18;
 2601|  3.57k|            }
 2602|       |
 2603|  6.72k|            i4_ref_yD = i4_y0 - i4_top - (i4_top >> 1);
 2604|  6.72k|            i4_xD = i4_x0 - i4_ref_xD;
 2605|  6.72k|            i4_yD = i4_y0 - i4_ref_yD;
 2606|  6.72k|            i4_xc0 = i4_x0 >> 1;
 2607|  6.72k|            i4_yc0 = i4_y0 >> 1;
 2608|  6.72k|            i4_c_ref_xD = i4_ref_xD >> 1;
 2609|  6.72k|            i4_c_ref_yD = i4_ref_yD >> 1;
 2610|  6.72k|            i4_c_xD = i4_xc0 - i4_c_ref_xD;
 2611|  6.72k|            i4_c_yD = i4_yc0 - i4_c_ref_yD;
 2612|       |
 2613|  6.72k|            if(!i1_corner_samp_avlbl_flag)
  ------------------
  |  Branch (2613:16): [True: 6.44k, False: 280]
  ------------------
 2614|  6.44k|            {
 2615|  6.44k|                isvcd_corner_samp_dyadic(i4_x0, i4_y0, i4_xD, i4_yD, pu1_refarray_luma,
 2616|  6.44k|                                         pu1_refarray_cb, pu1_refarray_cr);
 2617|  6.44k|            }
 2618|       |
 2619|       |            /* Call the diagonal construction for the 2 rows */
 2620|  6.72k|            if(i4_top == i4_left)
  ------------------
  |  Branch (2620:16): [True: 3.39k, False: 3.32k]
  ------------------
 2621|  3.39k|            {
 2622|       |                /* if top * left = 1 (x0,y0) */
 2623|  3.39k|                u1_filled_samp = isvcd_diagonal_construct_dyadic(i4_x0, i4_y0, i4_xD, i4_yD,
 2624|  3.39k|                                                                 pu1_refarray_luma, DYADIC_REF_W_Y);
  ------------------
  |  |   56|  3.39k|#define DYADIC_REF_W_Y 20
  ------------------
 2625|       |
 2626|  3.39k|                pu1_tmp_dst = pu1_refarray_luma + ((i4_y0 + 1) * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  3.39k|#define DYADIC_REF_W_Y 20
  ------------------
 2627|       |
 2628|       |                /* (x0+1,y0), ..., (x0+7,y0) and */
 2629|       |                /* (x0,y0+1), ..., (x0+6,y0+1)   */
 2630|  27.1k|                for(i4_x = i4_x0 + 1; i4_x < i4_x0 + 8; i4_x++)
  ------------------
  |  Branch (2630:39): [True: 23.7k, False: 3.39k]
  ------------------
 2631|  23.7k|                {
 2632|  23.7k|                    i4_xD++;
 2633|  23.7k|                    u1_filled_samp = isvcd_diagonal_construct_dyadic(
 2634|  23.7k|                        i4_x, i4_y0, i4_xD, i4_yD, pu1_refarray_luma, DYADIC_REF_W_Y);
  ------------------
  |  |   56|  23.7k|#define DYADIC_REF_W_Y 20
  ------------------
 2635|  23.7k|                    pu1_tmp_dst[i4_x - 1] = u1_filled_samp;
 2636|  23.7k|                }
 2637|       |
 2638|       |                /* (x0+7,y0+1) */
 2639|  3.39k|                u1_filled_samp = isvcd_diagonal_construct_dyadic(
 2640|  3.39k|                    i4_x0 + 7, i4_y0 + 1, i4_xD, i4_yD + 1, pu1_refarray_luma, DYADIC_REF_W_Y);
  ------------------
  |  |   56|  3.39k|#define DYADIC_REF_W_Y 20
  ------------------
 2641|  3.39k|            }
 2642|  3.32k|            else
 2643|  3.32k|            {
 2644|       |                /* top * left = -1 */
 2645|       |                /* (x0,y0+1) */
 2646|  3.32k|                u1_filled_samp = isvcd_diagonal_construct_dyadic(i4_x0, i4_y0 + 1, i4_xD, i4_yD + 1,
 2647|  3.32k|                                                                 pu1_refarray_luma, DYADIC_REF_W_Y);
  ------------------
  |  |   56|  3.32k|#define DYADIC_REF_W_Y 20
  ------------------
 2648|       |
 2649|  3.32k|                pu1_tmp_dst = pu1_refarray_luma + ((i4_y0 + 1) * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  3.32k|#define DYADIC_REF_W_Y 20
  ------------------
 2650|       |
 2651|       |                /* (x0,y0), ..., (x0,y0+6) and   */
 2652|       |                /* (x0+1,y0+1), ..., (x0+1,y0+7) */
 2653|  26.6k|                for(i4_x = i4_x0; i4_x < i4_x0 + 7; i4_x++)
  ------------------
  |  Branch (2653:35): [True: 23.2k, False: 3.32k]
  ------------------
 2654|  23.2k|                {
 2655|  23.2k|                    u1_filled_samp = isvcd_diagonal_construct_dyadic(
 2656|  23.2k|                        i4_x, i4_y0, i4_xD, i4_yD, pu1_refarray_luma, DYADIC_REF_W_Y);
  ------------------
  |  |   56|  23.2k|#define DYADIC_REF_W_Y 20
  ------------------
 2657|       |
 2658|  23.2k|                    pu1_tmp_dst[i4_x + 1] = u1_filled_samp;
 2659|  23.2k|                    i4_xD++;
 2660|  23.2k|                }
 2661|       |
 2662|       |                /* (x0+7,y0) */
 2663|  3.32k|                u1_filled_samp = isvcd_diagonal_construct_dyadic(i4_x0 + 7, i4_y0, i4_xD, i4_yD,
 2664|  3.32k|                                                                 pu1_refarray_luma, DYADIC_REF_W_Y);
  ------------------
  |  |   56|  3.32k|#define DYADIC_REF_W_Y 20
  ------------------
 2665|  3.32k|            }
 2666|       |
 2667|       |            /* For Cb and Cr */
 2668|  33.6k|            for(i4_x = i4_xc0; i4_x < i4_xc0 + 4; i4_x++)
  ------------------
  |  Branch (2668:32): [True: 26.8k, False: 6.72k]
  ------------------
 2669|  26.8k|            {
 2670|  26.8k|                u1_filled_samp = isvcd_diagonal_construct_dyadic(i4_x, i4_yc0, i4_c_xD, i4_c_yD,
 2671|  26.8k|                                                                 pu1_refarray_cb, DYADIC_REF_W_C);
  ------------------
  |  |   58|  26.8k|#define DYADIC_REF_W_C 10
  ------------------
 2672|  26.8k|                u1_filled_samp = isvcd_diagonal_construct_dyadic(i4_x, i4_yc0, i4_c_xD, i4_c_yD,
 2673|  26.8k|                                                                 pu1_refarray_cr, DYADIC_REF_W_C);
  ------------------
  |  |   58|  26.8k|#define DYADIC_REF_W_C 10
  ------------------
 2674|  26.8k|                i4_c_xD++;
 2675|  26.8k|            }
 2676|       |
 2677|  6.72k|        } /* (mb_x,mb_y+top) is unavailable */
 2678|  8.06k|    }     /* if (mb_x+left,mb_y+top) not available */
 2679|  47.8k|    else
 2680|  47.8k|    {
 2681|  47.8k|        UWORD8 *pu1_tmp_dst1, *pu1_tmp_dst2;
 2682|  47.8k|        UWORD8 *pu1_tmp_src1, *pu1_tmp_src2;
 2683|       |
 2684|  47.8k|        if(0x02 == (u1_ny_avlblty & 0x6))
  ------------------
  |  Branch (2684:12): [True: 2.19k, False: 45.6k]
  ------------------
 2685|  2.19k|        {
 2686|       |            /* (mb_x+left,mb_y) available, (mb_x,mb_y+top) unavailable */
 2687|  2.19k|            i4_x0 = 9 + (i4_left << 3) + i4_left;
 2688|  2.19k|            i4_y0 = 9 + (i4_top << 3) + i4_top;
 2689|  2.19k|            i4_ref_yD = i4_y0 - i4_top - (i4_top >> 1);
 2690|       |
 2691|       |            /* Copy (x0,ref_yD), (x0+1,ref_yD) to  */
 2692|       |            /* (x0,y0), (x0+1,y0), and (x0,y0+1), (x0+1,y0+1) */
 2693|  2.19k|            pu1_tmp_src1 = pu1_refarray_luma + (i4_ref_yD * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  2.19k|#define DYADIC_REF_W_Y 20
  ------------------
 2694|  2.19k|            pu1_tmp_dst1 = pu1_refarray_luma + (i4_y0 * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  2.19k|#define DYADIC_REF_W_Y 20
  ------------------
 2695|  2.19k|            pu1_tmp_dst2 = pu1_tmp_dst1 + DYADIC_REF_W_Y;
  ------------------
  |  |   56|  2.19k|#define DYADIC_REF_W_Y 20
  ------------------
 2696|  2.19k|            pu1_tmp_dst1[i4_x0] = pu1_tmp_src1[i4_x0];
 2697|  2.19k|            pu1_tmp_dst2[i4_x0] = pu1_tmp_src1[i4_x0];
 2698|  2.19k|            pu1_tmp_dst1[i4_x0 + 1] = pu1_tmp_src1[i4_x0 + 1];
 2699|  2.19k|            pu1_tmp_dst2[i4_x0 + 1] = pu1_tmp_src1[i4_x0 + 1];
 2700|       |
 2701|       |            /* Cb and Cr copy */
 2702|  2.19k|            i4_xc0 = i4_x0 >> 1;
 2703|  2.19k|            i4_yc0 = i4_y0 >> 1;
 2704|  2.19k|            i4_c_ref_yD = i4_ref_yD >> 1;
 2705|  2.19k|            pu1_tmp_src1 = pu1_refarray_cb + (i4_c_ref_yD * DYADIC_REF_W_C);
  ------------------
  |  |   58|  2.19k|#define DYADIC_REF_W_C 10
  ------------------
 2706|  2.19k|            pu1_tmp_dst1 = pu1_refarray_cb + (i4_yc0 * DYADIC_REF_W_C);
  ------------------
  |  |   58|  2.19k|#define DYADIC_REF_W_C 10
  ------------------
 2707|  2.19k|            pu1_tmp_src2 = pu1_refarray_cr + (i4_c_ref_yD * DYADIC_REF_W_C);
  ------------------
  |  |   58|  2.19k|#define DYADIC_REF_W_C 10
  ------------------
 2708|  2.19k|            pu1_tmp_dst2 = pu1_refarray_cr + (i4_yc0 * DYADIC_REF_W_C);
  ------------------
  |  |   58|  2.19k|#define DYADIC_REF_W_C 10
  ------------------
 2709|  2.19k|            pu1_tmp_dst1[i4_xc0] = pu1_tmp_src1[i4_xc0];
 2710|  2.19k|            pu1_tmp_dst2[i4_xc0] = pu1_tmp_src2[i4_xc0];
 2711|       |
 2712|  2.19k|        } /* if (mb_x+left,mb_y) available, (mb_x,mb_y+top) unavailable */
 2713|  45.6k|        else if(0x04 == (u1_ny_avlblty & 0x6))
  ------------------
  |  Branch (2713:17): [True: 5.97k, False: 39.6k]
  ------------------
 2714|  5.97k|        {
 2715|       |            /* (mb_x+left,mb_y) unavailable, (mb_x,mb_y+top) available */
 2716|  5.97k|            i4_x0 = 9 + (i4_left << 3) + i4_left;
 2717|  5.97k|            i4_y0 = 9 + (i4_top << 3) + i4_top;
 2718|  5.97k|            i4_ref_xD = i4_x0 - i4_left - (i4_left >> 1);
 2719|       |
 2720|       |            /* Copy (ref_xD,y0) to (x0,y0) and (x0+1,y0) */
 2721|       |            /* copy (ref_xD,y0+1) to (x0,y0+1) and (x0+1,y0+1) */
 2722|  5.97k|            pu1_tmp_src1 = pu1_refarray_luma + (i4_y0 * DYADIC_REF_W_Y);
  ------------------
  |  |   56|  5.97k|#define DYADIC_REF_W_Y 20
  ------------------
 2723|  5.97k|            pu1_tmp_dst1 = pu1_tmp_src1;
 2724|  5.97k|            pu1_tmp_src2 = pu1_tmp_src1 + DYADIC_REF_W_Y;
  ------------------
  |  |   56|  5.97k|#define DYADIC_REF_W_Y 20
  ------------------
 2725|  5.97k|            pu1_tmp_dst2 = pu1_tmp_src2;
 2726|       |
 2727|  5.97k|            pu1_tmp_dst1[i4_x0] = pu1_tmp_src1[i4_ref_xD];
 2728|  5.97k|            pu1_tmp_dst1[i4_x0 + 1] = pu1_tmp_src1[i4_ref_xD];
 2729|  5.97k|            pu1_tmp_dst2[i4_x0] = pu1_tmp_src2[i4_ref_xD];
 2730|  5.97k|            pu1_tmp_dst2[i4_x0 + 1] = pu1_tmp_src2[i4_ref_xD];
 2731|       |
 2732|       |            /* Copy Cb and Cr */
 2733|  5.97k|            i4_xc0 = i4_x0 >> 1;
 2734|  5.97k|            i4_yc0 = i4_y0 >> 1;
 2735|  5.97k|            i4_c_ref_xD = i4_ref_xD >> 1;
 2736|       |
 2737|  5.97k|            pu1_tmp_src1 = pu1_refarray_cb + (i4_yc0 * DYADIC_REF_W_C);
  ------------------
  |  |   58|  5.97k|#define DYADIC_REF_W_C 10
  ------------------
 2738|  5.97k|            pu1_tmp_dst1 = pu1_tmp_src1;
 2739|  5.97k|            pu1_tmp_src2 = pu1_refarray_cr + (i4_yc0 * DYADIC_REF_W_C);
  ------------------
  |  |   58|  5.97k|#define DYADIC_REF_W_C 10
  ------------------
 2740|  5.97k|            pu1_tmp_dst2 = pu1_tmp_src2;
 2741|       |
 2742|  5.97k|            pu1_tmp_dst1[i4_xc0] = pu1_tmp_src1[i4_c_ref_xD];
 2743|  5.97k|            pu1_tmp_dst2[i4_xc0] = pu1_tmp_src2[i4_c_ref_xD];
 2744|       |
 2745|  5.97k|        } /* if (mb_x+left,mb_y) unavailable, (mb_x,mb_y+top) available */
 2746|  39.6k|        else if(0x6 == (u1_ny_avlblty & 0x6))
  ------------------
  |  Branch (2746:17): [True: 3.59k, False: 36.0k]
  ------------------
 2747|  3.59k|        {
 2748|       |            /* (mb_x+left,mb_y) available, (mb_x,mb_y+top) available */
 2749|  3.59k|            WORD32 i4_xD, i4_yD;
 2750|  3.59k|            WORD32 i4_c_xD, i4_c_yD;
 2751|       |
 2752|  3.59k|            i4_y0 = 9 + (i4_top << 3) + i4_top;
 2753|  3.59k|            i4_x0 = 9 + (i4_left << 3) + i4_left;
 2754|  3.59k|            i4_ref_xD = i4_x0 - i4_left - (i4_left >> 1);
 2755|  3.59k|            i4_ref_yD = i4_y0 - i4_top - (i4_top >> 1);
 2756|  3.59k|            i4_xD = i4_x0 - i4_ref_xD;
 2757|  3.59k|            i4_yD = i4_y0 - i4_ref_yD;
 2758|  3.59k|            i4_xc0 = i4_x0 >> 1;
 2759|  3.59k|            i4_yc0 = i4_y0 >> 1;
 2760|  3.59k|            i4_c_ref_xD = i4_ref_xD >> 1;
 2761|  3.59k|            i4_c_ref_yD = i4_ref_yD >> 1;
 2762|  3.59k|            i4_c_xD = i4_xc0 - i4_c_ref_xD;
 2763|  3.59k|            i4_c_yD = i4_yc0 - i4_c_ref_yD;
 2764|       |
 2765|       |            /* Call diagonal construction for luma */
 2766|  10.7k|            for(i4_y = i4_y0; i4_y < i4_y0 + 2; i4_y++)
  ------------------
  |  Branch (2766:31): [True: 7.19k, False: 3.59k]
  ------------------
 2767|  7.19k|            {
 2768|  21.5k|                for(i4_x = i4_x0; i4_x < i4_x0 + 2; i4_x++)
  ------------------
  |  Branch (2768:35): [True: 14.3k, False: 7.19k]
  ------------------
 2769|  14.3k|                {
 2770|  14.3k|                    isvcd_diagonal_construct_dyadic(i4_x, i4_y, i4_xD, i4_yD, pu1_refarray_luma,
 2771|  14.3k|                                                    DYADIC_REF_W_Y);
  ------------------
  |  |   56|  14.3k|#define DYADIC_REF_W_Y 20
  ------------------
 2772|  14.3k|                    i4_xD++;
 2773|  14.3k|                }
 2774|  7.19k|                i4_yD++;
 2775|  7.19k|                i4_xD -= 2;
 2776|  7.19k|            }
 2777|       |
 2778|       |            /* Call diagonal construction for chroma */
 2779|  3.59k|            isvcd_diagonal_construct_dyadic(i4_xc0, i4_yc0, i4_c_xD, i4_c_yD, pu1_refarray_cb,
 2780|  3.59k|                                            DYADIC_REF_W_C);
  ------------------
  |  |   58|  3.59k|#define DYADIC_REF_W_C 10
  ------------------
 2781|       |
 2782|  3.59k|            isvcd_diagonal_construct_dyadic(i4_xc0, i4_yc0, i4_c_xD, i4_c_yD, pu1_refarray_cr,
 2783|  3.59k|                                            DYADIC_REF_W_C);
  ------------------
  |  |   58|  3.59k|#define DYADIC_REF_W_C 10
  ------------------
 2784|       |
 2785|  3.59k|        } /* if (mb_x+left,mb_y) available, (mb_x,mb_y+top) available */
 2786|  47.8k|    }     /* (mb_x+left,mb_y+top) available */
 2787|       |
 2788|  55.9k|    return OK;
  ------------------
  |  |  114|  55.9k|#define OK        0
  ------------------
 2789|  56.2k|}
isvcd_interpolate_base_luma_dyadic:
 2817|  35.5k|{
 2818|  35.5k|    WORD32 i4_x, i4_y;
 2819|  35.5k|    WORD32 i4_coeff_0, i4_coeff_1, i4_coeff_2, i4_coeff_3;
 2820|  35.5k|    WORD32 i4_samp_0, i4_samp_1, i4_samp_2, i4_samp_3;
 2821|  35.5k|    WORD32 i4_rslt_1, i4_rslt_2;
 2822|  35.5k|    WORD32 i4_filt_stride, i4_src_stride;
 2823|  35.5k|    UWORD8 *pu1_inp, *pu1_out;
 2824|  35.5k|    WORD16 *pi2_tmp;
 2825|       |
 2826|       |    /* Filter coefficient values for phase 4 */
 2827|  35.5k|    i4_coeff_0 = -3;
 2828|  35.5k|    i4_coeff_1 = 28;
 2829|  35.5k|    i4_coeff_2 = 8;
 2830|  35.5k|    i4_coeff_3 = -1;
 2831|  35.5k|    i4_filt_stride = 12;
 2832|  35.5k|    i4_src_stride = DYADIC_REF_W_Y;
  ------------------
  |  |   56|  35.5k|#define DYADIC_REF_W_Y 20
  ------------------
 2833|  35.5k|    pu1_inp = pu1_inp_buf;
 2834|  35.5k|    pi2_tmp = pi2_tmp_filt_buf;
 2835|  35.5k|    pu1_out = pu1_out_buf;
 2836|       |
 2837|       |    /* Vertical interpolation */
 2838|   461k|    for(i4_x = 0; i4_x < 12; i4_x++)
  ------------------
  |  Branch (2838:19): [True: 426k, False: 35.5k]
  ------------------
 2839|   426k|    {
 2840|       |        /* y = 0, y_phase = 12 */
 2841|   426k|        i4_samp_0 = pu1_inp[i4_x];
 2842|   426k|        pu1_inp += i4_src_stride;
 2843|   426k|        i4_samp_1 = pu1_inp[i4_x];
 2844|   426k|        pu1_inp += i4_src_stride;
 2845|   426k|        i4_samp_2 = pu1_inp[i4_x];
 2846|   426k|        pu1_inp += i4_src_stride;
 2847|   426k|        i4_samp_3 = pu1_inp[i4_x];
 2848|   426k|        pu1_inp += i4_src_stride;
 2849|       |
 2850|       |        /* since y_phase 12 for y = 0 */
 2851|   426k|        i4_rslt_1 = i4_samp_0 * i4_coeff_3;
 2852|   426k|        i4_rslt_1 += i4_samp_1 * i4_coeff_2;
 2853|   426k|        i4_rslt_1 += i4_samp_2 * i4_coeff_1;
 2854|   426k|        i4_rslt_1 += i4_samp_3 * i4_coeff_0;
 2855|       |
 2856|       |        /* Store the output */
 2857|   426k|        pi2_tmp[i4_x] = i4_rslt_1;
 2858|       |        /* Increment the output ptr */
 2859|   426k|        pi2_tmp += i4_filt_stride;
 2860|       |
 2861|  3.41M|        for(i4_y = 1; i4_y < 15; i4_y += 2)
  ------------------
  |  Branch (2861:23): [True: 2.98M, False: 426k]
  ------------------
 2862|  2.98M|        {
 2863|  2.98M|            i4_samp_0 = i4_samp_1;
 2864|  2.98M|            i4_samp_1 = i4_samp_2;
 2865|  2.98M|            i4_samp_2 = i4_samp_3;
 2866|  2.98M|            i4_samp_3 = pu1_inp[i4_x];
 2867|       |
 2868|       |            /* y_phase is 4 for odd values of y */
 2869|       |            /* and 12 for even values of y    */
 2870|  2.98M|            i4_rslt_1 = i4_samp_0 * i4_coeff_0;
 2871|  2.98M|            i4_rslt_1 += i4_samp_1 * i4_coeff_1;
 2872|  2.98M|            i4_rslt_1 += i4_samp_2 * i4_coeff_2;
 2873|  2.98M|            i4_rslt_1 += i4_samp_3 * i4_coeff_3;
 2874|  2.98M|            i4_rslt_2 = i4_samp_0 * i4_coeff_3;
 2875|  2.98M|            i4_rslt_2 += i4_samp_1 * i4_coeff_2;
 2876|  2.98M|            i4_rslt_2 += i4_samp_2 * i4_coeff_1;
 2877|  2.98M|            i4_rslt_2 += i4_samp_3 * i4_coeff_0;
 2878|       |
 2879|       |            /* Storing the results */
 2880|  2.98M|            pi2_tmp[i4_x] = i4_rslt_1;
 2881|  2.98M|            pi2_tmp += i4_filt_stride;
 2882|  2.98M|            pi2_tmp[i4_x] = i4_rslt_2;
 2883|       |
 2884|       |            /* Incrementing the pointers */
 2885|  2.98M|            pi2_tmp += i4_filt_stride;
 2886|  2.98M|            pu1_inp += i4_src_stride;
 2887|       |
 2888|  2.98M|        } /* End of loop over y */
 2889|       |
 2890|       |        /* y = 15, y_phase = 4 */
 2891|   426k|        i4_samp_0 = i4_samp_1;
 2892|   426k|        i4_samp_1 = i4_samp_2;
 2893|   426k|        i4_samp_2 = i4_samp_3;
 2894|   426k|        i4_samp_3 = pu1_inp[i4_x];
 2895|       |
 2896|   426k|        i4_rslt_1 = i4_samp_0 * i4_coeff_0;
 2897|   426k|        i4_rslt_1 += i4_samp_1 * i4_coeff_1;
 2898|   426k|        i4_rslt_1 += i4_samp_2 * i4_coeff_2;
 2899|   426k|        i4_rslt_1 += i4_samp_3 * i4_coeff_3;
 2900|       |
 2901|       |        /* Store the output */
 2902|   426k|        pi2_tmp[i4_x] = i4_rslt_1;
 2903|       |
 2904|       |        /* Reinitializing the ptrs */
 2905|   426k|        pu1_inp = pu1_inp_buf;
 2906|   426k|        pi2_tmp = pi2_tmp_filt_buf;
 2907|   426k|    }
 2908|       |
 2909|       |    /* Horizontal interpolation */
 2910|   604k|    for(i4_y = 0; i4_y < 16; i4_y++)
  ------------------
  |  Branch (2910:19): [True: 568k, False: 35.5k]
  ------------------
 2911|   568k|    {
 2912|       |        /* x = 0, x_phase = 12 */
 2913|   568k|        i4_samp_0 = *pi2_tmp++;
 2914|   568k|        i4_samp_1 = *pi2_tmp++;
 2915|   568k|        i4_samp_2 = *pi2_tmp++;
 2916|   568k|        i4_samp_3 = *pi2_tmp++;
 2917|       |
 2918|       |        /* since x_phase 12 for x = 0 */
 2919|   568k|        i4_rslt_1 = i4_samp_0 * i4_coeff_3;
 2920|   568k|        i4_rslt_1 += i4_samp_1 * i4_coeff_2;
 2921|   568k|        i4_rslt_1 += i4_samp_2 * i4_coeff_1;
 2922|   568k|        i4_rslt_1 += i4_samp_3 * i4_coeff_0;
 2923|   568k|        i4_rslt_1 += 512;
 2924|       |
 2925|   568k|        i4_rslt_1 >>= 10;
 2926|       |
 2927|       |        /* Store the output */
 2928|   568k|        pu1_out[0] = CLIPUCHAR(i4_rslt_1);
  ------------------
  |  |   69|   568k|#define CLIPUCHAR(x) CLIP3(0, 255, (x))
  |  |  ------------------
  |  |  |  |   77|   568k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 5.52k, False: 563k]
  |  |  |  |  |  Branch (77:54): [True: 342, False: 562k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2929|       |
 2930|  4.54M|        for(i4_x = 1; i4_x < 15; i4_x += 2)
  ------------------
  |  Branch (2930:23): [True: 3.98M, False: 568k]
  ------------------
 2931|  3.98M|        {
 2932|  3.98M|            i4_samp_0 = i4_samp_1;
 2933|  3.98M|            i4_samp_1 = i4_samp_2;
 2934|  3.98M|            i4_samp_2 = i4_samp_3;
 2935|  3.98M|            i4_samp_3 = *pi2_tmp++;
 2936|       |
 2937|       |            /* x_phase is 4 for odd values of x */
 2938|       |            /* and 12 for even values of x    */
 2939|  3.98M|            i4_rslt_1 = i4_samp_0 * i4_coeff_0;
 2940|  3.98M|            i4_rslt_1 += i4_samp_1 * i4_coeff_1;
 2941|  3.98M|            i4_rslt_1 += i4_samp_2 * i4_coeff_2;
 2942|  3.98M|            i4_rslt_1 += i4_samp_3 * i4_coeff_3;
 2943|  3.98M|            i4_rslt_1 += 512;
 2944|       |
 2945|  3.98M|            i4_rslt_2 = i4_samp_0 * i4_coeff_3;
 2946|  3.98M|            i4_rslt_2 += i4_samp_1 * i4_coeff_2;
 2947|  3.98M|            i4_rslt_2 += i4_samp_2 * i4_coeff_1;
 2948|  3.98M|            i4_rslt_2 += i4_samp_3 * i4_coeff_0;
 2949|  3.98M|            i4_rslt_2 += 512;
 2950|       |
 2951|  3.98M|            i4_rslt_1 >>= 10;
 2952|  3.98M|            i4_rslt_2 >>= 10;
 2953|       |
 2954|       |            /* Store the output */
 2955|  3.98M|            pu1_out[i4_x] = CLIPUCHAR(i4_rslt_1);
  ------------------
  |  |   69|  3.98M|#define CLIPUCHAR(x) CLIP3(0, 255, (x))
  |  |  ------------------
  |  |  |  |   77|  3.98M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 53.4k, False: 3.92M]
  |  |  |  |  |  Branch (77:54): [True: 1.95k, False: 3.92M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2956|  3.98M|            pu1_out[i4_x + 1] = CLIPUCHAR(i4_rslt_2);
  ------------------
  |  |   69|  3.98M|#define CLIPUCHAR(x) CLIP3(0, 255, (x))
  |  |  ------------------
  |  |  |  |   77|  3.98M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 53.1k, False: 3.92M]
  |  |  |  |  |  Branch (77:54): [True: 2.12k, False: 3.92M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2957|  3.98M|        }
 2958|       |
 2959|       |        /* x = 15 */
 2960|   568k|        i4_samp_0 = i4_samp_1;
 2961|   568k|        i4_samp_1 = i4_samp_2;
 2962|   568k|        i4_samp_2 = i4_samp_3;
 2963|   568k|        i4_samp_3 = *pi2_tmp++;
 2964|       |
 2965|   568k|        i4_rslt_1 = i4_samp_0 * i4_coeff_0;
 2966|   568k|        i4_rslt_1 += i4_samp_1 * i4_coeff_1;
 2967|   568k|        i4_rslt_1 += i4_samp_2 * i4_coeff_2;
 2968|   568k|        i4_rslt_1 += i4_samp_3 * i4_coeff_3;
 2969|   568k|        i4_rslt_1 += 512;
 2970|       |
 2971|   568k|        i4_rslt_1 >>= 10;
 2972|       |
 2973|       |        /* Store the output */
 2974|   568k|        pu1_out[i4_x] = CLIPUCHAR(i4_rslt_1);
  ------------------
  |  |   69|   568k|#define CLIPUCHAR(x) CLIP3(0, 255, (x))
  |  |  ------------------
  |  |  |  |   77|   568k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 6.44k, False: 562k]
  |  |  |  |  |  Branch (77:54): [True: 420, False: 561k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2975|       |
 2976|       |        /* Increment the output ptr */
 2977|   568k|        pu1_out += i4_out_stride;
 2978|       |
 2979|   568k|    } /* End of loop over y */
 2980|  35.5k|} /* isvcd_interpolate_base_luma_dyadic */
isvcd_vert_interpol_chroma_dyadic_1:
 3017|  68.1k|{
 3018|  68.1k|    WORD32 i4_x, i4_y;
 3019|  68.1k|    WORD32 i4_coeff_0, i4_coeff_1, i4_coeff_2, i4_coeff_3;
 3020|  68.1k|    WORD32 i4_samp_0, i4_samp_1;
 3021|  68.1k|    WORD32 i4_rslt_1, i4_rslt_2;
 3022|  68.1k|    WORD32 i4_filt_stride, i4_src_stride;
 3023|  68.1k|    UWORD8 *pu1_inp;
 3024|  68.1k|    WORD16 *pi2_tmp;
 3025|       |
 3026|  68.1k|    i4_coeff_0 = 8 - i4_phase_0;
 3027|  68.1k|    i4_coeff_1 = i4_phase_0;
 3028|  68.1k|    i4_coeff_2 = 8 - i4_phase_1;
 3029|  68.1k|    i4_coeff_3 = i4_phase_1;
 3030|       |
 3031|  68.1k|    pu1_inp = pu1_inp_buf;
 3032|  68.1k|    pi2_tmp = pi2_tmp_filt_buf;
 3033|  68.1k|    i4_filt_stride = 6;
 3034|  68.1k|    i4_src_stride = DYADIC_REF_W_C;
  ------------------
  |  |   58|  68.1k|#define DYADIC_REF_W_C 10
  ------------------
 3035|       |
 3036|       |    /* Vertical interpolation */
 3037|   477k|    for(i4_x = 0; i4_x < 6; i4_x++)
  ------------------
  |  Branch (3037:19): [True: 409k, False: 68.1k]
  ------------------
 3038|   409k|    {
 3039|       |        /* y = 0, y_phase = phase_0 */
 3040|   409k|        i4_samp_0 = pu1_inp[i4_x];
 3041|   409k|        pu1_inp += i4_src_stride;
 3042|   409k|        i4_samp_1 = pu1_inp[i4_x];
 3043|   409k|        pu1_inp += i4_src_stride;
 3044|       |
 3045|       |        /* since y_phase = phase_0 for y = 0 */
 3046|   409k|        i4_rslt_1 = i4_samp_0 * i4_coeff_0;
 3047|   409k|        i4_rslt_1 += i4_samp_1 * i4_coeff_1;
 3048|       |
 3049|       |        /* Store the output */
 3050|   409k|        pi2_tmp[i4_x] = i4_rslt_1;
 3051|       |
 3052|       |        /* Increment the output ptr */
 3053|   409k|        pi2_tmp += i4_filt_stride;
 3054|       |
 3055|  1.63M|        for(i4_y = 1; i4_y < 7; i4_y += 2)
  ------------------
  |  Branch (3055:23): [True: 1.22M, False: 409k]
  ------------------
 3056|  1.22M|        {
 3057|  1.22M|            i4_samp_0 = i4_samp_1;
 3058|  1.22M|            i4_samp_1 = pu1_inp[i4_x];
 3059|       |
 3060|       |            /* y_phase is phase_1 for odd values of y */
 3061|       |            /* and phase_0 for even values of y          */
 3062|  1.22M|            i4_rslt_1 = i4_samp_0 * i4_coeff_2;
 3063|  1.22M|            i4_rslt_1 += i4_samp_1 * i4_coeff_3;
 3064|  1.22M|            i4_rslt_2 = i4_samp_0 * i4_coeff_0;
 3065|  1.22M|            i4_rslt_2 += i4_samp_1 * i4_coeff_1;
 3066|       |
 3067|       |            /* Storing the results */
 3068|  1.22M|            pi2_tmp[i4_x] = i4_rslt_1;
 3069|  1.22M|            pi2_tmp += i4_filt_stride;
 3070|  1.22M|            pi2_tmp[i4_x] = i4_rslt_2;
 3071|       |
 3072|       |            /* Incrementing the pointers */
 3073|  1.22M|            pi2_tmp += i4_filt_stride;
 3074|  1.22M|            pu1_inp += i4_src_stride;
 3075|       |
 3076|  1.22M|        } /* End of loop over y */
 3077|       |
 3078|       |        /* y = 7, y_phase = phase_1 */
 3079|   409k|        i4_samp_0 = i4_samp_1;
 3080|   409k|        i4_samp_1 = pu1_inp[i4_x];
 3081|       |
 3082|   409k|        i4_rslt_1 = i4_samp_0 * i4_coeff_2;
 3083|   409k|        i4_rslt_1 += i4_samp_1 * i4_coeff_3;
 3084|       |
 3085|       |        /* Store the output */
 3086|   409k|        pi2_tmp[i4_x] = i4_rslt_1;
 3087|       |
 3088|       |        /* Reinitializing the ptrs */
 3089|   409k|        pu1_inp = pu1_inp_buf;
 3090|   409k|        pi2_tmp = pi2_tmp_filt_buf;
 3091|       |
 3092|   409k|    } /* End of loop over x */
 3093|  68.1k|} /* isvcd_vert_interpol_chroma_dyadic_1 */
isvcd_vert_interpol_chroma_dyadic_2:
 3126|  1.42k|{
 3127|  1.42k|    WORD32 i4_x, i4_y;
 3128|  1.42k|    WORD32 i4_coeff_0, i4_coeff_1, i4_coeff_2, i4_coeff_3;
 3129|  1.42k|    WORD32 i4_samp_0, i4_samp_1;
 3130|  1.42k|    WORD32 i4_rslt_1, i4_rslt_2;
 3131|  1.42k|    WORD32 i4_filt_stride, i4_src_stride;
 3132|  1.42k|    UWORD8 *pu1_inp;
 3133|  1.42k|    WORD16 *pi2_tmp;
 3134|       |
 3135|  1.42k|    i4_coeff_0 = 8 - i4_phase_0;
 3136|  1.42k|    i4_coeff_1 = i4_phase_0;
 3137|  1.42k|    i4_coeff_2 = 8 - i4_phase_1;
 3138|  1.42k|    i4_coeff_3 = i4_phase_1;
 3139|       |
 3140|  1.42k|    pi2_tmp = pi2_tmp_filt_buf;
 3141|  1.42k|    i4_filt_stride = 6;
 3142|  1.42k|    i4_src_stride = DYADIC_REF_W_C;
  ------------------
  |  |   58|  1.42k|#define DYADIC_REF_W_C 10
  ------------------
 3143|  1.42k|    pu1_inp = pu1_inp_buf + i4_src_stride;
 3144|       |
 3145|       |    /* Vertical interpolation */
 3146|  9.98k|    for(i4_x = 0; i4_x < 6; i4_x++)
  ------------------
  |  Branch (3146:19): [True: 8.55k, False: 1.42k]
  ------------------
 3147|  8.55k|    {
 3148|  8.55k|        i4_samp_1 = pu1_inp[i4_x];
 3149|  8.55k|        pu1_inp += i4_src_stride;
 3150|       |
 3151|  42.7k|        for(i4_y = 0; i4_y < 8; i4_y += 2)
  ------------------
  |  Branch (3151:23): [True: 34.2k, False: 8.55k]
  ------------------
 3152|  34.2k|        {
 3153|  34.2k|            i4_samp_0 = i4_samp_1;
 3154|  34.2k|            i4_samp_1 = pu1_inp[i4_x];
 3155|       |
 3156|       |            /* y_phase is phase_1 for odd values of y and phase_0 for even values of y */
 3157|  34.2k|            i4_rslt_1 = i4_samp_0 * i4_coeff_0;
 3158|  34.2k|            i4_rslt_1 += i4_samp_1 * i4_coeff_1;
 3159|       |
 3160|  34.2k|            i4_rslt_2 = i4_samp_0 * i4_coeff_2;
 3161|  34.2k|            i4_rslt_2 += i4_samp_1 * i4_coeff_3;
 3162|       |
 3163|       |            /* Storing the results */
 3164|  34.2k|            pi2_tmp[i4_x] = i4_rslt_1;
 3165|  34.2k|            pi2_tmp += i4_filt_stride;
 3166|  34.2k|            pi2_tmp[i4_x] = i4_rslt_2;
 3167|       |
 3168|       |            /* Incrementing the pointers */
 3169|  34.2k|            pi2_tmp += i4_filt_stride;
 3170|  34.2k|            pu1_inp += i4_src_stride;
 3171|       |
 3172|  34.2k|        } /* End of loop over y */
 3173|       |
 3174|       |        /* Reinitializing the ptrs */
 3175|  8.55k|        pu1_inp = pu1_inp_buf + i4_src_stride;
 3176|  8.55k|        pi2_tmp = pi2_tmp_filt_buf;
 3177|       |
 3178|  8.55k|    } /* End of loop over x */
 3179|  1.42k|} /* isvcd_vert_interpol_chroma_dyadic_2 */
isvcd_vert_interpol_chroma_dyadic_3:
 3211|  1.47k|{
 3212|  1.47k|    WORD32 i4_x, i4_y;
 3213|  1.47k|    WORD32 i4_coeff_0, i4_coeff_1, i4_coeff_2, i4_coeff_3;
 3214|  1.47k|    WORD32 i4_samp_0, i4_samp_1;
 3215|  1.47k|    WORD32 i4_rslt_1, i4_rslt_2;
 3216|  1.47k|    WORD32 i4_filt_stride, i4_src_stride;
 3217|  1.47k|    UWORD8 *pu1_inp;
 3218|  1.47k|    WORD16 *pi2_tmp;
 3219|       |
 3220|  1.47k|    i4_coeff_0 = 8 - i4_phase_0;
 3221|  1.47k|    i4_coeff_1 = i4_phase_0;
 3222|  1.47k|    i4_coeff_2 = 8 - i4_phase_1;
 3223|  1.47k|    i4_coeff_3 = i4_phase_1;
 3224|       |
 3225|  1.47k|    pi2_tmp = pi2_tmp_filt_buf;
 3226|  1.47k|    i4_filt_stride = 6;
 3227|  1.47k|    i4_src_stride = DYADIC_REF_W_C;
  ------------------
  |  |   58|  1.47k|#define DYADIC_REF_W_C 10
  ------------------
 3228|  1.47k|    pu1_inp = pu1_inp_buf;
 3229|       |
 3230|       |    /* Vertical interpolation */
 3231|  10.3k|    for(i4_x = 0; i4_x < 6; i4_x++)
  ------------------
  |  Branch (3231:19): [True: 8.84k, False: 1.47k]
  ------------------
 3232|  8.84k|    {
 3233|  8.84k|        i4_samp_1 = pu1_inp[i4_x];
 3234|  8.84k|        pu1_inp += i4_src_stride;
 3235|       |
 3236|  44.2k|        for(i4_y = 0; i4_y < 8; i4_y += 2)
  ------------------
  |  Branch (3236:23): [True: 35.3k, False: 8.84k]
  ------------------
 3237|  35.3k|        {
 3238|  35.3k|            i4_samp_0 = i4_samp_1;
 3239|  35.3k|            i4_samp_1 = pu1_inp[i4_x];
 3240|       |
 3241|       |            /* y_phase is phase_1 for odd values of y */
 3242|       |            /* and phase_0 for even values of y          */
 3243|  35.3k|            i4_rslt_1 = i4_samp_0 * i4_coeff_0;
 3244|  35.3k|            i4_rslt_1 += i4_samp_1 * i4_coeff_1;
 3245|       |
 3246|  35.3k|            i4_rslt_2 = i4_samp_0 * i4_coeff_2;
 3247|  35.3k|            i4_rslt_2 += i4_samp_1 * i4_coeff_3;
 3248|       |
 3249|       |            /* Storing the results */
 3250|  35.3k|            pi2_tmp[i4_x] = i4_rslt_1;
 3251|  35.3k|            pi2_tmp += i4_filt_stride;
 3252|  35.3k|            pi2_tmp[i4_x] = i4_rslt_2;
 3253|       |
 3254|       |            /* Incrementing the pointers */
 3255|  35.3k|            pi2_tmp += i4_filt_stride;
 3256|  35.3k|            pu1_inp += i4_src_stride;
 3257|       |
 3258|  35.3k|        } /* End of loop over y */
 3259|       |
 3260|       |        /* Reinitializing the ptrs */
 3261|  8.84k|        pu1_inp = pu1_inp_buf;
 3262|  8.84k|        pi2_tmp = pi2_tmp_filt_buf;
 3263|       |
 3264|  8.84k|    } /* End of loop over x */
 3265|  1.47k|} /* isvcd_vert_interpol_chroma_dyadic_3 */
isvcd_horz_interpol_chroma_dyadic_1:
 3300|  42.9k|{
 3301|  42.9k|    WORD32 i4_x, i4_y;
 3302|  42.9k|    WORD32 i4_coeff_0, i4_coeff_1, i4_coeff_2, i4_coeff_3;
 3303|  42.9k|    WORD32 i4_samp_0, i4_samp_1;
 3304|  42.9k|    WORD32 i4_rslt_1, i4_rslt_2;
 3305|  42.9k|    WORD32 i4_dst_stride;
 3306|  42.9k|    UWORD8 *pu1_out;
 3307|  42.9k|    WORD16 *pi2_tmp;
 3308|       |
 3309|  42.9k|    i4_coeff_0 = 8 - i4_phase_0;
 3310|  42.9k|    i4_coeff_1 = i4_phase_0;
 3311|  42.9k|    i4_coeff_2 = 8 - i4_phase_1;
 3312|  42.9k|    i4_coeff_3 = i4_phase_1;
 3313|       |
 3314|  42.9k|    pu1_out = pu1_out_buf;
 3315|  42.9k|    pi2_tmp = pi2_tmp_filt_buf;
 3316|  42.9k|    i4_dst_stride = i4_out_stride;
 3317|       |
 3318|       |    /* Horizontal interpolation */
 3319|   386k|    for(i4_y = 0; i4_y < 8; i4_y++)
  ------------------
  |  Branch (3319:19): [True: 343k, False: 42.9k]
  ------------------
 3320|   343k|    {
 3321|       |        /* x = 0, x_phase = phase_0 */
 3322|   343k|        i4_samp_0 = *pi2_tmp++;
 3323|   343k|        i4_samp_1 = *pi2_tmp++;
 3324|       |
 3325|       |        /* since x_phase = phase_0 for x = 0 */
 3326|   343k|        i4_rslt_1 = i4_samp_0 * i4_coeff_0;
 3327|   343k|        i4_rslt_1 += i4_samp_1 * i4_coeff_1;
 3328|       |
 3329|       |        /* Round to 8-bit value */
 3330|   343k|        i4_rslt_1 += 32;
 3331|   343k|        i4_rslt_1 >>= 6;
 3332|       |
 3333|       |        /* Store the output */
 3334|   343k|        pu1_out[0] = i4_rslt_1;
 3335|       |
 3336|  1.37M|        for(i4_x = 1; i4_x < 7; i4_x += 2)
  ------------------
  |  Branch (3336:23): [True: 1.03M, False: 343k]
  ------------------
 3337|  1.03M|        {
 3338|  1.03M|            i4_samp_0 = i4_samp_1;
 3339|  1.03M|            i4_samp_1 = *pi2_tmp++;
 3340|       |
 3341|       |            /* x_phase is phase_1 for odd values of x and phase_0 for even values of x */
 3342|  1.03M|            i4_rslt_1 = i4_samp_0 * i4_coeff_2;
 3343|  1.03M|            i4_rslt_1 += i4_samp_1 * i4_coeff_3;
 3344|  1.03M|            i4_rslt_2 = i4_samp_0 * i4_coeff_0;
 3345|  1.03M|            i4_rslt_2 += i4_samp_1 * i4_coeff_1;
 3346|       |
 3347|       |            /* Rounding to 8-bit values */
 3348|  1.03M|            i4_rslt_1 += 32;
 3349|  1.03M|            i4_rslt_1 >>= 6;
 3350|  1.03M|            i4_rslt_2 += 32;
 3351|  1.03M|            i4_rslt_2 >>= 6;
 3352|       |
 3353|       |            /* Storing the results */
 3354|  1.03M|            pu1_out[2 * i4_x] = i4_rslt_1;
 3355|  1.03M|            pu1_out[2 * (i4_x + 1)] = i4_rslt_2;
 3356|       |
 3357|  1.03M|        } /* End of loop over y */
 3358|       |
 3359|       |        /* y = 7, y_phase = phase_1 */
 3360|   343k|        i4_samp_0 = i4_samp_1;
 3361|   343k|        i4_samp_1 = *pi2_tmp++;
 3362|       |
 3363|       |        /* since x_phase = phase_1 for x = 7 */
 3364|   343k|        i4_rslt_1 = i4_samp_0 * i4_coeff_2;
 3365|   343k|        i4_rslt_1 += i4_samp_1 * i4_coeff_3;
 3366|       |
 3367|       |        /* Round to 8-bit value */
 3368|   343k|        i4_rslt_1 += 32;
 3369|   343k|        i4_rslt_1 >>= 6;
 3370|       |
 3371|       |        /* Store the output */
 3372|   343k|        pu1_out[2 * 7] = i4_rslt_1;
 3373|       |
 3374|       |        /* Incrementing the output ptr */
 3375|   343k|        pu1_out += i4_dst_stride;
 3376|       |
 3377|   343k|    } /* End of loop over x */
 3378|  42.9k|} /* isvcd_horz_interpol_chroma_dyadic_1 */
isvcd_horz_interpol_chroma_dyadic_2:
 3411|  28.1k|{
 3412|  28.1k|    WORD32 i4_x, i4_y;
 3413|  28.1k|    WORD32 i4_coeff_0, i4_coeff_1, i4_coeff_2, i4_coeff_3;
 3414|  28.1k|    WORD32 i4_samp_0, i4_samp_1;
 3415|  28.1k|    WORD32 i4_rslt_1, i4_rslt_2;
 3416|  28.1k|    WORD32 i4_dst_stride;
 3417|  28.1k|    UWORD8 *pu1_out;
 3418|  28.1k|    WORD16 *pi2_tmp;
 3419|       |
 3420|  28.1k|    i4_coeff_0 = 8 - i4_phase_0;
 3421|  28.1k|    i4_coeff_1 = i4_phase_0;
 3422|  28.1k|    i4_coeff_2 = 8 - i4_phase_1;
 3423|  28.1k|    i4_coeff_3 = i4_phase_1;
 3424|       |
 3425|  28.1k|    pu1_out = pu1_out_buf;
 3426|  28.1k|    pi2_tmp = pi2_tmp_filt_buf + 1;
 3427|  28.1k|    i4_dst_stride = i4_out_stride;
 3428|       |
 3429|       |    /* Horizontal interpolation */
 3430|   252k|    for(i4_y = 0; i4_y < 8; i4_y++)
  ------------------
  |  Branch (3430:19): [True: 224k, False: 28.1k]
  ------------------
 3431|   224k|    {
 3432|       |        /* x = 0, x_phase = phase_0 */
 3433|   224k|        i4_samp_1 = *pi2_tmp++;
 3434|       |
 3435|  1.12M|        for(i4_x = 0; i4_x < 8; i4_x += 2)
  ------------------
  |  Branch (3435:23): [True: 899k, False: 224k]
  ------------------
 3436|   899k|        {
 3437|   899k|            i4_samp_0 = i4_samp_1;
 3438|   899k|            i4_samp_1 = *pi2_tmp++;
 3439|       |
 3440|       |            /* x_phase is phase_1 for odd values of x */
 3441|       |            /* and phase_0 for even values of x          */
 3442|   899k|            i4_rslt_1 = i4_samp_0 * i4_coeff_0;
 3443|   899k|            i4_rslt_1 += i4_samp_1 * i4_coeff_1;
 3444|       |
 3445|   899k|            i4_rslt_2 = i4_samp_0 * i4_coeff_2;
 3446|   899k|            i4_rslt_2 += i4_samp_1 * i4_coeff_3;
 3447|       |
 3448|       |            /* Rounding to 8-bit values */
 3449|   899k|            i4_rslt_1 += 32;
 3450|   899k|            i4_rslt_1 >>= 6;
 3451|   899k|            i4_rslt_2 += 32;
 3452|   899k|            i4_rslt_2 >>= 6;
 3453|       |
 3454|       |            /* Storing the results */
 3455|   899k|            pu1_out[2 * i4_x] = i4_rslt_1;
 3456|   899k|            pu1_out[2 * (i4_x + 1)] = i4_rslt_2;
 3457|       |
 3458|   899k|        } /* End of loop over x */
 3459|       |
 3460|       |        /* Incrementing the ptrs */
 3461|   224k|        pi2_tmp += 1;
 3462|   224k|        pu1_out += i4_dst_stride;
 3463|       |
 3464|   224k|    } /* End of loop over y */
 3465|  28.1k|} /* isvcd_horz_interpol_chroma_dyadic_2 */
isvcd_intra_resamp_mb_dyadic:
 3500|  56.2k|{
 3501|       |    /* --------------------------------------------------------------------- */
 3502|       |    /* I/O buffer params                                                     */
 3503|       |    /* --------------------------------------------------------------------- */
 3504|  56.2k|    UWORD8 *pu1_inp_luma, *pu1_inp_chroma;
 3505|  56.2k|    UWORD8 *pu1_out_luma, *pu1_out_chroma;
 3506|  56.2k|    UWORD8 *pu1_out_cb, *pu1_out_cr;
 3507|  56.2k|    UWORD8 *pu1_refarray_luma, *pu1_refarray_cb, *pu1_refarray_cr;
 3508|  56.2k|    WORD16 *pi2_tmp_filt_buf;
 3509|  56.2k|    WORD32 i4_inp_luma_stride, i4_inp_chroma_stride;
 3510|  56.2k|    WORD32 i4_out_luma_stride, i4_out_chroma_stride;
 3511|  56.2k|    UWORD16 u2_mb_x_ref, u2_mb_y_ref;
 3512|  56.2k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) pv_svc_dec;
 3513|  56.2k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 3514|       |
 3515|       |    /* --------------------------------------------------------------------- */
 3516|       |    /* Intra resampling ctxt pointers                                         */
 3517|       |    /* --------------------------------------------------------------------- */
 3518|  56.2k|    intra_sampling_ctxt_t *ps_ctxt;
 3519|  56.2k|    intra_samp_lyr_ctxt *ps_lyr_ctxt;
 3520|       |
 3521|       |    /* --------------------------------------------------------------------- */
 3522|       |    /* reference and current layer MB coordinates                             */
 3523|       |    /* --------------------------------------------------------------------- */
 3524|  56.2k|    WORD32 i4_scaled_mb_x, i4_scaled_mb_y;
 3525|  56.2k|    WORD32 i4_top, i4_left;
 3526|  56.2k|    WORD32 ret;
 3527|       |
 3528|  56.2k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 3529|       |    /* --------------------------------------------------------------------- */
 3530|       |    /* Pointer derivation                                                     */
 3531|       |    /* --------------------------------------------------------------------- */
 3532|  56.2k|    ps_ctxt = (intra_sampling_ctxt_t *) pv_intra_samp_ctxt;
 3533|  56.2k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_ctxt->i4_res_lyr_id];
 3534|       |
 3535|       |    /* --------------------------------------------------------------------- */
 3536|       |    /* MB coordinate derivation                                                 */
 3537|       |    /* --------------------------------------------------------------------- */
 3538|  56.2k|    i4_scaled_mb_x =
 3539|  56.2k|        ps_mb_coord->u2_mb_x - (ps_svc_slice_params->i4_scaled_ref_layer_left_offset >> 4);
 3540|  56.2k|    i4_scaled_mb_y =
 3541|  56.2k|        ps_mb_coord->u2_mb_y - (ps_svc_slice_params->i4_scaled_ref_layer_top_offset >> 4);
 3542|       |
 3543|  56.2k|    if(i4_scaled_mb_x & 0x1)
  ------------------
  |  Branch (3543:8): [True: 27.9k, False: 28.3k]
  ------------------
 3544|  27.9k|    {
 3545|  27.9k|        i4_left = 1;
 3546|  27.9k|    }
 3547|  28.3k|    else
 3548|  28.3k|    {
 3549|  28.3k|        i4_left = -1;
 3550|  28.3k|    }
 3551|  56.2k|    if(i4_scaled_mb_y & 0x1)
  ------------------
  |  Branch (3551:8): [True: 26.8k, False: 29.4k]
  ------------------
 3552|  26.8k|    {
 3553|  26.8k|        i4_top = 1;
 3554|  26.8k|    }
 3555|  29.4k|    else
 3556|  29.4k|    {
 3557|  29.4k|        i4_top = -1;
 3558|  29.4k|    }
 3559|       |
 3560|  56.2k|    u2_mb_x_ref = (i4_scaled_mb_x >> 1);
 3561|  56.2k|    u2_mb_y_ref = (i4_scaled_mb_y >> 1);
 3562|       |
 3563|       |    /* --------------------------------------------------------------------- */
 3564|       |    /* Reference Array Consrtuction - luma and chroma                         */
 3565|       |    /* --------------------------------------------------------------------- */
 3566|  56.2k|    pu1_inp_luma = (UWORD8 *) ps_ref_luma->pv_buffer;
 3567|  56.2k|    pu1_inp_chroma = (UWORD8 *) ps_ref_chroma->pv_buffer;
 3568|  56.2k|    i4_inp_luma_stride = ps_ref_luma->i4_num_element_stride;
 3569|  56.2k|    i4_inp_chroma_stride = ps_ref_chroma->i4_num_element_stride;
 3570|       |
 3571|       |    /* ------- Constructing refSampleArray ----------------------- */
 3572|  56.2k|    ret = isvcd_reflayer_construction_dyadic(
 3573|  56.2k|        pv_intra_samp_ctxt, ps_ref_mb_mode_map, pu1_inp_luma, pu1_inp_chroma, i4_inp_luma_stride,
 3574|  56.2k|        i4_inp_chroma_stride, i4_top, i4_left, u2_mb_x_ref, u2_mb_y_ref);
 3575|       |
 3576|  56.2k|    if(ret != OK)
  ------------------
  |  |  114|  56.2k|#define OK        0
  ------------------
  |  Branch (3576:8): [True: 0, False: 56.2k]
  ------------------
 3577|      0|    {
 3578|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3579|      0|    }
 3580|       |    /* --------------------------------------------------------------------- */
 3581|       |    /* LUMA INTERPOLATION                                                       */
 3582|       |    /* --------------------------------------------------------------------- */
 3583|  56.2k|    pu1_refarray_luma = ps_ctxt->pu1_refarray_buffer;
 3584|  56.2k|    if(1 == i4_top)
  ------------------
  |  Branch (3584:8): [True: 26.8k, False: 29.4k]
  ------------------
 3585|  26.8k|    {
 3586|  26.8k|        pu1_refarray_luma += (DYADIC_REF_W_Y << 3);
  ------------------
  |  |   56|  26.8k|#define DYADIC_REF_W_Y 20
  ------------------
 3587|  26.8k|    }
 3588|  56.2k|    if(1 == i4_left)
  ------------------
  |  Branch (3588:8): [True: 27.9k, False: 28.3k]
  ------------------
 3589|  27.9k|    {
 3590|  27.9k|        pu1_refarray_luma += 8;
 3591|  27.9k|    }
 3592|  56.2k|    pu1_out_luma = (UWORD8 *) ps_curr_luma->pv_buffer;
 3593|  56.2k|    i4_out_luma_stride = ps_curr_luma->i4_num_element_stride;
 3594|  56.2k|    pi2_tmp_filt_buf = (WORD16 *) ps_ctxt->pi4_temp_interpolation_buffer;
 3595|       |
 3596|  56.2k|    ps_ctxt->pf_interpolate_base_luma_dyadic(pu1_refarray_luma, pi2_tmp_filt_buf, pu1_out_luma,
 3597|  56.2k|                                             i4_out_luma_stride);
 3598|       |
 3599|       |    /* --------------------------------------------------------------------- */
 3600|       |    /* CHROMA INTERPOLATION                                                     */
 3601|       |    /* --------------------------------------------------------------------- */
 3602|  56.2k|    pu1_out_chroma = (UWORD8 *) ps_curr_chroma->pv_buffer;
 3603|  56.2k|    i4_out_chroma_stride = ps_curr_chroma->i4_num_element_stride;
 3604|       |
 3605|       |    /* CB */
 3606|  56.2k|    pu1_out_cb = pu1_out_chroma;
 3607|  56.2k|    pu1_refarray_cb = ps_ctxt->pu1_refarray_cb;
 3608|       |
 3609|  56.2k|    if(1 == i4_top)
  ------------------
  |  Branch (3609:8): [True: 26.8k, False: 29.4k]
  ------------------
 3610|  26.8k|    {
 3611|  26.8k|        pu1_refarray_cb += (DYADIC_REF_W_C << 2);
  ------------------
  |  |   58|  26.8k|#define DYADIC_REF_W_C 10
  ------------------
 3612|  26.8k|    }
 3613|  56.2k|    if(1 == i4_left)
  ------------------
  |  Branch (3613:8): [True: 27.9k, False: 28.3k]
  ------------------
 3614|  27.9k|    {
 3615|  27.9k|        pu1_refarray_cb += 4;
 3616|  27.9k|    }
 3617|       |
 3618|       |    /* Vertical interpolation */
 3619|  56.2k|    ps_lyr_ctxt->pf_vert_chroma_interpol(pu1_refarray_cb, pi2_tmp_filt_buf,
 3620|  56.2k|                                         ps_lyr_ctxt->i4_y_phase_0, ps_lyr_ctxt->i4_y_phase_1);
 3621|       |
 3622|       |    /* Horizontal interpolation */
 3623|  56.2k|    ps_lyr_ctxt->pf_horz_chroma_interpol(pi2_tmp_filt_buf, pu1_out_cb, i4_out_chroma_stride,
 3624|  56.2k|                                         ps_lyr_ctxt->i4_x_phase_0, ps_lyr_ctxt->i4_x_phase_1);
 3625|       |
 3626|       |    /* CR */
 3627|  56.2k|    pu1_out_cr = pu1_out_chroma + 1;
 3628|  56.2k|    pu1_refarray_cr = ps_ctxt->pu1_refarray_cr;
 3629|       |
 3630|  56.2k|    if(1 == i4_top)
  ------------------
  |  Branch (3630:8): [True: 26.8k, False: 29.4k]
  ------------------
 3631|  26.8k|    {
 3632|  26.8k|        pu1_refarray_cr += (DYADIC_REF_W_C << 2);
  ------------------
  |  |   58|  26.8k|#define DYADIC_REF_W_C 10
  ------------------
 3633|  26.8k|    }
 3634|  56.2k|    if(1 == i4_left)
  ------------------
  |  Branch (3634:8): [True: 27.9k, False: 28.3k]
  ------------------
 3635|  27.9k|    {
 3636|  27.9k|        pu1_refarray_cr += 4;
 3637|  27.9k|    }
 3638|       |
 3639|       |    /* Vertical interpolation */
 3640|  56.2k|    ps_lyr_ctxt->pf_vert_chroma_interpol(pu1_refarray_cr, pi2_tmp_filt_buf,
 3641|  56.2k|                                         ps_lyr_ctxt->i4_y_phase_0, ps_lyr_ctxt->i4_y_phase_1);
 3642|       |
 3643|       |    /* Horizontal interpolation */
 3644|  56.2k|    ps_lyr_ctxt->pf_horz_chroma_interpol(pi2_tmp_filt_buf, pu1_out_cr, i4_out_chroma_stride,
 3645|  56.2k|                                         ps_lyr_ctxt->i4_x_phase_0, ps_lyr_ctxt->i4_x_phase_1);
 3646|  56.2k|    return OK;
  ------------------
  |  |  114|  56.2k|#define OK        0
  ------------------
 3647|  56.2k|}
isvcd_interpolate_intra_base:
 3680|  74.4k|{
 3681|       |    /* --------------------------------------------------------------------- */
 3682|       |    /* Index Parameters                                                         */
 3683|       |    /* --------------------------------------------------------------------- */
 3684|  74.4k|    intra_sampling_ctxt_t *ps_ctxt;
 3685|  74.4k|    intra_samp_map_ctxt_t *ps_map_ctxt;
 3686|  74.4k|    intra_samp_lyr_ctxt *ps_lyr_ctxt;
 3687|  74.4k|    WORD32 i4_x, i4_y;
 3688|  74.4k|    WORD32 i4_frm_mb_x, i4_frm_mb_y;
 3689|  74.4k|    ref_pixel_map_t *ps_x_pos_phase;
 3690|  74.4k|    ref_pixel_map_t *ps_y_pos_phase;
 3691|       |
 3692|  74.4k|    WORD32 i4_temp_array_ht;
 3693|  74.4k|    WORD32 *pi4_interp_buff;
 3694|  74.4k|    WORD32 *pi4_interp_buff_temp;
 3695|  74.4k|    WORD32 i4_mb_wd;
 3696|  74.4k|    WORD32 i4_mb_ht;
 3697|  74.4k|    WORD32 i4_x_min, i4_x_max;
 3698|  74.4k|    ref_min_max_map_t *ps_x_min_max;
 3699|  74.4k|    UWORD8 *pu1_refarray = NULL;
 3700|       |
 3701|       |    /* --------------------------------------------------------------------- */
 3702|       |    /* Extracting pointers from the  context                                  */
 3703|       |    /* --------------------------------------------------------------------- */
 3704|  74.4k|    ps_ctxt = (intra_sampling_ctxt_t *) pv_intra_samp_ctxt;
 3705|  74.4k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_ctxt->i4_res_lyr_id];
 3706|       |
 3707|  74.4k|    if(0 == i4_refarray_flag)
  ------------------
  |  Branch (3707:8): [True: 49.6k, False: 24.8k]
  ------------------
 3708|  49.6k|    {
 3709|  49.6k|        pu1_refarray = ps_ctxt->pu1_refarray_buffer;
 3710|  49.6k|    }
 3711|  24.8k|    else if(1 == i4_refarray_flag)
  ------------------
  |  Branch (3711:13): [True: 24.8k, False: 0]
  ------------------
 3712|  24.8k|    {
 3713|  24.8k|        pu1_refarray = ps_ctxt->pu1_refarray_cb;
 3714|  24.8k|    }
 3715|       |
 3716|       |    /* --------------------------------------------------------------------- */
 3717|       |    /* LUMA    or CHROMA */
 3718|       |    /* --------------------------------------------------------------------- */
 3719|  74.4k|    if(1 == i4_chroma_flag)
  ------------------
  |  Branch (3719:8): [True: 49.6k, False: 24.8k]
  ------------------
 3720|  49.6k|        ps_map_ctxt = &(ps_lyr_ctxt->s_chroma_map_ctxt);
 3721|  24.8k|    else
 3722|  24.8k|        ps_map_ctxt = &(ps_lyr_ctxt->s_luma_map_ctxt);
 3723|       |
 3724|  74.4k|    i4_mb_wd = MB_WIDTH >> i4_chroma_flag;
  ------------------
  |  |   67|  74.4k|#define MB_WIDTH 16
  ------------------
 3725|  74.4k|    i4_mb_ht = MB_HEIGHT >> i4_chroma_flag;
  ------------------
  |  |   68|  74.4k|#define MB_HEIGHT 16
  ------------------
 3726|  74.4k|    ps_x_min_max = ps_map_ctxt->ps_x_min_max;
 3727|  74.4k|    i4_frm_mb_y = i4_mb_y * i4_mb_ht;
 3728|  74.4k|    i4_frm_mb_x = i4_mb_x * i4_mb_wd;
 3729|       |
 3730|       |    /* get the min and max positions */
 3731|  74.4k|    i4_x_min = ps_x_min_max[i4_mb_x].i2_min_pos;
 3732|  74.4k|    i4_x_max = ps_x_min_max[i4_mb_x].i2_max_pos;
 3733|       |
 3734|       |    /* --------------------------------------------------------------------- */
 3735|       |    /* Projected frame level pointers                                        */
 3736|       |    /* --------------------------------------------------------------------- */
 3737|  74.4k|    ps_x_pos_phase = ps_map_ctxt->ps_x_pos_phase;
 3738|  74.4k|    ps_y_pos_phase = ps_map_ctxt->ps_y_pos_phase;
 3739|       |
 3740|       |    /* --------------------------------------------------------------------- */
 3741|       |    /* Pointers and Dimenstion of the temporary buffer                         */
 3742|       |    /* --------------------------------------------------------------------- */
 3743|  74.4k|    i4_temp_array_ht = i4_mb_ht;
 3744|  74.4k|    pi4_interp_buff = ps_ctxt->pi4_temp_interpolation_buffer;
 3745|  74.4k|    pi4_interp_buff_temp = pi4_interp_buff;
 3746|       |
 3747|       |    /* --------------------------------------------------------------------- */
 3748|       |    /* Loop for interpolation in vertical direction                             */
 3749|       |    /* --------------------------------------------------------------------- */
 3750|   868k|    for(i4_y = 0; i4_y < (i4_temp_array_ht); i4_y++)
  ------------------
  |  Branch (3750:19): [True: 793k, False: 74.4k]
  ------------------
 3751|   793k|    {
 3752|  10.5M|        for(i4_x = (i4_x_min - 1); i4_x <= (i4_x_max + 2); i4_x++)
  ------------------
  |  Branch (3752:36): [True: 9.75M, False: 793k]
  ------------------
 3753|  9.75M|        {
 3754|  9.75M|            UWORD8 *pu1_refarray_temp;
 3755|  9.75M|            WORD32 i4_y_ref;
 3756|  9.75M|            WORD32 i4_y_phase;
 3757|       |            /* ------------------------------------------------------------ */
 3758|       |            /* Finding the offset                                            */
 3759|       |            /* ------------------------------------------------------------ */
 3760|  9.75M|            i4_y_ref = ps_y_pos_phase[i4_y + i4_frm_mb_y].i2_ref_pos;
 3761|  9.75M|            i4_y_phase = ps_y_pos_phase[i4_y + i4_frm_mb_y].i2_phase;
 3762|  9.75M|            pu1_refarray_temp = pu1_refarray + i4_x + (i4_y_ref * i4_refarray_wd);
 3763|       |
 3764|       |            /* ------------------------------------------------------------ */
 3765|       |            /* Check for Luma/Chroma Processing                                */
 3766|       |            /* ------------------------------------------------------------ */
 3767|  9.75M|            if(0 == i4_chroma_flag)
  ------------------
  |  Branch (3767:16): [True: 5.95M, False: 3.80M]
  ------------------
 3768|  5.95M|            {
 3769|  5.95M|                *(pi4_interp_buff + i4_x) =
 3770|  5.95M|                    (g_ai1_interp_filter_luma[i4_y_phase]) *
 3771|  5.95M|                        (*(pu1_refarray_temp - i4_refarray_wd)) +
 3772|       |
 3773|  5.95M|                    (g_ai1_interp_filter_luma[16 + i4_y_phase]) * (*(pu1_refarray_temp)) +
 3774|       |
 3775|  5.95M|                    (g_ai1_interp_filter_luma[32 + i4_y_phase]) *
 3776|  5.95M|                        (*(pu1_refarray_temp + i4_refarray_wd)) +
 3777|       |
 3778|  5.95M|                    (g_ai1_interp_filter_luma[48 + i4_y_phase]) *
 3779|  5.95M|                        (*(pu1_refarray_temp + (2 * i4_refarray_wd)));
 3780|  5.95M|            }
 3781|  3.80M|            else
 3782|  3.80M|            {
 3783|  3.80M|                *(pi4_interp_buff + i4_x) =
 3784|  3.80M|                    (g_au1_interp_filter_chroma[i4_y_phase]) * (*(pu1_refarray_temp)) +
 3785|       |
 3786|  3.80M|                    (g_au1_interp_filter_chroma[16 + i4_y_phase]) *
 3787|  3.80M|                        (*(pu1_refarray_temp + i4_refarray_wd));
 3788|  3.80M|            }
 3789|       |
 3790|  9.75M|        } /* end of loop over array  width */
 3791|   793k|        pi4_interp_buff = pi4_interp_buff + i4_refarray_wd;
 3792|   793k|    }     /* end of loop over temp array height*/
 3793|       |
 3794|  74.4k|    pi4_interp_buff = pi4_interp_buff_temp;
 3795|       |
 3796|       |    /* --------------------------------------------------------------------- */
 3797|       |    /* Loop for interpolation in horizontal direction                         */
 3798|       |    /* --------------------------------------------------------------------- */
 3799|   868k|    for(i4_y = 0; i4_y < i4_temp_array_ht; i4_y++)
  ------------------
  |  Branch (3799:19): [True: 793k, False: 74.4k]
  ------------------
 3800|   793k|    {
 3801|  10.3M|        for(i4_x = 0; i4_x < i4_mb_wd; i4_x++)
  ------------------
  |  Branch (3801:23): [True: 9.52M, False: 793k]
  ------------------
 3802|  9.52M|        {
 3803|  9.52M|            WORD32 i4_x_ref;
 3804|  9.52M|            WORD32 i4_x_phase;
 3805|       |            /* ------------------------------------------------------------- */
 3806|       |            /* Finding the offset                                             */
 3807|       |            /* ------------------------------------------------------------- */
 3808|  9.52M|            i4_x_ref = ps_x_pos_phase[i4_x + i4_frm_mb_x].i2_ref_pos;
 3809|  9.52M|            i4_x_phase = ps_x_pos_phase[i4_x + i4_frm_mb_x].i2_phase;
 3810|  9.52M|            pi4_interp_buff_temp = pi4_interp_buff + i4_x_ref;
 3811|       |
 3812|       |            /* ------------------------------------------------------------- */
 3813|       |            /* Check for Luma/Chroma Processing                                 */
 3814|       |            /* ------------------------------------------------------------- */
 3815|  9.52M|            if(0 == i4_chroma_flag)
  ------------------
  |  Branch (3815:16): [True: 6.35M, False: 3.17M]
  ------------------
 3816|  6.35M|            {
 3817|  6.35M|                *(pu1_out + i4_x + (i4_y * i4_out_stride)) =
 3818|       |
 3819|  6.35M|                    CLIPUCHAR(
  ------------------
  |  |   69|  6.35M|#define CLIPUCHAR(x) CLIP3(0, 255, (x))
  |  |  ------------------
  |  |  |  |   77|  6.35M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 69.3k, False: 6.28M]
  |  |  |  |  |  Branch (77:54): [True: 2.51k, False: 6.27M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3820|  6.35M|                        ((g_ai1_interp_filter_luma[i4_x_phase]) * (*(pi4_interp_buff_temp - 1)) +
 3821|  6.35M|                         (g_ai1_interp_filter_luma[16 + i4_x_phase]) * (*(pi4_interp_buff_temp)) +
 3822|  6.35M|                         (g_ai1_interp_filter_luma[32 + i4_x_phase]) *
 3823|  6.35M|                             (*(pi4_interp_buff_temp + 1)) +
 3824|  6.35M|                         (g_ai1_interp_filter_luma[48 + i4_x_phase]) *
 3825|  6.35M|                             (*(pi4_interp_buff_temp + 2)) +
 3826|  6.35M|                         512) >>
 3827|  6.35M|                        10);
 3828|  6.35M|            }
 3829|  3.17M|            else
 3830|  3.17M|            {
 3831|  3.17M|                *(pu1_out + (2 * i4_x) + (i4_y * i4_out_stride)) = CLIPUCHAR(
  ------------------
  |  |   69|  3.17M|#define CLIPUCHAR(x) CLIP3(0, 255, (x))
  |  |  ------------------
  |  |  |  |   77|  3.17M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 0, False: 3.17M]
  |  |  |  |  |  Branch (77:54): [True: 0, False: 3.17M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3832|  3.17M|                    ((g_au1_interp_filter_chroma[i4_x_phase]) * (*(pi4_interp_buff_temp)) +
 3833|  3.17M|                     (g_au1_interp_filter_chroma[16 + i4_x_phase]) * (*(pi4_interp_buff_temp + 1)) +
 3834|  3.17M|                     512) >>
 3835|  3.17M|                    10);
 3836|  3.17M|            }
 3837|       |
 3838|  9.52M|        } /* end of loop over array width */
 3839|   793k|        pi4_interp_buff = pi4_interp_buff + i4_refarray_wd;
 3840|   793k|    }     /* end of loop over MB height */
 3841|       |
 3842|  74.4k|    return;
 3843|  74.4k|} /* End of Interpolation Function */
isvcd_intra_resamp_mb:
 3876|  41.4k|{
 3877|       |    /* --------------------------------------------------------------------- */
 3878|       |    /* I/O buffer params                                                     */
 3879|       |    /* --------------------------------------------------------------------- */
 3880|  41.4k|    intra_sampling_ctxt_t *ps_ctxt;
 3881|  41.4k|    UWORD8 *pu1_inp_luma, *pu1_inp_cb, *pu1_inp_cr;
 3882|  41.4k|    UWORD8 *pu1_out_luma, *pu1_out_cb, *pu1_out_cr;
 3883|  41.4k|    WORD32 i4_inp_stride;
 3884|  41.4k|    WORD32 i4_out_stride;
 3885|  41.4k|    WORD32 i4_refarray_stride;
 3886|       |
 3887|       |    /* --------------------------------------------------------------------- */
 3888|       |    /* ref sample array and corresponding parametrs                             */
 3889|       |    /* --------------------------------------------------------------------- */
 3890|  41.4k|    WORD32 i4_chroma_flag, ret;
 3891|       |
 3892|  41.4k|    ps_ctxt = (intra_sampling_ctxt_t *) pv_intra_samp_ctxt;
 3893|       |    /* needs to be populated at proper place */
 3894|  41.4k|    i4_refarray_stride = ps_ctxt->i4_refarray_stride;
 3895|       |
 3896|       |    /* --------------------------------------------------------------------- */
 3897|       |    /* LUMA PROCESSING                                                        */
 3898|       |    /* --------------------------------------------------------------------- */
 3899|  41.4k|    pu1_inp_luma = (UWORD8 *) ps_ref_luma->pv_buffer;
 3900|  41.4k|    pu1_out_luma = (UWORD8 *) ps_curr_luma->pv_buffer;
 3901|  41.4k|    i4_inp_stride = ps_ref_luma->i4_num_element_stride;
 3902|  41.4k|    i4_out_stride = ps_curr_luma->i4_num_element_stride;
 3903|  41.4k|    i4_chroma_flag = 0;
 3904|       |
 3905|       |    /* ------- Constructing refSampleArray ----------------------- */
 3906|  41.4k|    ret = isvcd_reflayer_construction(pv_intra_samp_ctxt, pu1_inp_luma, NULL, i4_inp_stride,
 3907|  41.4k|                                      i4_refarray_stride, ps_ref_mb_mode_map, ps_mb_coord,
 3908|  41.4k|                                      i4_chroma_flag);
 3909|       |
 3910|  41.4k|    if(ret != OK)
  ------------------
  |  |  114|  41.4k|#define OK        0
  ------------------
  |  Branch (3910:8): [True: 0, False: 41.4k]
  ------------------
 3911|      0|    {
 3912|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3913|      0|    }
 3914|       |    /* ---- Interpolation process for Intra_Base prediction     ------ */
 3915|  41.4k|    ps_ctxt->pf_interpolate_intra_base(pv_intra_samp_ctxt, pu1_out_luma, i4_out_stride,
 3916|  41.4k|                                       i4_refarray_stride, ps_mb_coord->u2_mb_x,
 3917|  41.4k|                                       ps_mb_coord->u2_mb_y, i4_chroma_flag, 0);
 3918|       |
 3919|       |    /* --------------------------------------------------------------------- */
 3920|       |    /* CHROMA PROCESSING                                                       */
 3921|       |    /* --------------------------------------------------------------------- */
 3922|       |    /* CB */
 3923|  41.4k|    i4_inp_stride = ps_ref_chroma->i4_num_element_stride;
 3924|  41.4k|    pu1_inp_cb = (UWORD8 *) ps_ref_chroma->pv_buffer;
 3925|  41.4k|    pu1_inp_cr = pu1_inp_cb + 1;
 3926|  41.4k|    i4_chroma_flag = 1;
 3927|       |
 3928|       |    /* ------- Constructing refSampleArray ----------------------- */
 3929|  41.4k|    ret = isvcd_reflayer_construction(pv_intra_samp_ctxt, pu1_inp_cb, pu1_inp_cr, i4_inp_stride,
 3930|  41.4k|                                      i4_refarray_stride, ps_ref_mb_mode_map, ps_mb_coord,
 3931|  41.4k|                                      i4_chroma_flag);
 3932|       |
 3933|  41.4k|    if(ret != OK)
  ------------------
  |  |  114|  41.4k|#define OK        0
  ------------------
  |  Branch (3933:8): [True: 0, False: 41.4k]
  ------------------
 3934|      0|    {
 3935|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3936|      0|    }
 3937|  41.4k|    i4_out_stride = ps_curr_chroma->i4_num_element_stride;
 3938|  41.4k|    pu1_out_cb = (UWORD8 *) ps_curr_chroma->pv_buffer;
 3939|  41.4k|    pu1_out_cr = pu1_out_cb + 1;
 3940|       |
 3941|       |    /* ---- Cb Interpolation process for Intra_Base prediction     ------ */
 3942|  41.4k|    ps_ctxt->pf_interpolate_intra_base(pv_intra_samp_ctxt, pu1_out_cb, i4_out_stride,
 3943|  41.4k|                                       i4_refarray_stride, ps_mb_coord->u2_mb_x,
 3944|  41.4k|                                       ps_mb_coord->u2_mb_y, i4_chroma_flag, 0);
 3945|       |
 3946|       |    /* ---- Cr Interpolation process for Intra_Base prediction     ------ */
 3947|  41.4k|    ps_ctxt->pf_interpolate_intra_base(pv_intra_samp_ctxt, pu1_out_cr, i4_out_stride,
 3948|  41.4k|                                       i4_refarray_stride, ps_mb_coord->u2_mb_x,
 3949|  41.4k|                                       ps_mb_coord->u2_mb_y, i4_chroma_flag, 1);
 3950|  41.4k|    return OK;
  ------------------
  |  |  114|  41.4k|#define OK        0
  ------------------
 3951|  41.4k|}
isvcd_intra_resamp_generate_segment_lookup:
 3981|  66.3k|{
 3982|  66.3k|    WORD32 i4_x;
 3983|  66.3k|    WORD32 i4_position, i4_dist_prev_mb, i4_dist_next_mb;
 3984|  66.3k|    UWORD8 u1_seg_dim;
 3985|  66.3k|    UWORD8 u1_num_sgmts;
 3986|  66.3k|    WORD32 i4_block_size = i4_mb_size >> 1;
 3987|  66.3k|    UWORD8 u1_offset = 0;
 3988|  66.3k|    seg_lookup_desc_t *ps_segments;
 3989|  66.3k|    seg_description_t *ps_seg_desc;
 3990|       |
 3991|  66.3k|    memset(ps_seg_lookup_table, 0, i4_mb_size * sizeof(seg_lookup_desc_t));
 3992|       |
 3993|   862k|    for(i4_x = 0; i4_x < i4_mb_size; i4_x++)
  ------------------
  |  Branch (3993:19): [True: 796k, False: 66.3k]
  ------------------
 3994|   796k|    {
 3995|   796k|        ps_segments = &ps_seg_lookup_table[i4_x];
 3996|   796k|        ps_seg_desc = ps_segments->s_segments;
 3997|   796k|        i4_position = i4_x;
 3998|       |
 3999|   796k|        if(i4_x >= i4_block_size)
  ------------------
  |  Branch (3999:12): [True: 398k, False: 398k]
  ------------------
 4000|   398k|        {
 4001|       |            /* set the fourth bit so that later it can be directly OR ed */
 4002|   398k|            ps_segments->u4_start_pos = 8;
 4003|   398k|        }
 4004|   398k|        else
 4005|   398k|        {
 4006|   398k|            ps_segments->u4_start_pos = 0;
 4007|   398k|        }
 4008|       |
 4009|   796k|        u1_num_sgmts = 0;
 4010|   796k|        u1_offset = 0;
 4011|       |
 4012|  2.98M|        while(i4_position < (i4_x + i4_dimension))
  ------------------
  |  Branch (4012:15): [True: 2.19M, False: 796k]
  ------------------
 4013|  2.19M|        {
 4014|       |            /* check and fill the nearest mb boundry flag */
 4015|  2.19M|            if((i4_position & (i4_mb_size - 1)) < i4_block_size)
  ------------------
  |  Branch (4015:16): [True: 1.09M, False: 1.09M]
  ------------------
 4016|  1.09M|            {
 4017|  1.09M|                ps_seg_desc->i1_nearst_mb_bdry = -1;
 4018|  1.09M|            }
 4019|  1.09M|            else
 4020|  1.09M|            {
 4021|  1.09M|                ps_seg_desc->i1_nearst_mb_bdry = 1;
 4022|  1.09M|            }
 4023|       |
 4024|       |            /* find the distance from the previous MB for start of segment*/
 4025|  2.19M|            i4_dist_prev_mb = (i4_position & (i4_mb_size - 1));
 4026|       |
 4027|  2.19M|            ps_seg_desc->i1_dist_idx =
 4028|  2.19M|                ((i4_dist_prev_mb >= i4_mb_size >> 1) ? (i4_mb_size - i4_dist_prev_mb)
  ------------------
  |  Branch (4028:18): [True: 1.09M, False: 1.09M]
  ------------------
 4029|  2.19M|                                                      : -(i4_dist_prev_mb + 1));
 4030|       |
 4031|       |            /* find the size of the segment */
 4032|  2.19M|            u1_seg_dim = (i4_block_size - (i4_position & (i4_block_size - 1)));
 4033|  2.19M|            i4_position += u1_seg_dim;
 4034|  2.19M|            if(i4_position > (i4_x + i4_dimension))
  ------------------
  |  Branch (4034:16): [True: 663k, False: 1.52M]
  ------------------
 4035|   663k|            {
 4036|   663k|                i4_position = (i4_x + i4_dimension);
 4037|   663k|                u1_seg_dim = (i4_position & (i4_block_size - 1));
 4038|   663k|            }
 4039|       |
 4040|       |            /* find the distance from the next MB for end of segment */
 4041|  2.19M|            i4_dist_next_mb = (i4_position & (i4_mb_size - 1));
 4042|  2.19M|            ps_seg_desc->u1_seg_dim = u1_seg_dim;
 4043|  2.19M|            ps_seg_desc->u1_seg_off = u1_offset;
 4044|       |
 4045|       |            /* check if the segment has a adjoining MB edge */
 4046|  2.19M|            if(i4_dist_prev_mb == 0)
  ------------------
  |  Branch (4046:16): [True: 763k, False: 1.42M]
  ------------------
 4047|   763k|            {
 4048|   763k|                if(0 == u1_num_sgmts)
  ------------------
  |  Branch (4048:20): [True: 66.3k, False: 696k]
  ------------------
 4049|  66.3k|                {
 4050|  66.3k|                    ps_seg_desc->u1_mb_adjoin = 0;
 4051|  66.3k|                }
 4052|   696k|                else
 4053|   696k|                {
 4054|   696k|                    ps_seg_desc->u1_mb_adjoin = 1 << i4_shift_val;
 4055|   696k|                }
 4056|   763k|            }
 4057|  1.42M|            else if(i4_dist_next_mb == 0)
  ------------------
  |  Branch (4057:21): [True: 763k, False: 663k]
  ------------------
 4058|   763k|            {
 4059|   763k|                if(i4_position == (i4_x + i4_dimension))
  ------------------
  |  Branch (4059:20): [True: 66.3k, False: 696k]
  ------------------
 4060|  66.3k|                {
 4061|  66.3k|                    ps_seg_desc->u1_mb_adjoin = 0;
 4062|  66.3k|                }
 4063|   696k|                else
 4064|   696k|                {
 4065|   696k|                    ps_seg_desc->u1_mb_adjoin = 1 << i4_shift_val;
 4066|   696k|                }
 4067|   763k|            }
 4068|   663k|            else
 4069|   663k|            {
 4070|   663k|                ps_seg_desc->u1_mb_adjoin = 0;
 4071|   663k|            }
 4072|       |
 4073|       |            /* Updations */
 4074|  2.19M|            u1_offset += u1_seg_dim;
 4075|  2.19M|            u1_num_sgmts++;
 4076|  2.19M|            ps_seg_desc++;
 4077|  2.19M|        }
 4078|       |
 4079|       |        /* fill the number of segments for this position */
 4080|   796k|        ps_segments->u1_num_segments = u1_num_sgmts;
 4081|   796k|    }
 4082|  66.3k|}
isvcd_intra_resamp_populate_list:
 4109|  69.1k|{
 4110|       |    /* --------------------------------------------------------------------- */
 4111|       |    /* Local variables required for finding the mapping between the layers     */
 4112|       |    /* --------------------------------------------------------------------- */
 4113|  69.1k|    UWORD32 i4_shift_x, i4_shift_y, i4_scale_x, i4_scale_y;
 4114|  69.1k|    WORD32 i4_offset_x, i4_offset_y;
 4115|  69.1k|    WORD32 i4_add_x, i4_add_y, i4_delta_x, i4_delta_y, i4_refphase_x, i4_refphase_y;
 4116|  69.1k|    WORD32 i4_phase_x, i4_phase_y, i4_sub_wd, i4_sub_ht, i4_mb_wd, i4_mb_ht;
 4117|  69.1k|    WORD32 i4_horz_dim, i4_vert_dim, i4_tmp;
 4118|  69.1k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 4119|       |    /* --------------------------------------------------------------------- */
 4120|       |    /* Local Pointer Declaration for arrays in Mapping context                 */
 4121|       |    /* --------------------------------------------------------------------- */
 4122|  69.1k|    ref_mb_map_t *ps_x_off_len, *ps_y_off_len;
 4123|  69.1k|    UWORD32 i4_ref_wd, i4_ref_ht, i4_scaled_wd, i4_scaled_ht, i4_curr_lyr_width, i4_curr_lyr_height;
 4124|       |
 4125|       |    /* --------------------------------------------------------------------- */
 4126|       |    /* Local Flag Declaration                                                 */
 4127|       |    /* --------------------------------------------------------------------- */
 4128|  69.1k|    WORD32 i4_ref_layer_field_pic_flag, i4_field_pic_flag, i4_frame_mbs_only_flag;
 4129|  69.1k|    WORD32 i4_ref_layer_frame_Mbs_only_flag, i4_field_Mb_flag, i4_bot_field_flag;
 4130|       |
 4131|       |    /* --------------------------------------------------------------------- */
 4132|       |    /* Cropping Parameters Declaration                                         */
 4133|       |    /* --------------------------------------------------------------------- */
 4134|  69.1k|    WORD32 i4_scaled_ref_layer_left_offset, i4_scaled_ref_layer_top_offset;
 4135|  69.1k|    WORD32 i4_scaled_ref_layer_right_offset, i4_scaled_ref_layer_bottom_offset;
 4136|  69.1k|    dec_seq_params_t *ps_sps;
 4137|  69.1k|    dec_svc_seq_params_t *ps_subset_sps;
 4138|  69.1k|    ps_sps = ps_dec->ps_cur_sps;
 4139|  69.1k|    ps_subset_sps = ps_svc_lyr_dec->ps_cur_subset_sps;
 4140|       |
 4141|       |    /* --------------------------------------------------------------------- */
 4142|       |    /* Hardcoding flag information    (assuming no field support) */
 4143|       |    /* --------------------------------------------------------------------- */
 4144|  69.1k|    i4_ref_layer_field_pic_flag = SVCD_FALSE;
  ------------------
  |  |   45|  69.1k|#define SVCD_FALSE 0
  ------------------
 4145|  69.1k|    i4_field_pic_flag = SVCD_FALSE;
  ------------------
  |  |   45|  69.1k|#define SVCD_FALSE 0
  ------------------
 4146|  69.1k|    i4_frame_mbs_only_flag = SVCD_TRUE;
  ------------------
  |  |   46|  69.1k|#define SVCD_TRUE 1
  ------------------
 4147|  69.1k|    i4_field_Mb_flag = SVCD_FALSE;
  ------------------
  |  |   45|  69.1k|#define SVCD_FALSE 0
  ------------------
 4148|  69.1k|    i4_bot_field_flag = SVCD_FALSE;
  ------------------
  |  |   45|  69.1k|#define SVCD_FALSE 0
  ------------------
 4149|  69.1k|    i4_ref_layer_frame_Mbs_only_flag = SVCD_TRUE;
  ------------------
  |  |   46|  69.1k|#define SVCD_TRUE 1
  ------------------
 4150|  69.1k|    i4_horz_dim = 0;
 4151|  69.1k|    i4_vert_dim = 0;
 4152|       |
 4153|       |    /* --------------------------------------------------------------------- */
 4154|       |    /* Pointer and Paramater are intialized    - Chroma and Luma */
 4155|       |    /* --------------------------------------------------------------------- */
 4156|  69.1k|    {
 4157|  69.1k|        WORD32 i4_base_width;
 4158|  69.1k|        WORD32 i4_base_height;
 4159|  69.1k|        WORD32 i4_ref_layer_chroma_phase_x_plus1_flag;
 4160|  69.1k|        WORD32 i4_ref_layer_chroma_phase_y_plus1;
 4161|  69.1k|        WORD32 i4_chroma_phase_x_plus1_flag;
 4162|  69.1k|        WORD32 i4_chroma_phase_y_plus1;
 4163|       |
 4164|       |        /* ------------------------------------------------------------- */
 4165|       |        /* HARD CODED FOR 420                                             */
 4166|       |        /* ------------------------------------------------------------- */
 4167|  69.1k|        WORD32 i4_sub_wd_chroma = 2;
 4168|  69.1k|        WORD32 i4_sub_ht_chroma = 2;
 4169|       |
 4170|  69.1k|        i4_base_width = ps_ref_res_prms->i4_res_width;
 4171|  69.1k|        i4_base_height = ps_ref_res_prms->i4_res_height;
 4172|       |
 4173|  69.1k|        i4_ref_layer_chroma_phase_x_plus1_flag =
 4174|  69.1k|            ps_curr_res_prms->i1_ref_lyr_chroma_phase_x_plus1_flag;
 4175|       |
 4176|  69.1k|        i4_ref_layer_chroma_phase_y_plus1 = ps_curr_res_prms->i1_ref_lyr_chroma_phase_y_plus1;
 4177|  69.1k|        i4_chroma_phase_x_plus1_flag = ps_subset_sps->s_sps_svc_ext.u1_chroma_phase_x_plus1_flag;
 4178|  69.1k|        i4_chroma_phase_y_plus1 = ps_subset_sps->s_sps_svc_ext.u1_chroma_phase_y_plus1;
 4179|  69.1k|        i4_scaled_ref_layer_bottom_offset = ps_curr_res_prms->s_ref_lyr_scaled_offset.i2_bot;
 4180|  69.1k|        i4_scaled_ref_layer_left_offset = ps_curr_res_prms->s_ref_lyr_scaled_offset.i2_left;
 4181|  69.1k|        i4_scaled_ref_layer_top_offset = ps_curr_res_prms->s_ref_lyr_scaled_offset.i2_top;
 4182|  69.1k|        i4_scaled_ref_layer_right_offset = ps_curr_res_prms->s_ref_lyr_scaled_offset.i2_rt;
 4183|       |
 4184|       |        /* ----------------------------------------------------------------- */
 4185|       |        /* Computing Effective Frame Dimensions                                 */
 4186|       |        /* ------------------------------------------------------------------*/
 4187|  69.1k|        i4_ref_wd = (i4_base_width >> i4_chroma_flag);
 4188|  69.1k|        i4_ref_ht = (i4_base_height >> i4_chroma_flag) * (1 + i4_ref_layer_field_pic_flag);
 4189|       |
 4190|  69.1k|        i4_scaled_wd = ps_curr_res_prms->u2_scaled_ref_width;
 4191|  69.1k|        i4_scaled_ht = ps_curr_res_prms->u2_scaled_ref_height;
 4192|  69.1k|        i4_scaled_wd = (i4_scaled_wd >> i4_chroma_flag);
 4193|  69.1k|        i4_scaled_ht = (i4_scaled_ht >> i4_chroma_flag) * (1 + i4_field_pic_flag);
 4194|       |
 4195|  69.1k|        if(1 == i4_chroma_flag)
  ------------------
  |  Branch (4195:12): [True: 34.5k, False: 34.5k]
  ------------------
 4196|  34.5k|        {
 4197|  34.5k|            i4_refphase_x = i4_ref_layer_chroma_phase_x_plus1_flag - 1;
 4198|  34.5k|            i4_refphase_y = i4_ref_layer_chroma_phase_y_plus1 - 1;
 4199|  34.5k|            i4_phase_x = i4_chroma_phase_x_plus1_flag - 1;
 4200|  34.5k|            i4_phase_y = i4_chroma_phase_y_plus1 - 1;
 4201|  34.5k|            i4_sub_wd = i4_sub_wd_chroma;
 4202|  34.5k|            i4_sub_ht = i4_sub_ht_chroma;
 4203|  34.5k|            i4_mb_wd = MB_WIDTH >> 1;
  ------------------
  |  |   67|  34.5k|#define MB_WIDTH 16
  ------------------
 4204|  34.5k|            i4_mb_ht = MB_HEIGHT >> 1;
  ------------------
  |  |   68|  34.5k|#define MB_HEIGHT 16
  ------------------
 4205|  34.5k|        }
 4206|  34.5k|        else
 4207|  34.5k|        {
 4208|  34.5k|            i4_refphase_x = 0;
 4209|  34.5k|            i4_refphase_y = 0;
 4210|  34.5k|            i4_phase_x = 0;
 4211|  34.5k|            i4_phase_y = 0;
 4212|  34.5k|            i4_sub_wd = 1;
 4213|  34.5k|            i4_sub_ht = 1;
 4214|  34.5k|            i4_mb_wd = MB_WIDTH;
  ------------------
  |  |   67|  34.5k|#define MB_WIDTH 16
  ------------------
 4215|  34.5k|            i4_mb_ht = MB_HEIGHT;
  ------------------
  |  |   68|  34.5k|#define MB_HEIGHT 16
  ------------------
 4216|  34.5k|        }
 4217|  69.1k|    }
 4218|       |
 4219|       |    /* --------------------------------------------------------------------- */
 4220|       |    /* Derive shift x and y based on level idd                               */
 4221|       |    /* --------------------------------------------------------------------- */
 4222|  69.1k|    if(ps_sps->u1_level_idc <= 30)
  ------------------
  |  Branch (4222:8): [True: 63.9k, False: 5.23k]
  ------------------
 4223|  63.9k|    {
 4224|  63.9k|        i4_shift_x = 16;
 4225|  63.9k|        i4_shift_y = 16;
 4226|  63.9k|    }
 4227|  5.23k|    else
 4228|  5.23k|    {
 4229|  5.23k|        i4_shift_x = 31 - isvcd_get_ceil_log2(i4_ref_wd);
 4230|  5.23k|        i4_shift_y = 31 - isvcd_get_ceil_log2(i4_ref_ht);
 4231|  5.23k|    }
 4232|       |
 4233|       |    /* --------------------------------------------------------------------- */
 4234|       |    /* The following condition is not true in our case for time being         */
 4235|       |    /* --------------------------------------------------------------------- */
 4236|  69.1k|    if((SVCD_FALSE == i4_frame_mbs_only_flag) || (SVCD_FALSE == i4_ref_layer_frame_Mbs_only_flag))
  ------------------
  |  |   45|  69.1k|#define SVCD_FALSE 0
  ------------------
                  if((SVCD_FALSE == i4_frame_mbs_only_flag) || (SVCD_FALSE == i4_ref_layer_frame_Mbs_only_flag))
  ------------------
  |  |   45|  69.1k|#define SVCD_FALSE 0
  ------------------
  |  Branch (4236:8): [True: 0, False: 69.1k]
  |  Branch (4236:50): [True: 0, False: 69.1k]
  ------------------
 4237|      0|    {
 4238|      0|        i4_phase_y = i4_phase_y + 4 * i4_bot_field_flag;
 4239|       |
 4240|      0|        if(1 == i4_ref_layer_frame_Mbs_only_flag)
  ------------------
  |  Branch (4240:12): [True: 0, False: 0]
  ------------------
 4241|      0|            i4_refphase_y = (2 * i4_refphase_y) + 2;
 4242|      0|        else
 4243|      0|            i4_refphase_y = i4_refphase_y + (4 * i4_bot_field_flag);
 4244|      0|    }
 4245|       |
 4246|       |    /* --------------------------------------------------------------------- */
 4247|       |    /* Dx and Dy Computation - Ratio of the base and enhance layer width     */
 4248|       |    /* --------------------------------------------------------------------- */
 4249|  69.1k|    i4_scale_x = ((i4_ref_wd << i4_shift_x) + (i4_scaled_wd >> 1)) / (i4_scaled_wd);
 4250|  69.1k|    i4_scale_y = ((i4_ref_ht << i4_shift_y) + (i4_scaled_ht >> 1)) / (i4_scaled_ht);
 4251|       |
 4252|  69.1k|    i4_offset_x = i4_scaled_ref_layer_left_offset / i4_sub_wd;
 4253|  69.1k|    i4_add_x = (((i4_ref_wd * (2 + i4_phase_x)) << (i4_shift_x - 2)) + (i4_scaled_wd >> 1)) /
 4254|  69.1k|                   i4_scaled_wd +
 4255|  69.1k|               (1 << (i4_shift_x - 5));
 4256|  69.1k|    i4_delta_x = 4 * (2 + i4_refphase_x);
 4257|       |
 4258|  69.1k|    if((SVCD_TRUE == i4_frame_mbs_only_flag) && (SVCD_TRUE == i4_ref_layer_frame_Mbs_only_flag))
  ------------------
  |  |   46|  69.1k|#define SVCD_TRUE 1
  ------------------
                  if((SVCD_TRUE == i4_frame_mbs_only_flag) && (SVCD_TRUE == i4_ref_layer_frame_Mbs_only_flag))
  ------------------
  |  |   46|  69.1k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4258:8): [True: 69.1k, False: 0]
  |  Branch (4258:49): [True: 69.1k, False: 0]
  ------------------
 4259|  69.1k|    {
 4260|  69.1k|        i4_offset_y = i4_scaled_ref_layer_top_offset / i4_sub_ht;
 4261|  69.1k|        i4_add_y = (((i4_ref_ht * (2 + i4_phase_y)) << (i4_shift_y - 2)) + (i4_scaled_ht >> 1)) /
 4262|  69.1k|                       i4_scaled_ht +
 4263|  69.1k|                   (1 << (i4_shift_y - 5));
 4264|  69.1k|        i4_delta_y = 4 * (2 + i4_refphase_y);
 4265|  69.1k|    }
 4266|      0|    else
 4267|      0|    {
 4268|      0|        i4_offset_y = i4_scaled_ref_layer_top_offset / (2 * i4_sub_ht);
 4269|      0|        i4_add_y = (((i4_ref_ht * (2 + i4_phase_y)) << (i4_shift_y - 3)) + (i4_scaled_ht >> 1)) /
 4270|      0|                       i4_scaled_ht +
 4271|      0|                   (1 << (i4_shift_y - 5));
 4272|      0|        i4_delta_y = 2 * (2 + i4_refphase_y);
 4273|      0|    }
 4274|       |
 4275|       |    /* --------------------------------------------------------------------- */
 4276|       |    /* Intializing Local Pointers    - Chroma and Luma                         */
 4277|       |    /* --------------------------------------------------------------------- */
 4278|  69.1k|    ps_x_off_len = ps_map_ctxt->ps_x_offset_length;
 4279|  69.1k|    ps_y_off_len = ps_map_ctxt->ps_y_offset_length;
 4280|  69.1k|    i4_curr_lyr_width = ps_curr_res_prms->i4_res_width >> i4_chroma_flag;
 4281|  69.1k|    i4_curr_lyr_height = ps_curr_res_prms->i4_res_height >> i4_chroma_flag;
 4282|       |
 4283|       |    /* --------------------------------------------------------------------- */
 4284|       |    /* Dyadic Scaling Ratios Handling                                         */
 4285|       |    /* --------------------------------------------------------------------- */
 4286|  69.1k|    if(1 == ps_curr_res_prms->u1_dyadic_flag)
  ------------------
  |  Branch (4286:8): [True: 36.0k, False: 33.1k]
  ------------------
 4287|  36.0k|    {
 4288|  36.0k|        WORD32 i4_refarray_wd, i4_x_offset;
 4289|  36.0k|        WORD32 i4_refarray_ht, i4_y_offset;
 4290|  36.0k|        WORD32 i4_crp_wd_lt, i4_crp_ht_top;
 4291|  36.0k|        WORD32 i4_crp_wd_rt, i4_crp_ht_bot;
 4292|  36.0k|        WORD32 i4_ref_lyr_wd, i4_ref_lyr_ht;
 4293|  36.0k|        WORD32 i4_ref_x, i4_ref_y;
 4294|  36.0k|        WORD32 i4_ofst;
 4295|  36.0k|        WORD32 i4_i, i4_j;
 4296|       |
 4297|       |        /* Hard coded for dyadic case */
 4298|  36.0k|        i4_refarray_wd = 20 >> i4_chroma_flag;
 4299|  36.0k|        i4_ofst = -2 >> i4_chroma_flag;
 4300|  36.0k|        i4_crp_wd_lt = i4_scaled_ref_layer_left_offset >> i4_chroma_flag;
 4301|  36.0k|        i4_crp_wd_rt = i4_scaled_ref_layer_right_offset >> i4_chroma_flag;
 4302|  36.0k|        i4_ref_lyr_wd = (i4_curr_lyr_width >> 1);
 4303|       |
 4304|  36.0k|        i4_ref_x = 0;
 4305|   108k|        for(i4_i = 0; i4_i < (WORD32) i4_curr_lyr_width; i4_i += (i4_mb_wd << 1))
  ------------------
  |  Branch (4305:23): [True: 72.1k, False: 36.0k]
  ------------------
 4306|  72.1k|        {
 4307|  72.1k|            i4_x_offset = MAX(i4_ofst, (i4_ref_x + i4_ofst));
  ------------------
  |  |   60|  72.1k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 72.1k]
  |  |  ------------------
  ------------------
 4308|  72.1k|            i4_x_offset = MIN(i4_x_offset, (i4_ref_lyr_wd - i4_ofst));
  ------------------
  |  |   61|  72.1k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 72.1k, False: 0]
  |  |  ------------------
  ------------------
 4309|  72.1k|            ps_x_off_len->i2_offset = i4_x_offset;
 4310|  72.1k|            ps_x_off_len->i2_length = i4_refarray_wd;
 4311|  72.1k|            ps_x_off_len++;
 4312|  72.1k|            ps_x_off_len->i2_offset = i4_x_offset;
 4313|  72.1k|            ps_x_off_len->i2_length = i4_refarray_wd;
 4314|  72.1k|            ps_x_off_len++;
 4315|  72.1k|            if(i4_i >= i4_crp_wd_lt)
  ------------------
  |  Branch (4315:16): [True: 72.1k, False: 0]
  ------------------
 4316|  72.1k|            {
 4317|  72.1k|                if(i4_i <= (WORD32) (i4_curr_lyr_width - i4_crp_wd_rt))
  ------------------
  |  Branch (4317:20): [True: 72.1k, False: 0]
  ------------------
 4318|  72.1k|                {
 4319|  72.1k|                    i4_ref_x += i4_mb_wd;
 4320|  72.1k|                }
 4321|  72.1k|            }
 4322|  72.1k|        }
 4323|       |
 4324|  36.0k|        i4_refarray_ht = 20 >> i4_chroma_flag;
 4325|  36.0k|        i4_crp_ht_top = i4_scaled_ref_layer_top_offset >> i4_chroma_flag;
 4326|  36.0k|        i4_crp_ht_bot = i4_scaled_ref_layer_bottom_offset >> i4_chroma_flag;
 4327|  36.0k|        i4_ref_lyr_ht = (i4_curr_lyr_height >> 1);
 4328|       |
 4329|  36.0k|        i4_ref_y = 0;
 4330|   206k|        for(i4_j = 0; i4_j < (WORD32) i4_curr_lyr_height; i4_j += (i4_mb_ht << 1))
  ------------------
  |  Branch (4330:23): [True: 170k, False: 36.0k]
  ------------------
 4331|   170k|        {
 4332|   170k|            i4_y_offset = MAX(i4_ofst, (i4_ref_y + i4_ofst));
  ------------------
  |  |   60|   170k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 170k]
  |  |  ------------------
  ------------------
 4333|   170k|            i4_y_offset = MIN(i4_y_offset, (i4_ref_lyr_ht - i4_ofst));
  ------------------
  |  |   61|   170k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 170k, False: 0]
  |  |  ------------------
  ------------------
 4334|   170k|            ps_y_off_len->i2_offset = i4_y_offset;
 4335|   170k|            ps_y_off_len->i2_length = i4_refarray_ht;
 4336|   170k|            ps_y_off_len++;
 4337|   170k|            ps_y_off_len->i2_offset = i4_y_offset;
 4338|   170k|            ps_y_off_len->i2_length = i4_refarray_ht;
 4339|   170k|            ps_y_off_len++;
 4340|   170k|            if(i4_j >= i4_crp_ht_top)
  ------------------
  |  Branch (4340:16): [True: 170k, False: 0]
  ------------------
 4341|   170k|            {
 4342|   170k|                if(i4_j <= (WORD32) (i4_curr_lyr_height - i4_crp_ht_bot))
  ------------------
  |  Branch (4342:20): [True: 170k, False: 684]
  ------------------
 4343|   170k|                {
 4344|   170k|                    i4_ref_y += i4_mb_ht;
 4345|   170k|                }
 4346|   170k|            }
 4347|   170k|        }
 4348|       |        /* No need to process further, return */
 4349|  36.0k|        return;
 4350|  36.0k|    } /* If dyadic path */
 4351|       |
 4352|       |    /* Proposed Algo for Optimization */
 4353|  33.1k|    {
 4354|  33.1k|        WORD32 i4_max, i4_min;
 4355|  33.1k|        ref_min_max_map_t *ps_x_min_max;
 4356|  33.1k|        ref_min_max_map_t *ps_y_min_max;
 4357|  33.1k|        WORD32 i4_i, i4_j;
 4358|       |
 4359|  33.1k|        ps_x_min_max = ps_map_ctxt->ps_x_min_max;
 4360|  33.1k|        ps_y_min_max = ps_map_ctxt->ps_y_min_max;
 4361|       |        /* ----------------------------------------------------------------- */
 4362|       |        /* Computation of offsetX refArrayW Xmin and Xmax Lists                 */
 4363|       |        /* ----------------------------------------------------------------- */
 4364|   132k|        for(i4_i = 0; i4_i < (WORD32) i4_curr_lyr_width; i4_i = i4_i + i4_mb_wd)
  ------------------
  |  Branch (4364:23): [True: 99.5k, False: 33.1k]
  ------------------
 4365|  99.5k|        {
 4366|  99.5k|            WORD32 i4_refarray_wd, i4_xr_index;
 4367|  99.5k|            WORD32 i4_x_refmin16;
 4368|  99.5k|            WORD32 i4_x_refmax16;
 4369|  99.5k|            WORD32 i4_x_offset;
 4370|       |
 4371|  99.5k|            i4_x_refmin16 = (WORD64) (((WORD64) (i4_i - i4_offset_x) * i4_scale_x + i4_add_x) >>
 4372|  99.5k|                                      ((WORD32) (i4_shift_x - 4))) -
 4373|  99.5k|                            i4_delta_x;
 4374|       |
 4375|  99.5k|            i4_x_refmax16 =
 4376|  99.5k|                (WORD64) (((WORD64) (i4_i + i4_mb_wd - 1 - i4_offset_x) * i4_scale_x + i4_add_x) >>
 4377|  99.5k|                          ((WORD32) (i4_shift_x - 4))) -
 4378|  99.5k|                i4_delta_x;
 4379|       |
 4380|       |            /* ------------------------------------------------------------- */
 4381|       |            /* Modified AC205                                                 */
 4382|       |            /* Minimum width required - So adding 2 pixels on each side         */
 4383|       |            /* ------------------------------------------------------------- */
 4384|  99.5k|            i4_refarray_wd = ((i4_x_refmax16 + 15) >> 4) - (i4_x_refmin16 >> 4) + 1 + 4;
 4385|       |
 4386|       |            /* ------------------------------------------------------------- */
 4387|       |            /* Setting the offset 2 pixels before                             */
 4388|       |            /* ------------------------------------------------------------- */
 4389|  99.5k|            i4_x_offset = (i4_x_refmin16 >> 4) - 2;
 4390|       |
 4391|       |            /* ------------------------------------------------------------- */
 4392|       |            /* Modifying the values based on the location                     */
 4393|       |            /* ------------------------------------------------------------- */
 4394|  99.5k|            i4_min = i4_x_offset;
 4395|  99.5k|            i4_xr_index = i4_min - ((i4_min / i4_mb_wd) * i4_mb_wd);
 4396|       |
 4397|  99.5k|            if(i4_xr_index < (i4_mb_wd >> 1))
  ------------------
  |  Branch (4397:16): [True: 82.9k, False: 16.5k]
  ------------------
 4398|  82.9k|            {
 4399|  82.9k|                i4_refarray_wd = i4_refarray_wd + (i4_mb_wd >> 1);
 4400|  82.9k|                i4_x_offset = i4_x_offset - (i4_mb_wd >> 1);
 4401|  82.9k|            }
 4402|       |
 4403|  99.5k|            i4_max = ((i4_x_refmax16 + 15) >> 4) + 2;
 4404|  99.5k|            i4_xr_index = i4_max - ((i4_max / i4_mb_wd) * i4_mb_wd);
 4405|       |
 4406|  99.5k|            if(i4_xr_index >= (i4_mb_wd >> 1)) i4_refarray_wd = i4_refarray_wd + (i4_mb_wd >> 1);
  ------------------
  |  Branch (4406:16): [True: 49.7k, False: 49.7k]
  ------------------
 4407|       |
 4408|       |            /* ------------------------------------------------------------- */
 4409|       |            /* Filling the arrays with offset, min, max and refArray dim     */
 4410|       |            /* ------------------------------------------------------------- */
 4411|  99.5k|            ps_x_off_len->i2_offset = i4_x_offset;
 4412|  99.5k|            ps_x_off_len->i2_length = i4_refarray_wd;
 4413|       |
 4414|  99.5k|            ps_x_min_max->i2_min_pos = (i4_x_refmin16 >> 4) - i4_x_offset;
 4415|  99.5k|            ps_x_min_max->i2_max_pos = ((i4_x_refmax16 + 15) >> 4) - i4_x_offset;
 4416|       |
 4417|  99.5k|            i4_tmp = (WORD32) (ps_x_min_max->i2_max_pos - ps_x_min_max->i2_min_pos) +
 4418|  99.5k|                     (4 >> i4_chroma_flag);
 4419|  99.5k|            if(i4_tmp > i4_horz_dim)
  ------------------
  |  Branch (4419:16): [True: 33.5k, False: 66.0k]
  ------------------
 4420|  33.5k|            {
 4421|  33.5k|                i4_horz_dim = i4_tmp;
 4422|  33.5k|            }
 4423|       |
 4424|       |            /* increment the pointer */
 4425|  99.5k|            ps_x_off_len++;
 4426|  99.5k|            ps_x_min_max++;
 4427|  99.5k|        } /* end of loop over scaled width */
 4428|       |
 4429|       |        /* ----------------------------------------------------------------- */
 4430|       |        /* Computation of offsetY refArrayH Ymin and Ymax Lists                 */
 4431|       |        /* ----------------------------------------------------------------- */
 4432|   331k|        for(i4_j = 0; i4_j < (WORD32) i4_curr_lyr_height; i4_j = i4_j + i4_mb_ht)
  ------------------
  |  Branch (4432:23): [True: 298k, False: 33.1k]
  ------------------
 4433|   298k|        {
 4434|   298k|            WORD32 i4_refarray_ht, i4_yr_index;
 4435|   298k|            WORD32 i4_y_refmin16;
 4436|   298k|            WORD32 i4_y_refmax16;
 4437|   298k|            WORD32 i4_y_offset;
 4438|       |
 4439|   298k|            i4_y_refmin16 = (WORD64) (((WORD64) (i4_j - i4_offset_y) * i4_scale_y + i4_add_y) >>
 4440|   298k|                                      ((WORD32) (i4_shift_y - 4))) -
 4441|   298k|                            i4_delta_y;
 4442|       |
 4443|   298k|            i4_y_refmax16 =
 4444|   298k|                (WORD64) (((WORD64) (i4_j + i4_mb_ht - 1 - i4_offset_y) * i4_scale_y + i4_add_y) >>
 4445|   298k|                          ((WORD32) (i4_shift_y - 4))) -
 4446|   298k|                i4_delta_y;
 4447|       |
 4448|       |            /* ------------------------------------------------------------- */
 4449|       |            /* Modified AC205                                                 */
 4450|       |            /* Minimum width required - So adding 2 pixels on each side            */
 4451|       |            /* ------------------------------------------------------------- */
 4452|   298k|            i4_refarray_ht = ((i4_y_refmax16 + 15) >> 4) - (i4_y_refmin16 >> 4) + 1 + 4;
 4453|       |
 4454|       |            /* ------------------------------------------------------------- */
 4455|       |            /* Setting the offset 2 pixels before                             */
 4456|       |            /* ------------------------------------------------------------- */
 4457|   298k|            i4_y_offset = (i4_y_refmin16 >> 4) - 2;
 4458|       |
 4459|       |            /* ------------------------------------------------------------- */
 4460|       |            /* Modifying the values based on the location                     */
 4461|       |            /* ------------------------------------------------------------- */
 4462|   298k|            i4_min = i4_y_offset;
 4463|   298k|            i4_yr_index = i4_min - ((i4_min / i4_mb_ht) * i4_mb_ht);
 4464|   298k|            if(i4_yr_index < (i4_mb_ht >> 1))
  ------------------
  |  Branch (4464:16): [True: 182k, False: 116k]
  ------------------
 4465|   182k|            {
 4466|   182k|                i4_refarray_ht = i4_refarray_ht + (i4_mb_ht >> 1);
 4467|   182k|                i4_y_offset = i4_y_offset - (i4_mb_ht >> 1);
 4468|   182k|            }
 4469|       |
 4470|   298k|            i4_max = ((i4_y_refmax16 + 15) >> 4) + 2;
 4471|   298k|            i4_yr_index = i4_max - ((i4_max / i4_mb_ht) * i4_mb_ht);
 4472|   298k|            if(i4_yr_index >= (i4_mb_ht >> 1)) i4_refarray_ht = i4_refarray_ht + (i4_mb_ht >> 1);
  ------------------
  |  Branch (4472:16): [True: 149k, False: 149k]
  ------------------
 4473|       |
 4474|       |            /* ------------------------------------------------------------- */
 4475|       |            /* Filling the arrays with offset, min, max and refArray dim     */
 4476|       |            /* ------------------------------------------------------------- */
 4477|   298k|            ps_y_off_len->i2_offset = i4_y_offset;
 4478|   298k|            ps_y_off_len->i2_length = i4_refarray_ht;
 4479|   298k|            ps_y_min_max->i2_min_pos = (i4_y_refmin16 >> 4) - i4_y_offset;
 4480|   298k|            ps_y_min_max->i2_max_pos = ((i4_y_refmax16 + 15) >> 4) - i4_y_offset;
 4481|       |
 4482|   298k|            i4_tmp = (WORD32) (ps_y_min_max->i2_max_pos - ps_y_min_max->i2_min_pos) +
 4483|   298k|                     (4 >> i4_chroma_flag);
 4484|   298k|            if(i4_tmp > i4_vert_dim)
  ------------------
  |  Branch (4484:16): [True: 33.5k, False: 264k]
  ------------------
 4485|  33.5k|            {
 4486|  33.5k|                i4_vert_dim = i4_tmp;
 4487|  33.5k|            }
 4488|       |
 4489|       |            /* increment the pointer */
 4490|   298k|            ps_y_off_len++;
 4491|   298k|            ps_y_min_max++;
 4492|   298k|        } /* end of loop over scaled height */
 4493|  33.1k|    }
 4494|       |
 4495|       |    /* --------------------------------------------------------------------- */
 4496|       |    /* Computation of Xref and Xphase List as per standard                     */
 4497|       |    /* --------------------------------------------------------------------- */
 4498|  33.1k|    ps_x_off_len = ps_map_ctxt->ps_x_offset_length;
 4499|  33.1k|    ps_y_off_len = ps_map_ctxt->ps_y_offset_length;
 4500|       |
 4501|  33.1k|    {
 4502|  33.1k|        ref_pixel_map_t *ps_x_pos_phase;
 4503|  33.1k|        WORD32 i4_xc;
 4504|  33.1k|        WORD32 i4_offset_x_index;
 4505|       |
 4506|  33.1k|        ps_x_pos_phase = ps_map_ctxt->ps_x_pos_phase;
 4507|       |
 4508|  1.22M|        for(i4_xc = 0; i4_xc < (WORD32) i4_curr_lyr_width; i4_xc++)
  ------------------
  |  Branch (4508:24): [True: 1.19M, False: 33.1k]
  ------------------
 4509|  1.19M|        {
 4510|  1.19M|            WORD32 i4_x_offset;
 4511|  1.19M|            WORD32 i4_x_ref16;
 4512|       |
 4513|  1.19M|            i4_offset_x_index = i4_xc / i4_mb_wd;
 4514|       |
 4515|  1.19M|            i4_x_offset = ps_x_off_len[i4_offset_x_index].i2_offset;
 4516|       |
 4517|  1.19M|            i4_x_ref16 = (WORD64) (((WORD64) (i4_xc - i4_offset_x) * i4_scale_x + i4_add_x) >>
 4518|  1.19M|                                   ((WORD32) (i4_shift_x - 4))) -
 4519|  1.19M|                         i4_delta_x;
 4520|       |
 4521|       |            /* store the values */
 4522|  1.19M|            ps_x_pos_phase->i2_ref_pos = (i4_x_ref16 >> 4) - i4_x_offset;
 4523|  1.19M|            ps_x_pos_phase->i2_phase = i4_x_ref16 & 15;
 4524|       |
 4525|       |            /* increment the pointer */
 4526|  1.19M|            ps_x_pos_phase++;
 4527|       |
 4528|  1.19M|        } /* end of loop over scaled width */
 4529|  33.1k|    }
 4530|       |
 4531|       |    /* --------------------------------------------------------------------- */
 4532|       |    /* Computation of Yref and Yphase List as per standard                     */
 4533|       |    /* --------------------------------------------------------------------- */
 4534|  33.1k|    {
 4535|  33.1k|        WORD32 i4_yc;
 4536|  33.1k|        ref_pixel_map_t *ps_y_pos_phase;
 4537|       |
 4538|  33.1k|        ps_y_pos_phase = ps_map_ctxt->ps_y_pos_phase;
 4539|       |
 4540|  3.61M|        for(i4_yc = 0; i4_yc < (WORD32) i4_curr_lyr_height; i4_yc++)
  ------------------
  |  Branch (4540:24): [True: 3.58M, False: 33.1k]
  ------------------
 4541|  3.58M|        {
 4542|  3.58M|            WORD32 i4_y_offset;
 4543|  3.58M|            WORD32 i4_y_ref16;
 4544|  3.58M|            WORD32 i4_offset_y_index;
 4545|       |
 4546|  3.58M|            i4_offset_y_index = i4_yc / i4_mb_ht;
 4547|       |
 4548|  3.58M|            i4_y_offset = ps_y_off_len[i4_offset_y_index].i2_offset;
 4549|       |
 4550|  3.58M|            if((SVCD_FALSE == i4_frame_mbs_only_flag) ||
  ------------------
  |  |   45|  3.58M|#define SVCD_FALSE 0
  ------------------
  |  Branch (4550:16): [True: 0, False: 3.58M]
  ------------------
 4551|  3.58M|               (SVCD_FALSE == i4_ref_layer_frame_Mbs_only_flag))
  ------------------
  |  |   45|  3.58M|#define SVCD_FALSE 0
  ------------------
  |  Branch (4551:16): [True: 0, False: 3.58M]
  ------------------
 4552|      0|            {
 4553|      0|                i4_yc = i4_yc >> (1 - i4_field_Mb_flag);
 4554|      0|            }
 4555|       |
 4556|  3.58M|            i4_y_ref16 = (WORD64) (((WORD64) (i4_yc - i4_offset_y) * i4_scale_y + i4_add_y) >>
 4557|  3.58M|                                   ((WORD32) (i4_shift_y - 4))) -
 4558|  3.58M|                         i4_delta_y;
 4559|  3.58M|            ps_y_pos_phase->i2_ref_pos = (i4_y_ref16 >> 4) - i4_y_offset;
 4560|  3.58M|            ps_y_pos_phase->i2_phase = i4_y_ref16 & 15;
 4561|       |
 4562|       |            /* increment the pointer */
 4563|  3.58M|            ps_y_pos_phase++;
 4564|       |
 4565|  3.58M|        } /* end of loop over scaled height */
 4566|  33.1k|    }
 4567|       |
 4568|       |    /* --------------------------------------------------------------------- */
 4569|       |    /* Computation of Corresponding Diagonal Location                         */
 4570|       |    /* --------------------------------------------------------------------- */
 4571|  33.1k|    {
 4572|  33.1k|        WORD16 *pi2_xd_index;
 4573|  33.1k|        WORD16 *pi2_yd_index;
 4574|  33.1k|        WORD16 *pi2_ya_index;
 4575|  33.1k|        WORD32 i4_i, i4_j;
 4576|       |
 4577|  33.1k|        pi2_xd_index = ps_map_ctxt->pi2_xd_index;
 4578|  33.1k|        pi2_yd_index = ps_map_ctxt->pi2_yd_index;
 4579|  33.1k|        pi2_ya_index = ps_map_ctxt->pi2_ya_index;
 4580|       |
 4581|   431k|        for(i4_i = 0; i4_i < i4_mb_wd; i4_i++)
  ------------------
  |  Branch (4581:23): [True: 398k, False: 33.1k]
  ------------------
 4582|   398k|        {
 4583|   398k|            *(pi2_xd_index + i4_i) = ((i4_i >= i4_mb_wd >> 1) ? (i4_i - i4_mb_wd) : (i4_i + 1));
  ------------------
  |  Branch (4583:39): [True: 199k, False: 199k]
  ------------------
 4584|       |
 4585|   398k|        } /* end of loop over MB width */
 4586|       |
 4587|   431k|        for(i4_j = 0; i4_j < i4_mb_ht; i4_j++)
  ------------------
  |  Branch (4587:23): [True: 398k, False: 33.1k]
  ------------------
 4588|   398k|        {
 4589|   398k|            *(pi2_yd_index + i4_j) = ((i4_j >= i4_mb_ht >> 1) ? (i4_j - i4_mb_ht) : (i4_j + 1));
  ------------------
  |  Branch (4589:39): [True: 199k, False: 199k]
  ------------------
 4590|       |
 4591|   398k|            *(pi2_ya_index + i4_j) =
 4592|   398k|                *(pi2_yd_index + i4_j) - (((i4_mb_ht >> 1) + 1) * (SIGN(*(pi2_yd_index + i4_j))));
  ------------------
  |  |  103|   398k|#define SIGN(x)     (((x) >= 0) ? (((x) > 0) ? 1 : 0) : -1)
  |  |  ------------------
  |  |  |  Branch (103:22): [True: 199k, False: 199k]
  |  |  |  Branch (103:36): [True: 199k, False: 0]
  |  |  ------------------
  ------------------
 4593|       |
 4594|   398k|        } /* end of loop over MB height */
 4595|  33.1k|    }
 4596|       |
 4597|       |    /* generate the lookup to generate horizontal segments */
 4598|  33.1k|    isvcd_intra_resamp_generate_segment_lookup(ps_map_ctxt->ps_seg_lookup_horz, i4_horz_dim,
 4599|  33.1k|                                               i4_mb_wd, 3);
 4600|       |
 4601|       |    /* generate the lookup to generate vertical segments */
 4602|  33.1k|    isvcd_intra_resamp_generate_segment_lookup(ps_map_ctxt->ps_seg_lookup_vert, i4_vert_dim,
 4603|  33.1k|                                               i4_mb_ht, 4);
 4604|       |
 4605|  33.1k|    return;
 4606|  69.1k|} /* end of function "isvcd_intra_resamp_populate_list"*/
isvcd_populate_res_prms:
 4631|   137k|{
 4632|   137k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) pv_svc_dec;
 4633|   137k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 4634|   137k|    res_prms_t *ps_curr_lyr_res_prms;
 4635|   137k|    svc_dec_lyr_struct_t *ps_svc_ref_lyr_dec;
 4636|   137k|    ps_svc_ref_lyr_dec = ps_svc_lyr_dec->ps_dec_svc_ref_layer;
 4637|   137k|    ps_curr_lyr_res_prms = &ps_svc_lyr_dec->s_res_prms;
 4638|       |
 4639|   137k|    ps_curr_lyr_res_prms->i4_res_width = ps_dec->u2_pic_wd;
 4640|   137k|    ps_curr_lyr_res_prms->i4_res_height = ps_dec->u2_pic_ht;
 4641|   137k|    ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_left =
 4642|   137k|        ps_svc_lyr_dec->ps_cur_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_left_offset << 1;
 4643|   137k|    ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_top =
 4644|   137k|        ps_svc_lyr_dec->ps_cur_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_top_offset << 1;
 4645|   137k|    ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_rt =
 4646|   137k|        ps_svc_lyr_dec->ps_cur_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_right_offset << 1;
 4647|   137k|    ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_bot =
 4648|   137k|        ps_svc_lyr_dec->ps_cur_subset_sps->s_sps_svc_ext.i4_seq_scaled_ref_layer_bottom_offset << 1;
 4649|   137k|    ps_curr_lyr_res_prms->u2_scaled_ref_width =
 4650|   137k|        (ps_dec->u2_frm_wd_in_mbs << 4) - (ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_left +
 4651|   137k|                                           ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_rt);
 4652|       |
 4653|   137k|    ps_curr_lyr_res_prms->u2_scaled_ref_height =
 4654|   137k|        (ps_dec->u2_frm_ht_in_mbs << 4) - (ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_top +
 4655|   137k|                                           ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_bot);
 4656|       |
 4657|   137k|    ps_curr_lyr_res_prms->u1_cropping_change_flag = 0;
 4658|   137k|    if(2 == ps_svc_lyr_dec->ps_cur_subset_sps->s_sps_svc_ext.u1_extended_spatial_scalability_idc)
  ------------------
  |  Branch (4658:8): [True: 79, False: 137k]
  ------------------
 4659|     79|    {
 4660|     79|        ps_curr_lyr_res_prms->u1_cropping_change_flag = 1;
 4661|       |
 4662|     79|        ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_left =
 4663|     79|            ps_svc_lyr_dec->s_svc_slice_params.i4_scaled_ref_layer_left_offset << 1;
 4664|       |
 4665|     79|        ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_top =
 4666|     79|            ps_svc_lyr_dec->s_svc_slice_params.i4_scaled_ref_layer_top_offset << 1;
 4667|     79|        ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_rt =
 4668|     79|            ps_svc_lyr_dec->s_svc_slice_params.i4_scaled_ref_layer_right_offset << 1;
 4669|     79|        ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_bot =
 4670|     79|            ps_svc_lyr_dec->s_svc_slice_params.i4_scaled_ref_layer_bottom_offset << 1;
 4671|     79|        ps_curr_lyr_res_prms->u2_scaled_ref_width =
 4672|     79|            (ps_dec->u2_frm_wd_in_mbs << 4) -
 4673|     79|            (ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_left +
 4674|     79|             ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_rt);
 4675|       |
 4676|     79|        ps_curr_lyr_res_prms->u2_scaled_ref_height =
 4677|     79|            (ps_dec->u2_frm_ht_in_mbs << 4) -
 4678|     79|            (ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_top +
 4679|     79|             ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_bot);
 4680|       |
 4681|     79|        return NOT_OK;
  ------------------
  |  |  116|     79|#define NOT_OK    -1
  ------------------
 4682|     79|    }
 4683|       |
 4684|   137k|    ps_curr_lyr_res_prms->u1_rstrct_res_change_flag = SVCD_TRUE;
  ------------------
  |  |   46|   137k|#define SVCD_TRUE 1
  ------------------
 4685|       |
 4686|   137k|    ps_curr_lyr_res_prms->u1_disable_inter_lyr_dblk_filter_idc =
 4687|   137k|        ps_svc_lyr_dec->s_svc_slice_params.u4_disable_inter_layer_deblk_filter_idc;
 4688|   137k|    ps_curr_lyr_res_prms->i1_inter_lyr_alpha_c0_offset =
 4689|   137k|        ps_svc_lyr_dec->s_svc_slice_params.i4_inter_layer_slice_alpha_c0_offset_div2;
 4690|   137k|    ps_curr_lyr_res_prms->i1_inter_lyr_beta_offset =
 4691|   137k|        ps_svc_lyr_dec->s_svc_slice_params.i4_inter_layer_slice_beta_offset_div2;
 4692|   137k|    ps_curr_lyr_res_prms->i1_constrained_intra_rsmpl_flag =
 4693|   137k|        ps_svc_lyr_dec->s_svc_slice_params.u1_constrained_intra_resampling_flag;
 4694|   137k|    ps_curr_lyr_res_prms->i1_ref_lyr_chroma_phase_x_plus1_flag =
 4695|   137k|        ps_svc_lyr_dec->ps_cur_subset_sps->s_sps_svc_ext.u1_seq_ref_layer_chroma_phase_x_plus1_flag;
 4696|   137k|    ps_curr_lyr_res_prms->i1_ref_lyr_chroma_phase_y_plus1 =
 4697|   137k|        ps_svc_lyr_dec->ps_cur_subset_sps->s_sps_svc_ext.u1_seq_ref_layer_chroma_phase_y_plus1;
 4698|   137k|    ps_curr_lyr_res_prms->u1_direct_8x8_inference_flag =
 4699|   137k|        ps_dec->ps_cur_sps->u1_direct_8x8_inference_flag;
 4700|       |
 4701|   137k|    ps_curr_lyr_res_prms->u1_remap_req_flag = 1;
 4702|   137k|    ps_curr_lyr_res_prms->u1_dyadic_flag = ps_svc_lyr_dec->u1_dyadic_flag;
 4703|       |
 4704|       |    /* Derive the reference layer width and height */
 4705|       |
 4706|   137k|    if(SVCD_TRUE != ps_svc_lyr_dec->u1_base_res_flag)
  ------------------
  |  |   46|   137k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4706:8): [True: 34.9k, False: 102k]
  ------------------
 4707|  34.9k|    {
 4708|  34.9k|        WORD32 i4_ref_lyr_width;
 4709|  34.9k|        WORD32 i4_ref_lyr_ht;
 4710|  34.9k|        WORD32 i4_dyadic_flag = SVCD_FALSE;
  ------------------
  |  |   45|  34.9k|#define SVCD_FALSE 0
  ------------------
 4711|  34.9k|        i4_ref_lyr_width = ps_svc_ref_lyr_dec->s_res_prms.i4_res_width;
 4712|  34.9k|        i4_ref_lyr_ht = ps_svc_ref_lyr_dec->s_res_prms.i4_res_height;
 4713|       |
 4714|       |        /* set the Restricted Spatial Resolution change flag */
 4715|  34.9k|        ps_curr_lyr_res_prms->u1_rstrct_res_change_flag = SVCD_TRUE;
  ------------------
  |  |   46|  34.9k|#define SVCD_TRUE 1
  ------------------
 4716|       |
 4717|  34.9k|        if(0 == ((ps_curr_lyr_res_prms->u2_scaled_ref_width == i4_ref_lyr_width) ||
  ------------------
  |  Branch (4717:12): [True: 16.7k, False: 18.1k]
  |  Branch (4717:18): [True: 86, False: 34.8k]
  ------------------
 4718|  34.8k|                 (ps_curr_lyr_res_prms->u2_scaled_ref_width == (i4_ref_lyr_width << 1))))
  ------------------
  |  Branch (4718:18): [True: 18.0k, False: 16.7k]
  ------------------
 4719|  16.7k|        {
 4720|  16.7k|            ps_curr_lyr_res_prms->u1_rstrct_res_change_flag = SVCD_FALSE;
  ------------------
  |  |   45|  16.7k|#define SVCD_FALSE 0
  ------------------
 4721|  16.7k|        }
 4722|       |
 4723|  34.9k|        if(0 == ((ps_curr_lyr_res_prms->u2_scaled_ref_height == i4_ref_lyr_ht) ||
  ------------------
  |  Branch (4723:12): [True: 16.8k, False: 18.1k]
  |  Branch (4723:18): [True: 144, False: 34.8k]
  ------------------
 4724|  34.8k|                 (ps_curr_lyr_res_prms->u2_scaled_ref_height == (i4_ref_lyr_ht << 1))))
  ------------------
  |  Branch (4724:18): [True: 18.0k, False: 16.8k]
  ------------------
 4725|  16.8k|        {
 4726|  16.8k|            ps_curr_lyr_res_prms->u1_rstrct_res_change_flag = SVCD_FALSE;
  ------------------
  |  |   45|  16.8k|#define SVCD_FALSE 0
  ------------------
 4727|  16.8k|        }
 4728|       |
 4729|  34.9k|        if(0 != (ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_left & 15))
  ------------------
  |  Branch (4729:12): [True: 0, False: 34.9k]
  ------------------
 4730|      0|        {
 4731|      0|            ps_curr_lyr_res_prms->u1_rstrct_res_change_flag = SVCD_FALSE;
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
 4732|      0|        }
 4733|       |
 4734|  34.9k|        if(0 != (ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_top & 15))
  ------------------
  |  Branch (4734:12): [True: 0, False: 34.9k]
  ------------------
 4735|      0|        {
 4736|      0|            ps_curr_lyr_res_prms->u1_rstrct_res_change_flag = SVCD_FALSE;
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
 4737|      0|        }
 4738|       |
 4739|       |        /* populate the dyadic status */
 4740|       |
 4741|  34.9k|        if((ps_curr_lyr_res_prms->u2_scaled_ref_width == (i4_ref_lyr_width << 1)) &&
  ------------------
  |  Branch (4741:12): [True: 18.0k, False: 16.8k]
  ------------------
 4742|  18.0k|           (ps_curr_lyr_res_prms->u2_scaled_ref_height == (i4_ref_lyr_ht << 1)))
  ------------------
  |  Branch (4742:12): [True: 18.0k, False: 78]
  ------------------
 4743|  18.0k|        {
 4744|  18.0k|            i4_dyadic_flag = SVCD_TRUE;
  ------------------
  |  |   46|  18.0k|#define SVCD_TRUE 1
  ------------------
 4745|  18.0k|        }
 4746|  16.9k|        else if((ps_curr_lyr_res_prms->u2_scaled_ref_width != ((i4_ref_lyr_width * 3) >> 1)) ||
  ------------------
  |  Branch (4746:17): [True: 180, False: 16.7k]
  ------------------
 4747|  16.7k|                (ps_curr_lyr_res_prms->u2_scaled_ref_height != ((i4_ref_lyr_ht * 3) >> 1)))
  ------------------
  |  Branch (4747:17): [True: 183, False: 16.5k]
  ------------------
 4748|    363|        {
 4749|    363|            ps_curr_lyr_res_prms->u1_dyadic_flag = i4_dyadic_flag;
 4750|    363|            ps_svc_lyr_dec->u1_dyadic_flag = ps_curr_lyr_res_prms->u1_dyadic_flag;
 4751|    363|            return NOT_OK;
  ------------------
  |  |  116|    363|#define NOT_OK    -1
  ------------------
 4752|    363|        }
 4753|       |
 4754|       |        /* check if cropping is MB aligned */
 4755|  34.5k|        if(SVCD_TRUE == i4_dyadic_flag)
  ------------------
  |  |   46|  34.5k|#define SVCD_TRUE 1
  ------------------
  |  Branch (4755:12): [True: 18.0k, False: 16.5k]
  ------------------
 4756|  18.0k|        {
 4757|  18.0k|            if((0 != (ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_left & 15)) ||
  ------------------
  |  Branch (4757:16): [True: 0, False: 18.0k]
  ------------------
 4758|  18.0k|               (0 != (ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_top & 15)))
  ------------------
  |  Branch (4758:16): [True: 0, False: 18.0k]
  ------------------
 4759|      0|            {
 4760|      0|                i4_dyadic_flag = SVCD_FALSE;
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
 4761|      0|            }
 4762|  18.0k|        }
 4763|       |
 4764|  34.5k|        ps_curr_lyr_res_prms->u1_dyadic_flag = i4_dyadic_flag;
 4765|  34.5k|        ps_svc_lyr_dec->u1_dyadic_flag = ps_curr_lyr_res_prms->u1_dyadic_flag;
 4766|  34.5k|    }
 4767|       |
 4768|   137k|    {
 4769|   137k|        inter_lyr_mb_prms_t *ps_tmp_prms, *ps_tmp_prms_2;
 4770|   137k|        inter_lyr_mb_prms_t *ps_ref_mb_prms;
 4771|   137k|        WORD32 i4_stride;
 4772|   137k|        WORD32 i4_ht_in_mbs, i4_wd_in_mbs;
 4773|   137k|        WORD32 i4_i;
 4774|       |
 4775|       |        /* Derive the reference mb mode map */
 4776|       |
 4777|   137k|        ps_ref_mb_prms = ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start;
 4778|   137k|        i4_stride = ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride;
 4779|       |
 4780|   137k|        i4_ht_in_mbs = ps_dec->u2_frm_ht_in_mbs;
 4781|   137k|        i4_wd_in_mbs = ps_dec->u2_frm_wd_in_mbs;
 4782|       |
 4783|       |        /* Set the first border row to 0xFF */
 4784|   137k|        ps_tmp_prms = (ps_ref_mb_prms - 1 - i4_stride);
 4785|       |
 4786|   137k|        memset(ps_svc_lyr_dec->ps_inter_lyr_mb_prms_base, -1,
 4787|   137k|               ps_svc_lyr_dec->u4_inter_lyr_mb_prms_size);
 4788|   137k|        memset(ps_svc_lyr_dec->pu1_svc_base_mode_flag, 0,
 4789|   137k|               ps_svc_lyr_dec->i4_frm_svc_base_mode_cabac_size);
 4790|       |
 4791|  1.18M|        for(i4_i = 0; i4_i < (i4_wd_in_mbs + 2); i4_i++)
  ------------------
  |  Branch (4791:23): [True: 1.04M, False: 137k]
  ------------------
 4792|  1.04M|        {
 4793|  1.04M|            ps_tmp_prms->i1_mb_mode = (WORD8) 0xFF;
 4794|  1.04M|            ps_tmp_prms += 1;
 4795|  1.04M|        }
 4796|       |
 4797|       |        /* Set the left and right border pixels of each row to 0 */
 4798|   137k|        ps_tmp_prms = ps_ref_mb_prms - 1;
 4799|       |
 4800|  2.55M|        for(i4_i = 0; i4_i < i4_ht_in_mbs; i4_i++)
  ------------------
  |  Branch (4800:23): [True: 2.42M, False: 137k]
  ------------------
 4801|  2.42M|        {
 4802|  2.42M|            ps_tmp_prms->i1_mb_mode = (WORD8) 0xFF;
 4803|  2.42M|            ps_tmp_prms_2 = ps_tmp_prms + (i4_wd_in_mbs + 1);
 4804|  2.42M|            ps_tmp_prms_2->i1_mb_mode = (WORD8) 0xFF;
 4805|  2.42M|            ps_tmp_prms += i4_stride;
 4806|  2.42M|        }
 4807|       |
 4808|       |        /* Set the last border row to 0xFF */
 4809|  1.18M|        for(i4_i = 0; i4_i < (i4_wd_in_mbs + 2); i4_i++)
  ------------------
  |  Branch (4809:23): [True: 1.04M, False: 137k]
  ------------------
 4810|  1.04M|        {
 4811|  1.04M|            ps_tmp_prms->i1_mb_mode = (WORD8) 0xFF;
 4812|  1.04M|            ps_tmp_prms += 1;
 4813|  1.04M|        }
 4814|   137k|    }
 4815|       |
 4816|       |    /* reset residual luma, chroma buffer*/
 4817|   137k|    memset(ps_svc_lyr_dec->pi2_il_residual_resample_luma_base, 0,
 4818|   137k|           ps_svc_lyr_dec->u4_residual_resample_luma_size);
 4819|   137k|    memset(ps_svc_lyr_dec->pi2_il_residual_resample_chroma_base, 0,
 4820|   137k|           ps_svc_lyr_dec->u4_residual_resample_chroma_size);
 4821|       |
 4822|   137k|    return OK;
  ------------------
  |  |  114|   137k|#define OK        0
  ------------------
 4823|   137k|}
isvcd_crop_wnd_flag_res_int:
 4850|   137k|{
 4851|   137k|    UWORD8 *pu1_crop_wnd_flag;
 4852|   137k|    WORD32 i4_num_mbs;
 4853|   137k|    WORD32 i4_crop_mbs_x;
 4854|   137k|    WORD32 i4_crop_mbs_y;
 4855|   137k|    WORD32 i4_cnt;
 4856|   137k|    WORD32 i4_left_offset, i4_rt_offset;
 4857|   137k|    WORD32 i4_top_offset, i4_bot_offset;
 4858|   137k|    WORD32 i4_frm_wd_in_mbs;
 4859|   137k|    WORD32 i4_frm_ht_in_mbs;
 4860|   137k|    dec_struct_t *ps_dec;
 4861|   137k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
 4862|   137k|    res_prms_t *ps_res_prms;
 4863|       |
 4864|   137k|    ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) pv_svc_dec;
 4865|   137k|    ps_dec = &ps_svc_lyr_dec->s_dec;
 4866|   137k|    ps_res_prms = &ps_svc_lyr_dec->s_res_prms;
 4867|   137k|    i4_frm_wd_in_mbs = ps_dec->u2_frm_wd_in_mbs;
 4868|   137k|    i4_frm_ht_in_mbs = ps_dec->u2_frm_ht_in_mbs;
 4869|       |
 4870|       |    /* Initializations */
 4871|   137k|    pu1_crop_wnd_flag = ps_svc_lyr_dec->pu1_crop_wnd_flag;
 4872|   137k|    i4_num_mbs = i4_frm_wd_in_mbs * i4_frm_ht_in_mbs;
 4873|       |
 4874|       |    /* bottom most layer in a resolution */
 4875|   137k|    if(ps_res_prms->s_ref_lyr_scaled_offset.i2_left >= 0)
  ------------------
  |  Branch (4875:8): [True: 137k, False: 0]
  ------------------
 4876|   137k|    {
 4877|       |        /* check for offset greater than 0 */
 4878|   137k|        i4_left_offset = (ps_res_prms->s_ref_lyr_scaled_offset.i2_left + 15) >> 4;
 4879|   137k|    }
 4880|      0|    else
 4881|      0|    {
 4882|       |        /* if negative set it to 0*/
 4883|      0|        i4_left_offset = 0;
 4884|      0|    }
 4885|       |
 4886|   137k|    if(ps_res_prms->s_ref_lyr_scaled_offset.i2_rt >= 0)
  ------------------
  |  Branch (4886:8): [True: 137k, False: 0]
  ------------------
 4887|   137k|    {
 4888|       |        /* check for offset greater than 0 */
 4889|   137k|        i4_rt_offset =
 4890|   137k|            (ps_res_prms->i4_res_width - ps_res_prms->s_ref_lyr_scaled_offset.i2_rt) >> 4;
 4891|   137k|    }
 4892|      0|    else
 4893|      0|    {
 4894|       |        /* if negative set it to framewidth in MBs */
 4895|      0|        i4_rt_offset = (ps_res_prms->i4_res_width >> 4);
 4896|      0|    }
 4897|       |
 4898|   137k|    if(ps_res_prms->s_ref_lyr_scaled_offset.i2_top >= 0)
  ------------------
  |  Branch (4898:8): [True: 137k, False: 0]
  ------------------
 4899|   137k|    {
 4900|       |        /* check for offset greater than 0 */
 4901|   137k|        i4_top_offset = (ps_res_prms->s_ref_lyr_scaled_offset.i2_top + 15) >> 4;
 4902|   137k|    }
 4903|      0|    else
 4904|      0|    {
 4905|       |        /* if negative set it to 0 */
 4906|      0|        i4_top_offset = 0;
 4907|      0|    }
 4908|       |
 4909|   137k|    if(ps_res_prms->s_ref_lyr_scaled_offset.i2_bot >= 0)
  ------------------
  |  Branch (4909:8): [True: 137k, False: 72]
  ------------------
 4910|   137k|    {
 4911|       |        /* check for offset greater than 0 */
 4912|   137k|        i4_bot_offset =
 4913|   137k|            (ps_res_prms->i4_res_height - ps_res_prms->s_ref_lyr_scaled_offset.i2_bot) >> 4;
 4914|   137k|    }
 4915|     72|    else
 4916|     72|    {
 4917|       |        /* if negative set it to frameheight in MBs */
 4918|     72|        i4_bot_offset = (ps_res_prms->i4_res_height >> 4);
 4919|     72|    }
 4920|       |
 4921|   137k|    i4_crop_mbs_x = i4_rt_offset - i4_left_offset;
 4922|   137k|    i4_crop_mbs_y = i4_bot_offset - i4_top_offset;
 4923|       |
 4924|       |    /* Set crop window flag to 0 for all mbs */
 4925|   137k|    memset(pu1_crop_wnd_flag, 0, i4_num_mbs);
 4926|       |
 4927|   137k|    pu1_crop_wnd_flag += (i4_frm_wd_in_mbs * i4_top_offset);
 4928|   137k|    pu1_crop_wnd_flag += i4_left_offset;
 4929|       |    /* Loop over MBs in crop window */
 4930|  2.55M|    for(i4_cnt = 0; i4_cnt < i4_crop_mbs_y; i4_cnt++)
  ------------------
  |  Branch (4930:21): [True: 2.41M, False: 137k]
  ------------------
 4931|  2.41M|    {
 4932|  2.41M|        memset(pu1_crop_wnd_flag, 1, i4_crop_mbs_x);
 4933|  2.41M|        pu1_crop_wnd_flag += i4_frm_wd_in_mbs;
 4934|  2.41M|    }
 4935|   137k|}
isvcd_intra_resamp_res_init_update_flags:
 4963|  26.4k|{
 4964|  26.4k|    intra_sampling_ctxt_t *ps_ctxt;
 4965|  26.4k|    intra_samp_lyr_ctxt *ps_lyr_ctxt;
 4966|  26.4k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) pv_svc_dec;
 4967|       |
 4968|  26.4k|    ps_ctxt = (intra_sampling_ctxt_t *) ps_svc_lyr_dec->pv_intra_sample_ctxt;;
 4969|       |    /* get the current layer ctxt */
 4970|  26.4k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_svc_lyr_dec->u1_layer_id - 1];
 4971|       |
 4972|  26.4k|    ps_lyr_ctxt->i1_constrained_intra_rsmpl_flag =
 4973|  26.4k|        ps_svc_lyr_dec->s_svc_slice_params.u1_constrained_intra_resampling_flag;
 4974|  26.4k|}
isvcd_intra_resamp_res_init:
 5002|   137k|{
 5003|   137k|    intra_sampling_ctxt_t *ps_ctxt;
 5004|   137k|    intra_samp_lyr_ctxt *ps_lyr_ctxt;
 5005|   137k|    dec_svc_seq_params_t *ps_cur_subset_sps;
 5006|   137k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) pv_svc_dec;
 5007|   137k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 5008|   137k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 5009|       |
 5010|   137k|    void *pv_intra_samp_ctxt = ps_svc_lyr_dec->pv_intra_sample_ctxt;
 5011|   137k|    res_prms_t *ps_curr_lyr_res_prms = &ps_svc_lyr_dec->s_res_prms;
 5012|   137k|    ref_mb_map_t **pps_luma_map_horz = &ps_svc_lyr_dec->ps_intsam_luma_map_horz;
 5013|   137k|    ref_mb_map_t **pps_chroma_map_horz = &ps_svc_lyr_dec->ps_intsam_chroma_map_horz;
 5014|   137k|    ref_mb_map_t **pps_luma_map_vert = &ps_svc_lyr_dec->ps_intsam_luma_map_vert;
 5015|   137k|    ref_mb_map_t **pps_chroma_map_vert = &ps_svc_lyr_dec->ps_intsam_chroma_map_vert;
 5016|       |
 5017|   137k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 5018|   137k|    ps_cur_subset_sps = ps_svc_lyr_dec->ps_cur_subset_sps;
 5019|       |
 5020|   137k|    ps_ctxt = (intra_sampling_ctxt_t *) pv_intra_samp_ctxt;
 5021|       |
 5022|       |    /* if called for base resolution store default values */
 5023|   137k|    if(SVCD_TRUE == ps_svc_lyr_dec->u1_base_res_flag)
  ------------------
  |  |   46|   137k|#define SVCD_TRUE 1
  ------------------
  |  Branch (5023:8): [True: 102k, False: 34.5k]
  ------------------
 5024|   102k|    {
 5025|   102k|        *pps_luma_map_horz = NULL;
 5026|   102k|        *pps_chroma_map_horz = NULL;
 5027|   102k|        *pps_luma_map_vert = NULL;
 5028|   102k|        *pps_chroma_map_vert = NULL;
 5029|   102k|        ps_ctxt->i4_res_lyr_id = -1;
 5030|   102k|        ps_ctxt->i4_ref_width = ps_dec->u2_pic_wd;
 5031|   102k|        ps_ctxt->i4_ref_height = ps_dec->u2_pic_ht;
 5032|       |
 5033|       |        /* Note: The stride option is provided for bringing in data at NMB */
 5034|       |        /* level. Hence to set a NMB level stride refSample array buffer   */
 5035|       |        /* have to be increased                                            */
 5036|   102k|        ps_ctxt->i4_refarray_stride = REF_ARRAY_WIDTH;
  ------------------
  |  |   73|   102k|#define REF_ARRAY_WIDTH 48
  ------------------
 5037|   102k|        return OK;
  ------------------
  |  |  114|   102k|#define OK        0
  ------------------
 5038|   102k|    }
 5039|       |
 5040|       |    /* derive the current sps */
 5041|       |    /* store the res id appropriately */
 5042|  34.5k|    ps_ctxt->i4_res_lyr_id = ps_svc_lyr_dec->u1_layer_id - 1;
 5043|       |
 5044|       |    /* store the resolution params */
 5045|  34.5k|    ps_ctxt->ps_res_prms = ps_curr_lyr_res_prms;
 5046|       |
 5047|       |    /* get the current layer ctxt */
 5048|  34.5k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_svc_lyr_dec->u1_layer_id - 1];
 5049|       |
 5050|  34.5k|    ps_ctxt->i4_res_lyr_id = ps_svc_lyr_dec->u1_layer_id - 1;
 5051|       |    /* get the width and heights */
 5052|  34.5k|    ps_lyr_ctxt->i4_curr_width = ps_dec->u2_pic_wd;
 5053|  34.5k|    ps_lyr_ctxt->i4_curr_height = ps_dec->u2_pic_ht;
 5054|  34.5k|    ps_lyr_ctxt->i4_ref_width = ps_ctxt->i4_ref_width;
 5055|  34.5k|    ps_lyr_ctxt->i4_ref_height = ps_ctxt->i4_ref_height;
 5056|  34.5k|    ps_lyr_ctxt->i1_constrained_intra_rsmpl_flag =
 5057|  34.5k|        ps_svc_slice_params->u1_constrained_intra_resampling_flag;
 5058|       |
 5059|       |    /* store the structure pointer containing projected locations */
 5060|  34.5k|    *pps_luma_map_horz = ps_lyr_ctxt->s_luma_map_ctxt.ps_x_offset_length;
 5061|  34.5k|    *pps_chroma_map_horz = ps_lyr_ctxt->s_chroma_map_ctxt.ps_x_offset_length;
 5062|  34.5k|    *pps_luma_map_vert = ps_lyr_ctxt->s_luma_map_ctxt.ps_y_offset_length;
 5063|  34.5k|    *pps_chroma_map_vert = ps_lyr_ctxt->s_chroma_map_ctxt.ps_y_offset_length;
 5064|       |
 5065|       |    /* check for recomputation of mapping required */
 5066|  34.5k|    if(SVCD_TRUE == ps_curr_lyr_res_prms->u1_remap_req_flag)
  ------------------
  |  |   46|  34.5k|#define SVCD_TRUE 1
  ------------------
  |  Branch (5066:8): [True: 34.5k, False: 0]
  ------------------
 5067|  34.5k|    {
 5068|  34.5k|        res_prms_t s_ref_res_prms = {0};
 5069|  34.5k|        WORD32 i4_chroma_x_phase, i4_chroma_y_phase;
 5070|  34.5k|        WORD32 i4_ref_chroma_x_phase, i4_ref_chroma_y_phase;
 5071|  34.5k|        WORD32 i4_x_phase_0, i4_x_phase_1;
 5072|  34.5k|        WORD32 i4_y_phase_0, i4_y_phase_1;
 5073|  34.5k|        WORD32 i4_vert_flag;
 5074|       |
 5075|       |        /* store the reference layer resolution width and height */
 5076|  34.5k|        s_ref_res_prms.i4_res_width = ps_ctxt->i4_ref_width;
 5077|  34.5k|        s_ref_res_prms.i4_res_height = ps_ctxt->i4_ref_height;
 5078|       |
 5079|       |        /* call the frame level projections calculation function */
 5080|  34.5k|        isvcd_intra_resamp_populate_list(&ps_lyr_ctxt->s_luma_map_ctxt, ps_curr_lyr_res_prms,
 5081|  34.5k|                                         &s_ref_res_prms, 0, ps_svc_lyr_dec);
 5082|       |
 5083|  34.5k|        isvcd_intra_resamp_populate_list(&ps_lyr_ctxt->s_chroma_map_ctxt, ps_curr_lyr_res_prms,
 5084|  34.5k|                                         &s_ref_res_prms, 1, ps_svc_lyr_dec);
 5085|       |
 5086|       |        /* Compute the chroma xPhase and yPhase values */
 5087|  34.5k|        if(1 == ps_curr_lyr_res_prms->u1_dyadic_flag)
  ------------------
  |  Branch (5087:12): [True: 18.0k, False: 16.5k]
  ------------------
 5088|  18.0k|        {
 5089|  18.0k|            i4_ref_chroma_x_phase = ps_curr_lyr_res_prms->i1_ref_lyr_chroma_phase_x_plus1_flag;
 5090|  18.0k|            i4_ref_chroma_y_phase = ps_curr_lyr_res_prms->i1_ref_lyr_chroma_phase_y_plus1;
 5091|  18.0k|            i4_chroma_x_phase = ps_cur_subset_sps->s_sps_svc_ext.u1_chroma_phase_x_plus1_flag;
 5092|  18.0k|            i4_chroma_y_phase = ps_cur_subset_sps->s_sps_svc_ext.u1_chroma_phase_y_plus1;
 5093|       |
 5094|  18.0k|            i4_x_phase_0 = i4_chroma_x_phase - (i4_ref_chroma_x_phase << 1);
 5095|  18.0k|            i4_x_phase_1 = (3 + i4_x_phase_0) & 0x7;
 5096|  18.0k|            i4_x_phase_0 += 7;
 5097|  18.0k|            i4_x_phase_0 &= 0x7;
 5098|  18.0k|            i4_y_phase_0 = i4_chroma_y_phase - (i4_ref_chroma_y_phase << 1);
 5099|  18.0k|            i4_y_phase_1 = (3 + i4_y_phase_0) & 0x7;
 5100|  18.0k|            i4_y_phase_0 += 7;
 5101|  18.0k|            i4_y_phase_0 &= 0x7;
 5102|       |
 5103|  18.0k|            ps_lyr_ctxt->i4_x_phase_0 = i4_x_phase_0;
 5104|  18.0k|            ps_lyr_ctxt->i4_x_phase_1 = i4_x_phase_1;
 5105|  18.0k|            ps_lyr_ctxt->i4_y_phase_0 = i4_y_phase_0;
 5106|  18.0k|            ps_lyr_ctxt->i4_y_phase_1 = i4_y_phase_1;
 5107|       |
 5108|       |            /* Choose the appropriate chroma interpolation functions */
 5109|  18.0k|            if((0 == i4_ref_chroma_x_phase) && (1 == i4_chroma_x_phase))
  ------------------
  |  Branch (5109:16): [True: 5.30k, False: 12.6k]
  |  Branch (5109:48): [True: 1.10k, False: 4.20k]
  ------------------
 5110|  1.10k|            {
 5111|  1.10k|                ps_lyr_ctxt->pf_horz_chroma_interpol = ps_ctxt->pf_horz_chroma_interpol[1];
 5112|  1.10k|            }
 5113|  16.9k|            else
 5114|  16.9k|            {
 5115|  16.9k|                ps_lyr_ctxt->pf_horz_chroma_interpol = ps_ctxt->pf_horz_chroma_interpol[0];
 5116|  16.9k|            }
 5117|       |
 5118|  18.0k|            i4_vert_flag = 0;
 5119|  18.0k|            if(0 == i4_ref_chroma_y_phase)
  ------------------
  |  Branch (5119:16): [True: 1.87k, False: 16.1k]
  ------------------
 5120|  1.87k|            {
 5121|  1.87k|                if((1 == i4_chroma_y_phase) || (2 == i4_chroma_y_phase))
  ------------------
  |  Branch (5121:20): [True: 70, False: 1.80k]
  |  Branch (5121:48): [True: 115, False: 1.69k]
  ------------------
 5122|    185|                {
 5123|    185|                    i4_vert_flag = 1;
 5124|    185|                }
 5125|  1.87k|            }
 5126|  16.1k|            else if((2 == i4_ref_chroma_y_phase) && (0 == i4_chroma_y_phase))
  ------------------
  |  Branch (5126:21): [True: 3.34k, False: 12.7k]
  |  Branch (5126:53): [True: 679, False: 2.66k]
  ------------------
 5127|    679|            {
 5128|    679|                i4_vert_flag = 2;
 5129|    679|            }
 5130|       |
 5131|  18.0k|            if(1 == i4_vert_flag)
  ------------------
  |  Branch (5131:16): [True: 185, False: 17.8k]
  ------------------
 5132|    185|            {
 5133|    185|                ps_lyr_ctxt->pf_vert_chroma_interpol = ps_ctxt->pf_vert_chroma_interpol[1];
 5134|    185|            }
 5135|  17.8k|            else if(2 == i4_vert_flag)
  ------------------
  |  Branch (5135:21): [True: 679, False: 17.1k]
  ------------------
 5136|    679|            {
 5137|    679|                ps_lyr_ctxt->pf_vert_chroma_interpol = ps_ctxt->pf_vert_chroma_interpol[2];
 5138|    679|            }
 5139|  17.1k|            else
 5140|  17.1k|            {
 5141|  17.1k|                ps_lyr_ctxt->pf_vert_chroma_interpol = ps_ctxt->pf_vert_chroma_interpol[0];
 5142|  17.1k|            }
 5143|  18.0k|        }
 5144|  34.5k|    }
 5145|      0|    else
 5146|      0|    {
 5147|       |        /* should take false value */
 5148|      0|        if(SVCD_FALSE != ps_curr_lyr_res_prms->u1_remap_req_flag)
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
  |  Branch (5148:12): [True: 0, False: 0]
  ------------------
 5149|      0|        {
 5150|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 5151|      0|        }
 5152|      0|    }
 5153|       |
 5154|       |    /* store the current layer width and height to context */
 5155|  34.5k|    ps_ctxt->i4_ref_width = ps_curr_lyr_res_prms->i4_res_width;
 5156|  34.5k|    ps_ctxt->i4_ref_height = ps_curr_lyr_res_prms->i4_res_height;
 5157|       |
 5158|  34.5k|    return OK;
  ------------------
  |  |  114|  34.5k|#define OK        0
  ------------------
 5159|  34.5k|}

isvcd_intra_resamp.c:isvcd_left_most_bit_detect:
   98|   617k|{
   99|   617k|    WORD32 i4_number = 0;
  100|   617k|    if(0xff == u4_num)
  ------------------
  |  Branch (100:8): [True: 0, False: 617k]
  ------------------
  101|      0|    {
  102|      0|        return 32;
  103|      0|    }
  104|       |
  105|   617k|    do
  106|   896k|    {
  107|   896k|        if(0 == (u4_num & 0x80000000))
  ------------------
  |  Branch (107:12): [True: 617k, False: 279k]
  ------------------
  108|   617k|        {
  109|   617k|            return i4_number;
  110|   617k|        }
  111|   279k|        u4_num <<= 1;
  112|   279k|        i4_number++;
  113|   279k|    } while(1);
  ------------------
  |  Branch (113:13): [True: 279k, Folded]
  ------------------
  114|   617k|}

isvcd_iquant_itrans_4x4:
   87|  41.8k|{
   88|  41.8k|    WORD16 *pi2_src_ptr = pi2_src;
   89|  41.8k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
   90|  41.8k|    WORD16 *pi2_out_ptr = pi2_out;
   91|  41.8k|    WORD16 x0, x1, x2, x3, i;
   92|  41.8k|    WORD32 q0, q1, q2, q3;
   93|  41.8k|    WORD16 i_macro;
   94|  41.8k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (94:23): [True: 19.7k, False: 22.0k]
  ------------------
   95|       |
   96|       |    /* inverse quant */
   97|       |    /*horizontal inverse transform */
   98|   209k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   209k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (98:16): [True: 167k, False: 41.8k]
  ------------------
   99|   167k|    {
  100|   167k|        q0 = pi2_src_ptr[0];
  101|   167k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   167k|                {\
  |  |  104|   167k|                    i4_value *= quant_scale;\
  |  |  105|   167k|                    i4_value *= weight_scale;\
  |  |  106|   167k|                    i4_value += rndfactor;\
  |  |  107|   167k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   167k|                    i4_value >>= qbits;\
  |  |  109|   167k|                }
  ------------------
  102|   167k|        if(i == 0 && iq_start_idx == 1)
  ------------------
  |  Branch (102:12): [True: 41.8k, False: 125k]
  |  Branch (102:22): [True: 0, False: 41.8k]
  ------------------
  103|      0|            q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case
  104|       |
  105|   167k|        q2 = pi2_src_ptr[2];
  106|   167k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   167k|                {\
  |  |  104|   167k|                    i4_value *= quant_scale;\
  |  |  105|   167k|                    i4_value *= weight_scale;\
  |  |  106|   167k|                    i4_value += rndfactor;\
  |  |  107|   167k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   167k|                    i4_value >>= qbits;\
  |  |  109|   167k|                }
  ------------------
  107|       |
  108|   167k|        x0 = q0 + q2;
  109|   167k|        x1 = q0 - q2;
  110|       |
  111|   167k|        q1 = pi2_src_ptr[1];
  112|   167k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   167k|                {\
  |  |  104|   167k|                    i4_value *= quant_scale;\
  |  |  105|   167k|                    i4_value *= weight_scale;\
  |  |  106|   167k|                    i4_value += rndfactor;\
  |  |  107|   167k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   167k|                    i4_value >>= qbits;\
  |  |  109|   167k|                }
  ------------------
  113|       |
  114|   167k|        q3 = pi2_src_ptr[3];
  115|   167k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|   167k|                {\
  |  |  104|   167k|                    i4_value *= quant_scale;\
  |  |  105|   167k|                    i4_value *= weight_scale;\
  |  |  106|   167k|                    i4_value += rndfactor;\
  |  |  107|   167k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   167k|                    i4_value >>= qbits;\
  |  |  109|   167k|                }
  ------------------
  116|       |
  117|   167k|        x2 = (q1 >> 1) - q3;
  118|   167k|        x3 = q1 + (q3 >> 1);
  119|       |
  120|   167k|        pi2_tmp_ptr[0] = x0 + x3;
  121|   167k|        pi2_tmp_ptr[1] = x1 + x2;
  122|   167k|        pi2_tmp_ptr[2] = x1 - x2;
  123|   167k|        pi2_tmp_ptr[3] = x0 - x3;
  124|       |
  125|   167k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   167k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  126|   167k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   167k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  127|   167k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   167k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  128|   167k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|   167k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  129|   167k|    }
  130|       |
  131|       |    /* vertical inverse transform */
  132|  41.8k|    pi2_tmp_ptr = pi2_tmp;
  133|   209k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   209k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (133:16): [True: 167k, False: 41.8k]
  ------------------
  134|   167k|    {
  135|   167k|        pi2_out = pi2_out_ptr;
  136|       |
  137|   167k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  138|   167k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  139|   167k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  140|   167k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  141|       |
  142|       |        /* inverse prediction */
  143|   167k|        i_macro = x0 + x3;
  144|   167k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|   167k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   167k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 8.38k, False: 158k]
  |  |  |  |  |  Branch (77:54): [True: 9.67k, False: 149k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|   167k|        pi2_out += out_strd;
  146|       |
  147|   167k|        i_macro = x1 + x2;
  148|   167k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|   167k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   167k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.47k, False: 159k]
  |  |  |  |  |  Branch (77:54): [True: 8.85k, False: 150k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  149|   167k|        pi2_out += out_strd;
  150|       |
  151|   167k|        i_macro = x1 - x2;
  152|   167k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|   167k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   167k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.73k, False: 159k]
  |  |  |  |  |  Branch (77:54): [True: 7.99k, False: 151k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|   167k|        pi2_out += out_strd;
  154|       |
  155|   167k|        i_macro = x0 - x3;
  156|   167k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|   167k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   167k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 8.02k, False: 159k]
  |  |  |  |  |  Branch (77:54): [True: 7.96k, False: 151k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  157|   167k|        pi2_tmp_ptr++;
  158|   167k|        pi2_out_ptr++;
  159|   167k|    }
  160|  41.8k|}
isvcd_iquant_itrans_4x4_dc:
  188|  6.64k|{
  189|  6.64k|    WORD16 *pi2_out_ptr = pi2_out;
  190|  6.64k|    WORD32 q0;
  191|  6.64k|    WORD16 i_macro, i;
  192|  6.64k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (192:23): [True: 1.01k, False: 5.63k]
  ------------------
  193|  6.64k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  6.64k|#define UNUSED(x) ((void)(x))
  ------------------
  194|       |
  195|  6.64k|    if(iq_start_idx == 0)
  ------------------
  |  Branch (195:8): [True: 6.64k, False: 0]
  ------------------
  196|  6.64k|    {
  197|  6.64k|        q0 = pi2_src[0];
  198|  6.64k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  6.64k|                {\
  |  |  104|  6.64k|                    i4_value *= quant_scale;\
  |  |  105|  6.64k|                    i4_value *= weight_scale;\
  |  |  106|  6.64k|                    i4_value += rndfactor;\
  |  |  107|  6.64k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  6.64k|                    i4_value >>= qbits;\
  |  |  109|  6.64k|                }
  ------------------
  199|  6.64k|    }
  200|      0|    else
  201|      0|    {
  202|      0|        q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case3
  203|      0|    }
  204|  6.64k|    i_macro = CLIP_RSD((q0 + 32) >> 6);
  ------------------
  |  |  774|  6.64k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  6.64k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 416, False: 6.23k]
  |  |  |  |  |  Branch (77:54): [True: 589, False: 5.64k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  205|  33.2k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  33.2k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (205:16): [True: 26.5k, False: 6.64k]
  ------------------
  206|  26.5k|    {
  207|  26.5k|        pi2_out = pi2_out_ptr;
  208|       |
  209|       |        /* inverse prediction */
  210|  26.5k|        *pi2_out = i_macro;
  211|  26.5k|        pi2_out += out_strd;
  212|  26.5k|        *pi2_out = i_macro;
  213|  26.5k|        pi2_out += out_strd;
  214|  26.5k|        *pi2_out = i_macro;
  215|  26.5k|        pi2_out += out_strd;
  216|  26.5k|        *pi2_out = i_macro;
  217|  26.5k|        pi2_out_ptr++;
  218|  26.5k|    }
  219|  6.64k|}
isvcd_iquant_itrans_chroma_4x4:
  246|  9.58k|{
  247|  9.58k|    WORD16 *pi2_src_ptr = pi2_src;
  248|  9.58k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  249|  9.58k|    WORD16 *pi2_out_ptr = pi2_out;
  250|  9.58k|    WORD16 x0, x1, x2, x3, i;
  251|  9.58k|    WORD32 q0, q1, q2, q3;
  252|  9.58k|    WORD16 i_macro;
  253|  9.58k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (253:23): [True: 6.23k, False: 3.35k]
  ------------------
  254|       |
  255|       |    /* inverse quant */
  256|       |    /*horizontal inverse transform */
  257|  47.9k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  47.9k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (257:16): [True: 38.3k, False: 9.58k]
  ------------------
  258|  38.3k|    {
  259|  38.3k|        if(i == 0)
  ------------------
  |  Branch (259:12): [True: 9.58k, False: 28.7k]
  ------------------
  260|  9.58k|        {
  261|  9.58k|            q0 = pi2_dc_src[0];
  262|  9.58k|        }
  263|  28.7k|        else
  264|  28.7k|        {
  265|  28.7k|            q0 = pi2_src_ptr[0];
  266|  28.7k|            INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  28.7k|                {\
  |  |  104|  28.7k|                    i4_value *= quant_scale;\
  |  |  105|  28.7k|                    i4_value *= weight_scale;\
  |  |  106|  28.7k|                    i4_value += rndfactor;\
  |  |  107|  28.7k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  28.7k|                    i4_value >>= qbits;\
  |  |  109|  28.7k|                }
  ------------------
  267|  28.7k|        }
  268|       |
  269|  38.3k|        q2 = pi2_src_ptr[2];
  270|  38.3k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  38.3k|                {\
  |  |  104|  38.3k|                    i4_value *= quant_scale;\
  |  |  105|  38.3k|                    i4_value *= weight_scale;\
  |  |  106|  38.3k|                    i4_value += rndfactor;\
  |  |  107|  38.3k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  38.3k|                    i4_value >>= qbits;\
  |  |  109|  38.3k|                }
  ------------------
  271|       |
  272|  38.3k|        x0 = q0 + q2;
  273|  38.3k|        x1 = q0 - q2;
  274|       |
  275|  38.3k|        q1 = pi2_src_ptr[1];
  276|  38.3k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  38.3k|                {\
  |  |  104|  38.3k|                    i4_value *= quant_scale;\
  |  |  105|  38.3k|                    i4_value *= weight_scale;\
  |  |  106|  38.3k|                    i4_value += rndfactor;\
  |  |  107|  38.3k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  38.3k|                    i4_value >>= qbits;\
  |  |  109|  38.3k|                }
  ------------------
  277|       |
  278|  38.3k|        q3 = pi2_src_ptr[3];
  279|  38.3k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  38.3k|                {\
  |  |  104|  38.3k|                    i4_value *= quant_scale;\
  |  |  105|  38.3k|                    i4_value *= weight_scale;\
  |  |  106|  38.3k|                    i4_value += rndfactor;\
  |  |  107|  38.3k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  38.3k|                    i4_value >>= qbits;\
  |  |  109|  38.3k|                }
  ------------------
  280|       |
  281|  38.3k|        x2 = (q1 >> 1) - q3;
  282|  38.3k|        x3 = q1 + (q3 >> 1);
  283|       |
  284|  38.3k|        pi2_tmp_ptr[0] = x0 + x3;
  285|  38.3k|        pi2_tmp_ptr[1] = x1 + x2;
  286|  38.3k|        pi2_tmp_ptr[2] = x1 - x2;
  287|  38.3k|        pi2_tmp_ptr[3] = x0 - x3;
  288|       |
  289|  38.3k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  38.3k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  290|  38.3k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  38.3k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  291|  38.3k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  38.3k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  292|  38.3k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  38.3k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  293|  38.3k|    }
  294|       |
  295|       |    /* vertical inverse transform */
  296|  9.58k|    pi2_tmp_ptr = pi2_tmp;
  297|  47.9k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  47.9k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (297:16): [True: 38.3k, False: 9.58k]
  ------------------
  298|  38.3k|    {
  299|  38.3k|        pi2_out = pi2_out_ptr;
  300|       |
  301|  38.3k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  302|  38.3k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  303|  38.3k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  304|  38.3k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  305|       |
  306|       |        /* inverse prediction */
  307|  38.3k|        i_macro = x0 + x3;
  308|  38.3k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|  38.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  38.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.30k, False: 37.0k]
  |  |  |  |  |  Branch (77:54): [True: 1.40k, False: 35.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  309|  38.3k|        pi2_out += out_strd;
  310|       |
  311|  38.3k|        i_macro = x1 + x2;
  312|  38.3k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|  38.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  38.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.10k, False: 37.2k]
  |  |  |  |  |  Branch (77:54): [True: 1.23k, False: 35.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  313|  38.3k|        pi2_out += out_strd;
  314|       |
  315|  38.3k|        i_macro = x1 - x2;
  316|  38.3k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|  38.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  38.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.24k, False: 37.0k]
  |  |  |  |  |  Branch (77:54): [True: 1.55k, False: 35.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  317|  38.3k|        pi2_out += out_strd;
  318|       |
  319|  38.3k|        i_macro = x0 - x3;
  320|  38.3k|        *pi2_out = CLIP_RSD((i_macro + 32) >> 6);
  ------------------
  |  |  774|  38.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  38.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.18k, False: 37.1k]
  |  |  |  |  |  Branch (77:54): [True: 1.26k, False: 35.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  321|  38.3k|        pi2_tmp_ptr++;
  322|  38.3k|        pi2_out_ptr += 2;  // Interleaved store for output
  323|  38.3k|    }
  324|  9.58k|}
isvcd_iquant_itrans_chroma_4x4_dc:
  351|  24.9k|{
  352|  24.9k|    WORD16 *pi2_out_ptr = pi2_out;
  353|  24.9k|    WORD32 q0;
  354|  24.9k|    WORD16 i_macro, i;
  355|  24.9k|    UNUSED(pi2_src);
  ------------------
  |  |   45|  24.9k|#define UNUSED(x) ((void)(x))
  ------------------
  356|  24.9k|    UNUSED(pu2_iscal_mat);
  ------------------
  |  |   45|  24.9k|#define UNUSED(x) ((void)(x))
  ------------------
  357|  24.9k|    UNUSED(pu2_weigh_mat);
  ------------------
  |  |   45|  24.9k|#define UNUSED(x) ((void)(x))
  ------------------
  358|  24.9k|    UNUSED(u4_qp_div_6);
  ------------------
  |  |   45|  24.9k|#define UNUSED(x) ((void)(x))
  ------------------
  359|  24.9k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  24.9k|#define UNUSED(x) ((void)(x))
  ------------------
  360|       |
  361|  24.9k|    q0 = pi2_dc_src[0];  // Restoring dc value for intra case3
  362|  24.9k|    i_macro = CLIP_RSD((q0 + 32) >> 6);
  ------------------
  |  |  774|  24.9k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  24.9k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 402, False: 24.5k]
  |  |  |  |  |  Branch (77:54): [True: 737, False: 23.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  363|       |
  364|   124k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   124k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (364:16): [True: 99.7k, False: 24.9k]
  ------------------
  365|  99.7k|    {
  366|  99.7k|        pi2_out = pi2_out_ptr;
  367|       |
  368|       |        /* inverse prediction */
  369|  99.7k|        *pi2_out = i_macro;
  370|  99.7k|        pi2_out += out_strd;
  371|       |
  372|  99.7k|        *pi2_out = i_macro;
  373|  99.7k|        pi2_out += out_strd;
  374|       |
  375|  99.7k|        *pi2_out = i_macro;
  376|  99.7k|        pi2_out += out_strd;
  377|       |
  378|  99.7k|        *pi2_out = i_macro;
  379|       |
  380|  99.7k|        pi2_out_ptr += 2;
  381|  99.7k|    }
  382|  24.9k|}
isvcd_iquant_itrans_8x8_dc:
  440|  5.37k|{
  441|  5.37k|    WORD16 *pi2_out_ptr = pi2_out;
  442|  5.37k|    WORD16 i, i_macro;
  443|  5.37k|    WORD32 q;
  444|  5.37k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (444:23): [True: 1.53k, False: 3.84k]
  ------------------
  445|  5.37k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  5.37k|#define UNUSED(x) ((void)(x))
  ------------------
  446|  5.37k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  5.37k|#define UNUSED(x) ((void)(x))
  ------------------
  447|  5.37k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  5.37k|#define UNUSED(x) ((void)(x))
  ------------------
  448|       |    /*************************************************************/
  449|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
  450|       |    /* operations on platform. Note : DC coeff is not scaled     */
  451|       |    /*************************************************************/
  452|  5.37k|    q = pi2_src[0];
  453|  5.37k|    INV_QUANT(q, pu2_iscale_mat[0], pu2_weigh_mat[0], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  5.37k|                {\
  |  |  104|  5.37k|                    i4_value *= quant_scale;\
  |  |  105|  5.37k|                    i4_value *= weight_scale;\
  |  |  106|  5.37k|                    i4_value += rndfactor;\
  |  |  107|  5.37k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  5.37k|                    i4_value >>= qbits;\
  |  |  109|  5.37k|                }
  ------------------
  454|  5.37k|    i_macro = CLIP_RSD((q + 32) >> 6);
  ------------------
  |  |  774|  5.37k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  5.37k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 785, False: 4.59k]
  |  |  |  |  |  Branch (77:54): [True: 1.31k, False: 3.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  455|       |    /* Perform Inverse transform */
  456|       |    /*--------------------------------------------------------------------*/
  457|       |    /* IDCT [ Horizontal transformation ]                                 */
  458|       |    /*--------------------------------------------------------------------*/
  459|       |    /*--------------------------------------------------------------------*/
  460|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6            */
  461|       |    /*                                                                    */
  462|       |    /* Add the prediction and store it back to reconstructed frame buffer */
  463|       |    /* [Prediction buffer itself in this case]                            */
  464|       |    /*--------------------------------------------------------------------*/
  465|  48.3k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|  48.3k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (465:16): [True: 43.0k, False: 5.37k]
  ------------------
  466|  43.0k|    {
  467|  43.0k|        pi2_out = pi2_out_ptr;
  468|       |
  469|  43.0k|        *pi2_out = i_macro;
  470|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  471|  43.0k|        pi2_out += out_strd;
  472|       |
  473|  43.0k|        *pi2_out = i_macro;
  474|  43.0k|        pi2_out += out_strd;
  475|       |
  476|  43.0k|        *pi2_out = i_macro;
  477|  43.0k|        pi2_out += out_strd;
  478|       |
  479|  43.0k|        *pi2_out = i_macro;
  480|  43.0k|        pi2_out += out_strd;
  481|       |
  482|  43.0k|        *pi2_out = i_macro;
  483|  43.0k|        pi2_out += out_strd;
  484|       |
  485|  43.0k|        *pi2_out = i_macro;
  486|  43.0k|        pi2_out += out_strd;
  487|       |
  488|  43.0k|        *pi2_out = i_macro;
  489|  43.0k|        pi2_out += out_strd;
  490|       |
  491|  43.0k|        *pi2_out = i_macro;
  492|       |
  493|  43.0k|        pi2_out_ptr++;
  494|  43.0k|    }
  495|  5.37k|}
isvcd_iquant_itrans_8x8:
  523|  11.5k|{
  524|  11.5k|    WORD32 i;
  525|  11.5k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  526|  11.5k|    WORD16 *pi2_out_ptr = pi2_out;
  527|  11.5k|    WORD16 i_z0, i_z1, i_z2, i_z3, i_z4, i_z5, i_z6, i_z7;
  528|  11.5k|    WORD16 i_y0, i_y1, i_y2, i_y3, i_y4, i_y5, i_y6, i_y7;
  529|  11.5k|    WORD32 q;
  530|  11.5k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (530:23): [True: 5.54k, False: 6.03k]
  ------------------
  531|  11.5k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  11.5k|#define UNUSED(x) ((void)(x))
  ------------------
  532|  11.5k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  11.5k|#define UNUSED(x) ((void)(x))
  ------------------
  533|       |    /*************************************************************/
  534|       |    /* De quantization of coefficients. Will be replaced by SIMD */
  535|       |    /* operations on platform. Note : DC coeff is not scaled     */
  536|       |    /*************************************************************/
  537|   752k|    for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|   752k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
                  for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|   752k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (537:16): [True: 741k, False: 11.5k]
  ------------------
  538|   741k|    {
  539|   741k|        q = pi2_src[i];
  540|   741k|        INV_QUANT(q, pu2_iscale_mat[i], pu2_weigh_mat[i], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|   741k|                {\
  |  |  104|   741k|                    i4_value *= quant_scale;\
  |  |  105|   741k|                    i4_value *= weight_scale;\
  |  |  106|   741k|                    i4_value += rndfactor;\
  |  |  107|   741k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|   741k|                    i4_value >>= qbits;\
  |  |  109|   741k|                }
  ------------------
  541|   741k|        pi2_tmp_ptr[i] = q;
  542|   741k|    }
  543|       |    /* Perform Inverse transform */
  544|       |    /*--------------------------------------------------------------------*/
  545|       |    /* IDCT [ Horizontal transformation ]                                 */
  546|       |    /*--------------------------------------------------------------------*/
  547|   104k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   104k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (547:16): [True: 92.6k, False: 11.5k]
  ------------------
  548|  92.6k|    {
  549|       |        /*------------------------------------------------------------------*/
  550|       |        /* y0 = w0 + w4                                                     */
  551|       |        /* y1 = -w3 + w5 - w7 - (w7 >> 1)                                   */
  552|       |        /* y2 = w0 - w4                                                     */
  553|       |        /* y3 = w1 + w7 - w3 - (w3 >> 1)                                    */
  554|       |        /* y4 = (w2 >> 1) - w6                                              */
  555|       |        /* y5 = -w1 + w7 + w5 + (w5 >> 1)                                   */
  556|       |        /* y6 = w2 + (w6 >> 1)                                              */
  557|       |        /* y7 = w3 + w5 + w1 + (w1 >> 1)                                    */
  558|       |        /*------------------------------------------------------------------*/
  559|  92.6k|        i_y0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[4]);
  560|       |
  561|  92.6k|        i_y1 =
  562|  92.6k|            ((WORD32) (-pi2_tmp_ptr[3]) + pi2_tmp_ptr[5] - pi2_tmp_ptr[7] - (pi2_tmp_ptr[7] >> 1));
  563|       |
  564|  92.6k|        i_y2 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[4]);
  565|       |
  566|  92.6k|        i_y3 = ((WORD32) pi2_tmp_ptr[1] + pi2_tmp_ptr[7] - pi2_tmp_ptr[3] - (pi2_tmp_ptr[3] >> 1));
  567|       |
  568|  92.6k|        i_y4 = ((pi2_tmp_ptr[2] >> 1) - pi2_tmp_ptr[6]);
  569|       |
  570|  92.6k|        i_y5 =
  571|  92.6k|            ((WORD32) (-pi2_tmp_ptr[1]) + pi2_tmp_ptr[7] + pi2_tmp_ptr[5] + (pi2_tmp_ptr[5] >> 1));
  572|       |
  573|  92.6k|        i_y6 = (pi2_tmp_ptr[2] + (pi2_tmp_ptr[6] >> 1));
  574|       |
  575|  92.6k|        i_y7 = ((WORD32) pi2_tmp_ptr[3] + pi2_tmp_ptr[5] + pi2_tmp_ptr[1] + (pi2_tmp_ptr[1] >> 1));
  576|       |
  577|       |        /*------------------------------------------------------------------*/
  578|       |        /* z0 = y0 + y6                                                     */
  579|       |        /* z1 = y1 + (y7 >> 2)                                              */
  580|       |        /* z2 = y2 + y4                                                     */
  581|       |        /* z3 = y3 + (y5 >> 2)                                              */
  582|       |        /* z4 = y2 - y4                                                     */
  583|       |        /* z5 = (y3 >> 2) - y5                                              */
  584|       |        /* z6 = y0 - y6                                                     */
  585|       |        /* z7 = y7 - (y1 >> 2)                                              */
  586|       |        /*------------------------------------------------------------------*/
  587|  92.6k|        i_z0 = i_y0 + i_y6;
  588|  92.6k|        i_z1 = i_y1 + (i_y7 >> 2);
  589|  92.6k|        i_z2 = i_y2 + i_y4;
  590|  92.6k|        i_z3 = i_y3 + (i_y5 >> 2);
  591|  92.6k|        i_z4 = i_y2 - i_y4;
  592|  92.6k|        i_z5 = (i_y3 >> 2) - i_y5;
  593|  92.6k|        i_z6 = i_y0 - i_y6;
  594|  92.6k|        i_z7 = i_y7 - (i_y1 >> 2);
  595|       |
  596|       |        /*------------------------------------------------------------------*/
  597|       |        /* x0 = z0 + z7                                                     */
  598|       |        /* x1 = z2 + z5                                                     */
  599|       |        /* x2 = z4 + z3                                                     */
  600|       |        /* x3 = z6 + z1                                                     */
  601|       |        /* x4 = z6 - z1                                                     */
  602|       |        /* x5 = z4 - z3                                                     */
  603|       |        /* x6 = z2 - z5                                                     */
  604|       |        /* x7 = z0 - z7                                                     */
  605|       |        /*------------------------------------------------------------------*/
  606|  92.6k|        pi2_tmp_ptr[0] = i_z0 + i_z7;
  607|  92.6k|        pi2_tmp_ptr[1] = i_z2 + i_z5;
  608|  92.6k|        pi2_tmp_ptr[2] = i_z4 + i_z3;
  609|  92.6k|        pi2_tmp_ptr[3] = i_z6 + i_z1;
  610|  92.6k|        pi2_tmp_ptr[4] = i_z6 - i_z1;
  611|  92.6k|        pi2_tmp_ptr[5] = i_z4 - i_z3;
  612|  92.6k|        pi2_tmp_ptr[6] = i_z2 - i_z5;
  613|  92.6k|        pi2_tmp_ptr[7] = i_z0 - i_z7;
  614|       |
  615|       |        /* move to the next row */
  616|       |        // pi2_src_ptr += SUB_BLK_WIDTH_8x8;
  617|  92.6k|        pi2_tmp_ptr += SUB_BLK_WIDTH_8x8;
  ------------------
  |  |   53|  92.6k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  618|  92.6k|    }
  619|       |    /*--------------------------------------------------------------------*/
  620|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6            */
  621|       |    /*                                                                    */
  622|       |    /* Add the prediction and store it back to reconstructed frame buffer */
  623|       |    /* [Prediction buffer itself in this case]                            */
  624|       |    /*--------------------------------------------------------------------*/
  625|       |
  626|  11.5k|    pi2_tmp_ptr = pi2_tmp;
  627|   104k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   104k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (627:16): [True: 92.6k, False: 11.5k]
  ------------------
  628|  92.6k|    {
  629|  92.6k|        pi2_out = pi2_out_ptr;
  630|       |        /*------------------------------------------------------------------*/
  631|       |        /* y0j = w0j + w4j                                                  */
  632|       |        /* y1j = -w3j + w5j -w7j -(w7j >> 1)                                */
  633|       |        /* y2j = w0j -w4j                                                   */
  634|       |        /* y3j = w1j + w7j -w3j -(w3j >> 1)                                 */
  635|       |        /* y4j = ( w2j >> 1 ) -w6j                                          */
  636|       |        /* y5j = -w1j + w7j + w5j + (w5j >> 1)                              */
  637|       |        /* y6j = w2j + ( w6j >> 1 )                                         */
  638|       |        /* y7j = w3j + w5j + w1j + (w1j >> 1)                               */
  639|       |        /*------------------------------------------------------------------*/
  640|  92.6k|        i_y0 = pi2_tmp_ptr[0] + pi2_tmp_ptr[32];
  641|       |
  642|  92.6k|        i_y1 = (WORD32) (-pi2_tmp_ptr[24]) + pi2_tmp_ptr[40] - pi2_tmp_ptr[56] -
  643|  92.6k|               (pi2_tmp_ptr[56] >> 1);
  644|       |
  645|  92.6k|        i_y2 = pi2_tmp_ptr[0] - pi2_tmp_ptr[32];
  646|       |
  647|  92.6k|        i_y3 = (WORD32) pi2_tmp_ptr[8] + pi2_tmp_ptr[56] - pi2_tmp_ptr[24] - (pi2_tmp_ptr[24] >> 1);
  648|       |
  649|  92.6k|        i_y4 = (pi2_tmp_ptr[16] >> 1) - pi2_tmp_ptr[48];
  650|       |
  651|  92.6k|        i_y5 =
  652|  92.6k|            (WORD32) (-pi2_tmp_ptr[8]) + pi2_tmp_ptr[56] + pi2_tmp_ptr[40] + (pi2_tmp_ptr[40] >> 1);
  653|       |
  654|  92.6k|        i_y6 = pi2_tmp_ptr[16] + (pi2_tmp_ptr[48] >> 1);
  655|       |
  656|  92.6k|        i_y7 = (WORD32) pi2_tmp_ptr[24] + pi2_tmp_ptr[40] + pi2_tmp_ptr[8] + (pi2_tmp_ptr[8] >> 1);
  657|       |
  658|       |        /*------------------------------------------------------------------*/
  659|       |        /* z0j = y0j + y6j                                                  */
  660|       |        /* z1j = y1j + (y7j >> 2)                                           */
  661|       |        /* z2j = y2j + y4j                                                  */
  662|       |        /* z3j = y3j + (y5j >> 2)                                           */
  663|       |        /* z4j = y2j -y4j                                                   */
  664|       |        /* z5j = (y3j >> 2) -y5j                                            */
  665|       |        /* z6j = y0j -y6j                                                   */
  666|       |        /* z7j = y7j -(y1j >> 2)                                            */
  667|       |        /*------------------------------------------------------------------*/
  668|  92.6k|        i_z0 = i_y0 + i_y6;
  669|  92.6k|        i_z1 = i_y1 + (i_y7 >> 2);
  670|  92.6k|        i_z2 = i_y2 + i_y4;
  671|  92.6k|        i_z3 = i_y3 + (i_y5 >> 2);
  672|  92.6k|        i_z4 = i_y2 - i_y4;
  673|  92.6k|        i_z5 = (i_y3 >> 2) - i_y5;
  674|  92.6k|        i_z6 = i_y0 - i_y6;
  675|  92.6k|        i_z7 = i_y7 - (i_y1 >> 2);
  676|       |
  677|       |        /*------------------------------------------------------------------*/
  678|       |        /* x0j = z0j + z7j                                                  */
  679|       |        /* x1j = z2j + z5j                                                  */
  680|       |        /* x2j = z4j + z3j                                                  */
  681|       |        /* x3j = z6j + z1j                                                  */
  682|       |        /* x4j = z6j -z1j                                                   */
  683|       |        /* x5j = z4j -z3j                                                   */
  684|       |        /* x6j = z2j -z5j                                                   */
  685|       |        /* x7j = z0j -z7j                                                   */
  686|       |        /*------------------------------------------------------------------*/
  687|  92.6k|        *pi2_out = CLIP_RSD((i_z0 + i_z7 + 32) >> 6);
  ------------------
  |  |  774|  92.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  92.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 8.77k, False: 83.8k]
  |  |  |  |  |  Branch (77:54): [True: 9.75k, False: 74.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  688|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  689|  92.6k|        pi2_out += out_strd;
  690|       |
  691|  92.6k|        *pi2_out = CLIP_RSD((i_z2 + i_z5 + 32) >> 6);
  ------------------
  |  |  774|  92.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  92.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.62k, False: 85.0k]
  |  |  |  |  |  Branch (77:54): [True: 9.17k, False: 75.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  692|  92.6k|        pi2_out += out_strd;
  693|       |
  694|  92.6k|        *pi2_out = CLIP_RSD((i_z4 + i_z3 + 32) >> 6);
  ------------------
  |  |  774|  92.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  92.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.60k, False: 85.0k]
  |  |  |  |  |  Branch (77:54): [True: 9.37k, False: 75.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|  92.6k|        pi2_out += out_strd;
  696|       |
  697|  92.6k|        *pi2_out = CLIP_RSD((i_z6 + i_z1 + 32) >> 6);
  ------------------
  |  |  774|  92.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  92.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.52k, False: 85.1k]
  |  |  |  |  |  Branch (77:54): [True: 8.86k, False: 76.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  698|  92.6k|        pi2_out += out_strd;
  699|       |
  700|  92.6k|        *pi2_out = CLIP_RSD((i_z6 - i_z1 + 32) >> 6);
  ------------------
  |  |  774|  92.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  92.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.32k, False: 85.3k]
  |  |  |  |  |  Branch (77:54): [True: 8.76k, False: 76.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  701|  92.6k|        pi2_out += out_strd;
  702|       |
  703|  92.6k|        *pi2_out = CLIP_RSD((i_z4 - i_z3 + 32) >> 6);
  ------------------
  |  |  774|  92.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  92.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.86k, False: 84.7k]
  |  |  |  |  |  Branch (77:54): [True: 8.97k, False: 75.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  704|  92.6k|        pi2_out += out_strd;
  705|       |
  706|  92.6k|        *pi2_out = CLIP_RSD((i_z2 - i_z5 + 32) >> 6);
  ------------------
  |  |  774|  92.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  92.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 7.58k, False: 85.0k]
  |  |  |  |  |  Branch (77:54): [True: 9.15k, False: 75.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|  92.6k|        pi2_out += out_strd;
  708|       |
  709|  92.6k|        *pi2_out = CLIP_RSD((i_z0 - i_z7 + 32) >> 6);
  ------------------
  |  |  774|  92.6k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  92.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 8.66k, False: 83.9k]
  |  |  |  |  |  Branch (77:54): [True: 8.91k, False: 75.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  710|       |
  711|  92.6k|        pi2_tmp_ptr++;
  712|  92.6k|        pi2_out_ptr++;
  713|  92.6k|    }
  714|  11.5k|}

isvcd_iquant_itrans_residual_recon_4x4:
   86|  15.5k|{
   87|  15.5k|    WORD32 i4_nnz = 0;
   88|  15.5k|    WORD16 *pi2_src_ptr = pi2_src;
   89|  15.5k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
   90|  15.5k|    UWORD8 *pu1_pred_ptr = pu1_pred;
   91|  15.5k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
   92|  15.5k|    UWORD8 *pu1_out_ptr = pu1_out;
   93|  15.5k|    WORD16 x0, x1, x2, x3, i;
   94|  15.5k|    WORD32 q0, q1, q2, q3;
   95|  15.5k|    WORD16 i_macro;
   96|  15.5k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (96:23): [True: 6.57k, False: 9.00k]
  ------------------
   97|       |
   98|       |    /* inverse quant */
   99|       |    /*horizontal inverse transform */
  100|  77.8k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  77.8k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (100:16): [True: 62.3k, False: 15.5k]
  ------------------
  101|  62.3k|    {
  102|  62.3k|        q0 = pi2_src_ptr[0];
  103|  62.3k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  62.3k|                {\
  |  |  104|  62.3k|                    i4_value *= quant_scale;\
  |  |  105|  62.3k|                    i4_value *= weight_scale;\
  |  |  106|  62.3k|                    i4_value += rndfactor;\
  |  |  107|  62.3k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  62.3k|                    i4_value >>= qbits;\
  |  |  109|  62.3k|                }
  ------------------
  104|  62.3k|        if(i == 0 && iq_start_idx == 1)
  ------------------
  |  Branch (104:12): [True: 15.5k, False: 46.7k]
  |  Branch (104:22): [True: 0, False: 15.5k]
  ------------------
  105|      0|            q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case
  106|       |
  107|  62.3k|        q2 = pi2_src_ptr[2];
  108|  62.3k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  62.3k|                {\
  |  |  104|  62.3k|                    i4_value *= quant_scale;\
  |  |  105|  62.3k|                    i4_value *= weight_scale;\
  |  |  106|  62.3k|                    i4_value += rndfactor;\
  |  |  107|  62.3k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  62.3k|                    i4_value >>= qbits;\
  |  |  109|  62.3k|                }
  ------------------
  109|       |
  110|  62.3k|        x0 = q0 + q2;
  111|  62.3k|        x1 = q0 - q2;
  112|       |
  113|  62.3k|        q1 = pi2_src_ptr[1];
  114|  62.3k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  62.3k|                {\
  |  |  104|  62.3k|                    i4_value *= quant_scale;\
  |  |  105|  62.3k|                    i4_value *= weight_scale;\
  |  |  106|  62.3k|                    i4_value += rndfactor;\
  |  |  107|  62.3k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  62.3k|                    i4_value >>= qbits;\
  |  |  109|  62.3k|                }
  ------------------
  115|       |
  116|  62.3k|        q3 = pi2_src_ptr[3];
  117|  62.3k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  62.3k|                {\
  |  |  104|  62.3k|                    i4_value *= quant_scale;\
  |  |  105|  62.3k|                    i4_value *= weight_scale;\
  |  |  106|  62.3k|                    i4_value += rndfactor;\
  |  |  107|  62.3k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  62.3k|                    i4_value >>= qbits;\
  |  |  109|  62.3k|                }
  ------------------
  118|       |
  119|  62.3k|        x2 = (q1 >> 1) - q3;
  120|  62.3k|        x3 = q1 + (q3 >> 1);
  121|       |
  122|  62.3k|        pi2_tmp_ptr[0] = x0 + x3;
  123|  62.3k|        pi2_tmp_ptr[1] = x1 + x2;
  124|  62.3k|        pi2_tmp_ptr[2] = x1 - x2;
  125|  62.3k|        pi2_tmp_ptr[3] = x0 - x3;
  126|       |
  127|  62.3k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  62.3k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  128|  62.3k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  62.3k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  129|  62.3k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  62.3k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  130|  62.3k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  62.3k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  131|  62.3k|    }
  132|       |
  133|       |    /* vertical inverse transform */
  134|  15.5k|    pi2_tmp_ptr = pi2_tmp;
  135|  77.8k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  77.8k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (135:16): [True: 62.3k, False: 15.5k]
  ------------------
  136|  62.3k|    {
  137|  62.3k|        pu1_pred_ptr = pu1_pred;
  138|  62.3k|        pi2_rsd_ptr = pi2_rsd;
  139|  62.3k|        pu1_out = pu1_out_ptr;
  140|       |
  141|  62.3k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  142|  62.3k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  143|  62.3k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  144|  62.3k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  145|       |
  146|       |        /* inverse prediction */
  147|  62.3k|        i_macro = x0 + x3;
  148|  62.3k|        i_macro = ((i_macro + 32) >> 6);
  149|  62.3k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  62.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  62.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 785, False: 61.5k]
  |  |  |  |  |  Branch (77:54): [True: 599, False: 60.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  150|  62.3k|        i4_nnz |= !!i_macro;
  151|  62.3k|        i_macro += *pu1_pred_ptr;
  152|  62.3k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  62.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  62.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 23.9k, False: 38.3k]
  |  |  |  |  |  Branch (77:54): [True: 2.01k, False: 36.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  153|  62.3k|        pu1_pred_ptr += pred_strd;
  154|  62.3k|        pi2_rsd_ptr += rsd_strd;
  155|  62.3k|        pu1_out += out_strd;
  156|       |
  157|  62.3k|        i_macro = x1 + x2;
  158|  62.3k|        i_macro = ((i_macro + 32) >> 6);
  159|  62.3k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  62.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  62.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 688, False: 61.6k]
  |  |  |  |  |  Branch (77:54): [True: 582, False: 61.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  160|  62.3k|        i4_nnz |= !!i_macro;
  161|  62.3k|        i_macro += *pu1_pred_ptr;
  162|  62.3k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  62.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  62.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 25.9k, False: 36.3k]
  |  |  |  |  |  Branch (77:54): [True: 1.93k, False: 34.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  163|  62.3k|        pu1_pred_ptr += pred_strd;
  164|  62.3k|        pi2_rsd_ptr += rsd_strd;
  165|  62.3k|        pu1_out += out_strd;
  166|       |
  167|  62.3k|        i_macro = x1 - x2;
  168|  62.3k|        i_macro = ((i_macro + 32) >> 6);
  169|  62.3k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  62.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  62.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 546, False: 61.7k]
  |  |  |  |  |  Branch (77:54): [True: 720, False: 61.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  170|  62.3k|        i4_nnz |= !!i_macro;
  171|  62.3k|        i_macro += *pu1_pred_ptr;
  172|  62.3k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  62.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  62.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 18.9k, False: 43.3k]
  |  |  |  |  |  Branch (77:54): [True: 3.10k, False: 40.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  173|  62.3k|        pu1_pred_ptr += pred_strd;
  174|  62.3k|        pi2_rsd_ptr += rsd_strd;
  175|  62.3k|        pu1_out += out_strd;
  176|       |
  177|  62.3k|        i_macro = x0 - x3;
  178|  62.3k|        i_macro = ((i_macro + 32) >> 6);
  179|  62.3k|        i4_nnz |= !!i_macro;
  180|  62.3k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  62.3k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  62.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 605, False: 61.7k]
  |  |  |  |  |  Branch (77:54): [True: 613, False: 61.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  181|  62.3k|        i_macro += *pu1_pred_ptr;
  182|  62.3k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  62.3k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  62.3k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 22.5k, False: 39.7k]
  |  |  |  |  |  Branch (77:54): [True: 3.65k, False: 36.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  183|       |
  184|  62.3k|        pi2_tmp_ptr++;
  185|  62.3k|        pu1_out_ptr++;
  186|  62.3k|        pi2_rsd++;
  187|  62.3k|        pu1_pred++;
  188|  62.3k|    }
  189|  15.5k|    return i4_nnz;
  190|  15.5k|}
isvcd_iquant_itrans_residual_recon_4x4_dc:
  221|  3.21k|{
  222|  3.21k|    WORD32 i4_nnz = 0;
  223|  3.21k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  224|  3.21k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  225|  3.21k|    UWORD8 *pu1_out_ptr = pu1_out;
  226|  3.21k|    WORD32 q0;
  227|  3.21k|    WORD16 x, i_macro, i;
  228|  3.21k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (228:23): [True: 675, False: 2.54k]
  ------------------
  229|  3.21k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  3.21k|#define UNUSED(x) ((void)(x))
  ------------------
  230|       |
  231|  3.21k|    if(iq_start_idx == 0)
  ------------------
  |  Branch (231:8): [True: 3.21k, False: 0]
  ------------------
  232|  3.21k|    {
  233|  3.21k|        q0 = pi2_src[0];
  234|  3.21k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  3.21k|                {\
  |  |  104|  3.21k|                    i4_value *= quant_scale;\
  |  |  105|  3.21k|                    i4_value *= weight_scale;\
  |  |  106|  3.21k|                    i4_value += rndfactor;\
  |  |  107|  3.21k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  3.21k|                    i4_value >>= qbits;\
  |  |  109|  3.21k|                }
  ------------------
  235|  3.21k|    }
  236|      0|    else
  237|      0|    {
  238|      0|        q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case3
  239|      0|    }
  240|  3.21k|    i_macro = ((q0 + 32) >> 6);
  241|  16.0k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  16.0k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (241:16): [True: 12.8k, False: 3.21k]
  ------------------
  242|  12.8k|    {
  243|  12.8k|        pu1_pred_ptr = pu1_pred;
  244|  12.8k|        pi2_rsd_ptr = pi2_rsd;
  245|  12.8k|        pu1_out = pu1_out_ptr;
  246|       |
  247|       |        /* inverse prediction */
  248|  12.8k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  12.8k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  12.8k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 309, False: 12.5k]
  |  |  |  |  |  Branch (77:54): [True: 1.70k, False: 10.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|  12.8k|        i4_nnz |= !!x;
  250|  12.8k|        x += *pu1_pred_ptr;
  251|  12.8k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  12.8k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  12.8k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.73k, False: 9.13k]
  |  |  |  |  |  Branch (77:54): [True: 1.09k, False: 8.03k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  252|  12.8k|        pu1_pred_ptr += pred_strd;
  253|  12.8k|        pi2_rsd_ptr += rsd_strd;
  254|  12.8k|        pu1_out += out_strd;
  255|       |
  256|  12.8k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  12.8k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  12.8k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 309, False: 12.5k]
  |  |  |  |  |  Branch (77:54): [True: 1.70k, False: 10.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  257|  12.8k|        i4_nnz |= !!x;
  258|  12.8k|        x += *pu1_pred_ptr;
  259|  12.8k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  12.8k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  12.8k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.75k, False: 9.11k]
  |  |  |  |  |  Branch (77:54): [True: 1.12k, False: 7.99k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  260|  12.8k|        pu1_pred_ptr += pred_strd;
  261|  12.8k|        pi2_rsd_ptr += rsd_strd;
  262|  12.8k|        pu1_out += out_strd;
  263|       |
  264|  12.8k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  12.8k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  12.8k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 303, False: 12.5k]
  |  |  |  |  |  Branch (77:54): [True: 1.70k, False: 10.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  265|  12.8k|        i4_nnz |= !!x;
  266|  12.8k|        x += *pu1_pred_ptr;
  267|  12.8k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  12.8k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  12.8k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.67k, False: 9.18k]
  |  |  |  |  |  Branch (77:54): [True: 1.05k, False: 8.13k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  268|  12.8k|        pu1_pred_ptr += pred_strd;
  269|  12.8k|        pi2_rsd_ptr += rsd_strd;
  270|  12.8k|        pu1_out += out_strd;
  271|       |
  272|  12.8k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  12.8k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  12.8k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 303, False: 12.5k]
  |  |  |  |  |  Branch (77:54): [True: 1.70k, False: 10.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  273|  12.8k|        i4_nnz |= !!x;
  274|  12.8k|        x += *pu1_pred_ptr;
  275|  12.8k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  12.8k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  12.8k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 3.43k, False: 9.43k]
  |  |  |  |  |  Branch (77:54): [True: 1.01k, False: 8.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  276|       |
  277|  12.8k|        pu1_out_ptr++;
  278|  12.8k|        pu1_pred++;
  279|  12.8k|        pi2_rsd++;
  280|  12.8k|    }
  281|  3.21k|    return i4_nnz;
  282|  3.21k|}
isvcd_iquant_itrans_residual_recon_chroma_4x4:
  311|  7.88k|{
  312|  7.88k|    WORD16 *pi2_src_ptr = pi2_src;
  313|  7.88k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  314|  7.88k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  315|  7.88k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  316|  7.88k|    UWORD8 *pu1_out_ptr = pu1_out;
  317|  7.88k|    WORD16 x0, x1, x2, x3, i;
  318|  7.88k|    WORD32 q0, q1, q2, q3;
  319|  7.88k|    WORD16 i_macro;
  320|  7.88k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (320:23): [True: 1.08k, False: 6.80k]
  ------------------
  321|       |
  322|       |    /* inverse quant */
  323|       |    /*horizontal inverse transform */
  324|  39.4k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  39.4k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (324:16): [True: 31.5k, False: 7.88k]
  ------------------
  325|  31.5k|    {
  326|  31.5k|        if(i == 0)
  ------------------
  |  Branch (326:12): [True: 7.88k, False: 23.6k]
  ------------------
  327|  7.88k|        {
  328|  7.88k|            q0 = pi2_dc_src[0];
  329|  7.88k|        }
  330|  23.6k|        else
  331|  23.6k|        {
  332|  23.6k|            q0 = pi2_src_ptr[0];
  333|  23.6k|            INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  23.6k|                {\
  |  |  104|  23.6k|                    i4_value *= quant_scale;\
  |  |  105|  23.6k|                    i4_value *= weight_scale;\
  |  |  106|  23.6k|                    i4_value += rndfactor;\
  |  |  107|  23.6k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  23.6k|                    i4_value >>= qbits;\
  |  |  109|  23.6k|                }
  ------------------
  334|  23.6k|        }
  335|       |
  336|  31.5k|        q2 = pi2_src_ptr[2];
  337|  31.5k|        INV_QUANT(q2, pu2_iscal_mat[2], pu2_weigh_mat[2], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  31.5k|                {\
  |  |  104|  31.5k|                    i4_value *= quant_scale;\
  |  |  105|  31.5k|                    i4_value *= weight_scale;\
  |  |  106|  31.5k|                    i4_value += rndfactor;\
  |  |  107|  31.5k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  31.5k|                    i4_value >>= qbits;\
  |  |  109|  31.5k|                }
  ------------------
  338|       |
  339|  31.5k|        x0 = q0 + q2;
  340|  31.5k|        x1 = q0 - q2;
  341|       |
  342|  31.5k|        q1 = pi2_src_ptr[1];
  343|  31.5k|        INV_QUANT(q1, pu2_iscal_mat[1], pu2_weigh_mat[1], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  31.5k|                {\
  |  |  104|  31.5k|                    i4_value *= quant_scale;\
  |  |  105|  31.5k|                    i4_value *= weight_scale;\
  |  |  106|  31.5k|                    i4_value += rndfactor;\
  |  |  107|  31.5k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  31.5k|                    i4_value >>= qbits;\
  |  |  109|  31.5k|                }
  ------------------
  344|       |
  345|  31.5k|        q3 = pi2_src_ptr[3];
  346|  31.5k|        INV_QUANT(q3, pu2_iscal_mat[3], pu2_weigh_mat[3], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  31.5k|                {\
  |  |  104|  31.5k|                    i4_value *= quant_scale;\
  |  |  105|  31.5k|                    i4_value *= weight_scale;\
  |  |  106|  31.5k|                    i4_value += rndfactor;\
  |  |  107|  31.5k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  31.5k|                    i4_value >>= qbits;\
  |  |  109|  31.5k|                }
  ------------------
  347|       |
  348|  31.5k|        x2 = (q1 >> 1) - q3;
  349|  31.5k|        x3 = q1 + (q3 >> 1);
  350|       |
  351|  31.5k|        pi2_tmp_ptr[0] = x0 + x3;
  352|  31.5k|        pi2_tmp_ptr[1] = x1 + x2;
  353|  31.5k|        pi2_tmp_ptr[2] = x1 - x2;
  354|  31.5k|        pi2_tmp_ptr[3] = x0 - x3;
  355|       |
  356|  31.5k|        pi2_src_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  31.5k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  357|  31.5k|        pi2_tmp_ptr += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  31.5k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  358|  31.5k|        pu2_iscal_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  31.5k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  359|  31.5k|        pu2_weigh_mat += SUB_BLK_WIDTH_4x4;
  ------------------
  |  |   48|  31.5k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  360|  31.5k|    }
  361|       |
  362|       |    /* vertical inverse transform */
  363|  7.88k|    pi2_tmp_ptr = pi2_tmp;
  364|  39.4k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|  39.4k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (364:16): [True: 31.5k, False: 7.88k]
  ------------------
  365|  31.5k|    {
  366|  31.5k|        pu1_pred_ptr = pu1_pred;
  367|  31.5k|        pi2_rsd_ptr = pi2_rsd;
  368|  31.5k|        pu1_out = pu1_out_ptr;
  369|       |
  370|  31.5k|        x0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[8]);
  371|  31.5k|        x1 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[8]);
  372|  31.5k|        x2 = (pi2_tmp_ptr[4] >> 1) - pi2_tmp_ptr[12];
  373|  31.5k|        x3 = pi2_tmp_ptr[4] + (pi2_tmp_ptr[12] >> 1);
  374|       |
  375|       |        /* inverse prediction */
  376|  31.5k|        i_macro = x0 + x3;
  377|  31.5k|        i_macro = ((i_macro + 32) >> 6);
  378|  31.5k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  31.5k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  31.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.57k, False: 29.9k]
  |  |  |  |  |  Branch (77:54): [True: 2.88k, False: 27.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  379|  31.5k|        i_macro += *pu1_pred_ptr;
  380|  31.5k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  31.5k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  31.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 10.3k, False: 21.1k]
  |  |  |  |  |  Branch (77:54): [True: 3.52k, False: 17.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  381|  31.5k|        pu1_pred_ptr += pred_strd;
  382|  31.5k|        pi2_rsd_ptr += rsd_strd;
  383|  31.5k|        pu1_out += out_strd;
  384|       |
  385|  31.5k|        i_macro = x1 + x2;
  386|  31.5k|        i_macro = ((i_macro + 32) >> 6);
  387|  31.5k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  31.5k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  31.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.40k, False: 29.1k]
  |  |  |  |  |  Branch (77:54): [True: 2.39k, False: 26.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  388|  31.5k|        i_macro += *pu1_pred_ptr;
  389|  31.5k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  31.5k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  31.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 11.0k, False: 20.4k]
  |  |  |  |  |  Branch (77:54): [True: 2.90k, False: 17.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  390|  31.5k|        pu1_pred_ptr += pred_strd;
  391|  31.5k|        pi2_rsd_ptr += rsd_strd;
  392|  31.5k|        pu1_out += out_strd;
  393|       |
  394|  31.5k|        i_macro = x1 - x2;
  395|  31.5k|        i_macro = ((i_macro + 32) >> 6);
  396|  31.5k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  31.5k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  31.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.62k, False: 29.9k]
  |  |  |  |  |  Branch (77:54): [True: 2.51k, False: 27.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  397|  31.5k|        i_macro += *pu1_pred_ptr;
  398|  31.5k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  31.5k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  31.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 8.79k, False: 22.7k]
  |  |  |  |  |  Branch (77:54): [True: 4.32k, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  399|  31.5k|        pu1_pred_ptr += pred_strd;
  400|  31.5k|        pi2_rsd_ptr += rsd_strd;
  401|  31.5k|        pu1_out += out_strd;
  402|       |
  403|  31.5k|        i_macro = x0 - x3;
  404|  31.5k|        i_macro = ((i_macro + 32) >> 6);
  405|  31.5k|        i_macro = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  31.5k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  31.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 1.76k, False: 29.7k]
  |  |  |  |  |  Branch (77:54): [True: 2.84k, False: 26.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  406|  31.5k|        i_macro += *pu1_pred_ptr;
  407|  31.5k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  31.5k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  31.5k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 8.05k, False: 23.4k]
  |  |  |  |  |  Branch (77:54): [True: 4.44k, False: 19.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  408|       |
  409|  31.5k|        pi2_tmp_ptr++;
  410|  31.5k|        pu1_out_ptr += 2;  // Interleaved store for output
  411|  31.5k|        pu1_pred += 2;     // Interleaved load for pred buffer
  412|  31.5k|        pi2_rsd += 2;
  413|  31.5k|    }
  414|  7.88k|}
isvcd_iquant_itrans_residual_recon_chroma_4x4_dc:
  443|  34.9k|{
  444|  34.9k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  445|  34.9k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  446|  34.9k|    UWORD8 *pu1_out_ptr = pu1_out;
  447|  34.9k|    WORD32 q0;
  448|  34.9k|    WORD16 x, i_macro, i;
  449|  34.9k|    UNUSED(pi2_src);
  ------------------
  |  |   45|  34.9k|#define UNUSED(x) ((void)(x))
  ------------------
  450|  34.9k|    UNUSED(pu2_iscal_mat);
  ------------------
  |  |   45|  34.9k|#define UNUSED(x) ((void)(x))
  ------------------
  451|  34.9k|    UNUSED(pu2_weigh_mat);
  ------------------
  |  |   45|  34.9k|#define UNUSED(x) ((void)(x))
  ------------------
  452|  34.9k|    UNUSED(u4_qp_div_6);
  ------------------
  |  |   45|  34.9k|#define UNUSED(x) ((void)(x))
  ------------------
  453|  34.9k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  34.9k|#define UNUSED(x) ((void)(x))
  ------------------
  454|       |
  455|  34.9k|    q0 = pi2_dc_src[0];  // Restoring dc value for intra case3
  456|  34.9k|    i_macro = ((q0 + 32) >> 6);
  457|       |
  458|   174k|    for(i = 0; i < SUB_BLK_WIDTH_4x4; i++)
  ------------------
  |  |   48|   174k|#define SUB_BLK_WIDTH_4x4                   4
  ------------------
  |  Branch (458:16): [True: 139k, False: 34.9k]
  ------------------
  459|   139k|    {
  460|   139k|        pu1_pred_ptr = pu1_pred;
  461|   139k|        pi2_rsd_ptr = pi2_rsd;
  462|   139k|        pu1_out = pu1_out_ptr;
  463|       |
  464|       |        /* inverse prediction */
  465|   139k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   139k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   139k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 706, False: 139k]
  |  |  |  |  |  Branch (77:54): [True: 2.20k, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  466|   139k|        x += *pu1_pred_ptr;
  467|   139k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   139k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   139k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 23.7k, False: 116k]
  |  |  |  |  |  Branch (77:54): [True: 3.74k, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  468|   139k|        pu1_pred_ptr += pred_strd;
  469|   139k|        pi2_rsd_ptr += rsd_strd;
  470|   139k|        pu1_out += out_strd;
  471|       |
  472|   139k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   139k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   139k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 691, False: 139k]
  |  |  |  |  |  Branch (77:54): [True: 2.20k, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  473|   139k|        x += *pu1_pred_ptr;
  474|   139k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   139k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   139k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 23.8k, False: 115k]
  |  |  |  |  |  Branch (77:54): [True: 3.75k, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  475|   139k|        pu1_pred_ptr += pred_strd;
  476|   139k|        pi2_rsd_ptr += rsd_strd;
  477|   139k|        pu1_out += out_strd;
  478|       |
  479|   139k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   139k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   139k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 695, False: 139k]
  |  |  |  |  |  Branch (77:54): [True: 2.20k, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  480|   139k|        x += *pu1_pred_ptr;
  481|   139k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   139k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   139k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 23.8k, False: 115k]
  |  |  |  |  |  Branch (77:54): [True: 3.75k, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  482|   139k|        pu1_pred_ptr += pred_strd;
  483|   139k|        pi2_rsd_ptr += rsd_strd;
  484|   139k|        pu1_out += out_strd;
  485|       |
  486|   139k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   139k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   139k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 697, False: 139k]
  |  |  |  |  |  Branch (77:54): [True: 2.20k, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|   139k|        x += *pu1_pred_ptr;
  488|   139k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|   139k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   139k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 23.7k, False: 115k]
  |  |  |  |  |  Branch (77:54): [True: 3.70k, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  489|       |
  490|   139k|        pu1_out_ptr += 2;
  491|   139k|        pu1_pred += 2;
  492|   139k|        pi2_rsd += 2;
  493|   139k|    }
  494|  34.9k|}
isvcd_iquant_itrans_residual_recon_8x8:
  525|  17.2k|{
  526|  17.2k|    WORD32 i4_nnz = 0, i4_nnz_H = 0, i4_nnz_L = 0;
  527|  17.2k|    WORD32 i;
  528|  17.2k|    WORD16 *pi2_tmp_ptr = pi2_tmp;
  529|  17.2k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  530|  17.2k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  531|  17.2k|    UWORD8 *pu1_out_ptr = pu1_out;
  532|  17.2k|    WORD16 i_z0, i_z1, i_z2, i_z3, i_z4, i_z5, i_z6, i_z7;
  533|  17.2k|    WORD16 i_y0, i_y1, i_y2, i_y3, i_y4, i_y5, i_y6, i_y7;
  534|  17.2k|    WORD16 i_macro;
  535|  17.2k|    WORD32 q;
  536|  17.2k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (536:23): [True: 13.0k, False: 4.17k]
  ------------------
  537|  17.2k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  17.2k|#define UNUSED(x) ((void)(x))
  ------------------
  538|  17.2k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  17.2k|#define UNUSED(x) ((void)(x))
  ------------------
  539|       |    /*************************************************************/
  540|       |    /* De quantization of coefficients. Will be replaced by SIMD */
  541|       |    /* operations on platform. Note : DC coeff is not scaled     */
  542|       |    /*************************************************************/
  543|  1.11M|    for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|  1.11M|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
                  for(i = 0; i < (SUB_BLK_WIDTH_8x8 * SUB_BLK_WIDTH_8x8); i++)
  ------------------
  |  |   53|  1.11M|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (543:16): [True: 1.10M, False: 17.2k]
  ------------------
  544|  1.10M|    {
  545|  1.10M|        q = pi2_src[i];
  546|  1.10M|        INV_QUANT(q, pu2_iscale_mat[i], pu2_weigh_mat[i], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  1.10M|                {\
  |  |  104|  1.10M|                    i4_value *= quant_scale;\
  |  |  105|  1.10M|                    i4_value *= weight_scale;\
  |  |  106|  1.10M|                    i4_value += rndfactor;\
  |  |  107|  1.10M|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  1.10M|                    i4_value >>= qbits;\
  |  |  109|  1.10M|                }
  ------------------
  547|  1.10M|        pi2_tmp_ptr[i] = q;
  548|  1.10M|    }
  549|       |    /* Perform Inverse transform */
  550|       |    /*--------------------------------------------------------------------*/
  551|       |    /* IDCT [ Horizontal transformation ]                                 */
  552|       |    /*--------------------------------------------------------------------*/
  553|   154k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   154k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (553:16): [True: 137k, False: 17.2k]
  ------------------
  554|   137k|    {
  555|       |        /*------------------------------------------------------------------*/
  556|       |        /* y0 = w0 + w4                                                     */
  557|       |        /* y1 = -w3 + w5 - w7 - (w7 >> 1)                                   */
  558|       |        /* y2 = w0 - w4                                                     */
  559|       |        /* y3 = w1 + w7 - w3 - (w3 >> 1)                                    */
  560|       |        /* y4 = (w2 >> 1) - w6                                              */
  561|       |        /* y5 = -w1 + w7 + w5 + (w5 >> 1)                                   */
  562|       |        /* y6 = w2 + (w6 >> 1)                                              */
  563|       |        /* y7 = w3 + w5 + w1 + (w1 >> 1)                                    */
  564|       |        /*------------------------------------------------------------------*/
  565|   137k|        i_y0 = (pi2_tmp_ptr[0] + pi2_tmp_ptr[4]);
  566|       |
  567|   137k|        i_y1 =
  568|   137k|            ((WORD32) (-pi2_tmp_ptr[3]) + pi2_tmp_ptr[5] - pi2_tmp_ptr[7] - (pi2_tmp_ptr[7] >> 1));
  569|       |
  570|   137k|        i_y2 = (pi2_tmp_ptr[0] - pi2_tmp_ptr[4]);
  571|       |
  572|   137k|        i_y3 = ((WORD32) pi2_tmp_ptr[1] + pi2_tmp_ptr[7] - pi2_tmp_ptr[3] - (pi2_tmp_ptr[3] >> 1));
  573|       |
  574|   137k|        i_y4 = ((pi2_tmp_ptr[2] >> 1) - pi2_tmp_ptr[6]);
  575|       |
  576|   137k|        i_y5 =
  577|   137k|            ((WORD32) (-pi2_tmp_ptr[1]) + pi2_tmp_ptr[7] + pi2_tmp_ptr[5] + (pi2_tmp_ptr[5] >> 1));
  578|       |
  579|   137k|        i_y6 = (pi2_tmp_ptr[2] + (pi2_tmp_ptr[6] >> 1));
  580|       |
  581|   137k|        i_y7 = ((WORD32) pi2_tmp_ptr[3] + pi2_tmp_ptr[5] + pi2_tmp_ptr[1] + (pi2_tmp_ptr[1] >> 1));
  582|       |
  583|       |        /*------------------------------------------------------------------*/
  584|       |        /* z0 = y0 + y6                                                     */
  585|       |        /* z1 = y1 + (y7 >> 2)                                              */
  586|       |        /* z2 = y2 + y4                                                     */
  587|       |        /* z3 = y3 + (y5 >> 2)                                              */
  588|       |        /* z4 = y2 - y4                                                     */
  589|       |        /* z5 = (y3 >> 2) - y5                                              */
  590|       |        /* z6 = y0 - y6                                                     */
  591|       |        /* z7 = y7 - (y1 >> 2)                                              */
  592|       |        /*------------------------------------------------------------------*/
  593|   137k|        i_z0 = i_y0 + i_y6;
  594|   137k|        i_z1 = i_y1 + (i_y7 >> 2);
  595|   137k|        i_z2 = i_y2 + i_y4;
  596|   137k|        i_z3 = i_y3 + (i_y5 >> 2);
  597|   137k|        i_z4 = i_y2 - i_y4;
  598|   137k|        i_z5 = (i_y3 >> 2) - i_y5;
  599|   137k|        i_z6 = i_y0 - i_y6;
  600|   137k|        i_z7 = i_y7 - (i_y1 >> 2);
  601|       |
  602|       |        /*------------------------------------------------------------------*/
  603|       |        /* x0 = z0 + z7                                                     */
  604|       |        /* x1 = z2 + z5                                                     */
  605|       |        /* x2 = z4 + z3                                                     */
  606|       |        /* x3 = z6 + z1                                                     */
  607|       |        /* x4 = z6 - z1                                                     */
  608|       |        /* x5 = z4 - z3                                                     */
  609|       |        /* x6 = z2 - z5                                                     */
  610|       |        /* x7 = z0 - z7                                                     */
  611|       |        /*------------------------------------------------------------------*/
  612|   137k|        pi2_tmp_ptr[0] = i_z0 + i_z7;
  613|   137k|        pi2_tmp_ptr[1] = i_z2 + i_z5;
  614|   137k|        pi2_tmp_ptr[2] = i_z4 + i_z3;
  615|   137k|        pi2_tmp_ptr[3] = i_z6 + i_z1;
  616|   137k|        pi2_tmp_ptr[4] = i_z6 - i_z1;
  617|   137k|        pi2_tmp_ptr[5] = i_z4 - i_z3;
  618|   137k|        pi2_tmp_ptr[6] = i_z2 - i_z5;
  619|   137k|        pi2_tmp_ptr[7] = i_z0 - i_z7;
  620|       |
  621|       |        /* move to the next row */
  622|   137k|        pi2_tmp_ptr += SUB_BLK_WIDTH_8x8;
  ------------------
  |  |   53|   137k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  623|   137k|    }
  624|       |    /*--------------------------------------------------------------------*/
  625|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6            */
  626|       |    /*                                                                    */
  627|       |    /* Add the prediction and store it back to reconstructed frame buffer */
  628|       |    /* [Prediction buffer itself in this case]                            */
  629|       |    /*--------------------------------------------------------------------*/
  630|       |
  631|  17.2k|    pi2_tmp_ptr = pi2_tmp;
  632|   154k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|   154k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (632:16): [True: 137k, False: 17.2k]
  ------------------
  633|   137k|    {
  634|   137k|        pu1_pred_ptr = pu1_pred;
  635|   137k|        pi2_rsd_ptr = pi2_rsd;
  636|   137k|        pu1_out = pu1_out_ptr;
  637|       |        /*------------------------------------------------------------------*/
  638|       |        /* y0j = w0j + w4j                                                  */
  639|       |        /* y1j = -w3j + w5j -w7j -(w7j >> 1)                                */
  640|       |        /* y2j = w0j -w4j                                                   */
  641|       |        /* y3j = w1j + w7j -w3j -(w3j >> 1)                                 */
  642|       |        /* y4j = ( w2j >> 1 ) -w6j                                          */
  643|       |        /* y5j = -w1j + w7j + w5j + (w5j >> 1)                              */
  644|       |        /* y6j = w2j + ( w6j >> 1 )                                         */
  645|       |        /* y7j = w3j + w5j + w1j + (w1j >> 1)                               */
  646|       |        /*------------------------------------------------------------------*/
  647|   137k|        i_y0 = pi2_tmp_ptr[0] + pi2_tmp_ptr[32];
  648|       |
  649|   137k|        i_y1 = (WORD32) (-pi2_tmp_ptr[24]) + pi2_tmp_ptr[40] - pi2_tmp_ptr[56] -
  650|   137k|               (pi2_tmp_ptr[56] >> 1);
  651|       |
  652|   137k|        i_y2 = pi2_tmp_ptr[0] - pi2_tmp_ptr[32];
  653|       |
  654|   137k|        i_y3 = (WORD32) pi2_tmp_ptr[8] + pi2_tmp_ptr[56] - pi2_tmp_ptr[24] - (pi2_tmp_ptr[24] >> 1);
  655|       |
  656|   137k|        i_y4 = (pi2_tmp_ptr[16] >> 1) - pi2_tmp_ptr[48];
  657|       |
  658|   137k|        i_y5 =
  659|   137k|            (WORD32) (-pi2_tmp_ptr[8]) + pi2_tmp_ptr[56] + pi2_tmp_ptr[40] + (pi2_tmp_ptr[40] >> 1);
  660|       |
  661|   137k|        i_y6 = pi2_tmp_ptr[16] + (pi2_tmp_ptr[48] >> 1);
  662|       |
  663|   137k|        i_y7 = (WORD32) pi2_tmp_ptr[24] + pi2_tmp_ptr[40] + pi2_tmp_ptr[8] + (pi2_tmp_ptr[8] >> 1);
  664|       |
  665|       |        /*------------------------------------------------------------------*/
  666|       |        /* z0j = y0j + y6j                                                  */
  667|       |        /* z1j = y1j + (y7j >> 2)                                           */
  668|       |        /* z2j = y2j + y4j                                                  */
  669|       |        /* z3j = y3j + (y5j >> 2)                                           */
  670|       |        /* z4j = y2j -y4j                                                   */
  671|       |        /* z5j = (y3j >> 2) -y5j                                            */
  672|       |        /* z6j = y0j -y6j                                                   */
  673|       |        /* z7j = y7j -(y1j >> 2)                                            */
  674|       |        /*------------------------------------------------------------------*/
  675|   137k|        i_z0 = i_y0 + i_y6;
  676|   137k|        i_z1 = i_y1 + (i_y7 >> 2);
  677|   137k|        i_z2 = i_y2 + i_y4;
  678|   137k|        i_z3 = i_y3 + (i_y5 >> 2);
  679|   137k|        i_z4 = i_y2 - i_y4;
  680|   137k|        i_z5 = (i_y3 >> 2) - i_y5;
  681|   137k|        i_z6 = i_y0 - i_y6;
  682|   137k|        i_z7 = i_y7 - (i_y1 >> 2);
  683|       |
  684|       |        /*------------------------------------------------------------------*/
  685|       |        /* x0j = z0j + z7j                                                  */
  686|       |        /* x1j = z2j + z5j                                                  */
  687|       |        /* x2j = z4j + z3j                                                  */
  688|       |        /* x3j = z6j + z1j                                                  */
  689|       |        /* x4j = z6j -z1j                                                   */
  690|       |        /* x5j = z4j -z3j                                                   */
  691|       |        /* x6j = z2j -z5j                                                   */
  692|       |        /* x7j = z0j -z7j                                                   */
  693|       |        /*------------------------------------------------------------------*/
  694|   137k|        i_macro = CLIP_RSD(((i_z0 + i_z7 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   137k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 768, False: 136k]
  |  |  |  |  |  Branch (77:54): [True: 1.02k, False: 135k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  695|   137k|        i4_nnz_H |= !!i_macro;
  696|   137k|        i_macro += *pu1_pred_ptr;
  697|   137k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   137k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 21.2k, False: 116k]
  |  |  |  |  |  Branch (77:54): [True: 2.31k, False: 114k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  698|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  699|   137k|        pu1_pred_ptr += pred_strd;
  700|   137k|        pi2_rsd_ptr += rsd_strd;
  701|   137k|        pu1_out += out_strd;
  702|       |
  703|   137k|        i_macro = CLIP_RSD(((i_z2 + i_z5 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   137k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 424, False: 137k]
  |  |  |  |  |  Branch (77:54): [True: 512, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  704|   137k|        i4_nnz_H |= !!i_macro;
  705|   137k|        i_macro += *pu1_pred_ptr;
  706|   137k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   137k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 25.5k, False: 112k]
  |  |  |  |  |  Branch (77:54): [True: 2.26k, False: 109k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  707|   137k|        pu1_pred_ptr += pred_strd;
  708|   137k|        pi2_rsd_ptr += rsd_strd;
  709|   137k|        pu1_out += out_strd;
  710|       |
  711|   137k|        i_macro = CLIP_RSD(((i_z4 + i_z3 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   137k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 590, False: 137k]
  |  |  |  |  |  Branch (77:54): [True: 412, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  712|   137k|        i4_nnz_H |= !!i_macro;
  713|   137k|        i_macro += *pu1_pred_ptr;
  714|   137k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   137k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 29.4k, False: 108k]
  |  |  |  |  |  Branch (77:54): [True: 2.28k, False: 105k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  715|   137k|        pu1_pred_ptr += pred_strd;
  716|   137k|        pi2_rsd_ptr += rsd_strd;
  717|   137k|        pu1_out += out_strd;
  718|       |
  719|   137k|        i_macro = CLIP_RSD(((i_z6 + i_z1 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   137k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 693, False: 136k]
  |  |  |  |  |  Branch (77:54): [True: 949, False: 135k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  720|   137k|        i4_nnz_H |= !!i_macro;
  721|   137k|        i_macro += *pu1_pred_ptr;
  722|   137k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   137k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 32.8k, False: 104k]
  |  |  |  |  |  Branch (77:54): [True: 2.12k, False: 102k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  723|   137k|        pu1_pred_ptr += pred_strd;
  724|   137k|        pi2_rsd_ptr += rsd_strd;
  725|   137k|        pu1_out += out_strd;
  726|       |
  727|   137k|        i_macro = CLIP_RSD(((i_z6 - i_z1 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   137k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 646, False: 136k]
  |  |  |  |  |  Branch (77:54): [True: 1.03k, False: 135k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  728|   137k|        i4_nnz_L |= !!i_macro;
  729|   137k|        i_macro += *pu1_pred_ptr;
  730|   137k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   137k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 34.4k, False: 103k]
  |  |  |  |  |  Branch (77:54): [True: 2.30k, False: 100k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  731|   137k|        pu1_pred_ptr += pred_strd;
  732|   137k|        pi2_rsd_ptr += rsd_strd;
  733|   137k|        pu1_out += out_strd;
  734|       |
  735|   137k|        i_macro = CLIP_RSD(((i_z4 - i_z3 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   137k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 441, False: 137k]
  |  |  |  |  |  Branch (77:54): [True: 484, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  736|   137k|        i4_nnz_L |= !!i_macro;
  737|   137k|        i_macro += *pu1_pred_ptr;
  738|   137k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   137k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 28.0k, False: 109k]
  |  |  |  |  |  Branch (77:54): [True: 2.58k, False: 107k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  739|   137k|        pu1_pred_ptr += pred_strd;
  740|   137k|        pi2_rsd_ptr += rsd_strd;
  741|   137k|        pu1_out += out_strd;
  742|       |
  743|   137k|        i_macro = CLIP_RSD(((i_z2 - i_z5 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   137k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 414, False: 137k]
  |  |  |  |  |  Branch (77:54): [True: 629, False: 136k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  744|   137k|        i4_nnz_L |= !!i_macro;
  745|   137k|        i_macro += *pu1_pred_ptr;
  746|   137k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   137k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 26.2k, False: 111k]
  |  |  |  |  |  Branch (77:54): [True: 2.63k, False: 108k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  747|   137k|        pu1_pred_ptr += pred_strd;
  748|   137k|        pi2_rsd_ptr += rsd_strd;
  749|   137k|        pu1_out += out_strd;
  750|       |
  751|   137k|        i_macro = CLIP_RSD(((i_z0 - i_z7 + 32) >> 6) + (*pi2_rsd_ptr));
  ------------------
  |  |  774|   137k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 879, False: 136k]
  |  |  |  |  |  Branch (77:54): [True: 920, False: 135k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  752|   137k|        i4_nnz_L |= !!i_macro;
  753|   137k|        i_macro += *pu1_pred_ptr;
  754|   137k|        *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   137k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   137k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 22.4k, False: 115k]
  |  |  |  |  |  Branch (77:54): [True: 2.43k, False: 112k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  755|       |
  756|   137k|        pi2_tmp_ptr++;
  757|   137k|        pu1_out_ptr++;
  758|   137k|        pi2_rsd++;
  759|   137k|        pu1_pred++;
  760|   137k|        if(i == 3)
  ------------------
  |  Branch (760:12): [True: 17.2k, False: 120k]
  ------------------
  761|  17.2k|        {
  762|  17.2k|            i4_nnz = i4_nnz_H | (i4_nnz_L << 4);
  763|  17.2k|            i4_nnz_L = 0;
  764|  17.2k|            i4_nnz_H = 0;
  765|  17.2k|        }
  766|   137k|    }
  767|  17.2k|    i4_nnz |= (i4_nnz_H << 1) | (i4_nnz_L << 5);
  768|  17.2k|    return i4_nnz;
  769|  17.2k|}
isvcd_iquant_itrans_residual_recon_8x8_dc:
  800|  1.62k|{
  801|  1.62k|    WORD32 i4_nnz = 0, i4_nnz_H = 0, i4_nnz_L = 0;
  802|  1.62k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  803|  1.62k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  804|  1.62k|    UWORD8 *pu1_out_ptr = pu1_out;
  805|  1.62k|    WORD16 x, i, i_macro;
  806|  1.62k|    WORD32 q;
  807|  1.62k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (807:23): [True: 899, False: 726]
  ------------------
  808|  1.62k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  1.62k|#define UNUSED(x) ((void)(x))
  ------------------
  809|  1.62k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  1.62k|#define UNUSED(x) ((void)(x))
  ------------------
  810|  1.62k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  1.62k|#define UNUSED(x) ((void)(x))
  ------------------
  811|       |    /*************************************************************/
  812|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
  813|       |    /* operations on platform. Note : DC coeff is not scaled     */
  814|       |    /*************************************************************/
  815|  1.62k|    q = pi2_src[0];
  816|  1.62k|    INV_QUANT(q, pu2_iscale_mat[0], pu2_weigh_mat[0], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  1.62k|                {\
  |  |  104|  1.62k|                    i4_value *= quant_scale;\
  |  |  105|  1.62k|                    i4_value *= weight_scale;\
  |  |  106|  1.62k|                    i4_value += rndfactor;\
  |  |  107|  1.62k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  1.62k|                    i4_value >>= qbits;\
  |  |  109|  1.62k|                }
  ------------------
  817|  1.62k|    i_macro = (q + 32) >> 6;
  818|       |    /* Perform Inverse transform */
  819|       |    /*--------------------------------------------------------------------*/
  820|       |    /* IDCT [ Horizontal transformation ]                                 */
  821|       |    /*--------------------------------------------------------------------*/
  822|       |    /*--------------------------------------------------------------------*/
  823|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6            */
  824|       |    /*                                                                    */
  825|       |    /* Add the prediction and store it back to reconstructed frame buffer */
  826|       |    /* [Prediction buffer itself in this case]                            */
  827|       |    /*--------------------------------------------------------------------*/
  828|  14.6k|    for(i = 0; i < SUB_BLK_WIDTH_8x8; i++)
  ------------------
  |  |   53|  14.6k|#define SUB_BLK_WIDTH_8x8                   8
  ------------------
  |  Branch (828:16): [True: 13.0k, False: 1.62k]
  ------------------
  829|  13.0k|    {
  830|  13.0k|        pu1_pred_ptr = pu1_pred;
  831|  13.0k|        pi2_rsd_ptr = pi2_rsd;
  832|  13.0k|        pu1_out = pu1_out_ptr;
  833|       |
  834|  13.0k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  13.0k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 324, False: 12.6k]
  |  |  |  |  |  Branch (77:54): [True: 460, False: 12.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  835|  13.0k|        i4_nnz_H |= !!x;
  836|  13.0k|        x += *pu1_pred_ptr;
  837|  13.0k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  13.0k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.94k, False: 10.0k]
  |  |  |  |  |  Branch (77:54): [True: 770, False: 9.28k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  838|       |        /* Change uc_recBuffer to Point to next element in the same column*/
  839|  13.0k|        pu1_pred_ptr += pred_strd;
  840|  13.0k|        pi2_rsd_ptr += rsd_strd;
  841|  13.0k|        pu1_out += out_strd;
  842|       |
  843|  13.0k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  13.0k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 315, False: 12.6k]
  |  |  |  |  |  Branch (77:54): [True: 434, False: 12.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  844|  13.0k|        i4_nnz_H |= !!x;
  845|  13.0k|        x += *pu1_pred_ptr;
  846|  13.0k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  13.0k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.85k, False: 10.1k]
  |  |  |  |  |  Branch (77:54): [True: 952, False: 9.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  847|  13.0k|        pu1_pred_ptr += pred_strd;
  848|  13.0k|        pi2_rsd_ptr += rsd_strd;
  849|  13.0k|        pu1_out += out_strd;
  850|       |
  851|  13.0k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  13.0k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 316, False: 12.6k]
  |  |  |  |  |  Branch (77:54): [True: 451, False: 12.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  852|  13.0k|        i4_nnz_H |= !!x;
  853|  13.0k|        x += *pu1_pred_ptr;
  854|  13.0k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  13.0k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.84k, False: 10.1k]
  |  |  |  |  |  Branch (77:54): [True: 1.16k, False: 8.98k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  855|  13.0k|        pu1_pred_ptr += pred_strd;
  856|  13.0k|        pi2_rsd_ptr += rsd_strd;
  857|  13.0k|        pu1_out += out_strd;
  858|       |
  859|  13.0k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  13.0k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 312, False: 12.6k]
  |  |  |  |  |  Branch (77:54): [True: 486, False: 12.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  860|  13.0k|        i4_nnz_H |= !!x;
  861|  13.0k|        x += *pu1_pred_ptr;
  862|  13.0k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  13.0k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.87k, False: 10.1k]
  |  |  |  |  |  Branch (77:54): [True: 1.12k, False: 9.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  863|  13.0k|        pu1_pred_ptr += pred_strd;
  864|  13.0k|        pi2_rsd_ptr += rsd_strd;
  865|  13.0k|        pu1_out += out_strd;
  866|       |
  867|  13.0k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  13.0k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 309, False: 12.6k]
  |  |  |  |  |  Branch (77:54): [True: 447, False: 12.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  868|  13.0k|        i4_nnz_L |= !!x;
  869|  13.0k|        x += *pu1_pred_ptr;
  870|  13.0k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  13.0k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.88k, False: 10.1k]
  |  |  |  |  |  Branch (77:54): [True: 899, False: 9.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  871|  13.0k|        pu1_pred_ptr += pred_strd;
  872|  13.0k|        pi2_rsd_ptr += rsd_strd;
  873|  13.0k|        pu1_out += out_strd;
  874|       |
  875|  13.0k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  13.0k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 310, False: 12.6k]
  |  |  |  |  |  Branch (77:54): [True: 479, False: 12.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  876|  13.0k|        i4_nnz_L |= !!x;
  877|  13.0k|        x += *pu1_pred_ptr;
  878|  13.0k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  13.0k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.95k, False: 10.0k]
  |  |  |  |  |  Branch (77:54): [True: 761, False: 9.28k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  879|  13.0k|        pu1_pred_ptr += pred_strd;
  880|  13.0k|        pi2_rsd_ptr += rsd_strd;
  881|  13.0k|        pu1_out += out_strd;
  882|       |
  883|  13.0k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  13.0k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 312, False: 12.6k]
  |  |  |  |  |  Branch (77:54): [True: 474, False: 12.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  884|  13.0k|        i4_nnz_L |= !!x;
  885|  13.0k|        x += *pu1_pred_ptr;
  886|  13.0k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  13.0k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.88k, False: 10.1k]
  |  |  |  |  |  Branch (77:54): [True: 701, False: 9.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  887|  13.0k|        pu1_pred_ptr += pred_strd;
  888|  13.0k|        pi2_rsd_ptr += rsd_strd;
  889|  13.0k|        pu1_out += out_strd;
  890|       |
  891|  13.0k|        x = CLIP_RSD(i_macro + (*pi2_rsd_ptr));
  ------------------
  |  |  774|  13.0k|#define CLIP_RSD(x) CLIP3(RSD_MIN, RSD_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 307, False: 12.6k]
  |  |  |  |  |  Branch (77:54): [True: 418, False: 12.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  892|  13.0k|        i4_nnz_L |= !!x;
  893|  13.0k|        x += *pu1_pred_ptr;
  894|  13.0k|        *pu1_out = CLIP_U8(x);
  ------------------
  |  |   58|  13.0k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  13.0k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 2.87k, False: 10.1k]
  |  |  |  |  |  Branch (77:54): [True: 539, False: 9.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  895|       |
  896|  13.0k|        pu1_out_ptr++;
  897|  13.0k|        pu1_pred++;
  898|  13.0k|        pi2_rsd++;
  899|  13.0k|        if(i == 3)
  ------------------
  |  Branch (899:12): [True: 1.62k, False: 11.3k]
  ------------------
  900|  1.62k|        {
  901|  1.62k|            i4_nnz = i4_nnz_H | (i4_nnz_L << 4);
  902|  1.62k|            i4_nnz_L = 0;
  903|  1.62k|            i4_nnz_H = 0;
  904|  1.62k|        }
  905|  13.0k|    }
  906|  1.62k|    i4_nnz |= (i4_nnz_H << 1) | (i4_nnz_L << 5);
  907|  1.62k|    return i4_nnz;
  908|  1.62k|}

isvcd_get_mb_info_cabac_nonmbaff:
   91|  1.75M|{
   92|  1.75M|    WORD32 mb_x;
   93|  1.75M|    WORD32 mb_y;
   94|  1.75M|    UWORD32 u1_mb_ngbr_avail = 0;
   95|  1.75M|    UWORD32 u2_frm_width_in_mb = ps_dec->u2_frm_wd_in_mbs;
   96|  1.75M|    UWORD32 u1_top_mb = 1;
   97|  1.75M|    WORD32 i2_prev_slice_mbx = ps_dec->i2_prev_slice_mbx;
   98|  1.75M|    UWORD32 u2_top_right_mask = TOP_RIGHT_DEFAULT_AVAILABLE;
  ------------------
  |  |   60|  1.75M|#define TOP_RIGHT_DEFAULT_AVAILABLE            0x5750
  ------------------
   99|  1.75M|    UWORD32 u2_top_left_mask = TOP_LEFT_DEFAULT_AVAILABLE;
  ------------------
  |  |   64|  1.75M|#define TOP_LEFT_DEFAULT_AVAILABLE            0xEEE0
  ------------------
  100|  1.75M|    ctxt_inc_mb_info_t *const p_ctx_inc_mb_map = ps_dec->p_ctxt_inc_mb_map;
  101|       |
  102|       |    /*--------------------------------------------------------------------*/
  103|       |    /* Calculate values of mb_x and mb_y                                  */
  104|       |    /*--------------------------------------------------------------------*/
  105|  1.75M|    mb_x = (WORD16) ps_dec->u2_mbx;
  106|  1.75M|    mb_y = (WORD16) ps_dec->u2_mby;
  107|  1.75M|    ps_dec->u4_cur_mb_addr = u2_cur_mb_address;
  108|       |
  109|  1.75M|    mb_x++;
  110|  1.75M|    if((UWORD32) mb_x == u2_frm_width_in_mb)
  ------------------
  |  Branch (110:8): [True: 134k, False: 1.62M]
  ------------------
  111|   134k|    {
  112|   134k|        mb_x = 0;
  113|   134k|        mb_y++;
  114|   134k|        if(mb_y >= ps_dec->u2_frm_ht_in_mbs)
  ------------------
  |  Branch (114:12): [True: 0, False: 134k]
  ------------------
  115|      0|        {
  116|      0|            mb_y = ps_dec->u2_frm_ht_in_mbs - 1;
  117|      0|        }
  118|   134k|    }
  119|       |    /*********************************************************************/
  120|       |    /* Cabac Context Initialisations                                     */
  121|       |    /*********************************************************************/
  122|  1.75M|    ps_dec->ps_curr_ctxt_mb_info = p_ctx_inc_mb_map + mb_x;
  123|  1.75M|    ps_dec->p_left_ctxt_mb_info = p_ctx_inc_mb_map - 1;
  124|  1.75M|    ps_dec->p_top_ctxt_mb_info = p_ctx_inc_mb_map - 1;
  125|       |
  126|       |    /********************************************************************/
  127|       |    /* neighbour availablility                                          */
  128|       |    /********************************************************************/
  129|  1.75M|    if(mb_y > ps_dec->i2_prev_slice_mby)
  ------------------
  |  Branch (129:8): [True: 1.58M, False: 176k]
  ------------------
  130|  1.58M|    {
  131|       |        /* if not in the immemdiate row of prev slice end then top will be available */
  132|  1.58M|        if(mb_y > (ps_dec->i2_prev_slice_mby + 1)) i2_prev_slice_mbx = -1;
  ------------------
  |  Branch (132:12): [True: 1.42M, False: 161k]
  ------------------
  133|       |
  134|  1.58M|        if(mb_x > i2_prev_slice_mbx)
  ------------------
  |  Branch (134:12): [True: 1.57M, False: 9.53k]
  ------------------
  135|  1.57M|        {
  136|  1.57M|            u1_mb_ngbr_avail |= TOP_MB_AVAILABLE_MASK;
  ------------------
  |  |   55|  1.57M|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  137|  1.57M|            u2_top_right_mask |= TOP_RIGHT_TOP_AVAILABLE;
  ------------------
  |  |   62|  1.57M|#define TOP_RIGHT_TOP_AVAILABLE                0x0007
  ------------------
  138|  1.57M|            u2_top_left_mask |= TOP_LEFT_TOP_AVAILABLE;
  ------------------
  |  |   66|  1.57M|#define TOP_LEFT_TOP_AVAILABLE                0x000E
  ------------------
  139|  1.57M|            ps_dec->p_top_ctxt_mb_info = ps_dec->ps_curr_ctxt_mb_info;
  140|  1.57M|        }
  141|  1.58M|        if((mb_x > (i2_prev_slice_mbx - 1)) && ((UWORD32) mb_x != (u2_frm_width_in_mb - 1)))
  ------------------
  |  Branch (141:12): [True: 1.57M, False: 7.43k]
  |  Branch (141:48): [True: 1.44M, False: 126k]
  ------------------
  142|  1.44M|        {
  143|  1.44M|            u1_mb_ngbr_avail |= TOP_RIGHT_MB_AVAILABLE_MASK;
  ------------------
  |  |   56|  1.44M|#define TOP_RIGHT_MB_AVAILABLE_MASK 0x08
  ------------------
  144|  1.44M|            u2_top_right_mask |= TOP_RIGHT_TOPR_AVAILABLE;
  ------------------
  |  |   61|  1.44M|#define TOP_RIGHT_TOPR_AVAILABLE               0x0008
  ------------------
  145|  1.44M|        }
  146|       |
  147|  1.58M|        if(mb_x > (i2_prev_slice_mbx + 1))
  ------------------
  |  Branch (147:12): [True: 1.43M, False: 143k]
  ------------------
  148|  1.43M|        {
  149|  1.43M|            u1_mb_ngbr_avail |= TOP_LEFT_MB_AVAILABLE_MASK;
  ------------------
  |  |   54|  1.43M|#define TOP_LEFT_MB_AVAILABLE_MASK  0x02
  ------------------
  150|  1.43M|            u2_top_left_mask |= TOP_LEFT_TOPL_AVAILABLE;
  ------------------
  |  |   65|  1.43M|#define TOP_LEFT_TOPL_AVAILABLE               0x0001
  ------------------
  151|  1.43M|        }
  152|       |        /* Next row */
  153|  1.58M|        i2_prev_slice_mbx = -1;
  154|  1.58M|    }
  155|       |    /* Same row */
  156|  1.75M|    if(mb_x > (i2_prev_slice_mbx + 1))
  ------------------
  |  Branch (156:8): [True: 1.59M, False: 159k]
  ------------------
  157|  1.59M|    {
  158|  1.59M|        u1_mb_ngbr_avail |= LEFT_MB_AVAILABLE_MASK;
  ------------------
  |  |   53|  1.59M|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  159|  1.59M|        u2_top_left_mask |= TOP_LEFT_LEFT_AVAILABLE;
  ------------------
  |  |   67|  1.59M|#define TOP_LEFT_LEFT_AVAILABLE               0x1110
  ------------------
  160|  1.59M|        ps_dec->p_left_ctxt_mb_info = ps_dec->ps_curr_ctxt_mb_info - 1;
  161|  1.59M|    }
  162|  1.75M|    {
  163|  1.75M|        mb_neigbour_params_t *ps_cur_mb_row = ps_dec->ps_cur_mb_row;
  164|  1.75M|        mb_neigbour_params_t *ps_top_mb_row = ps_dec->ps_top_mb_row;
  165|       |        /* copy the parameters of topleft Mb */
  166|  1.75M|        ps_cur_mb_info->u1_topleft_mbtype = ps_dec->u1_topleft_mbtype;
  167|       |        /* Neighbour pointer assignments*/
  168|  1.75M|        ps_cur_mb_info->ps_curmb = ps_cur_mb_row + mb_x;
  169|  1.75M|        ps_cur_mb_info->ps_left_mb = ps_cur_mb_row + mb_x - 1;
  170|  1.75M|        ps_cur_mb_info->ps_top_mb = ps_top_mb_row + mb_x;
  171|  1.75M|        ps_cur_mb_info->ps_top_right_mb = ps_top_mb_row + mb_x + 1;
  172|       |
  173|       |        /* Update the parameters of topleftmb*/
  174|  1.75M|        ps_dec->u1_topleft_mbtype = ps_cur_mb_info->ps_top_mb->u1_mb_type;
  175|  1.75M|    }
  176|       |
  177|  1.75M|    ps_dec->u2_mby = mb_y;
  178|  1.75M|    ps_dec->u2_mbx = mb_x;
  179|  1.75M|    ps_cur_mb_info->u2_mbx = mb_x;
  180|  1.75M|    ps_cur_mb_info->u2_mby = mb_y;
  181|  1.75M|    ps_cur_mb_info->u1_topmb = u1_top_mb;
  182|  1.75M|    ps_dec->i4_submb_ofst += SUB_BLK_SIZE;
  ------------------
  |  |  562|  1.75M|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  1.75M|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  1.75M|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
  183|  1.75M|    ps_dec->u1_mb_ngbr_availablity = u1_mb_ngbr_avail;
  184|  1.75M|    ps_cur_mb_info->u1_mb_ngbr_availablity = u1_mb_ngbr_avail;
  185|  1.75M|    ps_cur_mb_info->ps_curmb->u1_mb_fld = ps_dec->u1_cur_mb_fld_dec_flag;
  186|  1.75M|    ps_cur_mb_info->u1_mb_field_decodingflag = ps_dec->u1_cur_mb_fld_dec_flag;
  187|  1.75M|    ps_cur_mb_info->u2_top_left_avail_mask = u2_top_left_mask;
  188|  1.75M|    ps_cur_mb_info->u2_top_right_avail_mask = u2_top_right_mask;
  189|       |
  190|       |    /*********************************************************************/
  191|       |    /*                  Assign the neigbours                             */
  192|       |    /*********************************************************************/
  193|  1.75M|    if(u4_mbskip)
  ------------------
  |  Branch (193:8): [True: 1.66M, False: 92.2k]
  ------------------
  194|  1.66M|    {
  195|  1.66M|        UWORD8 u1_a, u1_b;
  196|  1.66M|        UWORD32 u4_ctx_inc;
  197|       |
  198|  1.66M|        u1_a = (ps_dec->p_top_ctxt_mb_info->u1_mb_type != CAB_INFERRED)
  ------------------
  |  |   74|  1.66M|#define CAB_INFERRED 0xFF
  ------------------
  |  Branch (198:16): [True: 1.65M, False: 15.5k]
  ------------------
  199|  1.66M|                   ? (!!(ps_dec->p_top_ctxt_mb_info->u1_mb_type & CAB_SKIP_MASK))
  ------------------
  |  |  401|  1.65M|#define CAB_SKIP_MASK     0x10 /* 0001 0000 */
  ------------------
  200|  1.66M|                   : 0;
  201|  1.66M|        u1_b = (ps_dec->p_left_ctxt_mb_info->u1_mb_type != CAB_INFERRED)
  ------------------
  |  |   74|  1.66M|#define CAB_INFERRED 0xFF
  ------------------
  |  Branch (201:16): [True: 1.65M, False: 13.7k]
  ------------------
  202|  1.66M|                   ? (!!(ps_dec->p_left_ctxt_mb_info->u1_mb_type & CAB_SKIP_MASK))
  ------------------
  |  |  401|  1.65M|#define CAB_SKIP_MASK     0x10 /* 0001 0000 */
  ------------------
  203|  1.66M|                   : 0;
  204|  1.66M|        u4_ctx_inc = 2 - (u1_a + u1_b);
  205|       |
  206|  1.66M|        u4_mbskip = ih264d_decode_bin(u4_ctx_inc, ps_dec->p_mb_skip_flag_t, ps_dec->ps_bitstrm,
  207|  1.66M|                                      &ps_dec->s_cab_dec_env);
  208|       |
  209|  1.66M|        if(!u4_mbskip)
  ------------------
  |  Branch (209:12): [True: 255k, False: 1.41M]
  ------------------
  210|   255k|        {
  211|   255k|            if(!(u1_mb_ngbr_avail & LEFT_MB_AVAILABLE_MASK))
  ------------------
  |  |   53|   255k|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  |  Branch (211:16): [True: 56.2k, False: 199k]
  ------------------
  212|  56.2k|            {
  213|  56.2k|                UWORD32 *pu4_buf;
  214|  56.2k|                UWORD8 *pu1_buf;
  215|       |
  216|  56.2k|                pu1_buf = ps_dec->pu1_left_nnz_y;
  217|  56.2k|                pu4_buf = (UWORD32 *) pu1_buf;
  218|  56.2k|                *pu4_buf = 0;
  219|  56.2k|                pu1_buf = ps_dec->pu1_left_nnz_uv;
  220|  56.2k|                pu4_buf = (UWORD32 *) pu1_buf;
  221|  56.2k|                *pu4_buf = 0;
  222|       |
  223|  56.2k|                *(ps_dec->pu1_left_yuv_dc_csbp) = 0;
  224|  56.2k|                MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
  ------------------
  |  |  652|  56.2k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  56.2k|{                                                               \
  |  |  654|  56.2k|    memset(pu4_start,value,16);                                 \
  |  |  655|  56.2k|}
  ------------------
  225|  56.2k|                *(UWORD32 *) ps_dec->pi1_left_ref_idx_ctxt_inc = 0;
  226|  56.2k|            }
  227|   255k|            if(!(u1_mb_ngbr_avail & TOP_MB_AVAILABLE_MASK))
  ------------------
  |  |   55|   255k|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  |  Branch (227:16): [True: 35.8k, False: 219k]
  ------------------
  228|  35.8k|            {
  229|  35.8k|                MEMSET_16BYTES(ps_dec->ps_curr_ctxt_mb_info->u1_mv, 0);
  ------------------
  |  |  652|  35.8k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  35.8k|{                                                               \
  |  |  654|  35.8k|    memset(pu4_start,value,16);                                 \
  |  |  655|  35.8k|}
  ------------------
  230|  35.8k|                memset(ps_dec->ps_curr_ctxt_mb_info->i1_ref_idx, 0, 4);
  231|  35.8k|            }
  232|   255k|        }
  233|  1.66M|    }
  234|  1.75M|    return (u4_mbskip);
  235|  1.75M|}
isvcd_get_mb_info_cavlc_nonmbaff:
  271|  12.2M|{
  272|  12.2M|    WORD32 mb_x;
  273|  12.2M|    WORD32 mb_y;
  274|  12.2M|    UWORD8 u1_mb_ngbr_avail = 0;
  275|  12.2M|    UWORD16 u2_frm_width_in_mb = ps_dec->u2_frm_wd_in_mbs;
  276|  12.2M|    WORD16 i2_prev_slice_mbx = ps_dec->i2_prev_slice_mbx;
  277|  12.2M|    UWORD16 u2_top_right_mask = TOP_RIGHT_DEFAULT_AVAILABLE;
  ------------------
  |  |   60|  12.2M|#define TOP_RIGHT_DEFAULT_AVAILABLE            0x5750
  ------------------
  278|  12.2M|    UWORD16 u2_top_left_mask = TOP_LEFT_DEFAULT_AVAILABLE;
  ------------------
  |  |   64|  12.2M|#define TOP_LEFT_DEFAULT_AVAILABLE            0xEEE0
  ------------------
  279|  12.2M|    UNUSED(u4_mbskip_run);
  ------------------
  |  |   45|  12.2M|#define UNUSED(x) ((void)(x))
  ------------------
  280|       |    /*--------------------------------------------------------------------*/
  281|       |    /* Calculate values of mb_x and mb_y                                  */
  282|       |    /*--------------------------------------------------------------------*/
  283|  12.2M|    mb_x = (WORD16) ps_dec->u2_mbx;
  284|  12.2M|    mb_y = (WORD16) ps_dec->u2_mby;
  285|       |
  286|  12.2M|    ps_dec->u4_cur_mb_addr = u2_cur_mb_address;
  287|       |
  288|  12.2M|    mb_x++;
  289|       |
  290|  12.2M|    if(mb_x == u2_frm_width_in_mb)
  ------------------
  |  Branch (290:8): [True: 2.06M, False: 10.1M]
  ------------------
  291|  2.06M|    {
  292|  2.06M|        mb_x = 0;
  293|  2.06M|        mb_y++;
  294|  2.06M|        if(mb_y >= ps_dec->u2_frm_ht_in_mbs)
  ------------------
  |  Branch (294:12): [True: 0, False: 2.06M]
  ------------------
  295|      0|        {
  296|      0|            mb_y = ps_dec->u2_frm_ht_in_mbs - 1;
  297|      0|        }
  298|  2.06M|    }
  299|  12.2M|    if(mb_y > ps_dec->i2_prev_slice_mby)
  ------------------
  |  Branch (299:8): [True: 11.5M, False: 687k]
  ------------------
  300|  11.5M|    {
  301|       |        /* if not in the immemdiate row of prev slice end then top
  302|       |         will be available */
  303|  11.5M|        if(mb_y > (ps_dec->i2_prev_slice_mby + 1)) i2_prev_slice_mbx = -1;
  ------------------
  |  Branch (303:12): [True: 10.8M, False: 714k]
  ------------------
  304|       |
  305|  11.5M|        if(mb_x > i2_prev_slice_mbx)
  ------------------
  |  Branch (305:12): [True: 11.4M, False: 106k]
  ------------------
  306|  11.4M|        {
  307|  11.4M|            u1_mb_ngbr_avail |= TOP_MB_AVAILABLE_MASK;
  ------------------
  |  |   55|  11.4M|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  308|  11.4M|            u2_top_right_mask |= TOP_RIGHT_TOP_AVAILABLE;
  ------------------
  |  |   62|  11.4M|#define TOP_RIGHT_TOP_AVAILABLE                0x0007
  ------------------
  309|  11.4M|            u2_top_left_mask |= TOP_LEFT_TOP_AVAILABLE;
  ------------------
  |  |   66|  11.4M|#define TOP_LEFT_TOP_AVAILABLE                0x000E
  ------------------
  310|  11.4M|        }
  311|       |
  312|  11.5M|        if((mb_x > (i2_prev_slice_mbx - 1)) && (mb_x != (u2_frm_width_in_mb - 1)))
  ------------------
  |  Branch (312:12): [True: 11.4M, False: 64.3k]
  |  Branch (312:48): [True: 9.41M, False: 2.05M]
  ------------------
  313|  9.41M|        {
  314|  9.41M|            u1_mb_ngbr_avail |= TOP_RIGHT_MB_AVAILABLE_MASK;
  ------------------
  |  |   56|  9.41M|#define TOP_RIGHT_MB_AVAILABLE_MASK 0x08
  ------------------
  315|  9.41M|            u2_top_right_mask |= TOP_RIGHT_TOPR_AVAILABLE;
  ------------------
  |  |   61|  9.41M|#define TOP_RIGHT_TOPR_AVAILABLE               0x0008
  ------------------
  316|  9.41M|        }
  317|       |
  318|  11.5M|        if(mb_x > (i2_prev_slice_mbx + 1))
  ------------------
  |  Branch (318:12): [True: 9.37M, False: 2.16M]
  ------------------
  319|  9.37M|        {
  320|  9.37M|            u1_mb_ngbr_avail |= TOP_LEFT_MB_AVAILABLE_MASK;
  ------------------
  |  |   54|  9.37M|#define TOP_LEFT_MB_AVAILABLE_MASK  0x02
  ------------------
  321|  9.37M|            u2_top_left_mask |= TOP_LEFT_TOPL_AVAILABLE;
  ------------------
  |  |   65|  9.37M|#define TOP_LEFT_TOPL_AVAILABLE               0x0001
  ------------------
  322|  9.37M|        }
  323|       |
  324|       |        /* Next row  Left will be available*/
  325|  11.5M|        i2_prev_slice_mbx = -1;
  326|  11.5M|    }
  327|       |
  328|       |    /* Same row */
  329|  12.2M|    if(mb_x > (i2_prev_slice_mbx + 1))
  ------------------
  |  Branch (329:8): [True: 9.98M, False: 2.24M]
  ------------------
  330|  9.98M|    {
  331|  9.98M|        u1_mb_ngbr_avail |= LEFT_MB_AVAILABLE_MASK;
  ------------------
  |  |   53|  9.98M|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  332|  9.98M|        u2_top_left_mask |= TOP_LEFT_LEFT_AVAILABLE;
  ------------------
  |  |   67|  9.98M|#define TOP_LEFT_LEFT_AVAILABLE               0x1110
  ------------------
  333|  9.98M|    }
  334|       |
  335|  12.2M|    {
  336|  12.2M|        mb_neigbour_params_t *ps_cur_mb_row = ps_dec->ps_cur_mb_row;
  337|  12.2M|        mb_neigbour_params_t *ps_top_mb_row = ps_dec->ps_top_mb_row;
  338|       |
  339|       |        /* copy the parameters of topleft Mb */
  340|  12.2M|        ps_cur_mb_info->u1_topleft_mbtype = ps_dec->u1_topleft_mbtype;
  341|       |        /* Neighbour pointer assignments*/
  342|  12.2M|        ps_cur_mb_info->ps_curmb = ps_cur_mb_row + mb_x;
  343|  12.2M|        ps_cur_mb_info->ps_left_mb = ps_cur_mb_row + mb_x - 1;
  344|  12.2M|        ps_cur_mb_info->ps_top_mb = ps_top_mb_row + mb_x;
  345|  12.2M|        ps_cur_mb_info->ps_top_right_mb = ps_top_mb_row + mb_x + 1;
  346|       |
  347|       |        /* Update the parameters of topleftmb*/
  348|  12.2M|        ps_dec->u1_topleft_mbtype = ps_cur_mb_info->ps_top_mb->u1_mb_type;
  349|  12.2M|    }
  350|       |
  351|  12.2M|    ps_dec->u2_mby = mb_y;
  352|  12.2M|    ps_dec->u2_mbx = mb_x;
  353|  12.2M|    ps_cur_mb_info->u2_mbx = mb_x;
  354|  12.2M|    ps_cur_mb_info->u2_mby = mb_y;
  355|  12.2M|    ps_cur_mb_info->u1_topmb = 1;
  356|  12.2M|    ps_dec->i4_submb_ofst += SUB_BLK_SIZE;
  ------------------
  |  |  562|  12.2M|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  12.2M|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  12.2M|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
  357|  12.2M|    ps_dec->u1_mb_ngbr_availablity = u1_mb_ngbr_avail;
  358|  12.2M|    ps_cur_mb_info->u1_mb_ngbr_availablity = u1_mb_ngbr_avail;
  359|  12.2M|    ps_cur_mb_info->ps_curmb->u1_mb_fld = ps_dec->u1_cur_mb_fld_dec_flag;
  360|  12.2M|    ps_cur_mb_info->u1_mb_field_decodingflag = ps_dec->u1_cur_mb_fld_dec_flag;
  361|  12.2M|    ps_cur_mb_info->u2_top_left_avail_mask = u2_top_left_mask;
  362|  12.2M|    ps_cur_mb_info->u2_top_right_avail_mask = u2_top_right_mask;
  363|  12.2M|    return (OK);
  ------------------
  |  |  114|  12.2M|#define OK        0
  ------------------
  364|  12.2M|}

isvcd_ref_lyr_part_idc:
  783|   131k|{
  784|       |    /*! Flow of the module is as follows                                   */
  785|       |    /*! 1. runs loops over the 16 4x4 blocks and gets teh reference layer
  786|       |    patition information by projecting the 1,1 locations of
  787|       |    each block                                                      */
  788|       |    /*! 2. if the projected partition is in INTRA MB then its stores -1
  789|       |    to the partition idc array                                      */
  790|       |    /*! 3. if projected partition is in INTER MB then it packs and stores
  791|       |    the offsets form the starting pointer in the part_idc array     */
  792|       |    /*! 4. IN non dyaydic cases. the part idc having -1 are replaced by
  793|       |    neighbours if the current MB projected is not INTRA             */
  794|       |    /*! 5. the -1 values are replaced first on a 4x4 inside an 8x8 basis   */
  795|       |    /*! 6. in second iteration -1 are replaced at an 8x8 basis             */
  796|       |    /*! 7. stores the intra MB status in the location given                */
  797|       |
  798|   131k|    mode_motion_ctxt_t *ps_ctxt;
  799|   131k|    mode_motion_lyr_ctxt *ps_lyr_mem;
  800|   131k|    inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms;
  801|   131k|    WORD32 i4_blk_y, i4_blk_x;
  802|   131k|    WORD32 i4_mb_x, i4_mb_y;
  803|   131k|    WORD32 i4_intra_mb_flag;
  804|   131k|    WORD32 i4_inter_lyr_mb_prms_stride;
  805|   131k|    dec_mb_info_t *ps_mb_params;
  806|       |
  807|   131k|    ps_mb_params = (dec_mb_info_t *) pv_mb_params;
  808|   131k|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
  809|       |
  810|       |    /* get the current layer ctxt */
  811|   131k|    ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
  812|       |
  813|       |    /* ref layer mb mode */
  814|   131k|    ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) ps_lyr_mem->s_ref_mb_mode.pv_buffer;
  815|   131k|    i4_inter_lyr_mb_prms_stride = ps_lyr_mem->s_ref_mb_mode.i4_num_element_stride;
  816|       |
  817|       |    /* derive the MB_X and MB_Y for the current MB */
  818|   131k|    i4_mb_x = ps_mb_params->u2_mbx;
  819|   131k|    i4_mb_y = ps_mb_params->u2_mby;
  820|       |
  821|       |    /* set the intra MB flag to default TRUE */
  822|   131k|    i4_intra_mb_flag = SVCD_TRUE;
  ------------------
  |  |   46|   131k|#define SVCD_TRUE 1
  ------------------
  823|       |
  824|       |    /*-----------------------------------------------------------------------*/
  825|       |    /* derive the reference layer part idc for all 16 partitions             */
  826|       |    /*-----------------------------------------------------------------------*/
  827|   656k|    for(i4_blk_y = 0; i4_blk_y < NUM_SUB_MB_PARTS; i4_blk_y++)
  ------------------
  |  |   60|   656k|#define NUM_SUB_MB_PARTS 4
  ------------------
  |  Branch (827:23): [True: 525k, False: 131k]
  ------------------
  828|   525k|    {
  829|  2.62M|        for(i4_blk_x = 0; i4_blk_x < NUM_SUB_MB_PARTS; i4_blk_x++)
  ------------------
  |  |   60|  2.62M|#define NUM_SUB_MB_PARTS 4
  ------------------
  |  Branch (829:27): [True: 2.10M, False: 525k]
  ------------------
  830|  2.10M|        {
  831|  2.10M|            WORD32 i4_curr_x, i4_curr_y;
  832|  2.10M|            WORD32 i4_ref_x, i4_ref_y;
  833|  2.10M|            WORD32 i4_ref_mb_x, i4_ref_mb_y;
  834|  2.10M|            WORD8 i1_ref_mb_mode;
  835|  2.10M|            inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms_temp;
  836|       |
  837|  2.10M|            i4_curr_x = (i4_mb_x << 4) + (i4_blk_x << 2) + 1;
  838|  2.10M|            i4_curr_y = (i4_mb_y << 4) + (i4_blk_y << 2) + 1;
  839|       |
  840|       |            /* get the colocated position in the refernce layer */
  841|  2.10M|            i4_ref_x = ps_lyr_mem->pi2_ref_loc_x[i4_curr_x];
  842|  2.10M|            i4_ref_y = ps_lyr_mem->pi2_ref_loc_y[i4_curr_y];
  843|       |
  844|  2.10M|            i4_ref_x = CLIP3(0, ((ps_lyr_mem->i4_ref_width) - 1), i4_ref_x);
  ------------------
  |  |   77|  2.10M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 2.10M]
  |  |  |  Branch (77:54): [True: 0, False: 2.10M]
  |  |  ------------------
  ------------------
  845|       |
  846|  2.10M|            i4_ref_y = CLIP3(0, ((ps_lyr_mem->i4_ref_height) - 1), i4_ref_y);
  ------------------
  |  |   77|  2.10M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 2.10M]
  |  |  |  Branch (77:54): [True: 0, False: 2.10M]
  |  |  ------------------
  ------------------
  847|       |
  848|       |            /* get the reference mb x and y */
  849|  2.10M|            i4_ref_mb_x = (i4_ref_x >> 4);
  850|  2.10M|            i4_ref_mb_y = (i4_ref_y >> 4);
  851|       |
  852|       |            /* get the appropriate mb params in reference layer */
  853|  2.10M|            ps_inter_lyr_mb_prms_temp = ps_inter_lyr_mb_prms + i4_ref_mb_x;
  854|  2.10M|            ps_inter_lyr_mb_prms_temp += i4_ref_mb_y * i4_inter_lyr_mb_prms_stride;
  855|       |
  856|  2.10M|            i1_ref_mb_mode = ps_inter_lyr_mb_prms_temp->i1_mb_mode;
  857|       |
  858|       |            /* check if the MB mode of the refernce MB is Intra*/
  859|  2.10M|            if(i1_ref_mb_mode > SVC_INTER_MB)
  ------------------
  |  |  114|  2.10M|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (859:16): [True: 273k, False: 1.82M]
  ------------------
  860|   273k|            {
  861|       |                /* store the -1 value */
  862|   273k|                ai4_ref_part_idc[i4_blk_y][i4_blk_x] = -1;
  863|   273k|            }
  864|  1.82M|            else
  865|  1.82M|            {
  866|       |                /* pack and store the reference x and y */
  867|  1.82M|                ai4_ref_part_idc[i4_blk_y][i4_blk_x] = (i4_ref_y << 16) + i4_ref_x;
  868|  1.82M|                i4_intra_mb_flag = SVCD_FALSE;
  ------------------
  |  |   45|  1.82M|#define SVCD_FALSE 0
  ------------------
  869|  1.82M|            }
  870|       |
  871|  2.10M|        } /* end of block x loop */
  872|       |
  873|   525k|    }     /* end of block y loop */
  874|       |
  875|       |    /*************************************************************************/
  876|       |    /* if the restricted spatial resolution change flag is 0                 */
  877|       |    /* modify the part_idc for all the partitions                            */
  878|       |    /*************************************************************************/
  879|   131k|    if(SVCD_FALSE == (ps_lyr_mem->ps_curr_lyr_res_prms->u1_rstrct_res_change_flag) &&
  ------------------
  |  |   45|   131k|#define SVCD_FALSE 0
  ------------------
  |  Branch (879:8): [True: 131k, False: 0]
  ------------------
  880|   131k|       (SVCD_FALSE == i4_intra_mb_flag))
  ------------------
  |  |   45|   131k|#define SVCD_FALSE 0
  ------------------
  |  Branch (880:8): [True: 121k, False: 9.42k]
  ------------------
  881|   121k|    {
  882|       |        /* replace values of "-1" on a 4x4 block basis */
  883|   121k|        WORD32 i4_xp, i4_yp;
  884|   121k|        WORD32 i4_indx_x, i4_indx_y;
  885|   121k|        WORD32 ai4_flag_8x8[2][2] = {SVCD_FALSE};
  ------------------
  |  |   45|   121k|#define SVCD_FALSE 0
  ------------------
  886|       |
  887|       |        /* loop over (4) 8x8 partitions */
  888|   365k|        for(i4_yp = 0; i4_yp < 2; i4_yp++)
  ------------------
  |  Branch (888:24): [True: 243k, False: 121k]
  ------------------
  889|   243k|        {
  890|   731k|            for(i4_xp = 0; i4_xp < 2; i4_xp++)
  ------------------
  |  Branch (890:28): [True: 487k, False: 243k]
  ------------------
  891|   487k|            {
  892|   487k|                WORD32 i4_xs, i4_ys;
  893|   487k|                WORD32 ai4_flag_4x4[2][2] = {SVCD_FALSE};
  ------------------
  |  |   45|   487k|#define SVCD_FALSE 0
  ------------------
  894|       |
  895|       |                /* loop over (4) 4x4 partitions */
  896|  1.46M|                for(i4_ys = 0; i4_ys < 2; i4_ys++)
  ------------------
  |  Branch (896:32): [True: 975k, False: 487k]
  ------------------
  897|   975k|                {
  898|  2.92M|                    for(i4_xs = 0; i4_xs < 2; i4_xs++)
  ------------------
  |  Branch (898:36): [True: 1.95M, False: 975k]
  ------------------
  899|  1.95M|                    {
  900|       |                        /* index to the exact 4x4 block */
  901|  1.95M|                        i4_indx_y = (i4_yp << 1) + i4_ys;
  902|  1.95M|                        i4_indx_x = (i4_xp << 1) + i4_xs;
  903|       |
  904|       |                        /* check if the current part idc is -1*/
  905|  1.95M|                        if(ai4_ref_part_idc[i4_indx_y][i4_indx_x] == -1)
  ------------------
  |  Branch (905:28): [True: 122k, False: 1.82M]
  ------------------
  906|   122k|                        {
  907|   122k|                            WORD32 i4_temp_x = 1 - i4_xs;
  908|   122k|                            WORD32 i4_temp_y = 1 - i4_ys;
  909|   122k|                            WORD32 i4_temp_part_y = (i4_yp << 1) + i4_temp_y;
  910|       |
  911|   122k|                            WORD32 i4_temp_part_x = (i4_xp << 1) + i4_temp_x;
  912|       |
  913|   122k|                            ai4_flag_4x4[i4_ys][i4_xs] = SVCD_TRUE;
  ------------------
  |  |   46|   122k|#define SVCD_TRUE 1
  ------------------
  914|       |
  915|       |                            /* replace with appropriate values */
  916|   122k|                            if((SVCD_FALSE == ai4_flag_4x4[i4_ys][i4_temp_x]) &&
  ------------------
  |  |   45|   122k|#define SVCD_FALSE 0
  ------------------
  |  Branch (916:32): [True: 61.4k, False: 61.4k]
  ------------------
  917|  61.4k|                               (ai4_ref_part_idc[i4_indx_y][i4_temp_part_x] != -1))
  ------------------
  |  Branch (917:32): [True: 0, False: 61.4k]
  ------------------
  918|      0|                            {
  919|      0|                                ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  920|      0|                                    ai4_ref_part_idc[i4_indx_y][i4_temp_part_x];
  921|      0|                            }
  922|   122k|                            else if((SVCD_FALSE == ai4_flag_4x4[i4_temp_y][i4_xs]) &&
  ------------------
  |  |   45|   122k|#define SVCD_FALSE 0
  ------------------
  |  Branch (922:37): [True: 61.4k, False: 61.4k]
  ------------------
  923|  61.4k|                                    (ai4_ref_part_idc[i4_temp_part_y][i4_indx_x] != -1))
  ------------------
  |  Branch (923:37): [True: 0, False: 61.4k]
  ------------------
  924|      0|                            {
  925|      0|                                ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  926|      0|                                    ai4_ref_part_idc[i4_temp_part_y][i4_indx_x];
  927|      0|                            }
  928|   122k|                            else if((SVCD_FALSE == ai4_flag_4x4[i4_temp_y][i4_temp_x]) &&
  ------------------
  |  |   45|   122k|#define SVCD_FALSE 0
  ------------------
  |  Branch (928:37): [True: 61.4k, False: 61.4k]
  ------------------
  929|  61.4k|                                    (ai4_ref_part_idc[i4_temp_part_y][i4_temp_part_x] != -1))
  ------------------
  |  Branch (929:37): [True: 0, False: 61.4k]
  ------------------
  930|      0|                            {
  931|      0|                                ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  932|      0|                                    ai4_ref_part_idc[i4_temp_part_y][i4_temp_part_x];
  933|      0|                            }
  934|   122k|                        } /* end of part idc equal to -1 check */
  935|       |
  936|  1.95M|                    }     /* end of sub partition xs loop */
  937|       |
  938|   975k|                }         /* end of sub partition ys loop */
  939|       |
  940|   487k|            }             /* end of partition xp loop */
  941|       |
  942|   243k|        }                 /* end of partition yp loop */
  943|       |
  944|       |        /* replace values of "-1" on an 8x8 block basis */
  945|       |
  946|       |        /* loop over (4) 8x8 partitions */
  947|   365k|        for(i4_yp = 0; i4_yp < 2; i4_yp++)
  ------------------
  |  Branch (947:24): [True: 243k, False: 121k]
  ------------------
  948|   243k|        {
  949|   731k|            for(i4_xp = 0; i4_xp < 2; i4_xp++)
  ------------------
  |  Branch (949:28): [True: 487k, False: 243k]
  ------------------
  950|   487k|            {
  951|   487k|                WORD32 i4_yp_inv = 1 - i4_yp;
  952|   487k|                WORD32 i4_xp_inv = 1 - i4_xp;
  953|   487k|                WORD32 i4_xo_inv = (2 - i4_xp);
  954|   487k|                WORD32 i4_yo_inv = (2 - i4_yp);
  955|   487k|                i4_indx_x = (i4_xp << 1);
  956|   487k|                i4_indx_y = (i4_yp << 1);
  957|       |
  958|       |                /* check if the current part idc is -1*/
  959|   487k|                if(ai4_ref_part_idc[i4_indx_y][i4_indx_x] == -1)
  ------------------
  |  Branch (959:20): [True: 30.7k, False: 457k]
  ------------------
  960|  30.7k|                {
  961|  30.7k|                    ai4_flag_8x8[i4_yp][i4_xp] = SVCD_TRUE;
  ------------------
  |  |   46|  30.7k|#define SVCD_TRUE 1
  ------------------
  962|       |
  963|       |                    /* replace the -1 with appropriate values */
  964|  30.7k|                    if(SVCD_FALSE == ai4_flag_8x8[i4_yp][i4_xp_inv] &&
  ------------------
  |  |   45|  30.7k|#define SVCD_FALSE 0
  ------------------
  |  Branch (964:24): [True: 23.6k, False: 7.06k]
  ------------------
  965|  23.6k|                       ai4_ref_part_idc[i4_indx_y][i4_xo_inv] != -1)
  ------------------
  |  Branch (965:24): [True: 16.6k, False: 7.06k]
  ------------------
  966|  16.6k|                    {
  967|  16.6k|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  968|  16.6k|                            ai4_ref_part_idc[i4_indx_y][i4_xo_inv];
  969|       |
  970|  16.6k|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x] =
  971|  16.6k|                            ai4_ref_part_idc[i4_indx_y + 1][i4_xo_inv];
  972|       |
  973|  16.6k|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x + 1] =
  974|  16.6k|                            ai4_ref_part_idc[i4_indx_y][i4_xo_inv];
  975|       |
  976|  16.6k|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x + 1] =
  977|  16.6k|                            ai4_ref_part_idc[i4_indx_y + 1][i4_xo_inv];
  978|  16.6k|                    }
  979|  14.1k|                    else if(SVCD_FALSE == ai4_flag_8x8[i4_yp_inv][i4_xp] &&
  ------------------
  |  |   45|  14.1k|#define SVCD_FALSE 0
  ------------------
  |  Branch (979:29): [True: 13.8k, False: 275]
  ------------------
  980|  13.8k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x] != -1)
  ------------------
  |  Branch (980:29): [True: 13.5k, False: 324]
  ------------------
  981|  13.5k|                    {
  982|  13.5k|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  983|  13.5k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x];
  984|       |
  985|  13.5k|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x] =
  986|  13.5k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x];
  987|       |
  988|  13.5k|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x + 1] =
  989|  13.5k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x + 1];
  990|       |
  991|  13.5k|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x + 1] =
  992|  13.5k|                            ai4_ref_part_idc[i4_yo_inv][i4_indx_x + 1];
  993|  13.5k|                    }
  994|    599|                    else if(SVCD_FALSE == ai4_flag_8x8[i4_yp_inv][i4_xp_inv] &&
  ------------------
  |  |   45|    599|#define SVCD_FALSE 0
  ------------------
  |  Branch (994:29): [True: 599, False: 0]
  ------------------
  995|    599|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv] != -1)
  ------------------
  |  Branch (995:29): [True: 599, False: 0]
  ------------------
  996|    599|                    {
  997|    599|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x] =
  998|    599|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv];
  999|       |
 1000|    599|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x] =
 1001|    599|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv];
 1002|       |
 1003|    599|                        ai4_ref_part_idc[i4_indx_y][i4_indx_x + 1] =
 1004|    599|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv];
 1005|       |
 1006|    599|                        ai4_ref_part_idc[i4_indx_y + 1][i4_indx_x + 1] =
 1007|    599|                            ai4_ref_part_idc[i4_yo_inv][i4_xo_inv];
 1008|    599|                    }
 1009|  30.7k|                } /* end of part idc equal to -1 check */
 1010|       |
 1011|   487k|            }     /* end of partition xp loop */
 1012|       |
 1013|   243k|        }         /* end of partition yp loop */
 1014|       |
 1015|   121k|    }             /* end of refinement of part idc for non dyadic case*/
 1016|       |
 1017|       |    /* store the intra flag in the location provided */
 1018|   131k|    *pi4_intra_flag = i4_intra_mb_flag;
 1019|       |
 1020|   131k|    return;
 1021|   131k|}
isvcd_check_motion:
 1049|   545k|{
 1050|   545k|    mv_pred_t *ps_part_a;
 1051|   545k|    mv_pred_t *ps_part_b;
 1052|   545k|    WORD32 i4_cntr;
 1053|   545k|    WORD32 i4_mv_treshold;
 1054|   545k|    WORD32 i4_flag = 0;
 1055|       |
 1056|   545k|    ps_part_a = (mv_pred_t *) pv_motion_prm_mb_part_a;
 1057|   545k|    ps_part_b = (mv_pred_t *) pv_motion_prm_mb_part_b;
 1058|       |
 1059|  1.14M|    for(i4_cntr = 0; i4_cntr < i4_listx; i4_cntr++)
  ------------------
  |  Branch (1059:22): [True: 646k, False: 501k]
  ------------------
 1060|   646k|    {
 1061|       |        /* calculate the absolute diff of both components */
 1062|   646k|        i4_mv_treshold = ABS((ps_part_a->i2_mv[2 * i4_cntr]) - (ps_part_b->i2_mv[2 * i4_cntr]));
  ------------------
  |  |  100|   646k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 17.8k, False: 628k]
  |  |  ------------------
  ------------------
 1063|   646k|        i4_mv_treshold +=
 1064|   646k|            ABS((ps_part_a->i2_mv[1 + 2 * i4_cntr]) - (ps_part_b->i2_mv[1 + 2 * i4_cntr]));
  ------------------
  |  |  100|   646k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 16.7k, False: 629k]
  |  |  ------------------
  ------------------
 1065|       |
 1066|   646k|        if((0 == i4_mv_treshold) &&
  ------------------
  |  Branch (1066:12): [True: 608k, False: 37.3k]
  ------------------
 1067|   608k|           (ps_part_a->i1_ref_frame[i4_cntr] == ps_part_b->i1_ref_frame[i4_cntr]))
  ------------------
  |  Branch (1067:12): [True: 603k, False: 5.70k]
  ------------------
 1068|   603k|        {
 1069|   603k|            i4_flag = 1;
 1070|   603k|        }
 1071|  43.0k|        else
 1072|  43.0k|        {
 1073|  43.0k|            i4_flag = 0;
 1074|  43.0k|            return (i4_flag);
 1075|  43.0k|        }
 1076|       |
 1077|   646k|    } /* end of loop over lists */
 1078|       |
 1079|   501k|    return (i4_flag);
 1080|   545k|}
isvcd_get_min_positive:
 1104|  2.29M|{
 1105|  2.29M|    UWORD32 u4_x, u4_y;
 1106|  2.29M|    WORD32 i4_min_positive;
 1107|       |
 1108|       |    /* get positive values */
 1109|  2.29M|    u4_x = (UWORD32) i4_input_1;
 1110|  2.29M|    u4_y = (UWORD32) i4_input_2;
 1111|       |
 1112|       |    /* logic and desired output
 1113|       |
 1114|       |    u4_x     magnitude compare    u4_y           o/p
 1115|       |    +              >              +             u4_y
 1116|       |    +              <              +             u4_x
 1117|       |    +              =              +             u4_x
 1118|       |    -              >              -             u4_y
 1119|       |    -              <              -             u4_x
 1120|       |    -              =              -             u4_x
 1121|       |    0              =              0             u4_x
 1122|       |    -              n/a            +             u4_y
 1123|       |    +              n/a            -             u4_x
 1124|       |
 1125|       |    */
 1126|       |
 1127|  2.29M|    if((u4_y < u4_x) && (0 <= i4_input_2))
  ------------------
  |  Branch (1127:8): [True: 4.36k, False: 2.28M]
  |  Branch (1127:25): [True: 4.36k, False: 0]
  ------------------
 1128|  4.36k|    {
 1129|  4.36k|        i4_min_positive = i4_input_2;
 1130|  4.36k|    }
 1131|  2.28M|    else
 1132|  2.28M|    {
 1133|  2.28M|        i4_min_positive = i4_input_1;
 1134|  2.28M|    }
 1135|  2.29M|    return (i4_min_positive);
 1136|  2.29M|}
isvcd_interlyr_motion_scale:
 1286|  2.15M|{
 1287|       |    /*! Flow of the module is as follows                                   */
 1288|       |    /*! 1. derive the offsets form part idc                                */
 1289|       |    /*! 2. takes the motion vector and scales it based on scale factor     */
 1290|       |    /*! 3. adds the correction factors for crop window change cases        */
 1291|       |    /*! 4. store the default motion params for intra projected blocks      */
 1292|       |
 1293|  2.15M|    mode_motion_ctxt_t *ps_ctxt;
 1294|  2.15M|    mode_motion_lyr_ctxt *ps_lyr_mem;
 1295|  2.15M|    mv_pred_t *ps_motion_pred;
 1296|  2.15M|    mv_pred_t *ps_ref_mv;
 1297|  2.15M|    WORD32 i4_lists;
 1298|  2.15M|    WORD32 i4_ref_16x16_flag = 0;
 1299|  2.15M|    WORD32 i4_scale_x, i4_scale_y;
 1300|  2.15M|    WORD16 i2_max_mv_x, i2_max_mv_y;
 1301|       |
 1302|  2.15M|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
 1303|       |
 1304|       |    /* get the current layer ctxt */
 1305|  2.15M|    ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
 1306|       |
 1307|       |    /* ----------- Get the reference layer MV structure ---------- */
 1308|  2.15M|    {
 1309|  2.15M|        mv_pred_t *ps_ref_lyr_motion_prms;
 1310|  2.15M|        WORD32 i4_ref_x, i4_ref_y;
 1311|  2.15M|        WORD32 i4_ref_mb_x, i4_ref_mb_y;
 1312|  2.15M|        WORD32 i4_ref_width;
 1313|       |
 1314|  2.15M|        ps_ref_lyr_motion_prms = (mv_pred_t *) ps_lyr_mem->pv_ref_mv_bank_l0;
 1315|  2.15M|        i4_ref_width = ps_lyr_mem->i4_ref_width;
 1316|  2.15M|        i2_max_mv_x = i4_ref_width << 2;
 1317|  2.15M|        i2_max_mv_y = ps_lyr_mem->i4_ref_height << 2;
 1318|       |
 1319|       |        /* extract the reference x and y positions */
 1320|  2.15M|        i4_ref_x = (*pi4_ref_part_idc) & 0xFFFF;
 1321|  2.15M|        i4_ref_y = (*pi4_ref_part_idc) >> 16;
 1322|       |
 1323|       |        /* get the reference mb x and y */
 1324|  2.15M|        i4_ref_mb_x = (i4_ref_x >> 4);
 1325|  2.15M|        i4_ref_mb_y = (i4_ref_y >> 4);
 1326|       |
 1327|       |        /* get the reference layer motion struct pointing  */
 1328|       |        /* to first 4x4 partition of the refernce layer MB */
 1329|  2.15M|        ps_ref_mv = ps_ref_lyr_motion_prms + (i4_ref_mb_x << 4);
 1330|  2.15M|        ps_ref_mv += (i4_ref_mb_y * i4_ref_width);
 1331|       |
 1332|       |        /* if reference layer mb type is non 16x16 */
 1333|  2.15M|        if(0 == i4_ref_16x16_flag)
  ------------------
  |  Branch (1333:12): [True: 2.15M, False: 0]
  ------------------
 1334|  2.15M|        {
 1335|       |            /* increment the pointer to appropaite 4x4 */
 1336|  2.15M|            ps_ref_mv += ((i4_ref_x >> 2) & 0x03);
 1337|  2.15M|            ps_ref_mv += (((i4_ref_y >> 2) & 0x03) << 2);
 1338|  2.15M|        }
 1339|  2.15M|    }
 1340|       |
 1341|       |    /* motion pred structure */
 1342|  2.15M|    ps_motion_pred = pv_motion_pred;
 1343|       |
 1344|       |    /* retrive the scale factors */
 1345|  2.15M|    i4_scale_x = ps_lyr_mem->i4_scale_mv_x;
 1346|  2.15M|    i4_scale_y = ps_lyr_mem->i4_scale_mv_y;
 1347|       |
 1348|       |    /* loop on the lists given as input */
 1349|  4.76M|    for(i4_lists = 0; i4_lists < i4_listx; i4_lists++)
  ------------------
  |  Branch (1349:23): [True: 2.60M, False: 2.15M]
  ------------------
 1350|  2.60M|    {
 1351|  2.60M|        WORD32 i4_mv_x, i4_mv_y;
 1352|  2.60M|        WORD16 i2_mv_x, i2_mv_y;
 1353|       |
 1354|       |        /* if the refernce index is -1 set the default values */
 1355|  2.60M|        if(-1 == ps_ref_mv->i1_ref_frame[i4_lists])
  ------------------
  |  Branch (1355:12): [True: 275k, False: 2.32M]
  ------------------
 1356|   275k|        {
 1357|   275k|            ps_motion_pred->i1_ref_frame[i4_lists] = -1;
 1358|   275k|            ps_motion_pred->i2_mv[2 * i4_lists] = 0;
 1359|   275k|            ps_motion_pred->i2_mv[1 + 2 * i4_lists] = 0;
 1360|   275k|        }
 1361|  2.32M|        else
 1362|  2.32M|        {
 1363|       |            /* field MB and field pictures modification are present */
 1364|       |            /* currently not implemented */
 1365|  2.32M|            ps_motion_pred->i1_ref_frame[i4_lists] = ps_ref_mv->i1_ref_frame[i4_lists];
 1366|       |
 1367|  2.32M|            i2_mv_x = ps_ref_mv->i2_mv[2 * i4_lists];
 1368|  2.32M|            i2_mv_y = ps_ref_mv->i2_mv[1 + 2 * i4_lists];
 1369|  2.32M|            i2_mv_x = CLIP3(-i2_max_mv_x, i2_max_mv_x, i2_mv_x);
  ------------------
  |  |   77|  2.32M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 1.59k, False: 2.32M]
  |  |  |  Branch (77:54): [True: 1.61k, False: 2.32M]
  |  |  ------------------
  ------------------
 1370|  2.32M|            i2_mv_y = CLIP3(-i2_max_mv_y, i2_max_mv_y, i2_mv_y);
  ------------------
  |  |   77|  2.32M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 1.31k, False: 2.32M]
  |  |  |  Branch (77:54): [True: 681, False: 2.32M]
  |  |  ------------------
  ------------------
 1371|       |            /* scale the motion vectors */
 1372|  2.32M|            i4_mv_x = (i2_mv_x * i4_scale_x + 32768) >> 16;
 1373|  2.32M|            i4_mv_y = (i2_mv_y * i4_scale_y + 32768) >> 16;
 1374|       |
 1375|       |            /* store the final motion vectors */
 1376|  2.32M|            ps_motion_pred->i2_mv[2 * i4_lists] = i4_mv_x;
 1377|  2.32M|            ps_motion_pred->i2_mv[1 + 2 * i4_lists] = i4_mv_y;
 1378|       |
 1379|       |            /* if cropping change flag is present */
 1380|  2.32M|            if(SVCD_TRUE == ps_lyr_mem->ps_curr_lyr_res_prms->u1_cropping_change_flag)
  ------------------
  |  |   46|  2.32M|#define SVCD_TRUE 1
  ------------------
  |  Branch (1380:16): [True: 0, False: 2.32M]
  ------------------
 1381|      0|            {
 1382|       |                /* over write the motion vectors x and y */
 1383|      0|                isvcd_motion_scale_crop_wdw_change(ps_ctxt, ps_lyr_mem, ps_mb_params, ps_ref_mv,
 1384|      0|                                                   ps_motion_pred, i4_listx, i4_part_frm_x,
 1385|      0|                                                   i4_part_frm_y, ppv_map_ref_idx_to_poc, i4_lists);
 1386|      0|            }
 1387|  2.32M|        }
 1388|  2.60M|    } /* end of lists loop */
 1389|       |
 1390|  2.15M|    return (i4_ref_16x16_flag);
 1391|  2.15M|}
isvcd_store_motion_map:
 1425|   208k|{
 1426|       |    /*! Flow of the module is as follows                                   */
 1427|       |    /*! 1. loops over part_width and part_height                           */
 1428|       |    /*! 2. copies the src params toi destination                           */
 1429|       |    /*! 3. updates the source pointer if src_update flag is set to 1       */
 1430|       |
 1431|   208k|    WORD32 i4_i, i4_j;
 1432|   208k|    mv_pred_t *ps_mv_pred_src;
 1433|   208k|    mv_pred_t *ps_mv_map_dst;
 1434|       |
 1435|   208k|    ps_mv_pred_src = (mv_pred_t *) pv_motion_pred;
 1436|   208k|    ps_mv_map_dst = (mv_pred_t *) pv_curr_lyr_motion_map;
 1437|       |
 1438|       |    /* store the current motion pred to all the motion map structures */
 1439|   625k|    for(i4_i = 0; i4_i < i4_part_height; i4_i++)
  ------------------
  |  Branch (1439:19): [True: 416k, False: 208k]
  ------------------
 1440|   416k|    {
 1441|  1.25M|        for(i4_j = 0; i4_j < i4_part_width; i4_j++)
  ------------------
  |  Branch (1441:23): [True: 833k, False: 416k]
  ------------------
 1442|   833k|        {
 1443|       |            /* copy form source to destination */
 1444|   833k|            *(ps_mv_map_dst + i4_j) = *(ps_mv_pred_src + (i4_src_update_flag * i4_j));
 1445|       |
 1446|   833k|        } /* end of loop over partition width */
 1447|       |
 1448|   416k|        ps_mv_map_dst += i4_dst_stride;
 1449|   416k|        ps_mv_pred_src += (i4_src_stride * i4_src_update_flag);
 1450|       |
 1451|   416k|    } /* end of loop over partition height */
 1452|   208k|    return;
 1453|   208k|}
isvcd_check_mv_diff:
 1482|  2.43M|{
 1483|  2.43M|    mv_pred_t *ps_part_a;
 1484|  2.43M|    mv_pred_t *ps_part_b;
 1485|  2.43M|    WORD32 i4_cntr;
 1486|  2.43M|    WORD32 i4_mv_treshold;
 1487|  2.43M|    WORD32 i4_flag;
 1488|       |
 1489|  2.43M|    ps_part_a = (mv_pred_t *) pv_motion_prm_a;
 1490|  2.43M|    ps_part_b = (mv_pred_t *) pv_motion_prm_b;
 1491|       |
 1492|  2.43M|    i4_flag = 1;
 1493|  5.26M|    for(i4_cntr = 0; i4_cntr < i4_listx; i4_cntr++)
  ------------------
  |  Branch (1493:22): [True: 2.86M, False: 2.39M]
  ------------------
 1494|  2.86M|    {
 1495|       |        /* calculate the absolute diff of both components */
 1496|  2.86M|        i4_mv_treshold = ABS((ps_part_a->i2_mv[2 * i4_cntr]) - (ps_part_b->i2_mv[2 * i4_cntr]));
  ------------------
  |  |  100|  2.86M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 20.7k, False: 2.84M]
  |  |  ------------------
  ------------------
 1497|  2.86M|        i4_mv_treshold +=
 1498|  2.86M|            ABS((ps_part_a->i2_mv[1 + (2 * i4_cntr)]) - (ps_part_b->i2_mv[1 + (2 * i4_cntr)]));
  ------------------
  |  |  100|  2.86M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 25.9k, False: 2.83M]
  |  |  ------------------
  ------------------
 1499|       |
 1500|  2.86M|        if(i4_actual_threshold < i4_mv_treshold)
  ------------------
  |  Branch (1500:12): [True: 42.6k, False: 2.82M]
  ------------------
 1501|  42.6k|        {
 1502|  42.6k|            i4_flag = 0;
 1503|  42.6k|            break;
 1504|  42.6k|        }
 1505|       |
 1506|  2.86M|    } /* end of loop over lists */
 1507|  2.43M|    return (i4_flag);
 1508|  2.43M|}
isvcd_interlyr_motion_submbmode_pred:
 1541|   121k|{
 1542|       |    /*! Flow of the module is as follows                                   */
 1543|       |    /*! 1. if dyadic case it calculates the motion vectors based on dyadic
 1544|       |           scale factor and loop counts calculated at layer level          */
 1545|       |    /*! 2. if non dyadic then it calculates the motion vectors based on
 1546|       |            reference layer part idc                                        */
 1547|       |    /*! 3. does the motion vector modification for non dyayic cases, by
 1548|       |           calculating the minimum positive of reference indices of 4 4x4
 1549|       |           blocks and getiing a single reference index for 8x8             */
 1550|       |    /*! 4. if direct 8x8 inference is present and current slice is
 1551|       |           B OR EB, then it stores the corner motion vectors for each 8x8  */
 1552|       |    /*! 5. does the sub mb mode prediction and merging of motion vectors
 1553|       |           which are closely related by setting appropriate thresholds
 1554|       |           for MVs                                                         */
 1555|       |    /*! 6. stores the sub mb modes in the array given as input             */
 1556|       |
 1557|   121k|    mode_motion_ctxt_t *ps_ctxt;
 1558|   121k|    mode_motion_lyr_ctxt *ps_lyr_mem;
 1559|   121k|    mv_pred_t *ps_motion_pred;
 1560|   121k|    dec_mb_info_t *ps_mb_params;
 1561|   121k|    dec_svc_mb_info_t *ps_svc_mb_params;
 1562|   121k|    WORD32 i4_blk_y, i4_blk_x;
 1563|   121k|    WORD32 i4_i;
 1564|   121k|    WORD32 i4_listx;
 1565|   121k|    WORD32 i4_mv_treshold;
 1566|   121k|    WORD32 ai4_temp_ref_indx[NUM_REF_LISTS][NUM_MB_PARTS] = {0};
 1567|   121k|    WORD32 i4_mb_x, i4_mb_y;
 1568|   121k|    WORD32 i4_mb_pic_x, i4_mb_pic_y;
 1569|   121k|    dec_struct_t *ps_dec;
 1570|       |
 1571|   121k|    ps_dec = (dec_struct_t *) pv_dec;
 1572|   121k|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
 1573|       |
 1574|       |    /* get the current layer ctxt */
 1575|   121k|    ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
 1576|       |
 1577|   121k|    ps_mb_params = (dec_mb_info_t *) pv_mb_params;
 1578|   121k|    ps_svc_mb_params = (dec_svc_mb_info_t *) pv_svc_mb_params;
 1579|   121k|    ps_motion_pred = ps_ctxt->ps_motion_pred_struct;
 1580|       |
 1581|   121k|    i4_listx = ps_ctxt->i4_listx;
 1582|       |
 1583|       |    /* derive the MB_X and MB_Y for the current MB */
 1584|   121k|    i4_mb_x = ps_mb_params->u2_mbx;
 1585|   121k|    i4_mb_y = ps_mb_params->u2_mby;
 1586|       |
 1587|       |    /* convert into picture units */
 1588|   121k|    i4_mb_pic_x = i4_mb_x << 4;
 1589|   121k|    i4_mb_pic_y = i4_mb_y << 4;
 1590|       |
 1591|       |    /* compute the motion vectors and reference indices of all part */
 1592|   609k|    for(i4_blk_y = 0; i4_blk_y < NUM_SUB_MB_PARTS; i4_blk_y++)
  ------------------
  |  |   60|   609k|#define NUM_SUB_MB_PARTS 4
  ------------------
  |  Branch (1592:23): [True: 487k, False: 121k]
  ------------------
 1593|   487k|    {
 1594|  2.43M|        for(i4_blk_x = 0; i4_blk_x < NUM_SUB_MB_PARTS; i4_blk_x++)
  ------------------
  |  |   60|  2.43M|#define NUM_SUB_MB_PARTS 4
  ------------------
  |  Branch (1594:27): [True: 1.95M, False: 487k]
  ------------------
 1595|  1.95M|        {
 1596|  1.95M|            isvcd_interlyr_motion_scale(pv_comp_mode_mv_ctxt, &ai4_ref_part_idc[i4_blk_y][i4_blk_x],
 1597|  1.95M|                                        ps_mb_params, (ps_motion_pred + (4 * i4_blk_y) + i4_blk_x),
 1598|  1.95M|                                        i4_listx, (i4_mb_pic_x + (i4_blk_x << 2) + 1),
 1599|  1.95M|                                        (i4_mb_pic_y + (i4_blk_y << 2) + 1),
 1600|  1.95M|                                        ps_dec->ppv_map_ref_idx_to_poc);
 1601|       |
 1602|  1.95M|        } /* end of blk x loop */
 1603|   487k|    }     /* end of blk y loop */
 1604|       |
 1605|       |    /********************************************************/
 1606|       |    /* get the final reference index into a temparory array */
 1607|       |    /********************************************************/
 1608|       |
 1609|       |    /* set reference indices */
 1610|   265k|    for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1610:19): [True: 143k, False: 121k]
  ------------------
 1611|   143k|    {
 1612|   143k|        ai4_temp_ref_indx[i4_i][0] = ps_motion_pred[0].i1_ref_frame[i4_i];
 1613|   143k|        ai4_temp_ref_indx[i4_i][1] = ps_motion_pred[2].i1_ref_frame[i4_i];
 1614|   143k|        ai4_temp_ref_indx[i4_i][2] = ps_motion_pred[8].i1_ref_frame[i4_i];
 1615|   143k|        ai4_temp_ref_indx[i4_i][3] = ps_motion_pred[10].i1_ref_frame[i4_i];
 1616|       |
 1617|   143k|    } /* end of loop over lists */
 1618|       |
 1619|       |    /* if restricted spatial resolution change is not set */
 1620|   121k|    if(SVCD_FALSE == ps_lyr_mem->ps_curr_lyr_res_prms->u1_rstrct_res_change_flag)
  ------------------
  |  |   45|   121k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1620:8): [True: 121k, False: 0]
  ------------------
 1621|   121k|    {
 1622|   121k|        WORD32 i4_xp, i4_yp;
 1623|   121k|        WORD32 i4_xs, i4_ys;
 1624|       |
 1625|       |        /* merge reference indices and modify the motion vectors */
 1626|   265k|        for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1626:23): [True: 143k, False: 121k]
  ------------------
 1627|   143k|        {
 1628|   429k|            for(i4_yp = 0; i4_yp < 2; i4_yp++)
  ------------------
  |  Branch (1628:28): [True: 286k, False: 143k]
  ------------------
 1629|   286k|            {
 1630|   859k|                for(i4_xp = 0; i4_xp < 2; i4_xp++)
  ------------------
  |  Branch (1630:32): [True: 573k, False: 286k]
  ------------------
 1631|   573k|                {
 1632|       |                    /* get the minimum positive of the refernce index */
 1633|  1.71M|                    for(i4_ys = 0; i4_ys < 2; i4_ys++)
  ------------------
  |  Branch (1633:36): [True: 1.14M, False: 573k]
  ------------------
 1634|  1.14M|                    {
 1635|  3.43M|                        for(i4_xs = 0; i4_xs < 2; i4_xs++)
  ------------------
  |  Branch (1635:40): [True: 2.29M, False: 1.14M]
  ------------------
 1636|  2.29M|                        {
 1637|  2.29M|                            mv_pred_t *ps_temp;
 1638|  2.29M|                            ps_temp = ps_motion_pred + (i4_xp << 1) + i4_xs;
 1639|  2.29M|                            ps_temp += 4 * ((i4_yp << 1) + i4_ys);
 1640|       |
 1641|       |                            /* get the minimum positive */
 1642|  2.29M|                            ai4_temp_ref_indx[i4_i][2 * i4_yp + i4_xp] =
 1643|  2.29M|                                isvcd_get_min_positive(ai4_temp_ref_indx[i4_i][2 * i4_yp + i4_xp],
 1644|  2.29M|                                                       ps_temp->i1_ref_frame[i4_i]);
 1645|  2.29M|                        }
 1646|  1.14M|                    }
 1647|       |                    /* update motion vectors */
 1648|  1.71M|                    for(i4_ys = 0; i4_ys < 2; i4_ys++)
  ------------------
  |  Branch (1648:36): [True: 1.14M, False: 573k]
  ------------------
 1649|  1.14M|                    {
 1650|  3.43M|                        for(i4_xs = 0; i4_xs < 2; i4_xs++)
  ------------------
  |  Branch (1650:40): [True: 2.29M, False: 1.14M]
  ------------------
 1651|  2.29M|                        {
 1652|  2.29M|                            mv_pred_t *ps_temp;
 1653|  2.29M|                            ps_temp = ps_motion_pred + (i4_xp << 1) + i4_xs;
 1654|  2.29M|                            ps_temp += 4 * ((i4_yp << 1) + i4_ys);
 1655|       |
 1656|       |                            /* check if the current part reference index is */
 1657|       |                            /* not choosen as the final reference index */
 1658|       |                            /* if not copy the neighbours MV */
 1659|  2.29M|                            if(ai4_temp_ref_indx[i4_i][2 * i4_yp + i4_xp] !=
  ------------------
  |  Branch (1659:32): [True: 11.8k, False: 2.28M]
  ------------------
 1660|  2.29M|                               ps_temp->i1_ref_frame[i4_i])
 1661|  11.8k|                            {
 1662|  11.8k|                                mv_pred_t *ps_temp_1;
 1663|  11.8k|                                WORD32 i4_updated_flag = SVCD_FALSE;
  ------------------
  |  |   45|  11.8k|#define SVCD_FALSE 0
  ------------------
 1664|       |
 1665|  11.8k|                                ps_temp_1 = ps_motion_pred + (i4_xp << 1) + (1 - i4_xs);
 1666|  11.8k|                                ps_temp_1 += 4 * ((i4_yp << 1) + i4_ys);
 1667|       |
 1668|       |                                /* store the appropriate neighbours */
 1669|  11.8k|                                if(ai4_temp_ref_indx[i4_i][2 * i4_yp + i4_xp] ==
  ------------------
  |  Branch (1669:36): [True: 4.09k, False: 7.76k]
  ------------------
 1670|  11.8k|                                   ps_temp_1->i1_ref_frame[i4_i])
 1671|  4.09k|                                {
 1672|  4.09k|                                    ps_temp->i2_mv[2 * i4_i] = ps_temp_1->i2_mv[2 * i4_i];
 1673|       |
 1674|  4.09k|                                    ps_temp->i2_mv[1 + (2 * i4_i)] =
 1675|  4.09k|                                        ps_temp_1->i2_mv[1 + (2 * i4_i)];
 1676|  4.09k|                                    i4_updated_flag = SVCD_TRUE;
  ------------------
  |  |   46|  4.09k|#define SVCD_TRUE 1
  ------------------
 1677|  4.09k|                                }
 1678|       |
 1679|  11.8k|                                if(SVCD_FALSE == i4_updated_flag)
  ------------------
  |  |   45|  11.8k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1679:36): [True: 7.76k, False: 4.09k]
  ------------------
 1680|  7.76k|                                {
 1681|  7.76k|                                    ps_temp_1 = ps_motion_pred + (i4_xp << 1) + i4_xs;
 1682|       |
 1683|  7.76k|                                    ps_temp_1 += 4 * ((i4_yp << 1) + 1 - i4_ys);
 1684|       |
 1685|  7.76k|                                    if(ai4_temp_ref_indx[i4_i][2 * i4_yp + i4_xp] ==
  ------------------
  |  Branch (1685:40): [True: 7.43k, False: 336]
  ------------------
 1686|  7.76k|                                       ps_temp_1->i1_ref_frame[i4_i])
 1687|  7.43k|                                    {
 1688|  7.43k|                                        ps_temp->i2_mv[2 * i4_i] = ps_temp_1->i2_mv[2 * i4_i];
 1689|       |
 1690|  7.43k|                                        ps_temp->i2_mv[1 + (2 * i4_i)] =
 1691|  7.43k|                                            ps_temp_1->i2_mv[1 + (2 * i4_i)];
 1692|  7.43k|                                        i4_updated_flag = SVCD_TRUE;
  ------------------
  |  |   46|  7.43k|#define SVCD_TRUE 1
  ------------------
 1693|  7.43k|                                    }
 1694|  7.76k|                                }
 1695|  11.8k|                                if(SVCD_FALSE == i4_updated_flag)
  ------------------
  |  |   45|  11.8k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1695:36): [True: 336, False: 11.5k]
  ------------------
 1696|    336|                                {
 1697|    336|                                    ps_temp_1 = ps_motion_pred + (i4_xp << 1) + (1 - i4_xs);
 1698|    336|                                    ps_temp_1 += 4 * ((i4_yp << 1) + 1 - i4_ys);
 1699|       |
 1700|    336|                                    ps_temp->i2_mv[2 * i4_i] = ps_temp_1->i2_mv[2 * i4_i];
 1701|       |
 1702|    336|                                    ps_temp->i2_mv[1 + (2 * i4_i)] =
 1703|    336|                                        ps_temp_1->i2_mv[1 + (2 * i4_i)];
 1704|       |
 1705|    336|                                    i4_updated_flag = SVCD_TRUE;
  ------------------
  |  |   46|    336|#define SVCD_TRUE 1
  ------------------
 1706|    336|                                }
 1707|  11.8k|                            } /* end of replacement of mv based on ref indx */
 1708|  2.29M|                        }     /* end of loop over sub partition xs */
 1709|  1.14M|                    }         /* end of loop over sub partition ys */
 1710|   573k|                }             /* end of loop over partition xp */
 1711|   286k|            }                 /* end of loop over partition yp */
 1712|   143k|        }                     /* end of loop over lists */
 1713|   121k|    }
 1714|       |
 1715|       |    /************************************************************************/
 1716|       |    /* if restircted saptial resolution change flag is 0                    */
 1717|       |    /* modify the reference indixes and motion vectors                      */
 1718|       |    /************************************************************************/
 1719|   121k|    if((SVCD_FALSE == ps_lyr_mem->ps_curr_lyr_res_prms->u1_rstrct_res_change_flag) &&
  ------------------
  |  |   45|   121k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1719:8): [True: 121k, False: 0]
  ------------------
 1720|   121k|       (2 == i4_listx) && (SVCD_TRUE == ps_ctxt->u1_direct_8x8_inference_flag))
  ------------------
  |  |   46|  21.3k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1720:8): [True: 21.3k, False: 100k]
  |  Branch (1720:27): [True: 5.07k, False: 16.2k]
  ------------------
 1721|  5.07k|    {
 1722|       |        /* only applicable for EB Slice */
 1723|       |        /* store the corner 4x4 motion vectors to the whole block */
 1724|       |        /* 2 lists and 4 partitions */
 1725|  5.07k|        mot_vec_t s_temp_mv[2][4];
 1726|  5.07k|        WORD32 i4_xp, i4_yp;
 1727|  5.07k|        memset(&s_temp_mv[0][0], 0, sizeof(s_temp_mv));
 1728|       |
 1729|  15.2k|        for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1729:23): [True: 10.1k, False: 5.07k]
  ------------------
 1730|  10.1k|        {
 1731|  10.1k|            s_temp_mv[i4_i][0].i2_mv_x = ps_motion_pred[0].i2_mv[2 * i4_i];
 1732|  10.1k|            s_temp_mv[i4_i][0].i2_mv_y = ps_motion_pred[0].i2_mv[1 + (2 * i4_i)];
 1733|       |
 1734|  10.1k|            s_temp_mv[i4_i][1].i2_mv_x = ps_motion_pred[3].i2_mv[2 * i4_i];
 1735|  10.1k|            s_temp_mv[i4_i][1].i2_mv_y = ps_motion_pred[3].i2_mv[1 + (2 * i4_i)];
 1736|       |
 1737|  10.1k|            s_temp_mv[i4_i][2].i2_mv_x = ps_motion_pred[12].i2_mv[2 * i4_i];
 1738|  10.1k|            s_temp_mv[i4_i][2].i2_mv_y = ps_motion_pred[12].i2_mv[1 + (2 * i4_i)];
 1739|       |
 1740|  10.1k|            s_temp_mv[i4_i][3].i2_mv_x = ps_motion_pred[15].i2_mv[2 * i4_i];
 1741|  10.1k|            s_temp_mv[i4_i][3].i2_mv_y = ps_motion_pred[15].i2_mv[1 + (2 * i4_i)];
 1742|       |
 1743|  10.1k|        } /* end of loop over lists */
 1744|       |
 1745|       |        /* replace the motion vectors */
 1746|  15.2k|        for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1746:23): [True: 10.1k, False: 5.07k]
  ------------------
 1747|  10.1k|        {
 1748|  50.7k|            for(i4_yp = 0; i4_yp < 4; i4_yp++)
  ------------------
  |  Branch (1748:28): [True: 40.6k, False: 10.1k]
  ------------------
 1749|  40.6k|            {
 1750|   203k|                for(i4_xp = 0; i4_xp < 4; i4_xp++)
  ------------------
  |  Branch (1750:32): [True: 162k, False: 40.6k]
  ------------------
 1751|   162k|                {
 1752|   162k|                    mv_pred_t *ps_temp;
 1753|   162k|                    ps_temp = ps_motion_pred + i4_xp;
 1754|   162k|                    ps_temp += 4 * i4_yp;
 1755|       |
 1756|   162k|                    ps_temp->i2_mv[2 * i4_i] =
 1757|   162k|                        s_temp_mv[i4_i][2 * (i4_yp >> 1) + (i4_xp >> 1)].i2_mv_x;
 1758|       |
 1759|   162k|                    ps_temp->i2_mv[1 + (2 * i4_i)] =
 1760|   162k|                        s_temp_mv[i4_i][2 * (i4_yp >> 1) + (i4_xp >> 1)].i2_mv_y;
 1761|       |
 1762|   162k|                } /* end of loop over sub partitions xp */
 1763|  40.6k|            }     /* end of loop over sub partitions yp */
 1764|  10.1k|        }         /* end of loop over lists */
 1765|  5.07k|    }
 1766|       |
 1767|       |    /* store the final reference index for all sub partitions */
 1768|       |    /* approporiate reference index is stored for each 4x4 belonging to 8x8 */
 1769|   121k|    {
 1770|   121k|        WORD32 i4_xp, i4_yp;
 1771|       |
 1772|   265k|        for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1772:23): [True: 143k, False: 121k]
  ------------------
 1773|   143k|        {
 1774|   716k|            for(i4_yp = 0; i4_yp < 4; i4_yp++)
  ------------------
  |  Branch (1774:28): [True: 573k, False: 143k]
  ------------------
 1775|   573k|            {
 1776|  2.86M|                for(i4_xp = 0; i4_xp < 4; i4_xp++)
  ------------------
  |  Branch (1776:32): [True: 2.29M, False: 573k]
  ------------------
 1777|  2.29M|                {
 1778|  2.29M|                    mv_pred_t *ps_temp;
 1779|  2.29M|                    ps_temp = ps_motion_pred + i4_xp;
 1780|  2.29M|                    ps_temp += 4 * i4_yp;
 1781|       |
 1782|  2.29M|                    ps_temp->i1_ref_frame[i4_i] =
 1783|  2.29M|                        ai4_temp_ref_indx[i4_i][2 * (i4_yp >> 1) + (i4_xp >> 1)];
 1784|       |
 1785|  2.29M|                } /* end of loop over partition xp */
 1786|   573k|            }     /* end of loop over partition yp */
 1787|   143k|        }         /* end of loop over lists */
 1788|   121k|    }
 1789|       |
 1790|       |    /********************************************************************/
 1791|       |    /* modify the motion vectors for non dyadic cases, set the mv       */
 1792|       |    /* threshold appropraitely to derive the sub MB type                */
 1793|       |    /********************************************************************/
 1794|   121k|    if(SVCD_FALSE == ps_lyr_mem->ps_curr_lyr_res_prms->u1_rstrct_res_change_flag)
  ------------------
  |  |   45|   121k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1794:8): [True: 121k, False: 0]
  ------------------
 1795|   121k|    {
 1796|       |        /* non dyadic cases set the mv treshold to 1 */
 1797|   121k|        i4_mv_treshold = 1;
 1798|   121k|    }
 1799|      0|    else
 1800|      0|    {
 1801|       |        /* dyadic cases set the mv treshold to 0 */
 1802|      0|        i4_mv_treshold = 0;
 1803|      0|    }
 1804|       |
 1805|       |    /* modify the motion vectors and get sub mb mode if base mode flag is 1 */
 1806|   121k|    if((SVCD_FALSE == ps_lyr_mem->ps_curr_lyr_res_prms->u1_rstrct_res_change_flag) ||
  ------------------
  |  |   45|   121k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1806:8): [True: 121k, False: 0]
  ------------------
 1807|      0|       (1 == ps_svc_mb_params->u1_base_mode_flag))
  ------------------
  |  Branch (1807:8): [True: 0, False: 0]
  ------------------
 1808|   121k|    {
 1809|   121k|        WORD32 i4_xp, i4_yp;
 1810|   365k|        for(i4_yp = 0; i4_yp < 2; i4_yp++)
  ------------------
  |  Branch (1810:24): [True: 243k, False: 121k]
  ------------------
 1811|   243k|        {
 1812|   731k|            for(i4_xp = 0; i4_xp < 2; i4_xp++)
  ------------------
  |  Branch (1812:28): [True: 487k, False: 243k]
  ------------------
 1813|   487k|            {
 1814|   487k|                mv_pred_t *ps_temp;
 1815|   487k|                WORD32 i4_part_size = 0;
 1816|   487k|                WORD32 i4_horz1_match, i4_vert1_match;
 1817|   487k|                WORD32 i4_horz2_match, i4_vert2_match;
 1818|   487k|                WORD32 i4_diag_match;
 1819|       |
 1820|   487k|                WORD32 i4_8x8_match, i4_horz_match, i4_vert_match;
 1821|   487k|                WORD32 i4_mv_x, i4_mv_y;
 1822|       |
 1823|   487k|                ps_temp = ps_motion_pred + (i4_xp << 1);
 1824|   487k|                ps_temp += 4 * ((i4_yp << 1));
 1825|       |
 1826|       |                /* default init */
 1827|   487k|                i4_8x8_match = i4_horz_match = i4_vert_match = SVCD_TRUE;
  ------------------
  |  |   46|   487k|#define SVCD_TRUE 1
  ------------------
 1828|       |
 1829|       |                /* check if the mv diff in horz direction is under threshold*/
 1830|   487k|                i4_horz1_match =
 1831|   487k|                    isvcd_check_mv_diff(ps_temp, (ps_temp + 1), i4_listx, i4_mv_treshold);
 1832|       |
 1833|   487k|                i4_horz2_match =
 1834|   487k|                    isvcd_check_mv_diff((ps_temp + 4), (ps_temp + 4 + 1), i4_listx, i4_mv_treshold);
 1835|       |
 1836|       |                /* check if the mv diff in horz direction is under threshold*/
 1837|   487k|                i4_vert1_match =
 1838|   487k|                    isvcd_check_mv_diff(ps_temp, (ps_temp + 4), i4_listx, i4_mv_treshold);
 1839|       |
 1840|   487k|                i4_vert2_match =
 1841|   487k|                    isvcd_check_mv_diff((ps_temp + 1), (ps_temp + 4 + 1), i4_listx, i4_mv_treshold);
 1842|       |
 1843|       |                /* check if in diagonal direction is under threshold*/
 1844|   487k|                i4_diag_match =
 1845|   487k|                    isvcd_check_mv_diff(ps_temp, (ps_temp + 4 + 1), i4_listx, i4_mv_treshold);
 1846|       |
 1847|       |                /* calculate the excat matching points*/
 1848|   487k|                i4_8x8_match = i4_8x8_match && i4_horz1_match && i4_vert1_match && i4_diag_match;
  ------------------
  |  Branch (1848:32): [True: 487k, False: 0]
  |  Branch (1848:48): [True: 479k, False: 8.35k]
  |  Branch (1848:66): [True: 473k, False: 5.50k]
  |  Branch (1848:84): [True: 473k, False: 236]
  ------------------
 1849|   487k|                i4_horz_match = i4_horz_match && i4_horz1_match && i4_horz2_match;
  ------------------
  |  Branch (1849:33): [True: 487k, False: 0]
  |  Branch (1849:50): [True: 479k, False: 8.35k]
  |  Branch (1849:68): [True: 479k, False: 363]
  ------------------
 1850|   487k|                i4_vert_match = i4_vert_match && i4_vert1_match && i4_vert2_match;
  ------------------
  |  Branch (1850:33): [True: 487k, False: 0]
  |  Branch (1850:50): [True: 481k, False: 6.03k]
  |  Branch (1850:68): [True: 481k, False: 367]
  ------------------
 1851|       |
 1852|       |                /* modify the motion vectors appropriately */
 1853|       |
 1854|  1.06M|                for(i4_i = 0; i4_i < i4_listx; i4_i++)
  ------------------
  |  Branch (1854:31): [True: 573k, False: 487k]
  ------------------
 1855|   573k|                {
 1856|       |                    /* 8x8 mode all the 4 blocks are under threshold */
 1857|   573k|                    if(SVCD_TRUE == i4_8x8_match)
  ------------------
  |  |   46|   573k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1857:24): [True: 558k, False: 15.0k]
  ------------------
 1858|   558k|                    {
 1859|       |                        /* calculate the avarage */
 1860|   558k|                        i4_mv_x =
 1861|   558k|                            ((ps_temp[0].i2_mv[2 * i4_i]) + (ps_temp[1].i2_mv[2 * i4_i]) +
 1862|   558k|                             (ps_temp[4].i2_mv[2 * i4_i]) + (ps_temp[5].i2_mv[2 * i4_i] + 2)) >>
 1863|   558k|                            2;
 1864|       |
 1865|   558k|                        i4_mv_y = ((ps_temp[0].i2_mv[1 + (2 * i4_i)]) +
 1866|   558k|                                   (ps_temp[1].i2_mv[1 + (2 * i4_i)]) +
 1867|   558k|                                   (ps_temp[4].i2_mv[1 + (2 * i4_i)]) +
 1868|   558k|                                   (ps_temp[5].i2_mv[1 + (2 * i4_i)] + 2)) >>
 1869|   558k|                                  2;
 1870|       |
 1871|       |                        /* store the modified motion vectors */
 1872|   558k|                        ps_temp[0].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1873|   558k|                        ps_temp[1].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1874|   558k|                        ps_temp[4].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1875|   558k|                        ps_temp[5].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1876|       |
 1877|   558k|                        ps_temp[0].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1878|   558k|                        ps_temp[1].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1879|   558k|                        ps_temp[4].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1880|   558k|                        ps_temp[5].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1881|       |
 1882|       |                        /* store the sub mb partition size */
 1883|   558k|                        i4_part_size = SUBMB_8x8;
  ------------------
  |  |  501|   558k|#define SUBMB_8x8    0
  ------------------
 1884|   558k|                    }
 1885|       |                    /* 8x4 mode  */
 1886|  15.0k|                    else if(SVCD_TRUE == i4_horz_match)
  ------------------
  |  |   46|  15.0k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1886:29): [True: 6.09k, False: 8.91k]
  ------------------
 1887|  6.09k|                    {
 1888|       |                        /* horizontal directional merging */
 1889|       |                        /* calculate the average of first two and store back*/
 1890|  6.09k|                        i4_mv_x =
 1891|  6.09k|                            ((ps_temp[0].i2_mv[2 * i4_i]) + (ps_temp[1].i2_mv[2 * i4_i] + 1)) >> 1;
 1892|       |
 1893|  6.09k|                        i4_mv_y = ((ps_temp[0].i2_mv[1 + (2 * i4_i)]) +
 1894|  6.09k|                                   (ps_temp[1].i2_mv[1 + (2 * i4_i)] + 1)) >>
 1895|  6.09k|                                  1;
 1896|       |
 1897|  6.09k|                        ps_temp[0].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1898|  6.09k|                        ps_temp[1].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1899|       |
 1900|  6.09k|                        ps_temp[0].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1901|  6.09k|                        ps_temp[1].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1902|       |
 1903|       |                        /* calculate the average of next two and store back*/
 1904|  6.09k|                        i4_mv_x =
 1905|  6.09k|                            ((ps_temp[4].i2_mv[2 * i4_i]) + (ps_temp[5].i2_mv[2 * i4_i] + 1)) >> 1;
 1906|       |
 1907|  6.09k|                        i4_mv_y = ((ps_temp[4].i2_mv[1 + (2 * i4_i)]) +
 1908|  6.09k|                                   (ps_temp[5].i2_mv[1 + (2 * i4_i)] + 1)) >>
 1909|  6.09k|                                  1;
 1910|       |
 1911|  6.09k|                        ps_temp[4].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1912|  6.09k|                        ps_temp[5].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1913|       |
 1914|  6.09k|                        ps_temp[4].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1915|  6.09k|                        ps_temp[5].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1916|       |                        /* store the sub mb partition size */
 1917|  6.09k|                        i4_part_size = SUBMB_8x4;
  ------------------
  |  |  502|  6.09k|#define SUBMB_8x4    1
  ------------------
 1918|  6.09k|                    }
 1919|       |                    /* 4x8 mode all the 4 blocks are under threshold */
 1920|  8.91k|                    else if(SVCD_TRUE == i4_vert_match)
  ------------------
  |  |   46|  8.91k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1920:29): [True: 7.87k, False: 1.04k]
  ------------------
 1921|  7.87k|                    {
 1922|       |                        /* vertical directional merging */
 1923|  7.87k|                        i4_mv_x =
 1924|  7.87k|                            ((ps_temp[0].i2_mv[2 * i4_i]) + (ps_temp[4].i2_mv[2 * i4_i] + 1)) >> 1;
 1925|       |
 1926|  7.87k|                        i4_mv_y = ((ps_temp[0].i2_mv[1 + (2 * i4_i)]) +
 1927|  7.87k|                                   (ps_temp[4].i2_mv[1 + (2 * i4_i)] + 1)) >>
 1928|  7.87k|                                  1;
 1929|       |
 1930|  7.87k|                        ps_temp[0].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1931|  7.87k|                        ps_temp[4].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1932|       |
 1933|  7.87k|                        ps_temp[0].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1934|  7.87k|                        ps_temp[4].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1935|       |
 1936|       |                        /* calculate the average of next two and store back*/
 1937|  7.87k|                        i4_mv_x =
 1938|  7.87k|                            ((ps_temp[1].i2_mv[2 * i4_i]) + (ps_temp[5].i2_mv[2 * i4_i] + 1)) >> 1;
 1939|       |
 1940|  7.87k|                        i4_mv_y = ((ps_temp[1].i2_mv[1 + (2 * i4_i)]) +
 1941|  7.87k|                                   (ps_temp[5].i2_mv[1 + (2 * i4_i)] + 1)) >>
 1942|  7.87k|                                  1;
 1943|       |
 1944|  7.87k|                        ps_temp[1].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1945|  7.87k|                        ps_temp[5].i2_mv[2 * i4_i] = (WORD16) i4_mv_x;
 1946|       |
 1947|  7.87k|                        ps_temp[1].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1948|  7.87k|                        ps_temp[5].i2_mv[1 + (2 * i4_i)] = (WORD16) i4_mv_y;
 1949|       |                        /* store the sub mb partition size */
 1950|  7.87k|                        i4_part_size = SUBMB_4x8;
  ------------------
  |  |  503|  7.87k|#define SUBMB_4x8    2
  ------------------
 1951|  7.87k|                    }
 1952|  1.04k|                    else
 1953|  1.04k|                    {
 1954|       |                        /* store the sub mb partition size */
 1955|  1.04k|                        i4_part_size = SUBMB_4x4;
  ------------------
  |  |  504|  1.04k|#define SUBMB_4x4    3
  ------------------
 1956|  1.04k|                    }
 1957|       |
 1958|   573k|                } /* end of loop over lists */
 1959|       |
 1960|       |                /* store the sub MB type B slice */
 1961|   487k|                if(2 == i4_listx)
  ------------------
  |  Branch (1961:20): [True: 85.3k, False: 402k]
  ------------------
 1962|  85.3k|                {
 1963|  85.3k|                    WORD32 i4_part_mode_a;
 1964|  85.3k|                    WORD32 i4_indx;
 1965|       |
 1966|  85.3k|                    i4_part_mode_a = 0;
 1967|       |                    /* check the 0th partiton reference indices */
 1968|  85.3k|                    if(0 <= ps_temp[0].i1_ref_frame[0])
  ------------------
  |  Branch (1968:24): [True: 70.1k, False: 15.1k]
  ------------------
 1969|  70.1k|                    {
 1970|  70.1k|                        i4_part_mode_a += 1;
 1971|  70.1k|                    }
 1972|  85.3k|                    if(0 <= ps_temp[0].i1_ref_frame[1])
  ------------------
  |  Branch (1972:24): [True: 49.0k, False: 36.3k]
  ------------------
 1973|  49.0k|                    {
 1974|  49.0k|                        i4_part_mode_a += 2;
 1975|  49.0k|                    }
 1976|  85.3k|                    i4_indx = 3 * i4_part_size + (i4_part_mode_a - 1);
 1977|       |
 1978|  85.3k|                    pi4_sub_mb_mode[2 * i4_yp + i4_xp] = g_au1_eb_submb_type[i4_indx];
 1979|  85.3k|                }
 1980|       |                /* P slice */
 1981|   402k|                else
 1982|   402k|                {
 1983|   402k|                    pi4_sub_mb_mode[2 * i4_yp + i4_xp] = g_au1_ep_submb_type[i4_part_size];
 1984|   402k|                }
 1985|   487k|            } /* end of loop over partition xp */
 1986|       |
 1987|   243k|        }     /* end of loop over partition yp */
 1988|   121k|    }
 1989|       |
 1990|   121k|    return;
 1991|   121k|}
isvcd_interlyr_mbmode_pred_bmb:
 2020|  30.1k|{
 2021|  30.1k|    WORD32 i4_part_mode_a, i4_part_mode_b;
 2022|  30.1k|    WORD32 i4_idx;
 2023|  30.1k|    dec_mb_info_t *ps_mb_params = (dec_mb_info_t *) pv_mb_params;
 2024|  30.1k|    parse_part_params_t *ps_part = (parse_part_params_t *) pv_part;
 2025|       |
 2026|  30.1k|    UNUSED(ps_ctxt);
  ------------------
  |  |   45|  30.1k|#define UNUSED(x) ((void)(x))
  ------------------
 2027|       |
 2028|  30.1k|    i4_part_mode_a = 0;
 2029|       |
 2030|       |    /* check the 0th partiton reference indices */
 2031|  30.1k|    if(PRED_8x8 != i4_part_size)
  ------------------
  |  |  453|  30.1k|#define PRED_8x8    3
  ------------------
  |  Branch (2031:8): [True: 26.3k, False: 3.75k]
  ------------------
 2032|  26.3k|    {
 2033|  26.3k|        if(0 <= ps_motion_pred[0].i1_ref_frame[0])
  ------------------
  |  Branch (2033:12): [True: 22.6k, False: 3.70k]
  ------------------
 2034|  22.6k|        {
 2035|  22.6k|            i4_part_mode_a += 1;
 2036|  22.6k|        }
 2037|  26.3k|        if(0 <= ps_motion_pred[0].i1_ref_frame[1])
  ------------------
  |  Branch (2037:12): [True: 12.9k, False: 13.4k]
  ------------------
 2038|  12.9k|        {
 2039|  12.9k|            i4_part_mode_a += 2;
 2040|  12.9k|        }
 2041|  26.3k|    }
 2042|       |
 2043|       |    /* check the 15th partiton reference indices */
 2044|       |    /* this done since all the reference indices will be replicated */
 2045|  30.1k|    i4_part_mode_b = 0;
 2046|       |
 2047|  30.1k|    if((PRED_16x8 == i4_part_size) || (PRED_8x16 == i4_part_size))
  ------------------
  |  |  451|  30.1k|#define PRED_16x8   1
  ------------------
                  if((PRED_16x8 == i4_part_size) || (PRED_8x16 == i4_part_size))
  ------------------
  |  |  452|  27.3k|#define PRED_8x16   2
  ------------------
  |  Branch (2047:8): [True: 2.78k, False: 27.3k]
  |  Branch (2047:39): [True: 1.59k, False: 25.7k]
  ------------------
 2048|  4.37k|    {
 2049|  4.37k|        ps_motion_pred += (3 * i4_cur_mot_stride) + 3;
 2050|       |
 2051|  4.37k|        if(0 <= ps_motion_pred[0].i1_ref_frame[0])
  ------------------
  |  Branch (2051:12): [True: 3.23k, False: 1.14k]
  ------------------
 2052|  3.23k|        {
 2053|  3.23k|            i4_part_mode_b += 1;
 2054|  3.23k|        }
 2055|  4.37k|        if(0 <= ps_motion_pred[0].i1_ref_frame[1])
  ------------------
  |  Branch (2055:12): [True: 1.83k, False: 2.53k]
  ------------------
 2056|  1.83k|        {
 2057|  1.83k|            i4_part_mode_b += 2;
 2058|  1.83k|        }
 2059|  4.37k|    }
 2060|       |    /* update the pred modes for B cases */
 2061|       |    /* If partition size is not equal to 8x8 */
 2062|       |    /* then update the prediciton mode of    */
 2063|       |    /* partitions                            */
 2064|  30.1k|    if(PRED_8x8 != i4_part_size)
  ------------------
  |  |  453|  30.1k|#define PRED_8x8    3
  ------------------
  |  Branch (2064:8): [True: 26.3k, False: 3.75k]
  ------------------
 2065|  26.3k|    {
 2066|  26.3k|        UWORD8 u1_pred_mode_part0;
 2067|  26.3k|        UWORD8 u1_pred_mode_part1;
 2068|       |
 2069|  26.3k|        i4_idx = 3 * i4_part_size;
 2070|  26.3k|        i4_idx += 3 * (i4_part_mode_a - 1);
 2071|  26.3k|        i4_part_mode_b = (i4_part_mode_b > 0) ? i4_part_mode_b : 1;
  ------------------
  |  Branch (2071:26): [True: 4.37k, False: 21.9k]
  ------------------
 2072|  26.3k|        i4_idx += (i4_part_mode_b - 1);
 2073|  26.3k|        i4_idx = (i4_idx < 0) ? 0 : i4_idx;
  ------------------
  |  Branch (2073:18): [True: 0, False: 26.3k]
  ------------------
 2074|       |        /* Get the mb type                     */
 2075|       |        /* From mb type - get prediciton modes */
 2076|       |        /*  of parttions                       */
 2077|       |        /* Update the prediciton mode parma of */
 2078|       |        /* mb param structure                  */
 2079|       |
 2080|  26.3k|        ps_mb_params->u1_mb_type = g_au1_eb_mb_type[i4_idx + (6 * i4_part_size)];
 2081|  26.3k|        u1_pred_mode_part0 = g_au1_mb_pred_mode[0][5 + ps_mb_params->u1_mb_type];
 2082|  26.3k|        u1_pred_mode_part1 = g_au1_mb_pred_mode[1][5 + ps_mb_params->u1_mb_type];
 2083|  26.3k|        ps_part[0].u1_pred_mode = u1_pred_mode_part0;
 2084|  26.3k|        ps_part[1].u1_pred_mode = u1_pred_mode_part1;
 2085|  26.3k|    }
 2086|  3.75k|    else
 2087|  3.75k|    {
 2088|  3.75k|        WORD32 i4_i, i4_ctr, i4_num_submb_part;
 2089|  3.75k|        UWORD8 u1_sub_mb_type, u1_sub_mb_mc_mode;
 2090|  3.75k|        UWORD8 u1_pred_mode;
 2091|       |
 2092|  3.75k|        ps_mb_params->u1_mb_type = B_8x8;
  ------------------
  |  |  480|  3.75k|#define B_8x8    22
  ------------------
 2093|       |
 2094|  18.7k|        for(i4_i = 0; i4_i < NUM_MB_PARTS; i4_i++)
  ------------------
  |  |   59|  18.7k|#define NUM_MB_PARTS 4
  ------------------
  |  Branch (2094:23): [True: 15.0k, False: 3.75k]
  ------------------
 2095|  15.0k|        {
 2096|  15.0k|            u1_sub_mb_type = (UWORD8) pi4_sub_mb_mode[i4_i];
 2097|       |
 2098|  15.0k|            u1_sub_mb_mc_mode = gau1_ih264d_submb_mc_mode[4 + u1_sub_mb_type];
 2099|  15.0k|            i4_num_submb_part = g_au1_num_sub_mb_part[u1_sub_mb_mc_mode];
 2100|  15.0k|            *pu1_col_info |= (u1_sub_mb_mc_mode << 4);
 2101|  15.0k|            pu1_col_info++;
 2102|  15.0k|            u1_pred_mode = g_au1_sub_mb_pred_mode[4 + u1_sub_mb_type];
 2103|  46.7k|            for(i4_ctr = 0; i4_ctr < i4_num_submb_part; i4_ctr++)
  ------------------
  |  Branch (2103:29): [True: 31.6k, False: 15.0k]
  ------------------
 2104|  31.6k|            {
 2105|  31.6k|                ps_part->u1_pred_mode = u1_pred_mode;
 2106|  31.6k|                ps_part++;
 2107|  31.6k|            }
 2108|  15.0k|        }
 2109|  3.75k|    }
 2110|       |
 2111|  30.1k|    return;
 2112|  30.1k|}
isvcd_populate_ref_idx:
 2139|  29.5k|{
 2140|  29.5k|    UWORD8 u1_mot_pred_flag;
 2141|  29.5k|    WORD32 i4_lx;
 2142|       |
 2143|  75.9k|    for(i4_lx = 0; i4_lx < i4_listx; i4_lx++)
  ------------------
  |  Branch (2143:20): [True: 46.4k, False: 29.5k]
  ------------------
 2144|  46.4k|    {
 2145|  46.4k|        u1_mot_pred_flag = ps_svc_mb_params->au1_motion_pred_flag[i4_lx];
 2146|       |
 2147|  46.4k|        if((PRED_16x16 == ps_mb_params->u1_mb_mc_mode) && (u1_mot_pred_flag & 0x1))
  ------------------
  |  |  450|  46.4k|#define PRED_16x16  0
  ------------------
  |  Branch (2147:12): [True: 18.1k, False: 28.2k]
  |  Branch (2147:59): [True: 12.0k, False: 6.12k]
  ------------------
 2148|  12.0k|        {
 2149|  12.0k|            ps_mb_part_info->i1_ref_idx[i4_lx][0] = ps_motion_pred[0].i1_ref_frame[i4_lx];
 2150|  12.0k|        }
 2151|  34.3k|        else if((PRED_8x16 == ps_mb_params->u1_mb_mc_mode))
  ------------------
  |  |  452|  34.3k|#define PRED_8x16   2
  ------------------
  |  Branch (2151:17): [True: 10.1k, False: 24.1k]
  ------------------
 2152|  10.1k|        {
 2153|  10.1k|            if(u1_mot_pred_flag & 0x01)
  ------------------
  |  Branch (2153:16): [True: 2.99k, False: 7.16k]
  ------------------
 2154|  2.99k|            {
 2155|  2.99k|                ps_mb_part_info->i1_ref_idx[i4_lx][0] = ps_motion_pred[0].i1_ref_frame[i4_lx];
 2156|  2.99k|            }
 2157|  10.1k|            if(u1_mot_pred_flag & 0x02)
  ------------------
  |  Branch (2157:16): [True: 5.55k, False: 4.60k]
  ------------------
 2158|  5.55k|            {
 2159|  5.55k|                ps_mb_part_info->i1_ref_idx[i4_lx][1] = ps_motion_pred[2].i1_ref_frame[i4_lx];
 2160|  5.55k|            }
 2161|  10.1k|        }
 2162|  24.1k|        else if((PRED_16x8 == ps_mb_params->u1_mb_mc_mode))
  ------------------
  |  |  451|  24.1k|#define PRED_16x8   1
  ------------------
  |  Branch (2162:17): [True: 7.02k, False: 17.1k]
  ------------------
 2163|  7.02k|        {
 2164|  7.02k|            if(u1_mot_pred_flag & 0x01)
  ------------------
  |  Branch (2164:16): [True: 4.20k, False: 2.81k]
  ------------------
 2165|  4.20k|            {
 2166|  4.20k|                ps_mb_part_info->i1_ref_idx[i4_lx][0] = ps_motion_pred[0].i1_ref_frame[i4_lx];
 2167|  4.20k|            }
 2168|  7.02k|            if(u1_mot_pred_flag & 0x02)
  ------------------
  |  Branch (2168:16): [True: 4.88k, False: 2.13k]
  ------------------
 2169|  4.88k|            {
 2170|  4.88k|                ps_mb_part_info->i1_ref_idx[i4_lx][1] = ps_motion_pred[8].i1_ref_frame[i4_lx];
 2171|  4.88k|            }
 2172|  7.02k|        }
 2173|  17.1k|        else if((PRED_8x8 == ps_mb_params->u1_mb_mc_mode))
  ------------------
  |  |  453|  17.1k|#define PRED_8x8    3
  ------------------
  |  Branch (2173:17): [True: 10.9k, False: 6.17k]
  ------------------
 2174|  10.9k|        {
 2175|  10.9k|            if(u1_mot_pred_flag & 0x01)
  ------------------
  |  Branch (2175:16): [True: 4.19k, False: 6.78k]
  ------------------
 2176|  4.19k|            {
 2177|  4.19k|                ps_mb_part_info->i1_ref_idx[i4_lx][0] = ps_motion_pred[0].i1_ref_frame[i4_lx];
 2178|  4.19k|            }
 2179|  10.9k|            if(u1_mot_pred_flag & 0x02)
  ------------------
  |  Branch (2179:16): [True: 4.09k, False: 6.88k]
  ------------------
 2180|  4.09k|            {
 2181|  4.09k|                ps_mb_part_info->i1_ref_idx[i4_lx][1] = ps_motion_pred[2].i1_ref_frame[i4_lx];
 2182|  4.09k|            }
 2183|  10.9k|            if(u1_mot_pred_flag & 0x04)
  ------------------
  |  Branch (2183:16): [True: 5.34k, False: 5.63k]
  ------------------
 2184|  5.34k|            {
 2185|  5.34k|                ps_mb_part_info->i1_ref_idx[i4_lx][2] = ps_motion_pred[8].i1_ref_frame[i4_lx];
 2186|  5.34k|            }
 2187|  10.9k|            if(u1_mot_pred_flag & 0x08)
  ------------------
  |  Branch (2187:16): [True: 4.30k, False: 6.67k]
  ------------------
 2188|  4.30k|            {
 2189|  4.30k|                ps_mb_part_info->i1_ref_idx[i4_lx][3] = ps_motion_pred[10].i1_ref_frame[i4_lx];
 2190|  4.30k|            }
 2191|  10.9k|        }
 2192|  46.4k|    }
 2193|  29.5k|}
isvcd_interlyr_mbmode_pred:
 2223|   112k|{
 2224|       |    /*! Flow of the module is as follows                                   */
 2225|       |    /*! 1. it checks if all the sub mb modes are 8x8 modes                 */
 2226|       |    /*! 2. it matches the motion vectors at 8x8 level and computes the
 2227|       |           partiton size. store the same in the part type of mb params     */
 2228|       |    /*! 3. stores the pred modes based on slcie type and reference indices */
 2229|       |    /*! 4. stores the sub mb type in the mb params if teh part size is 8x8 */
 2230|   112k|    mode_motion_ctxt_t *ps_ctxt;
 2231|   112k|    mv_pred_t *ps_motion_pred;
 2232|   112k|    dec_mb_info_t *ps_mb_params;
 2233|   112k|    WORD32 i4_listx;
 2234|   112k|    WORD32 i4_part_size;
 2235|   112k|    WORD32 i4_mb_mode_flag;
 2236|   112k|    WORD32 i4_i;
 2237|   112k|    WORD32 i4_blk_mode;
 2238|   112k|    parse_part_params_t *ps_part = (parse_part_params_t *) pv_part;
 2239|   112k|    parse_pmbarams_t *ps_mb_part_info = (parse_pmbarams_t *) pv_mb_part_info;
 2240|   112k|    UWORD8 *pu1_col_info = ps_mb_part_info->u1_col_info;
 2241|   112k|    UNUSED(pv_dec);
  ------------------
  |  |   45|   112k|#define UNUSED(x) ((void)(x))
  ------------------
 2242|       |
 2243|   112k|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
 2244|   112k|    ps_motion_pred = ps_ctxt->ps_motion_pred_struct;
 2245|   112k|    ps_mb_params = (dec_mb_info_t *) pv_mb_params;
 2246|       |
 2247|       |    /*********** store the MB mode as inter *************************/
 2248|   112k|    *pi4_mb_mode = SVC_INTER_MB;
  ------------------
  |  |  114|   112k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
 2249|       |
 2250|       |    /***********************************************************************/
 2251|       |    /* derivation of part type                                             */
 2252|       |    /***********************************************************************/
 2253|   112k|    i4_listx = ps_ctxt->i4_listx;
 2254|       |
 2255|       |    /* set the mb mode derivation flag to false */
 2256|   112k|    i4_mb_mode_flag = SVCD_FALSE;
  ------------------
  |  |   45|   112k|#define SVCD_FALSE 0
  ------------------
 2257|       |
 2258|       |    /* for B and P slice different blk mod treshold */
 2259|   112k|    if(2 == i4_listx)
  ------------------
  |  Branch (2259:8): [True: 17.2k, False: 94.9k]
  ------------------
 2260|  17.2k|    {
 2261|  17.2k|        i4_blk_mode = B_BI_8x8;
  ------------------
  |  |  468|  17.2k|#define B_BI_8x8        3
  ------------------
 2262|  17.2k|    }
 2263|  94.9k|    else
 2264|  94.9k|    {
 2265|  94.9k|        i4_blk_mode = P_L0_8x8;
  ------------------
  |  |  459|  94.9k|#define P_L0_8x8    0
  ------------------
 2266|  94.9k|    }
 2267|       |
 2268|       |    /* set the mode derivation flag to true base on conditions */
 2269|   112k|    if((i4_blk_mode >= pi4_sub_mb_mode[0]) && (i4_blk_mode >= pi4_sub_mb_mode[1]) &&
  ------------------
  |  Branch (2269:8): [True: 109k, False: 2.22k]
  |  Branch (2269:47): [True: 106k, False: 3.50k]
  ------------------
 2270|   106k|       (i4_blk_mode >= pi4_sub_mb_mode[2]) && (i4_blk_mode >= pi4_sub_mb_mode[3]))
  ------------------
  |  Branch (2270:8): [True: 104k, False: 1.81k]
  |  Branch (2270:47): [True: 103k, False: 697]
  ------------------
 2271|   103k|    {
 2272|   103k|        i4_mb_mode_flag = SVCD_TRUE;
  ------------------
  |  |   46|   103k|#define SVCD_TRUE 1
  ------------------
 2273|   103k|    }
 2274|       |
 2275|       |    /* store the default 8x8 mode */
 2276|   112k|    ps_mb_part_info->u1_num_part = 4;
 2277|   112k|    i4_part_size = PRED_8x8;
  ------------------
  |  |  453|   112k|#define PRED_8x8    3
  ------------------
 2278|       |
 2279|       |    /* further check is present if all are 8x8 mode */
 2280|   112k|    if(SVCD_TRUE == i4_mb_mode_flag)
  ------------------
  |  |   46|   112k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2280:8): [True: 103k, False: 8.23k]
  ------------------
 2281|   103k|    {
 2282|   103k|        WORD32 i4_horz_match, i4_vert_match;
 2283|       |
 2284|       |        /* check if the motion in horz direction are same*/
 2285|   103k|        i4_horz_match = isvcd_check_motion(ps_motion_pred, (ps_motion_pred + 2), i4_listx);
 2286|   103k|        i4_horz_match += isvcd_check_motion((ps_motion_pred + 8), (ps_motion_pred + 10), i4_listx);
 2287|       |
 2288|       |        /* check if the motion in vertical direction is same */
 2289|   103k|        i4_vert_match = isvcd_check_motion(ps_motion_pred, (ps_motion_pred + 8), i4_listx);
 2290|   103k|        i4_vert_match += isvcd_check_motion((ps_motion_pred + 2), (ps_motion_pred + 10), i4_listx);
 2291|       |
 2292|       |        /* decide the partition size based on the results of matching */
 2293|   103k|        if((2 == i4_horz_match) && (2 == i4_vert_match))
  ------------------
  |  Branch (2293:12): [True: 94.5k, False: 9.38k]
  |  Branch (2293:36): [True: 88.9k, False: 5.60k]
  ------------------
 2294|  88.9k|        {
 2295|  88.9k|            ps_mb_params->u1_mb_type = P_L0_16x16;
 2296|  88.9k|            i4_part_size = PRED_16x16;
  ------------------
  |  |  450|  88.9k|#define PRED_16x16  0
  ------------------
 2297|  88.9k|            ps_mb_part_info->u1_num_part = 1;
 2298|  88.9k|            *pu1_col_info++ = (PRED_16x16 << 6);
  ------------------
  |  |  450|  88.9k|#define PRED_16x16  0
  ------------------
 2299|  88.9k|            ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2300|  88.9k|            if(2 == i4_listx) ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
  ------------------
  |  Branch (2300:16): [True: 10.9k, False: 77.9k]
  ------------------
 2301|       |
 2302|  88.9k|            ps_part->u1_partwidth = 4;  // interms of 4x4
 2303|  88.9k|            ps_part->u1_partheight = 4;
 2304|  88.9k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  88.9k|#define PRED_L0   1
  ------------------
 2305|  88.9k|            ps_part->u1_is_direct = 0;
 2306|  88.9k|            ps_part->u1_sub_mb_num = 0;
 2307|  88.9k|        }
 2308|  14.9k|        else if(2 == i4_horz_match)
  ------------------
  |  Branch (2308:17): [True: 5.60k, False: 9.38k]
  ------------------
 2309|  5.60k|        {
 2310|  5.60k|            i4_part_size = PRED_16x8;
  ------------------
  |  |  451|  5.60k|#define PRED_16x8   1
  ------------------
 2311|  5.60k|            ps_mb_params->u1_mb_type = P_L0_L0_16x8;
 2312|  5.60k|            ps_mb_part_info->u1_num_part = 2;
 2313|  5.60k|            *pu1_col_info++ = (PRED_16x8 << 6);
  ------------------
  |  |  451|  5.60k|#define PRED_16x8   1
  ------------------
 2314|  5.60k|            *pu1_col_info++ = (PRED_16x8 << 6);
  ------------------
  |  |  451|  5.60k|#define PRED_16x8   1
  ------------------
 2315|       |
 2316|  5.60k|            ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2317|  5.60k|            ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[8].i1_ref_frame[0];
 2318|  5.60k|            if(2 == i4_listx)
  ------------------
  |  Branch (2318:16): [True: 2.62k, False: 2.98k]
  ------------------
 2319|  2.62k|            {
 2320|  2.62k|                ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2321|  2.62k|                ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[8].i1_ref_frame[1];
 2322|  2.62k|            }
 2323|  5.60k|            ps_part->u1_partwidth = 4;  // interms of 4x4
 2324|  5.60k|            ps_part->u1_partheight = 2;
 2325|  5.60k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  5.60k|#define PRED_L0   1
  ------------------
 2326|  5.60k|            ps_part->u1_is_direct = 0;
 2327|  5.60k|            ps_part->u1_sub_mb_num = 0;
 2328|       |
 2329|  5.60k|            ps_part++;
 2330|  5.60k|            ps_part->u1_partwidth = 4;
 2331|  5.60k|            ps_part->u1_partheight = 2;
 2332|  5.60k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  5.60k|#define PRED_L0   1
  ------------------
 2333|  5.60k|            ps_part->u1_is_direct = 0;
 2334|  5.60k|            ps_part->u1_sub_mb_num = 8;
 2335|  5.60k|        }
 2336|  9.38k|        else if(2 == i4_vert_match)
  ------------------
  |  Branch (2336:17): [True: 3.79k, False: 5.59k]
  ------------------
 2337|  3.79k|        {
 2338|  3.79k|            ps_mb_params->u1_mb_type = P_L0_L0_8x16;
 2339|  3.79k|            i4_part_size = PRED_8x16;
  ------------------
  |  |  452|  3.79k|#define PRED_8x16   2
  ------------------
 2340|  3.79k|            ps_mb_part_info->u1_num_part = 2;
 2341|  3.79k|            *pu1_col_info++ = (PRED_8x16 << 6);
  ------------------
  |  |  452|  3.79k|#define PRED_8x16   2
  ------------------
 2342|  3.79k|            *pu1_col_info++ = (PRED_8x16 << 6);
  ------------------
  |  |  452|  3.79k|#define PRED_8x16   2
  ------------------
 2343|       |
 2344|  3.79k|            ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2345|  3.79k|            ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[2].i1_ref_frame[0];
 2346|  3.79k|            if(2 == i4_listx)
  ------------------
  |  Branch (2346:16): [True: 1.19k, False: 2.59k]
  ------------------
 2347|  1.19k|            {
 2348|  1.19k|                ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2349|  1.19k|                ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[2].i1_ref_frame[1];
 2350|  1.19k|            }
 2351|  3.79k|            ps_part->u1_partwidth = 2;  // interms of 4x4
 2352|  3.79k|            ps_part->u1_partheight = 4;
 2353|  3.79k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  3.79k|#define PRED_L0   1
  ------------------
 2354|  3.79k|            ps_part->u1_is_direct = 0;
 2355|  3.79k|            ps_part->u1_sub_mb_num = 0;
 2356|       |
 2357|  3.79k|            ps_part++;
 2358|  3.79k|            ps_part->u1_partwidth = 2;
 2359|  3.79k|            ps_part->u1_partheight = 4;
 2360|  3.79k|            ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  3.79k|#define PRED_L0   1
  ------------------
 2361|  3.79k|            ps_part->u1_is_direct = 0;
 2362|  3.79k|            ps_part->u1_sub_mb_num = 2;
 2363|  3.79k|        }
 2364|   103k|    }
 2365|       |
 2366|       |    /* store the part size to the mb params */
 2367|   112k|    ps_mb_params->u1_mb_mc_mode = i4_part_size;
 2368|       |
 2369|       |    /* in case of slice derive the partition modes */
 2370|       |
 2371|   112k|    {
 2372|       |        /* store the sub MB modes if 8x8 mode is choosen */
 2373|   112k|        if(PRED_8x8 == i4_part_size)
  ------------------
  |  |  453|   112k|#define PRED_8x8    3
  ------------------
  |  Branch (2373:12): [True: 13.8k, False: 98.3k]
  ------------------
 2374|  13.8k|        {
 2375|  13.8k|            UWORD8 u1_sub_mb_type, u1_sub_mb_mc_mode = 0;
 2376|       |
 2377|       |            /* for P_MB sub part type is same as sub mb type */
 2378|  13.8k|            ps_mb_params->u1_mb_type = P_8x8;
 2379|  13.8k|            ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred[0].i1_ref_frame[0];
 2380|  13.8k|            ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[2].i1_ref_frame[0];
 2381|  13.8k|            ps_mb_part_info->i1_ref_idx[0][2] = ps_motion_pred[8].i1_ref_frame[0];
 2382|  13.8k|            ps_mb_part_info->i1_ref_idx[0][3] = ps_motion_pred[10].i1_ref_frame[0];
 2383|  13.8k|            if(2 == i4_listx)
  ------------------
  |  Branch (2383:16): [True: 2.43k, False: 11.3k]
  ------------------
 2384|  2.43k|            {
 2385|  2.43k|                ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred[0].i1_ref_frame[1];
 2386|  2.43k|                ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[2].i1_ref_frame[1];
 2387|  2.43k|                ps_mb_part_info->i1_ref_idx[1][2] = ps_motion_pred[8].i1_ref_frame[1];
 2388|  2.43k|                ps_mb_part_info->i1_ref_idx[1][3] = ps_motion_pred[10].i1_ref_frame[1];
 2389|  2.43k|            }
 2390|       |
 2391|  13.8k|            ps_mb_part_info->u1_num_part = 0;
 2392|  69.1k|            for(i4_i = 0; i4_i < NUM_MB_PARTS; i4_i++)
  ------------------
  |  |   59|  69.1k|#define NUM_MB_PARTS 4
  ------------------
  |  Branch (2392:27): [True: 55.3k, False: 13.8k]
  ------------------
 2393|  55.3k|            {
 2394|  55.3k|                WORD32 i4_num_submb_part, i4_part_width, i4_part_height, i4_ctr;
 2395|  55.3k|                u1_sub_mb_type = (UWORD8) pi4_sub_mb_mode[i4_i];
 2396|       |
 2397|  55.3k|                if(1 == i4_listx)
  ------------------
  |  Branch (2397:20): [True: 45.5k, False: 9.73k]
  ------------------
 2398|  45.5k|                {
 2399|  45.5k|                    u1_sub_mb_mc_mode = gau1_ih264d_submb_mc_mode[u1_sub_mb_type];
 2400|  45.5k|                }
 2401|  9.73k|                else if(2 == i4_listx)
  ------------------
  |  Branch (2401:25): [True: 9.73k, False: 0]
  ------------------
 2402|  9.73k|                {
 2403|  9.73k|                    u1_sub_mb_mc_mode = gau1_ih264d_submb_mc_mode[4 + u1_sub_mb_type];
 2404|  9.73k|                }
 2405|  55.3k|                i4_num_submb_part = g_au1_num_sub_mb_part[u1_sub_mb_mc_mode];
 2406|       |
 2407|  55.3k|                ps_mb_part_info->u1_num_part += i4_num_submb_part;
 2408|       |
 2409|  55.3k|                i4_part_width = g_au1_sub_mb_part_wd[u1_sub_mb_mc_mode];
 2410|  55.3k|                i4_part_height = g_au1_sub_mb_part_ht[u1_sub_mb_mc_mode];
 2411|  55.3k|                *pu1_col_info++ = (PRED_8x8 << 6) | (u1_sub_mb_mc_mode << 4);
  ------------------
  |  |  453|  55.3k|#define PRED_8x8    3
  ------------------
 2412|   126k|                for(i4_ctr = 0; i4_ctr < i4_num_submb_part; i4_ctr++)
  ------------------
  |  Branch (2412:33): [True: 71.0k, False: 55.3k]
  ------------------
 2413|  71.0k|                {
 2414|  71.0k|                    ps_part->u1_partwidth = i4_part_width;  // interms of 4x4
 2415|  71.0k|                    ps_part->u1_partheight = i4_part_height;
 2416|  71.0k|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  71.0k|#define PRED_L0   1
  ------------------
 2417|  71.0k|                    ps_part->u1_is_direct = 0;
 2418|  71.0k|                    ps_part->u1_sub_mb_num = (i4_i & 0x01) * 2 + (i4_i >> 1) * 8;
 2419|  71.0k|                    if(i4_num_submb_part == 2)
  ------------------
  |  Branch (2419:24): [True: 25.5k, False: 45.5k]
  ------------------
 2420|  25.5k|                    {
 2421|  25.5k|                        ps_part->u1_sub_mb_num +=
 2422|  25.5k|                            i4_ctr ? (((i4_part_width - 1) << 2) + (i4_part_height - 1)) : 0;
  ------------------
  |  Branch (2422:29): [True: 12.7k, False: 12.7k]
  ------------------
 2423|  25.5k|                    }
 2424|  45.5k|                    else if(i4_num_submb_part == 4)
  ------------------
  |  Branch (2424:29): [True: 3.94k, False: 41.5k]
  ------------------
 2425|  3.94k|                    {
 2426|  3.94k|                        ps_part->u1_sub_mb_num += ((i4_ctr >> 1) << 2) + (i4_ctr & 0x01);
 2427|  3.94k|                    }
 2428|       |
 2429|  71.0k|                    ps_part++;
 2430|  71.0k|                }
 2431|  55.3k|            }
 2432|  13.8k|        }
 2433|   112k|        if(2 == i4_listx)
  ------------------
  |  Branch (2433:12): [True: 17.2k, False: 94.9k]
  ------------------
 2434|  17.2k|        {
 2435|  17.2k|            ps_part = (parse_part_params_t *) pv_part;
 2436|  17.2k|            pu1_col_info = ps_mb_part_info->u1_col_info;
 2437|       |            /* B_MBs */
 2438|  17.2k|            isvcd_interlyr_mbmode_pred_bmb(ps_ctxt, ps_motion_pred, 4, i4_part_size,
 2439|  17.2k|                                           pi4_sub_mb_mode, ps_mb_params, ps_part, pu1_col_info);
 2440|  17.2k|        }
 2441|   112k|    }
 2442|       |
 2443|   112k|    return;
 2444|   112k|}
isvcd_compute_interlyr_motion_mode:
 2474|   131k|{
 2475|       |    /*! Flow of the module is as follows                                   */
 2476|       |    /*! 1. if dyaydic case then it sets the sub mb mode to 8x8             */
 2477|       |    /*! 2. else it call the ref part idc comute fucntion                   */
 2478|       |    /*! 3. it calls the motion vectors and submb mode derive function.
 2479|       |           if the current mb is not inffered as INTRA                      */
 2480|       |    /*! 4. it calls the mode predcition module if base mode flag is 1      */
 2481|       |
 2482|   131k|    mode_motion_ctxt_t *ps_ctxt;
 2483|   131k|    WORD32 i4_intra_flag;
 2484|   131k|    WORD32 ai4_sub_mb_mode[NUM_MB_PARTS] = {0};
 2485|   131k|    dec_mb_info_t *ps_mb_params;
 2486|   131k|    dec_svc_mb_info_t *ps_svc_mb_params;
 2487|   131k|    dec_struct_t *ps_dec = (dec_struct_t *) pv_dec;
 2488|   131k|    WORD32 i4_mb_mode = -1;
 2489|   131k|    parse_pmbarams_t *ps_mb_part_info = (parse_pmbarams_t *) pv_mb_part_info;
 2490|   131k|    parse_part_params_t *ps_part = (parse_part_params_t *) pv_part;
 2491|       |
 2492|   131k|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
 2493|   131k|    ps_mb_params = (dec_mb_info_t *) pv_mb_params;
 2494|   131k|    ps_svc_mb_params = (dec_svc_mb_info_t *) pv_svc_mb_params;
 2495|       |
 2496|   131k|    i4_intra_flag = SVCD_FALSE;
  ------------------
  |  |   45|   131k|#define SVCD_FALSE 0
  ------------------
 2497|       |
 2498|   131k|    isvcd_ref_lyr_part_idc(pv_comp_mode_mv_ctxt, ps_ctxt->ai4_ref_part_idc, &i4_intra_flag,
 2499|   131k|                           pv_mb_params);
 2500|       |
 2501|       |    /* If base is Intra */
 2502|   131k|    if(SVCD_TRUE == i4_intra_flag)
  ------------------
  |  |   46|   131k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2502:8): [True: 9.42k, False: 121k]
  ------------------
 2503|  9.42k|    {
 2504|  9.42k|        if(1 == ps_svc_mb_params->u1_base_mode_flag)
  ------------------
  |  Branch (2504:12): [True: 9.06k, False: 360]
  ------------------
 2505|  9.06k|        {
 2506|  9.06k|            i4_mb_mode = SVC_IBL_MB;
  ------------------
  |  |  117|  9.06k|#define SVC_IBL_MB (1 << 3)         /*!< I_BL MB always inferred */
  ------------------
 2507|  9.06k|            ps_svc_mb_params->u1_residual_prediction_flag = 0;
 2508|  9.06k|        }
 2509|  9.42k|    }
 2510|   121k|    else
 2511|   121k|    {
 2512|       |        /* derive the motion and reference index by inter layer predcition */
 2513|   121k|        isvcd_interlyr_motion_submbmode_pred(pv_comp_mode_mv_ctxt, ps_mb_params, ps_svc_mb_params,
 2514|   121k|                                             ps_ctxt->ai4_ref_part_idc, ai4_sub_mb_mode, pv_dec);
 2515|       |
 2516|       |        /* derive the MB mode */
 2517|   121k|        if(1 == ps_svc_mb_params->u1_base_mode_flag)
  ------------------
  |  Branch (2517:12): [True: 112k, False: 9.80k]
  ------------------
 2518|   112k|        {
 2519|   112k|            isvcd_interlyr_mbmode_pred(pv_comp_mode_mv_ctxt, pv_mb_params, ai4_sub_mb_mode,
 2520|   112k|                                       &i4_mb_mode, ps_dec, ps_mb_part_info, ps_part);
 2521|   112k|        }
 2522|  9.80k|        else
 2523|  9.80k|        {
 2524|  9.80k|            isvcd_populate_ref_idx(ps_mb_params, ps_svc_mb_params, ps_ctxt->ps_motion_pred_struct,
 2525|  9.80k|                                   ps_mb_part_info, ps_ctxt->i4_listx);
 2526|  9.80k|        }
 2527|   121k|    }
 2528|       |
 2529|   131k|    return i4_mb_mode;
 2530|   131k|}
isvcd_interlyr_motion_mode_pred_dyadic:
 2564|  64.6k|{
 2565|  64.6k|    mode_motion_ctxt_t *ps_ctxt;
 2566|  64.6k|    mode_motion_lyr_ctxt *ps_lyr_mem;
 2567|  64.6k|    dec_mb_info_t *ps_mb_params;
 2568|  64.6k|    dec_svc_mb_info_t *ps_svc_mb_params;
 2569|  64.6k|    WORD32 i4_listx;
 2570|  64.6k|    WORD32 i4_mb_pic_x, i4_mb_pic_y;
 2571|  64.6k|    WORD32 i4_ref_x, i4_ref_y;
 2572|  64.6k|    UWORD8 u1_base_mode_flag;
 2573|  64.6k|    dec_struct_t *ps_dec = (dec_struct_t *) pv_dec;
 2574|  64.6k|    WORD32 i4_mb_mode = -1;
 2575|  64.6k|    parse_pmbarams_t *ps_mb_part_info = (parse_pmbarams_t *) pv_mb_part_info;
 2576|  64.6k|    UWORD8 *pu1_col_info = ps_mb_part_info->u1_col_info;
 2577|  64.6k|    parse_part_params_t *ps_part = (parse_part_params_t *) pv_part;
 2578|       |
 2579|  64.6k|    ps_ctxt = (mode_motion_ctxt_t *) pv_comp_mode_mv_ctxt;
 2580|       |
 2581|       |    /* get the current layer ctxt */
 2582|  64.6k|    ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
 2583|       |
 2584|  64.6k|    ps_mb_params = (dec_mb_info_t *) pv_mb_params;
 2585|  64.6k|    ps_svc_mb_params = (dec_svc_mb_info_t *) pv_svc_mb_params;
 2586|  64.6k|    i4_listx = ps_ctxt->i4_listx;
 2587|       |
 2588|  64.6k|    {
 2589|  64.6k|        WORD32 i4_mb_x, i4_mb_y;
 2590|       |        /* derive the MB_X and MB_Y for the current MB */
 2591|  64.6k|        i4_mb_x = ps_mb_params->u2_mbx;
 2592|  64.6k|        i4_mb_y = ps_mb_params->u2_mby;
 2593|       |
 2594|       |        /* get the colocated position in the refernce layer */
 2595|  64.6k|        i4_ref_x = ps_lyr_mem->pi2_ref_loc_x[i4_mb_x << 4];
 2596|  64.6k|        i4_ref_y = ps_lyr_mem->pi2_ref_loc_y[i4_mb_y << 4];
 2597|  64.6k|        i4_ref_x = CLIP3(0, ((ps_lyr_mem->i4_ref_width) - 1), i4_ref_x);
  ------------------
  |  |   77|  64.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 64.6k]
  |  |  |  Branch (77:54): [True: 0, False: 64.6k]
  |  |  ------------------
  ------------------
 2598|  64.6k|        i4_ref_y = CLIP3(0, ((ps_lyr_mem->i4_ref_height) - 1), i4_ref_y);
  ------------------
  |  |   77|  64.6k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 64.6k]
  |  |  |  Branch (77:54): [True: 309, False: 64.2k]
  |  |  ------------------
  ------------------
 2599|       |
 2600|       |        /* convert into picture units */
 2601|  64.6k|        i4_mb_pic_x = i4_mb_x << 4;
 2602|  64.6k|        i4_mb_pic_y = i4_mb_y << 4;
 2603|  64.6k|    }
 2604|       |
 2605|       |    /* ref layer mb mode */
 2606|  64.6k|    {
 2607|  64.6k|        inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms;
 2608|  64.6k|        WORD32 i4_inter_lyr_mb_prms_stride;
 2609|  64.6k|        WORD32 i4_ref_mb_x, i4_ref_mb_y;
 2610|  64.6k|        WORD8 i1_ref_mb_mode;
 2611|       |
 2612|  64.6k|        ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) ps_lyr_mem->s_ref_mb_mode.pv_buffer;
 2613|  64.6k|        i4_inter_lyr_mb_prms_stride = ps_lyr_mem->s_ref_mb_mode.i4_num_element_stride;
 2614|       |
 2615|       |        /* get the reference mb x and y */
 2616|  64.6k|        i4_ref_mb_x = (i4_ref_x >> 4);
 2617|  64.6k|        i4_ref_mb_y = (i4_ref_y >> 4);
 2618|       |
 2619|       |        /* get the appropriate mb params in reference layer */
 2620|  64.6k|        ps_inter_lyr_mb_prms += i4_ref_mb_x;
 2621|  64.6k|        ps_inter_lyr_mb_prms += i4_ref_mb_y * i4_inter_lyr_mb_prms_stride;
 2622|  64.6k|        i1_ref_mb_mode = ps_inter_lyr_mb_prms->i1_mb_mode;
 2623|  64.6k|        u1_base_mode_flag = ps_svc_mb_params->u1_base_mode_flag;
 2624|       |
 2625|       |        /* check if the MB mode of the refernce MB is Intra*/
 2626|  64.6k|        if(i1_ref_mb_mode > SVC_INTER_MB)
  ------------------
  |  |  114|  64.6k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (2626:12): [True: 12.4k, False: 52.1k]
  ------------------
 2627|  12.4k|        {
 2628|  12.4k|            if(1 == u1_base_mode_flag)
  ------------------
  |  Branch (2628:16): [True: 12.0k, False: 413]
  ------------------
 2629|  12.0k|            {
 2630|  12.0k|                i4_mb_mode = SVC_IBL_MB;
  ------------------
  |  |  117|  12.0k|#define SVC_IBL_MB (1 << 3)         /*!< I_BL MB always inferred */
  ------------------
 2631|  12.0k|                ps_svc_mb_params->u1_residual_prediction_flag = 0;
 2632|  12.0k|            }
 2633|  12.4k|            return i4_mb_mode;
 2634|  12.4k|        }
 2635|  64.6k|    }
 2636|       |
 2637|       |    /*-----------------------------------------------------------------------*/
 2638|       |    /* Inter MB upsampling process                                           */
 2639|       |    /*-----------------------------------------------------------------------*/
 2640|  52.1k|    {
 2641|  52.1k|        mv_pred_t *ps_motion_pred;
 2642|  52.1k|        WORD32 i4_16x16_flag;
 2643|  52.1k|        WORD32 i4_part_idc;
 2644|  52.1k|        WORD32 i4_blk_idx;
 2645|  52.1k|        WORD32 i4_curr_mot_stride;
 2646|       |
 2647|       |        /* choose the appropriate mv bank pointer and stride */
 2648|  52.1k|        if(1 == u1_base_mode_flag)
  ------------------
  |  Branch (2648:12): [True: 32.3k, False: 19.7k]
  ------------------
 2649|  32.3k|        {
 2650|  32.3k|            i4_mb_mode = SVC_INTER_MB;
  ------------------
  |  |  114|  32.3k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
 2651|  32.3k|        }
 2652|       |
 2653|  52.1k|        ps_motion_pred = ps_ctxt->ps_motion_pred_struct;
 2654|  52.1k|        i4_curr_mot_stride = 4;
 2655|       |
 2656|       |        /* call the motion upsampling for 1st 4x4 */
 2657|  52.1k|        i4_part_idc = (i4_ref_y << 16) + i4_ref_x;
 2658|  52.1k|        i4_16x16_flag = isvcd_interlyr_motion_scale(
 2659|  52.1k|            pv_comp_mode_mv_ctxt, &i4_part_idc, ps_mb_params, ps_motion_pred, i4_listx,
 2660|  52.1k|            (i4_mb_pic_x + 1), (i4_mb_pic_y + 1), ps_dec->ppv_map_ref_idx_to_poc);
 2661|       |
 2662|       |        /* ---------- reference layer MB is 16x16 ------------------*/
 2663|  52.1k|        if(i4_16x16_flag)
  ------------------
  |  Branch (2663:12): [True: 0, False: 52.1k]
  ------------------
 2664|      0|        {
 2665|      0|            if(1 == u1_base_mode_flag)
  ------------------
  |  Branch (2665:16): [True: 0, False: 0]
  ------------------
 2666|      0|            {
 2667|      0|                ps_mb_params->u1_mb_type = P_L0_16x16;
 2668|      0|                ps_mb_params->u1_mb_mc_mode = PRED_16x16;
  ------------------
  |  |  450|      0|#define PRED_16x16  0
  ------------------
 2669|      0|                ps_mb_part_info->u1_num_part = 1;
 2670|      0|                *pu1_col_info++ = (PRED_16x16 << 6);
  ------------------
  |  |  450|      0|#define PRED_16x16  0
  ------------------
 2671|      0|                ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2672|       |
 2673|      0|                ps_part->u1_partwidth = 4;  // interms of 4x4
 2674|      0|                ps_part->u1_partheight = 4;
 2675|      0|                ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|      0|#define PRED_L0   1
  ------------------
 2676|      0|                ps_part->u1_is_direct = 0;
 2677|      0|                ps_part->u1_sub_mb_num = 0;
 2678|       |
 2679|      0|                if(2 == i4_listx)
  ------------------
  |  Branch (2679:20): [True: 0, False: 0]
  ------------------
 2680|      0|                {
 2681|      0|                    WORD32 i4_part_mode_a = 0;
 2682|      0|                    WORD32 i4_temp;
 2683|       |
 2684|      0|                    ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2685|      0|                    if(0 <= ps_motion_pred[0].i1_ref_frame[0])
  ------------------
  |  Branch (2685:24): [True: 0, False: 0]
  ------------------
 2686|      0|                    {
 2687|      0|                        i4_part_mode_a += 1;
 2688|      0|                    }
 2689|      0|                    if(0 <= ps_motion_pred[0].i1_ref_frame[1])
  ------------------
  |  Branch (2689:24): [True: 0, False: 0]
  ------------------
 2690|      0|                    {
 2691|      0|                        i4_part_mode_a += 2;
 2692|      0|                    }
 2693|       |
 2694|      0|                    i4_temp = 3 * PRED_16x16;
  ------------------
  |  |  450|      0|#define PRED_16x16  0
  ------------------
 2695|      0|                    i4_temp += (3 * (i4_part_mode_a - 1) - 1);
 2696|      0|                    i4_temp = (i4_temp < 0) ? 0 : i4_temp;
  ------------------
  |  Branch (2696:31): [True: 0, False: 0]
  ------------------
 2697|      0|                    i4_temp = g_au1_eb_mb_type[i4_temp];
 2698|      0|                    ps_mb_params->u1_mb_type = i4_temp;
 2699|      0|                    ps_part->u1_pred_mode = g_au1_mb_pred_mode[0][5 + i4_temp];
 2700|      0|                }
 2701|      0|            }
 2702|      0|            else
 2703|      0|            {
 2704|       |                /* motion prediction flag cases replicate the motion vectors for entire MB */
 2705|      0|                isvcd_store_motion_map(ps_motion_pred, (ps_motion_pred), 0, i4_curr_mot_stride,
 2706|      0|                                       NUM_MB_PARTS, NUM_MB_PARTS, SVCD_FALSE);
  ------------------
  |  |   59|      0|#define NUM_MB_PARTS 4
  ------------------
                                                     NUM_MB_PARTS, NUM_MB_PARTS, SVCD_FALSE);
  ------------------
  |  |   59|      0|#define NUM_MB_PARTS 4
  ------------------
                                                     NUM_MB_PARTS, NUM_MB_PARTS, SVCD_FALSE);
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
 2707|       |
 2708|      0|                isvcd_populate_ref_idx(ps_mb_params, ps_svc_mb_params, ps_motion_pred,
 2709|      0|                                       ps_mb_part_info, i4_listx);
 2710|      0|            }
 2711|      0|            return i4_mb_mode;
 2712|      0|        }
 2713|       |        /* ---------- reference layer MB is non 16x16 ------------------ */
 2714|  52.1k|        else
 2715|  52.1k|        {
 2716|  52.1k|            WORD32 ai4_sub_mb_mode[NUM_MB_PARTS] = {0};
 2717|       |
 2718|       |            /* replicate the motion vectors for 8x8 */
 2719|  52.1k|            isvcd_store_motion_map(ps_motion_pred, ps_motion_pred, 0, i4_curr_mot_stride, 2, 2,
 2720|  52.1k|                                   SVCD_FALSE);
  ------------------
  |  |   45|  52.1k|#define SVCD_FALSE 0
  ------------------
 2721|       |
 2722|  52.1k|            if(2 == i4_listx)
  ------------------
  |  Branch (2722:16): [True: 25.5k, False: 26.5k]
  ------------------
 2723|  25.5k|            {
 2724|  25.5k|                WORD32 i4_indx = 0;
 2725|       |
 2726|       |                /* replicate the motion vectors for 8x8 */
 2727|       |                /* check the 0th partiton reference indices */
 2728|  25.5k|                if(0 <= ps_motion_pred[0].i1_ref_frame[0])
  ------------------
  |  Branch (2728:20): [True: 24.9k, False: 639]
  ------------------
 2729|  24.9k|                {
 2730|  24.9k|                    i4_indx += 1;
 2731|  24.9k|                }
 2732|  25.5k|                if(0 <= ps_motion_pred[0].i1_ref_frame[1])
  ------------------
  |  Branch (2732:20): [True: 9.55k, False: 16.0k]
  ------------------
 2733|  9.55k|                {
 2734|  9.55k|                    i4_indx += 2;
 2735|  9.55k|                }
 2736|       |
 2737|  25.5k|                i4_indx = 3 * PRED_8x8 + (i4_indx - 1);
  ------------------
  |  |  453|  25.5k|#define PRED_8x8    3
  ------------------
 2738|  25.5k|                ai4_sub_mb_mode[0] = g_au1_eb_submb_type[i4_indx];
 2739|  25.5k|            }
 2740|       |
 2741|       |            /* derive the motion vectors and reference indices of 3 rem partitions */
 2742|   208k|            for(i4_blk_idx = 1; i4_blk_idx < NUM_MB_PARTS; i4_blk_idx++)
  ------------------
  |  |   59|   208k|#define NUM_MB_PARTS 4
  ------------------
  |  Branch (2742:33): [True: 156k, False: 52.1k]
  ------------------
 2743|   156k|            {
 2744|   156k|                WORD32 i4_blk_y, i4_blk_x;
 2745|   156k|                mv_pred_t *ps_temp;
 2746|       |
 2747|   156k|                i4_blk_x = i4_blk_idx & 1;
 2748|   156k|                i4_blk_y = i4_blk_idx >> 1;
 2749|       |
 2750|   156k|                ps_temp = ps_motion_pred + (i4_blk_x << 1);
 2751|   156k|                ps_temp += (i4_blk_y * i4_curr_mot_stride << 1);
 2752|       |
 2753|       |                /* store the reference layer positions */
 2754|   156k|                i4_part_idc = ((i4_ref_y + (i4_blk_y << 2)) << 16) + (i4_ref_x + (i4_blk_x << 2));
 2755|   156k|                isvcd_interlyr_motion_scale(pv_comp_mode_mv_ctxt, &i4_part_idc, ps_mb_params,
 2756|   156k|                                            ps_temp, i4_listx, (i4_mb_pic_x + (i4_blk_x << 2) + 1),
 2757|   156k|                                            (i4_mb_pic_y + (i4_blk_y << 2) + 1),
 2758|   156k|                                            ps_dec->ppv_map_ref_idx_to_poc);
 2759|       |
 2760|       |                /* replicate the motion vectors for 8x8 */
 2761|   156k|                isvcd_store_motion_map(ps_temp, ps_temp, 0, i4_curr_mot_stride, 2, 2, SVCD_FALSE);
  ------------------
  |  |   45|   156k|#define SVCD_FALSE 0
  ------------------
 2762|       |
 2763|   156k|                if(2 == i4_listx)
  ------------------
  |  Branch (2763:20): [True: 76.7k, False: 79.5k]
  ------------------
 2764|  76.7k|                {
 2765|  76.7k|                    WORD32 i4_indx = 0;
 2766|       |
 2767|       |                    /* check the 0th partiton reference indices */
 2768|  76.7k|                    if(0 <= ps_temp[0].i1_ref_frame[0])
  ------------------
  |  Branch (2768:24): [True: 74.8k, False: 1.91k]
  ------------------
 2769|  74.8k|                    {
 2770|  74.8k|                        i4_indx += 1;
 2771|  74.8k|                    }
 2772|  76.7k|                    if(0 <= ps_temp[0].i1_ref_frame[1])
  ------------------
  |  Branch (2772:24): [True: 29.2k, False: 47.4k]
  ------------------
 2773|  29.2k|                    {
 2774|  29.2k|                        i4_indx += 2;
 2775|  29.2k|                    }
 2776|       |
 2777|  76.7k|                    i4_indx = 3 * PRED_8x8 + (i4_indx - 1);
  ------------------
  |  |  453|  76.7k|#define PRED_8x8    3
  ------------------
 2778|       |
 2779|  76.7k|                    ai4_sub_mb_mode[i4_blk_idx] = g_au1_eb_submb_type[i4_indx];
 2780|  76.7k|                }
 2781|   156k|            }
 2782|       |
 2783|       |            /* if MB mode has to derivied */
 2784|  52.1k|            if(1 == u1_base_mode_flag)
  ------------------
  |  Branch (2784:16): [True: 32.3k, False: 19.7k]
  ------------------
 2785|  32.3k|            {
 2786|  32.3k|                WORD32 i4_horz_match, i4_vert_match;
 2787|  32.3k|                WORD32 i4_part_size = PRED_8x8;
  ------------------
  |  |  453|  32.3k|#define PRED_8x8    3
  ------------------
 2788|       |
 2789|  32.3k|                mv_pred_t *ps_motion_1;
 2790|  32.3k|                mv_pred_t *ps_motion_2;
 2791|  32.3k|                mv_pred_t *ps_motion_3;
 2792|       |
 2793|  32.3k|                ps_motion_1 = ps_motion_pred + 2;
 2794|  32.3k|                ps_motion_2 = ps_motion_pred + (i4_curr_mot_stride << 1);
 2795|  32.3k|                ps_motion_3 = ps_motion_2 + 2;
 2796|       |
 2797|       |                /* check if the motion in horz direction are same*/
 2798|  32.3k|                i4_horz_match = isvcd_check_motion(ps_motion_pred, ps_motion_1, i4_listx);
 2799|  32.3k|                i4_horz_match += isvcd_check_motion(ps_motion_2, ps_motion_3, i4_listx);
 2800|       |
 2801|       |                /* check if the motion in vertical direction is same */
 2802|  32.3k|                i4_vert_match = isvcd_check_motion(ps_motion_pred, ps_motion_2, i4_listx);
 2803|  32.3k|                i4_vert_match += isvcd_check_motion(ps_motion_1, ps_motion_3, i4_listx);
 2804|       |
 2805|  32.3k|                ps_mb_part_info->u1_num_part = 4;
 2806|       |
 2807|       |                /* decide the partition size based on the results of matching */
 2808|  32.3k|                if((2 == i4_horz_match) && (2 == i4_vert_match))
  ------------------
  |  Branch (2808:20): [True: 29.9k, False: 2.37k]
  |  Branch (2808:44): [True: 29.2k, False: 702]
  ------------------
 2809|  29.2k|                {
 2810|  29.2k|                    ps_mb_params->u1_mb_type = P_L0_16x16;
 2811|  29.2k|                    i4_part_size = PRED_16x16;
  ------------------
  |  |  450|  29.2k|#define PRED_16x16  0
  ------------------
 2812|  29.2k|                    ps_mb_part_info->u1_num_part = 1;
 2813|  29.2k|                    *pu1_col_info++ = (PRED_16x16 << 6);
  ------------------
  |  |  450|  29.2k|#define PRED_16x16  0
  ------------------
 2814|       |
 2815|  29.2k|                    ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2816|  29.2k|                    if(2 == i4_listx)
  ------------------
  |  Branch (2816:24): [True: 10.9k, False: 18.2k]
  ------------------
 2817|  10.9k|                        ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2818|       |
 2819|  29.2k|                    ps_part->u1_partwidth = 4;  // interms of 4x4
 2820|  29.2k|                    ps_part->u1_partheight = 4;
 2821|  29.2k|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  29.2k|#define PRED_L0   1
  ------------------
 2822|  29.2k|                    ps_part->u1_is_direct = 0;
 2823|  29.2k|                    ps_part->u1_sub_mb_num = 0;
 2824|  29.2k|                }
 2825|  3.07k|                else if(2 == i4_horz_match)
  ------------------
  |  Branch (2825:25): [True: 702, False: 2.37k]
  ------------------
 2826|    702|                {
 2827|    702|                    ps_mb_params->u1_mb_type = P_L0_L0_16x8;
 2828|    702|                    i4_part_size = PRED_16x8;
  ------------------
  |  |  451|    702|#define PRED_16x8   1
  ------------------
 2829|    702|                    ps_mb_part_info->u1_num_part = 2;
 2830|    702|                    *pu1_col_info++ = (PRED_16x8 << 6);
  ------------------
  |  |  451|    702|#define PRED_16x8   1
  ------------------
 2831|    702|                    *pu1_col_info++ = (PRED_16x8 << 6);
  ------------------
  |  |  451|    702|#define PRED_16x8   1
  ------------------
 2832|       |
 2833|    702|                    ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2834|    702|                    ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[8].i1_ref_frame[0];
 2835|    702|                    if(2 == i4_listx)
  ------------------
  |  Branch (2835:24): [True: 162, False: 540]
  ------------------
 2836|    162|                    {
 2837|    162|                        ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2838|    162|                        ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[8].i1_ref_frame[1];
 2839|    162|                    }
 2840|    702|                    ps_part->u1_partwidth = 4;  // interms of 4x4
 2841|    702|                    ps_part->u1_partheight = 2;
 2842|    702|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|    702|#define PRED_L0   1
  ------------------
 2843|    702|                    ps_part->u1_is_direct = 0;
 2844|    702|                    ps_part->u1_sub_mb_num = 0;
 2845|       |
 2846|    702|                    ps_part++;
 2847|    702|                    ps_part->u1_partwidth = 4;
 2848|    702|                    ps_part->u1_partheight = 2;
 2849|    702|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|    702|#define PRED_L0   1
  ------------------
 2850|    702|                    ps_part->u1_is_direct = 0;
 2851|    702|                    ps_part->u1_sub_mb_num = 8;
 2852|    702|                }
 2853|  2.37k|                else if(2 == i4_vert_match)
  ------------------
  |  Branch (2853:25): [True: 531, False: 1.84k]
  ------------------
 2854|    531|                {
 2855|    531|                    ps_mb_params->u1_mb_type = P_L0_L0_8x16;
 2856|    531|                    i4_part_size = PRED_8x16;
  ------------------
  |  |  452|    531|#define PRED_8x16   2
  ------------------
 2857|    531|                    ps_mb_part_info->u1_num_part = 2;
 2858|    531|                    *pu1_col_info++ = (PRED_8x16 << 6);
  ------------------
  |  |  452|    531|#define PRED_8x16   2
  ------------------
 2859|    531|                    *pu1_col_info++ = (PRED_8x16 << 6);
  ------------------
  |  |  452|    531|#define PRED_8x16   2
  ------------------
 2860|       |
 2861|    531|                    ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred->i1_ref_frame[0];
 2862|    531|                    ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[2].i1_ref_frame[0];
 2863|    531|                    if(2 == i4_listx)
  ------------------
  |  Branch (2863:24): [True: 394, False: 137]
  ------------------
 2864|    394|                    {
 2865|    394|                        ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred->i1_ref_frame[1];
 2866|    394|                        ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[2].i1_ref_frame[1];
 2867|    394|                    }
 2868|    531|                    ps_part->u1_partwidth = 2;  // interms of 4x4
 2869|    531|                    ps_part->u1_partheight = 4;
 2870|    531|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|    531|#define PRED_L0   1
  ------------------
 2871|    531|                    ps_part->u1_is_direct = 0;
 2872|    531|                    ps_part->u1_sub_mb_num = 0;
 2873|       |
 2874|    531|                    ps_part++;
 2875|    531|                    ps_part->u1_partwidth = 2;
 2876|    531|                    ps_part->u1_partheight = 4;
 2877|    531|                    ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|    531|#define PRED_L0   1
  ------------------
 2878|    531|                    ps_part->u1_is_direct = 0;
 2879|    531|                    ps_part->u1_sub_mb_num = 2;
 2880|    531|                }
 2881|       |
 2882|       |                /* store the part size to the mb params */
 2883|  32.3k|                ps_mb_params->u1_mb_mc_mode = i4_part_size;
 2884|       |
 2885|       |                /* store the sub partition size */
 2886|  32.3k|                if(PRED_8x8 == i4_part_size)
  ------------------
  |  |  453|  32.3k|#define PRED_8x8    3
  ------------------
  |  Branch (2886:20): [True: 1.84k, False: 30.5k]
  ------------------
 2887|  1.84k|                {
 2888|  1.84k|                    UWORD8 u1_ctr;
 2889|       |                    /* for P_MB sub part type is P_L0_8x8*/
 2890|       |
 2891|  1.84k|                    ps_mb_params->u1_mb_type = P_8x8;
 2892|  1.84k|                    ps_mb_part_info->i1_ref_idx[0][0] = ps_motion_pred[0].i1_ref_frame[0];
 2893|  1.84k|                    ps_mb_part_info->i1_ref_idx[0][1] = ps_motion_pred[2].i1_ref_frame[0];
 2894|  1.84k|                    ps_mb_part_info->i1_ref_idx[0][2] = ps_motion_pred[8].i1_ref_frame[0];
 2895|  1.84k|                    ps_mb_part_info->i1_ref_idx[0][3] = ps_motion_pred[10].i1_ref_frame[0];
 2896|  1.84k|                    if(2 == i4_listx)
  ------------------
  |  Branch (2896:24): [True: 1.32k, False: 523]
  ------------------
 2897|  1.32k|                    {
 2898|  1.32k|                        ps_mb_part_info->i1_ref_idx[1][0] = ps_motion_pred[0].i1_ref_frame[1];
 2899|  1.32k|                        ps_mb_part_info->i1_ref_idx[1][1] = ps_motion_pred[2].i1_ref_frame[1];
 2900|  1.32k|                        ps_mb_part_info->i1_ref_idx[1][2] = ps_motion_pred[8].i1_ref_frame[1];
 2901|  1.32k|                        ps_mb_part_info->i1_ref_idx[1][3] = ps_motion_pred[10].i1_ref_frame[1];
 2902|  1.32k|                    }
 2903|       |
 2904|  9.23k|                    for(u1_ctr = 0; u1_ctr < 4; u1_ctr++)
  ------------------
  |  Branch (2904:37): [True: 7.38k, False: 1.84k]
  ------------------
 2905|  7.38k|                    {
 2906|  7.38k|                        *pu1_col_info++ = (PRED_8x8 << 6);
  ------------------
  |  |  453|  7.38k|#define PRED_8x8    3
  ------------------
 2907|       |
 2908|  7.38k|                        ps_part->u1_partwidth = 2;  // interms of 4x4
 2909|  7.38k|                        ps_part->u1_partheight = 2;
 2910|  7.38k|                        ps_part->u1_pred_mode = PRED_L0;
  ------------------
  |  |  483|  7.38k|#define PRED_L0   1
  ------------------
 2911|  7.38k|                        ps_part->u1_is_direct = 0;
 2912|  7.38k|                        ps_part->u1_sub_mb_num = (u1_ctr & 0x01) * 2 + (u1_ctr >> 1) * 8;
 2913|  7.38k|                        ps_part++;
 2914|  7.38k|                    }
 2915|  1.84k|                }
 2916|       |
 2917|  32.3k|                if(2 == i4_listx)
  ------------------
  |  Branch (2917:20): [True: 12.8k, False: 19.4k]
  ------------------
 2918|  12.8k|                {
 2919|  12.8k|                    ps_part = (parse_part_params_t *) pv_part;
 2920|  12.8k|                    pu1_col_info = ps_mb_part_info->u1_col_info;
 2921|  12.8k|                    isvcd_interlyr_mbmode_pred_bmb(ps_ctxt, ps_motion_pred, i4_curr_mot_stride,
 2922|  12.8k|                                                   i4_part_size, &ai4_sub_mb_mode[0], ps_mb_params,
 2923|  12.8k|                                                   ps_part, pu1_col_info);
 2924|  12.8k|                }
 2925|  32.3k|            } /* end of mode derivation */
 2926|  19.7k|            else
 2927|  19.7k|            {
 2928|  19.7k|                isvcd_populate_ref_idx(ps_mb_params, ps_svc_mb_params, ps_motion_pred,
 2929|  19.7k|                                       ps_mb_part_info, i4_listx);
 2930|       |
 2931|  19.7k|            } /* non 16x16 mv mode derivation */
 2932|  52.1k|        }
 2933|  52.1k|    }
 2934|  52.1k|    return i4_mb_mode;
 2935|  52.1k|}
isvcd_compute_scaled_offsets:
 2968|  34.5k|{
 2969|  34.5k|    WORD32 i4_offset_x, i4_offset_y;
 2970|  34.5k|    UWORD32 i4_scaled_ref_lyr_width;
 2971|  34.5k|    UWORD32 i4_scaled_ref_lyr_height;
 2972|  34.5k|    UWORD32 i4_ref_lyr_width;
 2973|  34.5k|    UWORD32 i4_ref_lyr_height;
 2974|  34.5k|    UWORD32 i4_shift_x, i4_shift_y;
 2975|  34.5k|    UWORD32 i4_scale_x, i4_scale_y;
 2976|  34.5k|    WORD32 i4_cntr;
 2977|  34.5k|    WORD32 i4_scale_add_x, i4_scale_add_y;
 2978|  34.5k|    WORD32 i4_curr_lyr_width, i4_curr_lyr_height;
 2979|       |
 2980|  34.5k|    if((NULL == ps_curr_res_prms) || (NULL == ps_ref_res_prms) || (NULL == pi2_offset_x) ||
  ------------------
  |  Branch (2980:8): [True: 0, False: 34.5k]
  |  Branch (2980:38): [True: 0, False: 34.5k]
  |  Branch (2980:67): [True: 0, False: 34.5k]
  ------------------
 2981|  34.5k|       (NULL == pi2_offset_y))
  ------------------
  |  Branch (2981:8): [True: 0, False: 34.5k]
  ------------------
 2982|      0|    {
 2983|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 2984|      0|    }
 2985|       |    /* initial calculation */
 2986|  34.5k|    i4_offset_x = ps_curr_res_prms->s_ref_lyr_scaled_offset.i2_left;
 2987|  34.5k|    i4_offset_y = ps_curr_res_prms->s_ref_lyr_scaled_offset.i2_top;
 2988|       |
 2989|       |    /* get the width and height */
 2990|  34.5k|    i4_scaled_ref_lyr_width = ps_curr_res_prms->u2_scaled_ref_width;
 2991|  34.5k|    i4_scaled_ref_lyr_height = ps_curr_res_prms->u2_scaled_ref_height;
 2992|  34.5k|    i4_ref_lyr_width = ps_ref_res_prms->i4_res_width;
 2993|  34.5k|    i4_ref_lyr_height = ps_ref_res_prms->i4_res_height;
 2994|  34.5k|    i4_curr_lyr_width = ps_curr_res_prms->i4_res_width;
 2995|  34.5k|    i4_curr_lyr_height = ps_curr_res_prms->i4_res_height;
 2996|       |
 2997|       |    /* derive shift x and y based on level idd */
 2998|  34.5k|    if(u1_level_idc <= 30)
  ------------------
  |  Branch (2998:8): [True: 31.9k, False: 2.61k]
  ------------------
 2999|  31.9k|    {
 3000|  31.9k|        i4_shift_x = 16;
 3001|  31.9k|        i4_shift_y = 16;
 3002|  31.9k|    }
 3003|  2.61k|    else
 3004|  2.61k|    {
 3005|  2.61k|        i4_shift_x = 31 - isvcd_get_ceil_log2(i4_ref_lyr_width);
 3006|  2.61k|        i4_shift_y = 31 - isvcd_get_ceil_log2(i4_ref_lyr_height);
 3007|  2.61k|    }
 3008|       |
 3009|       |    /* assert on max ranges of width and shift values */
 3010|  34.5k|    if((i4_ref_lyr_width > H264_MAX_FRAME_WIDTH) ||
  ------------------
  |  |   39|  34.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (3010:8): [True: 0, False: 34.5k]
  ------------------
 3011|  34.5k|       (i4_scaled_ref_lyr_width > H264_MAX_FRAME_WIDTH) ||
  ------------------
  |  |   39|  34.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (3011:8): [True: 0, False: 34.5k]
  ------------------
 3012|  34.5k|       (i4_ref_lyr_height > H264_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   40|  34.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (3012:8): [True: 0, False: 34.5k]
  ------------------
 3013|  34.5k|       (i4_scaled_ref_lyr_height > H264_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   40|  34.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (3013:8): [True: 0, False: 34.5k]
  ------------------
 3014|  34.5k|       (i4_curr_lyr_width > H264_MAX_FRAME_WIDTH) || (i4_curr_lyr_height > H264_MAX_FRAME_HEIGHT))
  ------------------
  |  |   39|  34.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                     (i4_curr_lyr_width > H264_MAX_FRAME_WIDTH) || (i4_curr_lyr_height > H264_MAX_FRAME_HEIGHT))
  ------------------
  |  |   40|  34.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (3014:8): [True: 0, False: 34.5k]
  |  Branch (3014:54): [True: 0, False: 34.5k]
  ------------------
 3015|      0|    {
 3016|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3017|      0|    }
 3018|       |
 3019|       |    /* calculate scale factor x and y */
 3020|  34.5k|    i4_scale_x = (((UWORD32) i4_ref_lyr_width << i4_shift_x) + (i4_scaled_ref_lyr_width >> 1)) /
 3021|  34.5k|                 i4_scaled_ref_lyr_width;
 3022|       |
 3023|  34.5k|    i4_scale_y = (((UWORD32) i4_ref_lyr_height << i4_shift_y) + (i4_scaled_ref_lyr_height >> 1)) /
 3024|  34.5k|                 i4_scaled_ref_lyr_height;
 3025|       |
 3026|       |    /* calcualte the values to be added based on left and top offset */
 3027|  34.5k|    i4_scale_add_x = (1 << (i4_shift_x - 1)) - (i4_offset_x * (WORD32) i4_scale_x);
 3028|  34.5k|    i4_scale_add_y = (1 << (i4_shift_y - 1)) - (i4_offset_y * (WORD32) i4_scale_y);
 3029|       |
 3030|       |    /* derive the projected locations in the reference layer */
 3031|  1.98M|    for(i4_cntr = 0; i4_cntr < i4_curr_lyr_width; i4_cntr++)
  ------------------
  |  Branch (3031:22): [True: 1.95M, False: 34.5k]
  ------------------
 3032|  1.95M|    {
 3033|  1.95M|        WORD32 i4_ref_x;
 3034|  1.95M|        i4_ref_x = (i4_cntr * i4_scale_x + i4_scale_add_x) >> i4_shift_x;
 3035|  1.95M|        *pi2_offset_x++ = (WORD16) i4_ref_x;
 3036|  1.95M|    }
 3037|       |
 3038|       |    /* derive the projected locations in the reference layer */
 3039|  5.15M|    for(i4_cntr = 0; i4_cntr < i4_curr_lyr_height; i4_cntr++)
  ------------------
  |  Branch (3039:22): [True: 5.12M, False: 34.5k]
  ------------------
 3040|  5.12M|    {
 3041|  5.12M|        WORD32 i4_ref_y;
 3042|  5.12M|        i4_ref_y = (i4_cntr * i4_scale_y + i4_scale_add_y) >> i4_shift_y;
 3043|  5.12M|        *pi2_offset_y++ = (WORD16) i4_ref_y;
 3044|  5.12M|    }
 3045|  34.5k|    return OK;
  ------------------
  |  |  114|  34.5k|#define OK        0
  ------------------
 3046|  34.5k|}
isvcd_comp_mode_mv_res_init:
 3077|   137k|{
 3078|       |    /*! Flow of the module is as follows                                   */
 3079|       |    /*! 1. calculates the scale factors for dyadic cases                   */
 3080|       |    /*! 2. calculaets the loop counts and part width and height based on
 3081|       |           dyadic scale factor                                             */
 3082|       |    /*! 2. calculate the MV scale factors                                  */
 3083|       |    /*! 3. initialises the default mv ped structure with deafult values    */
 3084|       |
 3085|   137k|    mode_motion_ctxt_t *ps_ctxt;
 3086|   137k|    mode_motion_lyr_ctxt *ps_lyr_mem;
 3087|   137k|    dec_seq_params_t *ps_sps;
 3088|   137k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) pv_svc_dec;
 3089|   137k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 3090|   137k|    svc_dec_lyr_struct_t *ps_svc_dec_ref_layer;
 3091|   137k|    WORD32 ret;
 3092|   137k|    WORD32 i4_scaled_ref_lyr_width;
 3093|   137k|    WORD32 i4_scaled_ref_lyr_height;
 3094|   137k|    WORD32 i4_ref_lyr_width;
 3095|   137k|    WORD32 i4_ref_lyr_height;
 3096|   137k|    res_prms_t *ps_curr_lyr_res_prms = &ps_svc_lyr_dec->s_res_prms;
 3097|       |
 3098|   137k|    ps_svc_dec_ref_layer = ps_svc_lyr_dec->ps_dec_svc_ref_layer;
 3099|   137k|    if(NULL == ps_curr_lyr_res_prms)
  ------------------
  |  Branch (3099:8): [True: 0, False: 137k]
  ------------------
 3100|      0|    {
 3101|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3102|      0|    }
 3103|       |
 3104|   137k|    ps_ctxt = (mode_motion_ctxt_t *) ps_svc_lyr_dec->pv_mode_mv_sample_ctxt;
 3105|   137k|    ps_ctxt->u1_direct_8x8_inference_flag = ps_curr_lyr_res_prms->u1_direct_8x8_inference_flag;
 3106|       |
 3107|       |    /* if called for base resolution store deafult values */
 3108|   137k|    if(SVCD_TRUE == ps_svc_lyr_dec->u1_base_res_flag)
  ------------------
  |  |   46|   137k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3108:8): [True: 102k, False: 34.5k]
  ------------------
 3109|   102k|    {
 3110|   102k|        ps_ctxt->i4_res_id = -1;
 3111|   102k|        ps_ctxt->i4_ref_width = ps_curr_lyr_res_prms->i4_res_width;
 3112|   102k|        ps_ctxt->i4_ref_height = ps_curr_lyr_res_prms->i4_res_height;
 3113|   102k|        return OK;
  ------------------
  |  |  114|   102k|#define OK        0
  ------------------
 3114|   102k|    }
 3115|       |
 3116|       |    /* call the function which populates the projected ref locations */
 3117|  34.5k|    ps_sps = ps_dec->ps_cur_sps;
 3118|       |
 3119|       |    /* store the res id appropriately */
 3120|  34.5k|    ps_ctxt->i4_res_id = ps_svc_lyr_dec->u1_layer_id - 1;
 3121|       |
 3122|       |    /* get the current layer ctxt */
 3123|  34.5k|    ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
 3124|       |
 3125|       |    /* store the current and reference res params to the context */
 3126|  34.5k|    ps_lyr_mem->ps_curr_lyr_res_prms = ps_curr_lyr_res_prms;
 3127|       |
 3128|       |    /* store the reference layer mv bank pointer */
 3129|  34.5k|    ps_lyr_mem->pv_ref_mv_bank_l0 = ps_svc_dec_ref_layer->s_dec.s_cur_pic.ps_mv;
 3130|       |
 3131|       |    /* store the reference layer mb mode pointer */
 3132|  34.5k|    ps_lyr_mem->s_ref_mb_mode.pv_buffer = ps_svc_dec_ref_layer->ps_inter_lyr_mb_prms_frm_start;
 3133|  34.5k|    ps_lyr_mem->s_ref_mb_mode.i4_num_element_stride =
 3134|  34.5k|        ps_svc_dec_ref_layer->u2_inter_lyr_mb_prms_stride;
 3135|  34.5k|    ps_lyr_mem->s_ref_mb_mode.i4_element_size = sizeof(inter_lyr_mb_prms_t);
 3136|       |
 3137|       |    /* check for recomputation of mapping required */
 3138|  34.5k|    if(SVCD_TRUE == ps_curr_lyr_res_prms->u1_remap_req_flag)
  ------------------
  |  |   46|  34.5k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3138:8): [True: 34.5k, False: 0]
  ------------------
 3139|  34.5k|    {
 3140|  34.5k|        res_prms_t s_ref_res_prms = {0};
 3141|       |
 3142|       |        /* store the reference layer resolution width and height */
 3143|  34.5k|        s_ref_res_prms.i4_res_width = ps_ctxt->i4_ref_width;
 3144|  34.5k|        s_ref_res_prms.i4_res_height = ps_ctxt->i4_ref_height;
 3145|       |
 3146|       |        /* call projection map calculation function */
 3147|  34.5k|        ret = isvcd_compute_scaled_offsets(ps_curr_lyr_res_prms, &s_ref_res_prms,
 3148|  34.5k|                                           ps_lyr_mem->pi2_ref_loc_x, ps_lyr_mem->pi2_ref_loc_y,
 3149|  34.5k|                                           ps_sps->u1_level_idc);
 3150|  34.5k|        if(OK != ret)
  ------------------
  |  |  114|  34.5k|#define OK        0
  ------------------
  |  Branch (3150:12): [True: 0, False: 34.5k]
  ------------------
 3151|      0|        {
 3152|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3153|      0|        }
 3154|       |
 3155|       |        /* derive the scaling variables */
 3156|  34.5k|        ps_lyr_mem->i4_offset_x = ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_left;
 3157|       |
 3158|  34.5k|        ps_lyr_mem->i4_offset_y = ps_curr_lyr_res_prms->s_ref_lyr_scaled_offset.i2_top;
 3159|       |
 3160|       |        /* get the width and heights */
 3161|  34.5k|        i4_scaled_ref_lyr_width = ps_curr_lyr_res_prms->u2_scaled_ref_width;
 3162|  34.5k|        i4_scaled_ref_lyr_height = ps_curr_lyr_res_prms->u2_scaled_ref_height;
 3163|  34.5k|        i4_ref_lyr_width = ps_ctxt->i4_ref_width;
 3164|  34.5k|        i4_ref_lyr_height = ps_ctxt->i4_ref_height;
 3165|       |
 3166|       |        /*store the reference layer width adn height */
 3167|  34.5k|        ps_lyr_mem->i4_ref_width = ps_ctxt->i4_ref_width;
 3168|  34.5k|        ps_lyr_mem->i4_ref_height = ps_ctxt->i4_ref_height;
 3169|       |
 3170|  34.5k|        if((i4_ref_lyr_width > H264_MAX_FRAME_WIDTH) || (i4_ref_lyr_width <= 0)) return NOT_OK;
  ------------------
  |  |   39|  34.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                      if((i4_ref_lyr_width > H264_MAX_FRAME_WIDTH) || (i4_ref_lyr_width <= 0)) return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (3170:12): [True: 0, False: 34.5k]
  |  Branch (3170:57): [True: 0, False: 34.5k]
  ------------------
 3171|  34.5k|        if((i4_scaled_ref_lyr_width > H264_MAX_FRAME_WIDTH) || (i4_scaled_ref_lyr_width <= 0))
  ------------------
  |  |   39|  34.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (3171:12): [True: 0, False: 34.5k]
  |  Branch (3171:64): [True: 0, False: 34.5k]
  ------------------
 3172|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3173|  34.5k|        if((i4_ref_lyr_height > H264_MAX_FRAME_HEIGHT) || (i4_ref_lyr_height <= 0)) return NOT_OK;
  ------------------
  |  |   40|  34.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                      if((i4_ref_lyr_height > H264_MAX_FRAME_HEIGHT) || (i4_ref_lyr_height <= 0)) return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (3173:12): [True: 0, False: 34.5k]
  |  Branch (3173:59): [True: 0, False: 34.5k]
  ------------------
 3174|  34.5k|        if((i4_scaled_ref_lyr_height > H264_MAX_FRAME_HEIGHT) || (i4_scaled_ref_lyr_height <= 0))
  ------------------
  |  |   40|  34.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (3174:12): [True: 0, False: 34.5k]
  |  Branch (3174:66): [True: 0, False: 34.5k]
  ------------------
 3175|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3176|       |
 3177|       |        /* derivation of variables for dyadic cases cropping should be MB aligned */
 3178|       |        /* default values for flags */
 3179|  34.5k|        ps_lyr_mem->pf_inter_lyr_pred = &isvcd_compute_interlyr_motion_mode;
 3180|       |
 3181|  34.5k|        if(SVCD_TRUE == ps_curr_lyr_res_prms->u1_dyadic_flag)
  ------------------
  |  |   46|  34.5k|#define SVCD_TRUE 1
  ------------------
  |  Branch (3181:12): [True: 18.0k, False: 16.5k]
  ------------------
 3182|  18.0k|        {
 3183|  18.0k|            ps_lyr_mem->pf_inter_lyr_pred = &isvcd_interlyr_motion_mode_pred_dyadic;
 3184|  18.0k|        }
 3185|       |
 3186|       |        /* Store the Dyadic flag */
 3187|  34.5k|        ps_lyr_mem->i4_dyadic_flag = ps_curr_lyr_res_prms->u1_dyadic_flag;
 3188|       |
 3189|       |        /* derive the scaling factors for motion upscaling */
 3190|       |        /* this is derived assuming no crop change flag is present */
 3191|  34.5k|        ps_lyr_mem->i4_scale_mv_x =
 3192|  34.5k|            ((i4_scaled_ref_lyr_width << 16) + (i4_ref_lyr_width >> 1)) / i4_ref_lyr_width;
 3193|       |
 3194|  34.5k|        ps_lyr_mem->i4_scale_mv_y =
 3195|  34.5k|            ((i4_scaled_ref_lyr_height << 16) + (i4_ref_lyr_height >> 1)) / i4_ref_lyr_height;
 3196|  34.5k|    }
 3197|      0|    else
 3198|      0|    {
 3199|       |        /* should take false value */
 3200|      0|        if(SVCD_FALSE != ps_curr_lyr_res_prms->u1_remap_req_flag)
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
  |  Branch (3200:12): [True: 0, False: 0]
  ------------------
 3201|      0|        {
 3202|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 3203|      0|        }
 3204|      0|    }
 3205|       |
 3206|       |    /* store the current layer width and height to context */
 3207|  34.5k|    ps_ctxt->i4_ref_width = ps_curr_lyr_res_prms->i4_res_width;
 3208|  34.5k|    ps_ctxt->i4_ref_height = ps_curr_lyr_res_prms->i4_res_height;
 3209|       |
 3210|  34.5k|    return OK;
  ------------------
  |  |  114|  34.5k|#define OK        0
  ------------------
 3211|  34.5k|}

isvcd_nal_buf_reset:
  146|  5.57M|{
  147|  5.57M|    nal_buf_t *ps_nal_buf = pv_nal_buf;
  148|       |
  149|  5.57M|    ps_nal_buf->i4_valid_flag = SVCD_FALSE;
  ------------------
  |  |   45|  5.57M|#define SVCD_FALSE 0
  ------------------
  150|  5.57M|    ps_nal_buf->i4_buf_size = 0;
  151|  5.57M|    ps_nal_buf->u4_max_bits = 0;
  152|       |    ps_nal_buf->pu1_buf = NULL;
  153|  5.57M|}
isvcd_nal_find_start_code:
  184|  2.86M|{
  185|  2.86M|    UWORD8 *pu1_buf = pu1_buf_start + i4_cur_pos;
  186|  2.86M|    WORD32 i4_i;
  187|       |
  188|   147M|    for(i4_i = 0; i4_i < (i4_max_num_bytes - i4_cur_pos); i4_i++)
  ------------------
  |  Branch (188:19): [True: 147M, False: 32.9k]
  ------------------
  189|   147M|    {
  190|       |        /*-------------------------------------------------------------------*/
  191|       |        /* If zero increment the zero byte counter                           */
  192|       |        /*-------------------------------------------------------------------*/
  193|   147M|        if(0 == *pu1_buf)
  ------------------
  |  Branch (193:12): [True: 39.3M, False: 108M]
  ------------------
  194|  39.3M|        {
  195|  39.3M|            (*pi4_zero_cnt)++;
  196|  39.3M|        }
  197|       |
  198|       |        /*-------------------------------------------------------------------*/
  199|       |        /* If start code found then increment the byte consumed and return   */
  200|       |        /*-------------------------------------------------------------------*/
  201|   108M|        else if(0x01 == *pu1_buf && *pi4_zero_cnt >= NUM_OF_ZERO_BYTES_BEFORE_START_CODE)
  ------------------
  |  |   54|  37.7M|#define NUM_OF_ZERO_BYTES_BEFORE_START_CODE (2)
  ------------------
  |  Branch (201:17): [True: 37.7M, False: 70.5M]
  |  Branch (201:37): [True: 2.82M, False: 34.9M]
  ------------------
  202|  2.82M|        {
  203|  2.82M|            (*pu4_bytes_consumed)++;
  204|  2.82M|            return (SC_FOUND);
  ------------------
  |  |   52|  2.82M|#define SC_FOUND 1
  ------------------
  205|  2.82M|        }
  206|       |        /*-------------------------------------------------------------------*/
  207|       |        /* If non zero byte and value is not equal to 1 a then reset zero    */
  208|       |        /* byte counter                                                      */
  209|       |        /*-------------------------------------------------------------------*/
  210|   105M|        else
  211|   105M|        {
  212|   105M|            *pi4_zero_cnt = 0;
  213|   105M|        }
  214|       |
  215|   144M|        (*pu4_bytes_consumed)++;
  216|   144M|        pu1_buf++;
  217|   144M|    }
  218|       |
  219|  32.9k|    return (SC_NOT_FOUND);
  ------------------
  |  |   51|  32.9k|#define SC_NOT_FOUND (-1)
  ------------------
  220|  2.86M|}
isvcd_get_first_start_code:
  248|  21.5k|{
  249|  21.5k|    WORD32 i4_zero_cnt = 0, i4_status;
  250|  21.5k|    UWORD32 u4_bytes_consumed_temp = 0;
  251|       |
  252|  21.5k|    i4_status = isvcd_nal_find_start_code(pu1_stream_buffer, 0, *pu4_num_bytes, &i4_zero_cnt,
  253|  21.5k|                                          &u4_bytes_consumed_temp);
  254|       |
  255|       |    /*-----------------------------------------------------------------------*/
  256|       |    /* If start code is not found then return and start searching for it     */
  257|       |    /* again in the next process call. This process is repeated till we      */
  258|       |    /* get a start code                                                      */
  259|       |    /*-----------------------------------------------------------------------*/
  260|  21.5k|    if(SC_NOT_FOUND == i4_status)
  ------------------
  |  |   51|  21.5k|#define SC_NOT_FOUND (-1)
  ------------------
  |  Branch (260:8): [True: 26, False: 21.5k]
  ------------------
  261|     26|    {
  262|     26|        *pu4_bytes_consumed += u4_bytes_consumed_temp;
  263|     26|        return (i4_status);
  264|     26|    }
  265|  21.5k|    else
  266|  21.5k|    {
  267|       |        /*-------------------------------------------------------------------*/
  268|       |        /* If start code found then proceed with bitstream extraction        */
  269|       |        /*-------------------------------------------------------------------*/
  270|  21.5k|        *pu4_bytes_consumed += u4_bytes_consumed_temp;
  271|  21.5k|        return (i4_status);
  272|  21.5k|    }
  273|  21.5k|}
isvcd_get_annex_b_nal_unit:
  312|  2.83M|{
  313|  2.83M|    nal_unit_t *ps_nal_unit = (nal_unit_t *) pv_nal_unit;
  314|  2.83M|    WORD32 i4_status, i4_nal_start_flag = SVCD_FALSE;
  ------------------
  |  |   45|  2.83M|#define SVCD_FALSE 0
  ------------------
  315|       |
  316|       |    /*-----------------------------------------------------------------------*/
  317|       |    /* Initialization                                                        */
  318|       |    /*-----------------------------------------------------------------------*/
  319|  2.83M|    *pu4_bytes_consumed = 0;
  320|  2.83M|    *pi4_more_data_flag = SVCD_TRUE;
  ------------------
  |  |   46|  2.83M|#define SVCD_TRUE 1
  ------------------
  321|       |
  322|       |    /*------------------------ check ----------------------------------------*/
  323|       |    /* Assumptions is that this fucntion should not be called with this state*/
  324|       |    /* hence it is responsibility of the caller to reset the state after the */
  325|       |    /* NAL_END.                                                              */
  326|       |    /*-----------------------------------------------------------------------*/
  327|  2.83M|    if(NAL_END == *pi4_state)
  ------------------
  |  Branch (327:8): [True: 514, False: 2.83M]
  ------------------
  328|    514|    {
  329|    514|        return i4_nal_start_flag;
  330|    514|    }
  331|       |
  332|       |    /*-----------------------------------------------------------------------*/
  333|       |    /* ps_nal_unit->apu1_bufs[0] is expected to point to start of buffer of  */
  334|       |    /* current NAL unit of the current process call. If a NAL unit is frag-  */
  335|       |    /* -mented across multiple process call then this buffer should point to */
  336|       |    /* start address of buffers. But when start of NAL is present in the     */
  337|       |    /* buffer of current process call then ps_nal_unit->apu1_bufs[0] is      */
  338|       |    /* expected to point to start adress of NAL unit (should be pointing to) */
  339|       |    /* NAL header)                                                           */
  340|       |    /*-----------------------------------------------------------------------*/
  341|  2.83M|    ps_nal_unit->pu1_bufs = pu1_buf_start + i4_cur_pos;
  342|       |
  343|  2.83M|    if(NAL_START == *pi4_state)
  ------------------
  |  Branch (343:8): [True: 2.83M, False: 19]
  ------------------
  344|  2.83M|    {
  345|  2.83M|        if(0 != *pi4_zero_byte_cnt)
  ------------------
  |  Branch (345:12): [True: 0, False: 2.83M]
  ------------------
  346|      0|        {
  347|      0|            return i4_nal_start_flag;
  348|      0|        }
  349|  2.83M|        i4_nal_start_flag = SVCD_TRUE;
  ------------------
  |  |   46|  2.83M|#define SVCD_TRUE 1
  ------------------
  350|  2.83M|        ps_nal_unit->i4_num_bufs = 1;
  351|  2.83M|        ps_nal_unit->i4_buf_sizes = 0;
  352|  2.83M|        *pi4_state = FIND_NAL_END;
  353|  2.83M|    }
  354|       |
  355|  2.83M|    i4_status = isvcd_nal_find_start_code(pu1_buf_start, i4_cur_pos, i4_max_num_bytes,
  356|  2.83M|                                          pi4_zero_byte_cnt, pu4_bytes_consumed);
  357|       |
  358|  2.83M|    if(SC_NOT_FOUND == i4_status)
  ------------------
  |  |   51|  2.83M|#define SC_NOT_FOUND (-1)
  ------------------
  |  Branch (358:8): [True: 32.7k, False: 2.80M]
  ------------------
  359|  32.7k|    {
  360|       |        /*-------------------------------------------------------------------*/
  361|       |        /* If start code is not found then there are 2 possibilities         */
  362|       |        /* 1. We are in the middle of decoding the start code. This means    */
  363|       |        /*    that we might have decoded the one or 2 zeroes of the start    */
  364|       |        /*    code. In such cases, we should not consume these bytes. Though */
  365|       |        /*    doing so we might encounter spurious cases where 0's are not   */
  366|       |        /*    actually corresponds to start code but these will not harm us  */
  367|       |        /* 2. Not of above case. Straightforward one                         */
  368|       |        /*-------------------------------------------------------------------*/
  369|  32.7k|        ps_nal_unit->i4_buf_sizes = *pu4_bytes_consumed;
  370|  32.7k|        *pi4_more_data_flag = SVCD_FALSE;
  ------------------
  |  |   45|  32.7k|#define SVCD_FALSE 0
  ------------------
  371|       |
  372|  32.7k|        return (i4_nal_start_flag);
  373|  32.7k|    }
  374|  2.80M|    else
  375|  2.80M|    {
  376|       |        /*-------------------------------------------------------------------*/
  377|       |        /* If NAL END is found then increment the bytes consumed appropriatly*/
  378|       |        /* reset the zero byte counter                                       */
  379|       |        /*-------------------------------------------------------------------*/
  380|  2.80M|        *pi4_state = NAL_END;
  381|  2.80M|        ps_nal_unit->i4_buf_sizes = *pu4_bytes_consumed - 1;
  382|  2.80M|        *pi4_zero_byte_cnt = 0;
  383|  2.80M|        return (i4_nal_start_flag);
  384|  2.80M|    }
  385|  2.83M|}
isvcd_nal_rbsp_to_sodb:
  413|   667k|{
  414|   667k|    UWORD32 u4_last_word_pos;
  415|   667k|    UWORD32 u4_word, u4_max_bit_offset;
  416|   667k|    UWORD8 i4_num_bits;
  417|   667k|    WORD32 i4_i;
  418|   667k|    WORD64 i8_nal_len;
  419|   667k|    UWORD32 *pu4_buf;
  420|       |
  421|   667k|    if(0 >= i4_nal_len_in_bytes)
  ------------------
  |  Branch (421:8): [True: 13.9k, False: 653k]
  ------------------
  422|  13.9k|    {
  423|  13.9k|        return (0);
  424|  13.9k|    }
  425|       |
  426|       |    /* Get offset in bits */
  427|   653k|    i8_nal_len = (WORD64) i4_nal_len_in_bytes << 3;
  428|   653k|    u4_max_bit_offset = (UWORD32) i8_nal_len;
  429|       |
  430|       |    /* If NAL is coded in CABAC then SODB */
  431|       |    /* length has to account for CABAC    */
  432|       |    /* ZERO WORDS also                    */
  433|   653k|    if(1 == u1_ecd_mode)
  ------------------
  |  Branch (433:8): [True: 101k, False: 552k]
  ------------------
  434|   101k|    {
  435|   101k|        return (u4_max_bit_offset);
  436|   101k|    }
  437|       |
  438|       |    /* Calculate the position of last word */
  439|   552k|    u4_last_word_pos = i4_nal_len_in_bytes >> 2;
  440|       |
  441|       |    /* Load the last word                 */
  442|   552k|    i4_i = i4_nal_len_in_bytes & 0x03;
  443|   552k|    if(0 != i4_i)
  ------------------
  |  Branch (443:8): [True: 403k, False: 148k]
  ------------------
  444|   403k|    {
  445|   403k|        pu4_buf = (UWORD32 *) pu1_buf;
  446|   403k|        pu4_buf += u4_last_word_pos;
  447|   403k|        u4_word = *pu4_buf;
  448|   403k|        i4_num_bits = i4_i << 3;
  449|   403k|        u4_word >>= (32 - i4_num_bits);
  450|   403k|    }
  451|   148k|    else
  452|   148k|    {
  453|   148k|        pu4_buf = (UWORD32 *) pu1_buf;
  454|   148k|        pu4_buf += (u4_last_word_pos - 1);
  455|   148k|        u4_word = *pu4_buf;
  456|   148k|        i4_num_bits = 32;
  457|   148k|    }
  458|       |
  459|       |    /* Search for RBSP stop bit          */
  460|   552k|    do
  461|   626k|    {
  462|  4.13M|        for(i4_i = 0; (i4_i < i4_num_bits) && !CHECKBIT(u4_word, i4_i); i4_i++)
  ------------------
  |  |   54|  4.06M|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
  |  Branch (462:23): [True: 4.06M, False: 76.7k]
  |  Branch (462:47): [True: 3.51M, False: 549k]
  ------------------
  463|  3.51M|            ;
  464|       |
  465|   626k|        u4_max_bit_offset -= i4_i;
  466|       |
  467|       |        /* RBSP stop bit is found then   */
  468|       |        /* come out of the loop          */
  469|   626k|        if(0 != CHECKBIT(u4_word, i4_i))
  ------------------
  |  |   54|   626k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  ------------------
  |  Branch (469:12): [True: 549k, False: 76.7k]
  ------------------
  470|   549k|        {
  471|       |            /* Remove RBSP stop bit */
  472|   549k|            u4_max_bit_offset -= 1;
  473|   549k|            break;
  474|   549k|        }
  475|       |
  476|  76.7k|        pu4_buf -= 1;
  477|  76.7k|        u4_word = *pu4_buf;
  478|  76.7k|        i4_num_bits = 32;
  479|  76.7k|    } while(u4_max_bit_offset > 0);
  ------------------
  |  Branch (479:13): [True: 74.0k, False: 2.69k]
  ------------------
  480|       |
  481|   552k|    return (u4_max_bit_offset);
  482|   653k|}
isvcd_reset_emulation_ctxt:
  510|  3.49M|{
  511|  3.49M|    emulation_prevent_ctxt_t *ps_emulation_ctxt = (emulation_prevent_ctxt_t *) pv_emulation_ctxt;
  512|       |
  513|       |    /*! Reset the emulation prevention context */
  514|  3.49M|    ps_emulation_ctxt->i4_state = NOT_STUFFED_BYTE;
  515|  3.49M|    ps_emulation_ctxt->i4_zeroes_cnt = 0;
  516|  3.49M|    ps_emulation_ctxt->u4_bytes_in_word = 0;
  517|  3.49M|    ps_emulation_ctxt->u4_word = 0;
  518|  3.49M|}
isvcd_nal_byte_swap_emulation:
  564|  3.14M|{
  565|  3.14M|    UWORD32 u4_i, u4_num_bytes, u4_offset;
  566|  3.14M|    UWORD8 u1_cur_byte;
  567|  3.14M|    emulation_prevent_ctxt_t *ps_emulation_ctxt = (emulation_prevent_ctxt_t *) pv_emulation_ctxt;
  568|       |
  569|  3.14M|    u4_offset = ps_emulation_ctxt->u4_bytes_in_word;
  570|  3.14M|    u4_num_bytes = ps_emulation_ctxt->u4_bytes_in_word;
  571|       |
  572|  69.6M|    for(u4_i = 0; u4_i < u4_in_len; u4_i++)
  ------------------
  |  Branch (572:19): [True: 66.6M, False: 2.99M]
  ------------------
  573|  66.6M|    {
  574|  66.6M|        UWORD8 u1_cur_byte_emu, u1_cur_byte_sc;
  575|  66.6M|        UWORD64 u8_sft_word;
  576|       |
  577|  66.6M|        u1_cur_byte = *pu1_in_stream++;
  578|  66.6M|        u1_cur_byte_emu = (EMULATION_PREVENTION_BYTE == u1_cur_byte);
  ------------------
  |  |   57|  66.6M|#define EMULATION_PREVENTION_BYTE (0x03)
  ------------------
  579|  66.6M|        u1_cur_byte_sc = (START_CODE_BYTE == u1_cur_byte);
  ------------------
  |  |   55|  66.6M|#define START_CODE_BYTE (0x01)
  ------------------
  580|       |
  581|  66.6M|        if((ps_emulation_ctxt->i4_zeroes_cnt >= i4_0s_bfr_sc) & (u1_cur_byte_emu | u1_cur_byte_sc) &
  ------------------
  |  Branch (581:12): [True: 153k, False: 66.4M]
  ------------------
  582|  66.6M|           (NOT_STUFFED_BYTE == ps_emulation_ctxt->i4_state))
  583|   153k|        {
  584|   153k|            if(u1_cur_byte_sc)
  ------------------
  |  Branch (584:16): [True: 146k, False: 7.42k]
  ------------------
  585|   146k|            {
  586|   146k|                break;
  587|   146k|            }
  588|  7.42k|            ps_emulation_ctxt->i4_zeroes_cnt = 0;
  589|  7.42k|            ps_emulation_ctxt->i4_state = STUFFED_BYTE;
  590|  7.42k|            continue;
  591|   153k|        }
  592|       |
  593|  66.4M|        u8_sft_word = (UWORD64) ps_emulation_ctxt->u4_word << 8;
  594|  66.4M|        ps_emulation_ctxt->u4_word = (UWORD32) (u8_sft_word | u1_cur_byte);
  595|  66.4M|        ps_emulation_ctxt->u4_bytes_in_word++;
  596|  66.4M|        u4_num_bytes++;
  597|  66.4M|        ps_emulation_ctxt->i4_zeroes_cnt++;
  598|  66.4M|        if(u1_cur_byte != 0x00)
  ------------------
  |  Branch (598:12): [True: 42.9M, False: 23.4M]
  ------------------
  599|  42.9M|        {
  600|  42.9M|            ps_emulation_ctxt->i4_zeroes_cnt = 0;
  601|  42.9M|        }
  602|       |
  603|  66.4M|        if((u4_num_bytes & 0x03) == 0x00)
  ------------------
  |  Branch (603:12): [True: 15.6M, False: 50.8M]
  ------------------
  604|  15.6M|        {
  605|  15.6M|            *pu4_out_stream = ps_emulation_ctxt->u4_word;
  606|  15.6M|            ps_emulation_ctxt->u4_bytes_in_word = 0;
  607|  15.6M|            pu4_out_stream++;
  608|  15.6M|        }
  609|       |
  610|  66.4M|        ps_emulation_ctxt->i4_state = NOT_STUFFED_BYTE;
  611|  66.4M|    }
  612|       |
  613|  3.14M|    if(ps_emulation_ctxt->u4_bytes_in_word)
  ------------------
  |  Branch (613:8): [True: 2.76M, False: 381k]
  ------------------
  614|  2.76M|    {
  615|  2.76M|        UWORD64 temp_out_stream = (UWORD64) ps_emulation_ctxt->u4_word
  616|  2.76M|                                  << ((4 - ps_emulation_ctxt->u4_bytes_in_word) << 3);
  617|  2.76M|        *pu4_out_stream = (UWORD32) temp_out_stream;
  618|  2.76M|    }
  619|       |
  620|  3.14M|    *pu4_out_len = (u4_num_bytes - u4_offset);
  621|  3.14M|    return ((u4_num_bytes & 0xFFFFFFFC));
  622|  3.14M|}
isvcd_set_default_nal_prms:
  650|  3.06M|{
  651|  3.06M|    nal_prms_t *ps_nal_prms;
  652|  3.06M|    ps_nal_prms = (nal_prms_t *) pv_nal_prms;
  653|       |
  654|       |    /* Set default values */
  655|  3.06M|    ps_nal_prms->i4_dependency_id = 0;
  656|  3.06M|    ps_nal_prms->i4_derived_nal_type = 0xFF;
  657|  3.06M|    ps_nal_prms->i4_idr_pic_flag = SVCD_FALSE;
  ------------------
  |  |   45|  3.06M|#define SVCD_FALSE 0
  ------------------
  658|  3.06M|    ps_nal_prms->i4_nal_header_len = 0;
  659|  3.06M|    ps_nal_prms->i4_nal_ref_idc = 0xFF;
  660|  3.06M|    ps_nal_prms->i4_nal_unit_type = 0xFF;
  661|  3.06M|    ps_nal_prms->i4_no_int_lyr_pred = 1;
  662|  3.06M|    ps_nal_prms->i4_priority_id = 0;
  663|  3.06M|    ps_nal_prms->i4_quality_id = 0;
  664|  3.06M|    ps_nal_prms->i4_discard_flag = 0;
  665|  3.06M|    ps_nal_prms->i4_dqid = 0;
  666|  3.06M|    ps_nal_prms->i4_use_ref_base_pic_flag = 0;
  667|  3.06M|    ps_nal_prms->i4_temporal_id = 0;
  668|  3.06M|    ps_nal_prms->i4_idr_pic_num = 0;
  669|  3.06M|    ps_nal_prms->u2_frm_num = 0;
  670|  3.06M|    ps_nal_prms->i4_poc_lsb = 0;
  671|  3.06M|    ps_nal_prms->i4_delta_poc_bot = 0;
  672|  3.06M|    ps_nal_prms->ai4_delta_poc[0] = 0;
  673|  3.06M|    ps_nal_prms->ai4_delta_poc[1] = 0;
  674|  3.06M|    ps_nal_prms->u1_pps_id = 0;
  675|  3.06M|}
isvcd_dec_nal_hdr:
  705|  3.04M|{
  706|  3.04M|    nal_prms_t *ps_nal_prms;
  707|  3.04M|    nal_prms_t *ps_prefix_nal_prms;
  708|  3.04M|    nal_buf_t *ps_prefix_nal_buf;
  709|  3.04M|    dec_bit_stream_t s_stream_ctxt = {0};
  710|  3.04M|    WORD32 i4_forbidden_zero_bit;
  711|       |
  712|       |    /* byte swapping */
  713|  3.04M|    UWORD8 *pu1_buf = (UWORD8 *) pv_nal_header_buf;
  714|  3.04M|    UWORD8 *pu1_src = (UWORD8 *) pv_buf_ptr;
  715|       |
  716|  3.04M|    ps_nal_prms = (nal_prms_t *) pv_nal_prms;
  717|  3.04M|    ps_prefix_nal_prms = (nal_prms_t *) pv_prefix_nal_prms;
  718|  3.04M|    ps_prefix_nal_buf = (nal_buf_t *) pv_prefix_nal_buf;
  719|       |
  720|       |    /* The NAL header syntax elements are read through bitstream fucntions.  */
  721|       |    /* Hence bitstream context structure initializaton is needed before      */
  722|       |    /* parsing from the bitstream                                            */
  723|       |    /* Also bitstream fucntions assume the buffer is byteswapped. Hence the  */
  724|       |    /* byte swapping is also done for 4 bytes                                */
  725|  3.04M|    s_stream_ctxt.u4_ofst = 0;
  726|  3.04M|    s_stream_ctxt.pu4_buffer = pv_nal_header_buf;
  727|  3.04M|    s_stream_ctxt.u4_max_ofst = (i4_buf_size << 3);
  728|       |
  729|  3.04M|    *pu4_err_code = 0;
  730|       |
  731|       |    /* Check the size of bitstream buffer */
  732|  3.04M|    if(s_stream_ctxt.u4_max_ofst < 8)
  ------------------
  |  Branch (732:8): [True: 7.52k, False: 3.03M]
  ------------------
  733|  7.52k|    {
  734|  7.52k|        *pu4_err_code = (UWORD32) NAL_INSUFFICIENT_DATA;
  735|  7.52k|        return;
  736|  7.52k|    }
  737|       |
  738|  3.03M|    if(s_stream_ctxt.u4_max_ofst >= 32)
  ------------------
  |  Branch (738:8): [True: 1.24M, False: 1.79M]
  ------------------
  739|  1.24M|    {
  740|  1.24M|        *pu1_buf++ = *(pu1_src + 3);
  741|  1.24M|        *pu1_buf++ = *(pu1_src + 2);
  742|  1.24M|        *pu1_buf++ = *(pu1_src + 1);
  743|  1.24M|        *pu1_buf++ = *pu1_src;
  744|  1.24M|    }
  745|  1.79M|    else
  746|  1.79M|    {
  747|  1.79M|        *pu1_buf++ = *pu1_src;
  748|  1.79M|    }
  749|       |
  750|       |    /*-----------------------------------------------------------------------*/
  751|       |    /*! Parse the NAL header and update the NAL header structure members     */
  752|       |    /*-----------------------------------------------------------------------*/
  753|       |    /* Read forbidden 0 bit */
  754|  3.03M|    i4_forbidden_zero_bit = ih264d_get_bit_h264(&s_stream_ctxt);
  755|       |
  756|  3.03M|    if(0 != i4_forbidden_zero_bit)
  ------------------
  |  Branch (756:8): [True: 34.6k, False: 2.99M]
  ------------------
  757|  34.6k|    {
  758|  34.6k|        *pu4_err_code = (UWORD32) NAL_CORRUPT_DATA;
  759|  34.6k|        return;
  760|  34.6k|    }
  761|       |
  762|       |    /*---------------- Read NAL ref idc -----------------------------*/
  763|  2.99M|    ps_nal_prms->i4_nal_ref_idc = ih264d_get_bits_h264(&s_stream_ctxt, 2);
  764|       |
  765|       |    /*----------------- Read NAL type -------------------------------*/
  766|  2.99M|    ps_nal_prms->i4_nal_unit_type = ih264d_get_bits_h264(&s_stream_ctxt, 5);
  767|  2.99M|    if(ps_nal_prms->i4_nal_unit_type > CODED_SLICE_EXTENSION_NAL)
  ------------------
  |  |   66|  2.99M|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (767:8): [True: 6.53k, False: 2.99M]
  ------------------
  768|  6.53k|    {
  769|  6.53k|        *pu4_err_code = (UWORD32) NAL_CORRUPT_DATA;
  770|  6.53k|        return;
  771|  6.53k|    }
  772|  2.99M|    if(ACCESS_UNIT_DELIMITER_RBSP == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |  332|  2.99M|#define ACCESS_UNIT_DELIMITER_RBSP      9
  ------------------
  |  Branch (772:8): [True: 11.6k, False: 2.98M]
  ------------------
  773|  11.6k|    {
  774|  11.6k|        ps_nal_prms->i4_derived_nal_type = NON_VCL_NAL;
  775|  11.6k|        return;
  776|  11.6k|    }
  777|       |
  778|       |    /* set idr pic flag */
  779|  2.98M|    if(IDR_SLICE_NAL == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |  328|  2.98M|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (779:8): [True: 462k, False: 2.51M]
  ------------------
  780|   462k|    {
  781|   462k|        ps_nal_prms->i4_idr_pic_flag = SVCD_TRUE;
  ------------------
  |  |   46|   462k|#define SVCD_TRUE 1
  ------------------
  782|   462k|    }
  783|  2.51M|    else
  784|  2.51M|    {
  785|  2.51M|        ps_nal_prms->i4_idr_pic_flag = SVCD_FALSE;
  ------------------
  |  |   45|  2.51M|#define SVCD_FALSE 0
  ------------------
  786|  2.51M|    }
  787|       |
  788|       |    /*----------------- Read SVC extension NAL header ---------------*/
  789|  2.98M|    if(CODED_SLICE_EXTENSION_NAL == ps_nal_prms->i4_nal_unit_type ||
  ------------------
  |  |   66|  2.98M|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (789:8): [True: 142k, False: 2.83M]
  ------------------
  790|  2.83M|       PREFIX_UNIT_NAL == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   64|  2.83M|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (790:8): [True: 6.72k, False: 2.83M]
  ------------------
  791|   148k|    {
  792|   148k|        WORD32 i4_svc_extension_flag, i4_idr_flag;
  793|       |
  794|       |        /* check the size of the buffer */
  795|   148k|        if(s_stream_ctxt.u4_max_ofst < 32)
  ------------------
  |  Branch (795:12): [True: 2.52k, False: 146k]
  ------------------
  796|  2.52k|        {
  797|  2.52k|            *pu4_err_code = (UWORD32) NAL_INSUFFICIENT_DATA;
  798|  2.52k|            return;
  799|  2.52k|        }
  800|       |
  801|   146k|        i4_svc_extension_flag = ih264d_get_bit_h264(&s_stream_ctxt);
  802|   146k|        UNUSED(i4_svc_extension_flag);
  ------------------
  |  |   45|   146k|#define UNUSED(x) ((void)(x))
  ------------------
  803|       |
  804|   146k|        i4_idr_flag = ih264d_get_bit_h264(&s_stream_ctxt);
  805|       |
  806|       |        /* Set idr pic flag based on idr flag */
  807|   146k|        if(1 == i4_idr_flag)
  ------------------
  |  Branch (807:12): [True: 106k, False: 39.9k]
  ------------------
  808|   106k|        {
  809|   106k|            ps_nal_prms->i4_idr_pic_flag = SVCD_TRUE;
  ------------------
  |  |   46|   106k|#define SVCD_TRUE 1
  ------------------
  810|   106k|        }
  811|  39.9k|        else
  812|  39.9k|        {
  813|  39.9k|            ps_nal_prms->i4_idr_pic_flag = SVCD_FALSE;
  ------------------
  |  |   45|  39.9k|#define SVCD_FALSE 0
  ------------------
  814|  39.9k|        }
  815|       |
  816|       |        /* parse priorit id */
  817|   146k|        ps_nal_prms->i4_priority_id = ih264d_get_bits_h264(&s_stream_ctxt, 6);
  818|       |
  819|       |        /* parse the no inter layer prediction flag */
  820|   146k|        ps_nal_prms->i4_no_int_lyr_pred = ih264d_get_bit_h264(&s_stream_ctxt);
  821|       |
  822|       |        /* parse dependency id */
  823|   146k|        ps_nal_prms->i4_dependency_id = ih264d_get_bits_h264(&s_stream_ctxt, 3);
  824|       |
  825|       |        /* parse quality id */
  826|   146k|        ps_nal_prms->i4_quality_id = ih264d_get_bits_h264(&s_stream_ctxt, 4);
  827|       |
  828|   146k|        if((ps_nal_prms->i4_quality_id > 0) || (ps_nal_prms->i4_dependency_id > 2))
  ------------------
  |  Branch (828:12): [True: 6.78k, False: 139k]
  |  Branch (828:48): [True: 463, False: 139k]
  ------------------
  829|  7.25k|        {
  830|  7.25k|            *pu4_err_code = (UWORD32) NAL_CORRUPT_DATA;
  831|  7.25k|            return;
  832|  7.25k|        }
  833|       |        /* parse temporal id */
  834|   139k|        ps_nal_prms->i4_temporal_id = ih264d_get_bits_h264(&s_stream_ctxt, 3);
  835|       |
  836|       |        /* parse use ref base pic flag */
  837|   139k|        ps_nal_prms->i4_use_ref_base_pic_flag = ih264d_get_bit_h264(&s_stream_ctxt);
  838|       |
  839|   139k|        if(0 != ps_nal_prms->i4_use_ref_base_pic_flag)
  ------------------
  |  Branch (839:12): [True: 2.28k, False: 136k]
  ------------------
  840|  2.28k|        {
  841|  2.28k|            *pu4_err_code = (UWORD32) NAL_CORRUPT_DATA;
  842|  2.28k|            return;
  843|  2.28k|        }
  844|       |        /* parse discrad flag */
  845|   136k|        ps_nal_prms->i4_discard_flag = ih264d_get_bit_h264(&s_stream_ctxt);
  846|       |
  847|       |        /* parse the reserved bits */
  848|   136k|        ih264d_get_bits_h264(&s_stream_ctxt, 3);
  849|   136k|    }
  850|       |
  851|       |    /* update NAL hedaer length in bytes */
  852|  2.96M|    ps_nal_prms->i4_nal_header_len = s_stream_ctxt.u4_ofst >> 3;
  853|       |
  854|       |    /*************************************************************************/
  855|       |    /* PREFIX NAL UNIT ASSOCIATION WITH ASSOCIATED NAL UNIT                  */
  856|       |    /*************************************************************************/
  857|       |
  858|       |    /* if current NAL is not a AVC NAL unit then */
  859|       |    /* discard the prefix NAL unit if present    */
  860|  2.96M|    if(CODED_SLICE_EXTENSION_NAL == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   66|  2.96M|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (860:8): [True: 131k, False: 2.83M]
  ------------------
  861|   131k|    {
  862|   131k|        isvcd_nal_buf_reset(ps_prefix_nal_buf);
  863|   131k|    }
  864|       |
  865|  2.96M|    if(SVCD_TRUE == ps_prefix_nal_buf->i4_valid_flag)
  ------------------
  |  |   46|  2.96M|#define SVCD_TRUE 1
  ------------------
  |  Branch (865:8): [True: 3.61k, False: 2.96M]
  ------------------
  866|  3.61k|    {
  867|       |        /* Copy the required parameters from the prefix NAL unit */
  868|  3.61k|        ps_nal_prms->i4_dependency_id = ps_prefix_nal_prms->i4_dependency_id;
  869|  3.61k|        ps_nal_prms->i4_quality_id = ps_prefix_nal_prms->i4_quality_id;
  870|  3.61k|        ps_nal_prms->i4_priority_id = ps_prefix_nal_prms->i4_priority_id;
  871|  3.61k|        ps_nal_prms->i4_temporal_id = ps_prefix_nal_prms->i4_temporal_id;
  872|  3.61k|        ps_nal_prms->i4_no_int_lyr_pred = ps_prefix_nal_prms->i4_no_int_lyr_pred;
  873|  3.61k|        ps_nal_prms->i4_use_ref_base_pic_flag = ps_prefix_nal_prms->i4_use_ref_base_pic_flag;
  874|  3.61k|        ps_nal_prms->i4_discard_flag = ps_prefix_nal_prms->i4_discard_flag;
  875|  3.61k|    }
  876|       |
  877|       |    /*-----------------------------------------------------------------------*/
  878|       |    /* Set the derived NAL unit type and also update the DQID for VCL NAL    */
  879|       |    /*  units                                                                */
  880|       |    /*-----------------------------------------------------------------------*/
  881|  2.96M|    if(CODED_SLICE_EXTENSION_NAL == ps_nal_prms->i4_nal_unit_type ||
  ------------------
  |  |   66|  2.96M|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (881:8): [True: 131k, False: 2.83M]
  ------------------
  882|  2.83M|       SLICE_NAL == ps_nal_prms->i4_nal_unit_type ||
  ------------------
  |  |  324|  2.83M|#define SLICE_NAL                       1
  ------------------
  |  Branch (882:8): [True: 142k, False: 2.69M]
  ------------------
  883|  2.69M|       IDR_SLICE_NAL == ps_nal_prms->i4_nal_unit_type ||
  ------------------
  |  |  328|  2.69M|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (883:8): [True: 462k, False: 2.23M]
  ------------------
  884|  2.23M|       PREFIX_UNIT_NAL == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   64|  2.23M|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (884:8): [True: 5.16k, False: 2.22M]
  ------------------
  885|   742k|    {
  886|   742k|        ps_nal_prms->i4_derived_nal_type = VCL_NAL;
  887|       |
  888|       |        /* calculate the DQID and modified DQID */
  889|   742k|        ps_nal_prms->i4_dqid = (ps_nal_prms->i4_dependency_id << 4) + ps_nal_prms->i4_quality_id;
  890|   742k|    }
  891|  2.22M|    else
  892|  2.22M|    {
  893|  2.22M|        ps_nal_prms->i4_derived_nal_type = NON_VCL_NAL;
  894|  2.22M|    }
  895|  2.96M|}
isvcd_parse_part_slice_hdr:
  928|   635k|{
  929|   635k|    UWORD32 u4_slice_type;
  930|   635k|    dec_seq_params_t *ps_sps = (dec_seq_params_t *) pv_sps;
  931|   635k|    dec_pic_params_t *ps_pps = (dec_pic_params_t *) pv_pps;
  932|   635k|    dec_bit_stream_t s_stream_ctxt = {0};
  933|   635k|    dec_bit_stream_t *ps_stream_ctxt;
  934|   635k|    UWORD32 *pu4_bitstrm_buf;
  935|   635k|    UWORD32 *pu4_bitstrm_ofst;
  936|       |
  937|   635k|    *pi4_sps_pps_status = NAL_CORRUPT_DATA;
  938|       |    /* Perform the emulation prevention and byte swap */
  939|   635k|    {
  940|   635k|        emulation_prevent_ctxt_t s_emulation_ctxt = {0};
  941|   635k|        WORD32 i4_size, i4_temp;
  942|       |
  943|   635k|        isvcd_reset_emulation_ctxt((void *) &s_emulation_ctxt);
  944|   635k|        i4_size = MIN(i4_input_buf_size, HEADER_BUFFER_LEN_BEFORE_EP);
  ------------------
  |  |   61|   635k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 458k, False: 177k]
  |  |  ------------------
  ------------------
  945|       |
  946|   635k|        isvcd_nal_byte_swap_emulation((UWORD32 *) pu1_temp_buf, (UWORD32 *) &i4_temp, pu1_input_buf,
  947|   635k|                                      (UWORD32) i4_size, NUM_OF_ZERO_BYTES_BEFORE_START_CODE,
  ------------------
  |  |   54|   635k|#define NUM_OF_ZERO_BYTES_BEFORE_START_CODE (2)
  ------------------
  948|   635k|                                      &s_emulation_ctxt);
  949|       |
  950|       |        /* Initialize the stream context structure */
  951|   635k|        s_stream_ctxt.pu4_buffer = (UWORD32 *) pu1_temp_buf;
  952|   635k|        s_stream_ctxt.u4_ofst = 0;
  953|   635k|        s_stream_ctxt.u4_max_ofst = (i4_size << 3);
  954|   635k|    }
  955|       |
  956|   635k|    ps_stream_ctxt = &s_stream_ctxt;
  957|       |
  958|       |    /* Parse the first mb address in slice */
  959|   635k|    pu4_bitstrm_buf = ps_stream_ctxt->pu4_buffer;
  960|   635k|    pu4_bitstrm_ofst = &ps_stream_ctxt->u4_ofst;
  961|   635k|    ps_nal_prms->u4_first_mb_addr = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  962|   635k|    if(ps_nal_prms->u4_first_mb_addr >= (MAX_MBS_LEVEL_51))
  ------------------
  |  |  307|   635k|#define MAX_MBS_LEVEL_51 36864
  ------------------
  |  Branch (962:8): [True: 19.5k, False: 615k]
  ------------------
  963|  19.5k|    {
  964|  19.5k|        return ERROR_CORRUPTED_SLICE;
  965|  19.5k|    }
  966|       |    /* Parse slice type */
  967|   615k|    u4_slice_type = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  968|       |
  969|   615k|    if(u4_slice_type > 9) return ERROR_INV_SLC_TYPE_T;
  ------------------
  |  Branch (969:8): [True: 32.7k, False: 582k]
  ------------------
  970|       |
  971|       |    /* Check the validity of slice prms */
  972|   582k|    switch(u4_slice_type)
  973|   582k|    {
  974|   311k|        case 0:
  ------------------
  |  Branch (974:9): [True: 311k, False: 271k]
  ------------------
  975|   372k|        case 5:
  ------------------
  |  Branch (975:9): [True: 60.6k, False: 522k]
  ------------------
  976|   372k|            u4_slice_type = P_SLICE;
  ------------------
  |  |  368|   372k|#define P_SLICE  0
  ------------------
  977|       |            /* P slice */
  978|   372k|            break;
  979|   135k|        case 1:
  ------------------
  |  Branch (979:9): [True: 135k, False: 447k]
  ------------------
  980|   143k|        case 6:
  ------------------
  |  Branch (980:9): [True: 8.14k, False: 574k]
  ------------------
  981|   143k|            u4_slice_type = B_SLICE;
  ------------------
  |  |  369|   143k|#define B_SLICE  1
  ------------------
  982|       |            /* B slice */
  983|   143k|            break;
  984|  43.0k|        case 2:
  ------------------
  |  Branch (984:9): [True: 43.0k, False: 539k]
  ------------------
  985|  50.1k|        case 7:
  ------------------
  |  Branch (985:9): [True: 7.01k, False: 575k]
  ------------------
  986|       |            /* I slice */
  987|  50.1k|            u4_slice_type = I_SLICE;
  ------------------
  |  |  370|  50.1k|#define I_SLICE  2
  ------------------
  988|  50.1k|            break;
  989|  17.4k|        default:
  ------------------
  |  Branch (989:9): [True: 17.4k, False: 565k]
  ------------------
  990|  17.4k|            break;
  991|   582k|    }
  992|       |
  993|       |    /* Parse the pps id */
  994|   582k|    ps_nal_prms->u1_pps_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  995|   582k|    if(ps_nal_prms->u1_pps_id & MASK_ERR_PIC_SET_ID) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  527|   582k|#define MASK_ERR_PIC_SET_ID   (0xFFFFFF00)
  ------------------
  |  Branch (995:8): [True: 0, False: 582k]
  ------------------
  996|       |
  997|       |    /* validate pps id */
  998|   582k|    ps_pps += ps_nal_prms->u1_pps_id;
  999|   582k|    if(0 == ps_pps->u1_is_valid)
  ------------------
  |  Branch (999:8): [True: 68.3k, False: 514k]
  ------------------
 1000|  68.3k|    {
 1001|  68.3k|        return NOT_OK;
  ------------------
  |  |  116|  68.3k|#define NOT_OK    -1
  ------------------
 1002|  68.3k|    }
 1003|       |    /* Derive sps id */
 1004|   514k|    ps_sps = ps_pps->ps_sps;
 1005|       |
 1006|   514k|    ps_nal_prms->u1_sps_id = ps_sps->u1_seq_parameter_set_id;
 1007|   514k|    if(CODED_SLICE_EXTENSION_NAL == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   66|   514k|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (1007:8): [True: 97.3k, False: 417k]
  ------------------
 1008|  97.3k|    {
 1009|  97.3k|        ps_sps += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  97.3k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1010|  97.3k|        ps_nal_prms->u1_sps_id = ps_sps->u1_seq_parameter_set_id;
 1011|  97.3k|        ps_nal_prms->u1_sps_id += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  97.3k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1012|  97.3k|    }
 1013|       |
 1014|   514k|    if(NULL == ps_sps)
  ------------------
  |  Branch (1014:8): [True: 0, False: 514k]
  ------------------
 1015|      0|    {
 1016|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1017|      0|    }
 1018|   514k|    if(FALSE == ps_sps->u1_is_valid)
  ------------------
  |  |  592|   514k|#define FALSE   0
  ------------------
  |  Branch (1018:8): [True: 7.34k, False: 507k]
  ------------------
 1019|  7.34k|    {
 1020|  7.34k|        return ERROR_INV_SLICE_HDR_T;
 1021|  7.34k|    }
 1022|   507k|    if(ps_nal_prms->u4_first_mb_addr > (ps_sps->u2_frm_ht_in_mbs * ps_sps->u2_frm_wd_in_mbs))
  ------------------
  |  Branch (1022:8): [True: 76.6k, False: 430k]
  ------------------
 1023|  76.6k|    {
 1024|  76.6k|        return ERROR_CORRUPTED_SLICE;
 1025|  76.6k|    }
 1026|   430k|    *pi4_sps_pps_status = 0;
 1027|       |
 1028|       |    /* Parse frame number */
 1029|   430k|    ps_nal_prms->u2_frm_num = ih264d_get_bits_h264(ps_stream_ctxt, ps_sps->u1_bits_in_frm_num);
 1030|       |
 1031|       |    /* IDR picture number */
 1032|   430k|    if(SVCD_TRUE == ps_nal_prms->i4_idr_pic_flag)
  ------------------
  |  |   46|   430k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1032:8): [True: 338k, False: 91.6k]
  ------------------
 1033|   338k|    {
 1034|   338k|        ps_nal_prms->i4_idr_pic_num = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1035|       |
 1036|   338k|        if(ps_nal_prms->i4_idr_pic_num > 65535) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (1036:12): [True: 7.81k, False: 331k]
  ------------------
 1037|   338k|    }
 1038|       |
 1039|       |    /* Poc lsb */
 1040|   422k|    if(0 == ps_sps->u1_pic_order_cnt_type)
  ------------------
  |  Branch (1040:8): [True: 324k, False: 98.5k]
  ------------------
 1041|   324k|    {
 1042|   324k|        ps_nal_prms->i4_poc_lsb =
 1043|   324k|            ih264d_get_bits_h264(ps_stream_ctxt, ps_sps->u1_log2_max_pic_order_cnt_lsb_minus);
 1044|       |
 1045|   324k|        if(ps_nal_prms->i4_poc_lsb < 0 ||
  ------------------
  |  Branch (1045:12): [True: 0, False: 324k]
  ------------------
 1046|   324k|           ps_nal_prms->i4_poc_lsb >= ps_sps->i4_max_pic_order_cntLsb)
  ------------------
  |  Branch (1046:12): [True: 0, False: 324k]
  ------------------
 1047|      0|            return ERROR_INV_SLICE_HDR_T;
 1048|   324k|        if(SVCD_TRUE == ps_pps->u1_pic_order_present_flag)
  ------------------
  |  |   46|   324k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1048:12): [True: 113k, False: 210k]
  ------------------
 1049|   113k|        {
 1050|   113k|            ps_nal_prms->i4_delta_poc_bot = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1051|   113k|        }
 1052|   324k|    }
 1053|  98.5k|    else if((1 == ps_sps->u1_pic_order_cnt_type) && (!ps_sps->u1_delta_pic_order_always_zero_flag))
  ------------------
  |  Branch (1053:13): [True: 88.4k, False: 10.0k]
  |  Branch (1053:53): [True: 75.7k, False: 12.7k]
  ------------------
 1054|  75.7k|    {
 1055|  75.7k|        ps_nal_prms->ai4_delta_poc[0] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1056|       |
 1057|  75.7k|        if(SVCD_TRUE == ps_pps->u1_pic_order_present_flag)
  ------------------
  |  |   46|  75.7k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1057:12): [True: 66.9k, False: 8.82k]
  ------------------
 1058|  66.9k|        {
 1059|  66.9k|            ps_nal_prms->ai4_delta_poc[1] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1060|  66.9k|        }
 1061|  75.7k|    }
 1062|       |
 1063|   422k|    *pu4_err_code = 0;
 1064|   422k|    return (OK);
  ------------------
  |  |  114|   422k|#define OK        0
  ------------------
 1065|   422k|}
isvcd_get_int_tgt_lyr_attr:
 1093|  1.37M|{
 1094|  1.37M|    WORD32 i4_dep_id;
 1095|  1.37M|    WORD32 i4_quality_id;
 1096|  1.37M|    WORD32 i4_temp_id;
 1097|  1.37M|    WORD32 i4_prior_id;
 1098|       |
 1099|       |    /* sanity checks */
 1100|  1.37M|    if((NULL == ps_app_attr) || (NULL == ps_int_attr) || (NULL == ps_nal_prms))
  ------------------
  |  Branch (1100:8): [True: 0, False: 1.37M]
  |  Branch (1100:33): [True: 0, False: 1.37M]
  |  Branch (1100:58): [True: 0, False: 1.37M]
  ------------------
 1101|      0|    {
 1102|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1103|      0|    }
 1104|       |
 1105|  1.37M|    i4_dep_id = ps_int_attr->i4_dependency_id;
 1106|  1.37M|    i4_quality_id = ps_int_attr->i4_quality_id;
 1107|  1.37M|    i4_temp_id = ps_int_attr->i4_temporal_id;
 1108|  1.37M|    i4_prior_id = ps_int_attr->i4_priority_id;
 1109|       |
 1110|       |    /* check for idr pic flag                                  */
 1111|       |    /* dependency & temporal id is updated only for IDR picture */
 1112|  1.37M|    if(SVCD_TRUE == ps_nal_prms->i4_idr_pic_flag)
  ------------------
  |  |   46|  1.37M|#define SVCD_TRUE 1
  ------------------
  |  Branch (1112:8): [True: 372k, False: 1.00M]
  ------------------
 1113|   372k|    {
 1114|   372k|        if(ps_int_attr->i4_dependency_id < ps_app_attr->i4_dependency_id)
  ------------------
  |  Branch (1114:12): [True: 99.2k, False: 273k]
  ------------------
 1115|  99.2k|        {
 1116|       |            /* update the internal attributes only if             */
 1117|       |            /* current dep_id -1 == highest dep id decoded so far */
 1118|       |            /* and quality id is equal to 0                       */
 1119|  99.2k|            if((ps_nal_prms->i4_dependency_id - 1 == ps_int_attr->i4_dependency_id) &&
  ------------------
  |  Branch (1119:16): [True: 25.6k, False: 73.6k]
  ------------------
 1120|  25.6k|               (0 == ps_nal_prms->i4_quality_id))
  ------------------
  |  Branch (1120:16): [True: 25.6k, False: 0]
  ------------------
 1121|  25.6k|            {
 1122|       |                /* Set revised target dependency id */
 1123|  25.6k|                i4_dep_id = ps_nal_prms->i4_dependency_id;
 1124|  25.6k|                i4_temp_id = ps_app_attr->i4_temporal_id;
 1125|  25.6k|                i4_prior_id = ps_app_attr->i4_priority_id;
 1126|  25.6k|            }
 1127|  99.2k|        }
 1128|   273k|        else
 1129|   273k|        {
 1130|       |            /* cases when the curr dep is greater than or equal to app dep */
 1131|   273k|            i4_dep_id = ps_app_attr->i4_dependency_id;
 1132|   273k|            i4_temp_id = ps_app_attr->i4_temporal_id;
 1133|   273k|            i4_prior_id = ps_app_attr->i4_priority_id;
 1134|   273k|        }
 1135|   372k|    }
 1136|       |
 1137|       |    /* Set quality id */
 1138|  1.37M|    if(i4_dep_id == ps_app_attr->i4_dependency_id)
  ------------------
  |  Branch (1138:8): [True: 1.15M, False: 221k]
  ------------------
 1139|  1.15M|    {
 1140|  1.15M|        i4_quality_id = ps_app_attr->i4_quality_id;
 1141|  1.15M|    }
 1142|   221k|    else
 1143|   221k|    {
 1144|   221k|        i4_quality_id = MAX_QUALITY_ID;
  ------------------
  |  |  102|   221k|#define MAX_QUALITY_ID 0
  ------------------
 1145|   221k|    }
 1146|       |
 1147|       |    /* Update the internal attributes */
 1148|  1.37M|    ps_int_attr->i4_dependency_id = i4_dep_id;
 1149|  1.37M|    ps_int_attr->i4_quality_id = i4_quality_id;
 1150|  1.37M|    ps_int_attr->i4_temporal_id = i4_temp_id;
 1151|  1.37M|    ps_int_attr->i4_priority_id = i4_prior_id;
 1152|       |
 1153|  1.37M|    return (OK);
  ------------------
  |  |  114|  1.37M|#define OK        0
  ------------------
 1154|  1.37M|}
isvcd_discard_nal:
 1188|  2.96M|{
 1189|  2.96M|    WORD32 i4_discard_nal_flag;
 1190|  2.96M|    nal_prms_t *ps_nal_prms;
 1191|  2.96M|    target_lyr_attr_t *ps_app_attr;
 1192|  2.96M|    target_lyr_attr_t *ps_int_attr;
 1193|  2.96M|    WORD32 i4_status;
 1194|       |
 1195|  2.96M|    ps_nal_prms = (nal_prms_t *) pv_nal_prms;
 1196|  2.96M|    ps_app_attr = (target_lyr_attr_t *) pv_app_attr;
 1197|  2.96M|    ps_int_attr = (target_lyr_attr_t *) pv_int_attr;
 1198|       |
 1199|       |    /* Get the updated target layer attributes */
 1200|  2.96M|    if(SVCD_TRUE == i4_update_flag)
  ------------------
  |  |   46|  2.96M|#define SVCD_TRUE 1
  ------------------
  |  Branch (1200:8): [True: 1.37M, False: 1.58M]
  ------------------
 1201|  1.37M|    {
 1202|  1.37M|        i4_status = isvcd_get_int_tgt_lyr_attr(ps_app_attr, ps_int_attr, ps_nal_prms);
 1203|  1.37M|        if(OK != i4_status)
  ------------------
  |  |  114|  1.37M|#define OK        0
  ------------------
  |  Branch (1203:12): [True: 0, False: 1.37M]
  ------------------
 1204|      0|        {
 1205|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1206|      0|        }
 1207|  1.37M|    }
 1208|       |
 1209|  2.96M|    i4_discard_nal_flag = SVCD_FALSE;
  ------------------
  |  |   45|  2.96M|#define SVCD_FALSE 0
  ------------------
 1210|       |
 1211|  2.96M|    if(VCL_NAL == ps_nal_prms->i4_derived_nal_type)
  ------------------
  |  Branch (1211:8): [True: 742k, False: 2.22M]
  ------------------
 1212|   742k|    {
 1213|       |        /*-------------------------------------------------------------------*/
 1214|       |        /*!Discard VCL NAL if any of following is true                       */
 1215|       |        /*! - Dependency id is greater than target dependency id             */
 1216|       |        /*! - Dependency id is equal to target dependency id but quality id  */
 1217|       |        /*!   is greater than target quality id                              */
 1218|       |        /*! - priority id is greater than target priority id                 */
 1219|       |        /*! - Temporal id is greater than target temporal id                 */
 1220|       |        /*! - If dependency id is greater than a NAL unit for which discard  */
 1221|       |        /*!   flag of the NAL header is set                                  */
 1222|       |        /*-------------------------------------------------------------------*/
 1223|   742k|        if(PREFIX_UNIT_NAL != ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   64|   742k|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (1223:12): [True: 737k, False: 5.16k]
  ------------------
 1224|   737k|        {
 1225|   737k|            if(ps_nal_prms->i4_dependency_id > ps_int_attr->i4_dependency_id)
  ------------------
  |  Branch (1225:16): [True: 102k, False: 635k]
  ------------------
 1226|   102k|            {
 1227|   102k|                i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|   102k|#define SVCD_TRUE 1
  ------------------
 1228|   102k|            }
 1229|       |
 1230|   737k|            if(ps_nal_prms->i4_dependency_id == ps_int_attr->i4_dependency_id &&
  ------------------
  |  Branch (1230:16): [True: 414k, False: 322k]
  ------------------
 1231|   414k|               ps_nal_prms->i4_quality_id > ps_int_attr->i4_quality_id)
  ------------------
  |  Branch (1231:16): [True: 0, False: 414k]
  ------------------
 1232|      0|            {
 1233|      0|                i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 1234|      0|            }
 1235|       |
 1236|   737k|            if(ps_nal_prms->i4_temporal_id > ps_int_attr->i4_temporal_id)
  ------------------
  |  Branch (1236:16): [True: 2.25k, False: 735k]
  ------------------
 1237|  2.25k|            {
 1238|  2.25k|                i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|  2.25k|#define SVCD_TRUE 1
  ------------------
 1239|  2.25k|            }
 1240|       |
 1241|   737k|            if(ps_nal_prms->i4_priority_id > ps_int_attr->i4_priority_id)
  ------------------
  |  Branch (1241:16): [True: 0, False: 737k]
  ------------------
 1242|      0|            {
 1243|      0|                i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 1244|      0|            }
 1245|   737k|        }
 1246|  5.16k|        else
 1247|  5.16k|        {
 1248|  5.16k|            if(0 == ps_int_attr->i4_quality_id && 0 == ps_int_attr->i4_dependency_id)
  ------------------
  |  Branch (1248:16): [True: 5.16k, False: 0]
  |  Branch (1248:51): [True: 1.58k, False: 3.58k]
  ------------------
 1249|  1.58k|            {
 1250|  1.58k|                i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|  1.58k|#define SVCD_TRUE 1
  ------------------
 1251|  1.58k|            }
 1252|  5.16k|        }
 1253|   742k|    }
 1254|       |
 1255|  2.96M|    return (i4_discard_nal_flag);
 1256|  2.96M|}

isvcd_get_nal_buf:
  108|  2.52M|{
  109|  2.52M|    nal_prms_t *ps_nal_prms;
  110|  2.52M|    nal_buf_t *ps_nal_buf;
  111|       |
  112|  2.52M|    ps_nal_prms = &ps_nal_parse_ctxt->s_nal_prms;
  113|       |
  114|       |    /* Get the NAL buffer structure */
  115|  2.52M|    if(PREFIX_UNIT_NAL == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   64|  2.52M|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (115:8): [True: 3.47k, False: 2.52M]
  ------------------
  116|  3.47k|    {
  117|  3.47k|        ps_nal_buf = &ps_nal_parse_ctxt->s_prefix_nal_buf;
  118|       |
  119|       |        /* Note: This reset will cause a prefix NAL unit */
  120|       |        /* which is followed by another prefix NAL unit  */
  121|       |        /* to be ignored by the module. This is indeed   */
  122|       |        /* a desired behaviour                           */
  123|  3.47k|        isvcd_nal_buf_reset(ps_nal_buf);
  124|  3.47k|    }
  125|  2.52M|    else
  126|  2.52M|    {
  127|  2.52M|        ps_nal_buf = &ps_nal_parse_ctxt->s_nal_buf;
  128|  2.52M|    }
  129|       |
  130|       |    /* Initialize the buffer structure */
  131|  2.52M|    ps_nal_buf->i4_valid_flag = SVCD_TRUE;
  ------------------
  |  |   46|  2.52M|#define SVCD_TRUE 1
  ------------------
  132|  2.52M|    if(VCL_NAL == ps_nal_prms->i4_derived_nal_type)
  ------------------
  |  Branch (132:8): [True: 308k, False: 2.22M]
  ------------------
  133|   308k|    {
  134|   308k|        ps_nal_buf->pu1_buf = ps_nal_parse_ctxt->pu1_vcl_nal_buf;
  135|   308k|    }
  136|  2.22M|    else if(NON_VCL_NAL == ps_nal_prms->i4_derived_nal_type)
  ------------------
  |  Branch (136:13): [True: 2.20M, False: 17.0k]
  ------------------
  137|  2.20M|    {
  138|  2.20M|        ps_nal_buf->pu1_buf = ps_nal_parse_ctxt->pu1_non_vcl_nal_buf;
  139|  2.20M|    }
  140|  17.0k|    else
  141|  17.0k|    {
  142|  17.0k|        ps_nal_buf->pu1_buf = NULL;
  143|  17.0k|        return;
  144|  17.0k|    }
  145|       |
  146|  2.51M|    *pps_nal_buf = ps_nal_buf;
  147|  2.51M|}
isvcd_dqid_ctxt_reset:
  172|   296k|{
  173|   296k|    WORD32 i4_lyr_idx;
  174|   296k|    WORD32 i4_max_num_lyrs;
  175|   296k|    dqid_node_t *ps_dqid_node;
  176|       |
  177|       |    /* sanity checks */
  178|   296k|    if(NULL == ps_dqid_ctxt)
  ------------------
  |  Branch (178:8): [True: 0, False: 296k]
  ------------------
  179|      0|    {
  180|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  181|      0|    }
  182|       |
  183|   296k|    i4_max_num_lyrs = ps_dqid_ctxt->i4_max_num_lyrs;
  184|   296k|    ps_dqid_node = ps_dqid_ctxt->ps_dqid_node;
  185|       |
  186|       |    /* Loop over all the layers */
  187|  1.18M|    for(i4_lyr_idx = 0; i4_lyr_idx < i4_max_num_lyrs; i4_lyr_idx++)
  ------------------
  |  Branch (187:25): [True: 888k, False: 296k]
  ------------------
  188|   888k|    {
  189|       |        /* Reset the valid flag */
  190|   888k|        ps_dqid_node->u1_valid_flag = SVCD_FALSE;
  ------------------
  |  |   45|   888k|#define SVCD_FALSE 0
  ------------------
  191|       |
  192|       |        /* Loop updates */
  193|   888k|        ps_dqid_node += 1;
  194|   888k|    } /* loop over all the layers */
  195|       |
  196|   296k|    return (OK);
  ------------------
  |  |  114|   296k|#define OK        0
  ------------------
  197|   296k|}
isvcd_get_dqid_node:
  226|  1.04M|{
  227|  1.04M|    WORD32 i4_lyr_idx;
  228|  1.04M|    WORD32 i4_max_num_lyrs;
  229|  1.04M|    dqid_node_t *ps_dqid_node;
  230|  1.04M|    dqid_node_t *ps_rqrd_dqid_node;
  231|       |
  232|       |    /* sanity checks */
  233|  1.04M|    if((NULL == ps_dqid_ctxt) || (NULL == pps_dqid_node))
  ------------------
  |  Branch (233:8): [True: 0, False: 1.04M]
  |  Branch (233:34): [True: 0, False: 1.04M]
  ------------------
  234|      0|    {
  235|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  236|      0|    }
  237|       |
  238|  1.04M|    i4_max_num_lyrs = ps_dqid_ctxt->i4_max_num_lyrs;
  239|  1.04M|    ps_dqid_node = ps_dqid_ctxt->ps_dqid_node;
  240|       |
  241|       |    /*Initialization */
  242|  1.04M|    ps_rqrd_dqid_node = NULL;
  243|       |
  244|       |    /* Loop over all the buffer nodes */
  245|  2.33M|    for(i4_lyr_idx = 0; i4_lyr_idx < i4_max_num_lyrs; i4_lyr_idx++)
  ------------------
  |  Branch (245:25): [True: 1.92M, False: 404k]
  ------------------
  246|  1.92M|    {
  247|  1.92M|        if((SVCD_TRUE == ps_dqid_node->u1_valid_flag) && (u1_dqid == ps_dqid_node->u1_dqid))
  ------------------
  |  |   46|  1.92M|#define SVCD_TRUE 1
  ------------------
  |  Branch (247:12): [True: 790k, False: 1.13M]
  |  Branch (247:58): [True: 639k, False: 150k]
  ------------------
  248|   639k|        {
  249|   639k|            ps_rqrd_dqid_node = ps_dqid_node;
  250|   639k|            break;
  251|   639k|        }
  252|       |        /* Loop updates */
  253|  1.28M|        ps_dqid_node += 1;
  254|  1.28M|    } /* Loop over all the buffer nodes */
  255|       |
  256|  1.04M|    if(NULL == ps_rqrd_dqid_node)
  ------------------
  |  Branch (256:8): [True: 404k, False: 639k]
  ------------------
  257|   404k|    {
  258|       |        /* If vcl node is not allocated for the requested DQID then allocate buffer */
  259|   404k|        ps_dqid_node = ps_dqid_ctxt->ps_dqid_node;
  260|   482k|        for(i4_lyr_idx = 0; i4_lyr_idx < i4_max_num_lyrs; i4_lyr_idx++)
  ------------------
  |  Branch (260:29): [True: 482k, False: 0]
  ------------------
  261|   482k|        {
  262|   482k|            if(SVCD_FALSE == ps_dqid_node->u1_valid_flag)
  ------------------
  |  |   45|   482k|#define SVCD_FALSE 0
  ------------------
  |  Branch (262:16): [True: 404k, False: 77.7k]
  ------------------
  263|   404k|            {
  264|   404k|                break;
  265|   404k|            }
  266|       |            /* Loop updates */
  267|  77.7k|            ps_dqid_node += 1;
  268|  77.7k|        } /* Loop over all the nodes */
  269|       |        /* Update the node structure */
  270|   404k|        ps_rqrd_dqid_node = ps_dqid_node;
  271|   404k|    }
  272|       |
  273|       |    /* sanity checks */
  274|  1.04M|    if(NULL == ps_rqrd_dqid_node)
  ------------------
  |  Branch (274:8): [True: 0, False: 1.04M]
  ------------------
  275|      0|    {
  276|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  277|      0|    }
  278|  1.04M|    *pps_dqid_node = ps_rqrd_dqid_node;
  279|       |
  280|  1.04M|    return (OK);
  ------------------
  |  |  114|  1.04M|#define OK        0
  ------------------
  281|  1.04M|}
isvcd_nal_reset_ctxt:
  307|  2.86M|{
  308|  2.86M|    nal_unit_t *ps_nal_unit;
  309|       |
  310|  2.86M|    if(NULL == ps_nal_parse_ctxt)
  ------------------
  |  Branch (310:8): [True: 0, False: 2.86M]
  ------------------
  311|      0|    {
  312|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  313|      0|    }
  314|       |
  315|       |    /* Reset the NAL boundary detetction */
  316|  2.86M|    ps_nal_parse_ctxt->i4_find_nal_state = NAL_START;
  317|  2.86M|    ps_nal_parse_ctxt->i4_zero_byte_cnt = 0;
  318|  2.86M|    ps_nal_unit = ps_nal_parse_ctxt->pv_nal_unit;
  319|  2.86M|    ps_nal_unit->i4_num_bufs = 0;
  320|       |
  321|       |    /*Reset emulation prevention */
  322|  2.86M|    isvcd_reset_emulation_ctxt(&ps_nal_parse_ctxt->s_emulation_ctxt);
  323|       |
  324|       |    /*Reset the NAL header prms */
  325|  2.86M|    isvcd_set_default_nal_prms(&ps_nal_parse_ctxt->s_nal_prms);
  326|       |
  327|       |    /* Reset other NAL level tracking variables */
  328|  2.86M|    ps_nal_parse_ctxt->i4_discard_nal_flag = SVCD_FALSE;
  ------------------
  |  |   45|  2.86M|#define SVCD_FALSE 0
  ------------------
  329|       |
  330|       |    /*Reset NAL buffer structure*/
  331|  2.86M|    isvcd_nal_buf_reset(&ps_nal_parse_ctxt->s_nal_buf);
  332|       |
  333|  2.86M|    return (OK);
  ------------------
  |  |  114|  2.86M|#define OK        0
  ------------------
  334|  2.86M|}
isvcd_pic_reset_ctxt:
  361|   296k|{
  362|   296k|    WORD32 i4_status;
  363|       |
  364|       |    /*-----------------------------------------------------------------------*/
  365|       |    /*! Reset NAL boundary detetction logic                                  */
  366|       |    /*-----------------------------------------------------------------------*/
  367|   296k|    i4_status = isvcd_nal_reset_ctxt(ps_nal_parse_ctxt);
  368|       |
  369|   296k|    UNUSED(i4_status);
  ------------------
  |  |   45|   296k|#define UNUSED(x) ((void)(x))
  ------------------
  370|       |
  371|       |    /*-----------------------------------------------------------------------*/
  372|       |    /*! Reset picture boundary detctetion logic                              */
  373|       |    /*-----------------------------------------------------------------------*/
  374|   296k|    ps_nal_parse_ctxt->i4_is_frst_vcl_nal_in_au = SVCD_TRUE;
  ------------------
  |  |   46|   296k|#define SVCD_TRUE 1
  ------------------
  375|       |
  376|       |    /*-----------------------------------------------------------------------*/
  377|       |    /*! Reset VCL and non VCL NAL buffer tracking variables                  */
  378|       |    /*-----------------------------------------------------------------------*/
  379|   296k|    ps_nal_parse_ctxt->pu1_non_vcl_nal_buf = ps_nal_parse_ctxt->pv_non_vcl_nal_buf;
  380|   296k|    ps_nal_parse_ctxt->pu1_vcl_nal_buf = ps_nal_parse_ctxt->pv_vcl_nal_buf;
  381|       |
  382|       |    /* reset the bytes left to buffer size */
  383|   296k|    ps_nal_parse_ctxt->u4_bytes_left_vcl = MAX_VCL_NAL_BUFF_SIZE;
  ------------------
  |  |   69|   296k|#define MAX_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
  384|       |
  385|   296k|    ps_nal_parse_ctxt->u4_bytes_left_non_vcl = MAX_NON_VCL_NAL_BUFF_SIZE;
  ------------------
  |  |   70|   296k|#define MAX_NON_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
  386|       |
  387|       |    /* Offset the buffer to start of vcl data */
  388|   296k|    UPDATE_NAL_BUF_PTR(&ps_nal_parse_ctxt->pu1_non_vcl_nal_buf, NON_VCL_NAL,
  389|   296k|                       &ps_nal_parse_ctxt->u4_bytes_left_non_vcl);
  390|       |
  391|   296k|    UPDATE_NAL_BUF_PTR(&ps_nal_parse_ctxt->pu1_vcl_nal_buf, VCL_NAL,
  392|   296k|                       &ps_nal_parse_ctxt->u4_bytes_left_vcl);
  393|       |
  394|       |    /* Reset previous field */
  395|   296k|    ps_nal_parse_ctxt->ps_prev_non_vcl_buf = NULL;
  396|   296k|    ps_nal_parse_ctxt->i4_idr_pic_err_flag = 0;
  397|       |
  398|       |    /*-----------------------------------------------------------------------*/
  399|       |    /*! Reset other NAL related tracking variables                           */
  400|       |    /*-----------------------------------------------------------------------*/
  401|   296k|    ps_nal_parse_ctxt->i4_num_non_vcl_nals = 0;
  402|       |
  403|       |    /* Reset the vcl nal node buffer context */
  404|   296k|    i4_status = isvcd_dqid_ctxt_reset(&ps_nal_parse_ctxt->s_dqid_ctxt);
  405|       |
  406|       |    /* Reset target layer update flag */
  407|   296k|    ps_nal_parse_ctxt->i4_tgt_lyr_update = SVCD_TRUE;
  ------------------
  |  |   46|   296k|#define SVCD_TRUE 1
  ------------------
  408|   296k|}
isvcd_get_nal_prms:
  443|  3.04M|{
  444|  3.04M|    UWORD8 *pu1_input_buf;
  445|  3.04M|    WORD32 i4_status;
  446|  3.04M|    dec_seq_params_t *ps_sps;
  447|  3.04M|    dec_pic_params_t *ps_pps;
  448|       |
  449|  3.04M|    ps_sps = ps_nal_parse_ctxt->pv_seq_prms;
  450|  3.04M|    ps_pps = ps_nal_parse_ctxt->pv_pic_prms;
  451|       |
  452|  3.04M|    *pu4_err_code = 0;
  453|  3.04M|    *pi4_sps_pps_status = NAL_CORRUPT_DATA;
  454|       |
  455|       |    /* Decode the NAL header */
  456|  3.04M|    isvcd_dec_nal_hdr(pu1_buf, i4_buf_size, ps_nal_parse_ctxt->pv_nal_header_buf, ps_nal_prms,
  457|  3.04M|                      ps_prefix_nal_buf, ps_prefix_nal_prms, pu4_err_code);
  458|       |
  459|       |    /* If encountered with error return fail */
  460|  3.04M|    if(0 != *pu4_err_code)
  ------------------
  |  Branch (460:8): [True: 60.8k, False: 2.98M]
  ------------------
  461|  60.8k|    {
  462|  60.8k|        return (NOT_OK);
  ------------------
  |  |  116|  60.8k|#define NOT_OK    -1
  ------------------
  463|  60.8k|    }
  464|       |
  465|  2.98M|    if(ACCESS_UNIT_DELIMITER_RBSP == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |  332|  2.98M|#define ACCESS_UNIT_DELIMITER_RBSP      9
  ------------------
  |  Branch (465:8): [True: 11.6k, False: 2.96M]
  ------------------
  466|  11.6k|    {
  467|  11.6k|        *pi4_nal_discard_flag = 1;
  468|  11.6k|        return OK;
  ------------------
  |  |  114|  11.6k|#define OK        0
  ------------------
  469|  11.6k|    }
  470|       |
  471|       |    /* Set the discard flag */
  472|  2.96M|    *pi4_nal_discard_flag = isvcd_discard_nal(
  473|  2.96M|        (void *) ps_nal_prms, (void *) &ps_nal_parse_ctxt->s_app_attr,
  474|  2.96M|        (void *) &ps_nal_parse_ctxt->s_int_attr, ps_nal_parse_ctxt->i4_tgt_lyr_update);
  475|       |
  476|       |    /* Parse the slice header if all the following */
  477|       |    /* conditions are true                         */
  478|       |    /* 1. NAL is a VCL NAL unit                    */
  479|       |    /* 2. NAL is not a prefix NAL unit             */
  480|       |    /* 3. NAL is not discarded                     */
  481|  2.96M|    if((NON_VCL_NAL == ps_nal_prms->i4_derived_nal_type) ||
  ------------------
  |  Branch (481:8): [True: 2.22M, False: 742k]
  ------------------
  482|   742k|       (PREFIX_UNIT_NAL == ps_nal_prms->i4_nal_unit_type) || (SVCD_TRUE == *pi4_nal_discard_flag))
  ------------------
  |  |   64|   742k|#define PREFIX_UNIT_NAL 14
  ------------------
                     (PREFIX_UNIT_NAL == ps_nal_prms->i4_nal_unit_type) || (SVCD_TRUE == *pi4_nal_discard_flag))
  ------------------
  |  |   46|   737k|#define SVCD_TRUE 1
  ------------------
  |  Branch (482:8): [True: 5.16k, False: 737k]
  |  Branch (482:62): [True: 102k, False: 635k]
  ------------------
  483|  2.33M|    {
  484|  2.33M|        return (OK);
  ------------------
  |  |  114|  2.33M|#define OK        0
  ------------------
  485|  2.33M|    }
  486|       |
  487|   635k|    pu1_input_buf = pu1_buf;
  488|   635k|    pu1_input_buf += ps_nal_prms->i4_nal_header_len;
  489|   635k|    i4_buf_size -= ps_nal_prms->i4_nal_header_len;
  490|       |
  491|   635k|    i4_status =
  492|   635k|        isvcd_parse_part_slice_hdr(pu1_input_buf, i4_buf_size, ps_nal_parse_ctxt->pv_nal_header_buf,
  493|   635k|                                   ps_sps, ps_pps, ps_nal_prms, pu4_err_code, pi4_sps_pps_status);
  494|       |
  495|   635k|    return (i4_status);
  496|  2.96M|}
isvcd_compare_nal_prms:
  534|   551k|{
  535|   551k|    dqid_node_t *ps_dqid_node;
  536|   551k|    vcl_node_t *ps_vcl_node;
  537|   551k|    WORD32 i4_status;
  538|       |
  539|       |    /* If DQID is lesser than the DQID of the previous */
  540|       |    /* NAL then declare the picture boundary           */
  541|   551k|    *pi4_pic_bound_type = PIC_BOUND_DQID;
  542|   551k|    if(i4_prev_dqid > ps_nal_prms->i4_dqid)
  ------------------
  |  Branch (542:8): [True: 50.8k, False: 501k]
  ------------------
  543|  50.8k|    {
  544|  50.8k|        *pi4_pic_bound_status = PIC_BOUNDARY_TRUE;
  545|  50.8k|        return (OK);
  ------------------
  |  |  114|  50.8k|#define OK        0
  ------------------
  546|  50.8k|    }
  547|       |
  548|       |    /* Perform the picture boundary detection only for */
  549|       |    /* the layers with quality id equal to 0           */
  550|   501k|    if((FIRST_PASS == i4_pass) && (0 != (ps_nal_prms->i4_dqid & 0x0F)))
  ------------------
  |  |   61|   501k|#define FIRST_PASS 0
  ------------------
  |  Branch (550:8): [True: 363k, False: 137k]
  |  Branch (550:35): [True: 0, False: 363k]
  ------------------
  551|      0|    {
  552|      0|        *pi4_pic_bound_status = PIC_BOUNDARY_FALSE;
  553|      0|        return (OK);
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  554|      0|    }
  555|       |
  556|       |    /* Get the DQID node */
  557|   501k|    i4_status =
  558|   501k|        isvcd_get_dqid_node(&ps_nal_parse_ctxt->s_dqid_ctxt, (UWORD8) i4_prev_dqid, &ps_dqid_node);
  559|   501k|    if((OK != i4_status) || (NULL == ps_dqid_node))
  ------------------
  |  |  114|   501k|#define OK        0
  ------------------
  |  Branch (559:8): [True: 0, False: 501k]
  |  Branch (559:29): [True: 0, False: 501k]
  ------------------
  560|      0|    {
  561|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  562|      0|    }
  563|       |    /* If the current slice is first slice in the layer */
  564|       |    /* then do not compare                              */
  565|   501k|    if(SVCD_FALSE == ps_dqid_node->u1_valid_flag)
  ------------------
  |  |   45|   501k|#define SVCD_FALSE 0
  ------------------
  |  Branch (565:8): [True: 161k, False: 339k]
  ------------------
  566|   161k|    {
  567|   161k|        *pi4_pic_bound_status = PIC_BOUNDARY_FALSE;
  568|   161k|        return (OK);
  ------------------
  |  |  114|   161k|#define OK        0
  ------------------
  569|   161k|    }
  570|       |
  571|   339k|    *pi4_pic_bound_type = PIC_BOUND_SLICE_PRMS;
  572|   339k|    *pi4_pic_bound_status = PIC_BOUNDARY_TRUE;
  573|   339k|    ps_vcl_node = ps_dqid_node->ps_vcl_node;
  574|       |
  575|       |    /* Compare NAL ref idc */
  576|   339k|    {
  577|   339k|        WORD32 i4_prev_ref_pic_flag;
  578|   339k|        WORD32 i4_cur_ref_pic_flag;
  579|       |
  580|   339k|        i4_prev_ref_pic_flag = (0 != ps_vcl_node->i4_nal_ref_idc);
  581|   339k|        i4_cur_ref_pic_flag = (0 != ps_nal_prms->i4_nal_ref_idc);
  582|       |
  583|   339k|        if(i4_prev_ref_pic_flag != i4_cur_ref_pic_flag)
  ------------------
  |  Branch (583:12): [True: 41.3k, False: 298k]
  ------------------
  584|  41.3k|        {
  585|  41.3k|            return (OK);
  ------------------
  |  |  114|  41.3k|#define OK        0
  ------------------
  586|  41.3k|        }
  587|   339k|    }
  588|       |
  589|       |    /* Compare IDR picture flag */
  590|   298k|    if(ps_vcl_node->i4_idr_pic_flag != ps_nal_prms->i4_idr_pic_flag)
  ------------------
  |  Branch (590:8): [True: 26.9k, False: 271k]
  ------------------
  591|  26.9k|    {
  592|  26.9k|        return (OK);
  ------------------
  |  |  114|  26.9k|#define OK        0
  ------------------
  593|  26.9k|    }
  594|       |
  595|       |    /* Compare PPS id */
  596|   271k|    if(ps_vcl_node->u1_pps_id != ps_nal_prms->u1_pps_id)
  ------------------
  |  Branch (596:8): [True: 55.0k, False: 216k]
  ------------------
  597|  55.0k|    {
  598|  55.0k|        return (OK);
  ------------------
  |  |  114|  55.0k|#define OK        0
  ------------------
  599|  55.0k|    }
  600|       |
  601|       |    /* Compare idr pic num */
  602|   216k|    if((SVCD_TRUE == ps_nal_prms->i4_idr_pic_flag) &&
  ------------------
  |  |   46|   216k|#define SVCD_TRUE 1
  ------------------
  |  Branch (602:8): [True: 178k, False: 37.7k]
  ------------------
  603|   178k|       (ps_vcl_node->i4_idr_pic_num != ps_nal_prms->i4_idr_pic_num))
  ------------------
  |  Branch (603:8): [True: 33.8k, False: 144k]
  ------------------
  604|  33.8k|    {
  605|  33.8k|        return (OK);
  ------------------
  |  |  114|  33.8k|#define OK        0
  ------------------
  606|  33.8k|    }
  607|       |
  608|       |    /* Compare frame number */
  609|   182k|    if(ps_vcl_node->u2_frm_num != ps_nal_prms->u2_frm_num)
  ------------------
  |  Branch (609:8): [True: 76.6k, False: 106k]
  ------------------
  610|  76.6k|    {
  611|  76.6k|        return (OK);
  ------------------
  |  |  114|  76.6k|#define OK        0
  ------------------
  612|  76.6k|    }
  613|       |
  614|       |    /* Compare poc lsb */
  615|   106k|    if(ps_dqid_node->i4_poc_lsb != ps_nal_prms->i4_poc_lsb)
  ------------------
  |  Branch (615:8): [True: 4.28k, False: 101k]
  ------------------
  616|  4.28k|    {
  617|  4.28k|        return (OK);
  ------------------
  |  |  114|  4.28k|#define OK        0
  ------------------
  618|  4.28k|    }
  619|       |
  620|       |    /* Compare delta poc bottom */
  621|   101k|    if(ps_dqid_node->i4_delta_poc_bot != ps_nal_prms->i4_delta_poc_bot)
  ------------------
  |  Branch (621:8): [True: 1.26k, False: 100k]
  ------------------
  622|  1.26k|    {
  623|  1.26k|        return (OK);
  ------------------
  |  |  114|  1.26k|#define OK        0
  ------------------
  624|  1.26k|    }
  625|       |
  626|       |    /* Compare delta poc [0] */
  627|   100k|    if(ps_dqid_node->ai4_delta_poc[0] != ps_nal_prms->ai4_delta_poc[0])
  ------------------
  |  Branch (627:8): [True: 3.36k, False: 97.1k]
  ------------------
  628|  3.36k|    {
  629|  3.36k|        return (OK);
  ------------------
  |  |  114|  3.36k|#define OK        0
  ------------------
  630|  3.36k|    }
  631|       |
  632|       |    /* Compare delta poc [0] */
  633|  97.1k|    if(ps_dqid_node->ai4_delta_poc[1] != ps_nal_prms->ai4_delta_poc[1])
  ------------------
  |  Branch (633:8): [True: 546, False: 96.5k]
  ------------------
  634|    546|    {
  635|    546|        return (OK);
  ------------------
  |  |  114|    546|#define OK        0
  ------------------
  636|    546|    }
  637|       |
  638|  96.5k|    *pi4_pic_bound_status = PIC_BOUNDARY_FALSE;
  639|  96.5k|    return (OK);
  ------------------
  |  |  114|  96.5k|#define OK        0
  ------------------
  640|  97.1k|}
isvcd_detect_pic_boundary_annex_b:
  696|   460k|{
  697|   460k|    UWORD32 u4_err_code;
  698|   460k|    WORD32 i4_zero_cnt;
  699|   460k|    WORD32 i4_status;
  700|   460k|    nal_prms_t s_nal_prms = {0};
  701|   460k|    nal_prms_t s_prefix_nal_prms = {0};
  702|   460k|    nal_buf_t s_prefix_nal_buf = {0};
  703|   460k|    WORD32 i4_pic_bound_type;
  704|   460k|    WORD32 i4_pic_bound_status;
  705|   460k|    UWORD8 *pu1_buf;
  706|   460k|    WORD32 i4_buf_size;
  707|   460k|    WORD32 i4_more_data_flag;
  708|   460k|    WORD32 i4_new_lyr_flag;
  709|   460k|    WORD32 i4_prev_dqid;
  710|   460k|    WORD32 i4_nal_discard_flag;
  711|       |
  712|       |    /* Initializations */
  713|   460k|    i4_zero_cnt = 0;
  714|   460k|    s_prefix_nal_buf.i4_valid_flag = SVCD_FALSE;
  ------------------
  |  |   45|   460k|#define SVCD_FALSE 0
  ------------------
  715|   460k|    *pi4_pic_bound_status = PIC_BOUNDARY_FALSE;
  716|   460k|    i4_new_lyr_flag = SVCD_TRUE;
  ------------------
  |  |   46|   460k|#define SVCD_TRUE 1
  ------------------
  717|       |
  718|       |    /* Get the previous layer's DQID                    */
  719|   460k|    if(SVCD_TRUE == ps_nal_parse_ctxt->i4_is_frst_vcl_nal_in_au)
  ------------------
  |  |   46|   460k|#define SVCD_TRUE 1
  ------------------
  |  Branch (719:8): [True: 161k, False: 298k]
  ------------------
  720|   161k|    {
  721|   161k|        ps_nal_parse_ctxt->i4_prev_dq_id = ps_nal_prms->i4_dqid;
  722|   161k|        ps_nal_parse_ctxt->i4_is_frst_vcl_nal_in_au = SVCD_FALSE;
  ------------------
  |  |   45|   161k|#define SVCD_FALSE 0
  ------------------
  723|   161k|    }
  724|   460k|    i4_prev_dqid = ps_nal_parse_ctxt->i4_prev_dq_id;
  725|   460k|    ps_nal_parse_ctxt->i4_prev_dq_id = ps_nal_prms->i4_dqid;
  726|       |
  727|       |    /* Detect the picture boundary */
  728|   460k|    if(ps_nal_prms->i4_dqid <= i4_prev_dqid)
  ------------------
  |  Branch (728:8): [True: 411k, False: 48.6k]
  ------------------
  729|   411k|    {
  730|   411k|        i4_status =
  731|   411k|            isvcd_compare_nal_prms(ps_nal_prms, FIRST_PASS, i4_prev_dqid, &i4_pic_bound_type,
  ------------------
  |  |   61|   411k|#define FIRST_PASS 0
  ------------------
  732|   411k|                                   &i4_pic_bound_status, ps_nal_parse_ctxt);
  733|   411k|        if(OK != i4_status)
  ------------------
  |  |  114|   411k|#define OK        0
  ------------------
  |  Branch (733:12): [True: 0, False: 411k]
  ------------------
  734|      0|        {
  735|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  736|      0|        }
  737|   411k|        i4_new_lyr_flag = SVCD_FALSE;
  ------------------
  |  |   45|   411k|#define SVCD_FALSE 0
  ------------------
  738|       |
  739|       |        /* Check whether the picture boundary is detected */
  740|       |        /* or not */
  741|   411k|        if(PIC_BOUNDARY_FALSE == i4_pic_bound_status)
  ------------------
  |  Branch (741:12): [True: 244k, False: 167k]
  ------------------
  742|   244k|        {
  743|   244k|            return (OK);
  ------------------
  |  |  114|   244k|#define OK        0
  ------------------
  744|   244k|        }
  745|       |
  746|       |        /* Otherwise look for next nal and compare again */
  747|   167k|        *pi4_pic_bound_status = PIC_BOUNDARY_TRUE;
  748|   167k|    }
  749|       |
  750|   215k|    do
  751|   217k|    {
  752|   217k|        WORD32 i4_sps_pps_corrupt_status;
  753|   217k|        WORD32 i4_tgt_lyr_bckup;
  754|       |        /* If following conditions are true then there */
  755|       |        /* is no data left to decode next NAL and hence*/
  756|       |        /* no further processing is required           */
  757|   217k|        if((NAL_END != ps_nal_parse_ctxt->i4_find_nal_state) ||
  ------------------
  |  Branch (757:12): [True: 12.6k, False: 205k]
  ------------------
  758|   205k|           ((WORD64) i4_cur_pos >= (WORD64) *pu4_num_bytes))
  ------------------
  |  Branch (758:12): [True: 398, False: 204k]
  ------------------
  759|  13.0k|        {
  760|  13.0k|            return (OK);
  ------------------
  |  |  114|  13.0k|#define OK        0
  ------------------
  761|  13.0k|        }
  762|       |
  763|       |        /* Otherwise fill the parameters */
  764|   204k|        pu1_buf = pu1_stream_buffer;
  765|   204k|        pu1_buf += i4_cur_pos;
  766|   204k|        i4_buf_size = *pu4_num_bytes - i4_cur_pos;
  767|       |
  768|       |        /* Get the NAL prms. This involves the following things*/
  769|       |        /* 1. Decode the NAL header                            */
  770|       |        /* 2. Set the discard flag                             */
  771|       |        /* 3. Decode the slice header if needed                */
  772|   204k|        isvcd_set_default_nal_prms(&s_nal_prms);
  773|       |
  774|       |        /* take a back up of tgt lyr update flag */
  775|   204k|        i4_tgt_lyr_bckup = ps_nal_parse_ctxt->i4_tgt_lyr_update;
  776|       |
  777|       |        /* the tgt attributes should not be  updaetd while pic boundary det*/
  778|   204k|        ps_nal_parse_ctxt->i4_tgt_lyr_update = SVCD_FALSE;
  ------------------
  |  |   45|   204k|#define SVCD_FALSE 0
  ------------------
  779|       |
  780|   204k|        i4_status = isvcd_get_nal_prms(pu1_buf, i4_buf_size, &s_nal_prms, &s_prefix_nal_prms,
  781|   204k|                                       &s_prefix_nal_buf, &u4_err_code, &i4_sps_pps_corrupt_status,
  782|   204k|                                       &i4_nal_discard_flag, ps_nal_parse_ctxt);
  783|       |        /* restore back the tgt lyr update flag */
  784|   204k|        ps_nal_parse_ctxt->i4_tgt_lyr_update = i4_tgt_lyr_bckup;
  785|       |        /* If the error code by the nal prms decoder then declare*/
  786|       |        /* picture boundary                                     */
  787|   204k|        if(0 != u4_err_code)
  ------------------
  |  Branch (787:12): [True: 7.82k, False: 196k]
  ------------------
  788|  7.82k|        {
  789|  7.82k|            return (OK);
  ------------------
  |  |  114|  7.82k|#define OK        0
  ------------------
  790|  7.82k|        }
  791|       |
  792|   196k|        i4_more_data_flag = SVCD_FALSE;
  ------------------
  |  |   45|   196k|#define SVCD_FALSE 0
  ------------------
  793|       |
  794|       |        /* If prefix NAL unit comes then save the nal prms*/
  795|   196k|        if(PREFIX_UNIT_NAL == s_nal_prms.i4_nal_unit_type)
  ------------------
  |  |   64|   196k|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (795:12): [True: 2.11k, False: 194k]
  ------------------
  796|  2.11k|        {
  797|  2.11k|            UWORD32 u4_bytes_consumed;
  798|  2.11k|            WORD32 i4_status;
  799|       |
  800|       |            /* If prefix NAL is not discarded then set the varaibles */
  801|       |            /* appropriatly */
  802|  2.11k|            if(SVCD_FALSE == i4_nal_discard_flag)
  ------------------
  |  |   45|  2.11k|#define SVCD_FALSE 0
  ------------------
  |  Branch (802:16): [True: 1.00k, False: 1.11k]
  ------------------
  803|  1.00k|            {
  804|  1.00k|                s_prefix_nal_buf.i4_valid_flag = SVCD_TRUE;
  ------------------
  |  |   46|  1.00k|#define SVCD_TRUE 1
  ------------------
  805|  1.00k|                memcpy(&s_prefix_nal_prms, &s_nal_prms, sizeof(nal_prms_t));
  806|  1.00k|            }
  807|       |
  808|       |            /* Go to next start code */
  809|  2.11k|            i4_zero_cnt = 0;
  810|  2.11k|            u4_bytes_consumed = 0;
  811|  2.11k|            i4_status = isvcd_nal_find_start_code(pu1_stream_buffer, i4_cur_pos, *pu4_num_bytes,
  812|  2.11k|                                                  &i4_zero_cnt, &u4_bytes_consumed);
  813|       |            /* If associated NAL unit is  not present then */
  814|  2.11k|            if(SC_FOUND != i4_status)
  ------------------
  |  |   52|  2.11k|#define SC_FOUND 1
  ------------------
  |  Branch (814:16): [True: 133, False: 1.98k]
  ------------------
  815|    133|            {
  816|    133|                return (OK);
  ------------------
  |  |  114|    133|#define OK        0
  ------------------
  817|    133|            }
  818|  1.98k|            i4_cur_pos += u4_bytes_consumed;
  819|  1.98k|            i4_more_data_flag = SVCD_TRUE;
  ------------------
  |  |   46|  1.98k|#define SVCD_TRUE 1
  ------------------
  820|  1.98k|        }
  821|   196k|    } while(SVCD_TRUE == i4_more_data_flag);
  ------------------
  |  |   46|   196k|#define SVCD_TRUE 1
  ------------------
  |  Branch (821:13): [True: 1.98k, False: 194k]
  ------------------
  822|       |
  823|       |    /* Do further picture boundary detection only for */
  824|       |    /* VCL NAL unit (excliding prefix NAL unit)       */
  825|   194k|    if((NON_VCL_NAL == s_nal_prms.i4_derived_nal_type) ||
  ------------------
  |  Branch (825:8): [True: 26.9k, False: 167k]
  ------------------
  826|   167k|       (PREFIX_UNIT_NAL == s_nal_prms.i4_nal_unit_type) || (SVCD_TRUE == i4_nal_discard_flag))
  ------------------
  |  |   64|   167k|#define PREFIX_UNIT_NAL 14
  ------------------
                     (PREFIX_UNIT_NAL == s_nal_prms.i4_nal_unit_type) || (SVCD_TRUE == i4_nal_discard_flag))
  ------------------
  |  |   46|   167k|#define SVCD_TRUE 1
  ------------------
  |  Branch (826:8): [True: 0, False: 167k]
  |  Branch (826:60): [True: 3.89k, False: 164k]
  ------------------
  827|  30.8k|    {
  828|  30.8k|        return (OK);
  ------------------
  |  |  114|  30.8k|#define OK        0
  ------------------
  829|  30.8k|    }
  830|       |
  831|   164k|    if(SVCD_FALSE == i4_new_lyr_flag)
  ------------------
  |  |   45|   164k|#define SVCD_FALSE 0
  ------------------
  |  Branch (831:8): [True: 124k, False: 39.8k]
  ------------------
  832|   124k|    {
  833|   124k|        if(PIC_BOUND_DQID == i4_pic_bound_type)
  ------------------
  |  Branch (833:12): [True: 36.4k, False: 87.7k]
  ------------------
  834|  36.4k|        {
  835|       |            /* If picture boundary was detetcted based on change*/
  836|       |            /* in DQID then declare picture boundary if DQID of the third slice is different */
  837|  36.4k|            if(i4_prev_dqid != s_nal_prms.i4_dqid)
  ------------------
  |  Branch (837:16): [True: 19.6k, False: 16.7k]
  ------------------
  838|  19.6k|            {
  839|  19.6k|                return (OK);
  ------------------
  |  |  114|  19.6k|#define OK        0
  ------------------
  840|  19.6k|            }
  841|  36.4k|        }
  842|  87.7k|        else
  843|  87.7k|        {
  844|       |            /* If picture boundary was detetcted based on change in DQID */
  845|       |            /* then declare picture boundary if dependency id of third slice is different */
  846|  87.7k|            if(PIC_BOUND_SLICE_PRMS != i4_pic_bound_type)
  ------------------
  |  Branch (846:16): [True: 0, False: 87.7k]
  ------------------
  847|      0|            {
  848|      0|                return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  849|      0|            }
  850|       |
  851|  87.7k|            if((i4_prev_dqid & 0xF) != (s_nal_prms.i4_dqid & 0xF))
  ------------------
  |  Branch (851:16): [True: 0, False: 87.7k]
  ------------------
  852|      0|            {
  853|      0|                return (OK);
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  854|      0|            }
  855|  87.7k|        }
  856|       |
  857|   104k|        isvcd_compare_nal_prms(&s_nal_prms, SECOND_PASS, i4_prev_dqid, &i4_pic_bound_type,
  ------------------
  |  |   62|   104k|#define SECOND_PASS 1
  ------------------
  858|   104k|                               &i4_pic_bound_status, ps_nal_parse_ctxt);
  859|   104k|        *pi4_pic_bound_status = i4_pic_bound_status;
  860|       |
  861|   104k|        if(PIC_BOUNDARY_FALSE == i4_pic_bound_status)
  ------------------
  |  Branch (861:12): [True: 12.6k, False: 91.8k]
  ------------------
  862|  12.6k|        {
  863|  12.6k|            ps_nal_parse_ctxt->i4_prev_dq_id = i4_prev_dqid;
  864|  12.6k|        }
  865|   104k|    }
  866|  39.8k|    else
  867|  39.8k|    {
  868|  39.8k|        if(SVCD_TRUE != i4_new_lyr_flag)
  ------------------
  |  |   46|  39.8k|#define SVCD_TRUE 1
  ------------------
  |  Branch (868:12): [True: 0, False: 39.8k]
  ------------------
  869|      0|        {
  870|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  871|      0|        }
  872|       |        /* The NAL header is not corrupted only if any of the following conditions are true */
  873|       |        /* 1. The DQID of the first slice differs with DQID of the third slice */
  874|       |        /* 2. Picture boundary is detected between first slice and third slice */
  875|  39.8k|        if(i4_prev_dqid == s_nal_prms.i4_dqid)
  ------------------
  |  Branch (875:12): [True: 35.9k, False: 3.97k]
  ------------------
  876|  35.9k|        {
  877|  35.9k|            isvcd_compare_nal_prms(&s_nal_prms, SECOND_PASS, i4_prev_dqid, &i4_pic_bound_type,
  ------------------
  |  |   62|  35.9k|#define SECOND_PASS 1
  ------------------
  878|  35.9k|                                   &i4_pic_bound_status, ps_nal_parse_ctxt);
  879|       |            /* NAL header is corrupted and hence correct it  */
  880|  35.9k|            if(PIC_BOUNDARY_FALSE == i4_pic_bound_status)
  ------------------
  |  Branch (880:16): [True: 1.05k, False: 34.8k]
  ------------------
  881|  1.05k|            {
  882|  1.05k|                ps_nal_prms->i4_dqid = s_nal_prms.i4_dqid;
  883|  1.05k|                ps_nal_prms->i4_dependency_id = s_nal_prms.i4_dependency_id;
  884|  1.05k|                ps_nal_prms->i4_quality_id = s_nal_prms.i4_quality_id;
  885|  1.05k|                ps_nal_parse_ctxt->i4_prev_dq_id = ps_nal_prms->i4_dqid;
  886|  1.05k|            }
  887|  35.9k|        }
  888|  39.8k|        *pi4_pic_bound_status = PIC_BOUNDARY_FALSE;
  889|  39.8k|    }
  890|   144k|    return (OK);
  ------------------
  |  |  114|   144k|#define OK        0
  ------------------
  891|   164k|}
isvcd_insert_vcl_node:
  917|   242k|{
  918|   242k|    vcl_node_t *ps_bot_node;
  919|   242k|    vcl_node_t *ps_top_node;
  920|   242k|    vcl_node_t *ps_node;
  921|   242k|    WORD32 i4_rqrd_dqid;
  922|       |
  923|       |    /* sanity checks */
  924|   242k|    if((NULL == ps_vcl_nal) || (NULL == ps_vcl_node))
  ------------------
  |  Branch (924:8): [True: 0, False: 242k]
  |  Branch (924:32): [True: 0, False: 242k]
  ------------------
  925|      0|    {
  926|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  927|      0|    }
  928|       |
  929|   242k|    i4_rqrd_dqid = (ps_vcl_node->i4_dependency_id << 4);
  930|   242k|    i4_rqrd_dqid += ps_vcl_node->i4_quality_id;
  931|   242k|    ps_node = ps_vcl_nal->ps_bot_node;
  932|       |
  933|       |    /* Search for node which has a DQID which is */
  934|       |    /* lesser than taht of the node to inserted  */
  935|   316k|    while(NULL != ps_node)
  ------------------
  |  Branch (935:11): [True: 77.4k, False: 239k]
  ------------------
  936|  77.4k|    {
  937|  77.4k|        WORD32 i4_dqid;
  938|       |
  939|  77.4k|        i4_dqid = (ps_node->i4_dependency_id << 4);
  940|  77.4k|        i4_dqid += ps_node->i4_quality_id;
  941|       |
  942|       |        /* If we get a DQID which is greater than*/
  943|       |        /* the DQID of the  node to be inserted  */
  944|       |        /* then break out of the loop and update */
  945|  77.4k|        if(i4_dqid > i4_rqrd_dqid)
  ------------------
  |  Branch (945:12): [True: 3.46k, False: 74.0k]
  ------------------
  946|  3.46k|        {
  947|  3.46k|            ps_bot_node = ps_node->ps_bot_node;
  948|  3.46k|            break;
  949|  3.46k|        }
  950|       |
  951|  74.0k|        ps_node = ps_node->ps_top_node;
  952|  74.0k|    }
  953|       |
  954|       |    /* If none of the nodes in the list have DQId */
  955|       |    /* greater than the node to be inserted then  */
  956|       |    /* bottom node will be top most node          */
  957|   242k|    if(NULL == ps_node)
  ------------------
  |  Branch (957:8): [True: 239k, False: 3.46k]
  ------------------
  958|   239k|    {
  959|   239k|        ps_bot_node = ps_vcl_nal->ps_top_node;
  960|   239k|    }
  961|       |
  962|       |    /* Insert the node into DQID list */
  963|   242k|    if(NULL != ps_bot_node)
  ------------------
  |  Branch (963:8): [True: 74.0k, False: 168k]
  ------------------
  964|  74.0k|    {
  965|  74.0k|        ps_top_node = ps_bot_node->ps_top_node;
  966|  74.0k|    }
  967|   168k|    else
  968|   168k|    {
  969|   168k|        ps_top_node = ps_vcl_nal->ps_bot_node;
  970|   168k|    }
  971|       |
  972|       |    /* Join previous node and specified node */
  973|   242k|    if(NULL != ps_bot_node)
  ------------------
  |  Branch (973:8): [True: 74.0k, False: 168k]
  ------------------
  974|  74.0k|    {
  975|  74.0k|        ps_bot_node->ps_top_node = ps_vcl_node;
  976|  74.0k|    }
  977|   168k|    else
  978|   168k|    {
  979|   168k|        ps_vcl_nal->ps_bot_node = ps_vcl_node;
  980|   168k|    }
  981|   242k|    ps_vcl_node->ps_bot_node = ps_bot_node;
  982|       |
  983|       |    /* Join next node and specified node */
  984|   242k|    if(NULL != ps_top_node)
  ------------------
  |  Branch (984:8): [True: 3.46k, False: 239k]
  ------------------
  985|  3.46k|    {
  986|  3.46k|        ps_top_node->ps_bot_node = ps_vcl_node;
  987|  3.46k|    }
  988|   239k|    else
  989|   239k|    {
  990|   239k|        ps_vcl_nal->ps_top_node = ps_vcl_node;
  991|   239k|    }
  992|   242k|    ps_vcl_node->ps_top_node = ps_top_node;
  993|       |
  994|   242k|    return (OK);
  ------------------
  |  |  114|   242k|#define OK        0
  ------------------
  995|   242k|}
isvcd_update_nal_ctxt:
 1024|  2.50M|{
 1025|       |    /*! If current NAL is VCL NAL then
 1026|       |          - Insert a VCL node into DQID list if neccessery
 1027|       |          - update the information part of NAL unit */
 1028|       |    /*! Otherwise, populate the buffer parameters into non vcl output
 1029|       |    structure */
 1030|  2.50M|    nal_prms_t *ps_nal_prms;
 1031|  2.50M|    nal_buf_t *ps_nal_buf, *ps_prefix_nal_buf;
 1032|       |
 1033|  2.50M|    ps_nal_prms = &ps_nal_parse_ctxt->s_nal_prms;
 1034|  2.50M|    ps_nal_prms = &ps_nal_parse_ctxt->s_nal_prms;
 1035|  2.50M|    ps_nal_buf = &ps_nal_parse_ctxt->s_nal_buf;
 1036|  2.50M|    ps_prefix_nal_buf = &ps_nal_parse_ctxt->s_prefix_nal_buf;
 1037|       |
 1038|       |    /* If prefix NAL unit then          */
 1039|       |    /* - calculate the SODB length      */
 1040|  2.50M|    if(PREFIX_UNIT_NAL == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   64|  2.50M|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (1040:8): [True: 2.54k, False: 2.50M]
  ------------------
 1041|  2.54k|    {
 1042|       |        /* Since we consume the zeroes in start code also */
 1043|       |        /* size has to reduced                            */
 1044|  2.54k|        if(NAL_END == ps_nal_parse_ctxt->i4_find_nal_state)
  ------------------
  |  Branch (1044:12): [True: 2.54k, False: 0]
  ------------------
 1045|  2.54k|        {
 1046|  2.54k|            ps_prefix_nal_buf->i4_buf_size -= 2;
 1047|  2.54k|        }
 1048|       |
 1049|  2.54k|        ps_prefix_nal_buf->u4_max_bits =
 1050|  2.54k|            isvcd_nal_rbsp_to_sodb(ps_prefix_nal_buf->pu1_buf, ps_prefix_nal_buf->i4_buf_size, 0);
 1051|  2.54k|        memcpy(&ps_nal_parse_ctxt->s_prefix_nal_prms, &ps_nal_parse_ctxt->s_nal_prms,
 1052|  2.54k|               sizeof(nal_prms_t));
 1053|  2.54k|        return;
 1054|  2.54k|    }
 1055|       |
 1056|  2.50M|    if(ANNEX_B == ps_nal_parse_ctxt->i4_input_bitstream_mode)
  ------------------
  |  |   64|  2.50M|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
  |  Branch (1056:8): [True: 2.50M, False: 0]
  ------------------
 1057|  2.50M|    {
 1058|       |        /* Since we consume the zeroes in start code also */
 1059|       |        /* size has to reduced                            */
 1060|  2.50M|        if(NAL_END == ps_nal_parse_ctxt->i4_find_nal_state)
  ------------------
  |  Branch (1060:12): [True: 2.50M, False: 0]
  ------------------
 1061|  2.50M|        {
 1062|  2.50M|            ps_nal_buf->i4_buf_size -= 2;
 1063|  2.50M|        }
 1064|  2.50M|    }
 1065|       |
 1066|  2.50M|    if(VCL_NAL == ps_nal_prms->i4_derived_nal_type)
  ------------------
  |  Branch (1066:8): [True: 304k, False: 2.19M]
  ------------------
 1067|   304k|    {
 1068|   304k|        dqid_node_t *ps_dqid_node;
 1069|   304k|        vcl_node_t *ps_node;
 1070|   304k|        WORD32 i4_status;
 1071|   304k|        dec_pic_params_t *ps_pps;
 1072|   304k|        dec_seq_params_t *ps_sps;
 1073|   304k|        vcl_buf_hdr_t *ps_vcl_hdr;
 1074|   304k|        vcl_buf_hdr_t *ps_prev_vcl_hdr;
 1075|   304k|        WORD32 i4_slice_offset;
 1076|       |
 1077|   304k|        ps_sps = ps_nal_parse_ctxt->pv_seq_prms;
 1078|   304k|        ps_sps += ps_nal_prms->u1_sps_id;
 1079|   304k|        ps_pps = ps_nal_parse_ctxt->pv_pic_prms;
 1080|   304k|        ps_pps += ps_nal_prms->u1_pps_id;
 1081|       |
 1082|       |        /* Get the VCL NAL node */
 1083|   304k|        i4_status = isvcd_get_dqid_node(&ps_nal_parse_ctxt->s_dqid_ctxt,
 1084|   304k|                                        (UWORD8) ps_nal_parse_ctxt->i4_prev_dq_id, &ps_dqid_node);
 1085|       |
 1086|   304k|        ps_node = ps_dqid_node->ps_vcl_node;
 1087|       |
 1088|   304k|        if(NULL == ps_node)
  ------------------
  |  Branch (1088:12): [True: 0, False: 304k]
  ------------------
 1089|      0|        {
 1090|       |            /* no active node has been acquired */
 1091|      0|            return;
 1092|      0|        }
 1093|       |
 1094|       |        /*-------------------------------------------------------------------*/
 1095|       |        /* The DQID list updation should happen only once in a               */
 1096|       |        /* layer. Hence a flag used to determine whether the                 */
 1097|       |        /* layer is already initialized or not.                              */
 1098|       |        /*-------------------------------------------------------------------*/
 1099|   304k|        if(SVCD_FALSE == ps_dqid_node->u1_valid_flag)
  ------------------
  |  |   45|   304k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1099:12): [True: 207k, False: 96.4k]
  ------------------
 1100|   207k|        {
 1101|       |            /* Update the DQID node */
 1102|   207k|            ps_dqid_node->u1_valid_flag = SVCD_TRUE;
  ------------------
  |  |   46|   207k|#define SVCD_TRUE 1
  ------------------
 1103|   207k|            ps_dqid_node->u1_dqid = (ps_nal_prms->i4_dependency_id << 4);
 1104|   207k|            ps_dqid_node->u1_dqid += ps_nal_prms->i4_quality_id;
 1105|   207k|            ps_dqid_node->i4_poc_lsb = ps_nal_prms->i4_poc_lsb;
 1106|   207k|            ps_dqid_node->i4_delta_poc_bot = ps_nal_prms->i4_delta_poc_bot;
 1107|   207k|            ps_dqid_node->ai4_delta_poc[0] = ps_nal_prms->ai4_delta_poc[0];
 1108|   207k|            ps_dqid_node->ai4_delta_poc[1] = ps_nal_prms->ai4_delta_poc[1];
 1109|       |
 1110|       |            /* Update the VCL node */
 1111|   207k|            ps_node->i4_quality_id = ps_nal_prms->i4_quality_id;
 1112|   207k|            ps_node->i4_dependency_id = ps_nal_prms->i4_dependency_id;
 1113|   207k|            ps_node->i4_temporal_id = ps_nal_prms->i4_temporal_id;
 1114|   207k|            ps_node->i4_priority_id = ps_nal_prms->i4_priority_id;
 1115|   207k|            ps_node->i4_idr_pic_flag = ps_nal_prms->i4_idr_pic_flag;
 1116|   207k|            ps_node->i4_nal_ref_idc = ps_nal_prms->i4_nal_ref_idc;
 1117|   207k|            ps_node->i4_nal_unit_type = ps_nal_prms->i4_nal_unit_type;
 1118|   207k|            ps_node->i4_use_ref_base = ps_nal_prms->i4_use_ref_base_pic_flag;
 1119|   207k|            ps_node->i4_nal_ref_idc = ps_nal_prms->i4_nal_ref_idc;
 1120|   207k|            ps_node->u1_sps_id = ps_nal_prms->u1_sps_id;
 1121|   207k|            ps_node->u1_pps_id = ps_nal_prms->u1_pps_id;
 1122|   207k|            ps_node->u2_frm_num = ps_nal_prms->u2_frm_num;
 1123|   207k|            ps_node->i4_idr_pic_num = ps_nal_prms->i4_idr_pic_num;
 1124|   207k|            ps_node->i4_num_slices = 0;
 1125|   207k|            ps_node->u1_acc_no_int_pred = 1;
 1126|   207k|            if(0 == ps_sps->u1_pic_order_cnt_type)
  ------------------
  |  Branch (1126:16): [True: 168k, False: 39.4k]
  ------------------
 1127|   168k|            {
 1128|   168k|                ps_node->i4_poc_syntax = ps_nal_prms->i4_poc_lsb;
 1129|   168k|            }
 1130|  39.4k|            else
 1131|  39.4k|            {
 1132|  39.4k|                ps_node->i4_poc_syntax = ps_nal_prms->ai4_delta_poc[0];
 1133|  39.4k|            }
 1134|       |
 1135|       |            /* Insert the node into DQID list */
 1136|   207k|            i4_status = isvcd_insert_vcl_node(ps_vcl_nal, ps_node);
 1137|   207k|            if(OK != i4_status)
  ------------------
  |  |  114|   207k|#define OK        0
  ------------------
  |  Branch (1137:16): [True: 0, False: 207k]
  ------------------
 1138|      0|            {
 1139|      0|                return;
 1140|      0|            }
 1141|       |
 1142|       |            /* Reset the previous field */
 1143|   207k|            ps_nal_parse_ctxt->ps_prev_vcl_buf = NULL;
 1144|   207k|            ps_node->ps_first_vcl_nal = NULL;
 1145|   207k|        }
 1146|       |
 1147|       |        /* Update accumulated no inter layer prediction */
 1148|   304k|        ps_node->u1_acc_no_int_pred &= (UWORD8) ps_nal_prms->i4_no_int_lyr_pred;
 1149|       |
 1150|       |        /****************** Fill VCL BUF header ************/
 1151|       |
 1152|       |        /* If prefix NAL unit is present then update  */
 1153|       |        /* the following                              */
 1154|       |        /* - Start of buffer header will be present in*/
 1155|       |        /*   before the start of prefix NAL unit's SODB*/
 1156|       |        /*   data.                                    */
 1157|       |        /*   Note: If memeory left for buffer header  */
 1158|       |        /*   of the prefix NAL unit will have junk    */
 1159|       |        /*   values                                   */
 1160|       |
 1161|   304k|        if(NULL == ps_nal_buf->pu1_buf)
  ------------------
  |  Branch (1161:12): [True: 0, False: 304k]
  ------------------
 1162|      0|        {
 1163|       |            /* no nal needs to be added into the list hence return */
 1164|      0|            return;
 1165|      0|        }
 1166|   304k|        else
 1167|   304k|        {
 1168|   304k|            ps_vcl_hdr = (vcl_buf_hdr_t *) (ps_nal_buf->pu1_buf - GET_NAL_BUF_INC(VCL_NAL));
 1169|   304k|        }
 1170|       |
 1171|   304k|        i4_slice_offset = 0;
 1172|   304k|        if(SVCD_TRUE == ps_prefix_nal_buf->i4_valid_flag)
  ------------------
  |  |   46|   304k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1172:12): [True: 907, False: 303k]
  ------------------
 1173|    907|        {
 1174|    907|            ps_vcl_hdr = (vcl_buf_hdr_t *) (ps_prefix_nal_buf->pu1_buf - GET_NAL_BUF_INC(VCL_NAL));
 1175|    907|            i4_slice_offset = ps_nal_buf->pu1_buf - ps_prefix_nal_buf->pu1_buf;
 1176|    907|        }
 1177|       |
 1178|       |        /* Update the next field of the previous nal  */
 1179|       |        /* unit or if it is the first NAL then update */
 1180|       |        /* VCL node information                       */
 1181|   304k|        ps_prev_vcl_hdr = ps_nal_parse_ctxt->ps_prev_vcl_buf;
 1182|   304k|        if(NULL != ps_prev_vcl_hdr)
  ------------------
  |  Branch (1182:12): [True: 96.4k, False: 207k]
  ------------------
 1183|  96.4k|        {
 1184|  96.4k|            ps_prev_vcl_hdr->ps_next = ps_vcl_hdr;
 1185|  96.4k|        }
 1186|   207k|        else
 1187|   207k|        {
 1188|   207k|            ps_node->ps_first_vcl_nal = ps_vcl_hdr;
 1189|   207k|        }
 1190|       |
 1191|       |        /* Fill the VCL buffer header */
 1192|   304k|        ps_vcl_hdr->ps_next = NULL;
 1193|   304k|        ps_vcl_hdr->i4_no_int_lyr_pred = ps_nal_prms->i4_no_int_lyr_pred;
 1194|   304k|        ps_vcl_hdr->i4_first_mb_addr = ps_nal_prms->u4_first_mb_addr;
 1195|   304k|        ps_vcl_hdr->u4_prefix_nal_bits = ps_prefix_nal_buf->u4_max_bits;
 1196|   304k|        ps_vcl_hdr->i4_slice_offset = 0;
 1197|   304k|        ps_vcl_hdr->i4_buf_offset = GET_NAL_BUF_INC(VCL_NAL);
 1198|   304k|        ps_vcl_hdr->i4_slice_offset = i4_slice_offset;
 1199|       |
 1200|       |        /* Determine max num bits */
 1201|   304k|        ps_nal_buf->u4_max_bits = isvcd_nal_rbsp_to_sodb(
 1202|   304k|            ps_nal_buf->pu1_buf, ps_nal_buf->i4_buf_size, ps_pps->u1_entropy_coding_mode);
 1203|   304k|        ps_vcl_hdr->u4_max_bits = ps_nal_buf->u4_max_bits;
 1204|       |
 1205|       |        /* Updates */
 1206|   304k|        ps_nal_parse_ctxt->ps_prev_vcl_buf = ps_vcl_hdr;
 1207|   304k|        ps_node->i4_num_slices += 1;
 1208|   304k|    }
 1209|       |    /*-----------------------------------------------------------------------*/
 1210|       |    /* If start of NAL and if its a NON VCL NAL then update the              */
 1211|       |    /* start address of the NON VCL NAL                                      */
 1212|       |    /*-----------------------------------------------------------------------*/
 1213|  2.19M|    else
 1214|  2.19M|    {
 1215|  2.19M|        non_vcl_buf_hdr_t *ps_non_vcl_buf_hdr;
 1216|  2.19M|        non_vcl_buf_hdr_t *ps_prev_non_vcl_buf_hdr;
 1217|       |
 1218|  2.19M|        ps_non_vcl_buf_hdr =
 1219|  2.19M|            (non_vcl_buf_hdr_t *) (ps_nal_buf->pu1_buf - GET_NAL_BUF_INC(NON_VCL_NAL));
 1220|       |
 1221|       |        /* Update NON VCL structure */
 1222|  2.19M|        ps_non_vcl_buf_hdr->i4_nal_unit_type = ps_nal_prms->i4_nal_unit_type;
 1223|  2.19M|        ps_non_vcl_buf_hdr->ps_next = NULL;
 1224|  2.19M|        ps_non_vcl_buf_hdr->i4_buf_offset = GET_NAL_BUF_INC(NON_VCL_NAL);
 1225|  2.19M|        ps_non_vcl_buf_hdr->i4_buf_size = ps_nal_buf->i4_buf_size;
 1226|       |
 1227|       |        /* Update the next field and first non vcl fields of */
 1228|       |        /* non vcl buffer header structure and non vcl       */
 1229|       |        /* structure respectively                            */
 1230|  2.19M|        ps_prev_non_vcl_buf_hdr = ps_nal_parse_ctxt->ps_prev_non_vcl_buf;
 1231|  2.19M|        if(NULL != ps_prev_non_vcl_buf_hdr)
  ------------------
  |  Branch (1231:12): [True: 2.11M, False: 85.9k]
  ------------------
 1232|  2.11M|        {
 1233|  2.11M|            ps_prev_non_vcl_buf_hdr->ps_next = ps_non_vcl_buf_hdr;
 1234|  2.11M|        }
 1235|  85.9k|        else
 1236|  85.9k|        {
 1237|  85.9k|            ps_non_vcl_nal->ps_first_non_vcl_nal = ps_non_vcl_buf_hdr;
 1238|  85.9k|        }
 1239|       |
 1240|       |        /* Updates */
 1241|  2.19M|        ps_nal_parse_ctxt->i4_num_non_vcl_nals += 1;
 1242|  2.19M|        ps_non_vcl_nal->i4_num_non_vcl_nals = ps_nal_parse_ctxt->i4_num_non_vcl_nals;
 1243|  2.19M|        ps_nal_parse_ctxt->ps_prev_non_vcl_buf = ps_non_vcl_buf_hdr;
 1244|  2.19M|    }
 1245|  2.50M|}
isvcd_refine_dqid_list:
 1340|   162k|{
 1341|   162k|    vcl_node_t *ps_node;
 1342|   162k|    target_lyr_attr_t *ps_int_attr;
 1343|   162k|    dqid_ctxt_t *ps_dqid_ctxt;
 1344|   162k|    UWORD8 u1_dep_id;
 1345|   162k|    WORD32 i4_status;
 1346|   162k|    WORD32 i4_dep_id;
 1347|       |
 1348|   162k|    ps_int_attr = &ps_nal_parse_ctxt->s_int_attr;
 1349|   162k|    ps_dqid_ctxt = &ps_nal_parse_ctxt->s_dqid_ctxt;
 1350|   162k|    i4_dep_id = -1;
 1351|       |
 1352|   400k|    for(u1_dep_id = 0; u1_dep_id <= ps_int_attr->i4_dependency_id; u1_dep_id++)
  ------------------
  |  Branch (1352:24): [True: 238k, False: 161k]
  ------------------
 1353|   238k|    {
 1354|   238k|        dqid_node_t *ps_dqid_node;
 1355|       |
 1356|       |        /* Get a DQID node */
 1357|   238k|        i4_status = isvcd_get_dqid_node(ps_dqid_ctxt, (UWORD8) (u1_dep_id << 4), &ps_dqid_node);
 1358|   238k|        if(OK != i4_status)
  ------------------
  |  |  114|   238k|#define OK        0
  ------------------
  |  Branch (1358:12): [True: 0, False: 238k]
  ------------------
 1359|      0|        {
 1360|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1361|      0|        }
 1362|       |
 1363|       |        /* If node does not exist already then insert a dummy node */
 1364|   238k|        if(SVCD_FALSE == ps_dqid_node->u1_valid_flag)
  ------------------
  |  |   45|   238k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1364:12): [True: 35.0k, False: 203k]
  ------------------
 1365|  35.0k|        {
 1366|  35.0k|            if(1 == ps_nal_parse_ctxt->i4_idr_pic_err_flag)
  ------------------
  |  Branch (1366:16): [True: 382, False: 34.6k]
  ------------------
 1367|    382|            {
 1368|    382|                ps_int_attr->i4_dependency_id = i4_dep_id;
 1369|    382|                ps_int_attr->i4_quality_id = MAX_QUALITY_ID;
  ------------------
  |  |  102|    382|#define MAX_QUALITY_ID 0
  ------------------
 1370|       |
 1371|       |                /* remove all the nodes from dependency list */
 1372|       |                /* which are at higher dependency than the   */
 1373|       |                /* value set in init attributes              */
 1374|    568|                while(NULL != ps_vcl_nal->ps_top_node)
  ------------------
  |  Branch (1374:23): [True: 286, False: 282]
  ------------------
 1375|    286|                {
 1376|       |                    /* if higher dependency */
 1377|    286|                    if(ps_vcl_nal->ps_top_node->i4_dependency_id > i4_dep_id)
  ------------------
  |  Branch (1377:24): [True: 186, False: 100]
  ------------------
 1378|    186|                    {
 1379|    186|                        ps_vcl_nal->ps_top_node = ps_vcl_nal->ps_top_node->ps_bot_node;
 1380|    186|                    }
 1381|    100|                    else
 1382|    100|                    {
 1383|    100|                        break;
 1384|    100|                    }
 1385|    286|                }
 1386|       |
 1387|       |                /* if no node exists in the dependency list */
 1388|    382|                if(NULL == ps_vcl_nal->ps_top_node)
  ------------------
  |  Branch (1388:20): [True: 282, False: 100]
  ------------------
 1389|    282|                {
 1390|    282|                    ps_vcl_nal->ps_bot_node = NULL;
 1391|    282|                }
 1392|    100|                else if(ps_vcl_nal->ps_top_node == ps_vcl_nal->ps_bot_node)
  ------------------
  |  Branch (1392:25): [True: 100, False: 0]
  ------------------
 1393|    100|                {
 1394|       |                    /* if a single node exists */
 1395|    100|                    ps_vcl_nal->ps_top_node->ps_bot_node = NULL;
 1396|    100|                    ps_vcl_nal->ps_bot_node->ps_top_node = NULL;
 1397|    100|                }
 1398|       |
 1399|    382|                return (NOT_OK);
  ------------------
  |  |  116|    382|#define NOT_OK    -1
  ------------------
 1400|    382|            }
 1401|  34.6k|            else
 1402|  34.6k|            {
 1403|  34.6k|                ps_dqid_node->u1_valid_flag = SVCD_TRUE;
  ------------------
  |  |   46|  34.6k|#define SVCD_TRUE 1
  ------------------
 1404|  34.6k|                ps_dqid_node->u1_dqid = (u1_dep_id << 4);
 1405|       |
 1406|       |                /* Fill VCL node information */
 1407|  34.6k|                ps_node = ps_dqid_node->ps_vcl_node;
 1408|  34.6k|                ps_node->i4_dependency_id = u1_dep_id;
 1409|  34.6k|                ps_node->i4_quality_id = 0;
 1410|  34.6k|                ps_node->ps_first_vcl_nal = NULL;
 1411|  34.6k|            }
 1412|       |
 1413|       |            /* Insert node into DQID list */
 1414|  34.6k|            i4_status = isvcd_insert_vcl_node(ps_vcl_nal, ps_node);
 1415|  34.6k|            if(OK != i4_status)
  ------------------
  |  |  114|  34.6k|#define OK        0
  ------------------
  |  Branch (1415:16): [True: 0, False: 34.6k]
  ------------------
 1416|      0|            {
 1417|      0|                return (NOT_OK);
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1418|      0|            }
 1419|  34.6k|        }
 1420|       |
 1421|   238k|        i4_dep_id++;
 1422|   238k|    } /* End of loop over all the dependency id */
 1423|   161k|    return (OK);
  ------------------
  |  |  114|   161k|#define OK        0
  ------------------
 1424|   162k|}
isvcd_nal_parse_set_target_attr:
 1457|  21.5k|{
 1458|  21.5k|    nal_parse_ctxt_t *ps_nal_parse_ctxt;
 1459|  21.5k|    target_lyr_attr_t *ps_app_attr;
 1460|       |
 1461|  21.5k|    if((i4_target_quality_id > MAX_QUALITY_ID) || (i4_target_dependency_id > MAX_DEPENDENCY_ID))
  ------------------
  |  |  102|  21.5k|#define MAX_QUALITY_ID 0
  ------------------
                  if((i4_target_quality_id > MAX_QUALITY_ID) || (i4_target_dependency_id > MAX_DEPENDENCY_ID))
  ------------------
  |  |  103|  21.5k|#define MAX_DEPENDENCY_ID 4
  ------------------
  |  Branch (1461:8): [True: 0, False: 21.5k]
  |  Branch (1461:51): [True: 0, False: 21.5k]
  ------------------
 1462|      0|    {
 1463|      0|        return IV_FAIL;
 1464|      0|    }
 1465|       |
 1466|  21.5k|    ps_nal_parse_ctxt = (nal_parse_ctxt_t *) pv_nal_parse_ctxt;
 1467|  21.5k|    ps_app_attr = &ps_nal_parse_ctxt->s_app_attr;
 1468|       |
 1469|       |    /*-----------------------------------------------------------------------*/
 1470|       |    /*! Register the target information into context structure               */
 1471|       |    /*-----------------------------------------------------------------------*/
 1472|  21.5k|    ps_app_attr->i4_quality_id = i4_target_quality_id;
 1473|  21.5k|    ps_app_attr->i4_dependency_id = i4_target_dependency_id;
 1474|  21.5k|    ps_app_attr->i4_temporal_id = i4_target_temporal_id;
 1475|  21.5k|    ps_app_attr->i4_priority_id = i4_target_priority_id;
 1476|  21.5k|    return IV_SUCCESS;
 1477|  21.5k|}
isvcd_nal_parse_reset_ctxt:
 1510|  21.5k|{
 1511|  21.5k|    nal_parse_ctxt_t *ps_nal_parse_ctxt = (nal_parse_ctxt_t *) pv_nal_parse_ctxt;
 1512|  21.5k|    UNUSED(i4_input_mode);
  ------------------
  |  |   45|  21.5k|#define UNUSED(x) ((void)(x))
  ------------------
 1513|       |
 1514|       |    /*-----------------------------------------------------------------------*/
 1515|       |    /*! Set the input bitstream mode of context structure                    */
 1516|       |    /*-----------------------------------------------------------------------*/
 1517|  21.5k|    switch(i4_input_bitstream_mode)
 1518|  21.5k|    {
 1519|  21.5k|        case ANNEX_B:
  ------------------
  |  |   64|  21.5k|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
  |  Branch (1519:9): [True: 21.5k, False: 0]
  ------------------
 1520|  21.5k|        case NON_ANNEX_B:
  ------------------
  |  |   65|  21.5k|#define NON_ANNEX_B 1 /*!< Non Annex B RFC stream */
  ------------------
  |  Branch (1520:9): [True: 0, False: 21.5k]
  ------------------
 1521|  21.5k|            break;
 1522|      0|        default:
  ------------------
  |  Branch (1522:9): [True: 0, False: 21.5k]
  ------------------
 1523|      0|            break;
 1524|  21.5k|    }
 1525|       |
 1526|  21.5k|    ps_nal_parse_ctxt->i4_input_bitstream_mode = i4_input_bitstream_mode;
 1527|       |
 1528|       |    /*-----------------------------------------------------------------------*/
 1529|       |    /*! Perform the picture level initialization                             */
 1530|       |    /*-----------------------------------------------------------------------*/
 1531|  21.5k|    isvcd_pic_reset_ctxt(pv_nal_parse_ctxt);
 1532|       |
 1533|       |    /* Reset the prefix nal unit buffer structure */
 1534|  21.5k|    isvcd_nal_buf_reset(&ps_nal_parse_ctxt->s_prefix_nal_buf);
 1535|       |
 1536|       |    /*-----------------------------------------------------------------------*/
 1537|       |    /*! Reset other varaibles                                                */
 1538|       |    /*-----------------------------------------------------------------------*/
 1539|  21.5k|    ps_nal_parse_ctxt->i4_dec_frst_sc_flag = SVCD_TRUE;
  ------------------
  |  |   46|  21.5k|#define SVCD_TRUE 1
  ------------------
 1540|  21.5k|    ps_nal_parse_ctxt->i4_eos_flag = SVCD_FALSE;
  ------------------
  |  |   45|  21.5k|#define SVCD_FALSE 0
  ------------------
 1541|  21.5k|    ps_nal_parse_ctxt->u1_pic_boundary_aud_flag = 0;
 1542|  21.5k|    ps_nal_parse_ctxt->u4_bytes_left = 0;
 1543|       |
 1544|       |    /* Reset target layer attributes */
 1545|  21.5k|    {
 1546|  21.5k|        target_lyr_attr_t *ps_app_attr;
 1547|  21.5k|        target_lyr_attr_t *ps_int_attr;
 1548|       |
 1549|  21.5k|        ps_app_attr = &ps_nal_parse_ctxt->s_app_attr;
 1550|  21.5k|        ps_int_attr = &ps_nal_parse_ctxt->s_int_attr;
 1551|       |
 1552|  21.5k|        ps_app_attr->i4_dependency_id = MAX_DEPENDENCY_ID;
  ------------------
  |  |  103|  21.5k|#define MAX_DEPENDENCY_ID 4
  ------------------
 1553|  21.5k|        ps_app_attr->i4_quality_id = MAX_QUALITY_ID;
  ------------------
  |  |  102|  21.5k|#define MAX_QUALITY_ID 0
  ------------------
 1554|  21.5k|        ps_app_attr->i4_temporal_id = MAX_TEMPORAL_ID;
  ------------------
  |  |  104|  21.5k|#define MAX_TEMPORAL_ID 7
  ------------------
 1555|  21.5k|        ps_app_attr->i4_priority_id = MAX_PRIORITY_ID;
  ------------------
  |  |  105|  21.5k|#define MAX_PRIORITY_ID 63
  ------------------
 1556|       |
 1557|  21.5k|        ps_int_attr->i4_dependency_id = -1;
 1558|  21.5k|        ps_int_attr->i4_quality_id = MAX_QUALITY_ID;
  ------------------
  |  |  102|  21.5k|#define MAX_QUALITY_ID 0
  ------------------
 1559|  21.5k|        ps_int_attr->i4_temporal_id = 0;
 1560|  21.5k|        ps_int_attr->i4_priority_id = MAX_PRIORITY_ID;
  ------------------
  |  |  105|  21.5k|#define MAX_PRIORITY_ID 63
  ------------------
 1561|  21.5k|    }
 1562|  21.5k|}
isvcd_nal_parse_partial_signal_eos:
 1593|     15|{
 1594|     15|    nal_parse_ctxt_t *ps_nal_parse_ctxt;
 1595|     15|    vcl_nal_t *ps_vcl_nal;
 1596|       |
 1597|     15|    ps_nal_parse_ctxt = (nal_parse_ctxt_t *) pv_nal_parse_ctxt;
 1598|     15|    ps_vcl_nal = (vcl_nal_t *) pv_out_vcl_nal;
 1599|       |
 1600|       |    /* for RFC mode */
 1601|     15|    if(NON_ANNEX_B == ps_nal_parse_ctxt->i4_input_bitstream_mode)
  ------------------
  |  |   65|     15|#define NON_ANNEX_B 1 /*!< Non Annex B RFC stream */
  ------------------
  |  Branch (1601:8): [True: 0, False: 15]
  ------------------
 1602|      0|    {
 1603|       |        /* Reset the end of stream flag so that in    */
 1604|      0|        ps_nal_parse_ctxt->i4_eos_flag = SVCD_TRUE;
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 1605|      0|    }
 1606|       |
 1607|     15|    if(1 == ps_nal_parse_ctxt->u1_pic_boundary_aud_flag)
  ------------------
  |  Branch (1607:8): [True: 11, False: 4]
  ------------------
 1608|     11|    {
 1609|     11|        ps_nal_parse_ctxt->i4_eos_flag = SVCD_TRUE;
  ------------------
  |  |   46|     11|#define SVCD_TRUE 1
  ------------------
 1610|     11|    }
 1611|       |    /* Update VCL node if it is first call in the */
 1612|       |    /* flush mode                                 */
 1613|     15|    if(SVCD_FALSE == ps_nal_parse_ctxt->i4_eos_flag)
  ------------------
  |  |   45|     15|#define SVCD_FALSE 0
  ------------------
  |  Branch (1613:8): [True: 4, False: 11]
  ------------------
 1614|      4|    {
 1615|      4|        WORD32 i4_status;
 1616|       |
 1617|       |        /* Update the unfinished NAL into VCL node if */
 1618|       |        /* all the following conditions are true      */
 1619|       |        /* 1. We have not found the start code and    */
 1620|       |        /*    NAL boundary is not detected yet        */
 1621|       |        /* 2. NAL is not discarded                    */
 1622|      4|        if((FIND_NAL_END == ps_nal_parse_ctxt->i4_find_nal_state) &&
  ------------------
  |  Branch (1622:12): [True: 0, False: 4]
  ------------------
 1623|      0|           (SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag))
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
  |  Branch (1623:12): [True: 0, False: 0]
  ------------------
 1624|      0|        {
 1625|      0|            isvcd_update_nal_ctxt(ps_nal_parse_ctxt, pv_out_vcl_nal, pv_out_non_vcl_nal);
 1626|      0|        }
 1627|       |
 1628|      4|        ps_nal_parse_ctxt->i4_idr_pic_err_flag = 0;
 1629|       |        /* Refine based on the no inter layer pred flag*/
 1630|      4|        i4_status = isvcd_refine_dqid_list(ps_vcl_nal, ps_nal_parse_ctxt);
 1631|       |
 1632|      4|        if(!(OK == i4_status))
  ------------------
  |  |  114|      4|#define OK        0
  ------------------
  |  Branch (1632:12): [True: 0, False: 4]
  ------------------
 1633|      0|        {
 1634|      0|            return i4_status;
 1635|      0|        }
 1636|      4|        UNUSED(i4_status);
  ------------------
  |  |   45|      4|#define UNUSED(x) ((void)(x))
  ------------------
 1637|       |
 1638|       |        /* Reset the context structure variables */
 1639|      4|        isvcd_nal_reset_ctxt(ps_nal_parse_ctxt);
 1640|       |
 1641|       |        /* Reset the end of stream flag so that in    */
 1642|       |        /* the next flush call the above steps need   */
 1643|       |        /* not be performed                           */
 1644|      4|        ps_nal_parse_ctxt->i4_eos_flag = SVCD_TRUE;
  ------------------
  |  |   46|      4|#define SVCD_TRUE 1
  ------------------
 1645|       |
 1646|      4|        return (PIC_BOUNDARY_TRUE);
 1647|      4|    }
 1648|     11|    else
 1649|     11|    {
 1650|     11|        return (FLUSH_DECODED_PICTURE);
 1651|     11|    }
 1652|     15|}
isvcd_nal_parse_pic_bound_proc:
 1677|   162k|{
 1678|   162k|    WORD32 i4_status;
 1679|       |
 1680|   162k|    i4_status = isvcd_refine_dqid_list(ps_vcl_nal, ps_nal_parse_ctxt);
 1681|       |
 1682|       |    /* in case of IDR pictures if the node     */
 1683|       |    /* which has to be added into dependency   */
 1684|       |    /* list is not valied then the layer below */
 1685|       |    /* that node is set as target layer        */
 1686|       |
 1687|   162k|    if(NOT_OK == i4_status)
  ------------------
  |  |  116|   162k|#define NOT_OK    -1
  ------------------
  |  Branch (1687:8): [True: 382, False: 161k]
  ------------------
 1688|    382|    {
 1689|    382|        ps_nal_parse_ctxt->i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|    382|#define SVCD_TRUE 1
  ------------------
 1690|    382|        ps_vcl_nal->i1_nal_ref_id_next = -1;
 1691|    382|    }
 1692|   161k|    else
 1693|   161k|    {
 1694|       |        /* update the next access unit params */
 1695|       |        /* will be used by lower level decoder*/
 1696|       |        /* for concealment of frame number    */
 1697|       |        /* applicable for single layer cases  */
 1698|   161k|        ps_vcl_nal->i1_nal_ref_id_next = ps_nal_prms->i4_nal_ref_idc;
 1699|       |
 1700|   161k|        ps_vcl_nal->u2_frm_num_next = ps_nal_prms->u2_frm_num;
 1701|   161k|    }
 1702|       |
 1703|       |    /* -------- reset few variables in context structure ----*/
 1704|   162k|    isvcd_pic_reset_ctxt(ps_nal_parse_ctxt);
 1705|   162k|}
isvcd_nal_parse_vcl_nal_partial:
 1741|   167k|{
 1742|       |    /*! - Search for the NAL boundary
 1743|       |        - If NAL boundary is not found and bytes consumed is lesser than
 1744|       |          minimum buffer size then break out of the loop
 1745|       |        - if it is start of NAL then read the NAL header
 1746|       |        - If it is a VCL NAL then invoke picture boundary detection logic and
 1747|       |          picture boundary is detected then break out of the loop without
 1748|       |          updating the bytes consumed variable
 1749|       |        - NAL discard logic determines whther the current NAL has to be
 1750|       |          discarded or not
 1751|       |        - If NAL is not discarded then populate the vcl or non vcl output
 1752|       |          structures
 1753|       |    */
 1754|   167k|    nal_parse_ctxt_t *ps_nal_parse_ctxt;
 1755|   167k|    vcl_nal_t *ps_vcl_nal;
 1756|   167k|    non_vcl_nal_t *ps_non_vcl_nal;
 1757|   167k|    nal_unit_t *ps_nal_unit;
 1758|   167k|    WORD32 i4_nal_start_flag, i4_cur_pos, i4_status;
 1759|   167k|    WORD32 i4_nal_header_len, i4_more_data_flag;
 1760|   167k|    UWORD32 u4_bytes_consumed_temp = 0;
 1761|   167k|    UWORD8 **ppu1_out_buf;
 1762|   167k|    nal_prms_t *ps_nal_prms;
 1763|   167k|    WORD32 i4_pic_bound_status;
 1764|       |
 1765|   167k|    ps_nal_parse_ctxt = (nal_parse_ctxt_t *) pv_nal_parse_ctxt;
 1766|   167k|    ps_vcl_nal = (vcl_nal_t *) pv_out_vcl_nal;
 1767|   167k|    ps_non_vcl_nal = (non_vcl_nal_t *) pv_out_non_vcl_nal;
 1768|   167k|    ps_nal_unit = (nal_unit_t *) ps_nal_parse_ctxt->pv_nal_unit;
 1769|   167k|    ps_nal_prms = &ps_nal_parse_ctxt->s_nal_prms;
 1770|       |
 1771|       |    /* Initialization */
 1772|   167k|    i4_cur_pos = 0;
 1773|   167k|    *pu4_bytes_consumed = 0;
 1774|   167k|    i4_nal_header_len = 0;
 1775|   167k|    i4_nal_start_flag = SVCD_FALSE;
  ------------------
  |  |   45|   167k|#define SVCD_FALSE 0
  ------------------
 1776|   167k|    i4_more_data_flag = SVCD_TRUE;
  ------------------
  |  |   46|   167k|#define SVCD_TRUE 1
  ------------------
 1777|   167k|    i4_pic_bound_status = PIC_BOUNDARY_FALSE;
 1778|       |
 1779|   167k|    ps_non_vcl_nal->i4_num_non_vcl_nals = ps_nal_parse_ctxt->i4_num_non_vcl_nals;
 1780|       |
 1781|       |    /* Since we do not perform the picture boundary detection */
 1782|       |    /* on the prefix NAL unit, the current picture's prefix   */
 1783|       |    /* NAL unit will be at the bottom of the buffer. Hence    */
 1784|       |    /* it should be copied to top of the buffer               */
 1785|   167k|    if(SVCD_TRUE == ps_nal_parse_ctxt->i4_is_frst_vcl_nal_in_au)
  ------------------
  |  |   46|   167k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1785:8): [True: 167k, False: 105]
  ------------------
 1786|   167k|    {
 1787|   167k|        nal_buf_t *ps_prefix_nal_buf;
 1788|       |
 1789|   167k|        ps_prefix_nal_buf = &ps_nal_parse_ctxt->s_prefix_nal_buf;
 1790|   167k|        if(SVCD_TRUE == ps_prefix_nal_buf->i4_valid_flag)
  ------------------
  |  |   46|   167k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1790:12): [True: 528, False: 166k]
  ------------------
 1791|    528|        {
 1792|    528|            WORD32 i4_buf_size;
 1793|    528|            UWORD8 *pu1_vcl_nal;
 1794|       |
 1795|    528|            if(ps_prefix_nal_buf->i4_buf_size > 0)
  ------------------
  |  Branch (1795:16): [True: 109, False: 419]
  ------------------
 1796|    109|            {
 1797|    109|                i4_buf_size = ps_prefix_nal_buf->i4_buf_size;
 1798|    109|                i4_buf_size = UP_ALIGN_8(i4_buf_size + BUFFER_ALIGN_4);
  ------------------
  |  |   51|    109|#define UP_ALIGN_8(x) (((((UWORD64) x) + 7) >> 3) << 3)
  ------------------
 1799|    109|            }
 1800|    419|            else
 1801|    419|            {
 1802|    419|                i4_buf_size = 0;
 1803|    419|            }
 1804|       |
 1805|    528|            pu1_vcl_nal = ps_nal_parse_ctxt->pu1_vcl_nal_buf + i4_buf_size;
 1806|       |
 1807|    528|            memmove(ps_nal_parse_ctxt->pu1_vcl_nal_buf, ps_prefix_nal_buf->pu1_buf, i4_buf_size);
 1808|    528|            ps_prefix_nal_buf->pu1_buf = ps_nal_parse_ctxt->pu1_vcl_nal_buf;
 1809|    528|            ps_nal_parse_ctxt->pu1_vcl_nal_buf = pu1_vcl_nal;
 1810|       |
 1811|       |            /* subtract the buffer size left */
 1812|    528|            ps_nal_parse_ctxt->u4_bytes_left_vcl -= i4_buf_size;
 1813|    528|        }
 1814|       |        /* Reset the top and bottom node */
 1815|   167k|        ps_vcl_nal->ps_top_node = NULL;
 1816|   167k|        ps_vcl_nal->ps_bot_node = NULL;
 1817|   167k|        ps_vcl_nal->i1_nal_ref_id_next = -1;
 1818|   167k|        ps_vcl_nal->u2_frm_num_next = 0;
 1819|   167k|    }
 1820|       |
 1821|       |    /* If number of bytes left in the previous process call  */
 1822|       |    /* is is greater or equal to number of bytes in input    */
 1823|       |    /* buffer of the current process call then declare that  */
 1824|       |    /* end of bitstream has occurred and consume the bytes   */
 1825|       |    /* but do not decode                                     */
 1826|   167k|    if(ps_nal_parse_ctxt->u4_bytes_left >= (UWORD32) *pu4_num_bytes)
  ------------------
  |  Branch (1826:8): [True: 15, False: 167k]
  ------------------
 1827|     15|    {
 1828|     15|        ps_nal_parse_ctxt->i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|     15|#define SVCD_TRUE 1
  ------------------
 1829|     15|        *pu4_bytes_consumed = *pu4_num_bytes;
 1830|       |
 1831|     15|        i4_status =
 1832|     15|            isvcd_nal_parse_partial_signal_eos(ps_nal_parse_ctxt, ps_vcl_nal, ps_non_vcl_nal);
 1833|       |        /* set the next AU params to default values */
 1834|     15|        ps_vcl_nal->i1_nal_ref_id_next = -1;
 1835|     15|        ps_vcl_nal->u2_frm_num_next = 0;
 1836|       |
 1837|     15|        return (i4_status);
 1838|     15|    }
 1839|   167k|    ps_nal_parse_ctxt->u4_bytes_left = 0;
 1840|       |
 1841|       |    /*************************************************************************/
 1842|       |    /*                      LOOP OVER NALs                                   */
 1843|       |    /*************************************************************************/
 1844|   167k|    do
 1845|  1.41M|    {
 1846|  1.41M|        nal_buf_t *ps_nal_buf;
 1847|  1.41M|        UWORD32 *pu4_bytes_left;
 1848|       |
 1849|       |        /* Find NAL boundary                */
 1850|  1.41M|        if(ANNEX_B == ps_nal_parse_ctxt->i4_input_bitstream_mode)
  ------------------
  |  |   64|  1.41M|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
  |  Branch (1850:12): [True: 1.41M, False: 0]
  ------------------
 1851|  1.41M|        {
 1852|  1.41M|            i4_nal_start_flag = isvcd_get_annex_b_nal_unit(
 1853|  1.41M|                pu1_stream_buffer, i4_cur_pos, *pu4_num_bytes,
 1854|  1.41M|                &ps_nal_parse_ctxt->i4_find_nal_state, &ps_nal_parse_ctxt->i4_zero_byte_cnt,
 1855|  1.41M|                &u4_bytes_consumed_temp, ps_nal_parse_ctxt->pv_nal_unit, &i4_more_data_flag);
 1856|       |
 1857|  1.41M|            i4_cur_pos += u4_bytes_consumed_temp;
 1858|  1.41M|        }
 1859|       |
 1860|       |        /*********************************************************************/
 1861|       |        /*          READ NAL HEADER AND NAL DISCARD LOGIC                    */
 1862|       |        /*********************************************************************/
 1863|       |
 1864|       |        /* If it is the start of NAL header perform the following */
 1865|       |        /* 1. Decode NAL header                                   */
 1866|       |        /* 2. Determine whether the NAL has to be discarded or not*/
 1867|       |        /* 3. Detect the picture boundary                         */
 1868|  1.41M|        if(SVCD_TRUE == i4_nal_start_flag)
  ------------------
  |  |   46|  1.41M|#define SVCD_TRUE 1
  ------------------
  |  Branch (1868:12): [True: 1.41M, False: 192]
  ------------------
 1869|  1.41M|        {
 1870|  1.41M|            UWORD32 u4_err_code;
 1871|  1.41M|            WORD32 i4_sps_pps_corrupt_status;
 1872|  1.41M|            WORD32 i4_internal_dep_id_prev;
 1873|       |
 1874|       |            /* Get the NAL prms. This involves the following things*/
 1875|       |            /* 1. Decode the NAL header                            */
 1876|       |            /* 2. Set the discard flag                             */
 1877|       |            /* 3. Decode the slice header if needed                */
 1878|       |
 1879|       |            /* get the dependency id at which the NAl parse is currently */
 1880|       |            /* present */
 1881|  1.41M|            i4_internal_dep_id_prev = ps_nal_parse_ctxt->s_int_attr.i4_dependency_id;
 1882|       |
 1883|  1.41M|            i4_status = isvcd_get_nal_prms(
 1884|  1.41M|                ps_nal_unit->pu1_bufs, ps_nal_unit->i4_buf_sizes, ps_nal_prms,
 1885|  1.41M|                &ps_nal_parse_ctxt->s_prefix_nal_prms, &ps_nal_parse_ctxt->s_prefix_nal_buf,
 1886|  1.41M|                &u4_err_code, &i4_sps_pps_corrupt_status, &ps_nal_parse_ctxt->i4_discard_nal_flag,
 1887|  1.41M|                ps_nal_parse_ctxt);
 1888|       |
 1889|  1.41M|            if(NON_ANNEX_B == ps_nal_parse_ctxt->i4_input_bitstream_mode)
  ------------------
  |  |   65|  1.41M|#define NON_ANNEX_B 1 /*!< Non Annex B RFC stream */
  ------------------
  |  Branch (1889:16): [True: 0, False: 1.41M]
  ------------------
 1890|      0|            {
 1891|      0|                ps_nal_parse_ctxt->i4_prev_dq_id = ps_nal_prms->i4_dqid;
 1892|      0|            }
 1893|       |
 1894|       |            /* If the error code returned by the "picture boundary" */
 1895|       |            /* detetction is                                        */
 1896|       |            /* 1. Insufficient bitstream size: then store the bytes */
 1897|       |            /*    left and break out of the loop                    */
 1898|       |            /* 2. Corrupted slice: then discard the slice           */
 1899|  1.41M|            if((NAL_INSUFFICIENT_DATA == (WORD32) u4_err_code) &&
  ------------------
  |  Branch (1899:16): [True: 3.05k, False: 1.41M]
  ------------------
 1900|  3.05k|               (NAL_END != ps_nal_parse_ctxt->i4_find_nal_state))
  ------------------
  |  Branch (1900:16): [True: 2.33k, False: 718]
  ------------------
 1901|  2.33k|            {
 1902|  2.33k|                ps_nal_parse_ctxt->u4_bytes_left = *pu4_num_bytes - *pu4_bytes_consumed;
 1903|       |
 1904|       |                /* Reset the NAL level tracking variables */
 1905|  2.33k|                isvcd_nal_reset_ctxt(ps_nal_parse_ctxt);
 1906|  2.33k|                break;
 1907|  2.33k|            }
 1908|  1.41M|            else if(0 != u4_err_code)
  ------------------
  |  Branch (1908:21): [True: 28.3k, False: 1.38M]
  ------------------
 1909|  28.3k|            {
 1910|  28.3k|                ps_nal_parse_ctxt->i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|  28.3k|#define SVCD_TRUE 1
  ------------------
 1911|       |
 1912|  28.3k|                if(SVCD_TRUE == ps_nal_prms->i4_idr_pic_flag)
  ------------------
  |  |   46|  28.3k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1912:20): [True: 1.33k, False: 26.9k]
  ------------------
 1913|  1.33k|                {
 1914|       |                    /* IDR Error handler is called       */
 1915|       |                    /* only if for a given layer the NAL */
 1916|       |                    /* haeder and partial slice decode   */
 1917|       |                    /* routine comes out as no SPS PPS   */
 1918|       |                    /* error. But for Lowest layer in    */
 1919|       |                    /* access unit it is doen always     */
 1920|  1.33k|                    if(i4_internal_dep_id_prev != ps_nal_parse_ctxt->s_int_attr.i4_dependency_id)
  ------------------
  |  Branch (1920:24): [True: 0, False: 1.33k]
  ------------------
 1921|      0|                    {
 1922|       |                        /* if the target depedency id has been */
 1923|       |                        /* changed while decoding currnet NAL  */
 1924|       |
 1925|      0|                        if((0 != i4_sps_pps_corrupt_status) ||
  ------------------
  |  Branch (1925:28): [True: 0, False: 0]
  ------------------
 1926|      0|                           (-1 == ps_nal_parse_ctxt->i4_prev_dq_id))
  ------------------
  |  Branch (1926:28): [True: 0, False: 0]
  ------------------
 1927|      0|                        {
 1928|      0|                            i4_status =
 1929|      0|                                isvcd_idr_err_hdlr(ps_vcl_nal, ps_nal_prms, ps_nal_parse_ctxt);
 1930|      0|                            if(OK != i4_status)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (1930:32): [True: 0, False: 0]
  ------------------
 1931|      0|                            {
 1932|      0|                                return i4_status;
 1933|      0|                            }
 1934|      0|                            UNUSED(i4_status);
  ------------------
  |  |   45|      0|#define UNUSED(x) ((void)(x))
  ------------------
 1935|       |
 1936|      0|                            ps_nal_parse_ctxt->i4_tgt_lyr_update = SVCD_FALSE;
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
 1937|      0|                        }
 1938|      0|                        else
 1939|      0|                        {
 1940|      0|                            if(0 == ps_nal_prms->i4_quality_id)
  ------------------
  |  Branch (1940:32): [True: 0, False: 0]
  ------------------
 1941|      0|                            {
 1942|       |                                /* over write the frame number */
 1943|      0|                                ps_nal_parse_ctxt->s_nal_prms.u2_frm_num = 0;
 1944|       |
 1945|       |                                /* Get the previous layer's DQID */
 1946|      0|                                if(ps_nal_parse_ctxt->i4_prev_dq_id < ps_nal_prms->i4_dqid)
  ------------------
  |  Branch (1946:36): [True: 0, False: 0]
  ------------------
 1947|      0|                                {
 1948|      0|                                    ps_nal_parse_ctxt->i4_prev_dq_id = ps_nal_prms->i4_dqid;
 1949|      0|                                    ps_nal_parse_ctxt->i4_is_frst_vcl_nal_in_au = SVCD_FALSE;
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
 1950|      0|                                }
 1951|       |
 1952|       |                                /* update the nal context with the nal */
 1953|       |                                /* header params */
 1954|      0|                                isvcd_update_nal_ctxt(ps_nal_parse_ctxt, ps_vcl_nal,
 1955|      0|                                                      ps_non_vcl_nal);
 1956|      0|                            }
 1957|      0|                        }
 1958|      0|                    }
 1959|  1.33k|                }
 1960|  28.3k|            }
 1961|       |
 1962|       |            /* Populate the derived nal type into bitstream extract*/
 1963|       |            /* context structure                                   */
 1964|  1.41M|            i4_nal_header_len = ps_nal_prms->i4_nal_header_len;
 1965|  1.41M|            ps_nal_parse_ctxt->i4_nal_type = ps_nal_prms->i4_derived_nal_type;
 1966|       |
 1967|       |            /* get the accumulated idr pic error flag */
 1968|  1.41M|            ps_nal_parse_ctxt->i4_idr_pic_err_flag |=
 1969|  1.41M|                ((SVCD_TRUE == ps_nal_prms->i4_idr_pic_flag) &&
  ------------------
  |  |   46|  1.41M|#define SVCD_TRUE 1
  ------------------
  |  Branch (1969:18): [True: 373k, False: 1.04M]
  ------------------
 1970|   373k|                 (SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag) &&
  ------------------
  |  |   45|   373k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1970:18): [True: 371k, False: 2.63k]
  ------------------
 1971|   371k|                 (i4_internal_dep_id_prev != ps_nal_parse_ctxt->s_int_attr.i4_dependency_id));
  ------------------
  |  Branch (1971:18): [True: 25.2k, False: 345k]
  ------------------
 1972|       |
 1973|  1.41M|            if(ACCESS_UNIT_DELIMITER_RBSP == ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |  332|  1.41M|#define ACCESS_UNIT_DELIMITER_RBSP      9
  ------------------
  |  Branch (1973:16): [True: 7.69k, False: 1.40M]
  ------------------
 1974|  7.69k|            {
 1975|  7.69k|                i4_pic_bound_status = PIC_BOUNDARY_TRUE;
 1976|  7.69k|                ps_nal_parse_ctxt->u1_pic_boundary_aud_flag = 1;
 1977|       |                /* If picture boundary is detected then come out of  */
 1978|       |                /* the loop                                          */
 1979|  7.69k|                if(PIC_BOUNDARY_TRUE == i4_pic_bound_status)
  ------------------
  |  Branch (1979:20): [True: 7.69k, False: 0]
  ------------------
 1980|  7.69k|                {
 1981|  7.69k|                    isvcd_nal_parse_pic_bound_proc(ps_nal_parse_ctxt, ps_vcl_nal, ps_nal_prms);
 1982|  7.69k|                    break;
 1983|  7.69k|                }
 1984|  7.69k|            }
 1985|       |            /* Perform the picture boundary detetction if all the  */
 1986|       |            /* following conditions are TRUE                       */
 1987|       |            /*  1. VCL NAL                                         */
 1988|       |            /*  2. Not a prefix NAL                                */
 1989|       |            /*  3. Not a discardable NAL                           */
 1990|  1.40M|            if((VCL_NAL == ps_nal_prms->i4_derived_nal_type) &&
  ------------------
  |  Branch (1990:16): [True: 467k, False: 940k]
  ------------------
 1991|   467k|               (PREFIX_UNIT_NAL != ps_nal_prms->i4_nal_unit_type) &&
  ------------------
  |  |   64|   467k|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (1991:16): [True: 465k, False: 1.91k]
  ------------------
 1992|   465k|               (SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag))
  ------------------
  |  |   45|   465k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1992:16): [True: 460k, False: 5.53k]
  ------------------
 1993|   460k|            {
 1994|   460k|                if(ANNEX_B == ps_nal_parse_ctxt->i4_input_bitstream_mode)
  ------------------
  |  |   64|   460k|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
  |  Branch (1994:20): [True: 460k, False: 0]
  ------------------
 1995|   460k|                {
 1996|   460k|                    ps_nal_parse_ctxt->u1_pic_boundary_aud_flag = 0;
 1997|       |
 1998|   460k|                    i4_status = isvcd_detect_pic_boundary_annex_b(ps_nal_prms, pu1_stream_buffer,
 1999|   460k|                                                                  i4_cur_pos, &i4_pic_bound_status,
 2000|   460k|                                                                  ps_nal_parse_ctxt, pu4_num_bytes);
 2001|   460k|                }
 2002|       |
 2003|       |                /* If picture boundary is detected then come out of  */
 2004|       |                /* the loop                                          */
 2005|   460k|                if(PIC_BOUNDARY_TRUE == i4_pic_bound_status)
  ------------------
  |  Branch (2005:20): [True: 154k, False: 305k]
  ------------------
 2006|   154k|                {
 2007|   154k|                    isvcd_nal_parse_pic_bound_proc(ps_nal_parse_ctxt, ps_vcl_nal, ps_nal_prms);
 2008|   154k|                    break;
 2009|   154k|                }
 2010|   460k|            }
 2011|       |
 2012|  1.25M|            if(SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag)
  ------------------
  |  |   45|  1.25M|#define SVCD_FALSE 0
  ------------------
  |  Branch (2012:16): [True: 1.21M, False: 34.3k]
  ------------------
 2013|  1.21M|            {
 2014|       |                /* Set the active NAL buffer structure and initialize */
 2015|       |                /* the nal buffer structure                           */
 2016|  1.21M|                isvcd_get_nal_buf(ps_nal_parse_ctxt, &ps_nal_buf);
 2017|  1.21M|                ps_nal_parse_ctxt->ps_nal_buf = ps_nal_buf;
 2018|  1.21M|            }
 2019|  34.3k|            else
 2020|  34.3k|            {
 2021|  34.3k|                ps_nal_parse_ctxt->ps_nal_buf = NULL;
 2022|  34.3k|            }
 2023|  1.25M|        }
 2024|       |
 2025|       |        /*-------------------------------------------------------------------*/
 2026|       |        /* In RFC based bitstreams, this is a dummy update (in this mode, the*/
 2027|       |        /* bytes consumed updation is done by picture boundary dectection    */
 2028|       |        /* But for Annex B based streams this is valid update                */
 2029|       |        /*-------------------------------------------------------------------*/
 2030|  1.25M|        *pu4_bytes_consumed += u4_bytes_consumed_temp;
 2031|       |
 2032|       |        /*********************************************************************/
 2033|       |        /*          EMULATION PREVENTION AND BYTE SWAPPING                   */
 2034|       |        /*********************************************************************/
 2035|       |
 2036|       |        /* Determine output buffer */
 2037|  1.25M|        ps_nal_buf = ps_nal_parse_ctxt->ps_nal_buf;
 2038|       |
 2039|  1.25M|        if(VCL_NAL == ps_nal_parse_ctxt->i4_nal_type)
  ------------------
  |  Branch (2039:12): [True: 312k, False: 940k]
  ------------------
 2040|   312k|        {
 2041|   312k|            ppu1_out_buf = &ps_nal_parse_ctxt->pu1_vcl_nal_buf;
 2042|   312k|            pu4_bytes_left = &ps_nal_parse_ctxt->u4_bytes_left_vcl;
 2043|   312k|            if(*pu4_bytes_left < (MAX_VCL_NAL_BUFF_SIZE * 0.05))
  ------------------
  |  |   69|   312k|#define MAX_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
  |  Branch (2043:16): [True: 0, False: 312k]
  ------------------
 2044|      0|            {
 2045|      0|                return (VCL_NAL_FOUND_FALSE);
 2046|      0|            }
 2047|   312k|        }
 2048|   940k|        else
 2049|   940k|        {
 2050|   940k|            ppu1_out_buf = &ps_nal_parse_ctxt->pu1_non_vcl_nal_buf;
 2051|   940k|            pu4_bytes_left = &ps_nal_parse_ctxt->u4_bytes_left_non_vcl;
 2052|   940k|            if(*pu4_bytes_left < (MAX_NON_VCL_NAL_BUFF_SIZE * 0.05))
  ------------------
  |  |   70|   940k|#define MAX_NON_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
  |  Branch (2052:16): [True: 179, False: 940k]
  ------------------
 2053|    179|            {
 2054|    179|                return (VCL_NAL_FOUND_FALSE);
 2055|    179|            }
 2056|   940k|        }
 2057|       |
 2058|       |        /* if 0 bytes left then discard the current NAL */
 2059|  1.25M|        if(0 >= (WORD32) *pu4_bytes_left)
  ------------------
  |  Branch (2059:12): [True: 0, False: 1.25M]
  ------------------
 2060|      0|        {
 2061|      0|            ps_nal_parse_ctxt->i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 2062|      0|        }
 2063|       |
 2064|       |        /* Perform the emulation prevention and byte swap */
 2065|  1.25M|        if(SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag)
  ------------------
  |  |   45|  1.25M|#define SVCD_FALSE 0
  ------------------
  |  Branch (2065:12): [True: 1.21M, False: 34.3k]
  ------------------
 2066|  1.21M|        {
 2067|  1.21M|            UWORD32 u4_output_bytes, u4_buf_inc;
 2068|       |
 2069|       |            /* Do emulation prevention and byte swapping on all the packets  */
 2070|       |            /* of RFC or current partial or full Annex B NAL unit            */
 2071|  1.21M|            {
 2072|  1.21M|                UWORD32 u4_buf_size;
 2073|       |
 2074|       |                /* clip the size before emulation prevention */
 2075|  1.21M|                u4_buf_size = (UWORD32) CLIP3(0, (WORD32) *pu4_bytes_left,
  ------------------
  |  |   77|  1.21M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 1.21M]
  |  |  |  Branch (77:54): [True: 0, False: 1.21M]
  |  |  ------------------
  ------------------
 2076|  1.21M|                                              (ps_nal_unit->i4_buf_sizes - i4_nal_header_len));
 2077|       |
 2078|  1.21M|                u4_buf_inc = isvcd_nal_byte_swap_emulation(
 2079|  1.21M|                    (UWORD32 *) *ppu1_out_buf, &u4_output_bytes,
 2080|  1.21M|                    ps_nal_unit->pu1_bufs + i4_nal_header_len, u4_buf_size,
 2081|  1.21M|                    NUM_OF_ZERO_BYTES_BEFORE_START_CODE, &ps_nal_parse_ctxt->s_emulation_ctxt);
  ------------------
  |  |   54|  1.21M|#define NUM_OF_ZERO_BYTES_BEFORE_START_CODE (2)
  ------------------
 2082|       |
 2083|  1.21M|                i4_nal_header_len = 0;
 2084|  1.21M|                u4_buf_inc = UP_ALIGN_8(u4_buf_inc);
  ------------------
  |  |   51|  1.21M|#define UP_ALIGN_8(x) (((((UWORD64) x) + 7) >> 3) << 3)
  ------------------
 2085|  1.21M|                *ppu1_out_buf += u4_buf_inc;
 2086|  1.21M|                *pu4_bytes_left -= u4_buf_inc;
 2087|  1.21M|                ps_nal_buf->i4_buf_size += u4_output_bytes;
 2088|  1.21M|            }
 2089|  1.21M|        }
 2090|       |
 2091|       |        /*********************************************************************/
 2092|       |        /*                UPDATE VARIABLES                                   */
 2093|       |        /*********************************************************************/
 2094|  1.25M|        if(NAL_END == ps_nal_parse_ctxt->i4_find_nal_state)
  ------------------
  |  Branch (2094:12): [True: 1.25M, False: 2.31k]
  ------------------
 2095|  1.25M|        {
 2096|  1.25M|            if(SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag)
  ------------------
  |  |   45|  1.25M|#define SVCD_FALSE 0
  ------------------
  |  Branch (2096:16): [True: 1.21M, False: 33.9k]
  ------------------
 2097|  1.21M|            {
 2098|       |                /* This fucntions updates output nal ctxt - vcl nal structure*/
 2099|       |                /* and non vcl nal structure depending upon the current NAL  */
 2100|       |                /* type.                                                     */
 2101|       |                /* This will only update parameters which are available at   */
 2102|       |                /* end of NAL unit like nal unit's total size                */
 2103|  1.21M|                isvcd_update_nal_ctxt(ps_nal_parse_ctxt, ps_vcl_nal, ps_non_vcl_nal);
 2104|       |
 2105|  1.21M|                UPDATE_NAL_BUF_PTR(ppu1_out_buf, ps_nal_prms->i4_derived_nal_type, pu4_bytes_left);
 2106|  1.21M|            }
 2107|       |
 2108|       |            /* If the prefix NAL unit is not immediatly followed by */
 2109|       |            /* a AVC NAL unit it shall be discarded and hence reset */
 2110|       |            /* is done                                              */
 2111|       |            /* Also if prefix NAL unit is discarded then we should  */
 2112|       |            /* not associate the prefix NAL unit with AVC NAL unit  */
 2113|       |            /* and hence a reset is required                        */
 2114|  1.25M|            if((PREFIX_UNIT_NAL != ps_nal_prms->i4_nal_unit_type) ||
  ------------------
  |  |   64|  1.25M|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (2114:16): [True: 1.24M, False: 2.44k]
  ------------------
 2115|  2.44k|               (SVCD_TRUE == ps_nal_parse_ctxt->i4_discard_nal_flag))
  ------------------
  |  |   46|  2.44k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2115:16): [True: 1.01k, False: 1.43k]
  ------------------
 2116|  1.24M|            {
 2117|  1.24M|                isvcd_nal_buf_reset(&ps_nal_parse_ctxt->s_prefix_nal_buf);
 2118|  1.24M|            }
 2119|       |
 2120|       |            /* Reset the nal level tracking variables */
 2121|  1.25M|            isvcd_nal_reset_ctxt(ps_nal_parse_ctxt);
 2122|  1.25M|        }
 2123|       |
 2124|       |        /*------------- while loop ends here --------------------------------*/
 2125|  1.25M|    } while(SVCD_TRUE == i4_more_data_flag);
  ------------------
  |  |   46|  1.25M|#define SVCD_TRUE 1
  ------------------
  |  Branch (2125:13): [True: 1.25M, False: 2.31k]
  ------------------
 2126|       |
 2127|   166k|    return (i4_pic_bound_status);
 2128|   167k|}
isvcd_nal_parse_non_vcl_nal:
 2164|   112k|{
 2165|       |    /*! - Search for the NAL boundary
 2166|       |        - If NAL boundary is not found and bytes consumed is lesser than
 2167|       |          minimum buffer size then break out of the loop
 2168|       |        - if it is start of NAL then read the NAL header
 2169|       |        - If it is a VCL NAL then return from this fucntion saying that
 2170|       |          VCL NAL found
 2171|       |        - NAL discard logic determines whther the current NAL has to be
 2172|       |          discarded or not
 2173|       |        - If NAL is not discarded then populate the vcl or non vcl output
 2174|       |          structures
 2175|       |    */
 2176|       |
 2177|   112k|    nal_parse_ctxt_t *ps_nal_parse_ctxt;
 2178|   112k|    non_vcl_nal_t *ps_non_vcl_nal;
 2179|   112k|    nal_unit_t *ps_nal_unit;
 2180|   112k|    WORD32 i4_nal_start_flag, i4_cur_pos, i4_status;
 2181|   112k|    WORD32 i4_nal_header_len, i4_more_data_flag;
 2182|   112k|    UWORD32 u4_bytes_consumed_temp = 0;
 2183|   112k|    UWORD8 **ppu1_out_buf;
 2184|   112k|    nal_prms_t *ps_nal_prms;
 2185|       |
 2186|   112k|    ps_nal_parse_ctxt = (nal_parse_ctxt_t *) pv_nal_parse_ctxt;
 2187|   112k|    ps_non_vcl_nal = (non_vcl_nal_t *) pv_out_non_vcl_nal;
 2188|   112k|    ps_nal_unit = (nal_unit_t *) ps_nal_parse_ctxt->pv_nal_unit;
 2189|   112k|    ps_nal_prms = &ps_nal_parse_ctxt->s_nal_prms;
 2190|       |
 2191|       |    /* Initialization */
 2192|   112k|    i4_cur_pos = 0;
 2193|   112k|    *pu4_bytes_consumed = 0;
 2194|   112k|    i4_nal_header_len = 0;
 2195|   112k|    i4_nal_start_flag = SVCD_FALSE;
  ------------------
  |  |   45|   112k|#define SVCD_FALSE 0
  ------------------
 2196|   112k|    i4_more_data_flag = SVCD_TRUE;
  ------------------
  |  |   46|   112k|#define SVCD_TRUE 1
  ------------------
 2197|   112k|    i4_status = PIC_BOUNDARY_FALSE;
 2198|       |
 2199|       |    /* reset the target layer update flag */
 2200|   112k|    ps_nal_parse_ctxt->i4_tgt_lyr_update = SVCD_FALSE;
  ------------------
  |  |   45|   112k|#define SVCD_FALSE 0
  ------------------
 2201|       |    /*************************************************************************/
 2202|       |    /*              SEARCHING FOR THE START OF BITSTREAM                     */
 2203|       |    /*************************************************************************/
 2204|       |
 2205|       |    /*-----------------------------------------------------------------------*/
 2206|       |    /* For Annex B based bitstreams the first start code has to decoded      */
 2207|       |    /* The first start code can come after multiple process call also. This  */
 2208|       |    /* has to be carefully handled                                           */
 2209|       |    /*-----------------------------------------------------------------------*/
 2210|       |
 2211|   112k|    if(ANNEX_B == ps_nal_parse_ctxt->i4_input_bitstream_mode &&
  ------------------
  |  |   64|   112k|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
  |  Branch (2211:8): [True: 112k, False: 0]
  ------------------
 2212|   112k|       SVCD_TRUE == ps_nal_parse_ctxt->i4_dec_frst_sc_flag)
  ------------------
  |  |   46|   112k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2212:8): [True: 21.5k, False: 91.2k]
  ------------------
 2213|  21.5k|    {
 2214|  21.5k|        WORD32 i4_status;
 2215|       |
 2216|  21.5k|        i4_status =
 2217|  21.5k|            isvcd_get_first_start_code(pu1_stream_buffer, pu4_bytes_consumed, pu4_num_bytes);
 2218|       |
 2219|       |        /*-------------------------------------------------------------------*/
 2220|       |        /* If start code found then proceed with bitstream extraction        */
 2221|       |        /*-------------------------------------------------------------------*/
 2222|       |
 2223|  21.5k|        if(i4_status == SC_NOT_FOUND)
  ------------------
  |  |   51|  21.5k|#define SC_NOT_FOUND (-1)
  ------------------
  |  Branch (2223:12): [True: 26, False: 21.5k]
  ------------------
 2224|     26|        {
 2225|     26|            return (VCL_NAL_FOUND_FALSE);
 2226|     26|        }
 2227|       |
 2228|  21.5k|        i4_cur_pos = *pu4_bytes_consumed;
 2229|  21.5k|        ps_nal_parse_ctxt->i4_dec_frst_sc_flag = SVCD_FALSE;
  ------------------
  |  |   45|  21.5k|#define SVCD_FALSE 0
  ------------------
 2230|  21.5k|    }
 2231|       |
 2232|       |    /* If number of bytes left in the previous process call  */
 2233|       |    /* is is greater or equal to number of bytes in input    */
 2234|       |    /* buffer of the current process call then declare that  */
 2235|       |    /* end of bitstream has occurred and consume the bytes   */
 2236|       |    /* but do not decode                                     */
 2237|   112k|    if(ps_nal_parse_ctxt->u4_bytes_left >= (UWORD32) *pu4_num_bytes)
  ------------------
  |  Branch (2237:8): [True: 0, False: 112k]
  ------------------
 2238|      0|    {
 2239|      0|        ps_nal_parse_ctxt->i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 2240|      0|        *pu4_bytes_consumed = *pu4_num_bytes;
 2241|       |
 2242|      0|        i4_status = isvcd_nal_parse_partial_signal_eos(ps_nal_parse_ctxt, NULL, ps_non_vcl_nal);
 2243|      0|        return (i4_status);
 2244|      0|    }
 2245|       |
 2246|   112k|    do
 2247|  1.41M|    {
 2248|  1.41M|        nal_buf_t *ps_nal_buf;
 2249|  1.41M|        UWORD32 *pu4_bytes_left;
 2250|       |
 2251|       |        /*********************************************************************/
 2252|       |        /*                  NAL BOUNDARY DETECTION                           */
 2253|       |        /*********************************************************************/
 2254|       |        /*-------------------------------------------------------------------*/
 2255|       |        /* Detect NAL boundary                                               */
 2256|       |        /* After return,  this NAL boundary detetction logic might be in     */
 2257|       |        /* one of following states:                                          */
 2258|       |        /*  - NAL_START                                                      */
 2259|       |        /*  - FIND_NAL_END                                                   */
 2260|       |        /*  - NAL_END                                                        */
 2261|       |        /*-------------------------------------------------------------------*/
 2262|  1.41M|        if(ANNEX_B == ps_nal_parse_ctxt->i4_input_bitstream_mode)
  ------------------
  |  |   64|  1.41M|#define ANNEX_B 0     /*!< Annex B stream*/
  ------------------
  |  Branch (2262:12): [True: 1.41M, False: 0]
  ------------------
 2263|  1.41M|        {
 2264|  1.41M|            i4_nal_start_flag = isvcd_get_annex_b_nal_unit(
 2265|  1.41M|                pu1_stream_buffer, i4_cur_pos, *pu4_num_bytes,
 2266|  1.41M|                &ps_nal_parse_ctxt->i4_find_nal_state, &ps_nal_parse_ctxt->i4_zero_byte_cnt,
 2267|  1.41M|                &u4_bytes_consumed_temp, ps_nal_parse_ctxt->pv_nal_unit, &i4_more_data_flag);
 2268|       |
 2269|  1.41M|            i4_cur_pos += u4_bytes_consumed_temp;
 2270|  1.41M|        }
 2271|       |
 2272|       |        /* If current NAL unit is start of new NAL unit then parse the NAL
 2273|       |            header. If the current NAL unit type is VCL NAL then return from
 2274|       |            this function. otherwise apply NAL discard logic and discard the
 2275|       |            NAL if discard NAL flag is true                                  */
 2276|       |
 2277|  1.41M|        if(SVCD_TRUE == i4_nal_start_flag)
  ------------------
  |  |   46|  1.41M|#define SVCD_TRUE 1
  ------------------
  |  Branch (2277:12): [True: 1.41M, False: 341]
  ------------------
 2278|  1.41M|        {
 2279|  1.41M|            UWORD32 u4_err_code;
 2280|  1.41M|            WORD32 i4_sps_pps_corrupt_status;
 2281|       |
 2282|       |            /* Get the NAL prms. This involves the following things*/
 2283|       |            /* 1. Decode the NAL header                            */
 2284|       |            /* 2. Set the discard flag                             */
 2285|       |            /* 3. Decode the slice header if needed                */
 2286|  1.41M|            isvcd_get_nal_prms(ps_nal_unit->pu1_bufs, ps_nal_unit->i4_buf_sizes, ps_nal_prms,
 2287|  1.41M|                               &ps_nal_parse_ctxt->s_prefix_nal_prms,
 2288|  1.41M|                               &ps_nal_parse_ctxt->s_prefix_nal_buf, &u4_err_code,
 2289|  1.41M|                               &i4_sps_pps_corrupt_status, &ps_nal_parse_ctxt->i4_discard_nal_flag,
 2290|  1.41M|                               ps_nal_parse_ctxt);
 2291|       |            /* If the error code returned by the "picture boundary" */
 2292|       |            /* detetction is                                        */
 2293|       |            /* 1. Insufficient bitstream size: then store the bytes */
 2294|       |            /*    left and break out of the loop                    */
 2295|       |            /* 2. Corrupted slice: then discard the slice           */
 2296|  1.41M|            if((NAL_INSUFFICIENT_DATA == (WORD32) u4_err_code) &&
  ------------------
  |  Branch (2296:16): [True: 6.96k, False: 1.41M]
  ------------------
 2297|  6.96k|               (NAL_END != ps_nal_parse_ctxt->i4_find_nal_state))
  ------------------
  |  Branch (2297:16): [True: 5.24k, False: 1.72k]
  ------------------
 2298|  5.24k|            {
 2299|  5.24k|                ps_nal_parse_ctxt->u4_bytes_left = *pu4_num_bytes - *pu4_bytes_consumed;
 2300|       |
 2301|       |                /* Reset the NAL level tracking variables */
 2302|  5.24k|                isvcd_nal_reset_ctxt(ps_nal_parse_ctxt);
 2303|  5.24k|                break;
 2304|  5.24k|            }
 2305|  1.41M|            else if(0 != u4_err_code)
  ------------------
  |  Branch (2305:21): [True: 17.0k, False: 1.39M]
  ------------------
 2306|  17.0k|            {
 2307|  17.0k|                ps_nal_parse_ctxt->i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|  17.0k|#define SVCD_TRUE 1
  ------------------
 2308|  17.0k|            }
 2309|       |
 2310|       |            /* Populate other paramters based on the nal prms */
 2311|  1.41M|            ps_nal_parse_ctxt->i4_nal_type = ps_nal_prms->i4_derived_nal_type;
 2312|  1.41M|            i4_nal_header_len = ps_nal_prms->i4_nal_header_len;
 2313|       |
 2314|       |            /* If derived NAL unit is VCL_NAL then return from this function */
 2315|  1.41M|            if(VCL_NAL == ps_nal_prms->i4_derived_nal_type &&
  ------------------
  |  Branch (2315:16): [True: 104k, False: 1.30M]
  ------------------
 2316|   104k|               PREFIX_UNIT_NAL != ps_nal_prms->i4_nal_unit_type)
  ------------------
  |  |   64|   104k|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (2316:16): [True: 103k, False: 1.13k]
  ------------------
 2317|   103k|            {
 2318|   103k|                isvcd_pic_reset_ctxt(ps_nal_parse_ctxt);
 2319|       |
 2320|   103k|                return (VCL_NAL_FOUND_TRUE);
 2321|   103k|            }
 2322|       |
 2323|       |            /* Set the active NAL buffer structure and initialize */
 2324|       |            /* the nal buffer structure                           */
 2325|  1.30M|            isvcd_get_nal_buf(ps_nal_parse_ctxt, &ps_nal_buf);
 2326|       |
 2327|  1.30M|            ps_nal_parse_ctxt->ps_nal_buf = ps_nal_buf;
 2328|  1.30M|        }
 2329|       |
 2330|       |        /* Update the bytes consumed variable */
 2331|       |
 2332|  1.31M|        *pu4_bytes_consumed += u4_bytes_consumed_temp;
 2333|       |
 2334|  1.31M|        ps_nal_buf = ps_nal_parse_ctxt->ps_nal_buf;
 2335|  1.31M|        if(VCL_NAL == ps_nal_parse_ctxt->i4_nal_type)
  ------------------
  |  Branch (2335:12): [True: 1.13k, False: 1.30M]
  ------------------
 2336|  1.13k|        {
 2337|  1.13k|            ppu1_out_buf = &ps_nal_parse_ctxt->pu1_vcl_nal_buf;
 2338|  1.13k|            pu4_bytes_left = &ps_nal_parse_ctxt->u4_bytes_left_vcl;
 2339|  1.13k|            if(*pu4_bytes_left < (MAX_VCL_NAL_BUFF_SIZE * 0.05))
  ------------------
  |  |   69|  1.13k|#define MAX_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
  |  Branch (2339:16): [True: 0, False: 1.13k]
  ------------------
 2340|      0|            {
 2341|      0|                return (VCL_NAL_FOUND_FALSE);
 2342|      0|            }
 2343|  1.13k|        }
 2344|  1.30M|        else
 2345|  1.30M|        {
 2346|  1.30M|            ppu1_out_buf = &ps_nal_parse_ctxt->pu1_non_vcl_nal_buf;
 2347|  1.30M|            pu4_bytes_left = &ps_nal_parse_ctxt->u4_bytes_left_non_vcl;
 2348|  1.30M|            if(*pu4_bytes_left < (MAX_NON_VCL_NAL_BUFF_SIZE * 0.05))
  ------------------
  |  |   70|  1.30M|#define MAX_NON_VCL_NAL_BUFF_SIZE (1024 * 1024 * 2)
  ------------------
  |  Branch (2348:16): [True: 350, False: 1.30M]
  ------------------
 2349|    350|            {
 2350|    350|                return (VCL_NAL_FOUND_FALSE);
 2351|    350|            }
 2352|  1.30M|        }
 2353|       |
 2354|       |        /* if 0 bytes left then discard the current NAL */
 2355|  1.30M|        if(0 >= (WORD32) *pu4_bytes_left)
  ------------------
  |  Branch (2355:12): [True: 0, False: 1.30M]
  ------------------
 2356|      0|        {
 2357|      0|            ps_nal_parse_ctxt->i4_discard_nal_flag = SVCD_TRUE;
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 2358|      0|        }
 2359|       |
 2360|       |        /* If NAL is not discarded then :
 2361|       |            1) Perform emulation prevention and byte swapping on the RBSP data
 2362|       |            2) Update the NAL unit ctxt:
 2363|       |                a) If VCL NAL then update DQID list
 2364|       |                b) If NON VCL NAL then update the non vcl output structure   */
 2365|       |
 2366|  1.30M|        if(SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag)
  ------------------
  |  |   45|  1.30M|#define SVCD_FALSE 0
  ------------------
  |  Branch (2366:12): [True: 1.28M, False: 20.6k]
  ------------------
 2367|  1.28M|        {
 2368|  1.28M|            UWORD32 u4_output_bytes, u4_buf_inc;
 2369|       |
 2370|  1.28M|            {
 2371|  1.28M|                UWORD32 u4_buf_size;
 2372|       |
 2373|       |                /* clip the size before emulation prevention */
 2374|  1.28M|                u4_buf_size = (UWORD32) CLIP3(0, (WORD32) *pu4_bytes_left,
  ------------------
  |  |   77|  1.28M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 0, False: 1.28M]
  |  |  |  Branch (77:54): [True: 0, False: 1.28M]
  |  |  ------------------
  ------------------
 2375|  1.28M|                                              (ps_nal_unit->i4_buf_sizes - i4_nal_header_len));
 2376|       |
 2377|  1.28M|                u4_buf_inc = isvcd_nal_byte_swap_emulation(
 2378|  1.28M|                    (UWORD32 *) *ppu1_out_buf, &u4_output_bytes,
 2379|  1.28M|                    ps_nal_unit->pu1_bufs + i4_nal_header_len, u4_buf_size,
 2380|  1.28M|                    NUM_OF_ZERO_BYTES_BEFORE_START_CODE, &ps_nal_parse_ctxt->s_emulation_ctxt);
  ------------------
  |  |   54|  1.28M|#define NUM_OF_ZERO_BYTES_BEFORE_START_CODE (2)
  ------------------
 2381|  1.28M|                i4_nal_header_len = 0;
 2382|       |
 2383|  1.28M|                u4_buf_inc = UP_ALIGN_8(u4_buf_inc);
  ------------------
  |  |   51|  1.28M|#define UP_ALIGN_8(x) (((((UWORD64) x) + 7) >> 3) << 3)
  ------------------
 2384|  1.28M|                *ppu1_out_buf += u4_buf_inc;
 2385|  1.28M|                *pu4_bytes_left -= u4_buf_inc;
 2386|  1.28M|                ps_nal_buf->i4_buf_size += u4_output_bytes;
 2387|  1.28M|            }
 2388|  1.28M|        }
 2389|       |
 2390|       |        /*********************************************************************/
 2391|       |        /*                UPDATE VARIABLES                                   */
 2392|       |        /*********************************************************************/
 2393|       |
 2394|  1.30M|        if(NAL_END == ps_nal_parse_ctxt->i4_find_nal_state)
  ------------------
  |  Branch (2394:12): [True: 1.30M, False: 3.38k]
  ------------------
 2395|  1.30M|        {
 2396|       |            /*---------------------------------------------------------------*/
 2397|       |            /* - Update the total bits in the NAL. While doing so bits       */
 2398|       |            /* calculated so far should be converted to SODB length          */
 2399|       |            /*---------------------------------------------------------------*/
 2400|  1.30M|            if(SVCD_FALSE == ps_nal_parse_ctxt->i4_discard_nal_flag)
  ------------------
  |  |   45|  1.30M|#define SVCD_FALSE 0
  ------------------
  |  Branch (2400:16): [True: 1.28M, False: 20.0k]
  ------------------
 2401|  1.28M|            {
 2402|  1.28M|                isvcd_update_nal_ctxt(ps_nal_parse_ctxt, NULL, ps_non_vcl_nal);
 2403|       |
 2404|  1.28M|                UPDATE_NAL_BUF_PTR(ppu1_out_buf, ps_nal_prms->i4_derived_nal_type, pu4_bytes_left);
 2405|  1.28M|            }
 2406|       |
 2407|       |            /* If the prefix NAL unit is not immediatly followed by */
 2408|       |            /* a AVC NAL unit it shall be discarded and hence reset */
 2409|       |            /* is done                                              */
 2410|       |            /* Also if prefix NAL unit is discarded then we should  */
 2411|       |            /* not associate the prefix NAL unit with AVC NAL unit  */
 2412|       |            /* and hence a reset is required                        */
 2413|  1.30M|            if((PREFIX_UNIT_NAL != ps_nal_prms->i4_nal_unit_type) ||
  ------------------
  |  |   64|  1.30M|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (2413:16): [True: 1.30M, False: 1.95k]
  ------------------
 2414|  1.95k|               (SVCD_TRUE == ps_nal_parse_ctxt->i4_discard_nal_flag))
  ------------------
  |  |   46|  1.95k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2414:16): [True: 849, False: 1.10k]
  ------------------
 2415|  1.30M|            {
 2416|  1.30M|                isvcd_nal_buf_reset(&ps_nal_parse_ctxt->s_prefix_nal_buf);
 2417|  1.30M|            }
 2418|       |
 2419|       |            /* Reset NAL level tracking variables */
 2420|  1.30M|            isvcd_nal_reset_ctxt(ps_nal_parse_ctxt);
 2421|  1.30M|        }
 2422|       |
 2423|  1.30M|        i4_nal_header_len = 0;
 2424|       |        /*------------- while loop ends here --------------------------------*/
 2425|  1.30M|    } while(SVCD_TRUE == i4_more_data_flag);
  ------------------
  |  |   46|  1.30M|#define SVCD_TRUE 1
  ------------------
  |  Branch (2425:13): [True: 1.30M, False: 3.38k]
  ------------------
 2426|       |
 2427|  8.62k|    if(i4_more_data_flag == 0)
  ------------------
  |  Branch (2427:8): [True: 8.62k, False: 0]
  ------------------
 2428|  8.62k|    {
 2429|  8.62k|        isvcd_pic_reset_ctxt(ps_nal_parse_ctxt);
 2430|  8.62k|        return (VCL_NAL_FOUND_TRUE);
 2431|  8.62k|    }
 2432|       |
 2433|      0|    return (VCL_NAL_FOUND_FALSE);
 2434|  8.62k|}

isvcd_nal_parse.c:UPDATE_NAL_BUF_PTR:
   86|  3.09M|{
   87|  3.09M|    UWORD8 *pu1_buf_ptr;
   88|  3.09M|    UWORD64 u4_inc;
   89|       |
   90|       |    /* Align the start of the structure */
   91|       |
   92|  3.09M|    pu1_buf_ptr = *ppu1_buf;
   93|       |
   94|       |    /* Account for the vcl or non-vcl header */
   95|  3.09M|    u4_inc = GET_NAL_BUF_INC(i4_derived_nal_type);
   96|  3.09M|    u4_inc = UP_ALIGN_8(u4_inc);
  ------------------
  |  |   51|  3.09M|#define UP_ALIGN_8(x) (((((UWORD64) x) + 7) >> 3) << 3)
  ------------------
   97|  3.09M|    pu1_buf_ptr += u4_inc;
   98|       |
   99|       |    /* Update the pointers */
  100|  3.09M|    if(*pu4_bytes_left >= u4_inc)
  ------------------
  |  Branch (100:8): [True: 3.09M, False: 0]
  ------------------
  101|  3.09M|    {
  102|  3.09M|        *pu4_bytes_left -= u4_inc;
  103|  3.09M|    }
  104|  3.09M|    *ppu1_buf = pu1_buf_ptr;
  105|  3.09M|}
isvcd_nal_parse.c:GET_NAL_BUF_INC:
   68|  8.09M|{
   69|  8.09M|    UWORD32 u4_buf_inc;
   70|       |
   71|  8.09M|    if(VCL_NAL == i4_derived_nal_type)
  ------------------
  |  Branch (71:8): [True: 1.21M, False: 6.88M]
  ------------------
   72|  1.21M|    {
   73|  1.21M|        u4_buf_inc = sizeof(vcl_buf_hdr_t);
   74|  1.21M|    }
   75|  6.88M|    else
   76|  6.88M|    {
   77|  6.88M|        u4_buf_inc = sizeof(non_vcl_buf_hdr_t);
   78|  6.88M|    }
   79|       |
   80|  8.09M|    u4_buf_inc = UP_ALIGN_8(u4_buf_inc);
  ------------------
  |  |   51|  8.09M|#define UP_ALIGN_8(x) (((((UWORD64) x) + 7) >> 3) << 3)
  ------------------
   81|  8.09M|    return (u4_buf_inc);
   82|  8.09M|}

isvcd_parse_bmb_ref_index_cavlc_range1:
   90|  6.81k|{
   91|  6.81k|    UWORD32 u4_i;
   92|  6.81k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   93|  6.81k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
   94|  6.81k|    UNUSED(u4_num_ref_idx_active_minus1);
  ------------------
  |  |   45|  6.81k|#define UNUSED(x) ((void)(x))
  ------------------
   95|  15.5k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (95:19): [True: 8.76k, False: 6.81k]
  ------------------
   96|  8.76k|    {
   97|  8.76k|        if(pi1_ref_idx[u4_i] > -1 && (((*pu1_motion_prediction_flag >> u4_i) & 0x01) == 0))
  ------------------
  |  Branch (97:12): [True: 3.84k, False: 4.92k]
  |  Branch (97:38): [True: 1.30k, False: 2.53k]
  ------------------
   98|  1.30k|        {
   99|  1.30k|            UWORD32 u4_ref_idx;
  100|  1.30k|            u4_ref_idx = ih264d_tev_range1(pu4_bitstream_off, pu4_bitstrm_buf);
  101|       |
  102|       |            /* Storing Reference Idx Information */
  103|  1.30k|            pi1_ref_idx[u4_i] = (WORD8) u4_ref_idx;
  104|  1.30k|        }
  105|  8.76k|    }
  106|  6.81k|}
isvcd_parse_bmb_ref_index_cavlc:
  138|  14.6k|{
  139|  14.6k|    UWORD32 u4_i;
  140|  14.6k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  141|  14.6k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
  142|       |
  143|  38.3k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (143:19): [True: 26.0k, False: 12.3k]
  ------------------
  144|  26.0k|    {
  145|  26.0k|        if(pi1_ref_idx[u4_i] > -1 && (((*pu1_motion_prediction_flag >> u4_i) & 0x01) == 0))
  ------------------
  |  Branch (145:12): [True: 12.7k, False: 13.2k]
  |  Branch (145:38): [True: 8.04k, False: 4.68k]
  ------------------
  146|  8.04k|        {
  147|  8.04k|            UWORD32 u4_ref_idx;
  148|       |            // inlining ih264d_uev
  149|  8.04k|            UWORD32 u4_bitstream_offset = *pu4_bitstream_off;
  150|  8.04k|            UWORD32 u4_word, u4_ldz;
  151|       |
  152|       |            /***************************************************************/
  153|       |            /* Find leading zeros in next 32 bits                          */
  154|       |            /***************************************************************/
  155|  8.04k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  8.04k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  8.04k|{                                                                           \
  |  |  152|  8.04k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  8.04k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  8.04k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  8.04k|                                                                            \
  |  |  156|  8.04k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  8.04k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 7.57k, False: 467]
  |  |  ------------------
  |  |  158|  8.04k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  7.57k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  8.04k|}
  ------------------
  156|  8.04k|            u4_ldz = CLZ(u4_word);
  157|       |            /* Flush the ps_bitstrm */
  158|  8.04k|            u4_bitstream_offset += (u4_ldz + 1);
  159|       |            /* Read the suffix from the ps_bitstrm */
  160|  8.04k|            u4_word = 0;
  161|  8.04k|            if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  6.31k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  6.31k|{                                                                           \
  |  |  122|  6.31k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  6.31k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  6.31k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  6.31k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  6.31k|                                                                            \
  |  |  127|  6.31k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 5.82k, False: 495]
  |  |  ------------------
  |  |  128|  6.31k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  5.82k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  6.31k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  6.31k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  6.31k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  6.31k|}                                                                           \
  ------------------
  |  Branch (161:16): [True: 6.31k, False: 1.72k]
  ------------------
  162|  8.04k|            *pu4_bitstream_off = u4_bitstream_offset;
  163|  8.04k|            u4_ref_idx = ((1 << u4_ldz) + u4_word - 1);
  164|       |            // inlining ih264d_uev
  165|  8.04k|            if(u4_ref_idx > u4_num_ref_idx_active_minus1) return ERROR_REF_IDX;
  ------------------
  |  Branch (165:16): [True: 2.30k, False: 5.74k]
  ------------------
  166|       |
  167|       |            /* Storing Reference Idx Information */
  168|  5.74k|            pi1_ref_idx[u4_i] = (WORD8) u4_ref_idx;
  169|  5.74k|        }
  170|  26.0k|    }
  171|  12.3k|    return OK;
  ------------------
  |  |  114|  12.3k|#define OK        0
  ------------------
  172|  14.6k|}
isvcd_parse_pmb_ref_index_cavlc:
  205|  9.30k|{
  206|  9.30k|    UWORD32 u4_i;
  207|  9.30k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  208|  9.30k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
  209|       |
  210|  24.6k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (210:19): [True: 15.4k, False: 9.19k]
  ------------------
  211|  15.4k|    {
  212|  15.4k|        if(((*pu1_motion_prediction_flag >> u4_i) & 0x01) == 0)
  ------------------
  |  Branch (212:12): [True: 9.50k, False: 5.90k]
  ------------------
  213|  9.50k|        {
  214|  9.50k|            UWORD32 u4_ref_idx;
  215|       |            // Inlined ih264d_uev
  216|  9.50k|            UWORD32 u4_bitstream_offset = *pu4_bitstream_off;
  217|  9.50k|            UWORD32 u4_word, u4_ldz;
  218|       |
  219|       |            /***************************************************************/
  220|       |            /* Find leading zeros in next 32 bits                          */
  221|       |            /***************************************************************/
  222|  9.50k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  9.50k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  9.50k|{                                                                           \
  |  |  152|  9.50k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  9.50k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  9.50k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  9.50k|                                                                            \
  |  |  156|  9.50k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  9.50k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 9.22k, False: 285]
  |  |  ------------------
  |  |  158|  9.50k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  9.22k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  9.50k|}
  ------------------
  223|  9.50k|            u4_ldz = CLZ(u4_word);
  224|       |            /* Flush the ps_bitstrm */
  225|  9.50k|            u4_bitstream_offset += (u4_ldz + 1);
  226|       |            /* Read the suffix from the ps_bitstrm */
  227|  9.50k|            u4_word = 0;
  228|  9.50k|            if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  3.04k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  3.04k|{                                                                           \
  |  |  122|  3.04k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  3.04k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  3.04k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  3.04k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  3.04k|                                                                            \
  |  |  127|  3.04k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.80k, False: 234]
  |  |  ------------------
  |  |  128|  3.04k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.80k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  3.04k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  3.04k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  3.04k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  3.04k|}                                                                           \
  ------------------
  |  Branch (228:16): [True: 3.04k, False: 6.46k]
  ------------------
  229|  9.50k|            *pu4_bitstream_off = u4_bitstream_offset;
  230|  9.50k|            u4_ref_idx = ((1 << u4_ldz) + u4_word - 1);
  231|       |
  232|       |            // Inlined ih264d_uev
  233|  9.50k|            if(u4_ref_idx > u4_num_ref_idx_active_minus1) return ERROR_REF_IDX;
  ------------------
  |  Branch (233:16): [True: 115, False: 9.39k]
  ------------------
  234|       |
  235|       |            /* Storing Reference Idx Information */
  236|  9.39k|            pi1_ref_idx[u4_i] = (WORD8) u4_ref_idx;
  237|  9.39k|        }
  238|  15.4k|    }
  239|  9.19k|    return OK;
  ------------------
  |  |  114|  9.19k|#define OK        0
  ------------------
  240|  9.30k|}
isvcd_parse_pmb_ref_index_cavlc_range1:
  272|  3.79k|{
  273|  3.79k|    UWORD32 u4_i;
  274|  3.79k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  275|  3.79k|    UWORD32 *pu4_bitstream_off = &ps_bitstrm->u4_ofst;
  276|  3.79k|    UNUSED(u4_num_ref_idx_active_minus1);
  ------------------
  |  |   45|  3.79k|#define UNUSED(x) ((void)(x))
  ------------------
  277|  11.0k|    for(u4_i = 0; u4_i < u4_num_part; u4_i++)
  ------------------
  |  Branch (277:19): [True: 7.26k, False: 3.79k]
  ------------------
  278|  7.26k|    {
  279|  7.26k|        if(((*pu1_motion_prediction_flag >> u4_i) & 0x01) == 0)
  ------------------
  |  Branch (279:12): [True: 1.75k, False: 5.50k]
  ------------------
  280|  1.75k|        {
  281|  1.75k|            UWORD32 u4_ref_idx;
  282|  1.75k|            u4_ref_idx = ih264d_tev_range1(pu4_bitstream_off, pu4_bitstrm_buf);
  283|       |
  284|       |            /* Storing Reference Idx Information */
  285|  1.75k|            pi1_ref_idx[u4_i] = (WORD8) u4_ref_idx;
  286|  1.75k|        }
  287|  7.26k|    }
  288|  3.79k|}

isvcd_parse_bmb_cabac:
  102|  14.3k|{
  103|  14.3k|    UWORD8 u1_cbp = 0;
  104|  14.3k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  105|  14.3k|    deblk_mb_t *ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u4_mb_num;
  106|  14.3k|    const UWORD8 *puc_mb_mc_mode = (const UWORD8 *) gau1_ih264d_mb_mc_mode;
  107|  14.3k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  108|  14.3k|    ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
  109|  14.3k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
  110|  14.3k|    decoding_envirnoment_t *ps_cab_env = &ps_dec->s_cab_dec_env;
  111|  14.3k|    WORD32 ret;
  112|  14.3k|    UWORD8 u1_Bdirect_tranform_read = 1;
  113|  14.3k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
  114|       |
  115|  14.3k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
  116|  14.3k|    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 1;
  117|  14.3k|    ps_cur_mb_info->u1_mb_mc_mode = puc_mb_mc_mode[5 + u1_mb_type];
  118|  14.3k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  119|  14.3k|    ps_cur_deblk_mb->u1_mb_type |= D_B_SLICE;
  ------------------
  |  |  384|  14.3k|#define D_B_SLICE         4
  ------------------
  120|       |
  121|  14.3k|    if(u1_mb_type != B_DIRECT)
  ------------------
  |  |  482|  14.3k|#define B_DIRECT  0
  ------------------
  |  Branch (121:8): [True: 13.2k, False: 1.07k]
  ------------------
  122|  13.2k|    {
  123|  13.2k|        ret = isvcd_parse_bmb_non_direct_cabac(ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info,
  124|  13.2k|                                               u4_mb_num, u4_num_mbsNby2);
  125|  13.2k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  13.2k|#define OK        0
  ------------------
  |  Branch (125:12): [True: 204, False: 13.0k]
  ------------------
  126|  13.2k|    }
  127|  1.07k|    else
  128|  1.07k|    {
  129|       |        /************ STORING PARTITION INFO ***********/
  130|  1.07k|        parse_part_params_t *ps_part_info;
  131|  1.07k|        ps_part_info = ps_dec->ps_part;
  132|  1.07k|        ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  571|  1.07k|#define PART_DIRECT_16x16              2
  ------------------
  133|  1.07k|        ps_part_info->u1_sub_mb_num = 0;
  134|  1.07k|        ps_dec->ps_part++;
  135|  1.07k|        p_curr_ctxt->u1_mb_type = CAB_BD16x16;
  ------------------
  |  |  396|  1.07k|#define CAB_BD16x16       0x04 /* 0000 0100 */
  ------------------
  136|       |
  137|  1.07k|        MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
  ------------------
  |  |  652|  1.07k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  1.07k|{                                                               \
  |  |  654|  1.07k|    memset(pu4_start,value,16);                                 \
  |  |  655|  1.07k|}
  ------------------
  138|  1.07k|        memset(ps_dec->pi1_left_ref_idx_ctxt_inc, 0, 4);
  139|  1.07k|        MEMSET_16BYTES(p_curr_ctxt->u1_mv, 0);
  ------------------
  |  |  652|  1.07k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  1.07k|{                                                               \
  |  |  654|  1.07k|    memset(pu4_start,value,16);                                 \
  |  |  655|  1.07k|}
  ------------------
  140|  1.07k|        memset(p_curr_ctxt->i1_ref_idx, 0, 4);
  141|       |
  142|       |        /* check whether transform8x8 u4_flag to be read or not */
  143|  1.07k|        u1_Bdirect_tranform_read = ps_dec->s_high_profile.u1_direct_8x8_inference_flag;
  144|  1.07k|    }
  145|       |
  146|  14.1k|    if(ps_svc_slice_params->u1_adaptive_residual_prediction_flag &&
  ------------------
  |  Branch (146:8): [True: 3.47k, False: 10.6k]
  ------------------
  147|  3.47k|       ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (147:8): [True: 3.24k, False: 225]
  ------------------
  148|  3.24k|    {
  149|  3.24k|        ps_svc_cur_mb_info->u1_residual_prediction_flag = ih264d_decode_bin(
  150|  3.24k|            1, ps_svc_lyr_dec->ps_residual_prediction_flag, ps_bitstrm, ps_cab_env);
  151|  3.24k|        COPYTHECONTEXT("SVC ext: u1_residual_prediction_flag",
  152|  3.24k|                       ps_svc_cur_mb_info->u1_residual_prediction_flag);
  153|  3.24k|    }
  154|  10.8k|    else
  155|  10.8k|    {
  156|       |        /*residual flag inference code */
  157|  10.8k|        if(1 == ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (157:12): [True: 10.6k, False: 225]
  ------------------
  158|  10.6k|           1 == ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (158:12): [True: 0, False: 10.6k]
  ------------------
  159|      0|        {
  160|      0|            ps_svc_cur_mb_info->u1_residual_prediction_flag =
  161|      0|                ps_svc_slice_params->u1_default_residual_prediction_flag;
  162|      0|        }
  163|  10.8k|        else
  164|  10.8k|        {
  165|  10.8k|            ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
  166|  10.8k|        }
  167|  10.8k|    }
  168|       |
  169|  14.1k|    if(ps_svc_slice_params->u1_scan_idx_end >= ps_svc_slice_params->u1_scan_idx_start)
  ------------------
  |  Branch (169:8): [True: 14.1k, False: 0]
  ------------------
  170|  14.1k|    {
  171|       |        /* Read the Coded block pattern */
  172|  14.1k|        u1_cbp = (WORD8) ih264d_parse_ctx_cbp_cabac(ps_dec);
  173|  14.1k|        p_curr_ctxt->u1_cbp = u1_cbp;
  174|  14.1k|        ps_cur_mb_info->u1_cbp = u1_cbp;
  175|       |
  176|  14.1k|        if(u1_cbp > 47) return ERROR_CBP;
  ------------------
  |  Branch (176:12): [True: 0, False: 14.1k]
  ------------------
  177|  14.1k|        COPYTHECONTEXT("coded_block_pattern", u1_cbp);
  178|       |
  179|  14.1k|        ps_cur_mb_info->u1_tran_form8x8 = 0;
  180|  14.1k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  181|       |
  182|  14.1k|        if((ps_dec->s_high_profile.u1_transform8x8_present) && (u1_cbp & (0xf)) &&
  ------------------
  |  Branch (182:12): [True: 3.50k, False: 10.6k]
  |  Branch (182:64): [True: 2.62k, False: 886]
  ------------------
  183|  2.62k|           (ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag) && (u1_Bdirect_tranform_read))
  ------------------
  |  Branch (183:12): [True: 2.18k, False: 437]
  |  Branch (183:73): [True: 1.51k, False: 675]
  ------------------
  184|  1.51k|        {
  185|  1.51k|            ps_cur_mb_info->u1_tran_form8x8 =
  186|  1.51k|                ih264d_parse_transform8x8flag_cabac(ps_dec, ps_cur_mb_info);
  187|  1.51k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  188|       |
  189|  1.51k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  190|  1.51k|            p_curr_ctxt->u1_transform8x8_ctxt = ps_cur_mb_info->u1_tran_form8x8;
  191|  1.51k|        }
  192|  12.6k|        else
  193|  12.6k|        {
  194|  12.6k|            p_curr_ctxt->u1_transform8x8_ctxt = 0;
  195|  12.6k|        }
  196|  14.1k|    }
  197|       |
  198|  14.1k|    p_curr_ctxt->u1_intra_chroma_pred_mode = 0;
  199|  14.1k|    p_curr_ctxt->u1_yuv_dc_csbp &= 0xFE;
  200|  14.1k|    ps_dec->pu1_left_yuv_dc_csbp[0] &= 0x6;
  201|       |
  202|       |    /* Read mb_qp_delta */
  203|  14.1k|    if(u1_cbp)
  ------------------
  |  Branch (203:8): [True: 4.52k, False: 9.61k]
  ------------------
  204|  4.52k|    {
  205|  4.52k|        WORD8 c_temp;
  206|  4.52k|        ret = ih264d_parse_mb_qp_delta_cabac(ps_dec, &c_temp);
  207|  4.52k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  4.52k|#define OK        0
  ------------------
  |  Branch (207:12): [True: 116, False: 4.41k]
  ------------------
  208|  4.41k|        COPYTHECONTEXT("mb_qp_delta", c_temp);
  209|  4.41k|        if(c_temp)
  ------------------
  |  Branch (209:12): [True: 1.46k, False: 2.94k]
  ------------------
  210|  1.46k|        {
  211|  1.46k|            ret = ih264d_update_qp(ps_dec, c_temp);
  212|  1.46k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  1.46k|#define OK        0
  ------------------
  |  Branch (212:16): [True: 0, False: 1.46k]
  ------------------
  213|  1.46k|        }
  214|  4.41k|    }
  215|  9.61k|    else
  216|  9.61k|        ps_dec->i1_prev_mb_qp_delta = 0;
  217|       |
  218|       |    /*RESIDUAL FOR Start to end idx*/
  219|  14.0k|    ih264d_parse_residual4x4_cabac(ps_dec, ps_cur_mb_info, 0);
  220|  14.0k|    if(EXCEED_OFFSET(ps_dec->ps_bitstrm)) return ERROR_EOB_TERMINATE_T;
  ------------------
  |  |   93|  14.0k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 629, False: 13.4k]
  |  |  ------------------
  ------------------
  221|  13.4k|    return OK;
  ------------------
  |  |  114|  13.4k|#define OK        0
  ------------------
  222|  14.0k|}
isvcd_mv_pred_ref_tfr_nby2_ebmb:
  235|  42.6k|{
  236|  42.6k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) ps_dec;
  237|  42.6k|    parse_pmbarams_t *ps_mb_part_info;
  238|  42.6k|    parse_part_params_t *ps_part;
  239|  42.6k|    mv_pred_t *ps_mv_nmb, *ps_mv_nmb_start, *ps_mv_ntop, *ps_mv_ntop_start;
  240|  42.6k|    pic_buffer_t *ps_ref_frame;
  241|  42.6k|    UWORD8 u1_direct_mode_width;
  242|  42.6k|    UWORD8 i, j;
  243|  42.6k|    dec_mb_info_t *ps_cur_mb_info;
  244|  42.6k|    dec_svc_mb_info_t *ps_svc_cur_mb_info;
  245|  42.6k|    const UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  246|  42.6k|    UWORD8 u1_field;
  247|  42.6k|    WORD32 ret = 0;
  248|  42.6k|    WORD16 i2_mv_x, i2_mv_y;
  249|       |
  250|  42.6k|    ps_dec->i4_submb_ofst -= (u4_num_mbs - u4_mb_idx) << 4;
  251|  42.6k|    ps_mb_part_info = ps_dec->ps_parse_mb_data;
  252|  42.6k|    ps_part = ps_dec->ps_parse_part_params;
  253|       |
  254|       |    /* N/2 Mb MvPred and Transfer Setup Loop */
  255|   184k|    for(i = u4_mb_idx; i < u4_num_mbs; i++, ps_mb_part_info++)
  ------------------
  |  Branch (255:24): [True: 142k, False: 42.2k]
  ------------------
  256|   142k|    {
  257|   142k|        UWORD8 u1_colz = 0;
  258|   142k|        ps_dec->i4_submb_ofst += SUB_BLK_SIZE;
  ------------------
  |  |  562|   142k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   142k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   142k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
  259|       |        /* Restore the slice scratch MbX and MbY context */
  260|   142k|        ps_cur_mb_info = ps_dec->ps_nmb_info + i;
  261|   142k|        ps_svc_cur_mb_info = ps_svc_lyr_dec->ps_svc_nmb_info + i;
  262|   142k|        u1_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  263|   142k|        ps_mv_nmb_start = ps_dec->ps_mv_cur + (i << 4);
  264|   142k|        ps_dec->u2_mbx = ps_cur_mb_info->u2_mbx;
  265|   142k|        ps_dec->u2_mby = ps_cur_mb_info->u2_mby;
  266|   142k|        ps_dec->u1_currB_type = 0;
  267|   142k|        ps_dec->u2_mv_2mb[i & 0x1] = 0;
  268|       |
  269|       |        /* Look for MV Prediction and Reference Transfer in Non-I Mbs */
  270|   142k|        if(!ps_mb_part_info->u4_isI_mb)
  ------------------
  |  Branch (270:12): [True: 141k, False: 563]
  ------------------
  271|   141k|        {
  272|   141k|            UWORD8 u1_blk_no;
  273|   141k|            WORD16 i1_ref_idx, i1_ref_idx1;
  274|   141k|            UWORD8 u1_pred_mode;
  275|   141k|            UWORD8 u1_sub_mb_x, u1_sub_mb_y, u1_sub_mb_num;
  276|   141k|            UWORD8 u1_lx, u1_lx_start, u1_lxend, u1_tmp_lx;
  277|   141k|            UWORD8 u1_num_part, u1_num_ref, u1_wd, u1_ht;
  278|   141k|            UWORD32 *pu4_wt_offst;
  279|   141k|            UWORD8 u1_scale_ref, u4_bot_mb;
  280|   141k|            deblk_mb_t *ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + i;
  281|   141k|            WORD8(*pi1_ref_idx)[MAX_REFIDX_INFO_PER_MB] = ps_mb_part_info->i1_ref_idx;
  282|   141k|            WORD8 *pi1_ref_idx0 = pi1_ref_idx[0], *pi1_ref_idx1 = pi1_ref_idx[1];
  283|   141k|            UWORD32 **ppu4_wt_ofst = ps_mb_part_info->pu4_wt_offst;
  284|   141k|            WORD32 i4_mb_mode_svc;
  285|   141k|            UWORD8 u1_motion_pred_flag_l0 = ps_svc_cur_mb_info->au1_motion_pred_flag[0];
  286|   141k|            UWORD8 u1_motion_pred_flag_l1 = ps_svc_cur_mb_info->au1_motion_pred_flag[1];
  287|       |
  288|       |            /* MB Level initialisations */
  289|   141k|            ps_dec->u4_num_pmbair = i >> u1_mbaff;
  290|   141k|            ps_dec->u4_mb_idx_mv = i;
  291|       |
  292|   141k|            i4_mb_mode_svc = isvcd_interlyr_motion_mode_pred(
  293|   141k|                ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info, ps_mb_part_info, ps_part);
  294|       |
  295|   141k|            if((-1 == i4_mb_mode_svc) || (SVC_INTER_MB == i4_mb_mode_svc))
  ------------------
  |  |  114|  33.4k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (295:16): [True: 108k, False: 33.4k]
  |  Branch (295:42): [True: 30.1k, False: 3.38k]
  ------------------
  296|   138k|            {
  297|   138k|                ps_mv_ntop_start =
  298|   138k|                    ps_mv_nmb_start - (ps_dec->u2_frm_wd_in_mbs << (4 + u1_mbaff)) + 12;
  299|       |
  300|   138k|                u1_num_part = ps_mb_part_info->u1_num_part;
  301|   138k|                ps_cur_deblk_mb->u1_mb_type |= (u1_num_part > 1) << 1;
  302|   138k|                u1_direct_mode_width = (1 == ps_mb_part_info->u1_num_part) ? 16 : 8;
  ------------------
  |  Branch (302:40): [True: 114k, False: 23.5k]
  ------------------
  303|       |
  304|   138k|                ps_cur_mb_info->u4_pred_info_pkd_idx = ps_dec->u4_pred_info_pkd_idx;
  305|   138k|                ps_cur_mb_info->u1_num_pred_parts = 0;
  306|       |
  307|       |                /****************************************************/
  308|       |                /* weighted u4_ofst pointer calculations, this loop  */
  309|       |                /* runs maximum 4 times, even in direct cases       */
  310|       |                /****************************************************/
  311|   138k|                u1_scale_ref = u1_mbaff & ps_cur_mb_info->u1_mb_field_decodingflag;
  312|   138k|                u4_bot_mb = 1 - ps_cur_mb_info->u1_topmb;
  313|   138k|                if(ps_dec->ps_cur_pps->u1_wted_bipred_idc)
  ------------------
  |  Branch (313:20): [True: 82.2k, False: 55.8k]
  ------------------
  314|  82.2k|                {
  315|  82.2k|                    u1_num_ref = MIN(u1_num_part, 4);
  ------------------
  |  |   61|  82.2k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 74.3k, False: 7.88k]
  |  |  ------------------
  ------------------
  316|  82.2k|                    if(PART_DIRECT_16x16 != ps_part->u1_is_direct)
  ------------------
  |  |  571|  82.2k|#define PART_DIRECT_16x16              2
  ------------------
  |  Branch (316:24): [True: 35.9k, False: 46.3k]
  ------------------
  317|  35.9k|                    {
  318|   102k|                        for(u1_blk_no = 0; u1_blk_no < u1_num_ref; u1_blk_no++)
  ------------------
  |  Branch (318:44): [True: 66.5k, False: 35.9k]
  ------------------
  319|  66.5k|                        {
  320|  66.5k|                            i1_ref_idx = MAX(pi1_ref_idx0[u1_blk_no], 0);
  ------------------
  |  |   60|  66.5k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 6.43k, False: 60.1k]
  |  |  ------------------
  ------------------
  321|  66.5k|                            if(u1_scale_ref) i1_ref_idx >>= 1;
  ------------------
  |  Branch (321:32): [True: 0, False: 66.5k]
  ------------------
  322|  66.5k|                            i1_ref_idx *= ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1];
  323|  66.5k|                            if(u1_scale_ref)
  ------------------
  |  Branch (323:32): [True: 0, False: 66.5k]
  ------------------
  324|      0|                                i1_ref_idx += (MAX(pi1_ref_idx1[u1_blk_no], 0) >> 1);
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  325|  66.5k|                            else
  326|  66.5k|                                i1_ref_idx += MAX(pi1_ref_idx1[u1_blk_no], 0);
  ------------------
  |  |   60|  66.5k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 1.18k, False: 65.4k]
  |  |  ------------------
  ------------------
  327|  66.5k|                            pu4_wt_offst = (UWORD32 *) &ps_dec->pu4_wt_ofsts[2 * X3(i1_ref_idx)];
  ------------------
  |  |   92|  66.5k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  328|       |
  329|  66.5k|                            if(pi1_ref_idx0[u1_blk_no] < 0) pu4_wt_offst += 1;
  ------------------
  |  Branch (329:32): [True: 19.7k, False: 46.8k]
  ------------------
  330|       |
  331|  66.5k|                            ppu4_wt_ofst[u1_blk_no] = pu4_wt_offst;
  332|  66.5k|                            if(u1_scale_ref && (ps_dec->ps_cur_pps->u1_wted_bipred_idc == 2))
  ------------------
  |  Branch (332:32): [True: 0, False: 66.5k]
  |  Branch (332:48): [True: 0, False: 0]
  ------------------
  333|      0|                            {
  334|      0|                                i1_ref_idx = MAX(pi1_ref_idx0[u1_blk_no], 0);
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  335|      0|                                i1_ref_idx *=
  336|      0|                                    (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1] << 1);
  337|      0|                                i1_ref_idx += MAX(pi1_ref_idx1[u1_blk_no], 0);
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  338|      0|                                if(u4_bot_mb)
  ------------------
  |  Branch (338:36): [True: 0, False: 0]
  ------------------
  339|      0|                                {
  340|      0|                                    i1_ref_idx +=
  341|      0|                                        (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0] << 1) *
  342|      0|                                        (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1] << 1);
  343|      0|                                }
  344|      0|                                pu4_wt_offst =
  345|      0|                                    (UWORD32 *) &ps_dec->pu4_mbaff_wt_mat[2 * X3(i1_ref_idx)];
  ------------------
  |  |   92|      0|#define X3(a)   (((a) << 1) + (a))
  ------------------
  346|      0|                                ppu4_wt_ofst[u1_blk_no] = pu4_wt_offst;
  347|      0|                            }
  348|  66.5k|                        }
  349|  35.9k|                    }
  350|  82.2k|                }
  351|       |
  352|       |                /**************************************************/
  353|       |                /* Loop on Partitions                             */
  354|       |                /* direct mode is reflected as a single partition */
  355|       |                /**************************************************/
  356|   325k|                for(j = 0; j < u1_num_part; j++, ps_part++)
  ------------------
  |  Branch (356:28): [True: 187k, False: 137k]
  ------------------
  357|   187k|                {
  358|   187k|                    u1_sub_mb_num = ps_part->u1_sub_mb_num;
  359|   187k|                    ps_dec->u1_sub_mb_num = u1_sub_mb_num;
  360|       |
  361|   187k|                    if(PART_NOT_DIRECT != ps_part->u1_is_direct)
  ------------------
  |  |  569|   187k|#define PART_NOT_DIRECT                0
  ------------------
  |  Branch (361:24): [True: 85.9k, False: 101k]
  ------------------
  362|  85.9k|                    {
  363|       |                        /**************************************************/
  364|       |                        /* Direct Mode, Call DecodeSpatial/TemporalDirect */
  365|       |                        /* only (those will in turn call FormMbPartInfo)  */
  366|       |                        /**************************************************/
  367|  85.9k|                        ret = isvcd_decode_spatial_direct(ps_dec, u1_direct_mode_width,
  368|  85.9k|                                                          ps_cur_mb_info, i);
  369|  85.9k|                        if(ret != OK) return ret;
  ------------------
  |  |  114|  85.9k|#define OK        0
  ------------------
  |  Branch (369:28): [True: 0, False: 85.9k]
  ------------------
  370|  85.9k|                        ps_cur_deblk_mb->u1_mb_type |= (ps_dec->u1_currB_type << 1);
  371|  85.9k|                    }
  372|   101k|                    else
  373|   101k|                    {
  374|   101k|                        mv_pred_t s_mvPred = {0};
  375|       |                        /**************************************************/
  376|       |                        /* Non Direct Mode, Call Motion Vector Predictor  */
  377|       |                        /* and FormMbpartInfo                             */
  378|       |                        /**************************************************/
  379|   101k|                        u1_sub_mb_x = u1_sub_mb_num & 0x03;
  380|   101k|                        u1_sub_mb_y = u1_sub_mb_num >> 2;
  381|   101k|                        u1_blk_no = (u1_num_part < 4)
  ------------------
  |  Branch (381:37): [True: 61.8k, False: 39.6k]
  ------------------
  382|   101k|                                        ? j
  383|   101k|                                        : (((u1_sub_mb_y >> 1) << 1) + (u1_sub_mb_x >> 1));
  384|       |
  385|   101k|                        ps_mv_ntop = ps_mv_ntop_start + u1_sub_mb_x;
  386|   101k|                        ps_mv_nmb = ps_mv_nmb_start + u1_sub_mb_num;
  387|       |
  388|       |                        /* Populate the colpic info and reference frames */
  389|   101k|                        s_mvPred.i1_ref_frame[0] = pi1_ref_idx0[u1_blk_no];
  390|   101k|                        s_mvPred.i1_ref_frame[1] = pi1_ref_idx1[u1_blk_no];
  391|   101k|                        u1_pred_mode = ps_part->u1_pred_mode;
  392|   101k|                        u1_wd = ps_part->u1_partwidth;
  393|   101k|                        u1_ht = ps_part->u1_partheight;
  394|       |
  395|   101k|                        if(1 != ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (395:28): [True: 54.9k, False: 46.5k]
  ------------------
  396|  54.9k|                        {
  397|  54.9k|                            u1_lx_start = 0;
  398|  54.9k|                            u1_lxend = 2;
  399|  54.9k|                            if(PRED_L0 == u1_pred_mode)
  ------------------
  |  |  483|  54.9k|#define PRED_L0   1
  ------------------
  |  Branch (399:32): [True: 23.7k, False: 31.2k]
  ------------------
  400|  23.7k|                            {
  401|  23.7k|                                s_mvPred.i2_mv[2] = 0;
  402|  23.7k|                                s_mvPred.i2_mv[3] = 0;
  403|  23.7k|                                if(0 == (u1_motion_pred_flag_l0 & (1 << u1_blk_no)))
  ------------------
  |  Branch (403:36): [True: 13.9k, False: 9.82k]
  ------------------
  404|  13.9k|                                {
  405|  13.9k|                                    u1_lxend = 1;
  406|  13.9k|                                }
  407|  9.82k|                                else
  408|  9.82k|                                {
  409|  9.82k|                                    u1_lxend = 0;
  410|  9.82k|                                }
  411|  23.7k|                            }
  412|  31.2k|                            else if(PRED_L1 == u1_pred_mode)
  ------------------
  |  |  484|  31.2k|#define PRED_L1   2
  ------------------
  |  Branch (412:37): [True: 19.8k, False: 11.3k]
  ------------------
  413|  19.8k|                            {
  414|  19.8k|                                s_mvPred.i2_mv[0] = 0;
  415|  19.8k|                                s_mvPred.i2_mv[1] = 0;
  416|  19.8k|                                if(0 == (u1_motion_pred_flag_l1 & (1 << u1_blk_no)))
  ------------------
  |  Branch (416:36): [True: 15.1k, False: 4.67k]
  ------------------
  417|  15.1k|                                {
  418|  15.1k|                                    u1_lx_start = 1;
  419|  15.1k|                                }
  420|  4.67k|                                else
  421|  4.67k|                                {
  422|  4.67k|                                    u1_lx_start = 2;
  423|  4.67k|                                }
  424|  19.8k|                            }
  425|  11.3k|                            else  // Bi Pred
  426|  11.3k|                            {
  427|  11.3k|                                if(0 == (u1_motion_pred_flag_l0 & (1 << u1_blk_no)))
  ------------------
  |  Branch (427:36): [True: 9.83k, False: 1.56k]
  ------------------
  428|  9.83k|                                {
  429|  9.83k|                                    u1_lxend = 1;
  430|  9.83k|                                }
  431|  11.3k|                                if(0 == (u1_motion_pred_flag_l1 & (1 << u1_blk_no)))
  ------------------
  |  Branch (431:36): [True: 2.73k, False: 8.66k]
  ------------------
  432|  2.73k|                                {
  433|  2.73k|                                    u1_lx_start = 1;
  434|  2.73k|                                }
  435|  11.3k|                                if((0 != (u1_motion_pred_flag_l0 & (1 << u1_blk_no))) &&
  ------------------
  |  Branch (435:36): [True: 1.56k, False: 9.83k]
  ------------------
  436|  1.56k|                                   (0 != (u1_motion_pred_flag_l1 & (1 << u1_blk_no))))
  ------------------
  |  Branch (436:36): [True: 1.05k, False: 514]
  ------------------
  437|  1.05k|                                {
  438|  1.05k|                                    u1_lx_start = 0;
  439|  1.05k|                                    u1_lxend = 0;
  440|  1.05k|                                }
  441|  11.3k|                                if((0 == (u1_motion_pred_flag_l0 & (1 << u1_blk_no))) &&
  ------------------
  |  Branch (441:36): [True: 9.83k, False: 1.56k]
  ------------------
  442|  9.83k|                                   (0 == (u1_motion_pred_flag_l1 & (1 << u1_blk_no))))
  ------------------
  |  Branch (442:36): [True: 2.21k, False: 7.61k]
  ------------------
  443|  2.21k|                                {
  444|  2.21k|                                    u1_lx_start = 0;
  445|  2.21k|                                    u1_lxend = 2;
  446|  2.21k|                                }
  447|  11.3k|                            }
  448|  54.9k|                            ps_dec->pf_mvpred(ps_dec, ps_cur_mb_info, ps_mv_nmb, ps_mv_ntop,
  449|  54.9k|                                              &s_mvPred, u1_sub_mb_num, u1_wd, u1_lx_start,
  450|  54.9k|                                              u1_lxend, ps_cur_mb_info->u1_mb_mc_mode);
  451|  54.9k|                        }
  452|       |
  453|       |                        /* for generic case based on pred mode derived / signalled */
  454|   101k|                        u1_lx_start = 0;
  455|   101k|                        u1_lxend = 2;
  456|   101k|                        if(PRED_L0 == u1_pred_mode)
  ------------------
  |  |  483|   101k|#define PRED_L0   1
  ------------------
  |  Branch (456:28): [True: 50.2k, False: 51.2k]
  ------------------
  457|  50.2k|                        {
  458|  50.2k|                            s_mvPred.i2_mv[2] = 0;
  459|  50.2k|                            s_mvPred.i2_mv[3] = 0;
  460|  50.2k|                            u1_lxend = 1;
  461|  50.2k|                        }
  462|   101k|                        if(PRED_L1 == u1_pred_mode)
  ------------------
  |  |  484|   101k|#define PRED_L1   2
  ------------------
  |  Branch (462:28): [True: 27.1k, False: 74.3k]
  ------------------
  463|  27.1k|                        {
  464|  27.1k|                            s_mvPred.i2_mv[0] = 0;
  465|  27.1k|                            s_mvPred.i2_mv[1] = 0;
  466|  27.1k|                            u1_lx_start = 1;
  467|  27.1k|                        }
  468|       |
  469|       |                        /**********************************************************/
  470|       |                        /* Loop on number of predictors, 1 Each for Forw Backw    */
  471|       |                        /* Loop 2 times for BiDirect mode                         */
  472|       |                        /**********************************************************/
  473|   226k|                        for(u1_lx = u1_lx_start; u1_lx < u1_lxend; u1_lx++)
  ------------------
  |  Branch (473:50): [True: 125k, False: 101k]
  ------------------
  474|   125k|                        {
  475|   125k|                            UWORD8 u1_motion_pred_flag =
  476|   125k|                                u1_lx ? u1_motion_pred_flag_l1 : u1_motion_pred_flag_l0;
  ------------------
  |  Branch (476:33): [True: 51.2k, False: 74.3k]
  ------------------
  477|       |
  478|   125k|                            if((0 != (u1_motion_pred_flag & (1 << u1_blk_no))) ||
  ------------------
  |  Branch (478:32): [True: 24.7k, False: 100k]
  ------------------
  479|   100k|                               (ps_svc_cur_mb_info->u1_base_mode_flag))
  ------------------
  |  Branch (479:32): [True: 59.3k, False: 41.6k]
  ------------------
  480|  84.0k|                            {
  481|  84.0k|                                isvcd_retrive_infer_mode_mv(ps_svc_lyr_dec, &s_mvPred, u1_lx,
  482|  84.0k|                                                            u1_sub_mb_num);
  483|  84.0k|                            }
  484|       |                            /********************************************************/
  485|       |                            /* Predict Mv                                           */
  486|       |                            /* Add Mv Residuals and store back                      */
  487|       |                            /********************************************************/
  488|   125k|                            u1_tmp_lx = (u1_lx << 1);
  489|   125k|                            i1_ref_idx = s_mvPred.i1_ref_frame[u1_lx];
  490|       |                            /********************************************************************/
  491|       |                            /* If reference index is inferred from the base layer and it is     */
  492|       |                            /* exceeding the number of active reference in the current layer.   */
  493|       |                            /* Then reference index is clipped to the max in the current layer  */
  494|       |                            /********************************************************************/
  495|   125k|                            if(ps_svc_cur_mb_info->u1_base_mode_flag == 1)
  ------------------
  |  Branch (495:32): [True: 59.3k, False: 66.3k]
  ------------------
  496|  59.3k|                            {
  497|  59.3k|                                if(i1_ref_idx > (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[u1_lx] - 1))
  ------------------
  |  Branch (497:36): [True: 5.65k, False: 53.6k]
  ------------------
  498|  5.65k|                                {
  499|  5.65k|                                    i1_ref_idx = ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[u1_lx] - 1;
  500|  5.65k|                                }
  501|  59.3k|                            }
  502|   125k|                            if(0 == ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (502:32): [True: 66.3k, False: 59.3k]
  ------------------
  503|  66.3k|                            {
  504|  66.3k|                                i2_mv_x = ps_mv_nmb->i2_mv[u1_tmp_lx];
  505|  66.3k|                                i2_mv_y = ps_mv_nmb->i2_mv[u1_tmp_lx + 1];
  506|       |
  507|  66.3k|                                i2_mv_x += s_mvPred.i2_mv[u1_tmp_lx];
  508|  66.3k|                                i2_mv_y += s_mvPred.i2_mv[u1_tmp_lx + 1];
  509|       |
  510|  66.3k|                                s_mvPred.i2_mv[u1_tmp_lx] = i2_mv_x;
  511|  66.3k|                                s_mvPred.i2_mv[u1_tmp_lx + 1] = i2_mv_y;
  512|  66.3k|                            }
  513|  59.3k|                            else
  514|  59.3k|                            {
  515|  59.3k|                                i2_mv_x = s_mvPred.i2_mv[u1_tmp_lx];
  516|  59.3k|                                i2_mv_y = s_mvPred.i2_mv[u1_tmp_lx + 1];
  517|  59.3k|                            }
  518|       |
  519|       |                            /********************************************************/
  520|       |                            /* Transfer setup call                                  */
  521|       |                            /* convert RefIdx if it is MbAff                        */
  522|       |                            /* Pass Weight Offset and refFrame                      */
  523|       |                            /********************************************************/
  524|   125k|                            i1_ref_idx1 = i1_ref_idx >> u1_scale_ref;
  525|       |
  526|   125k|                            if(-1 == i1_ref_idx1) return NOT_OK;
  ------------------
  |  |  116|    341|#define NOT_OK    -1
  ------------------
  |  Branch (526:32): [True: 341, False: 125k]
  ------------------
  527|   125k|                            if(u1_scale_ref && ((i1_ref_idx & 0x01) != u4_bot_mb))
  ------------------
  |  Branch (527:32): [True: 0, False: 125k]
  |  Branch (527:48): [True: 0, False: 0]
  ------------------
  528|      0|                                i1_ref_idx1 += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  529|   125k|                            ps_ref_frame = ps_dec->ps_ref_pic_buf_lx[u1_lx][i1_ref_idx1];
  530|       |
  531|       |                            /* Storing Colocated-Zero u4_flag */
  532|   125k|                            if(u1_lx == u1_lx_start)
  ------------------
  |  Branch (532:32): [True: 101k, False: 24.0k]
  ------------------
  533|   101k|                            {
  534|       |                                /* Fill colocated info in MvPred structure */
  535|   101k|                                s_mvPred.u1_col_ref_pic_idx = ps_ref_frame->u1_mv_buf_id;
  536|   101k|                                s_mvPred.u1_pic_type = ps_ref_frame->u1_pic_type;
  537|       |
  538|       |                                /* Calculating colocated zero information */
  539|   101k|                                u1_colz =
  540|   101k|                                    (u1_field << 1) | ((i1_ref_idx == 0) && (ABS(i2_mv_x) <= 1) &&
  ------------------
  |  |  100|  90.4k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 19.1k, False: 71.2k]
  |  |  ------------------
  ------------------
  |  Branch (540:56): [True: 90.4k, False: 10.7k]
  |  Branch (540:77): [True: 57.6k, False: 32.8k]
  ------------------
  541|  57.6k|                                                       (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|  57.6k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 5.62k, False: 51.9k]
  |  |  ------------------
  ------------------
  |  Branch (541:56): [True: 48.1k, False: 9.43k]
  ------------------
  542|   101k|                                u1_colz |= ps_mb_part_info->u1_col_info[u1_blk_no];
  543|   101k|                            }
  544|       |
  545|   125k|                            pu4_wt_offst = ppu4_wt_ofst[u1_blk_no];
  546|   125k|                            {
  547|   125k|                                pred_info_pkd_t *ps_pred_pkd;
  548|   125k|                                WORD16 i2_mv[2];
  549|       |
  550|   125k|                                i2_mv[0] = i2_mv_x;
  551|   125k|                                i2_mv[1] = i2_mv_y;
  552|       |
  553|   125k|                                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  554|   125k|                                ih264d_fill_pred_info(i2_mv, u1_wd, u1_ht, u1_sub_mb_num,
  555|   125k|                                                      u1_pred_mode, ps_pred_pkd,
  556|   125k|                                                      ps_ref_frame->u1_pic_buf_id, i1_ref_idx,
  557|   125k|                                                      pu4_wt_offst, ps_ref_frame->u1_pic_type);
  558|   125k|                                ps_dec->u4_pred_info_pkd_idx++;
  559|   125k|                                ps_cur_mb_info->u1_num_pred_parts++;
  560|   125k|                            }
  561|   125k|                        }
  562|   101k|                        if(ps_mv_nmb)
  ------------------
  |  Branch (562:28): [True: 101k, False: 0]
  ------------------
  563|   101k|                        {
  564|   101k|                            ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb, u1_sub_mb_num, u1_colz,
  565|   101k|                                               u1_ht, u1_wd);
  566|   101k|                        }
  567|      0|                        else
  568|      0|                        {
  569|      0|                            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  570|      0|                        }
  571|   101k|                    }
  572|   187k|                }
  573|       |                /* to take care of 16 parttitions increment for base mode flag case*/
  574|   137k|                if(1 == ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (574:20): [True: 30.1k, False: 107k]
  ------------------
  575|  30.1k|                {
  576|  30.1k|                    ps_part += (MAX_NUM_MB_PART - u1_num_part);
  ------------------
  |  |   62|  30.1k|#define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   59|  30.1k|#define NUM_MB_PARTS 4
  |  |  ------------------
  |  |               #define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   60|  30.1k|#define NUM_SUB_MB_PARTS 4
  |  |  ------------------
  ------------------
  577|  30.1k|                }
  578|   137k|            }
  579|  3.38k|            else
  580|  3.38k|            {
  581|       |                /* Set zero values in case of Intra Mbs */
  582|  3.38k|                mv_pred_t s_mvPred = {{0, 0, 0, 0}, {-1, -1}, 0, 0};
  583|       |                /* to take care of 16 parttitions increment for base mode flag case*/
  584|  3.38k|                if(1 != ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (584:20): [True: 0, False: 3.38k]
  ------------------
  585|      0|                {
  586|      0|                    return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  587|      0|                }
  588|       |
  589|  3.38k|                ps_cur_deblk_mb->u1_mb_type |= D_INTRA_IBL;
  ------------------
  |  |   72|  3.38k|#define D_INTRA_IBL 16
  ------------------
  590|  3.38k|                if((ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER) &&
  ------------------
  |  |  110|  3.38k|#define TARGET_LAYER 2
  ------------------
  |  Branch (590:20): [True: 0, False: 3.38k]
  ------------------
  591|      0|                   (DBLK_ENABLED == ps_dec->ps_cur_slice->u1_disable_dblk_filter_idc))
  ------------------
  |  |  549|      0|#define DBLK_ENABLED                  0
  ------------------
  |  Branch (591:20): [True: 0, False: 0]
  ------------------
  592|      0|                {
  593|      0|                    ps_cur_deblk_mb->u1_deblocking_mode = MB_ENABLE_FILTERING;
  ------------------
  |  |   69|      0|#define MB_ENABLE_FILTERING           0x00
  ------------------
  594|      0|                }
  595|       |
  596|  3.38k|                ps_part += (MAX_NUM_MB_PART);
  ------------------
  |  |   62|  3.38k|#define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   59|  3.38k|#define NUM_MB_PARTS 4
  |  |  ------------------
  |  |               #define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   60|  3.38k|#define NUM_SUB_MB_PARTS 4
  |  |  ------------------
  ------------------
  597|       |                /* Storing colocated zero information */
  598|  3.38k|                if(ps_mv_nmb_start)
  ------------------
  |  Branch (598:20): [True: 3.38k, False: 0]
  ------------------
  599|  3.38k|                {
  600|  3.38k|                    ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0,
  601|  3.38k|                                       (UWORD8) (u1_field << 1), 4, 4);
  602|  3.38k|                }
  603|      0|                else
  604|      0|                {
  605|      0|                    return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  606|      0|                }
  607|  3.38k|            }
  608|   141k|        }
  609|    563|        else
  610|    563|        {
  611|       |            /* Set zero values in case of Intra Mbs */
  612|    563|            mv_pred_t s_mvPred = {{0, 0, 0, 0}, {-1, -1}, 0, 0};
  613|       |            /* Storing colocated zero information */
  614|    563|            if(ps_mv_nmb_start)
  ------------------
  |  Branch (614:16): [True: 563, False: 0]
  ------------------
  615|    563|            {
  616|    563|                ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0, (UWORD8) (u1_field << 1),
  617|    563|                                   4, 4);
  618|    563|            }
  619|      0|            else
  620|      0|            {
  621|      0|                return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  622|      0|            }
  623|    563|        }
  624|   142k|    }
  625|       |
  626|  42.2k|    return OK;
  ------------------
  |  |  114|  42.2k|#define OK        0
  ------------------
  627|  42.6k|}
isvcd_parse_bmb_cavlc:
  643|  27.9k|{
  644|  27.9k|    UWORD32 u4_cbp = 0;
  645|  27.9k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  646|  27.9k|    deblk_mb_t *ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u4_mb_num;
  647|  27.9k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
  648|  27.9k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  649|  27.9k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  650|  27.9k|    const UWORD8 *puc_mb_mc_mode = (const UWORD8 *) gau1_ih264d_mb_mc_mode;
  651|  27.9k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  652|  27.9k|    WORD32 ret;
  653|  27.9k|    UWORD8 u1_Bdirect_tranform_read = 1;
  654|  27.9k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
  655|       |
  656|  27.9k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
  657|  27.9k|    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 1;
  658|  27.9k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
  659|  27.9k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  660|  27.9k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  661|  27.9k|    ps_cur_mb_info->u1_mb_mc_mode = puc_mb_mc_mode[5 + u1_mb_type];
  662|  27.9k|    ps_cur_deblk_mb->u1_mb_type |= D_B_SLICE;
  ------------------
  |  |  384|  27.9k|#define D_B_SLICE         4
  ------------------
  663|  27.9k|    if(u1_mb_type != B_DIRECT)
  ------------------
  |  |  482|  27.9k|#define B_DIRECT  0
  ------------------
  |  Branch (663:8): [True: 16.3k, False: 11.6k]
  ------------------
  664|  16.3k|    {
  665|  16.3k|        ret = isvcd_parse_bmb_non_direct_cavlc(ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info,
  666|  16.3k|                                               u4_mb_num, u4_num_mbsNby2);
  667|  16.3k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  16.3k|#define OK        0
  ------------------
  |  Branch (667:12): [True: 313, False: 15.9k]
  ------------------
  668|  16.3k|    }
  669|  11.6k|    else
  670|  11.6k|    {
  671|       |        /************ STORING PARTITION INFO ***********/
  672|  11.6k|        parse_part_params_t *ps_part_info;
  673|  11.6k|        ps_part_info = ps_dec->ps_part;
  674|  11.6k|        ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  571|  11.6k|#define PART_DIRECT_16x16              2
  ------------------
  675|  11.6k|        ps_part_info->u1_sub_mb_num = 0;
  676|  11.6k|        ps_dec->ps_part++;
  677|       |        /* check whether transform8x8 u4_flag to be read or not */
  678|  11.6k|        u1_Bdirect_tranform_read = ps_dec->s_high_profile.u1_direct_8x8_inference_flag;
  679|  11.6k|    }
  680|       |
  681|  27.6k|    if(ps_svc_slice_params->u1_adaptive_residual_prediction_flag &&
  ------------------
  |  Branch (681:8): [True: 16.1k, False: 11.4k]
  ------------------
  682|  16.1k|       ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (682:8): [True: 15.4k, False: 732]
  ------------------
  683|  15.4k|    {
  684|  15.4k|        ps_svc_cur_mb_info->u1_residual_prediction_flag = ih264d_get_bit_h264(ps_bitstrm);
  685|  15.4k|        COPYTHECONTEXT("SVC ext: u1_residual_prediction_flag",
  686|  15.4k|                       ps_svc_cur_mb_info->u1_residual_prediction_flag);
  687|  15.4k|    }
  688|  12.1k|    else
  689|  12.1k|    {
  690|       |        /*residual flag inference code */
  691|  12.1k|        if(1 == ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (691:12): [True: 11.3k, False: 798]
  ------------------
  692|  11.3k|           1 == ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (692:12): [True: 0, False: 11.3k]
  ------------------
  693|      0|        {
  694|      0|            ps_svc_cur_mb_info->u1_residual_prediction_flag =
  695|      0|                ps_svc_slice_params->u1_default_residual_prediction_flag;
  696|      0|        }
  697|  12.1k|        else
  698|  12.1k|        {
  699|  12.1k|            ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
  700|  12.1k|        }
  701|  12.1k|    }
  702|       |
  703|  27.6k|    if(ps_svc_slice_params->u1_scan_idx_end >= ps_svc_slice_params->u1_scan_idx_start)
  ------------------
  |  Branch (703:8): [True: 27.6k, False: 0]
  ------------------
  704|  27.6k|    {
  705|       |        /* Read the Coded block pattern */
  706|  27.6k|        const UWORD8 *puc_CbpInter = gau1_ih264d_cbp_inter;
  707|       |        // Inlined ih264d_uev
  708|  27.6k|        UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  709|  27.6k|        UWORD32 u4_word, u4_ldz;
  710|       |
  711|       |        /***************************************************************/
  712|       |        /* Find leading zeros in next 32 bits                          */
  713|       |        /***************************************************************/
  714|  27.6k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  27.6k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  27.6k|{                                                                           \
  |  |  152|  27.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  27.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  27.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  27.6k|                                                                            \
  |  |  156|  27.6k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  27.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 26.6k, False: 938]
  |  |  ------------------
  |  |  158|  27.6k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  26.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  27.6k|}
  ------------------
  715|  27.6k|        u4_ldz = CLZ(u4_word);
  716|       |        /* Flush the ps_bitstrm */
  717|  27.6k|        u4_bitstream_offset += (u4_ldz + 1);
  718|       |        /* Read the suffix from the ps_bitstrm */
  719|  27.6k|        u4_word = 0;
  720|  27.6k|        if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  8.86k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  8.86k|{                                                                           \
  |  |  122|  8.86k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  8.86k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  8.86k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  8.86k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  8.86k|                                                                            \
  |  |  127|  8.86k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 8.34k, False: 522]
  |  |  ------------------
  |  |  128|  8.86k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  8.34k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  8.86k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  8.86k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  8.86k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  8.86k|}                                                                           \
  ------------------
  |  Branch (720:12): [True: 8.86k, False: 18.7k]
  ------------------
  721|  27.6k|        *pu4_bitstrm_ofst = u4_bitstream_offset;
  722|  27.6k|        u4_cbp = ((1 << u4_ldz) + u4_word - 1);
  723|       |        // Inlined ih264d_uev
  724|  27.6k|        if(u4_cbp > 47) return ERROR_CBP;
  ------------------
  |  Branch (724:12): [True: 498, False: 27.1k]
  ------------------
  725|  27.1k|        u4_cbp = puc_CbpInter[u4_cbp];
  726|       |
  727|  27.1k|        if((ps_dec->s_high_profile.u1_transform8x8_present) && (u4_cbp & (0xf)) &&
  ------------------
  |  Branch (727:12): [True: 11.6k, False: 15.4k]
  |  Branch (727:64): [True: 2.60k, False: 9.07k]
  ------------------
  728|  2.60k|           (ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag) && (u1_Bdirect_tranform_read))
  ------------------
  |  Branch (728:12): [True: 1.70k, False: 905]
  |  Branch (728:73): [True: 1.21k, False: 490]
  ------------------
  729|  1.21k|        {
  730|  1.21k|            ps_cur_mb_info->u1_tran_form8x8 = ih264d_get_bit_h264(ps_bitstrm);
  731|  1.21k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  732|  1.21k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  733|  1.21k|        }
  734|       |
  735|  27.1k|        COPYTHECONTEXT("coded_block_pattern", u4_cbp);
  736|  27.1k|        ps_cur_mb_info->u1_cbp = u4_cbp;
  737|  27.1k|    }
  738|       |
  739|       |    /* Read mb_qp_delta */
  740|  27.1k|    if(u4_cbp)
  ------------------
  |  Branch (740:8): [True: 8.36k, False: 18.7k]
  ------------------
  741|  8.36k|    {
  742|  8.36k|        WORD32 i_temp;
  743|       |        // inlining ih264d_sev
  744|  8.36k|        UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  745|  8.36k|        UWORD32 u4_word, u4_ldz, u4_abs_val;
  746|       |
  747|       |        /***************************************************************/
  748|       |        /* Find leading zeros in next 32 bits                          */
  749|       |        /***************************************************************/
  750|  8.36k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  8.36k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  8.36k|{                                                                           \
  |  |  152|  8.36k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  8.36k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  8.36k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  8.36k|                                                                            \
  |  |  156|  8.36k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  8.36k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 8.04k, False: 320]
  |  |  ------------------
  |  |  158|  8.36k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  8.04k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  8.36k|}
  ------------------
  751|  8.36k|        u4_ldz = CLZ(u4_word);
  752|       |
  753|       |        /* Flush the ps_bitstrm */
  754|  8.36k|        u4_bitstream_offset += (u4_ldz + 1);
  755|       |
  756|       |        /* Read the suffix from the ps_bitstrm */
  757|  8.36k|        u4_word = 0;
  758|  8.36k|        if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  3.80k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  3.80k|{                                                                           \
  |  |  122|  3.80k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  3.80k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  3.80k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  3.80k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  3.80k|                                                                            \
  |  |  127|  3.80k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 3.44k, False: 356]
  |  |  ------------------
  |  |  128|  3.80k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  3.44k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  3.80k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  3.80k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  3.80k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  3.80k|}                                                                           \
  ------------------
  |  Branch (758:12): [True: 3.80k, False: 4.56k]
  ------------------
  759|       |
  760|  8.36k|        *pu4_bitstrm_ofst = u4_bitstream_offset;
  761|  8.36k|        u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  762|       |
  763|  8.36k|        if(u4_word & 0x1)
  ------------------
  |  Branch (763:12): [True: 1.85k, False: 6.51k]
  ------------------
  764|  1.85k|            i_temp = (-(WORD32) u4_abs_val);
  765|  6.51k|        else
  766|  6.51k|            i_temp = (u4_abs_val);
  767|       |
  768|  8.36k|        if(i_temp < -26 || i_temp > 25) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  Branch (768:12): [True: 153, False: 8.21k]
  |  Branch (768:28): [True: 201, False: 8.01k]
  ------------------
  769|       |        // inlinined ih264d_sev
  770|  8.01k|        COPYTHECONTEXT("mb_qp_delta", i_temp);
  771|  8.01k|        if(i_temp)
  ------------------
  |  Branch (771:12): [True: 3.44k, False: 4.56k]
  ------------------
  772|  3.44k|        {
  773|  3.44k|            ret = ih264d_update_qp(ps_dec, (WORD8) i_temp);
  774|  3.44k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  3.44k|#define OK        0
  ------------------
  |  Branch (774:16): [True: 0, False: 3.44k]
  ------------------
  775|  3.44k|        }
  776|       |
  777|       |        /*SVC residual from start to end idx*/
  778|  8.01k|        ret = ih264d_parse_residual4x4_cavlc(ps_dec, ps_cur_mb_info, 0);
  779|  8.01k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  8.01k|#define OK        0
  ------------------
  |  Branch (779:12): [True: 203, False: 7.81k]
  ------------------
  780|  7.81k|        if(EXCEED_OFFSET(ps_bitstrm)) return ERROR_EOB_TERMINATE_T;
  ------------------
  |  |   93|  7.81k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 156, False: 7.65k]
  |  |  ------------------
  ------------------
  781|  7.81k|    }
  782|  18.7k|    else
  783|  18.7k|    {
  784|  18.7k|        ps_dec->i1_prev_mb_qp_delta = 0;
  785|  18.7k|        ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|  18.7k|#define CAVLC  0
  ------------------
  786|  18.7k|    }
  787|       |
  788|  26.4k|    return OK;
  ------------------
  |  |  114|  26.4k|#define OK        0
  ------------------
  789|  27.1k|}
isvcd_parse_bmb_non_direct_cabac:
  808|  13.2k|{
  809|       |    /* Loads from ps_dec */
  810|  13.2k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  811|  13.2k|    decoding_envirnoment_t *ps_cab_env = &ps_dec->s_cab_dec_env;
  812|  13.2k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
  813|  13.2k|    ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
  814|  13.2k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data + u4_num_mbsNby2;
  815|       |
  816|       |    /* table pointer loads */
  817|  13.2k|    const UWORD8 *pu1_sub_mb_pred_modes = (UWORD8 *) (gau1_ih264d_submb_pred_modes) + 4;
  818|  13.2k|    const UWORD8(*pu1_mb_pred_modes)[32] = (const UWORD8(*)[32]) gau1_ih264d_mb_pred_modes;
  819|  13.2k|    const UWORD8 *pu1_num_mb_part = (const UWORD8 *) gau1_ih264d_num_mb_part;
  820|  13.2k|    const UWORD8 *pu1_sub_mb_mc_mode = (UWORD8 *) (gau1_ih264d_submb_mc_mode) + 4;
  821|       |
  822|  13.2k|    const UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
  823|  13.2k|    UWORD8 *pu1_col_info = ps_parse_mb_data->u1_col_info;
  824|  13.2k|    WORD8 *pi1_ref_idx_l0 = &ps_parse_mb_data->i1_ref_idx[0][0];
  825|  13.2k|    WORD8 *pi1_ref_idx_l1 = &ps_parse_mb_data->i1_ref_idx[1][0];
  826|  13.2k|    UWORD8 u1_dec_ref_l0, u1_dec_ref_l1;
  827|       |
  828|  13.2k|    UWORD8 u1_num_mb_part, u1_mb_mc_mode, u1_sub_mb, u1_mbpred_mode = 5 + u1_mb_type;
  829|  13.2k|    UWORD32 u4_mb_mc_mode = 0, u4_mb_pred_mode = 0;
  830|  13.2k|    WORD32 ret;
  831|  13.2k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
  832|  13.2k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
  833|       |
  834|  13.2k|    p_curr_ctxt->u1_mb_type = CAB_NON_BD16x16;
  ------------------
  |  |  397|  13.2k|#define CAB_NON_BD16x16   0x05 /* 0000 0101 */
  ------------------
  835|  13.2k|    u1_sub_mb = !(u1_mb_type ^ B_8x8);
  ------------------
  |  |  480|  13.2k|#define B_8x8    22
  ------------------
  836|       |
  837|  13.2k|    {
  838|  13.2k|        UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  839|  13.2k|        UWORD8 *pu1_num_ref_idx_lx_active = ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active;
  840|  13.2k|        UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  841|  13.2k|        UWORD8 u1_mbaff_field = (u1_mbaff & uc_field);
  842|  13.2k|        u1_dec_ref_l0 = (pu1_num_ref_idx_lx_active[0] << u1_mbaff_field) - 1;
  843|  13.2k|        u1_dec_ref_l1 = (pu1_num_ref_idx_lx_active[1] << u1_mbaff_field) - 1;
  844|  13.2k|    }
  845|       |
  846|  13.2k|    if(u1_sub_mb)
  ------------------
  |  Branch (846:8): [True: 4.57k, False: 8.70k]
  ------------------
  847|  4.57k|    {
  848|  4.57k|        const UWORD8 u1_colz = ((PRED_8x8) << 6);
  ------------------
  |  |  453|  4.57k|#define PRED_8x8    3
  ------------------
  849|  4.57k|        UWORD8 uc_i;
  850|  4.57k|        u1_mb_mc_mode = 0;
  851|  4.57k|        u1_num_mb_part = 4;
  852|       |        /* Reading the subMB type */
  853|  22.8k|        for(uc_i = 0; uc_i < 4; uc_i++)
  ------------------
  |  Branch (853:23): [True: 18.3k, False: 4.57k]
  ------------------
  854|  18.3k|        {
  855|  18.3k|            UWORD8 u1_sub_mb_mode, u1_subMbPredModes;
  856|  18.3k|            u1_sub_mb_mode =
  857|  18.3k|                ih264d_parse_submb_type_cabac(1, ps_cab_env, ps_bitstrm, ps_dec->p_sub_mb_type_t);
  858|       |
  859|  18.3k|            if(u1_sub_mb_mode > 12) return ERROR_SUB_MB_TYPE;
  ------------------
  |  Branch (859:16): [True: 0, False: 18.3k]
  ------------------
  860|       |
  861|  18.3k|            u1_subMbPredModes = pu1_sub_mb_pred_modes[u1_sub_mb_mode];
  862|  18.3k|            u4_mb_mc_mode = (u4_mb_mc_mode << 8) | pu1_sub_mb_mc_mode[u1_sub_mb_mode];
  863|  18.3k|            u4_mb_pred_mode = (u4_mb_pred_mode << 8) | u1_subMbPredModes;
  864|  18.3k|            *pi1_ref_idx_l0++ = (u1_subMbPredModes & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|  18.3k|#define PRED_L0   1
  ------------------
  |  Branch (864:33): [True: 11.3k, False: 6.94k]
  ------------------
  865|  18.3k|            *pi1_ref_idx_l1++ = (u1_subMbPredModes & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|  18.3k|#define PRED_L1   2
  ------------------
  |  Branch (865:33): [True: 13.3k, False: 4.91k]
  ------------------
  866|  18.3k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
  867|       |            /* Storing collocated Mb and SubMb mode information */
  868|  18.3k|            *pu1_col_info++ = (u1_colz | (pu1_sub_mb_mc_mode[u1_sub_mb_mode] << 4));
  869|  18.3k|            if(u1_sub_mb_mode != B_DIRECT_8x8)
  ------------------
  |  |  465|  18.3k|#define B_DIRECT_8x8    0
  ------------------
  |  Branch (869:16): [True: 15.5k, False: 2.75k]
  ------------------
  870|  15.5k|            {
  871|  15.5k|                if(u1_sub_mb_mode > B_BI_8x8)
  ------------------
  |  |  468|  15.5k|#define B_BI_8x8        3
  ------------------
  |  Branch (871:20): [True: 3.95k, False: 11.6k]
  ------------------
  872|  3.95k|                {
  873|  3.95k|                    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  874|  3.95k|                }
  875|  15.5k|            }
  876|  2.75k|            else if(!ps_dec->s_high_profile.u1_direct_8x8_inference_flag)
  ------------------
  |  Branch (876:21): [True: 1.09k, False: 1.65k]
  ------------------
  877|  1.09k|            {
  878|  1.09k|                ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
  879|  1.09k|            }
  880|  18.3k|        }
  881|  4.57k|        pi1_ref_idx_l0 -= 4;
  882|  4.57k|        pi1_ref_idx_l1 -= 4;
  883|  4.57k|    }
  884|  8.70k|    else
  885|  8.70k|    {
  886|  8.70k|        UWORD8 u1_mb_pred_mode_part0 = pu1_mb_pred_modes[0][u1_mbpred_mode];
  887|  8.70k|        UWORD8 u1_mb_pred_mode_part1 = pu1_mb_pred_modes[1][u1_mbpred_mode];
  888|  8.70k|        u1_mb_mc_mode = ps_cur_mb_info->u1_mb_mc_mode;
  889|  8.70k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_mc_mode];
  890|       |        /* Storing collocated Mb and SubMb mode information */
  891|  8.70k|        *pu1_col_info++ = (u1_mb_mc_mode << 6);
  892|  8.70k|        if(u1_mb_mc_mode) *pu1_col_info++ = (u1_mb_mc_mode << 6);
  ------------------
  |  Branch (892:12): [True: 3.39k, False: 5.30k]
  ------------------
  893|  8.70k|        u4_mb_mc_mode = u1_mb_mc_mode | (u1_mb_mc_mode << 8);
  894|  8.70k|        u4_mb_mc_mode <<= 16;
  895|  8.70k|        u4_mb_pred_mode = ((u1_mb_pred_mode_part0 << 8) | u1_mb_pred_mode_part1) << 16;
  896|       |
  897|  8.70k|        *pi1_ref_idx_l0++ = (u1_mb_pred_mode_part0 & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|  8.70k|#define PRED_L0   1
  ------------------
  |  Branch (897:29): [True: 2.89k, False: 5.80k]
  ------------------
  898|  8.70k|        *pi1_ref_idx_l0-- = (u1_mb_pred_mode_part1 & PRED_L0) ? u1_dec_ref_l0 : -1;
  ------------------
  |  |  483|  8.70k|#define PRED_L0   1
  ------------------
  |  Branch (898:29): [True: 8.13k, False: 567]
  ------------------
  899|  8.70k|        *pi1_ref_idx_l1++ = (u1_mb_pred_mode_part0 & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|  8.70k|#define PRED_L1   2
  ------------------
  |  Branch (899:29): [True: 6.42k, False: 2.27k]
  ------------------
  900|  8.70k|        *pi1_ref_idx_l1-- = (u1_mb_pred_mode_part1 & PRED_L1) ? u1_dec_ref_l1 : -1;
  ------------------
  |  |  484|  8.70k|#define PRED_L1   2
  ------------------
  |  Branch (900:29): [True: 6.83k, False: 1.86k]
  ------------------
  901|  8.70k|    }
  902|       |
  903|       |    /*Adding SVC extension code to get Motion Prediction Flags*/
  904|  13.2k|    {
  905|  13.2k|        UWORD8 uc_i, u1_mvp_l1, u1_mvp_l0;
  906|  13.2k|        UWORD8 *pu1_motion_pred_flag_l0;
  907|  13.2k|        UWORD8 *pu1_motion_pred_flag_l1;
  908|  13.2k|        WORD8 *pi1_ref_idx;
  909|  13.2k|        WORD8 *pi1_lft_cxt = ps_dec->pi1_left_ref_idx_ctxt_inc;
  910|  13.2k|        WORD8 *pi1_top_cxt = p_curr_ctxt->i1_ref_idx;
  911|       |
  912|  13.2k|        pu1_motion_pred_flag_l0 = &ps_svc_cur_mb_info->au1_motion_pred_flag[0];
  913|  13.2k|        *pu1_motion_pred_flag_l0 = 0;
  914|  13.2k|        pu1_motion_pred_flag_l1 = &ps_svc_cur_mb_info->au1_motion_pred_flag[1];
  915|  13.2k|        *pu1_motion_pred_flag_l1 = 0;
  916|       |
  917|  13.2k|        if(ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (917:12): [True: 13.0k, False: 208]
  ------------------
  918|  13.0k|           ps_svc_slice_params->u1_adaptive_motion_prediction_flag)
  ------------------
  |  Branch (918:12): [True: 11.3k, False: 1.71k]
  ------------------
  919|  11.3k|        {
  920|  11.3k|            pi1_ref_idx = pi1_ref_idx_l0;
  921|  38.6k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++, pi1_ref_idx++)
  ------------------
  |  Branch (921:27): [True: 27.2k, False: 11.3k]
  ------------------
  922|  27.2k|            {
  923|  27.2k|                if(*pi1_ref_idx > 0)
  ------------------
  |  Branch (923:20): [True: 2.40k, False: 24.8k]
  ------------------
  924|  2.40k|                {
  925|  2.40k|                    u1_mvp_l0 = ih264d_decode_bin(0, ps_svc_lyr_dec->ps_motion_prediction_flag_l0,
  926|  2.40k|                                                  ps_bitstrm, ps_cab_env);
  927|  2.40k|                    COPYTHECONTEXT("SVC ext: u1_motion_prediction_flag_l0", u1_mvp_l0);
  928|       |
  929|  2.40k|                    *pu1_motion_pred_flag_l0 |= (u1_mvp_l0 << uc_i);
  930|  2.40k|                    if((u1_mvp_l0 & 0x01))
  ------------------
  |  Branch (930:24): [True: 1.03k, False: 1.36k]
  ------------------
  931|  1.03k|                    {
  932|  1.03k|                        *pi1_ref_idx = -1;
  933|  1.03k|                    }
  934|  2.40k|                }
  935|  27.2k|            }
  936|  11.3k|            pi1_ref_idx = pi1_ref_idx_l1;
  937|  38.6k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++, pi1_ref_idx++)
  ------------------
  |  Branch (937:27): [True: 27.2k, False: 11.3k]
  ------------------
  938|  27.2k|            {
  939|  27.2k|                if(*pi1_ref_idx > 0)
  ------------------
  |  Branch (939:20): [True: 15.9k, False: 11.3k]
  ------------------
  940|  15.9k|                {
  941|  15.9k|                    u1_mvp_l1 = ih264d_decode_bin(0, ps_svc_lyr_dec->ps_motion_prediction_flag_l1,
  942|  15.9k|                                                  ps_bitstrm, ps_cab_env);
  943|  15.9k|                    COPYTHECONTEXT("SVC ext: u1_motion_prediction_flag_l1", u1_mvp_l1);
  944|       |
  945|  15.9k|                    *pu1_motion_pred_flag_l1 |= (u1_mvp_l1 << uc_i);
  946|       |
  947|  15.9k|                    if((u1_mvp_l1 & 0x01))
  ------------------
  |  Branch (947:24): [True: 11.5k, False: 4.36k]
  ------------------
  948|  11.5k|                    {
  949|  11.5k|                        *pi1_ref_idx = -1;
  950|  11.5k|                    }
  951|  15.9k|                }
  952|  27.2k|            }
  953|  11.3k|        }
  954|  1.92k|        else if(ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (954:17): [True: 1.71k, False: 208]
  ------------------
  955|  1.71k|        {
  956|  1.71k|            *pu1_motion_pred_flag_l0 = ps_svc_slice_params->u1_default_motion_prediction_flag
  ------------------
  |  Branch (956:40): [True: 511, False: 1.20k]
  ------------------
  957|  1.71k|                                           ? ((1 << u1_num_mb_part) - 1)
  958|  1.71k|                                           : 0;
  959|  1.71k|            *pu1_motion_pred_flag_l1 = ps_svc_slice_params->u1_default_motion_prediction_flag
  ------------------
  |  Branch (959:40): [True: 511, False: 1.20k]
  ------------------
  960|  1.71k|                                           ? ((1 << u1_num_mb_part) - 1)
  961|  1.71k|                                           : 0;
  962|  1.71k|            if(ps_svc_slice_params->u1_default_motion_prediction_flag)
  ------------------
  |  Branch (962:16): [True: 511, False: 1.20k]
  ------------------
  963|    511|            {
  964|    511|                pi1_ref_idx_l0[0] = -1;
  965|    511|                pi1_ref_idx_l0[1] = -1;
  966|    511|                pi1_ref_idx_l0[2] = -1;
  967|    511|                pi1_ref_idx_l0[3] = -1;
  968|       |
  969|    511|                pi1_ref_idx_l1[0] = -1;
  970|    511|                pi1_ref_idx_l1[1] = -1;
  971|    511|                pi1_ref_idx_l1[2] = -1;
  972|    511|                pi1_ref_idx_l1[3] = -1;
  973|    511|            }
  974|  1.71k|        }
  975|       |
  976|  13.2k|        ret = ih264d_parse_ref_idx_cabac(u1_num_mb_part, 0, u1_dec_ref_l0, u1_mb_mc_mode,
  977|  13.2k|                                         pi1_ref_idx_l0, pi1_lft_cxt, pi1_top_cxt, ps_cab_env,
  978|  13.2k|                                         ps_bitstrm, ps_dec->p_ref_idx_t);
  979|       |
  980|  13.2k|        if(ret != OK)
  ------------------
  |  |  114|  13.2k|#define OK        0
  ------------------
  |  Branch (980:12): [True: 97, False: 13.1k]
  ------------------
  981|     97|        {
  982|     97|            return ret;
  983|     97|        }
  984|  13.1k|        ret = ih264d_parse_ref_idx_cabac(u1_num_mb_part, 2, u1_dec_ref_l1, u1_mb_mc_mode,
  985|  13.1k|                                         pi1_ref_idx_l1, pi1_lft_cxt, pi1_top_cxt, ps_cab_env,
  986|  13.1k|                                         ps_bitstrm, ps_dec->p_ref_idx_t);
  987|       |
  988|  13.1k|        if(ret != OK)
  ------------------
  |  |  114|  13.1k|#define OK        0
  ------------------
  |  Branch (988:12): [True: 107, False: 13.0k]
  ------------------
  989|    107|        {
  990|    107|            return ret;
  991|    107|        }
  992|  13.1k|    }
  993|       |    /* Read MotionVectors */
  994|  13.0k|    {
  995|  13.0k|        const UWORD8 *pu1_top_left_sub_mb_indx;
  996|  13.0k|        UWORD8 uc_j, uc_lx;
  997|  13.0k|        UWORD8 u1_mb_part_wd, u1_mb_part_ht;
  998|       |
  999|  13.0k|        const UWORD8 *pu1_sub_mb_indx_mod =
 1000|  13.0k|            (const UWORD8 *) gau1_ih264d_submb_indx_mod + (u1_sub_mb * 6);
 1001|  13.0k|        const UWORD8 *pu1_sub_mb_partw = (const UWORD8 *) gau1_ih264d_submb_partw;
 1002|  13.0k|        const UWORD8 *pu1_sub_mb_parth = (const UWORD8 *) gau1_ih264d_submb_parth;
 1003|  13.0k|        const UWORD8 *pu1_num_sub_mb_part = (const UWORD8 *) gau1_ih264d_num_submb_part;
 1004|  13.0k|        const UWORD8 *pu1_mb_partw = (const UWORD8 *) gau1_ih264d_mb_partw;
 1005|  13.0k|        const UWORD8 *pu1_mb_parth = (const UWORD8 *) gau1_ih264d_mb_parth;
 1006|       |
 1007|  13.0k|        UWORD8 u1_p_idx = 0;
 1008|  13.0k|        UWORD8 u1_num_submb_part;
 1009|  13.0k|        parse_part_params_t *ps_part;
 1010|  13.0k|        mv_pred_t *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
 1011|  13.0k|        ps_part = ps_dec->ps_part;
 1012|       |
 1013|       |        /* Default initialization for non subMb case */
 1014|  13.0k|        u1_mb_part_wd = pu1_mb_partw[u1_mb_mc_mode];
 1015|  13.0k|        u1_mb_part_ht = pu1_mb_parth[u1_mb_mc_mode];
 1016|  13.0k|        u1_num_submb_part = 1;
 1017|       |
 1018|       |        /* Decoding the MV for the subMB */
 1019|  39.2k|        for(uc_lx = 0; uc_lx < 2; uc_lx++)
  ------------------
  |  Branch (1019:24): [True: 26.1k, False: 13.0k]
  ------------------
 1020|  26.1k|        {
 1021|  26.1k|            UWORD8 u1_sub_mb_num = 0;
 1022|  26.1k|            UWORD32 u4_mb_pred_mode_tmp = u4_mb_pred_mode;
 1023|  26.1k|            UWORD32 u4_mb_mc_mode_tmp = u4_mb_mc_mode;
 1024|  26.1k|            UWORD8 u1_mb_mc_mode_1, u1_pred_mode, uc_i;
 1025|  26.1k|            UWORD16 u2_sub_mb_num = 0x028A;
 1026|  26.1k|            UWORD8 u1_b2 = uc_lx << 1;
 1027|  26.1k|            u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  484|  13.0k|#define PRED_L1   2
  ------------------
                          u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  483|  39.2k|#define PRED_L0   1
  ------------------
  |  Branch (1027:28): [True: 13.0k, False: 13.0k]
  ------------------
 1028|       |            /* Default for Cabac */
 1029|  26.1k|            pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode << 1);
 1030|  86.1k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (1030:27): [True: 59.9k, False: 26.1k]
  ------------------
 1031|  59.9k|            {
 1032|  59.9k|                WORD8 i1_pred = (UWORD8) (u4_mb_pred_mode_tmp >> 24);
 1033|  59.9k|                u1_mb_mc_mode_1 = (UWORD8) (u4_mb_mc_mode_tmp >> 24);
 1034|  59.9k|                u4_mb_pred_mode_tmp <<= 8;
 1035|  59.9k|                u4_mb_mc_mode_tmp <<= 8;
 1036|       |
 1037|       |                /* subMb prediction mode */
 1038|  59.9k|                if(u1_sub_mb)
  ------------------
  |  Branch (1038:20): [True: 36.5k, False: 23.4k]
  ------------------
 1039|  36.5k|                {
 1040|  36.5k|                    u1_mb_part_wd = pu1_sub_mb_partw[u1_mb_mc_mode_1];
 1041|  36.5k|                    u1_mb_part_ht = pu1_sub_mb_parth[u1_mb_mc_mode_1];
 1042|  36.5k|                    u1_sub_mb_num = u2_sub_mb_num >> 12;
 1043|  36.5k|                    pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode_1 << 1);
 1044|  36.5k|                    u1_num_submb_part = pu1_num_sub_mb_part[u1_mb_mc_mode_1];
 1045|  36.5k|                    u2_sub_mb_num = u2_sub_mb_num << 4;
 1046|  36.5k|                }
 1047|       |
 1048|   129k|                for(uc_j = 0; uc_j < u1_num_submb_part; uc_j++, pu1_top_left_sub_mb_indx++)
  ------------------
  |  Branch (1048:31): [True: 69.9k, False: 59.9k]
  ------------------
 1049|  69.9k|                {
 1050|  69.9k|                    mv_pred_t *ps_mv;
 1051|  69.9k|                    u1_sub_mb_num = u1_sub_mb_num + *pu1_top_left_sub_mb_indx;
 1052|  69.9k|                    ps_mv = ps_mv_start + u1_sub_mb_num;
 1053|       |
 1054|       |                    /* Storing Info for partitions, writing only once */
 1055|  69.9k|                    if(uc_lx)
  ------------------
  |  Branch (1055:24): [True: 34.9k, False: 34.9k]
  ------------------
 1056|  34.9k|                    {
 1057|  34.9k|                        ps_part->u1_is_direct = (!i1_pred);
 1058|  34.9k|                        ps_part->u1_pred_mode = i1_pred;
 1059|  34.9k|                        ps_part->u1_sub_mb_num = u1_sub_mb_num;
 1060|  34.9k|                        ps_part->u1_partheight = u1_mb_part_ht;
 1061|  34.9k|                        ps_part->u1_partwidth = u1_mb_part_wd;
 1062|       |
 1063|       |                        /* Increment partition Index */
 1064|  34.9k|                        u1_p_idx++;
 1065|  34.9k|                        ps_part++;
 1066|  34.9k|                    }
 1067|       |
 1068|  69.9k|                    ih264d_get_mvd_cabac(u1_sub_mb_num, u1_b2, u1_mb_part_wd, u1_mb_part_ht,
 1069|  69.9k|                                         (UWORD8) (i1_pred & u1_pred_mode), ps_dec, ps_mv);
 1070|  69.9k|                }
 1071|  59.9k|            }
 1072|  26.1k|        }
 1073|       |        /* write back to the scratch partition info */
 1074|  13.0k|        ps_dec->ps_part = ps_part;
 1075|  13.0k|        ps_parse_mb_data->u1_num_part = u1_sub_mb ? u1_p_idx : u1_num_mb_part;
  ------------------
  |  Branch (1075:41): [True: 4.56k, False: 8.50k]
  ------------------
 1076|  13.0k|    }
 1077|       |
 1078|  13.0k|    return OK;
  ------------------
  |  |  114|  13.0k|#define OK        0
  ------------------
 1079|  13.1k|}
isvcd_parse_bmb_non_direct_cavlc:
 1097|  16.3k|{
 1098|  16.3k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1099|  16.3k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1100|  16.3k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1101|  16.3k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 1102|  16.3k|    UWORD8 *pu1_sub_mb_pred_modes = (UWORD8 *) (gau1_ih264d_submb_pred_modes) + 4;
 1103|  16.3k|    const UWORD8(*pu1_mb_pred_modes)[32] = (const UWORD8(*)[32]) gau1_ih264d_mb_pred_modes;
 1104|  16.3k|    const UWORD8 *pu1_num_mb_part = (const UWORD8 *) gau1_ih264d_num_mb_part;
 1105|  16.3k|    const UWORD8 *pu1_sub_mb_mc_mode = (const UWORD8 *) (gau1_ih264d_submb_mc_mode) + 4;
 1106|  16.3k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data + u4_num_mbsNby2;
 1107|  16.3k|    UWORD8 *pu1_col_info = ps_parse_mb_data->u1_col_info;
 1108|  16.3k|    WORD8(*pi1_ref_idx)[MAX_REFIDX_INFO_PER_MB] = ps_parse_mb_data->i1_ref_idx;
 1109|  16.3k|    UWORD8 u1_mb_type = ps_cur_mb_info->u1_mb_type;
 1110|  16.3k|    UWORD8 u1_mb_mc_mode, u1_num_mb_part, u1_sub_mb = !(u1_mb_type ^ B_8x8);
  ------------------
  |  |  480|  16.3k|#define B_8x8    22
  ------------------
 1111|  16.3k|    UWORD32 u4_mb_mc_mode = 0, u4_mb_pred_mode = 0;
 1112|  16.3k|    WORD32 ret = OK;
  ------------------
  |  |  114|  16.3k|#define OK        0
  ------------------
 1113|  16.3k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1114|  16.3k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1115|       |
 1116|  16.3k|    if(u1_sub_mb)
  ------------------
  |  Branch (1116:8): [True: 1.50k, False: 14.8k]
  ------------------
 1117|  1.50k|    {
 1118|  1.50k|        UWORD8 uc_i;
 1119|  1.50k|        u1_mb_mc_mode = 0;
 1120|  1.50k|        u1_num_mb_part = 4;
 1121|       |        /* Reading the subMB type */
 1122|  7.18k|        for(uc_i = 0; uc_i < 4; uc_i++)
  ------------------
  |  Branch (1122:23): [True: 5.84k, False: 1.34k]
  ------------------
 1123|  5.84k|        {
 1124|  5.84k|            UWORD32 ui_sub_mb_mode;
 1125|       |            // Inlined ih264d_uev
 1126|  5.84k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 1127|  5.84k|            UWORD32 u4_word, u4_ldz;
 1128|       |
 1129|       |            /***************************************************************/
 1130|       |            /* Find leading zeros in next 32 bits                          */
 1131|       |            /***************************************************************/
 1132|  5.84k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  5.84k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  5.84k|{                                                                           \
  |  |  152|  5.84k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  5.84k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  5.84k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  5.84k|                                                                            \
  |  |  156|  5.84k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  5.84k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 5.45k, False: 390]
  |  |  ------------------
  |  |  158|  5.84k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  5.45k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  5.84k|}
  ------------------
 1133|  5.84k|            u4_ldz = CLZ(u4_word);
 1134|       |            /* Flush the ps_bitstrm */
 1135|  5.84k|            u4_bitstream_offset += (u4_ldz + 1);
 1136|       |            /* Read the suffix from the ps_bitstrm */
 1137|  5.84k|            u4_word = 0;
 1138|  5.84k|            if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  3.15k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  3.15k|{                                                                           \
  |  |  122|  3.15k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  3.15k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  3.15k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  3.15k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  3.15k|                                                                            \
  |  |  127|  3.15k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.79k, False: 361]
  |  |  ------------------
  |  |  128|  3.15k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.79k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  3.15k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  3.15k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  3.15k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  3.15k|}                                                                           \
  ------------------
  |  Branch (1138:16): [True: 3.15k, False: 2.68k]
  ------------------
 1139|  5.84k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
 1140|  5.84k|            ui_sub_mb_mode = ((1 << u4_ldz) + u4_word - 1);
 1141|       |            // Inlined ih264d_uev
 1142|  5.84k|            if(ui_sub_mb_mode > 12)
  ------------------
  |  Branch (1142:16): [True: 158, False: 5.68k]
  ------------------
 1143|    158|                return ERROR_SUB_MB_TYPE;
 1144|  5.68k|            else
 1145|  5.68k|            {
 1146|  5.68k|                UWORD8 u1_subMbPredMode = pu1_sub_mb_pred_modes[ui_sub_mb_mode];
 1147|  5.68k|                u4_mb_mc_mode = (u4_mb_mc_mode << 8) | pu1_sub_mb_mc_mode[ui_sub_mb_mode];
 1148|  5.68k|                u4_mb_pred_mode = (u4_mb_pred_mode << 8) | u1_subMbPredMode;
 1149|  5.68k|                pi1_ref_idx[0][uc_i] = ((u1_subMbPredMode & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  5.68k|#define PRED_L0   1
  ------------------
 1150|  5.68k|                pi1_ref_idx[1][uc_i] = ((u1_subMbPredMode & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  5.68k|#define PRED_L1   2
  ------------------
 1151|  5.68k|                COPYTHECONTEXT("sub_mb_type", u1_subMbPredMode);
 1152|  5.68k|            }
 1153|       |            /* Storing collocated Mb and SubMb mode information */
 1154|  5.68k|            *pu1_col_info++ = ((PRED_8x8) << 6) | ((pu1_sub_mb_mc_mode[ui_sub_mb_mode] << 4));
  ------------------
  |  |  453|  5.68k|#define PRED_8x8    3
  ------------------
 1155|  5.68k|            if(ui_sub_mb_mode != B_DIRECT_8x8)
  ------------------
  |  |  465|  5.68k|#define B_DIRECT_8x8    0
  ------------------
  |  Branch (1155:16): [True: 2.99k, False: 2.68k]
  ------------------
 1156|  2.99k|            {
 1157|  2.99k|                if(ui_sub_mb_mode > B_BI_8x8)
  ------------------
  |  |  468|  2.99k|#define B_BI_8x8        3
  ------------------
  |  Branch (1157:20): [True: 761, False: 2.23k]
  ------------------
 1158|    761|                {
 1159|    761|                    ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
 1160|    761|                }
 1161|  2.99k|            }
 1162|  2.68k|            else if(!ps_dec->s_high_profile.u1_direct_8x8_inference_flag)
  ------------------
  |  Branch (1162:21): [True: 2.12k, False: 566]
  ------------------
 1163|  2.12k|            {
 1164|  2.12k|                ps_dec->s_high_profile.u1_no_submb_part_size_lt8x8_flag = 0;
 1165|  2.12k|            }
 1166|  5.68k|        }
 1167|  1.50k|    }
 1168|  14.8k|    else
 1169|  14.8k|    {
 1170|  14.8k|        UWORD8 u1_mb_pred_mode_idx = 5 + u1_mb_type;
 1171|  14.8k|        UWORD8 u1_mb_pred_mode_part0 = pu1_mb_pred_modes[0][u1_mb_pred_mode_idx];
 1172|  14.8k|        UWORD8 u1_mb_pred_mode_part1 = pu1_mb_pred_modes[1][u1_mb_pred_mode_idx];
 1173|  14.8k|        u1_mb_mc_mode = ps_cur_mb_info->u1_mb_mc_mode;
 1174|  14.8k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_mc_mode];
 1175|       |
 1176|  14.8k|        pi1_ref_idx[0][0] = ((u1_mb_pred_mode_part0 & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  14.8k|#define PRED_L0   1
  ------------------
 1177|  14.8k|        pi1_ref_idx[1][0] = ((u1_mb_pred_mode_part0 & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  14.8k|#define PRED_L1   2
  ------------------
 1178|  14.8k|        pi1_ref_idx[0][1] = ((u1_mb_pred_mode_part1 & PRED_L0) - 1) >> 1;
  ------------------
  |  |  483|  14.8k|#define PRED_L0   1
  ------------------
 1179|  14.8k|        pi1_ref_idx[1][1] = ((u1_mb_pred_mode_part1 & PRED_L1) - 1) >> 1;
  ------------------
  |  |  484|  14.8k|#define PRED_L1   2
  ------------------
 1180|       |
 1181|  14.8k|        u4_mb_pred_mode = (u1_mb_pred_mode_part0 << 8) | u1_mb_pred_mode_part1;
 1182|  14.8k|        u4_mb_mc_mode = u1_mb_mc_mode | (u1_mb_mc_mode << 8);
 1183|  14.8k|        u4_mb_mc_mode <<= 16;
 1184|  14.8k|        u4_mb_pred_mode <<= 16;
 1185|       |
 1186|       |        /* Storing collocated Mb and SubMb mode information */
 1187|  14.8k|        *pu1_col_info++ = (u1_mb_mc_mode << 6);
 1188|  14.8k|        if(u1_mb_mc_mode) *pu1_col_info++ = (u1_mb_mc_mode << 6);
  ------------------
  |  Branch (1188:12): [True: 7.35k, False: 7.45k]
  ------------------
 1189|  14.8k|    }
 1190|       |
 1191|  16.1k|    {
 1192|  16.1k|        UWORD8 uc_i;
 1193|  16.1k|        UWORD8 *pu1_motion_pred_flag_l0;
 1194|  16.1k|        UWORD8 *pu1_motion_pred_flag_l1;
 1195|  16.1k|        UWORD8 u1_mvp_l1;
 1196|  16.1k|        UWORD8 u1_mvp_l0;
 1197|       |
 1198|  16.1k|        pu1_motion_pred_flag_l0 = &ps_svc_cur_mb_info->au1_motion_pred_flag[0];
 1199|  16.1k|        *pu1_motion_pred_flag_l0 = 0;
 1200|  16.1k|        pu1_motion_pred_flag_l1 = &ps_svc_cur_mb_info->au1_motion_pred_flag[1];
 1201|  16.1k|        *pu1_motion_pred_flag_l1 = 0;
 1202|       |
 1203|  16.1k|        if(ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (1203:12): [True: 16.0k, False: 121]
  ------------------
 1204|  16.0k|           ps_svc_slice_params->u1_adaptive_motion_prediction_flag)
  ------------------
  |  Branch (1204:12): [True: 7.11k, False: 8.90k]
  ------------------
 1205|  7.11k|        {
 1206|  20.0k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (1206:27): [True: 12.9k, False: 7.11k]
  ------------------
 1207|  12.9k|            {
 1208|  12.9k|                if(pi1_ref_idx[0][uc_i] > -1)
  ------------------
  |  Branch (1208:20): [True: 8.76k, False: 4.18k]
  ------------------
 1209|  8.76k|                {
 1210|  8.76k|                    u1_mvp_l0 = ih264d_get_bit_h264(ps_bitstrm);
 1211|  8.76k|                    COPYTHECONTEXT("SVC ext: ps_motion_prediction_flag_l0", u1_mvp_l0);
 1212|  8.76k|                    *pu1_motion_pred_flag_l0 |= (u1_mvp_l0 << uc_i);
 1213|  8.76k|                }
 1214|  12.9k|            }
 1215|       |
 1216|  20.0k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (1216:27): [True: 12.9k, False: 7.11k]
  ------------------
 1217|  12.9k|            {
 1218|  12.9k|                if(pi1_ref_idx[1][uc_i] > -1)
  ------------------
  |  Branch (1218:20): [True: 2.36k, False: 10.5k]
  ------------------
 1219|  2.36k|                {
 1220|  2.36k|                    u1_mvp_l1 = ih264d_get_bit_h264(ps_bitstrm);
 1221|  2.36k|                    COPYTHECONTEXT("SVC ext: ps_motion_prediction_flag_l1", u1_mvp_l1);
 1222|  2.36k|                    *pu1_motion_pred_flag_l1 |= (u1_mvp_l1 << uc_i);
 1223|  2.36k|                }
 1224|  12.9k|            }
 1225|  7.11k|        }
 1226|  9.03k|        else if(ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1226:17): [True: 8.90k, False: 121]
  ------------------
 1227|  8.90k|        {
 1228|  8.90k|            *pu1_motion_pred_flag_l0 = ps_svc_slice_params->u1_default_motion_prediction_flag
  ------------------
  |  Branch (1228:40): [True: 2.48k, False: 6.42k]
  ------------------
 1229|  8.90k|                                           ? ((1 << u1_num_mb_part) - 1)
 1230|  8.90k|                                           : 0;
 1231|  8.90k|            *pu1_motion_pred_flag_l1 = ps_svc_slice_params->u1_default_motion_prediction_flag
  ------------------
  |  Branch (1231:40): [True: 2.48k, False: 6.42k]
  ------------------
 1232|  8.90k|                                           ? ((1 << u1_num_mb_part) - 1)
 1233|  8.90k|                                           : 0;
 1234|  8.90k|        }
 1235|       |
 1236|  16.1k|        {
 1237|  16.1k|            UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 1238|  16.1k|            UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
 1239|  16.1k|            UWORD8 *pu1_num_ref_idx_lx_active = ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active;
 1240|  16.1k|            const UWORD8 u1_mbaff_field = (u1_mbaff & uc_field);
 1241|  16.1k|            UWORD8 u4_num_ref_idx_lx_active;
 1242|       |
 1243|  16.1k|            u4_num_ref_idx_lx_active = (pu1_num_ref_idx_lx_active[0] << u1_mbaff_field) - 1;
 1244|       |
 1245|  16.1k|            if(u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (1245:16): [True: 11.6k, False: 4.54k]
  ------------------
 1246|  11.6k|            {
 1247|  11.6k|                if(1 == u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (1247:20): [True: 3.16k, False: 8.44k]
  ------------------
 1248|  3.16k|                    isvcd_parse_bmb_ref_index_cavlc_range1(u1_num_mb_part, ps_bitstrm,
 1249|  3.16k|                                                           pi1_ref_idx[0], u4_num_ref_idx_lx_active,
 1250|  3.16k|                                                           pu1_motion_pred_flag_l0);
 1251|  8.44k|                else
 1252|  8.44k|                {
 1253|  8.44k|                    isvcd_parse_bmb_ref_index_cavlc(u1_num_mb_part, ps_bitstrm, pi1_ref_idx[0],
 1254|  8.44k|                                                    u4_num_ref_idx_lx_active,
 1255|  8.44k|                                                    pu1_motion_pred_flag_l0);
 1256|  8.44k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  8.44k|#define OK        0
  ------------------
  |  Branch (1256:24): [True: 0, False: 8.44k]
  ------------------
 1257|  8.44k|                }
 1258|  11.6k|            }
 1259|       |
 1260|  16.1k|            u4_num_ref_idx_lx_active = (pu1_num_ref_idx_lx_active[1] << u1_mbaff_field) - 1;
 1261|       |
 1262|  16.1k|            if(u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (1262:16): [True: 9.90k, False: 6.24k]
  ------------------
 1263|  9.90k|            {
 1264|  9.90k|                if(1 == u4_num_ref_idx_lx_active)
  ------------------
  |  Branch (1264:20): [True: 3.65k, False: 6.25k]
  ------------------
 1265|  3.65k|                    isvcd_parse_bmb_ref_index_cavlc_range1(u1_num_mb_part, ps_bitstrm,
 1266|  3.65k|                                                           pi1_ref_idx[1], u4_num_ref_idx_lx_active,
 1267|  3.65k|                                                           pu1_motion_pred_flag_l1);
 1268|  6.25k|                else
 1269|  6.25k|                {
 1270|  6.25k|                    ret = isvcd_parse_bmb_ref_index_cavlc(u1_num_mb_part, ps_bitstrm,
 1271|  6.25k|                                                          pi1_ref_idx[1], u4_num_ref_idx_lx_active,
 1272|  6.25k|                                                          pu1_motion_pred_flag_l1);
 1273|  6.25k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  6.25k|#define OK        0
  ------------------
  |  Branch (1273:24): [True: 155, False: 6.09k]
  ------------------
 1274|  6.25k|                }
 1275|  9.90k|            }
 1276|  16.1k|        }
 1277|  16.1k|    }
 1278|       |    /* Read MotionVectors */
 1279|  15.9k|    {
 1280|  15.9k|        const UWORD8 *pu1_top_left_sub_mb_indx;
 1281|  15.9k|        const UWORD8 *pu1_sub_mb_indx_mod =
 1282|  15.9k|            (const UWORD8 *) (gau1_ih264d_submb_indx_mod) + (u1_sub_mb * 6);
 1283|  15.9k|        const UWORD8 *pu1_sub_mb_partw = (const UWORD8 *) gau1_ih264d_submb_partw;
 1284|  15.9k|        const UWORD8 *pu1_sub_mb_parth = (const UWORD8 *) gau1_ih264d_submb_parth;
 1285|  15.9k|        const UWORD8 *pu1_num_sub_mb_part = (const UWORD8 *) gau1_ih264d_num_submb_part;
 1286|  15.9k|        const UWORD8 *pu1_mb_partw = (const UWORD8 *) gau1_ih264d_mb_partw;
 1287|  15.9k|        const UWORD8 *pu1_mb_parth = (const UWORD8 *) gau1_ih264d_mb_parth;
 1288|  15.9k|        UWORD8 u1_p_idx = 0, u1_num_submb_part, uc_lx;
 1289|  15.9k|        parse_part_params_t *ps_part;
 1290|  15.9k|        mv_pred_t *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
 1291|  15.9k|        UWORD8 u1_mb_part_wd, u1_mb_part_ht;
 1292|       |
 1293|  15.9k|        ps_part = ps_dec->ps_part;
 1294|       |        /* Default Initialization for Non subMb Case Mode */
 1295|  15.9k|        u1_mb_part_wd = pu1_mb_partw[u1_mb_mc_mode];
 1296|  15.9k|        u1_mb_part_ht = pu1_mb_parth[u1_mb_mc_mode];
 1297|  15.9k|        u1_num_submb_part = 1;
 1298|       |
 1299|       |        /* Decoding the MV for the subMB */
 1300|  47.9k|        for(uc_lx = 0; uc_lx < 2; uc_lx++)
  ------------------
  |  Branch (1300:24): [True: 31.9k, False: 15.9k]
  ------------------
 1301|  31.9k|        {
 1302|  31.9k|            UWORD8 u1_sub_mb_num = 0, u1_pred_mode, uc_i;
 1303|  31.9k|            UWORD32 u4_mb_mc_mode_tmp = u4_mb_mc_mode;
 1304|  31.9k|            UWORD32 u4_mb_pred_mode_tmp = u4_mb_pred_mode;
 1305|  31.9k|            UWORD16 u2_sub_mb_num = 0x028A;  // for sub mb case
 1306|  31.9k|            UWORD8 u1_b2 = uc_lx << 1;
 1307|  31.9k|            u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  484|  15.9k|#define PRED_L1   2
  ------------------
                          u1_pred_mode = (uc_lx) ? PRED_L1 : PRED_L0;
  ------------------
  |  |  483|  47.9k|#define PRED_L0   1
  ------------------
  |  Branch (1307:28): [True: 15.9k, False: 15.9k]
  ------------------
 1308|  31.9k|            pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode << 1);
 1309|       |
 1310|  86.4k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (1310:27): [True: 54.5k, False: 31.9k]
  ------------------
 1311|  54.5k|            {
 1312|  54.5k|                UWORD8 u1_mb_mc_mode, uc_j;
 1313|  54.5k|                UWORD8 i1_pred = u4_mb_pred_mode_tmp >> 24;
 1314|  54.5k|                u1_mb_mc_mode = u4_mb_mc_mode_tmp >> 24;
 1315|  54.5k|                u4_mb_pred_mode_tmp <<= 8;
 1316|  54.5k|                u4_mb_mc_mode_tmp <<= 8;
 1317|       |                /* subMb prediction mode */
 1318|  54.5k|                if(u1_sub_mb)
  ------------------
  |  Branch (1318:20): [True: 10.7k, False: 43.7k]
  ------------------
 1319|  10.7k|                {
 1320|  10.7k|                    u1_mb_part_wd = pu1_sub_mb_partw[u1_mb_mc_mode];
 1321|  10.7k|                    u1_mb_part_ht = pu1_sub_mb_parth[u1_mb_mc_mode];
 1322|  10.7k|                    u1_sub_mb_num = u2_sub_mb_num >> 12;
 1323|  10.7k|                    u1_num_submb_part = pu1_num_sub_mb_part[u1_mb_mc_mode];
 1324|  10.7k|                    pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_mc_mode << 1);
 1325|  10.7k|                    u2_sub_mb_num <<= 4;
 1326|  10.7k|                }
 1327|   112k|                for(uc_j = 0; uc_j < u1_num_submb_part; uc_j++, pu1_top_left_sub_mb_indx++)
  ------------------
  |  Branch (1327:31): [True: 57.9k, False: 54.5k]
  ------------------
 1328|  57.9k|                {
 1329|  57.9k|                    mv_pred_t *ps_mv;
 1330|  57.9k|                    u1_sub_mb_num = u1_sub_mb_num + *pu1_top_left_sub_mb_indx;
 1331|  57.9k|                    ps_mv = ps_mv_start + u1_sub_mb_num;
 1332|       |
 1333|       |                    /* Storing Info for partitions, writing only once */
 1334|  57.9k|                    if(uc_lx)
  ------------------
  |  Branch (1334:24): [True: 28.9k, False: 28.9k]
  ------------------
 1335|  28.9k|                    {
 1336|  28.9k|                        ps_part->u1_is_direct = (!i1_pred);
 1337|  28.9k|                        ps_part->u1_pred_mode = i1_pred;
 1338|  28.9k|                        ps_part->u1_sub_mb_num = u1_sub_mb_num;
 1339|  28.9k|                        ps_part->u1_partheight = u1_mb_part_ht;
 1340|  28.9k|                        ps_part->u1_partwidth = u1_mb_part_wd;
 1341|       |                        /* Increment partition Index */
 1342|  28.9k|                        u1_p_idx++;
 1343|  28.9k|                        ps_part++;
 1344|  28.9k|                    }
 1345|       |
 1346|  57.9k|                    if(i1_pred & u1_pred_mode)
  ------------------
  |  Branch (1346:24): [True: 27.6k, False: 30.2k]
  ------------------
 1347|  27.6k|                    {
 1348|  27.6k|                        WORD16 i2_mvx, i2_mvy;
 1349|       |                        // inlining ih264d_sev
 1350|  27.6k|                        {
 1351|  27.6k|                            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 1352|  27.6k|                            UWORD32 u4_word, u4_ldz, u4_abs_val;
 1353|       |
 1354|       |                            /***************************************************************/
 1355|       |                            /* Find leading zeros in next 32 bits                          */
 1356|       |                            /***************************************************************/
 1357|  27.6k|                            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  27.6k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  27.6k|{                                                                           \
  |  |  152|  27.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  27.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  27.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  27.6k|                                                                            \
  |  |  156|  27.6k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  27.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 26.9k, False: 707]
  |  |  ------------------
  |  |  158|  27.6k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  26.9k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  27.6k|}
  ------------------
 1358|  27.6k|                            u4_ldz = CLZ(u4_word);
 1359|       |
 1360|       |                            /* Flush the ps_bitstrm */
 1361|  27.6k|                            u4_bitstream_offset += (u4_ldz + 1);
 1362|       |
 1363|       |                            /* Read the suffix from the ps_bitstrm */
 1364|  27.6k|                            u4_word = 0;
 1365|  27.6k|                            if(u4_ldz)
  ------------------
  |  Branch (1365:32): [True: 12.4k, False: 15.2k]
  ------------------
 1366|  12.4k|                                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  12.4k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  12.4k|{                                                                           \
  |  |  122|  12.4k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  12.4k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  12.4k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  12.4k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  12.4k|                                                                            \
  |  |  127|  12.4k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 11.8k, False: 568]
  |  |  ------------------
  |  |  128|  12.4k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  11.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  12.4k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  12.4k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  12.4k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  12.4k|}                                                                           \
  ------------------
 1367|       |
 1368|  27.6k|                            *pu4_bitstrm_ofst = u4_bitstream_offset;
 1369|  27.6k|                            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
 1370|       |
 1371|  27.6k|                            if(u4_word & 0x1)
  ------------------
  |  Branch (1371:32): [True: 9.61k, False: 18.0k]
  ------------------
 1372|  9.61k|                                i2_mvx = (-(WORD32) u4_abs_val);
 1373|  18.0k|                            else
 1374|  18.0k|                                i2_mvx = (u4_abs_val);
 1375|  27.6k|                        }
 1376|       |                        // inlinined ih264d_sev
 1377|  27.6k|                        {
 1378|  27.6k|                            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 1379|  27.6k|                            UWORD32 u4_word, u4_ldz, u4_abs_val;
 1380|       |
 1381|       |                            /***************************************************************/
 1382|       |                            /* Find leading zeros in next 32 bits                          */
 1383|       |                            /***************************************************************/
 1384|  27.6k|                            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  27.6k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  27.6k|{                                                                           \
  |  |  152|  27.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  27.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  27.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  27.6k|                                                                            \
  |  |  156|  27.6k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  27.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 26.3k, False: 1.29k]
  |  |  ------------------
  |  |  158|  27.6k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  26.3k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  27.6k|}
  ------------------
 1385|  27.6k|                            u4_ldz = CLZ(u4_word);
 1386|       |
 1387|       |                            /* Flush the ps_bitstrm */
 1388|  27.6k|                            u4_bitstream_offset += (u4_ldz + 1);
 1389|       |
 1390|       |                            /* Read the suffix from the ps_bitstrm */
 1391|  27.6k|                            u4_word = 0;
 1392|  27.6k|                            if(u4_ldz)
  ------------------
  |  Branch (1392:32): [True: 15.3k, False: 12.3k]
  ------------------
 1393|  15.3k|                                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  15.3k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  15.3k|{                                                                           \
  |  |  122|  15.3k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  15.3k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  15.3k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  15.3k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  15.3k|                                                                            \
  |  |  127|  15.3k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 14.3k, False: 914]
  |  |  ------------------
  |  |  128|  15.3k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  14.3k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  15.3k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  15.3k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  15.3k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  15.3k|}                                                                           \
  ------------------
 1394|       |
 1395|  27.6k|                            *pu4_bitstrm_ofst = u4_bitstream_offset;
 1396|  27.6k|                            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
 1397|       |
 1398|  27.6k|                            if(u4_word & 0x1)
  ------------------
  |  Branch (1398:32): [True: 7.29k, False: 20.3k]
  ------------------
 1399|  7.29k|                                i2_mvy = (-(WORD32) u4_abs_val);
 1400|  20.3k|                            else
 1401|  20.3k|                                i2_mvy = (u4_abs_val);
 1402|  27.6k|                        }
 1403|       |                        // inlinined ih264d_sev
 1404|       |                        /* Storing Mv residuals */
 1405|  27.6k|                        ps_mv->i2_mv[u1_b2] = i2_mvx;
 1406|  27.6k|                        ps_mv->i2_mv[u1_b2 + 1] = i2_mvy;
 1407|  27.6k|                    }
 1408|  57.9k|                }
 1409|  54.5k|            }
 1410|  31.9k|        }
 1411|       |        /* write back to the scratch partition info */
 1412|  15.9k|        ps_dec->ps_part = ps_part;
 1413|  15.9k|        ps_parse_mb_data->u1_num_part = u1_sub_mb ? u1_p_idx : u1_num_mb_part;
  ------------------
  |  Branch (1413:41): [True: 1.34k, False: 14.6k]
  ------------------
 1414|  15.9k|    }
 1415|  15.9k|    return OK;
  ------------------
  |  |  114|  15.9k|#define OK        0
  ------------------
 1416|  16.1k|}
isvcd_parse_ebslice:
 1431|  13.2k|{
 1432|  13.2k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1433|  13.2k|    WORD32 i_status = OK;
  ------------------
  |  |  114|  13.2k|#define OK        0
  ------------------
 1434|  13.2k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1435|  13.2k|    dec_slice_params_t *ps_slice = ps_dec->ps_cur_slice;
 1436|  13.2k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1437|  13.2k|    dec_svc_seq_params_t *ps_subset_seq;
 1438|  13.2k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1439|  13.2k|    dec_subset_seq_params_t *ps_sps_svc_ext = NULL;
 1440|  13.2k|    dec_nal_unit_svc_ext_params_t *ps_nal_svc_ext = NULL;
 1441|  13.2k|    UWORD8 u1_ref_idx_re_flag_lx;
 1442|  13.2k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1443|  13.2k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 1444|  13.2k|    UWORD64 u8_ref_idx_l0, u8_ref_idx_l1;
 1445|  13.2k|    UWORD32 u4_temp;
 1446|  13.2k|    WORD32 i_temp;
 1447|  13.2k|    WORD32 ret;
 1448|       |
 1449|  13.2k|    ps_nal_svc_ext = ps_svc_lyr_dec->ps_nal_svc_ext;
 1450|  13.2k|    ps_subset_seq = ps_svc_lyr_dec->ps_cur_subset_sps;
 1451|  13.2k|    ps_sps_svc_ext = &ps_subset_seq->s_sps_svc_ext;
 1452|  13.2k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1453|       |
 1454|       |    /*--------------------------------------------------------------------*/
 1455|       |    /* Read remaining contents of the slice header                        */
 1456|       |    /*--------------------------------------------------------------------*/
 1457|  13.2k|    {
 1458|  13.2k|        WORD8 *pi1_buf;
 1459|  13.2k|        WORD16 *pi2_mv = ps_dec->s_default_mv_pred.i2_mv;
 1460|  13.2k|        WORD32 *pi4_mv = (WORD32 *) pi2_mv;
 1461|  13.2k|        WORD16 *pi16_refFrame;
 1462|  13.2k|        pi1_buf = ps_dec->s_default_mv_pred.i1_ref_frame;
 1463|  13.2k|        pi16_refFrame = (WORD16 *) pi1_buf;
 1464|  13.2k|        *pi4_mv = 0;
 1465|  13.2k|        *(pi4_mv + 1) = 0;
 1466|  13.2k|        *pi16_refFrame = OUT_OF_RANGE_REF;
  ------------------
  |  |   45|  13.2k|#define OUT_OF_RANGE_REF  -1
  ------------------
 1467|  13.2k|        ps_dec->s_default_mv_pred.u1_col_ref_pic_idx = (UWORD8) -1;
 1468|  13.2k|        ps_dec->s_default_mv_pred.u1_pic_type = (UWORD8) -1;
 1469|  13.2k|    }
 1470|       |
 1471|  13.2k|    if(0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id)
  ------------------
  |  Branch (1471:8): [True: 13.2k, False: 0]
  ------------------
 1472|  13.2k|    {
 1473|  13.2k|        ps_slice->u1_num_ref_idx_active_override_flag = ih264d_get_bit_h264(ps_bitstrm);
 1474|  13.2k|        COPYTHECONTEXT("Slice Header SVC ext: num_ref_idx_override_flag",
 1475|  13.2k|                       ps_slice->u1_num_ref_idx_active_override_flag);
 1476|       |
 1477|  13.2k|        u8_ref_idx_l0 = ps_dec->ps_cur_pps->u1_num_ref_idx_lx_active[0];
 1478|  13.2k|        u8_ref_idx_l1 = ps_dec->ps_cur_pps->u1_num_ref_idx_lx_active[1];
 1479|  13.2k|        if(ps_slice->u1_num_ref_idx_active_override_flag)
  ------------------
  |  Branch (1479:12): [True: 7.25k, False: 6.03k]
  ------------------
 1480|  7.25k|        {
 1481|  7.25k|            u8_ref_idx_l0 = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1482|  7.25k|            COPYTHECONTEXT("Slice Header SVC ext: num_ref_idx_l0_active_minus1", u8_ref_idx_l0 - 1);
 1483|       |
 1484|  7.25k|            u8_ref_idx_l1 = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1485|  7.25k|            COPYTHECONTEXT("Slice Header SVC ext: num_ref_idx_l1_active_minus1", u8_ref_idx_l1 - 1);
 1486|  7.25k|        }
 1487|       |
 1488|  13.2k|        {
 1489|  13.2k|            UWORD8 u1_max_ref_idx = H264_MAX_REF_PICS;
  ------------------
  |  |  534|  13.2k|#define H264_MAX_REF_PICS         16
  ------------------
 1490|  13.2k|            if(ps_slice->u1_field_pic_flag)
  ------------------
  |  Branch (1490:16): [True: 0, False: 13.2k]
  ------------------
 1491|      0|            {
 1492|      0|                u1_max_ref_idx = H264_MAX_REF_PICS << 1;
  ------------------
  |  |  534|      0|#define H264_MAX_REF_PICS         16
  ------------------
 1493|      0|            }
 1494|  13.2k|            if((u8_ref_idx_l0 >= u1_max_ref_idx) || (u8_ref_idx_l1 >= u1_max_ref_idx))
  ------------------
  |  Branch (1494:16): [True: 194, False: 13.0k]
  |  Branch (1494:53): [True: 266, False: 12.8k]
  ------------------
 1495|    460|            {
 1496|    460|                return ERROR_NUM_REF;
 1497|    460|            }
 1498|  12.8k|            ps_slice->u1_num_ref_idx_lx_active[0] = (UWORD8) u8_ref_idx_l0;
 1499|  12.8k|            ps_slice->u1_num_ref_idx_lx_active[1] = (UWORD8) u8_ref_idx_l1;
 1500|  12.8k|        }
 1501|       |
 1502|      0|        ih264d_init_ref_idx_lx_b(ps_dec);
 1503|       |        /* Store the value for future slices in the same picture */
 1504|  12.8k|        ps_dec->u1_num_ref_idx_lx_active_prev = ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0];
 1505|       |
 1506|  12.8k|        u1_ref_idx_re_flag_lx = ih264d_get_bit_h264(ps_bitstrm);
 1507|  12.8k|        COPYTHECONTEXT("Slice Header SVC ext: ref_pic_list_reordering_flag_l0",
 1508|  12.8k|                       u1_ref_idx_re_flag_lx);
 1509|       |
 1510|       |        /* Modified temporarily */
 1511|  12.8k|        if(u1_ref_idx_re_flag_lx)
  ------------------
  |  Branch (1511:12): [True: 3.65k, False: 9.17k]
  ------------------
 1512|  3.65k|        {
 1513|  3.65k|            WORD8 ret;
 1514|  3.65k|            ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_mod_dpb[0];
 1515|  3.65k|            ret = ih264d_ref_idx_reordering(ps_dec, 0);
 1516|  3.65k|            if(ret == -1) return ERROR_REFIDX_ORDER_T;
  ------------------
  |  Branch (1516:16): [True: 0, False: 3.65k]
  ------------------
 1517|  3.65k|        }
 1518|  9.17k|        else
 1519|  9.17k|            ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_init_dpb[0];
 1520|       |
 1521|  12.8k|        u1_ref_idx_re_flag_lx = ih264d_get_bit_h264(ps_bitstrm);
 1522|  12.8k|        COPYTHECONTEXT("Slice Header SVC ext: ref_pic_list_reordering_flag_l1",
 1523|  12.8k|                       u1_ref_idx_re_flag_lx);
 1524|       |
 1525|       |        /* Modified temporarily */
 1526|  12.8k|        if(u1_ref_idx_re_flag_lx)
  ------------------
  |  Branch (1526:12): [True: 5.71k, False: 7.11k]
  ------------------
 1527|  5.71k|        {
 1528|  5.71k|            WORD8 ret;
 1529|  5.71k|            ps_dec->ps_ref_pic_buf_lx[1] = ps_dec->ps_dpb_mgr->ps_mod_dpb[1];
 1530|  5.71k|            ret = ih264d_ref_idx_reordering(ps_dec, 1);
 1531|  5.71k|            if(ret == -1) return ERROR_REFIDX_ORDER_T;
  ------------------
  |  Branch (1531:16): [True: 0, False: 5.71k]
  ------------------
 1532|  5.71k|        }
 1533|  7.11k|        else
 1534|  7.11k|            ps_dec->ps_ref_pic_buf_lx[1] = ps_dec->ps_dpb_mgr->ps_init_dpb[1];
 1535|       |
 1536|       |        /* Create refIdx to POC mapping */
 1537|  12.8k|        {
 1538|  12.8k|            void **ppv_map_ref_idx_to_poc_lx;
 1539|  12.8k|            WORD8 idx;
 1540|  12.8k|            struct pic_buffer_t *ps_pic;
 1541|       |
 1542|  12.8k|            ppv_map_ref_idx_to_poc_lx = ps_dec->ppv_map_ref_idx_to_poc + FRM_LIST_L0;
  ------------------
  |  |   89|  12.8k|#define FRM_LIST_L0             0                                               //0
  ------------------
 1543|  12.8k|            ppv_map_ref_idx_to_poc_lx[0] = 0;
 1544|  12.8k|            ppv_map_ref_idx_to_poc_lx++;
 1545|  41.6k|            for(idx = 0; idx < ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0]; idx++)
  ------------------
  |  Branch (1545:26): [True: 28.8k, False: 12.8k]
  ------------------
 1546|  28.8k|            {
 1547|  28.8k|                ps_pic = ps_dec->ps_ref_pic_buf_lx[0][idx];
 1548|  28.8k|                ppv_map_ref_idx_to_poc_lx[idx] = (ps_pic->pu1_buf1);
 1549|  28.8k|            }
 1550|       |
 1551|  12.8k|            ppv_map_ref_idx_to_poc_lx = ps_dec->ppv_map_ref_idx_to_poc + FRM_LIST_L1;
  ------------------
  |  |   90|  12.8k|#define FRM_LIST_L1             1 * POC_LIST_L0_TO_L1_DIFF//FRM_LIST_L0 + POC_LIST_L0_TO_L1_DIFF        //0+33                  //(1 * POC_LIST_L0_TO_L1_DIFF)
  |  |  ------------------
  |  |  |  |   86|  12.8k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|  12.8k|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1552|       |
 1553|  12.8k|            ppv_map_ref_idx_to_poc_lx[0] = 0;
 1554|  12.8k|            ppv_map_ref_idx_to_poc_lx++;
 1555|  47.7k|            for(idx = 0; idx < ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1]; idx++)
  ------------------
  |  Branch (1555:26): [True: 34.8k, False: 12.8k]
  ------------------
 1556|  34.8k|            {
 1557|  34.8k|                ps_pic = ps_dec->ps_ref_pic_buf_lx[1][idx];
 1558|  34.8k|                ppv_map_ref_idx_to_poc_lx[idx] = (ps_pic->pu1_buf1);
 1559|  34.8k|            }
 1560|       |
 1561|  12.8k|            if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (1561:16): [True: 0, False: 12.8k]
  ------------------
 1562|      0|            {
 1563|      0|                void **ppv_map_ref_idx_to_poc_lx_t, **ppv_map_ref_idx_to_poc_lx_b;
 1564|       |
 1565|      0|                ppv_map_ref_idx_to_poc_lx_t = ps_dec->ppv_map_ref_idx_to_poc + TOP_LIST_FLD_L0;
  ------------------
  |  |   91|      0|#define TOP_LIST_FLD_L0         2 * POC_LIST_L0_TO_L1_DIFF//FRM_LIST_L1 + POC_LIST_L0_TO_L1_DIFF        //0+33+33                   //(2 * POC_LIST_L0_TO_L1_DIFF)
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1566|      0|                ppv_map_ref_idx_to_poc_lx_b = ps_dec->ppv_map_ref_idx_to_poc + BOT_LIST_FLD_L0;
  ------------------
  |  |   93|      0|#define BOT_LIST_FLD_L0         4 * POC_LIST_L0_TO_L1_DIFF//TOP_LIST_FLD_L1 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1567|       |
 1568|      0|                ppv_map_ref_idx_to_poc_lx_t[0] = 0;
 1569|      0|                ppv_map_ref_idx_to_poc_lx_t++;
 1570|      0|                ppv_map_ref_idx_to_poc_lx_b[0] = 0;
 1571|      0|                ppv_map_ref_idx_to_poc_lx_b++;
 1572|      0|                for(idx = 0; idx < ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0]; idx++)
  ------------------
  |  Branch (1572:30): [True: 0, False: 0]
  ------------------
 1573|      0|                {
 1574|      0|                    ps_pic = ps_dec->ps_ref_pic_buf_lx[0][idx];
 1575|      0|                    ppv_map_ref_idx_to_poc_lx_t[0] = (ps_pic->pu1_buf1);
 1576|      0|                    ppv_map_ref_idx_to_poc_lx_b[1] = (ps_pic->pu1_buf1);
 1577|       |
 1578|      0|                    ppv_map_ref_idx_to_poc_lx_b[0] = (ps_pic->pu1_buf1) + 1;
 1579|      0|                    ppv_map_ref_idx_to_poc_lx_t[1] = (ps_pic->pu1_buf1) + 1;
 1580|       |
 1581|      0|                    ppv_map_ref_idx_to_poc_lx_t += 2;
 1582|      0|                    ppv_map_ref_idx_to_poc_lx_b += 2;
 1583|      0|                }
 1584|       |
 1585|      0|                ppv_map_ref_idx_to_poc_lx_t = ps_dec->ppv_map_ref_idx_to_poc + TOP_LIST_FLD_L1;
  ------------------
  |  |   92|      0|#define TOP_LIST_FLD_L1         3 * POC_LIST_L0_TO_L1_DIFF//TOP_LIST_FLD_L0 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17                //(3 * POC_LIST_L0_TO_L1_DIFF)
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1586|      0|                ppv_map_ref_idx_to_poc_lx_b = ps_dec->ppv_map_ref_idx_to_poc + BOT_LIST_FLD_L1;
  ------------------
  |  |   94|      0|#define BOT_LIST_FLD_L1         5 * POC_LIST_L0_TO_L1_DIFF//BOT_LIST_FLD_L0 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17+17
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1587|       |
 1588|      0|                ppv_map_ref_idx_to_poc_lx_t[0] = 0;
 1589|      0|                ppv_map_ref_idx_to_poc_lx_t++;
 1590|      0|                ppv_map_ref_idx_to_poc_lx_b[0] = 0;
 1591|      0|                ppv_map_ref_idx_to_poc_lx_b++;
 1592|      0|                for(idx = 0; idx < ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1]; idx++)
  ------------------
  |  Branch (1592:30): [True: 0, False: 0]
  ------------------
 1593|      0|                {
 1594|      0|                    UWORD8 u1_tmp_idx = idx << 1;
 1595|      0|                    ps_pic = ps_dec->ps_ref_pic_buf_lx[1][idx];
 1596|      0|                    ppv_map_ref_idx_to_poc_lx_t[u1_tmp_idx] = (ps_pic->pu1_buf1);
 1597|      0|                    ppv_map_ref_idx_to_poc_lx_b[u1_tmp_idx + 1] = (ps_pic->pu1_buf1);
 1598|       |
 1599|      0|                    ppv_map_ref_idx_to_poc_lx_b[u1_tmp_idx] = (ps_pic->pu1_buf1) + 1;
 1600|      0|                    ppv_map_ref_idx_to_poc_lx_t[u1_tmp_idx + 1] = (ps_pic->pu1_buf1) + 1;
 1601|      0|                }
 1602|      0|            }
 1603|       |
 1604|       |            /* BS is moved post recon gen in SVC ext*/
 1605|  12.8k|            if(ps_dec->u4_num_cores >= 2)
  ------------------
  |  Branch (1605:16): [True: 7.89k, False: 4.93k]
  ------------------
 1606|  7.89k|            {
 1607|  7.89k|                WORD32 num_entries;
 1608|  7.89k|                WORD32 size;
 1609|  7.89k|                num_entries = MAX_FRAMES;
  ------------------
  |  |  600|  7.89k|#define MAX_FRAMES              16
  ------------------
 1610|  7.89k|                if((1 >= ps_dec->ps_cur_sps->u1_num_ref_frames) && (0 == ps_dec->i4_display_delay))
  ------------------
  |  Branch (1610:20): [True: 7.10k, False: 798]
  |  Branch (1610:68): [True: 0, False: 7.10k]
  ------------------
 1611|      0|                {
 1612|      0|                    num_entries = 1;
 1613|      0|                }
 1614|       |
 1615|  7.89k|                num_entries = ((2 * num_entries) + 1);
 1616|  7.89k|                num_entries *= 2;
 1617|       |
 1618|  7.89k|                size = num_entries * sizeof(void *);
 1619|  7.89k|                size += PAD_MAP_IDX_POC * sizeof(void *);
  ------------------
  |  |  100|  7.89k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 1620|       |
 1621|  7.89k|                memcpy((void *) ps_dec->ps_parse_cur_slice->ppv_map_ref_idx_to_poc,
 1622|  7.89k|                       ps_dec->ppv_map_ref_idx_to_poc, size);
 1623|  7.89k|            }
 1624|  12.8k|        }
 1625|       |
 1626|  12.8k|        if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag &&
  ------------------
  |  Branch (1626:12): [True: 0, False: 12.8k]
  ------------------
 1627|      0|           (ps_dec->ps_cur_slice->u1_field_pic_flag == 0))
  ------------------
  |  Branch (1627:12): [True: 0, False: 0]
  ------------------
 1628|      0|        {
 1629|      0|            ih264d_convert_frm_mbaff_list(ps_dec);
 1630|      0|        }
 1631|       |
 1632|  12.8k|        if(ps_pps->u1_wted_bipred_idc == 1)
  ------------------
  |  Branch (1632:12): [True: 5.53k, False: 7.29k]
  ------------------
 1633|  5.53k|        {
 1634|  5.53k|            if(!ps_nal_svc_ext->u1_no_inter_layer_pred_flag)
  ------------------
  |  Branch (1634:16): [True: 5.53k, False: 0]
  ------------------
 1635|  5.53k|            {
 1636|  5.53k|                ps_svc_slice_params->u1_base_pred_weight_table_flag =
 1637|  5.53k|                    ih264d_get_bit_h264(ps_bitstrm);
 1638|  5.53k|                COPYTHECONTEXT("Slice Header SVC ext: u1_base_pred_weight_table_flag",
 1639|  5.53k|                               ps_svc_slice_params->u1_base_pred_weight_table_flag);
 1640|  5.53k|            }
 1641|       |
 1642|  5.53k|            if(ps_nal_svc_ext->u1_no_inter_layer_pred_flag ||
  ------------------
  |  Branch (1642:16): [True: 0, False: 5.53k]
  ------------------
 1643|  5.53k|               !ps_svc_slice_params->u1_base_pred_weight_table_flag)
  ------------------
  |  Branch (1643:16): [True: 2.68k, False: 2.84k]
  ------------------
 1644|  2.68k|            {
 1645|  2.68k|                ih264d_parse_pred_weight_table(ps_slice, ps_bitstrm);
 1646|       |
 1647|  2.68k|                ih264d_form_pred_weight_matrix(ps_dec);
 1648|  2.68k|                ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
 1649|  2.68k|            }
 1650|  5.53k|        }
 1651|  7.29k|        else if(ps_pps->u1_wted_bipred_idc == 2)
  ------------------
  |  Branch (1651:17): [True: 2.63k, False: 4.66k]
  ------------------
 1652|  2.63k|        {
 1653|       |            /* Implicit Weighted prediction */
 1654|  2.63k|            ps_slice->u2_log2Y_crwd = 0x0505;
 1655|  2.63k|            ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
 1656|  2.63k|            ih264d_get_implicit_weights(ps_dec);
 1657|  2.63k|        }
 1658|  4.66k|        else
 1659|  4.66k|            ps_dec->ps_cur_slice->u2_log2Y_crwd = 0;
 1660|       |
 1661|  12.8k|        ps_dec->ps_parse_cur_slice->u2_log2Y_crwd = ps_dec->ps_cur_slice->u2_log2Y_crwd;
 1662|       |
 1663|       |        /* G050 */
 1664|  12.8k|        if(ps_slice->u1_nal_ref_idc != 0)
  ------------------
  |  Branch (1664:12): [True: 7.44k, False: 5.38k]
  ------------------
 1665|  7.44k|        {
 1666|  7.44k|            if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (1666:16): [True: 7.31k, False: 130]
  ------------------
 1667|  7.31k|            {
 1668|  7.31k|                dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1669|  7.31k|                dec_seq_params_t *ps_sps_tmp = ps_pps->ps_sps;
 1670|  7.31k|                UWORD8 u1_nal_unit_type_tmp = ps_dec->u1_nal_unit_type;
 1671|       |
 1672|  7.31k|                ps_pps->ps_sps = ps_dec->ps_cur_sps;
 1673|  7.31k|                if(ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag)
  ------------------
  |  Branch (1673:20): [True: 7.09k, False: 212]
  ------------------
 1674|  7.09k|                    ps_dec->u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  7.09k|#define IDR_SLICE_NAL                   5
  ------------------
 1675|       |
 1676|  7.31k|                i_temp = ih264d_read_mmco_commands(ps_dec);
 1677|       |
 1678|  7.31k|                ps_pps->ps_sps = ps_sps_tmp;
 1679|  7.31k|                ps_dec->u1_nal_unit_type = u1_nal_unit_type_tmp;
 1680|       |
 1681|  7.31k|                if(i_temp < 0)
  ------------------
  |  Branch (1681:20): [True: 47, False: 7.26k]
  ------------------
 1682|     47|                {
 1683|     47|                    return ERROR_DBP_MANAGER_T;
 1684|     47|                }
 1685|  7.26k|                ps_dec->u4_bitoffset = i_temp;
 1686|  7.26k|            }
 1687|    130|            else
 1688|    130|                ps_bitstrm->u4_ofst += ps_dec->u4_bitoffset;
 1689|       |
 1690|  7.39k|            if(!ps_sps_svc_ext->u1_slice_header_restriction_flag)
  ------------------
  |  Branch (1690:16): [True: 6.10k, False: 1.29k]
  ------------------
 1691|  6.10k|            {
 1692|  6.10k|                ps_svc_slice_params->u1_store_ref_base_pic_flag = ih264d_get_bit_h264(ps_bitstrm);
 1693|  6.10k|                COPYTHECONTEXT("SPS_SVC_EXT: u1_store_ref_base_pic_flag",
 1694|  6.10k|                               ps_svc_slice_params->u1_store_ref_base_pic_flag);
 1695|       |
 1696|  6.10k|                if(0 != ps_svc_slice_params->u1_store_ref_base_pic_flag)
  ------------------
  |  Branch (1696:20): [True: 533, False: 5.56k]
  ------------------
 1697|    533|                {
 1698|    533|                    return NOT_OK;
  ------------------
  |  |  116|    533|#define NOT_OK    -1
  ------------------
 1699|    533|                }
 1700|  5.56k|                if(((1 == ps_nal_svc_ext->u1_use_ref_base_pic_flag) ||
  ------------------
  |  Branch (1700:21): [True: 0, False: 5.56k]
  ------------------
 1701|  5.56k|                    (1 == ps_svc_slice_params->u1_store_ref_base_pic_flag)) &&
  ------------------
  |  Branch (1701:21): [True: 0, False: 5.56k]
  ------------------
 1702|      0|                   (!ps_nal_svc_ext->u1_idr_flag))
  ------------------
  |  Branch (1702:20): [True: 0, False: 0]
  ------------------
 1703|      0|                {
 1704|      0|                    i_status = isvcd_dec_ref_base_pic_marking(
 1705|      0|                        &ps_svc_slice_params->s_ref_base_pic_marking_svc_ext, ps_bitstrm);
 1706|      0|                    if(i_status != OK)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (1706:24): [True: 0, False: 0]
  ------------------
 1707|      0|                    {
 1708|      0|                        return i_status;
 1709|      0|                    }
 1710|      0|                }
 1711|  5.56k|            }
 1712|  7.39k|        }
 1713|  12.8k|    }
 1714|       |    /* G050 */
 1715|       |    /*Code is present in standard but omitted in the reference code*/
 1716|  12.2k|    if(ps_pps->u1_entropy_coding_mode == CABAC)
  ------------------
  |  |  339|  12.2k|#define CABAC  1
  ------------------
  |  Branch (1716:8): [True: 2.44k, False: 9.81k]
  ------------------
 1717|  2.44k|    {
 1718|  2.44k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1719|  2.44k|        if(u4_temp > MAX_CABAC_INIT_IDC)
  ------------------
  |  |  537|  2.44k|#define MAX_CABAC_INIT_IDC        2
  ------------------
  |  Branch (1719:12): [True: 150, False: 2.29k]
  ------------------
 1720|    150|        {
 1721|    150|            return ERROR_INV_SLICE_HDR_T;
 1722|    150|        }
 1723|  2.29k|        ps_slice->u1_cabac_init_idc = u4_temp;
 1724|  2.29k|        COPYTHECONTEXT("Slice Header SVC ext: cabac_init_idc", ps_slice->u1_cabac_init_idc);
 1725|  2.29k|    }
 1726|       |
 1727|  12.1k|    {
 1728|       |        /* Read slice_qp_delta */
 1729|  12.1k|        WORD64 i8_temp =
 1730|  12.1k|            (WORD64) ps_pps->u1_pic_init_qp + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1731|  12.1k|        if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  629|  12.1k|#define MIN_H264_QP 0
  ------------------
                      if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  634|  11.8k|#define MAX_H264_QP 51
  ------------------
  |  Branch (1731:12): [True: 267, False: 11.8k]
  |  Branch (1731:39): [True: 1.54k, False: 10.2k]
  ------------------
 1732|  1.80k|        {
 1733|  1.80k|            return ERROR_INV_RANGE_QP_T;
 1734|  1.80k|        }
 1735|  10.2k|        ps_slice->u1_slice_qp = (UWORD8) i8_temp;
 1736|  10.2k|        COPYTHECONTEXT("Slice Header SVC ext: slice_qp_delta",
 1737|  10.2k|                       (WORD8) (ps_slice->u1_slice_qp - ps_pps->u1_pic_init_qp));
 1738|  10.2k|    }
 1739|  10.2k|    if(ps_pps->u1_deblocking_filter_parameters_present_flag == 1)
  ------------------
  |  Branch (1739:8): [True: 6.89k, False: 3.40k]
  ------------------
 1740|  6.89k|    {
 1741|  6.89k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1742|  6.89k|        if(u4_temp > SLICE_BOUNDARY_DBLK_DISABLED)
  ------------------
  |  |  547|  6.89k|#define SLICE_BOUNDARY_DBLK_DISABLED  2
  ------------------
  |  Branch (1742:12): [True: 236, False: 6.65k]
  ------------------
 1743|    236|        {
 1744|    236|            return ERROR_INV_SLICE_HDR_T;
 1745|    236|        }
 1746|  6.65k|        COPYTHECONTEXT("Slice Header SVC ext: disable_deblocking_filter_idc", u4_temp);
 1747|  6.65k|        ps_slice->u1_disable_dblk_filter_idc = u4_temp;
 1748|  6.65k|        if(u4_temp != 1)
  ------------------
  |  Branch (1748:12): [True: 5.90k, False: 748]
  ------------------
 1749|  5.90k|        {
 1750|  5.90k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 1751|  5.90k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  5.90k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  5.68k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (1751:16): [True: 224, False: 5.68k]
  |  Branch (1751:47): [True: 189, False: 5.49k]
  ------------------
 1752|    413|            {
 1753|    413|                return ERROR_INV_SLICE_HDR_T;
 1754|    413|            }
 1755|  5.49k|            ps_slice->i1_slice_alpha_c0_offset = i_temp;
 1756|  5.49k|            COPYTHECONTEXT("Slice Header SVC ext: slice_alpha_c0_offset_div2",
 1757|  5.49k|                           ps_slice->i1_slice_alpha_c0_offset >> 1);
 1758|       |
 1759|  5.49k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 1760|  5.49k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  5.49k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  5.30k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (1760:16): [True: 190, False: 5.30k]
  |  Branch (1760:47): [True: 174, False: 5.12k]
  ------------------
 1761|    364|            {
 1762|    364|                return ERROR_INV_SLICE_HDR_T;
 1763|    364|            }
 1764|  5.12k|            ps_slice->i1_slice_beta_offset = i_temp;
 1765|  5.12k|            COPYTHECONTEXT("Slice Header SVC ext: slice_beta_offset_div2",
 1766|  5.12k|                           ps_slice->i1_slice_beta_offset >> 1);
 1767|  5.12k|        }
 1768|    748|        else
 1769|    748|        {
 1770|    748|            ps_slice->i1_slice_alpha_c0_offset = 0;
 1771|    748|            ps_slice->i1_slice_beta_offset = 0;
 1772|    748|        }
 1773|  6.65k|    }
 1774|  3.40k|    else
 1775|  3.40k|    {
 1776|  3.40k|        ps_slice->u1_disable_dblk_filter_idc = 0;
 1777|  3.40k|        ps_slice->i1_slice_alpha_c0_offset = 0;
 1778|  3.40k|        ps_slice->i1_slice_beta_offset = 0;
 1779|  3.40k|    }
 1780|       |
 1781|       |    /* add the remaining part of the code for svc extension from reference */
 1782|  9.27k|    ret = isvcd_set_default_slice_header_ext(ps_svc_lyr_dec);
 1783|  9.27k|    if(ret != OK)
  ------------------
  |  |  114|  9.27k|#define OK        0
  ------------------
  |  Branch (1783:8): [True: 0, False: 9.27k]
  ------------------
 1784|      0|    {
 1785|      0|        return ERROR_INV_SLICE_HDR_T;
 1786|      0|    }
 1787|       |
 1788|  9.27k|    ret = isvcd_parse_slice_header(ps_svc_lyr_dec);
 1789|  9.27k|    if(ret != OK)
  ------------------
  |  |  114|  9.27k|#define OK        0
  ------------------
  |  Branch (1789:8): [True: 835, False: 8.44k]
  ------------------
 1790|    835|    {
 1791|    835|        return ERROR_INV_SLICE_HDR_T;
 1792|    835|    }
 1793|       |
 1794|  8.44k|    ps_dec->u1_slice_header_done = 2;
 1795|  8.44k|    if(!ps_svc_slice_params->u1_slice_skip_flag)
  ------------------
  |  Branch (1795:8): [True: 8.12k, False: 317]
  ------------------
 1796|  8.12k|    {
 1797|  8.12k|        if(ps_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (1797:12): [True: 2.20k, False: 5.91k]
  ------------------
 1798|  2.20k|        {
 1799|  2.20k|            SWITCHOFFTRACE;
 1800|  2.20k|            SWITCHONTRACECABAC;
 1801|  2.20k|            ps_svc_lyr_dec->pf_parse_inter_slice_svc_ext =
 1802|  2.20k|                isvcd_parse_inter_slice_data_cabac_enh_lyr;
 1803|  2.20k|            ps_svc_lyr_dec->pf_parse_inter_mb_svc_ext = isvcd_parse_bmb_cabac;
 1804|  2.20k|            isvcd_init_cabac_contexts(B_SLICE, ps_dec);
  ------------------
  |  |  369|  2.20k|#define B_SLICE  1
  ------------------
 1805|       |
 1806|  2.20k|            if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (1806:16): [True: 0, False: 2.20k]
  ------------------
 1807|      0|                ps_dec->pf_get_mb_info = ih264d_get_mb_info_cabac_mbaff;
 1808|  2.20k|            else
 1809|  2.20k|                ps_dec->pf_get_mb_info = isvcd_get_mb_info_cabac_nonmbaff;
 1810|  2.20k|        }
 1811|  5.91k|        else
 1812|  5.91k|        {
 1813|  5.91k|            SWITCHONTRACE;
 1814|  5.91k|            SWITCHOFFTRACECABAC;
 1815|  5.91k|            ps_svc_lyr_dec->pf_parse_inter_slice_svc_ext =
 1816|  5.91k|                isvcd_parse_inter_slice_data_cavlc_enh_lyr;
 1817|  5.91k|            ps_svc_lyr_dec->pf_parse_inter_mb_svc_ext = isvcd_parse_bmb_cavlc;
 1818|  5.91k|            if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (1818:16): [True: 0, False: 5.91k]
  ------------------
 1819|      0|                ps_dec->pf_get_mb_info = ih264d_get_mb_info_cavlc_mbaff;
 1820|  5.91k|            else
 1821|  5.91k|                ps_dec->pf_get_mb_info = isvcd_get_mb_info_cavlc_nonmbaff;
 1822|  5.91k|        }
 1823|  8.12k|    }
 1824|    317|    else
 1825|    317|    {
 1826|    317|        return ERROR_FEATURE_UNAVAIL;
 1827|    317|    }
 1828|       |
 1829|  8.12k|    ret = ih264d_cal_col_pic(ps_dec);
 1830|  8.12k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  8.12k|#define OK        0
  ------------------
  |  Branch (1830:8): [True: 0, False: 8.12k]
  ------------------
 1831|  8.12k|    ps_dec->u1_B = 1;
 1832|  8.12k|    ps_dec->pf_mvpred_ref_tfr_nby2mb = isvcd_mv_pred_ref_tfr_nby2_ebmb;
 1833|  8.12k|    ret = ps_svc_lyr_dec->pf_parse_inter_slice_svc_ext(ps_svc_lyr_dec, ps_slice,
 1834|  8.12k|                                                       u2_first_mb_in_slice);
 1835|  8.12k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  8.12k|#define OK        0
  ------------------
  |  Branch (1835:8): [True: 4.19k, False: 3.93k]
  ------------------
 1836|       |
 1837|  3.93k|    return OK;
  ------------------
  |  |  114|  3.93k|#define OK        0
  ------------------
 1838|  8.12k|}
isvcd_parse_bslice:
 1853|  30.8k|{
 1854|  30.8k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1855|  30.8k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1856|  30.8k|    dec_slice_params_t *ps_slice = ps_dec->ps_cur_slice;
 1857|  30.8k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1858|  30.8k|    UWORD8 u1_ref_idx_re_flag_lx;
 1859|  30.8k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1860|  30.8k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 1861|  30.8k|    UWORD64 u8_ref_idx_l0, u8_ref_idx_l1;
 1862|  30.8k|    UWORD32 u4_temp;
 1863|  30.8k|    WORD32 i_temp;
 1864|  30.8k|    WORD32 ret;
 1865|       |
 1866|       |    /*--------------------------------------------------------------------*/
 1867|       |    /* Read remaining contents of the slice header                        */
 1868|       |    /*--------------------------------------------------------------------*/
 1869|  30.8k|    {
 1870|  30.8k|        WORD8 *pi1_buf;
 1871|  30.8k|        WORD16 *pi2_mv = ps_dec->s_default_mv_pred.i2_mv;
 1872|  30.8k|        WORD32 *pi4_mv = (WORD32 *) pi2_mv;
 1873|  30.8k|        WORD16 *pi16_refFrame;
 1874|  30.8k|        pi1_buf = ps_dec->s_default_mv_pred.i1_ref_frame;
 1875|  30.8k|        pi16_refFrame = (WORD16 *) pi1_buf;
 1876|  30.8k|        *pi4_mv = 0;
 1877|  30.8k|        *(pi4_mv + 1) = 0;
 1878|  30.8k|        *pi16_refFrame = OUT_OF_RANGE_REF;
  ------------------
  |  |   45|  30.8k|#define OUT_OF_RANGE_REF  -1
  ------------------
 1879|  30.8k|        ps_dec->s_default_mv_pred.u1_col_ref_pic_idx = (UWORD8) -1;
 1880|  30.8k|        ps_dec->s_default_mv_pred.u1_pic_type = (UWORD8) -1;
 1881|  30.8k|    }
 1882|       |
 1883|  30.8k|    ps_slice->u1_num_ref_idx_active_override_flag = ih264d_get_bit_h264(ps_bitstrm);
 1884|  30.8k|    COPYTHECONTEXT("SH: num_ref_idx_override_flag", ps_slice->u1_num_ref_idx_active_override_flag);
 1885|       |
 1886|  30.8k|    u8_ref_idx_l0 = ps_dec->ps_cur_pps->u1_num_ref_idx_lx_active[0];
 1887|  30.8k|    u8_ref_idx_l1 = ps_dec->ps_cur_pps->u1_num_ref_idx_lx_active[1];
 1888|  30.8k|    if(ps_slice->u1_num_ref_idx_active_override_flag)
  ------------------
  |  Branch (1888:8): [True: 18.0k, False: 12.7k]
  ------------------
 1889|  18.0k|    {
 1890|  18.0k|        u8_ref_idx_l0 = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1891|  18.0k|        COPYTHECONTEXT("SH: num_ref_idx_l0_active_minus1", u8_ref_idx_l0 - 1);
 1892|       |
 1893|  18.0k|        u8_ref_idx_l1 = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1894|  18.0k|        COPYTHECONTEXT("SH: num_ref_idx_l1_active_minus1", u8_ref_idx_l1 - 1);
 1895|  18.0k|    }
 1896|       |
 1897|  30.8k|    {
 1898|  30.8k|        UWORD8 u1_max_ref_idx = H264_MAX_REF_PICS;
  ------------------
  |  |  534|  30.8k|#define H264_MAX_REF_PICS         16
  ------------------
 1899|  30.8k|        if(ps_slice->u1_field_pic_flag)
  ------------------
  |  Branch (1899:12): [True: 0, False: 30.8k]
  ------------------
 1900|      0|        {
 1901|      0|            u1_max_ref_idx = H264_MAX_REF_PICS << 1;
  ------------------
  |  |  534|      0|#define H264_MAX_REF_PICS         16
  ------------------
 1902|      0|        }
 1903|  30.8k|        if((u8_ref_idx_l0 >= u1_max_ref_idx) || (u8_ref_idx_l1 >= u1_max_ref_idx))
  ------------------
  |  Branch (1903:12): [True: 623, False: 30.1k]
  |  Branch (1903:49): [True: 721, False: 29.4k]
  ------------------
 1904|  1.34k|        {
 1905|  1.34k|            return ERROR_NUM_REF;
 1906|  1.34k|        }
 1907|  29.4k|        ps_slice->u1_num_ref_idx_lx_active[0] = (UWORD8) u8_ref_idx_l0;
 1908|  29.4k|        ps_slice->u1_num_ref_idx_lx_active[1] = (UWORD8) u8_ref_idx_l1;
 1909|  29.4k|    }
 1910|       |
 1911|      0|    ih264d_init_ref_idx_lx_b(ps_dec);
 1912|       |    /* Store the value for future slices in the same picture */
 1913|  29.4k|    ps_dec->u1_num_ref_idx_lx_active_prev = ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0];
 1914|       |
 1915|  29.4k|    u1_ref_idx_re_flag_lx = ih264d_get_bit_h264(ps_bitstrm);
 1916|  29.4k|    COPYTHECONTEXT("SH: ref_pic_list_reordering_flag_l0", u1_ref_idx_re_flag_lx);
 1917|       |
 1918|       |    /* Modified temporarily */
 1919|  29.4k|    if(u1_ref_idx_re_flag_lx)
  ------------------
  |  Branch (1919:8): [True: 12.4k, False: 17.0k]
  ------------------
 1920|  12.4k|    {
 1921|  12.4k|        WORD8 ret;
 1922|  12.4k|        ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_mod_dpb[0];
 1923|  12.4k|        ret = ih264d_ref_idx_reordering(ps_dec, 0);
 1924|  12.4k|        if(ret == -1) return ERROR_REFIDX_ORDER_T;
  ------------------
  |  Branch (1924:12): [True: 0, False: 12.4k]
  ------------------
 1925|  12.4k|    }
 1926|  17.0k|    else
 1927|  17.0k|        ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_init_dpb[0];
 1928|       |
 1929|  29.4k|    u1_ref_idx_re_flag_lx = ih264d_get_bit_h264(ps_bitstrm);
 1930|  29.4k|    COPYTHECONTEXT("SH: ref_pic_list_reordering_flag_l1", u1_ref_idx_re_flag_lx);
 1931|       |
 1932|       |    /* Modified temporarily */
 1933|  29.4k|    if(u1_ref_idx_re_flag_lx)
  ------------------
  |  Branch (1933:8): [True: 11.3k, False: 18.1k]
  ------------------
 1934|  11.3k|    {
 1935|  11.3k|        WORD8 ret;
 1936|  11.3k|        ps_dec->ps_ref_pic_buf_lx[1] = ps_dec->ps_dpb_mgr->ps_mod_dpb[1];
 1937|  11.3k|        ret = ih264d_ref_idx_reordering(ps_dec, 1);
 1938|  11.3k|        if(ret == -1) return ERROR_REFIDX_ORDER_T;
  ------------------
  |  Branch (1938:12): [True: 0, False: 11.3k]
  ------------------
 1939|  11.3k|    }
 1940|  18.1k|    else
 1941|  18.1k|        ps_dec->ps_ref_pic_buf_lx[1] = ps_dec->ps_dpb_mgr->ps_init_dpb[1];
 1942|       |
 1943|       |    /* Create refIdx to POC mapping */
 1944|  29.4k|    {
 1945|  29.4k|        void **ppv_map_ref_idx_to_poc_lx;
 1946|  29.4k|        WORD8 idx;
 1947|  29.4k|        struct pic_buffer_t *ps_pic;
 1948|       |
 1949|  29.4k|        ppv_map_ref_idx_to_poc_lx = ps_dec->ppv_map_ref_idx_to_poc + FRM_LIST_L0;
  ------------------
  |  |   89|  29.4k|#define FRM_LIST_L0             0                                               //0
  ------------------
 1950|  29.4k|        ppv_map_ref_idx_to_poc_lx[0] = 0;
 1951|  29.4k|        ppv_map_ref_idx_to_poc_lx++;
 1952|  97.5k|        for(idx = 0; idx < ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0]; idx++)
  ------------------
  |  Branch (1952:22): [True: 68.0k, False: 29.4k]
  ------------------
 1953|  68.0k|        {
 1954|  68.0k|            ps_pic = ps_dec->ps_ref_pic_buf_lx[0][idx];
 1955|  68.0k|            ppv_map_ref_idx_to_poc_lx[idx] = (ps_pic->pu1_buf1);
 1956|  68.0k|        }
 1957|       |
 1958|  29.4k|        ppv_map_ref_idx_to_poc_lx = ps_dec->ppv_map_ref_idx_to_poc + FRM_LIST_L1;
  ------------------
  |  |   90|  29.4k|#define FRM_LIST_L1             1 * POC_LIST_L0_TO_L1_DIFF//FRM_LIST_L0 + POC_LIST_L0_TO_L1_DIFF        //0+33                  //(1 * POC_LIST_L0_TO_L1_DIFF)
  |  |  ------------------
  |  |  |  |   86|  29.4k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|  29.4k|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1959|       |
 1960|  29.4k|        ppv_map_ref_idx_to_poc_lx[0] = 0;
 1961|  29.4k|        ppv_map_ref_idx_to_poc_lx++;
 1962|  88.1k|        for(idx = 0; idx < ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1]; idx++)
  ------------------
  |  Branch (1962:22): [True: 58.6k, False: 29.4k]
  ------------------
 1963|  58.6k|        {
 1964|  58.6k|            ps_pic = ps_dec->ps_ref_pic_buf_lx[1][idx];
 1965|  58.6k|            ppv_map_ref_idx_to_poc_lx[idx] = (ps_pic->pu1_buf1);
 1966|  58.6k|        }
 1967|       |
 1968|  29.4k|        if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (1968:12): [True: 0, False: 29.4k]
  ------------------
 1969|      0|        {
 1970|      0|            void **ppv_map_ref_idx_to_poc_lx_t, **ppv_map_ref_idx_to_poc_lx_b;
 1971|       |
 1972|      0|            ppv_map_ref_idx_to_poc_lx_t = ps_dec->ppv_map_ref_idx_to_poc + TOP_LIST_FLD_L0;
  ------------------
  |  |   91|      0|#define TOP_LIST_FLD_L0         2 * POC_LIST_L0_TO_L1_DIFF//FRM_LIST_L1 + POC_LIST_L0_TO_L1_DIFF        //0+33+33                   //(2 * POC_LIST_L0_TO_L1_DIFF)
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1973|      0|            ppv_map_ref_idx_to_poc_lx_b = ps_dec->ppv_map_ref_idx_to_poc + BOT_LIST_FLD_L0;
  ------------------
  |  |   93|      0|#define BOT_LIST_FLD_L0         4 * POC_LIST_L0_TO_L1_DIFF//TOP_LIST_FLD_L1 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1974|       |
 1975|      0|            ppv_map_ref_idx_to_poc_lx_t[0] = 0;
 1976|      0|            ppv_map_ref_idx_to_poc_lx_t++;
 1977|      0|            ppv_map_ref_idx_to_poc_lx_b[0] = 0;
 1978|      0|            ppv_map_ref_idx_to_poc_lx_b++;
 1979|      0|            for(idx = 0; idx < ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0]; idx++)
  ------------------
  |  Branch (1979:26): [True: 0, False: 0]
  ------------------
 1980|      0|            {
 1981|      0|                ps_pic = ps_dec->ps_ref_pic_buf_lx[0][idx];
 1982|      0|                ppv_map_ref_idx_to_poc_lx_t[0] = (ps_pic->pu1_buf1);
 1983|      0|                ppv_map_ref_idx_to_poc_lx_b[1] = (ps_pic->pu1_buf1);
 1984|       |
 1985|      0|                ppv_map_ref_idx_to_poc_lx_b[0] = (ps_pic->pu1_buf1) + 1;
 1986|      0|                ppv_map_ref_idx_to_poc_lx_t[1] = (ps_pic->pu1_buf1) + 1;
 1987|       |
 1988|      0|                ppv_map_ref_idx_to_poc_lx_t += 2;
 1989|      0|                ppv_map_ref_idx_to_poc_lx_b += 2;
 1990|      0|            }
 1991|       |
 1992|      0|            ppv_map_ref_idx_to_poc_lx_t = ps_dec->ppv_map_ref_idx_to_poc + TOP_LIST_FLD_L1;
  ------------------
  |  |   92|      0|#define TOP_LIST_FLD_L1         3 * POC_LIST_L0_TO_L1_DIFF//TOP_LIST_FLD_L0 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17                //(3 * POC_LIST_L0_TO_L1_DIFF)
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1993|      0|            ppv_map_ref_idx_to_poc_lx_b = ps_dec->ppv_map_ref_idx_to_poc + BOT_LIST_FLD_L1;
  ------------------
  |  |   94|      0|#define BOT_LIST_FLD_L1         5 * POC_LIST_L0_TO_L1_DIFF//BOT_LIST_FLD_L0 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17+17
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1994|       |
 1995|      0|            ppv_map_ref_idx_to_poc_lx_t[0] = 0;
 1996|      0|            ppv_map_ref_idx_to_poc_lx_t++;
 1997|      0|            ppv_map_ref_idx_to_poc_lx_b[0] = 0;
 1998|      0|            ppv_map_ref_idx_to_poc_lx_b++;
 1999|      0|            for(idx = 0; idx < ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1]; idx++)
  ------------------
  |  Branch (1999:26): [True: 0, False: 0]
  ------------------
 2000|      0|            {
 2001|      0|                UWORD8 u1_tmp_idx = idx << 1;
 2002|      0|                ps_pic = ps_dec->ps_ref_pic_buf_lx[1][idx];
 2003|      0|                ppv_map_ref_idx_to_poc_lx_t[u1_tmp_idx] = (ps_pic->pu1_buf1);
 2004|      0|                ppv_map_ref_idx_to_poc_lx_b[u1_tmp_idx + 1] = (ps_pic->pu1_buf1);
 2005|       |
 2006|      0|                ppv_map_ref_idx_to_poc_lx_b[u1_tmp_idx] = (ps_pic->pu1_buf1) + 1;
 2007|      0|                ppv_map_ref_idx_to_poc_lx_t[u1_tmp_idx + 1] = (ps_pic->pu1_buf1) + 1;
 2008|      0|            }
 2009|      0|        }
 2010|  29.4k|    }
 2011|       |
 2012|  29.4k|    if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag && (ps_dec->ps_cur_slice->u1_field_pic_flag == 0))
  ------------------
  |  Branch (2012:8): [True: 0, False: 29.4k]
  |  Branch (2012:53): [True: 0, False: 0]
  ------------------
 2013|      0|    {
 2014|      0|        ih264d_convert_frm_mbaff_list(ps_dec);
 2015|      0|    }
 2016|       |
 2017|  29.4k|    if(ps_pps->u1_wted_bipred_idc == 1)
  ------------------
  |  Branch (2017:8): [True: 3.47k, False: 25.9k]
  ------------------
 2018|  3.47k|    {
 2019|  3.47k|        ret = ih264d_parse_pred_weight_table(ps_slice, ps_bitstrm);
 2020|  3.47k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  3.47k|#define OK        0
  ------------------
  |  Branch (2020:12): [True: 1.85k, False: 1.62k]
  ------------------
 2021|  1.62k|        ih264d_form_pred_weight_matrix(ps_dec);
 2022|  1.62k|        ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
 2023|  1.62k|    }
 2024|  25.9k|    else if(ps_pps->u1_wted_bipred_idc == 2)
  ------------------
  |  Branch (2024:13): [True: 13.6k, False: 12.3k]
  ------------------
 2025|  13.6k|    {
 2026|       |        /* Implicit Weighted prediction */
 2027|  13.6k|        ps_slice->u2_log2Y_crwd = 0x0505;
 2028|  13.6k|        ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
 2029|  13.6k|        ih264d_get_implicit_weights(ps_dec);
 2030|  13.6k|    }
 2031|  12.3k|    else
 2032|  12.3k|        ps_dec->ps_cur_slice->u2_log2Y_crwd = 0;
 2033|       |
 2034|  27.6k|    ps_dec->ps_parse_cur_slice->u2_log2Y_crwd = ps_dec->ps_cur_slice->u2_log2Y_crwd;
 2035|       |
 2036|       |    /* G050 */
 2037|  27.6k|    if(ps_slice->u1_nal_ref_idc != 0)
  ------------------
  |  Branch (2037:8): [True: 18.9k, False: 8.62k]
  ------------------
 2038|  18.9k|    {
 2039|  18.9k|        if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (2039:12): [True: 18.7k, False: 237]
  ------------------
 2040|  18.7k|        {
 2041|  18.7k|            dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 2042|  18.7k|            dec_seq_params_t *ps_sps_tmp = ps_pps->ps_sps;
 2043|  18.7k|            UWORD8 u1_nal_unit_type_tmp = ps_dec->u1_nal_unit_type;
 2044|       |
 2045|  18.7k|            ps_pps->ps_sps = ps_dec->ps_cur_sps;
 2046|  18.7k|            if(ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag)
  ------------------
  |  Branch (2046:16): [True: 12.3k, False: 6.44k]
  ------------------
 2047|  12.3k|                ps_dec->u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  12.3k|#define IDR_SLICE_NAL                   5
  ------------------
 2048|       |
 2049|  18.7k|            i_temp = ih264d_read_mmco_commands(ps_dec);
 2050|       |
 2051|  18.7k|            ps_pps->ps_sps = ps_sps_tmp;
 2052|  18.7k|            ps_dec->u1_nal_unit_type = u1_nal_unit_type_tmp;
 2053|       |
 2054|  18.7k|            if(i_temp < 0)
  ------------------
  |  Branch (2054:16): [True: 255, False: 18.4k]
  ------------------
 2055|    255|            {
 2056|    255|                return ERROR_DBP_MANAGER_T;
 2057|    255|            }
 2058|  18.4k|            ps_dec->u4_bitoffset = i_temp;
 2059|  18.4k|        }
 2060|    237|        else
 2061|    237|            ps_bitstrm->u4_ofst += ps_dec->u4_bitoffset;
 2062|  18.9k|    }
 2063|       |    /* G050 */
 2064|       |
 2065|  27.3k|    if(ps_pps->u1_entropy_coding_mode == CABAC)
  ------------------
  |  |  339|  27.3k|#define CABAC  1
  ------------------
  |  Branch (2065:8): [True: 10.4k, False: 16.9k]
  ------------------
 2066|  10.4k|    {
 2067|  10.4k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2068|  10.4k|        if(u4_temp > MAX_CABAC_INIT_IDC)
  ------------------
  |  |  537|  10.4k|#define MAX_CABAC_INIT_IDC        2
  ------------------
  |  Branch (2068:12): [True: 1.14k, False: 9.29k]
  ------------------
 2069|  1.14k|        {
 2070|  1.14k|            return ERROR_INV_SLICE_HDR_T;
 2071|  1.14k|        }
 2072|  9.29k|        ps_slice->u1_cabac_init_idc = u4_temp;
 2073|  9.29k|        COPYTHECONTEXT("SH: cabac_init_idc", ps_slice->u1_cabac_init_idc);
 2074|  9.29k|    }
 2075|  26.2k|    {
 2076|       |        /* Read slice_qp_delta */
 2077|  26.2k|        WORD64 i8_temp =
 2078|  26.2k|            (WORD64) ps_pps->u1_pic_init_qp + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2079|  26.2k|        if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  629|  26.2k|#define MIN_H264_QP 0
  ------------------
                      if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  634|  25.3k|#define MAX_H264_QP 51
  ------------------
  |  Branch (2079:12): [True: 904, False: 25.3k]
  |  Branch (2079:39): [True: 1.78k, False: 23.5k]
  ------------------
 2080|  2.69k|        {
 2081|  2.69k|            return ERROR_INV_RANGE_QP_T;
 2082|  2.69k|        }
 2083|  23.5k|        ps_slice->u1_slice_qp = (UWORD8) i8_temp;
 2084|  23.5k|        COPYTHECONTEXT("SH: slice_qp_delta",
 2085|  23.5k|                       (WORD8) (ps_slice->u1_slice_qp - ps_pps->u1_pic_init_qp));
 2086|  23.5k|    }
 2087|  23.5k|    if(ps_pps->u1_deblocking_filter_parameters_present_flag == 1)
  ------------------
  |  Branch (2087:8): [True: 12.6k, False: 10.8k]
  ------------------
 2088|  12.6k|    {
 2089|  12.6k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2090|  12.6k|        if(u4_temp > SLICE_BOUNDARY_DBLK_DISABLED)
  ------------------
  |  |  547|  12.6k|#define SLICE_BOUNDARY_DBLK_DISABLED  2
  ------------------
  |  Branch (2090:12): [True: 990, False: 11.6k]
  ------------------
 2091|    990|        {
 2092|    990|            return ERROR_INV_SLICE_HDR_T;
 2093|    990|        }
 2094|  11.6k|        COPYTHECONTEXT("SH: disable_deblocking_filter_idc", u4_temp);
 2095|  11.6k|        ps_slice->u1_disable_dblk_filter_idc = u4_temp;
 2096|  11.6k|        if(u4_temp != 1)
  ------------------
  |  Branch (2096:12): [True: 9.55k, False: 2.12k]
  ------------------
 2097|  9.55k|        {
 2098|  9.55k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 2099|  9.55k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  9.55k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  9.34k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (2099:16): [True: 215, False: 9.34k]
  |  Branch (2099:47): [True: 196, False: 9.14k]
  ------------------
 2100|    411|            {
 2101|    411|                return ERROR_INV_SLICE_HDR_T;
 2102|    411|            }
 2103|  9.14k|            ps_slice->i1_slice_alpha_c0_offset = i_temp;
 2104|  9.14k|            COPYTHECONTEXT("SH: slice_alpha_c0_offset_div2",
 2105|  9.14k|                           ps_slice->i1_slice_alpha_c0_offset >> 1);
 2106|       |
 2107|  9.14k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 2108|  9.14k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  9.14k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  8.97k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (2108:16): [True: 171, False: 8.97k]
  |  Branch (2108:47): [True: 207, False: 8.76k]
  ------------------
 2109|    378|            {
 2110|    378|                return ERROR_INV_SLICE_HDR_T;
 2111|    378|            }
 2112|  8.76k|            ps_slice->i1_slice_beta_offset = i_temp;
 2113|  8.76k|            COPYTHECONTEXT("SH: slice_beta_offset_div2", ps_slice->i1_slice_beta_offset >> 1);
 2114|  8.76k|        }
 2115|  2.12k|        else
 2116|  2.12k|        {
 2117|  2.12k|            ps_slice->i1_slice_alpha_c0_offset = 0;
 2118|  2.12k|            ps_slice->i1_slice_beta_offset = 0;
 2119|  2.12k|        }
 2120|  11.6k|    }
 2121|  10.8k|    else
 2122|  10.8k|    {
 2123|  10.8k|        ps_slice->u1_disable_dblk_filter_idc = 0;
 2124|  10.8k|        ps_slice->i1_slice_alpha_c0_offset = 0;
 2125|  10.8k|        ps_slice->i1_slice_beta_offset = 0;
 2126|  10.8k|    }
 2127|       |
 2128|  21.7k|    ps_dec->u1_slice_header_done = 2;
 2129|       |
 2130|  21.7k|    if(ps_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (2130:8): [True: 9.17k, False: 12.5k]
  ------------------
 2131|  9.17k|    {
 2132|  9.17k|        SWITCHOFFTRACE;
 2133|  9.17k|        SWITCHONTRACECABAC;
 2134|  9.17k|        ps_svc_lyr_dec->pf_parse_svc_inter_slice = isvcd_parse_inter_slice_data_cabac;
 2135|  9.17k|        ps_dec->pf_parse_inter_mb = ih264d_parse_bmb_cabac;
 2136|  9.17k|        ih264d_init_cabac_contexts(B_SLICE, ps_dec);
  ------------------
  |  |  369|  9.17k|#define B_SLICE  1
  ------------------
 2137|       |
 2138|  9.17k|        if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (2138:12): [True: 0, False: 9.17k]
  ------------------
 2139|      0|            ps_dec->pf_get_mb_info = ih264d_get_mb_info_cabac_mbaff;
 2140|  9.17k|        else
 2141|  9.17k|            ps_dec->pf_get_mb_info = isvcd_get_mb_info_cabac_nonmbaff;
 2142|  9.17k|    }
 2143|  12.5k|    else
 2144|  12.5k|    {
 2145|  12.5k|        SWITCHONTRACE;
 2146|  12.5k|        SWITCHOFFTRACECABAC;
 2147|  12.5k|        ps_svc_lyr_dec->pf_parse_svc_inter_slice = isvcd_parse_inter_slice_data_cavlc;
 2148|  12.5k|        ps_dec->pf_parse_inter_mb = ih264d_parse_bmb_cavlc;
 2149|  12.5k|        if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (2149:12): [True: 0, False: 12.5k]
  ------------------
 2150|      0|            ps_dec->pf_get_mb_info = ih264d_get_mb_info_cavlc_mbaff;
 2151|  12.5k|        else
 2152|  12.5k|            ps_dec->pf_get_mb_info = isvcd_get_mb_info_cavlc_nonmbaff;
 2153|  12.5k|    }
 2154|       |
 2155|  21.7k|    ret = ih264d_cal_col_pic(ps_dec);
 2156|  21.7k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  21.7k|#define OK        0
  ------------------
  |  Branch (2156:8): [True: 0, False: 21.7k]
  ------------------
 2157|  21.7k|    ps_dec->u1_B = 1;
 2158|  21.7k|    ps_dec->pf_mvpred_ref_tfr_nby2mb = ih264d_mv_pred_ref_tfr_nby2_bmb;
 2159|  21.7k|    ret = ps_svc_lyr_dec->pf_parse_svc_inter_slice(ps_svc_lyr_dec, ps_slice, u2_first_mb_in_slice);
 2160|  21.7k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  21.7k|#define OK        0
  ------------------
  |  Branch (2160:8): [True: 7.18k, False: 14.5k]
  ------------------
 2161|       |
 2162|  14.5k|    return OK;
  ------------------
  |  |  114|  14.5k|#define OK        0
  ------------------
 2163|  21.7k|}

isvcd_parse_islice_data_cabac:
  108|  3.77k|{
  109|  3.77k|    UWORD8 uc_more_data_flag;
  110|  3.77k|    UWORD32 u4_num_mbs, u4_mb_idx;
  111|  3.77k|    dec_mb_info_t *ps_cur_mb_info;
  112|  3.77k|    deblk_mb_t *ps_cur_deblk_mb;
  113|  3.77k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  114|  3.77k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
  115|  3.77k|    UWORD16 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
  116|  3.77k|    WORD32 i4_cur_mb_addr;
  117|  3.77k|    UWORD8 u1_mbaff;
  118|  3.77k|    UWORD32 u4_num_mbs_next, u4_end_of_row, u4_tfr_n_mb;
  119|  3.77k|    WORD32 ret = OK;
  ------------------
  |  |  114|  3.77k|#define OK        0
  ------------------
  120|       |
  121|  3.77k|    ps_dec->u1_qp = ps_slice->u1_slice_qp;
  122|  3.77k|    ih264d_update_qp(ps_dec, 0);
  123|  3.77k|    u1_mbaff = ps_slice->u1_mbaff_frame_flag;
  124|       |
  125|  3.77k|    if(ps_bitstrm->u4_ofst & 0x07)
  ------------------
  |  Branch (125:8): [True: 2.95k, False: 817]
  ------------------
  126|  2.95k|    {
  127|  2.95k|        ps_bitstrm->u4_ofst += 8;
  128|  2.95k|        ps_bitstrm->u4_ofst &= 0xFFFFFFF8;
  129|  2.95k|    }
  130|  3.77k|    ret = ih264d_init_cabac_dec_envirnoment(&(ps_dec->s_cab_dec_env), ps_bitstrm);
  131|  3.77k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  3.77k|#define OK        0
  ------------------
  |  Branch (131:8): [True: 284, False: 3.49k]
  ------------------
  132|  3.49k|    ih264d_init_cabac_contexts(I_SLICE, ps_dec);
  ------------------
  |  |  370|  3.49k|#define I_SLICE  2
  ------------------
  133|       |
  134|  3.49k|    ps_dec->i1_prev_mb_qp_delta = 0;
  135|       |
  136|       |    /* initializations */
  137|  3.49k|    u4_mb_idx = ps_dec->u4_mb_idx;
  138|  3.49k|    u4_num_mbs = u4_mb_idx;
  139|  3.49k|    uc_more_data_flag = 1;
  140|  3.49k|    i4_cur_mb_addr = u2_first_mb_in_slice << u1_mbaff;
  141|  3.49k|    do
  142|  74.4k|    {
  143|  74.4k|        UWORD16 u2_mbx;
  144|  74.4k|        ps_dec->pv_prev_mb_parse_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
  145|       |
  146|  74.4k|        if(i4_cur_mb_addr > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (146:12): [True: 94, False: 74.3k]
  ------------------
  147|     94|        {
  148|     94|            break;
  149|     94|        }
  150|       |
  151|  74.3k|        {
  152|  74.3k|            UWORD8 u1_mb_type;
  153|  74.3k|            ps_cur_mb_info = ps_dec->ps_nmb_info + u4_num_mbs;
  154|  74.3k|            ps_dec->u4_num_mbs_cur_nmb = u4_num_mbs;
  155|  74.3k|            ps_dec->u4_num_pmbair = (u4_num_mbs >> u1_mbaff);
  156|  74.3k|            ps_cur_mb_info->u1_end_of_slice = 0;
  157|       |
  158|       |            /***************************************************************/
  159|       |            /* Get the required information for decoding of MB                  */
  160|       |            /* mb_x, mb_y , neighbour availablity,                              */
  161|       |            /***************************************************************/
  162|  74.3k|            ps_dec->pf_get_mb_info(ps_dec, i4_cur_mb_addr, ps_cur_mb_info, 0);
  163|  74.3k|            u2_mbx = ps_dec->u2_mbx;
  164|       |
  165|       |            /*********************************************************************/
  166|       |            /* initialize u1_tran_form8x8 to zero to aviod uninitialized accesses */
  167|       |            /*********************************************************************/
  168|  74.3k|            ps_cur_mb_info->u1_tran_form8x8 = 0;
  169|  74.3k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  170|       |
  171|       |            /***************************************************************/
  172|       |            /* Set the deblocking parameters for this MB                   */
  173|       |            /***************************************************************/
  174|  74.3k|            ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u4_num_mbs;
  175|  74.3k|            if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (175:16): [True: 74.3k, False: 0]
  ------------------
  176|  74.3k|                ih264d_set_deblocking_parameters(ps_cur_deblk_mb, ps_slice,
  177|  74.3k|                                                 ps_dec->u1_mb_ngbr_availablity,
  178|  74.3k|                                                 ps_dec->u1_cur_mb_fld_dec_flag);
  179|       |
  180|  74.3k|            ps_cur_deblk_mb->u1_mb_type = ps_cur_deblk_mb->u1_mb_type | D_INTRA_MB;
  ------------------
  |  |  382|  74.3k|#define D_INTRA_MB        1
  ------------------
  181|       |
  182|       |            /* Macroblock Layer Begins */
  183|       |            /* Decode the u1_mb_type */
  184|  74.3k|            u1_mb_type = ih264d_parse_mb_type_intra_cabac(0, ps_dec);
  185|  74.3k|            if(u1_mb_type > 25) return ERROR_MB_TYPE;
  ------------------
  |  Branch (185:16): [True: 0, False: 74.3k]
  ------------------
  186|  74.3k|            ps_cur_mb_info->u1_mb_type = u1_mb_type;
  187|  74.3k|            COPYTHECONTEXT("u1_mb_type", u1_mb_type);
  188|       |
  189|       |            /* Parse Macroblock Data */
  190|  74.3k|            if(25 == u1_mb_type)
  ------------------
  |  Branch (190:16): [True: 827, False: 73.5k]
  ------------------
  191|    827|            {
  192|       |                /* I_PCM_MB */
  193|    827|                ps_cur_mb_info->ps_curmb->u1_mb_type = I_PCM_MB;
  ------------------
  |  |  423|    827|#define I_PCM_MB    6
  ------------------
  194|    827|                ret = ih264d_parse_ipcm_mb(ps_dec, ps_cur_mb_info, u4_num_mbs);
  195|    827|                if(ret != OK) return ret;
  ------------------
  |  |  114|    827|#define OK        0
  ------------------
  |  Branch (195:20): [True: 408, False: 419]
  ------------------
  196|    419|                ps_cur_deblk_mb->u1_mb_qp = 0;
  197|    419|            }
  198|  73.5k|            else
  199|  73.5k|            {
  200|  73.5k|                ret = ih264d_parse_imb_cabac(ps_dec, ps_cur_mb_info, u1_mb_type);
  201|  73.5k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  73.5k|#define OK        0
  ------------------
  |  Branch (201:20): [True: 2.38k, False: 71.1k]
  ------------------
  202|  71.1k|                ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
  203|  71.1k|            }
  204|       |
  205|  71.6k|            if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (205:16): [True: 0, False: 71.6k]
  ------------------
  206|      0|            {
  207|      0|                ih264d_populate_mb_info_map(ps_dec, ps_cur_mb_info, ps_cur_mb_info->u2_mbx << 1,
  208|      0|                                            ps_cur_mb_info->u2_mby << 1, ps_cur_deblk_mb->u1_mb_qp);
  209|      0|            }
  210|  71.6k|            if(u1_mbaff)
  ------------------
  |  Branch (210:16): [True: 0, False: 71.6k]
  ------------------
  211|      0|            {
  212|      0|                ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
  213|      0|            }
  214|       |
  215|  71.6k|            if(ps_cur_mb_info->u1_topmb && u1_mbaff)
  ------------------
  |  Branch (215:16): [True: 71.6k, False: 0]
  |  Branch (215:44): [True: 0, False: 71.6k]
  ------------------
  216|      0|                uc_more_data_flag = 1;
  217|  71.6k|            else
  218|  71.6k|            {
  219|  71.6k|                uc_more_data_flag = ih264d_decode_terminate(&ps_dec->s_cab_dec_env, ps_bitstrm);
  220|  71.6k|                uc_more_data_flag = !uc_more_data_flag;
  221|  71.6k|                COPYTHECONTEXT("Decode Sliceterm", !uc_more_data_flag);
  222|  71.6k|            }
  223|       |
  224|  71.6k|            if(u1_mbaff)
  ------------------
  |  Branch (224:16): [True: 0, False: 71.6k]
  ------------------
  225|      0|            {
  226|      0|                if(!uc_more_data_flag && (0 == (i4_cur_mb_addr & 1)))
  ------------------
  |  Branch (226:20): [True: 0, False: 0]
  |  Branch (226:42): [True: 0, False: 0]
  ------------------
  227|      0|                {
  228|      0|                    return ERROR_EOB_FLUSHBITS_T;
  229|      0|                }
  230|      0|            }
  231|       |            /* Next macroblock information */
  232|  71.6k|            i4_cur_mb_addr++;
  233|       |            /* Store the colocated information */
  234|  71.6k|            {
  235|  71.6k|                mv_pred_t *ps_mv_nmb_start = ps_dec->ps_mv_cur + (u4_num_mbs << 4);
  236|  71.6k|                mv_pred_t s_mvPred = {{0, 0, 0, 0}, {-1, -1}, 0, 0};
  237|  71.6k|                ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0,
  238|  71.6k|                                   (UWORD8) (ps_dec->u1_cur_mb_fld_dec_flag << 1), 4, 4);
  239|  71.6k|            }
  240|       |            /*if num _cores is set to 3,compute bs will be done in another thread*/
  241|  71.6k|            if(ps_dec->u4_num_cores < 3)
  ------------------
  |  Branch (241:16): [True: 71.6k, False: 0]
  ------------------
  242|  71.6k|            {
  243|  71.6k|                if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (243:20): [True: 71.6k, False: 0]
  ------------------
  244|  71.6k|                    ps_svc_lyr_dec->pf_svc_compute_bs(ps_svc_lyr_dec, ps_cur_mb_info,
  245|  71.6k|                                                      (UWORD16) (u4_num_mbs >> u1_mbaff));
  246|  71.6k|            }
  247|  71.6k|            u4_num_mbs++;
  248|  71.6k|        }
  249|       |
  250|       |        /****************************************************************/
  251|       |        /* Check for End Of Row                                         */
  252|       |        /****************************************************************/
  253|      0|        u4_num_mbs_next = i2_pic_wdin_mbs - u2_mbx - 1;
  254|  71.6k|        u4_end_of_row = (!u4_num_mbs_next) && (!(u1_mbaff && (u4_num_mbs & 0x01)));
  ------------------
  |  Branch (254:25): [True: 11.6k, False: 59.9k]
  |  Branch (254:50): [True: 0, False: 11.6k]
  |  Branch (254:62): [True: 0, False: 0]
  ------------------
  255|  71.6k|        u4_tfr_n_mb =
  256|  71.6k|            (u4_num_mbs == ps_dec->u4_recon_mb_grp) || u4_end_of_row || (!uc_more_data_flag);
  ------------------
  |  Branch (256:13): [True: 11.1k, False: 60.4k]
  |  Branch (256:56): [True: 509, False: 59.9k]
  |  Branch (256:73): [True: 455, False: 59.5k]
  ------------------
  257|  71.6k|        ps_cur_mb_info->u1_end_of_slice = (!uc_more_data_flag);
  258|       |
  259|  71.6k|        if(u4_tfr_n_mb || (!uc_more_data_flag))
  ------------------
  |  Branch (259:12): [True: 12.0k, False: 59.5k]
  |  Branch (259:27): [True: 0, False: 59.5k]
  ------------------
  260|  12.0k|        {
  261|  12.0k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (261:16): [True: 5.27k, False: 6.81k]
  ------------------
  262|  5.27k|            {
  263|  5.27k|                ih264d_parse_tfr_nmb(ps_dec, u4_mb_idx, u4_num_mbs, u4_num_mbs_next, u4_tfr_n_mb,
  264|  5.27k|                                     u4_end_of_row);
  265|  5.27k|                ps_dec->ps_nmb_info += u4_num_mbs;
  266|  5.27k|                ps_svc_lyr_dec->ps_svc_nmb_info += u4_num_mbs;
  267|  5.27k|            }
  268|  6.81k|            else
  269|  6.81k|            {
  270|  6.81k|                if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|  6.81k|#define TARGET_LAYER 2
  ------------------
  |  Branch (270:20): [True: 4.22k, False: 2.59k]
  ------------------
  271|  4.22k|                {
  272|  4.22k|                    ih264d_decode_recon_tfr_nmb(ps_dec, u4_mb_idx, u4_num_mbs, u4_num_mbs_next,
  273|  4.22k|                                                u4_tfr_n_mb, u4_end_of_row);
  274|  4.22k|                }
  275|  2.59k|                else
  276|  2.59k|                {
  277|  2.59k|                    isvcd_decode_recon_tfr_nmb_base_lyr(ps_svc_lyr_dec, u4_mb_idx, u4_num_mbs,
  278|  2.59k|                                                        u4_num_mbs_next, u4_tfr_n_mb,
  279|  2.59k|                                                        u4_end_of_row);
  280|  2.59k|                }
  281|  6.81k|            }
  282|  12.0k|            ps_dec->u4_total_mbs_coded += u4_num_mbs;
  283|  12.0k|            if(u4_tfr_n_mb) u4_num_mbs = 0;
  ------------------
  |  Branch (283:16): [True: 12.0k, False: 0]
  ------------------
  284|  12.0k|            u4_mb_idx = u4_num_mbs;
  285|  12.0k|            ps_dec->u4_mb_idx = u4_num_mbs;
  286|  12.0k|        }
  287|  71.6k|    } while(uc_more_data_flag);
  ------------------
  |  Branch (287:13): [True: 71.0k, False: 606]
  ------------------
  288|       |
  289|    700|    ps_dec->u4_num_mbs_cur_nmb = 0;
  290|    700|    ps_dec->ps_cur_slice->u4_mbs_in_slice = i4_cur_mb_addr - (u2_first_mb_in_slice << u1_mbaff);
  291|       |
  292|    700|    return ret;
  293|  3.49k|}
isvcd_parse_islice_data_cavlc:
  322|  2.06k|{
  323|  2.06k|    UWORD8 uc_more_data_flag;
  324|  2.06k|    UWORD32 u4_num_mbs, u4_mb_idx;
  325|  2.06k|    dec_mb_info_t *ps_cur_mb_info;
  326|  2.06k|    deblk_mb_t *ps_cur_deblk_mb;
  327|  2.06k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  328|  2.06k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
  329|  2.06k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  330|  2.06k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  331|  2.06k|    UWORD16 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
  332|  2.06k|    WORD32 i4_cur_mb_addr;
  333|  2.06k|    UWORD8 u1_mbaff;
  334|  2.06k|    UWORD32 u4_num_mbs_next, u4_end_of_row, u4_tfr_n_mb;
  335|  2.06k|    WORD32 ret = OK;
  ------------------
  |  |  114|  2.06k|#define OK        0
  ------------------
  336|       |
  337|  2.06k|    ps_dec->u1_qp = ps_slice->u1_slice_qp;
  338|  2.06k|    ih264d_update_qp(ps_dec, 0);
  339|  2.06k|    u1_mbaff = ps_slice->u1_mbaff_frame_flag;
  340|       |
  341|       |    /* initializations */
  342|  2.06k|    u4_mb_idx = ps_dec->u4_mb_idx;
  343|  2.06k|    u4_num_mbs = u4_mb_idx;
  344|       |
  345|  2.06k|    uc_more_data_flag = 1;
  346|  2.06k|    i4_cur_mb_addr = u2_first_mb_in_slice << u1_mbaff;
  347|  2.06k|    do
  348|  30.8k|    {
  349|  30.8k|        UWORD8 u1_mb_type;
  350|  30.8k|        ps_dec->pv_prev_mb_parse_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
  351|  30.8k|        if(i4_cur_mb_addr > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (351:12): [True: 82, False: 30.8k]
  ------------------
  352|     82|        {
  353|     82|            break;
  354|     82|        }
  355|       |
  356|  30.8k|        ps_cur_mb_info = ps_dec->ps_nmb_info + u4_num_mbs;
  357|  30.8k|        ps_dec->u4_num_mbs_cur_nmb = u4_num_mbs;
  358|  30.8k|        ps_dec->u4_num_pmbair = (u4_num_mbs >> u1_mbaff);
  359|  30.8k|        ps_cur_mb_info->u1_end_of_slice = 0;
  360|       |
  361|       |        /***************************************************************/
  362|       |        /* Get the required information for decoding of MB             */
  363|       |        /* mb_x, mb_y , neighbour availablity,                         */
  364|       |        /***************************************************************/
  365|  30.8k|        ps_dec->pf_get_mb_info(ps_dec, i4_cur_mb_addr, ps_cur_mb_info, 0);
  366|       |
  367|       |        /***************************************************************/
  368|       |        /* Set the deblocking parameters for this MB                   */
  369|       |        /***************************************************************/
  370|  30.8k|        ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u4_num_mbs;
  371|  30.8k|        if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (371:12): [True: 30.8k, False: 0]
  ------------------
  372|  30.8k|            ih264d_set_deblocking_parameters(ps_cur_deblk_mb, ps_slice,
  373|  30.8k|                                             ps_dec->u1_mb_ngbr_availablity,
  374|  30.8k|                                             ps_dec->u1_cur_mb_fld_dec_flag);
  375|       |
  376|  30.8k|        ps_cur_deblk_mb->u1_mb_type = ps_cur_deblk_mb->u1_mb_type | D_INTRA_MB;
  ------------------
  |  |  382|  30.8k|#define D_INTRA_MB        1
  ------------------
  377|       |
  378|       |        /**************************************************************/
  379|       |        /* Macroblock Layer Begins, Decode the u1_mb_type             */
  380|       |        /**************************************************************/
  381|       |        /* Inlined ih264d_uev */
  382|  30.8k|        {
  383|  30.8k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  384|  30.8k|            UWORD32 u4_word, u4_ldz, u4_temp;
  385|       |
  386|       |            /***************************************************************/
  387|       |            /* Find leading zeros in next 32 bits                          */
  388|       |            /***************************************************************/
  389|  30.8k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  30.8k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  30.8k|{                                                                           \
  |  |  152|  30.8k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  30.8k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  30.8k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  30.8k|                                                                            \
  |  |  156|  30.8k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  30.8k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 30.1k, False: 631]
  |  |  ------------------
  |  |  158|  30.8k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  30.1k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  30.8k|}
  ------------------
  390|  30.8k|            u4_ldz = CLZ(u4_word);
  391|       |            /* Flush the ps_bitstrm */
  392|  30.8k|            u4_bitstream_offset += (u4_ldz + 1);
  393|       |            /* Read the suffix from the ps_bitstrm */
  394|  30.8k|            u4_word = 0;
  395|  30.8k|            if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  19.5k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  19.5k|{                                                                           \
  |  |  122|  19.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  19.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  19.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  19.5k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  19.5k|                                                                            \
  |  |  127|  19.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 19.0k, False: 494]
  |  |  ------------------
  |  |  128|  19.5k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  19.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  19.5k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  19.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  19.5k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  19.5k|}                                                                           \
  ------------------
  |  Branch (395:16): [True: 19.5k, False: 11.2k]
  ------------------
  396|  30.8k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  397|  30.8k|            u4_temp = ((1 << u4_ldz) + u4_word - 1);
  398|  30.8k|            if(u4_temp > 25) return ERROR_MB_TYPE;
  ------------------
  |  Branch (398:16): [True: 125, False: 30.6k]
  ------------------
  399|  30.6k|            u1_mb_type = u4_temp;
  400|  30.6k|        }
  401|       |        /* Inlined ih264d_uev */
  402|      0|        ps_cur_mb_info->u1_mb_type = u1_mb_type;
  403|  30.6k|        COPYTHECONTEXT("u1_mb_type", u1_mb_type);
  404|       |
  405|       |        /**************************************************************/
  406|       |        /* Parse Macroblock data                                      */
  407|       |        /**************************************************************/
  408|  30.6k|        if(25 == u1_mb_type)
  ------------------
  |  Branch (408:12): [True: 73, False: 30.6k]
  ------------------
  409|     73|        {
  410|       |            /* I_PCM_MB */
  411|     73|            ps_cur_mb_info->ps_curmb->u1_mb_type = I_PCM_MB;
  ------------------
  |  |  423|     73|#define I_PCM_MB    6
  ------------------
  412|     73|            ret = ih264d_parse_ipcm_mb(ps_dec, ps_cur_mb_info, u4_num_mbs);
  413|     73|            if(ret != OK) return ret;
  ------------------
  |  |  114|     73|#define OK        0
  ------------------
  |  Branch (413:16): [True: 0, False: 73]
  ------------------
  414|     73|            ps_cur_deblk_mb->u1_mb_qp = 0;
  415|     73|        }
  416|  30.6k|        else
  417|  30.6k|        {
  418|  30.6k|            ret = ih264d_parse_imb_cavlc(ps_dec, ps_cur_mb_info, u4_num_mbs, u1_mb_type);
  419|  30.6k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  30.6k|#define OK        0
  ------------------
  |  Branch (419:16): [True: 1.72k, False: 28.8k]
  ------------------
  420|  28.8k|            ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
  421|  28.8k|        }
  422|  28.9k|        if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (422:12): [True: 0, False: 28.9k]
  ------------------
  423|      0|        {
  424|      0|            ih264d_populate_mb_info_map(ps_dec, ps_cur_mb_info, ps_cur_mb_info->u2_mbx << 1,
  425|      0|                                        ps_cur_mb_info->u2_mby << 1, ps_cur_deblk_mb->u1_mb_qp);
  426|      0|        }
  427|  28.9k|        uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
  ------------------
  |  |   97|  28.9k|    CHECK_BITS_SUFFICIENT(ps_bitstrm, 1)
  |  |  ------------------
  |  |  |  |   95|  28.9k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  ------------------
  428|  28.9k|        if(u1_mbaff)
  ------------------
  |  Branch (428:12): [True: 0, False: 28.9k]
  ------------------
  429|      0|        {
  430|      0|            ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
  431|      0|            if(!uc_more_data_flag && (0 == (i4_cur_mb_addr & 1)))
  ------------------
  |  Branch (431:16): [True: 0, False: 0]
  |  Branch (431:38): [True: 0, False: 0]
  ------------------
  432|      0|            {
  433|      0|                return ERROR_EOB_FLUSHBITS_T;
  434|      0|            }
  435|      0|        }
  436|       |        /**************************************************************/
  437|       |        /* Get next Macroblock address                                */
  438|       |        /**************************************************************/
  439|  28.9k|        i4_cur_mb_addr++;
  440|       |        /* Store the colocated information */
  441|  28.9k|        {
  442|  28.9k|            mv_pred_t *ps_mv_nmb_start = ps_dec->ps_mv_cur + (u4_num_mbs << 4);
  443|  28.9k|            mv_pred_t s_mvPred = {{0, 0, 0, 0}, {-1, -1}, 0, 0};
  444|  28.9k|            ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0,
  445|  28.9k|                               (UWORD8) (ps_dec->u1_cur_mb_fld_dec_flag << 1), 4, 4);
  446|  28.9k|        }
  447|       |
  448|       |        /*if num _cores is set to 3,compute bs will be done in another thread*/
  449|  28.9k|        if(ps_dec->u4_num_cores < 3)
  ------------------
  |  Branch (449:12): [True: 28.9k, False: 0]
  ------------------
  450|  28.9k|        {
  451|  28.9k|            if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (451:16): [True: 28.9k, False: 0]
  ------------------
  452|  28.9k|                ps_svc_lyr_dec->pf_svc_compute_bs(ps_svc_lyr_dec, ps_cur_mb_info,
  453|  28.9k|                                                  (UWORD16) (u4_num_mbs >> u1_mbaff));
  454|  28.9k|        }
  455|  28.9k|        u4_num_mbs++;
  456|       |
  457|       |        /****************************************************************/
  458|       |        /* Check for End Of Row                                         */
  459|       |        /****************************************************************/
  460|  28.9k|        u4_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
  461|  28.9k|        u4_end_of_row = (!u4_num_mbs_next) && (!(u1_mbaff && (u4_num_mbs & 0x01)));
  ------------------
  |  Branch (461:25): [True: 5.12k, False: 23.8k]
  |  Branch (461:50): [True: 0, False: 5.12k]
  |  Branch (461:62): [True: 0, False: 0]
  ------------------
  462|  28.9k|        u4_tfr_n_mb =
  463|  28.9k|            (u4_num_mbs == ps_dec->u4_recon_mb_grp) || u4_end_of_row || (!uc_more_data_flag);
  ------------------
  |  Branch (463:13): [True: 5.03k, False: 23.9k]
  |  Branch (463:56): [True: 95, False: 23.8k]
  |  Branch (463:73): [True: 115, False: 23.7k]
  ------------------
  464|  28.9k|        ps_cur_mb_info->u1_end_of_slice = (!uc_more_data_flag);
  465|       |
  466|  28.9k|        if(u4_tfr_n_mb || (!uc_more_data_flag))
  ------------------
  |  Branch (466:12): [True: 5.24k, False: 23.7k]
  |  Branch (466:27): [True: 0, False: 23.7k]
  ------------------
  467|  5.24k|        {
  468|  5.24k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (468:16): [True: 1.85k, False: 3.38k]
  ------------------
  469|  1.85k|            {
  470|  1.85k|                ih264d_parse_tfr_nmb(ps_dec, u4_mb_idx, u4_num_mbs, u4_num_mbs_next, u4_tfr_n_mb,
  471|  1.85k|                                     u4_end_of_row);
  472|  1.85k|                ps_dec->ps_nmb_info += u4_num_mbs;
  473|  1.85k|                ps_svc_lyr_dec->ps_svc_nmb_info += u4_num_mbs;
  474|  1.85k|            }
  475|  3.38k|            else
  476|  3.38k|            {
  477|  3.38k|                if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|  3.38k|#define TARGET_LAYER 2
  ------------------
  |  Branch (477:20): [True: 3.10k, False: 278]
  ------------------
  478|  3.10k|                {
  479|  3.10k|                    ih264d_decode_recon_tfr_nmb(ps_dec, u4_mb_idx, u4_num_mbs, u4_num_mbs_next,
  480|  3.10k|                                                u4_tfr_n_mb, u4_end_of_row);
  481|  3.10k|                }
  482|    278|                else
  483|    278|                {
  484|    278|                    isvcd_decode_recon_tfr_nmb_base_lyr(ps_svc_lyr_dec, u4_mb_idx, u4_num_mbs,
  485|    278|                                                        u4_num_mbs_next, u4_tfr_n_mb,
  486|    278|                                                        u4_end_of_row);
  487|    278|                }
  488|  3.38k|            }
  489|  5.24k|            ps_dec->u4_total_mbs_coded += u4_num_mbs;
  490|  5.24k|            if(u4_tfr_n_mb) u4_num_mbs = 0;
  ------------------
  |  Branch (490:16): [True: 5.24k, False: 0]
  ------------------
  491|  5.24k|            u4_mb_idx = u4_num_mbs;
  492|  5.24k|            ps_dec->u4_mb_idx = u4_num_mbs;
  493|  5.24k|        }
  494|  28.9k|    } while(uc_more_data_flag);
  ------------------
  |  Branch (494:13): [True: 28.8k, False: 132]
  ------------------
  495|       |
  496|    214|    ps_dec->u4_num_mbs_cur_nmb = 0;
  497|    214|    ps_dec->ps_cur_slice->u4_mbs_in_slice = i4_cur_mb_addr - (u2_first_mb_in_slice << u1_mbaff);
  498|       |
  499|    214|    return ret;
  500|  2.06k|}
isvcd_parse_imb_cavlc:
  517|   217k|{
  518|   217k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  519|   217k|    WORD32 i4_delta_qp;
  520|   217k|    UWORD32 u4_temp;
  521|   217k|    UWORD32 ui_is_top_mb_available;
  522|   217k|    UWORD32 ui_is_left_mb_available;
  523|   217k|    UWORD32 u4_cbp;
  524|   217k|    UWORD32 u4_offset;
  525|   217k|    UWORD32 *pu4_bitstrm_buf;
  526|   217k|    WORD32 ret;
  527|   217k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
  528|   217k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  529|   217k|    UNUSED(u4_mb_num);
  ------------------
  |  |   45|   217k|#define UNUSED(x) ((void)(x))
  ------------------
  530|       |
  531|   217k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
  532|   217k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  533|   217k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
  534|   217k|    u4_temp = ps_dec->u1_mb_ngbr_availablity;
  535|   217k|    ui_is_top_mb_available = BOOLEAN(u4_temp & TOP_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|   217k|#define BOOLEAN(x) (!!(x))
  ------------------
  536|   217k|    ui_is_left_mb_available = BOOLEAN(u4_temp & LEFT_MB_AVAILABLE_MASK);
  ------------------
  |  |   61|   217k|#define BOOLEAN(x) (!!(x))
  ------------------
  537|   217k|    pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  538|       |
  539|   217k|    ps_cur_mb_info->ps_curmb->u1_mb_type = P_MB;
  ------------------
  |  |  419|   217k|#define P_MB        2
  ------------------
  540|   217k|    if(!ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (540:8): [True: 16.6k, False: 200k]
  ------------------
  541|  16.6k|    {
  542|  16.6k|        if(u1_mb_type == I_4x4_MB)
  ------------------
  |  |  417|  16.6k|#define I_4x4_MB    0
  ------------------
  |  Branch (542:12): [True: 7.56k, False: 9.10k]
  ------------------
  543|  7.56k|        {
  544|  7.56k|            ps_cur_mb_info->ps_curmb->u1_mb_type = I_4x4_MB;
  ------------------
  |  |  417|  7.56k|#define I_4x4_MB    0
  ------------------
  545|  7.56k|            u4_offset = 0;
  546|       |
  547|       |            /*--------------------------------------------------------------------*/
  548|       |            /* Read transform_size_8x8_flag if present                            */
  549|       |            /*--------------------------------------------------------------------*/
  550|  7.56k|            if(ps_dec->ps_cur_pps->i4_transform_8x8_mode_flag)
  ------------------
  |  Branch (550:16): [True: 6.39k, False: 1.16k]
  ------------------
  551|  6.39k|            {
  552|  6.39k|                ps_cur_mb_info->u1_tran_form8x8 = ih264d_get_bit_h264(ps_bitstrm);
  553|  6.39k|                COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  554|  6.39k|                ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  555|  6.39k|            }
  556|       |
  557|       |            /*--------------------------------------------------------------------*/
  558|       |            /* Read the IntraPrediction modes for LUMA                            */
  559|       |            /*--------------------------------------------------------------------*/
  560|  7.56k|            if(!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (560:16): [True: 1.65k, False: 5.91k]
  ------------------
  561|  1.65k|            {
  562|  1.65k|                UWORD8 *pu1_temp;
  563|  1.65k|                ih264d_read_intra_pred_modes(ps_dec, ((UWORD8 *) ps_dec->pv_parse_tu_coeff_data),
  564|  1.65k|                                             ((UWORD8 *) ps_dec->pv_parse_tu_coeff_data + 16),
  565|  1.65k|                                             ps_cur_mb_info->u1_tran_form8x8);
  566|  1.65k|                pu1_temp = (UWORD8 *) ps_dec->pv_parse_tu_coeff_data;
  567|  1.65k|                pu1_temp += 32;
  568|  1.65k|                ps_dec->pv_parse_tu_coeff_data = (void *) pu1_temp;
  569|  1.65k|            }
  570|  5.91k|            else
  571|  5.91k|            {
  572|  5.91k|                UWORD8 *pu1_temp;
  573|  5.91k|                ih264d_read_intra_pred_modes(ps_dec, ((UWORD8 *) ps_dec->pv_parse_tu_coeff_data),
  574|  5.91k|                                             ((UWORD8 *) ps_dec->pv_parse_tu_coeff_data + 4),
  575|  5.91k|                                             ps_cur_mb_info->u1_tran_form8x8);
  576|  5.91k|                pu1_temp = (UWORD8 *) ps_dec->pv_parse_tu_coeff_data;
  577|  5.91k|                pu1_temp += 8;
  578|  5.91k|                ps_dec->pv_parse_tu_coeff_data = (void *) pu1_temp;
  579|  5.91k|            }
  580|       |            /*--------------------------------------------------------------------*/
  581|       |            /* Read the IntraPrediction mode for CHROMA                           */
  582|       |            /*--------------------------------------------------------------------*/
  583|       |            /* Inlined ih264d_uev */
  584|  7.56k|            {
  585|  7.56k|                UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  586|  7.56k|                UWORD32 u4_word, u4_ldz, u4_temp;
  587|       |
  588|       |                /***************************************************************/
  589|       |                /* Find leading zeros in next 32 bits                          */
  590|       |                /***************************************************************/
  591|  7.56k|                NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  7.56k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  7.56k|{                                                                           \
  |  |  152|  7.56k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  7.56k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  7.56k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  7.56k|                                                                            \
  |  |  156|  7.56k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  7.56k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 7.19k, False: 367]
  |  |  ------------------
  |  |  158|  7.56k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  7.19k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  7.56k|}
  ------------------
  592|  7.56k|                u4_ldz = CLZ(u4_word);
  593|       |                /* Flush the ps_bitstrm */
  594|  7.56k|                u4_bitstream_offset += (u4_ldz + 1);
  595|       |                /* Read the suffix from the ps_bitstrm */
  596|  7.56k|                u4_word = 0;
  597|  7.56k|                if(u4_ldz)
  ------------------
  |  Branch (597:20): [True: 1.42k, False: 6.14k]
  ------------------
  598|  1.42k|                {
  599|  1.42k|                    GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  1.42k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  1.42k|{                                                                           \
  |  |  122|  1.42k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  1.42k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  1.42k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  1.42k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  1.42k|                                                                            \
  |  |  127|  1.42k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 1.07k, False: 353]
  |  |  ------------------
  |  |  128|  1.42k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  1.07k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  1.42k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  1.42k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  1.42k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  1.42k|}                                                                           \
  ------------------
  600|  1.42k|                }
  601|  7.56k|                *pu4_bitstrm_ofst = u4_bitstream_offset;
  602|  7.56k|                u4_temp = ((1 << u4_ldz) + u4_word - 1);
  603|  7.56k|                if(u4_temp > 3)
  ------------------
  |  Branch (603:20): [True: 333, False: 7.23k]
  ------------------
  604|    333|                {
  605|    333|                    return ERROR_CHROMA_PRED_MODE;
  606|    333|                }
  607|  7.23k|                ps_cur_mb_info->u1_chroma_pred_mode = u4_temp;
  608|  7.23k|                COPYTHECONTEXT("intra_chroma_pred_mode", ps_cur_mb_info->u1_chroma_pred_mode);
  609|  7.23k|            }
  610|       |            /*--------------------------------------------------------------------*/
  611|       |            /* Read the Coded block pattern                                       */
  612|       |            /*--------------------------------------------------------------------*/
  613|      0|            {
  614|  7.23k|                UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  615|  7.23k|                UWORD32 u4_word, u4_ldz;
  616|       |
  617|       |                /***************************************************************/
  618|       |                /* Find leading zeros in next 32 bits                          */
  619|       |                /***************************************************************/
  620|  7.23k|                NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  7.23k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  7.23k|{                                                                           \
  |  |  152|  7.23k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  7.23k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  7.23k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  7.23k|                                                                            \
  |  |  156|  7.23k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  7.23k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 6.85k, False: 376]
  |  |  ------------------
  |  |  158|  7.23k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  6.85k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  7.23k|}
  ------------------
  621|  7.23k|                u4_ldz = CLZ(u4_word);
  622|       |                /* Flush the ps_bitstrm */
  623|  7.23k|                u4_bitstream_offset += (u4_ldz + 1);
  624|       |                /* Read the suffix from the ps_bitstrm */
  625|  7.23k|                u4_word = 0;
  626|  7.23k|                if(u4_ldz)
  ------------------
  |  Branch (626:20): [True: 2.05k, False: 5.17k]
  ------------------
  627|  2.05k|                {
  628|  2.05k|                    GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  2.05k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  2.05k|{                                                                           \
  |  |  122|  2.05k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  2.05k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  2.05k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  2.05k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  2.05k|                                                                            \
  |  |  127|  2.05k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 1.84k, False: 213]
  |  |  ------------------
  |  |  128|  2.05k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  1.84k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  2.05k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  2.05k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  2.05k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  2.05k|}                                                                           \
  ------------------
  629|  2.05k|                }
  630|  7.23k|                *pu4_bitstrm_ofst = u4_bitstream_offset;
  631|  7.23k|                u4_cbp = ((1 << u4_ldz) + u4_word - 1);
  632|  7.23k|            }
  633|  7.23k|            if(u4_cbp > 47)
  ------------------
  |  Branch (633:16): [True: 289, False: 6.94k]
  ------------------
  634|    289|            {
  635|    289|                return ERROR_CBP;
  636|    289|            }
  637|       |
  638|  6.94k|            u4_cbp = gau1_ih264d_cbp_table[u4_cbp][0];
  639|  6.94k|            COPYTHECONTEXT("coded_block_pattern", u4_cbp);
  640|  6.94k|            ps_cur_mb_info->u1_cbp = u4_cbp;
  641|       |
  642|       |            /*--------------------------------------------------------------------*/
  643|       |            /* Read mb_qp_delta                                                   */
  644|       |            /*--------------------------------------------------------------------*/
  645|  6.94k|            if(ps_cur_mb_info->u1_cbp)
  ------------------
  |  Branch (645:16): [True: 6.57k, False: 373]
  ------------------
  646|  6.57k|            {
  647|  6.57k|                UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  648|  6.57k|                UWORD32 u4_word, u4_ldz, u4_abs_val;
  649|       |
  650|       |                /***************************************************************/
  651|       |                /* Find leading zeros in next 32 bits                          */
  652|       |                /***************************************************************/
  653|  6.57k|                NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  6.57k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  6.57k|{                                                                           \
  |  |  152|  6.57k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  6.57k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  6.57k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  6.57k|                                                                            \
  |  |  156|  6.57k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  6.57k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 6.25k, False: 314]
  |  |  ------------------
  |  |  158|  6.57k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  6.25k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  6.57k|}
  ------------------
  654|  6.57k|                u4_ldz = CLZ(u4_word);
  655|       |
  656|       |                /* Flush the ps_bitstrm */
  657|  6.57k|                u4_bitstream_offset += (u4_ldz + 1);
  658|       |
  659|       |                /* Read the suffix from the ps_bitstrm */
  660|  6.57k|                u4_word = 0;
  661|  6.57k|                if(u4_ldz)
  ------------------
  |  Branch (661:20): [True: 2.62k, False: 3.94k]
  ------------------
  662|  2.62k|                {
  663|  2.62k|                    GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  2.62k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  2.62k|{                                                                           \
  |  |  122|  2.62k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  2.62k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  2.62k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  2.62k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  2.62k|                                                                            \
  |  |  127|  2.62k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.06k, False: 560]
  |  |  ------------------
  |  |  128|  2.62k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.06k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  2.62k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  2.62k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  2.62k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  2.62k|}                                                                           \
  ------------------
  664|  2.62k|                }
  665|       |
  666|  6.57k|                *pu4_bitstrm_ofst = u4_bitstream_offset;
  667|  6.57k|                u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  668|       |
  669|  6.57k|                if(u4_word & 0x1)
  ------------------
  |  Branch (669:20): [True: 2.02k, False: 4.54k]
  ------------------
  670|  2.02k|                {
  671|  2.02k|                    i4_delta_qp = (-(WORD32) u4_abs_val);
  672|  2.02k|                }
  673|  4.54k|                else
  674|  4.54k|                {
  675|  4.54k|                    i4_delta_qp = (u4_abs_val);
  676|  4.54k|                }
  677|       |
  678|  6.57k|                if((i4_delta_qp < -26) || (i4_delta_qp > 25))
  ------------------
  |  Branch (678:20): [True: 159, False: 6.41k]
  |  Branch (678:43): [True: 240, False: 6.17k]
  ------------------
  679|    399|                {
  680|    399|                    return ERROR_INV_RANGE_QP_T;
  681|    399|                }
  682|       |
  683|  6.17k|                COPYTHECONTEXT("mb_qp_delta", i1_delta_qp);
  684|  6.17k|                if(i4_delta_qp != 0)
  ------------------
  |  Branch (684:20): [True: 2.22k, False: 3.94k]
  ------------------
  685|  2.22k|                {
  686|  2.22k|                    ret = ih264d_update_qp(ps_dec, (WORD8) i4_delta_qp);
  687|  2.22k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  2.22k|#define OK        0
  ------------------
  |  Branch (687:24): [True: 0, False: 2.22k]
  ------------------
  688|  2.22k|                }
  689|  6.17k|            }
  690|  6.94k|        }
  691|  9.10k|        else
  692|  9.10k|        {
  693|  9.10k|            u4_offset = 1;
  694|  9.10k|            ps_cur_mb_info->ps_curmb->u1_mb_type = I_16x16_MB;
  ------------------
  |  |  418|  9.10k|#define I_16x16_MB  1
  ------------------
  695|       |            /*-------------------------------------------------------------------*/
  696|       |            /* Read the IntraPrediction mode for CHROMA                          */
  697|       |            /*-------------------------------------------------------------------*/
  698|  9.10k|            {
  699|  9.10k|                UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  700|  9.10k|                UWORD32 u4_word, u4_ldz;
  701|       |
  702|       |                /***************************************************************/
  703|       |                /* Find leading zeros in next 32 bits                          */
  704|       |                /***************************************************************/
  705|  9.10k|                NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  9.10k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  9.10k|{                                                                           \
  |  |  152|  9.10k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  9.10k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  9.10k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  9.10k|                                                                            \
  |  |  156|  9.10k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  9.10k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 8.44k, False: 654]
  |  |  ------------------
  |  |  158|  9.10k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  8.44k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  9.10k|}
  ------------------
  706|  9.10k|                u4_ldz = CLZ(u4_word);
  707|       |                /* Flush the ps_bitstrm */
  708|  9.10k|                u4_bitstream_offset += (u4_ldz + 1);
  709|       |                /* Read the suffix from the ps_bitstrm */
  710|  9.10k|                u4_word = 0;
  711|  9.10k|                if(u4_ldz)
  ------------------
  |  Branch (711:20): [True: 4.24k, False: 4.85k]
  ------------------
  712|  4.24k|                {
  713|  4.24k|                    GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  4.24k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  4.24k|{                                                                           \
  |  |  122|  4.24k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  4.24k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  4.24k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  4.24k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  4.24k|                                                                            \
  |  |  127|  4.24k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 3.59k, False: 649]
  |  |  ------------------
  |  |  128|  4.24k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  3.59k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  4.24k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  4.24k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  4.24k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  4.24k|}                                                                           \
  ------------------
  714|  4.24k|                }
  715|  9.10k|                *pu4_bitstrm_ofst = u4_bitstream_offset;
  716|  9.10k|                u4_temp = ((1 << u4_ldz) + u4_word - 1);
  717|       |
  718|       |                /* Inlined ih264d_uev */
  719|  9.10k|                if(u4_temp > 3)
  ------------------
  |  Branch (719:20): [True: 543, False: 8.55k]
  ------------------
  720|    543|                {
  721|    543|                    return ERROR_CHROMA_PRED_MODE;
  722|    543|                }
  723|  8.55k|                ps_cur_mb_info->u1_chroma_pred_mode = u4_temp;
  724|  8.55k|                COPYTHECONTEXT("intra_chroma_pred_mode", ps_cur_mb_info->u1_chroma_pred_mode);
  725|  8.55k|            }
  726|       |            /*-------------------------------------------------------------------*/
  727|       |            /* Read the Coded block pattern                                      */
  728|       |            /*-------------------------------------------------------------------*/
  729|      0|            u4_cbp = gau1_ih264d_cbp_tab[(u1_mb_type - 1) >> 2];
  730|  8.55k|            ps_cur_mb_info->u1_cbp = u4_cbp;
  731|       |
  732|       |            /*-------------------------------------------------------------------*/
  733|       |            /* Read mb_qp_delta                                                  */
  734|       |            /*-------------------------------------------------------------------*/
  735|  8.55k|            {
  736|  8.55k|                UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  737|  8.55k|                UWORD32 u4_word, u4_ldz, u4_abs_val;
  738|       |
  739|       |                /***************************************************************/
  740|       |                /* Find leading zeros in next 32 bits                          */
  741|       |                /***************************************************************/
  742|  8.55k|                NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  8.55k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  8.55k|{                                                                           \
  |  |  152|  8.55k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  8.55k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  8.55k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  8.55k|                                                                            \
  |  |  156|  8.55k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  8.55k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 8.26k, False: 297]
  |  |  ------------------
  |  |  158|  8.55k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  8.26k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  8.55k|}
  ------------------
  743|  8.55k|                u4_ldz = CLZ(u4_word);
  744|       |
  745|       |                /* Flush the ps_bitstrm */
  746|  8.55k|                u4_bitstream_offset += (u4_ldz + 1);
  747|       |
  748|       |                /* Read the suffix from the ps_bitstrm */
  749|  8.55k|                u4_word = 0;
  750|  8.55k|                if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  2.57k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  2.57k|{                                                                           \
  |  |  122|  2.57k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  2.57k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  2.57k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  2.57k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  2.57k|                                                                            \
  |  |  127|  2.57k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.18k, False: 398]
  |  |  ------------------
  |  |  128|  2.57k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.18k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  2.57k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  2.57k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  2.57k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  2.57k|}                                                                           \
  ------------------
  |  Branch (750:20): [True: 2.57k, False: 5.98k]
  ------------------
  751|       |
  752|  8.55k|                *pu4_bitstrm_ofst = u4_bitstream_offset;
  753|  8.55k|                u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  754|       |
  755|  8.55k|                if(u4_word & 0x1)
  ------------------
  |  Branch (755:20): [True: 1.28k, False: 7.27k]
  ------------------
  756|  1.28k|                    i4_delta_qp = (-(WORD32) u4_abs_val);
  757|  7.27k|                else
  758|  7.27k|                    i4_delta_qp = (u4_abs_val);
  759|       |
  760|  8.55k|                if((i4_delta_qp < -26) || (i4_delta_qp > 25)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  Branch (760:20): [True: 78, False: 8.48k]
  |  Branch (760:43): [True: 82, False: 8.39k]
  ------------------
  761|  8.55k|            }
  762|       |            /* inlinined ih264d_sev */
  763|  8.39k|            COPYTHECONTEXT("Delta quant", i1_delta_qp);
  764|       |
  765|  8.39k|            if(i4_delta_qp != 0)
  ------------------
  |  Branch (765:16): [True: 2.41k, False: 5.98k]
  ------------------
  766|  2.41k|            {
  767|  2.41k|                ret = ih264d_update_qp(ps_dec, (WORD8) i4_delta_qp);
  768|  2.41k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  2.41k|#define OK        0
  ------------------
  |  Branch (768:20): [True: 0, False: 2.41k]
  ------------------
  769|  2.41k|            }
  770|       |
  771|  8.39k|            {
  772|  8.39k|                WORD16 i_scaleFactor;
  773|  8.39k|                UWORD32 ui_N = 0;
  774|  8.39k|                WORD16 *pi2_scale_matrix_ptr;
  775|       |                /*******************************************************************/
  776|       |                /* for luma DC coefficients the scaling is done during the parsing */
  777|       |                /* to preserve the precision                                       */
  778|       |                /*******************************************************************/
  779|  8.39k|                if(ps_dec->s_high_profile.u1_scaling_present)
  ------------------
  |  Branch (779:20): [True: 3.51k, False: 4.88k]
  ------------------
  780|  3.51k|                {
  781|  3.51k|                    pi2_scale_matrix_ptr = ps_dec->s_high_profile.i2_scalinglist4x4[0];
  782|  3.51k|                }
  783|  4.88k|                else
  784|  4.88k|                {
  785|  4.88k|                    i_scaleFactor = 16;
  786|  4.88k|                    pi2_scale_matrix_ptr = &i_scaleFactor;
  787|  4.88k|                }
  788|       |
  789|       |                /*---------------------------------------------------------------*/
  790|       |                /* Decode DC coefficients                                        */
  791|       |                /*---------------------------------------------------------------*/
  792|       |                /*---------------------------------------------------------------*/
  793|       |                /* Calculation of N                                              */
  794|       |                /*---------------------------------------------------------------*/
  795|  8.39k|                if(ui_is_left_mb_available)
  ------------------
  |  Branch (795:20): [True: 5.25k, False: 3.14k]
  ------------------
  796|  5.25k|                {
  797|  5.25k|                    if(ui_is_top_mb_available)
  ------------------
  |  Branch (797:24): [True: 4.31k, False: 938]
  ------------------
  798|  4.31k|                    {
  799|  4.31k|                        ui_N = ((ps_cur_mb_info->ps_top_mb->pu1_nnz_y[0] +
  800|  4.31k|                                 ps_dec->pu1_left_nnz_y[0] + 1) >>
  801|  4.31k|                                1);
  802|  4.31k|                    }
  803|    938|                    else
  804|    938|                    {
  805|    938|                        ui_N = ps_dec->pu1_left_nnz_y[0];
  806|    938|                    }
  807|  5.25k|                }
  808|  3.14k|                else if(ui_is_top_mb_available)
  ------------------
  |  Branch (808:25): [True: 2.10k, False: 1.04k]
  ------------------
  809|  2.10k|                {
  810|  2.10k|                    ui_N = ps_cur_mb_info->ps_top_mb->pu1_nnz_y[0];
  811|  2.10k|                }
  812|       |
  813|  8.39k|                {
  814|  8.39k|                    WORD16 pi2_dc_coef[16] = {0};
  815|  8.39k|                    WORD32 pi4_tmp[16] = {0};
  816|  8.39k|                    tu_sblk4x4_coeff_data_t *ps_tu_4x4 =
  817|  8.39k|                        (tu_sblk4x4_coeff_data_t *) ps_dec->pv_parse_tu_coeff_data;
  818|  8.39k|                    WORD16 *pi2_coeff_block = (WORD16 *) ps_dec->pv_parse_tu_coeff_data;
  819|  8.39k|                    UWORD32 u4_num_coeff;
  820|  8.39k|                    ps_tu_4x4->u2_sig_coeff_map = 0;
  821|  8.39k|                    ret = ps_dec->pf_cavlc_parse4x4coeff[(ui_N > 7)](pi2_dc_coef, 0, ui_N, ps_dec,
  822|  8.39k|                                                                     &u4_num_coeff);
  823|  8.39k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  8.39k|#define OK        0
  ------------------
  |  Branch (823:24): [True: 88, False: 8.31k]
  ------------------
  824|       |
  825|  8.31k|                    if(EXCEED_OFFSET(ps_bitstrm)) return ERROR_EOB_TERMINATE_T;
  ------------------
  |  |   93|  8.31k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 145, False: 8.16k]
  |  |  ------------------
  ------------------
  826|  8.16k|                    if(ps_tu_4x4->u2_sig_coeff_map)
  ------------------
  |  Branch (826:24): [True: 2.40k, False: 5.76k]
  ------------------
  827|  2.40k|                    {
  828|  2.40k|                        memset(pi2_dc_coef, 0, sizeof(pi2_dc_coef));
  829|  2.40k|                        ih264d_unpack_coeff4x4_dc_4x4blk(ps_tu_4x4, pi2_dc_coef,
  830|  2.40k|                                                         ps_dec->pu1_inv_scan);
  831|       |
  832|  2.40k|                        PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  2.40k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
  833|  2.40k|                        ps_dec->pf_ihadamard_scaling_4x4(
  834|  2.40k|                            pi2_dc_coef, pi2_coeff_block, ps_dec->pu2_quant_scale_y,
  835|  2.40k|                            (UWORD16 *) pi2_scale_matrix_ptr, ps_dec->u1_qp_y_div6, pi4_tmp);
  836|  2.40k|                        pi2_coeff_block += 16;
  837|  2.40k|                        ps_dec->pv_parse_tu_coeff_data = (void *) pi2_coeff_block;
  838|  2.40k|                        SET_BIT(ps_cur_mb_info->u1_yuv_dc_block_flag, 0);
  ------------------
  |  |  106|  2.40k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
  839|  2.40k|                    }
  840|  8.16k|                }
  841|  8.16k|            }
  842|  8.16k|        }
  843|  16.6k|    }
  844|   200k|    else
  845|   200k|    {
  846|   200k|        ps_cur_mb_info->u1_tran_form8x8 = 0;
  847|   200k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  848|   200k|        u4_offset = 0;
  849|       |        /*--------------------------------------------------------------------*/
  850|       |        /* Read the Coded block pattern                                       */
  851|       |        /*--------------------------------------------------------------------*/
  852|   200k|        {
  853|   200k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  854|   200k|            UWORD32 u4_word, u4_ldz;
  855|       |
  856|       |            /***************************************************************/
  857|       |            /* Find leading zeros in next 32 bits                          */
  858|       |            /***************************************************************/
  859|   200k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|   200k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|   200k|{                                                                           \
  |  |  152|   200k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|   200k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|   200k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|   200k|                                                                            \
  |  |  156|   200k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|   200k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 194k, False: 6.37k]
  |  |  ------------------
  |  |  158|   200k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|   194k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|   200k|}
  ------------------
  860|   200k|            u4_ldz = CLZ(u4_word);
  861|       |            /* Flush the ps_bitstrm */
  862|   200k|            u4_bitstream_offset += (u4_ldz + 1);
  863|       |            /* Read the suffix from the ps_bitstrm */
  864|   200k|            u4_word = 0;
  865|   200k|            if(u4_ldz)
  ------------------
  |  Branch (865:16): [True: 22.6k, False: 177k]
  ------------------
  866|  22.6k|            {
  867|  22.6k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  22.6k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  22.6k|{                                                                           \
  |  |  122|  22.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  22.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  22.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  22.6k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  22.6k|                                                                            \
  |  |  127|  22.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 22.0k, False: 631]
  |  |  ------------------
  |  |  128|  22.6k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  22.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  22.6k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  22.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  22.6k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  22.6k|}                                                                           \
  ------------------
  868|  22.6k|            }
  869|   200k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  870|   200k|            u4_cbp = ((1 << u4_ldz) + u4_word - 1);
  871|   200k|        }
  872|   200k|        if(u4_cbp > 47)
  ------------------
  |  Branch (872:12): [True: 807, False: 199k]
  ------------------
  873|    807|        {
  874|    807|            return ERROR_CBP;
  875|    807|        }
  876|       |
  877|       |        /*  inter cbp table to be used for base mode flag*/
  878|   199k|        u4_cbp = gau1_ih264d_cbp_table[u4_cbp][1];
  879|   199k|        COPYTHECONTEXT("coded_block_pattern", u4_cbp);
  880|   199k|        ps_cur_mb_info->u1_cbp = u4_cbp;
  881|   199k|        ps_cur_mb_info->u1_tran_form8x8 = 0;
  882|   199k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  883|       |
  884|       |        /*--------------------------------------------------------------------*/
  885|       |        /* Read transform_size_8x8_flag if present                            */
  886|       |        /*--------------------------------------------------------------------*/
  887|   199k|        if((ps_dec->ps_cur_pps->i4_transform_8x8_mode_flag) && (ps_cur_mb_info->u1_cbp & 0xf))
  ------------------
  |  Branch (887:12): [True: 76.1k, False: 123k]
  |  Branch (887:64): [True: 5.25k, False: 70.8k]
  ------------------
  888|  5.25k|        {
  889|  5.25k|            ps_cur_mb_info->u1_tran_form8x8 = ih264d_get_bit_h264(ps_bitstrm);
  890|  5.25k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
  891|  5.25k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
  892|  5.25k|        }
  893|       |        /*--------------------------------------------------------------------*/
  894|       |        /* Read mb_qp_delta                                                   */
  895|       |        /*--------------------------------------------------------------------*/
  896|   199k|        if(ps_cur_mb_info->u1_cbp)
  ------------------
  |  Branch (896:12): [True: 21.8k, False: 177k]
  ------------------
  897|  21.8k|        {
  898|  21.8k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  899|  21.8k|            UWORD32 u4_word, u4_ldz, u4_abs_val;
  900|       |
  901|       |            /***************************************************************/
  902|       |            /* Find leading zeros in next 32 bits                          */
  903|       |            /***************************************************************/
  904|  21.8k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  21.8k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  21.8k|{                                                                           \
  |  |  152|  21.8k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  21.8k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  21.8k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  21.8k|                                                                            \
  |  |  156|  21.8k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  21.8k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 20.8k, False: 958]
  |  |  ------------------
  |  |  158|  21.8k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  20.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  21.8k|}
  ------------------
  905|  21.8k|            u4_ldz = CLZ(u4_word);
  906|       |
  907|       |            /* Flush the ps_bitstrm */
  908|  21.8k|            u4_bitstream_offset += (u4_ldz + 1);
  909|       |
  910|       |            /* Read the suffix from the ps_bitstrm */
  911|  21.8k|            u4_word = 0;
  912|  21.8k|            if(u4_ldz)
  ------------------
  |  Branch (912:16): [True: 7.22k, False: 14.6k]
  ------------------
  913|  7.22k|            {
  914|  7.22k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  7.22k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  7.22k|{                                                                           \
  |  |  122|  7.22k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  7.22k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  7.22k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  7.22k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  7.22k|                                                                            \
  |  |  127|  7.22k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 6.53k, False: 691]
  |  |  ------------------
  |  |  128|  7.22k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  6.53k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  7.22k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  7.22k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  7.22k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  7.22k|}                                                                           \
  ------------------
  915|  7.22k|            }
  916|       |
  917|  21.8k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  918|  21.8k|            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
  919|       |
  920|  21.8k|            if(u4_word & 0x1)
  ------------------
  |  Branch (920:16): [True: 2.36k, False: 19.4k]
  ------------------
  921|  2.36k|            {
  922|  2.36k|                i4_delta_qp = (-(WORD32) u4_abs_val);
  923|  2.36k|            }
  924|  19.4k|            else
  925|  19.4k|            {
  926|  19.4k|                i4_delta_qp = (u4_abs_val);
  927|  19.4k|            }
  928|       |
  929|  21.8k|            if((i4_delta_qp < -26) || (i4_delta_qp > 25))
  ------------------
  |  Branch (929:16): [True: 165, False: 21.6k]
  |  Branch (929:39): [True: 243, False: 21.4k]
  ------------------
  930|    408|            {
  931|    408|                return ERROR_INV_RANGE_QP_T;
  932|    408|            }
  933|       |
  934|  21.4k|            COPYTHECONTEXT("mb_qp_delta", i4_delta_qp);
  935|  21.4k|            if(i4_delta_qp != 0)
  ------------------
  |  Branch (935:16): [True: 6.81k, False: 14.6k]
  ------------------
  936|  6.81k|            {
  937|  6.81k|                ret = ih264d_update_qp(ps_dec, (WORD8) i4_delta_qp);
  938|  6.81k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  6.81k|#define OK        0
  ------------------
  |  Branch (938:20): [True: 0, False: 6.81k]
  ------------------
  939|  6.81k|            }
  940|  21.4k|        }
  941|   199k|    }
  942|   213k|    if(u4_cbp)
  ------------------
  |  Branch (942:8): [True: 28.0k, False: 185k]
  ------------------
  943|  28.0k|    {
  944|  28.0k|        ret = ih264d_parse_residual4x4_cavlc(ps_dec, ps_cur_mb_info, (UWORD8) u4_offset);
  945|  28.0k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  28.0k|#define OK        0
  ------------------
  |  Branch (945:12): [True: 777, False: 27.3k]
  ------------------
  946|  27.3k|        if(EXCEED_OFFSET(ps_bitstrm)) return ERROR_EOB_TERMINATE_T;
  ------------------
  |  |   93|  27.3k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 624, False: 26.6k]
  |  |  ------------------
  ------------------
  947|       |
  948|       |        /* Store Left Mb NNZ and TOP chroma NNZ */
  949|  27.3k|    }
  950|   185k|    else
  951|   185k|    {
  952|   185k|        ps_cur_mb_info->u1_qp_div6 = ps_dec->u1_qp_y_div6;
  953|   185k|        ps_cur_mb_info->u1_qpc_div6 = ps_dec->u1_qp_u_div6;
  954|   185k|        ps_cur_mb_info->u1_qpcr_div6 = ps_dec->u1_qp_v_div6;
  955|   185k|        ps_cur_mb_info->u1_qp_rem6 = ps_dec->u1_qp_y_rem6;
  956|   185k|        ps_cur_mb_info->u1_qpc_rem6 = ps_dec->u1_qp_u_rem6;
  957|   185k|        ps_cur_mb_info->u1_qpcr_rem6 = ps_dec->u1_qp_v_rem6;
  958|   185k|        ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|   185k|#define CAVLC  0
  ------------------
  959|   185k|    }
  960|       |
  961|   212k|    return OK;
  ------------------
  |  |  114|   212k|#define OK        0
  ------------------
  962|   213k|}
isvcd_parse_eislice:
  977|  6.68k|{
  978|  6.68k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  979|  6.68k|    WORD32 i_status = OK;
  ------------------
  |  |  114|  6.68k|#define OK        0
  ------------------
  980|  6.68k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
  981|  6.68k|    dec_slice_params_t *ps_slice = ps_dec->ps_cur_slice;
  982|  6.68k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
  983|  6.68k|    dec_seq_params_t *ps_seq;
  984|  6.68k|    dec_svc_seq_params_t *ps_subset_seq;
  985|  6.68k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
  986|  6.68k|    dec_subset_seq_params_t *ps_sps_svc_ext = NULL;
  987|  6.68k|    dec_nal_unit_svc_ext_params_t *ps_nal_svc_ext = NULL;
  988|  6.68k|    UWORD32 u4_temp;
  989|  6.68k|    WORD32 i_temp;
  990|  6.68k|    WORD32 ret;
  991|  6.68k|    UWORD32 *pu4_bitstrm_buf = ps_dec->ps_bitstrm->pu4_buffer;
  992|  6.68k|    UWORD32 *pu4_bitstrm_ofst = &ps_dec->ps_bitstrm->u4_ofst;
  993|       |
  994|  6.68k|    ps_nal_svc_ext = ps_svc_lyr_dec->ps_nal_svc_ext;
  995|  6.68k|    ps_seq = ps_dec->ps_cur_sps;
  996|  6.68k|    ps_subset_seq =
  997|  6.68k|        &ps_svc_lyr_dec->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_seq->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  6.68k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  998|  6.68k|    ps_sps_svc_ext = &ps_subset_seq->s_sps_svc_ext;
  999|  6.68k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1000|       |
 1001|  6.68k|    if(0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id)
  ------------------
  |  Branch (1001:8): [True: 6.68k, False: 0]
  ------------------
 1002|  6.68k|    {
 1003|       |        /*--------------------------------------------------------------------*/
 1004|       |        /* Read remaining contents of the slice header                        */
 1005|       |        /*--------------------------------------------------------------------*/
 1006|       |        /* dec_ref_pic_marking function */
 1007|       |        /* G050 */
 1008|  6.68k|        if(ps_slice->u1_nal_ref_idc != 0)
  ------------------
  |  Branch (1008:12): [True: 6.60k, False: 83]
  ------------------
 1009|  6.60k|        {
 1010|  6.60k|            if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (1010:16): [True: 6.37k, False: 232]
  ------------------
 1011|  6.37k|            {
 1012|  6.37k|                dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1013|  6.37k|                dec_seq_params_t *ps_sps_tmp = ps_pps->ps_sps;
 1014|  6.37k|                UWORD8 u1_nal_unit_type_tmp = ps_dec->u1_nal_unit_type;
 1015|       |
 1016|  6.37k|                ps_pps->ps_sps = ps_dec->ps_cur_sps;
 1017|  6.37k|                if(ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag)
  ------------------
  |  Branch (1017:20): [True: 4.33k, False: 2.04k]
  ------------------
 1018|  4.33k|                    ps_dec->u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  4.33k|#define IDR_SLICE_NAL                   5
  ------------------
 1019|       |
 1020|  6.37k|                i_temp = ih264d_read_mmco_commands(ps_dec);
 1021|       |
 1022|  6.37k|                ps_pps->ps_sps = ps_sps_tmp;
 1023|  6.37k|                ps_dec->u1_nal_unit_type = u1_nal_unit_type_tmp;
 1024|  6.37k|                if(i_temp < 0)
  ------------------
  |  Branch (1024:20): [True: 104, False: 6.26k]
  ------------------
 1025|    104|                {
 1026|    104|                    return ERROR_DBP_MANAGER_T;
 1027|    104|                }
 1028|  6.26k|                ps_dec->u4_bitoffset = i_temp;
 1029|  6.26k|            }
 1030|    232|            else
 1031|    232|                ps_dec->ps_bitstrm->u4_ofst += ps_dec->u4_bitoffset;
 1032|       |
 1033|  6.50k|            if(!ps_sps_svc_ext->u1_slice_header_restriction_flag)
  ------------------
  |  Branch (1033:16): [True: 5.40k, False: 1.10k]
  ------------------
 1034|  5.40k|            {
 1035|  5.40k|                ps_svc_slice_params->u1_store_ref_base_pic_flag = ih264d_get_bit_h264(ps_bitstrm);
 1036|  5.40k|                COPYTHECONTEXT("SPS_SVC_EXT: u1_store_ref_base_pic_flag",
 1037|  5.40k|                               ps_svc_slice_params->u1_store_ref_base_pic_flag);
 1038|       |
 1039|  5.40k|                if(0 != ps_svc_slice_params->u1_store_ref_base_pic_flag)
  ------------------
  |  Branch (1039:20): [True: 235, False: 5.16k]
  ------------------
 1040|    235|                {
 1041|    235|                    return NOT_OK;
  ------------------
  |  |  116|    235|#define NOT_OK    -1
  ------------------
 1042|    235|                }
 1043|  5.16k|                if(((1 == ps_nal_svc_ext->u1_use_ref_base_pic_flag) ||
  ------------------
  |  Branch (1043:21): [True: 0, False: 5.16k]
  ------------------
 1044|  5.16k|                    (1 == ps_svc_slice_params->u1_store_ref_base_pic_flag)) &&
  ------------------
  |  Branch (1044:21): [True: 0, False: 5.16k]
  ------------------
 1045|      0|                   (!ps_nal_svc_ext->u1_idr_flag))
  ------------------
  |  Branch (1045:20): [True: 0, False: 0]
  ------------------
 1046|      0|                {
 1047|      0|                    i_status = isvcd_dec_ref_base_pic_marking(
 1048|      0|                        &ps_svc_slice_params->s_ref_base_pic_marking_svc_ext, ps_bitstrm);
 1049|      0|                    if(i_status != OK)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (1049:24): [True: 0, False: 0]
  ------------------
 1050|      0|                    {
 1051|      0|                        return i_status;
 1052|      0|                    }
 1053|      0|                }
 1054|  5.16k|            }
 1055|  6.50k|        }
 1056|  6.68k|    }
 1057|       |
 1058|  6.34k|    {
 1059|       |        /* G050 */
 1060|       |        /* Read slice_qp_delta */
 1061|  6.34k|        WORD64 i8_temp =
 1062|  6.34k|            (WORD64) ps_pps->u1_pic_init_qp + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1063|  6.34k|        if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  |  629|  6.34k|#define MIN_H264_QP 0
  ------------------
                      if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  |  634|  6.18k|#define MAX_H264_QP 51
  ------------------
  |  Branch (1063:12): [True: 163, False: 6.18k]
  |  Branch (1063:39): [True: 177, False: 6.00k]
  ------------------
 1064|  6.00k|        ps_slice->u1_slice_qp = (UWORD8) i8_temp;
 1065|  6.00k|        COPYTHECONTEXT("Slice Header SVC ext: slice_qp_delta",
 1066|  6.00k|                       ps_slice->u1_slice_qp - ps_pps->u1_pic_init_qp);
 1067|  6.00k|    }
 1068|       |
 1069|  6.00k|    if(ps_pps->u1_deblocking_filter_parameters_present_flag == 1)
  ------------------
  |  Branch (1069:8): [True: 3.67k, False: 2.33k]
  ------------------
 1070|  3.67k|    {
 1071|  3.67k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1072|  3.67k|        COPYTHECONTEXT("Slice Header SVC ext: disable_deblocking_filter_idc", u4_temp);
 1073|       |
 1074|  3.67k|        if(u4_temp > SLICE_BOUNDARY_DBLK_DISABLED)
  ------------------
  |  |  547|  3.67k|#define SLICE_BOUNDARY_DBLK_DISABLED  2
  ------------------
  |  Branch (1074:12): [True: 356, False: 3.31k]
  ------------------
 1075|    356|        {
 1076|    356|            return ERROR_INV_SLICE_HDR_T;
 1077|    356|        }
 1078|  3.31k|        ps_slice->u1_disable_dblk_filter_idc = u4_temp;
 1079|  3.31k|        if(u4_temp != 1)
  ------------------
  |  Branch (1079:12): [True: 2.99k, False: 321]
  ------------------
 1080|  2.99k|        {
 1081|  2.99k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 1082|  2.99k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  2.99k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  2.89k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (1082:16): [True: 105, False: 2.89k]
  |  Branch (1082:47): [True: 76, False: 2.81k]
  ------------------
 1083|    181|            {
 1084|    181|                return ERROR_INV_SLICE_HDR_T;
 1085|    181|            }
 1086|  2.81k|            ps_slice->i1_slice_alpha_c0_offset = i_temp;
 1087|  2.81k|            COPYTHECONTEXT("Slice Header SVC ext: slice_alpha_c0_offset_div2",
 1088|  2.81k|                           ps_slice->i1_slice_alpha_c0_offset >> 1);
 1089|       |
 1090|  2.81k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 1091|  2.81k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  2.81k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  2.73k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (1091:16): [True: 84, False: 2.73k]
  |  Branch (1091:47): [True: 73, False: 2.65k]
  ------------------
 1092|    157|            {
 1093|    157|                return ERROR_INV_SLICE_HDR_T;
 1094|    157|            }
 1095|  2.65k|            ps_slice->i1_slice_beta_offset = i_temp;
 1096|  2.65k|            COPYTHECONTEXT("Slice Header SVC ext: slice_beta_offset_div2",
 1097|  2.65k|                           ps_slice->i1_slice_beta_offset >> 1);
 1098|  2.65k|        }
 1099|    321|        else
 1100|    321|        {
 1101|    321|            ps_slice->i1_slice_alpha_c0_offset = 0;
 1102|    321|            ps_slice->i1_slice_beta_offset = 0;
 1103|    321|        }
 1104|  3.31k|    }
 1105|  2.33k|    else
 1106|  2.33k|    {
 1107|  2.33k|        ps_slice->u1_disable_dblk_filter_idc = 0;
 1108|  2.33k|        ps_slice->i1_slice_alpha_c0_offset = 0;
 1109|  2.33k|        ps_slice->i1_slice_beta_offset = 0;
 1110|  2.33k|    }
 1111|       |
 1112|       |    /* add the remaining part of the code for svc extension from reference */
 1113|  5.31k|    ret = isvcd_set_default_slice_header_ext(ps_svc_lyr_dec);
 1114|  5.31k|    if(ret != OK)
  ------------------
  |  |  114|  5.31k|#define OK        0
  ------------------
  |  Branch (1114:8): [True: 0, False: 5.31k]
  ------------------
 1115|      0|    {
 1116|      0|        return ERROR_INV_SLICE_HDR_T;
 1117|      0|    }
 1118|       |
 1119|  5.31k|    ret = isvcd_parse_slice_header(ps_svc_lyr_dec);
 1120|  5.31k|    if(ret != OK)
  ------------------
  |  |  114|  5.31k|#define OK        0
  ------------------
  |  Branch (1120:8): [True: 347, False: 4.96k]
  ------------------
 1121|    347|    {
 1122|    347|        return ERROR_INV_SLICE_HDR_T;
 1123|    347|    }
 1124|       |
 1125|       |    /* Initialization to check if number of motion vector per 2 Mbs */
 1126|       |    /* are exceeding the range or not */
 1127|  4.96k|    ps_dec->u2_mv_2mb[0] = 0;
 1128|  4.96k|    ps_dec->u2_mv_2mb[1] = 0;
 1129|       |
 1130|       |    /*set slice header cone to 2 ,to indicate  correct header*/
 1131|  4.96k|    ps_dec->u1_slice_header_done = 2;
 1132|       |
 1133|  4.96k|    if(!ps_svc_slice_params->u1_slice_skip_flag)
  ------------------
  |  Branch (1133:8): [True: 4.78k, False: 179]
  ------------------
 1134|  4.78k|    {
 1135|  4.78k|        if(ps_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (1135:12): [True: 1.26k, False: 3.52k]
  ------------------
 1136|  1.26k|        {
 1137|  1.26k|            SWITCHOFFTRACE;
 1138|  1.26k|            SWITCHONTRACECABAC;
 1139|  1.26k|            if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (1139:16): [True: 0, False: 1.26k]
  ------------------
 1140|      0|            {
 1141|      0|                ps_dec->pf_get_mb_info = ih264d_get_mb_info_cabac_mbaff;
 1142|      0|            }
 1143|  1.26k|            else
 1144|  1.26k|                ps_dec->pf_get_mb_info = isvcd_get_mb_info_cabac_nonmbaff;
 1145|       |
 1146|  1.26k|            ret = isvcd_parse_eislice_data_cabac(ps_svc_lyr_dec, ps_slice, u2_first_mb_in_slice);
 1147|  1.26k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  1.26k|#define OK        0
  ------------------
  |  Branch (1147:16): [True: 875, False: 394]
  ------------------
 1148|    394|            SWITCHONTRACE;
 1149|    394|            SWITCHOFFTRACECABAC;
 1150|    394|        }
 1151|  3.52k|        else
 1152|  3.52k|        {
 1153|  3.52k|            if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (1153:16): [True: 0, False: 3.52k]
  ------------------
 1154|      0|            {
 1155|      0|                ps_dec->pf_get_mb_info = ih264d_get_mb_info_cavlc_mbaff;
 1156|      0|            }
 1157|  3.52k|            else
 1158|  3.52k|                ps_dec->pf_get_mb_info = isvcd_get_mb_info_cavlc_nonmbaff;
 1159|  3.52k|            ret = isvcd_parse_eislice_data_cavlc(ps_svc_lyr_dec, ps_slice, u2_first_mb_in_slice);
 1160|  3.52k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  3.52k|#define OK        0
  ------------------
  |  Branch (1160:16): [True: 2.29k, False: 1.23k]
  ------------------
 1161|  3.52k|        }
 1162|  4.78k|    }
 1163|    179|    else
 1164|    179|    {
 1165|    179|        return ERROR_FEATURE_UNAVAIL;
 1166|    179|    }
 1167|       |
 1168|  1.62k|    return OK;
  ------------------
  |  |  114|  1.62k|#define OK        0
  ------------------
 1169|  4.96k|}
isvcd_parse_eislice_data_cabac:
 1197|  1.26k|{
 1198|  1.26k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1199|  1.26k|    UWORD8 uc_more_data_flag;
 1200|  1.26k|    UWORD8 u1_num_mbs, u1_mb_idx;
 1201|  1.26k|    dec_mb_info_t *ps_cur_mb_info;
 1202|  1.26k|    dec_svc_mb_info_t *ps_svc_cur_mb_info;
 1203|  1.26k|    deblk_mb_t *ps_cur_deblk_mb;
 1204|  1.26k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
 1205|  1.26k|    UWORD16 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
 1206|  1.26k|    WORD16 i2_cur_mb_addr;
 1207|  1.26k|    UWORD8 u1_mbaff;
 1208|  1.26k|    UWORD8 u1_num_mbs_next, u1_end_of_row, u1_tfr_n_mb;
 1209|  1.26k|    WORD32 ret = OK;
  ------------------
  |  |  114|  1.26k|#define OK        0
  ------------------
 1210|  1.26k|    decoding_envirnoment_t *ps_cab_env;
 1211|  1.26k|    UWORD8 *pu1_cur_svc_base_mode_flag;
 1212|  1.26k|    UWORD8 u1_left_svc_base_mode_flag;
 1213|  1.26k|    UWORD8 u1_top_svc_base_mode_flag;
 1214|  1.26k|    UWORD32 u4_a, u4_b, u4_ctxt_inc;
 1215|  1.26k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1216|       |
 1217|  1.26k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1218|  1.26k|    ps_dec->u1_qp = ps_slice->u1_slice_qp;
 1219|  1.26k|    ih264d_update_qp(ps_dec, 0);
 1220|  1.26k|    u1_mbaff = ps_slice->u1_mbaff_frame_flag;
 1221|       |
 1222|  1.26k|    if(ps_bitstrm->u4_ofst & 0x07)
  ------------------
  |  Branch (1222:8): [True: 967, False: 302]
  ------------------
 1223|    967|    {
 1224|    967|        ps_bitstrm->u4_ofst += 8;
 1225|    967|        ps_bitstrm->u4_ofst &= 0xFFFFFFF8;
 1226|    967|    }
 1227|  1.26k|    ret = ih264d_init_cabac_dec_envirnoment(&(ps_dec->s_cab_dec_env), ps_bitstrm);
 1228|  1.26k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  1.26k|#define OK        0
  ------------------
  |  Branch (1228:8): [True: 175, False: 1.09k]
  ------------------
 1229|  1.09k|    isvcd_init_cabac_contexts(I_SLICE, ps_dec);
  ------------------
  |  |  370|  1.09k|#define I_SLICE  2
  ------------------
 1230|  1.09k|    ps_dec->i1_prev_mb_qp_delta = 0;
 1231|  1.09k|    ps_cab_env = &ps_dec->s_cab_dec_env;
 1232|       |    /* initializations */
 1233|  1.09k|    u1_mb_idx = ps_dec->u4_mb_idx;
 1234|  1.09k|    u1_num_mbs = u1_mb_idx;
 1235|  1.09k|    uc_more_data_flag = 1;
 1236|  1.09k|    i2_cur_mb_addr = u2_first_mb_in_slice << u1_mbaff;
 1237|  1.09k|    do
 1238|  18.1k|    {
 1239|  18.1k|        UWORD16 u2_mbx;
 1240|  18.1k|        ps_dec->pv_prev_mb_parse_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
 1241|  18.1k|        if(i2_cur_mb_addr > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (1241:12): [True: 317, False: 17.8k]
  ------------------
 1242|    317|        {
 1243|    317|            break;
 1244|    317|        }
 1245|       |
 1246|  17.8k|        {
 1247|  17.8k|            UWORD8 u1_mb_type;
 1248|  17.8k|            ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs;
 1249|  17.8k|            ps_svc_cur_mb_info = ps_svc_lyr_dec->ps_svc_nmb_info + u1_num_mbs;
 1250|  17.8k|            ps_dec->u4_num_mbs_cur_nmb = u1_num_mbs;
 1251|  17.8k|            ps_dec->u4_num_pmbair = (u1_num_mbs >> u1_mbaff);
 1252|  17.8k|            ps_cur_mb_info->u1_end_of_slice = 0;
 1253|       |            /***************************************************************/
 1254|       |            /* Get the required information for decoding of MB                  */
 1255|       |            /* mb_x, mb_y , neighbour availablity,                              */
 1256|       |            /***************************************************************/
 1257|  17.8k|            ps_dec->pf_get_mb_info(ps_dec, i2_cur_mb_addr, ps_cur_mb_info, 0);
 1258|  17.8k|            u2_mbx = ps_dec->u2_mbx;
 1259|  17.8k|            ps_svc_cur_mb_info->u1_crop_window_flag =
 1260|  17.8k|                *(ps_svc_lyr_dec->pu1_crop_wnd_flag + ps_cur_mb_info->u2_mbx +
 1261|  17.8k|                  (ps_cur_mb_info->u2_mby * ps_dec->u2_frm_wd_in_mbs));
 1262|       |            /*********************************************************************/
 1263|       |            /* initialize u1_tran_form8x8 to zero to aviod uninitialized accesses */
 1264|       |            /*********************************************************************/
 1265|  17.8k|            ps_cur_mb_info->u1_tran_form8x8 = 0;
 1266|  17.8k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
 1267|       |            /***************************************************************/
 1268|       |            /* Set the deblocking parameters for this MB                   */
 1269|       |            /***************************************************************/
 1270|  17.8k|            ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u1_num_mbs;
 1271|  17.8k|            if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (1271:16): [True: 17.8k, False: 0]
  ------------------
 1272|  17.8k|                ih264d_set_deblocking_parameters(ps_cur_deblk_mb, ps_slice,
 1273|  17.8k|                                                 ps_dec->u1_mb_ngbr_availablity,
 1274|  17.8k|                                                 ps_dec->u1_cur_mb_fld_dec_flag);
 1275|       |
 1276|  17.8k|            ps_svc_cur_mb_info->u1_base_mode_flag = 0;
 1277|       |            /* Macroblock Layer Begins */
 1278|  17.8k|            if(ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (1278:16): [True: 17.8k, False: 40]
  ------------------
 1279|  17.8k|               ps_svc_slice_params->u1_adaptive_base_mode_flag)
  ------------------
  |  Branch (1279:16): [True: 14.5k, False: 3.24k]
  ------------------
 1280|  14.5k|            {
 1281|  14.5k|                pu1_cur_svc_base_mode_flag =
 1282|  14.5k|                    ps_svc_lyr_dec->pu1_svc_base_mode_flag + ps_cur_mb_info->u2_mbx;
 1283|  14.5k|                pu1_cur_svc_base_mode_flag +=
 1284|  14.5k|                    ps_cur_mb_info->u2_mby * ps_svc_lyr_dec->i4_frm_svc_base_mode_cabac_stride;
 1285|       |
 1286|  14.5k|                u1_left_svc_base_mode_flag = 0;
 1287|  14.5k|                if(ps_dec->u1_mb_ngbr_availablity & LEFT_MB_AVAILABLE_MASK)
  ------------------
  |  |   53|  14.5k|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  |  Branch (1287:20): [True: 10.6k, False: 3.96k]
  ------------------
 1288|  10.6k|                    u1_left_svc_base_mode_flag = *(pu1_cur_svc_base_mode_flag - 1);
 1289|       |
 1290|  14.5k|                u1_top_svc_base_mode_flag = 0;
 1291|  14.5k|                if(ps_dec->u1_mb_ngbr_availablity & TOP_MB_AVAILABLE_MASK)
  ------------------
  |  |   55|  14.5k|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  |  Branch (1291:20): [True: 11.8k, False: 2.76k]
  ------------------
 1292|  11.8k|                    u1_top_svc_base_mode_flag =
 1293|  11.8k|                        *(pu1_cur_svc_base_mode_flag -
 1294|  11.8k|                          ps_svc_lyr_dec->i4_frm_svc_base_mode_cabac_stride);
 1295|       |
 1296|  14.5k|                u4_a = 1;
 1297|  14.5k|                u4_b = 1;
 1298|       |
 1299|  14.5k|                if(u1_top_svc_base_mode_flag)
  ------------------
  |  Branch (1299:20): [True: 8.33k, False: 6.24k]
  ------------------
 1300|  8.33k|                {
 1301|  8.33k|                    u4_a = 0;
 1302|  8.33k|                }
 1303|       |
 1304|  14.5k|                if(u1_left_svc_base_mode_flag)
  ------------------
  |  Branch (1304:20): [True: 7.46k, False: 7.11k]
  ------------------
 1305|  7.46k|                {
 1306|  7.46k|                    u4_b = 0;
 1307|  7.46k|                }
 1308|       |
 1309|  14.5k|                u4_ctxt_inc = u4_a + u4_b;
 1310|  14.5k|                ps_svc_cur_mb_info->u1_base_mode_flag = ih264d_decode_bin(
 1311|  14.5k|                    u4_ctxt_inc, ps_svc_lyr_dec->ps_base_mode_flag, ps_bitstrm, ps_cab_env);
 1312|  14.5k|                COPYTHECONTEXT("SVC ext: u1_base_mode_flag", ps_cur_mb_info->u1_base_mode_flag);
 1313|  14.5k|                *pu1_cur_svc_base_mode_flag = ps_svc_cur_mb_info->u1_base_mode_flag;
 1314|  14.5k|            }
 1315|  3.28k|            else if(ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1315:21): [True: 3.24k, False: 40]
  ------------------
 1316|  3.24k|            {
 1317|  3.24k|                ps_svc_cur_mb_info->u1_base_mode_flag =
 1318|  3.24k|                    ps_svc_slice_params->u1_default_base_mode_flag;
 1319|  3.24k|            }
 1320|       |
 1321|  17.8k|            if(!ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (1321:16): [True: 7.12k, False: 10.7k]
  ------------------
 1322|  7.12k|            {
 1323|       |                /* Decode the u1_mb_type */
 1324|  7.12k|                u1_mb_type = ih264d_parse_mb_type_intra_cabac(0, ps_dec);
 1325|  7.12k|                if(u1_mb_type > 25) return ERROR_MB_TYPE;
  ------------------
  |  Branch (1325:20): [True: 0, False: 7.12k]
  ------------------
 1326|  7.12k|                ps_cur_mb_info->u1_mb_type = u1_mb_type;
 1327|  7.12k|                COPYTHECONTEXT("u1_mb_type", u1_mb_type);
 1328|  7.12k|                ps_cur_deblk_mb->u1_mb_type = ps_cur_deblk_mb->u1_mb_type | D_INTRA_MB;
  ------------------
  |  |  382|  7.12k|#define D_INTRA_MB        1
  ------------------
 1329|  7.12k|            }
 1330|  10.7k|            else
 1331|  10.7k|            {
 1332|  10.7k|                ps_cur_mb_info->u1_mb_type = MB_INFER;
  ------------------
  |  |  112|  10.7k|#define MB_INFER 250
  ------------------
 1333|  10.7k|                ps_cur_deblk_mb->u1_mb_type = ps_cur_deblk_mb->u1_mb_type | D_INTRA_IBL;
  ------------------
  |  |   72|  10.7k|#define D_INTRA_IBL 16
  ------------------
 1334|  10.7k|            }
 1335|       |            /* Parse Macroblock Data */
 1336|  17.8k|            u1_mb_type = ps_cur_mb_info->u1_mb_type;
 1337|  17.8k|            if(25 == u1_mb_type)
  ------------------
  |  Branch (1337:16): [True: 136, False: 17.7k]
  ------------------
 1338|    136|            {
 1339|       |                /* I_PCM_MB */
 1340|    136|                ps_cur_mb_info->ps_curmb->u1_mb_type = I_PCM_MB;
  ------------------
  |  |  423|    136|#define I_PCM_MB    6
  ------------------
 1341|    136|                ret = ih264d_parse_ipcm_mb(ps_dec, ps_cur_mb_info, u1_num_mbs);
 1342|    136|                if(ret != OK) return ret;
  ------------------
  |  |  114|    136|#define OK        0
  ------------------
  |  Branch (1342:20): [True: 70, False: 66]
  ------------------
 1343|     66|                ps_cur_deblk_mb->u1_mb_qp = 0;
 1344|     66|            }
 1345|  17.7k|            else
 1346|  17.7k|            {
 1347|  17.7k|                ret = isvcd_parse_imb_cabac(ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info,
 1348|  17.7k|                                            u1_mb_type);
 1349|  17.7k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  17.7k|#define OK        0
  ------------------
  |  Branch (1349:20): [True: 630, False: 17.1k]
  ------------------
 1350|  17.1k|                ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
 1351|  17.1k|            }
 1352|       |
 1353|  17.1k|            if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (1353:16): [True: 0, False: 17.1k]
  ------------------
 1354|      0|            {
 1355|      0|                ih264d_populate_mb_info_map(ps_dec, ps_cur_mb_info, ps_cur_mb_info->u2_mbx << 1,
 1356|      0|                                            ps_cur_mb_info->u2_mby << 1, ps_cur_deblk_mb->u1_mb_qp);
 1357|      0|            }
 1358|  17.1k|            if(u1_mbaff)
  ------------------
  |  Branch (1358:16): [True: 0, False: 17.1k]
  ------------------
 1359|      0|            {
 1360|      0|                ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
 1361|      0|            }
 1362|       |
 1363|  17.1k|            if(ps_cur_mb_info->u1_topmb && u1_mbaff)
  ------------------
  |  Branch (1363:16): [True: 17.1k, False: 0]
  |  Branch (1363:44): [True: 0, False: 17.1k]
  ------------------
 1364|      0|                uc_more_data_flag = 1;
 1365|  17.1k|            else
 1366|  17.1k|            {
 1367|  17.1k|                uc_more_data_flag = ih264d_decode_terminate(&ps_dec->s_cab_dec_env, ps_bitstrm);
 1368|  17.1k|                uc_more_data_flag = !uc_more_data_flag;
 1369|  17.1k|                COPYTHECONTEXT("Decode Sliceterm", !uc_more_data_flag);
 1370|  17.1k|            }
 1371|       |
 1372|  17.1k|            if(u1_mbaff)
  ------------------
  |  Branch (1372:16): [True: 0, False: 17.1k]
  ------------------
 1373|      0|            {
 1374|      0|                if(!uc_more_data_flag && (0 == (i2_cur_mb_addr & 1)))
  ------------------
  |  Branch (1374:20): [True: 0, False: 0]
  |  Branch (1374:42): [True: 0, False: 0]
  ------------------
 1375|      0|                {
 1376|      0|                    return ERROR_EOB_FLUSHBITS_T;
 1377|      0|                }
 1378|      0|            }
 1379|       |            /* Next macroblock information */
 1380|  17.1k|            i2_cur_mb_addr++;
 1381|       |            /* Store the colocated information */
 1382|  17.1k|            {
 1383|  17.1k|                mv_pred_t *ps_mv_nmb_start = ps_dec->ps_mv_cur + (u1_num_mbs << 4);
 1384|  17.1k|                mv_pred_t s_mvPred = {{0, 0, 0, 0}, {-1, -1}, 0, 0};
 1385|  17.1k|                if(ps_mv_nmb_start)
  ------------------
  |  Branch (1385:20): [True: 17.1k, False: 0]
  ------------------
 1386|  17.1k|                {
 1387|  17.1k|                    ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0,
 1388|  17.1k|                                       (UWORD8) (ps_dec->u1_cur_mb_fld_dec_flag << 1), 4, 4);
 1389|  17.1k|                }
 1390|      0|                else
 1391|      0|                {
 1392|      0|                    return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1393|      0|                }
 1394|  17.1k|            }
 1395|       |
 1396|  17.1k|            u1_num_mbs++;
 1397|  17.1k|        }
 1398|       |
 1399|       |        /****************************************************************/
 1400|       |        /* Check for End Of Row                                         */
 1401|       |        /****************************************************************/
 1402|      0|        u1_num_mbs_next = i2_pic_wdin_mbs - u2_mbx - 1;
 1403|  17.1k|        u1_end_of_row = (!u1_num_mbs_next) && (!(u1_mbaff && (u1_num_mbs & 0x01)));
  ------------------
  |  Branch (1403:25): [True: 4.06k, False: 13.1k]
  |  Branch (1403:50): [True: 0, False: 4.06k]
  |  Branch (1403:62): [True: 0, False: 0]
  ------------------
 1404|  17.1k|        u1_tfr_n_mb =
 1405|  17.1k|            (u1_num_mbs == ps_dec->u4_recon_mb_grp) || u1_end_of_row || (!uc_more_data_flag);
  ------------------
  |  Branch (1405:13): [True: 4.06k, False: 13.1k]
  |  Branch (1405:56): [True: 0, False: 13.1k]
  |  Branch (1405:73): [True: 77, False: 13.0k]
  ------------------
 1406|  17.1k|        ps_cur_mb_info->u1_end_of_slice = (!uc_more_data_flag);
 1407|       |
 1408|  17.1k|        if(u1_tfr_n_mb || (!uc_more_data_flag))
  ------------------
  |  Branch (1408:12): [True: 4.14k, False: 13.0k]
  |  Branch (1408:27): [True: 0, False: 13.0k]
  ------------------
 1409|  4.14k|        {
 1410|  4.14k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1410:16): [True: 1.23k, False: 2.90k]
  ------------------
 1411|  1.23k|            {
 1412|  1.23k|                ih264d_parse_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next, u1_tfr_n_mb,
 1413|  1.23k|                                     u1_end_of_row);
 1414|  1.23k|                ps_dec->ps_nmb_info += u1_num_mbs;
 1415|  1.23k|                ps_svc_lyr_dec->ps_svc_nmb_info += u1_num_mbs;
 1416|  1.23k|            }
 1417|  2.90k|            else
 1418|  2.90k|            {
 1419|  2.90k|                ret = isvcd_decode_recon_tfr_nmb_non_base_lyr(ps_svc_lyr_dec, u1_mb_idx, u1_num_mbs,
 1420|  2.90k|                                                              u1_num_mbs_next, u1_tfr_n_mb,
 1421|  2.90k|                                                              u1_end_of_row);
 1422|  2.90k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  2.90k|#define OK        0
  ------------------
  |  Branch (1422:20): [True: 0, False: 2.90k]
  ------------------
 1423|  2.90k|            }
 1424|  4.14k|            ps_dec->u4_total_mbs_coded += u1_num_mbs;
 1425|  4.14k|            if(u1_tfr_n_mb) u1_num_mbs = 0;
  ------------------
  |  Branch (1425:16): [True: 4.14k, False: 0]
  ------------------
 1426|  4.14k|            u1_mb_idx = u1_num_mbs;
 1427|  4.14k|            ps_dec->u4_mb_idx = u1_num_mbs;
 1428|  4.14k|        }
 1429|  17.1k|    } while(uc_more_data_flag);
  ------------------
  |  Branch (1429:13): [True: 17.0k, False: 77]
  ------------------
 1430|       |
 1431|    394|    ps_dec->u4_num_mbs_cur_nmb = 0;
 1432|    394|    ps_dec->ps_cur_slice->u4_mbs_in_slice = i2_cur_mb_addr - (u2_first_mb_in_slice << u1_mbaff);
 1433|       |
 1434|    394|    return ret;
 1435|  1.09k|}
isvcd_parse_eislice_data_cavlc:
 1463|  3.52k|{
 1464|  3.52k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1465|  3.52k|    UWORD8 uc_more_data_flag;
 1466|  3.52k|    UWORD8 u1_num_mbs, u1_mb_idx;
 1467|  3.52k|    dec_mb_info_t *ps_cur_mb_info;
 1468|  3.52k|    dec_svc_mb_info_t *ps_svc_cur_mb_info;
 1469|  3.52k|    deblk_mb_t *ps_cur_deblk_mb;
 1470|  3.52k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
 1471|  3.52k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 1472|  3.52k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1473|  3.52k|    UWORD16 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
 1474|  3.52k|    WORD16 i2_cur_mb_addr;
 1475|  3.52k|    UWORD8 u1_mbaff;
 1476|  3.52k|    UWORD8 u1_num_mbs_next, u1_end_of_row, u1_tfr_n_mb;
 1477|  3.52k|    WORD32 ret = OK;
  ------------------
  |  |  114|  3.52k|#define OK        0
  ------------------
 1478|  3.52k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1479|       |
 1480|  3.52k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1481|  3.52k|    ps_dec->u1_qp = ps_slice->u1_slice_qp;
 1482|  3.52k|    ih264d_update_qp(ps_dec, 0);
 1483|  3.52k|    u1_mbaff = ps_slice->u1_mbaff_frame_flag;
 1484|       |
 1485|  3.52k|    u1_mb_idx = ps_dec->u4_mb_idx;
 1486|  3.52k|    u1_num_mbs = u1_mb_idx;
 1487|  3.52k|    uc_more_data_flag = 1;
 1488|  3.52k|    i2_cur_mb_addr = u2_first_mb_in_slice << u1_mbaff;
 1489|       |
 1490|  3.52k|    do
 1491|  67.7k|    {
 1492|  67.7k|        UWORD8 u1_mb_type;
 1493|  67.7k|        ps_dec->pv_prev_mb_parse_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
 1494|  67.7k|        if(i2_cur_mb_addr > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (1494:12): [True: 663, False: 67.1k]
  ------------------
 1495|    663|        {
 1496|    663|            break;
 1497|    663|        }
 1498|       |
 1499|  67.1k|        ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs;
 1500|  67.1k|        ps_svc_cur_mb_info = ps_svc_lyr_dec->ps_svc_nmb_info + u1_num_mbs;
 1501|  67.1k|        ps_dec->u4_num_mbs_cur_nmb = u1_num_mbs;
 1502|  67.1k|        ps_dec->u4_num_pmbair = (u1_num_mbs >> u1_mbaff);
 1503|  67.1k|        ps_cur_mb_info->u1_end_of_slice = 0;
 1504|       |        /***************************************************************/
 1505|       |        /* Get the required information for decoding of MB             */
 1506|       |        /* mb_x, mb_y , neighbour availablity,                         */
 1507|       |        /***************************************************************/
 1508|  67.1k|        ps_dec->pf_get_mb_info(ps_dec, i2_cur_mb_addr, ps_cur_mb_info, 0);
 1509|  67.1k|        ps_svc_cur_mb_info->u1_crop_window_flag =
 1510|  67.1k|            *(ps_svc_lyr_dec->pu1_crop_wnd_flag + ps_cur_mb_info->u2_mbx +
 1511|  67.1k|              (ps_cur_mb_info->u2_mby * ps_dec->u2_frm_wd_in_mbs));
 1512|       |
 1513|       |        /***************************************************************/
 1514|       |        /* Set the deblocking parameters for this MB                   */
 1515|       |        /***************************************************************/
 1516|  67.1k|        ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u1_num_mbs;
 1517|  67.1k|        if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (1517:12): [True: 67.1k, False: 0]
  ------------------
 1518|  67.1k|            ih264d_set_deblocking_parameters(ps_cur_deblk_mb, ps_slice,
 1519|  67.1k|                                             ps_dec->u1_mb_ngbr_availablity,
 1520|  67.1k|                                             ps_dec->u1_cur_mb_fld_dec_flag);
 1521|       |
 1522|  67.1k|        ps_svc_cur_mb_info->u1_base_mode_flag = 0;
 1523|  67.1k|        if(ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (1523:12): [True: 66.9k, False: 206]
  ------------------
 1524|  66.9k|           ps_svc_slice_params->u1_adaptive_base_mode_flag)
  ------------------
  |  Branch (1524:12): [True: 39.8k, False: 27.0k]
  ------------------
 1525|  39.8k|        {
 1526|  39.8k|            ps_svc_cur_mb_info->u1_base_mode_flag = ih264d_get_bit_h264(ps_bitstrm);
 1527|  39.8k|            COPYTHECONTEXT("SVC ext: u1_base_mode_flag", ps_cur_mb_info->u1_base_mode_flag);
 1528|  39.8k|        }
 1529|  27.2k|        else if(ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1529:17): [True: 27.0k, False: 206]
  ------------------
 1530|  27.0k|        {
 1531|  27.0k|            ps_svc_cur_mb_info->u1_base_mode_flag = ps_svc_slice_params->u1_default_base_mode_flag;
 1532|  27.0k|        }
 1533|       |
 1534|       |        /**************************************************************/
 1535|       |        /* Macroblock Layer Begins, Decode the u1_mb_type                */
 1536|       |        /**************************************************************/
 1537|  67.1k|        if(!ps_svc_cur_mb_info->u1_base_mode_flag) /* Inlined ih264d_uev */
  ------------------
  |  Branch (1537:12): [True: 15.0k, False: 52.0k]
  ------------------
 1538|  15.0k|        {
 1539|  15.0k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 1540|  15.0k|            UWORD32 u4_word, u4_ldz, u4_temp;
 1541|       |
 1542|       |            /***************************************************************/
 1543|       |            /* Find leading zeros in next 32 bits                          */
 1544|       |            /***************************************************************/
 1545|  15.0k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  15.0k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  15.0k|{                                                                           \
  |  |  152|  15.0k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  15.0k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  15.0k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  15.0k|                                                                            \
  |  |  156|  15.0k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  15.0k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 14.7k, False: 282]
  |  |  ------------------
  |  |  158|  15.0k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  14.7k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  15.0k|}
  ------------------
 1546|  15.0k|            u4_ldz = CLZ(u4_word);
 1547|       |            /* Flush the ps_bitstrm */
 1548|  15.0k|            u4_bitstream_offset += (u4_ldz + 1);
 1549|       |            /* Read the suffix from the ps_bitstrm */
 1550|  15.0k|            u4_word = 0;
 1551|  15.0k|            if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  7.64k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  7.64k|{                                                                           \
  |  |  122|  7.64k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  7.64k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  7.64k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  7.64k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  7.64k|                                                                            \
  |  |  127|  7.64k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 6.75k, False: 890]
  |  |  ------------------
  |  |  128|  7.64k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  6.75k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  7.64k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  7.64k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  7.64k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  7.64k|}                                                                           \
  ------------------
  |  Branch (1551:16): [True: 7.64k, False: 7.42k]
  ------------------
 1552|  15.0k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
 1553|  15.0k|            u4_temp = ((1 << u4_ldz) + u4_word - 1);
 1554|  15.0k|            if(u4_temp > 25) return ERROR_MB_TYPE;
  ------------------
  |  Branch (1554:16): [True: 183, False: 14.8k]
  ------------------
 1555|  14.8k|            u1_mb_type = u4_temp;
 1556|       |
 1557|       |            /* Inlined ih264d_uev */
 1558|  14.8k|            ps_cur_mb_info->u1_mb_type = u1_mb_type;
 1559|  14.8k|            COPYTHECONTEXT("u1_mb_type", u1_mb_type);
 1560|       |
 1561|  14.8k|            ps_cur_deblk_mb->u1_mb_type = ps_cur_deblk_mb->u1_mb_type | D_INTRA_MB;
  ------------------
  |  |  382|  14.8k|#define D_INTRA_MB        1
  ------------------
 1562|  14.8k|        }
 1563|  52.0k|        else
 1564|  52.0k|        {
 1565|  52.0k|            ps_cur_mb_info->u1_mb_type = MB_INFER;
  ------------------
  |  |  112|  52.0k|#define MB_INFER 250
  ------------------
 1566|  52.0k|            ps_cur_deblk_mb->u1_mb_type = ps_cur_deblk_mb->u1_mb_type | D_INTRA_IBL;
  ------------------
  |  |   72|  52.0k|#define D_INTRA_IBL 16
  ------------------
 1567|  52.0k|        }
 1568|       |
 1569|       |        /**************************************************************/
 1570|       |        /* Parse Macroblock data                                      */
 1571|       |        /**************************************************************/
 1572|  66.9k|        u1_mb_type = ps_cur_mb_info->u1_mb_type;
 1573|  66.9k|        if(25 == u1_mb_type)
  ------------------
  |  Branch (1573:12): [True: 72, False: 66.8k]
  ------------------
 1574|     72|        {
 1575|       |            /* I_PCM_MB */
 1576|     72|            ps_cur_mb_info->ps_curmb->u1_mb_type = I_PCM_MB;
  ------------------
  |  |  423|     72|#define I_PCM_MB    6
  ------------------
 1577|     72|            ret = ih264d_parse_ipcm_mb(ps_dec, ps_cur_mb_info, u1_num_mbs);
 1578|     72|            if(ret != OK) return ret;
  ------------------
  |  |  114|     72|#define OK        0
  ------------------
  |  Branch (1578:16): [True: 0, False: 72]
  ------------------
 1579|     72|            ps_cur_deblk_mb->u1_mb_qp = 0;
 1580|     72|        }
 1581|  66.8k|        else
 1582|  66.8k|        {
 1583|  66.8k|            ret = isvcd_parse_imb_cavlc(ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info,
 1584|  66.8k|                                        u1_num_mbs, u1_mb_type);
 1585|  66.8k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  66.8k|#define OK        0
  ------------------
  |  Branch (1585:16): [True: 2.10k, False: 64.7k]
  ------------------
 1586|  64.7k|            ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
 1587|  64.7k|        }
 1588|       |
 1589|  64.8k|        if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (1589:12): [True: 0, False: 64.8k]
  ------------------
 1590|      0|        {
 1591|      0|            ih264d_populate_mb_info_map(ps_dec, ps_cur_mb_info, ps_cur_mb_info->u2_mbx << 1,
 1592|      0|                                        ps_cur_mb_info->u2_mby << 1, ps_cur_deblk_mb->u1_mb_qp);
 1593|      0|        }
 1594|  64.8k|        uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
  ------------------
  |  |   97|  64.8k|    CHECK_BITS_SUFFICIENT(ps_bitstrm, 1)
  |  |  ------------------
  |  |  |  |   95|  64.8k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  ------------------
 1595|       |
 1596|  64.8k|        if(u1_mbaff)
  ------------------
  |  Branch (1596:12): [True: 0, False: 64.8k]
  ------------------
 1597|      0|        {
 1598|      0|            ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
 1599|      0|            if(!uc_more_data_flag && (0 == (i2_cur_mb_addr & 1)))
  ------------------
  |  Branch (1599:16): [True: 0, False: 0]
  |  Branch (1599:38): [True: 0, False: 0]
  ------------------
 1600|      0|            {
 1601|      0|                return ERROR_EOB_FLUSHBITS_T;
 1602|      0|            }
 1603|      0|        }
 1604|       |        /**************************************************************/
 1605|       |        /* Get next Macroblock address                                */
 1606|       |        /**************************************************************/
 1607|  64.8k|        i2_cur_mb_addr++;
 1608|       |        /* Store the colocated information */
 1609|  64.8k|        {
 1610|  64.8k|            mv_pred_t *ps_mv_nmb_start = ps_dec->ps_mv_cur + (u1_num_mbs << 4);
 1611|  64.8k|            mv_pred_t s_mvPred = {{0, 0, 0, 0}, {-1, -1}, 0, 0};
 1612|  64.8k|            if(ps_mv_nmb_start)
  ------------------
  |  Branch (1612:16): [True: 64.8k, False: 0]
  ------------------
 1613|  64.8k|            {
 1614|  64.8k|                ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0,
 1615|  64.8k|                                   (UWORD8) (ps_dec->u1_cur_mb_fld_dec_flag << 1), 4, 4);
 1616|  64.8k|            }
 1617|      0|            else
 1618|      0|            {
 1619|      0|                return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1620|      0|            }
 1621|  64.8k|        }
 1622|  64.8k|        u1_num_mbs++;
 1623|       |
 1624|       |        /****************************************************************/
 1625|       |        /* Check for End Of Row                                         */
 1626|       |        /****************************************************************/
 1627|  64.8k|        u1_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
 1628|  64.8k|        u1_end_of_row = (!u1_num_mbs_next) && (!(u1_mbaff && (u1_num_mbs & 0x01)));
  ------------------
  |  Branch (1628:25): [True: 17.7k, False: 47.0k]
  |  Branch (1628:50): [True: 0, False: 17.7k]
  |  Branch (1628:62): [True: 0, False: 0]
  ------------------
 1629|  64.8k|        u1_tfr_n_mb =
 1630|  64.8k|            (u1_num_mbs == ps_dec->u4_recon_mb_grp) || u1_end_of_row || (!uc_more_data_flag);
  ------------------
  |  Branch (1630:13): [True: 17.6k, False: 47.2k]
  |  Branch (1630:56): [True: 148, False: 47.0k]
  |  Branch (1630:73): [True: 309, False: 46.7k]
  ------------------
 1631|  64.8k|        ps_cur_mb_info->u1_end_of_slice = (!uc_more_data_flag);
 1632|       |
 1633|  64.8k|        if(u1_tfr_n_mb || (!uc_more_data_flag))
  ------------------
  |  Branch (1633:12): [True: 18.0k, False: 46.7k]
  |  Branch (1633:27): [True: 0, False: 46.7k]
  ------------------
 1634|  18.0k|        {
 1635|  18.0k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1635:16): [True: 11.7k, False: 6.34k]
  ------------------
 1636|  11.7k|            {
 1637|  11.7k|                ih264d_parse_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next, u1_tfr_n_mb,
 1638|  11.7k|                                     u1_end_of_row);
 1639|  11.7k|                ps_dec->ps_nmb_info += u1_num_mbs;
 1640|  11.7k|                ps_svc_lyr_dec->ps_svc_nmb_info += u1_num_mbs;
 1641|  11.7k|            }
 1642|  6.34k|            else
 1643|  6.34k|            {
 1644|  6.34k|                ret = isvcd_decode_recon_tfr_nmb_non_base_lyr(ps_svc_lyr_dec, u1_mb_idx, u1_num_mbs,
 1645|  6.34k|                                                              u1_num_mbs_next, u1_tfr_n_mb,
 1646|  6.34k|                                                              u1_end_of_row);
 1647|  6.34k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  6.34k|#define OK        0
  ------------------
  |  Branch (1647:20): [True: 0, False: 6.34k]
  ------------------
 1648|  6.34k|            }
 1649|  18.0k|            ps_dec->u4_total_mbs_coded += u1_num_mbs;
 1650|  18.0k|            if(u1_tfr_n_mb) u1_num_mbs = 0;
  ------------------
  |  Branch (1650:16): [True: 18.0k, False: 0]
  ------------------
 1651|  18.0k|            u1_mb_idx = u1_num_mbs;
 1652|  18.0k|            ps_dec->u4_mb_idx = u1_num_mbs;
 1653|  18.0k|        }
 1654|  64.8k|    } while(uc_more_data_flag);
  ------------------
  |  Branch (1654:13): [True: 64.2k, False: 567]
  ------------------
 1655|       |
 1656|  1.23k|    ps_dec->u4_num_mbs_cur_nmb = 0;
 1657|  1.23k|    ps_dec->ps_cur_slice->u4_mbs_in_slice = i2_cur_mb_addr - (u2_first_mb_in_slice << u1_mbaff);
 1658|       |
 1659|  1.23k|    return ret;
 1660|  3.52k|}
isvcd_parse_imb_cabac:
 1677|  39.7k|{
 1678|  39.7k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1679|  39.7k|    WORD8 i1_delta_qp;
 1680|  39.7k|    UWORD8 u1_cbp;
 1681|  39.7k|    UWORD8 u1_offset;
 1682|       |    /* Variables for handling Cabac contexts */
 1683|  39.7k|    ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
 1684|  39.7k|    ctxt_inc_mb_info_t *ps_left_ctxt = ps_dec->p_left_ctxt_mb_info;
 1685|  39.7k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
 1686|  39.7k|    bin_ctxt_model_t *p_bin_ctxt;
 1687|  39.7k|    UWORD8 u1_intra_chrom_pred_mode;
 1688|  39.7k|    UWORD8 u1_dc_block_flag = 0;
 1689|  39.7k|    WORD32 ret;
 1690|       |
 1691|  39.7k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
 1692|       |
 1693|  39.7k|    if(ps_left_ctxt == ps_dec->ps_def_ctxt_mb_info)
  ------------------
  |  Branch (1693:8): [True: 10.0k, False: 29.6k]
  ------------------
 1694|  10.0k|    {
 1695|  10.0k|        ps_dec->pu1_left_yuv_dc_csbp[0] = 0xf;
 1696|  10.0k|    }
 1697|       |
 1698|  39.7k|    if(ps_dec->ps_cur_slice->u1_slice_type != I_SLICE)
  ------------------
  |  |  370|  39.7k|#define I_SLICE  2
  ------------------
  |  Branch (1698:8): [True: 21.9k, False: 17.7k]
  ------------------
 1699|  21.9k|    {
 1700|  21.9k|        MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
  ------------------
  |  |  652|  21.9k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  21.9k|{                                                               \
  |  |  654|  21.9k|    memset(pu4_start,value,16);                                 \
  |  |  655|  21.9k|}
  ------------------
 1701|  21.9k|        *((UWORD32 *) ps_dec->pi1_left_ref_idx_ctxt_inc) = 0;
 1702|  21.9k|        MEMSET_16BYTES(p_curr_ctxt->u1_mv, 0);
  ------------------
  |  |  652|  21.9k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  21.9k|{                                                               \
  |  |  654|  21.9k|    memset(pu4_start,value,16);                                 \
  |  |  655|  21.9k|}
  ------------------
 1703|  21.9k|        memset(p_curr_ctxt->i1_ref_idx, 0, 4);
 1704|  21.9k|    }
 1705|       |
 1706|       |    /* default */
 1707|  39.7k|    ps_cur_mb_info->ps_curmb->u1_mb_type = P_MB;
  ------------------
  |  |  419|  39.7k|#define P_MB        2
  ------------------
 1708|  39.7k|    if(!ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (1708:8): [True: 9.13k, False: 30.5k]
  ------------------
 1709|  9.13k|    {
 1710|  9.13k|        if(u1_mb_type == I_4x4_MB)
  ------------------
  |  |  417|  9.13k|#define I_4x4_MB    0
  ------------------
  |  Branch (1710:12): [True: 4.71k, False: 4.42k]
  ------------------
 1711|  4.71k|        {
 1712|  4.71k|            ps_cur_mb_info->ps_curmb->u1_mb_type = I_4x4_MB;
  ------------------
  |  |  417|  4.71k|#define I_4x4_MB    0
  ------------------
 1713|  4.71k|            p_curr_ctxt->u1_mb_type = CAB_I4x4;
  ------------------
  |  |  394|  4.71k|#define CAB_I4x4          0x00 /* 0000 00x0 */
  ------------------
 1714|  4.71k|            u1_offset = 0;
 1715|  4.71k|            ps_cur_mb_info->u1_tran_form8x8 = 0;
 1716|  4.71k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
 1717|       |            /*--------------------------------------------------------------------*/
 1718|       |            /* Read transform_size_8x8_flag if present                            */
 1719|       |            /*--------------------------------------------------------------------*/
 1720|  4.71k|            if(ps_dec->ps_cur_pps->i4_transform_8x8_mode_flag)
  ------------------
  |  Branch (1720:16): [True: 4.43k, False: 287]
  ------------------
 1721|  4.43k|            {
 1722|  4.43k|                ps_cur_mb_info->u1_tran_form8x8 =
 1723|  4.43k|                    ih264d_parse_transform8x8flag_cabac(ps_dec, ps_cur_mb_info);
 1724|  4.43k|                COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
 1725|  4.43k|                p_curr_ctxt->u1_transform8x8_ctxt = ps_cur_mb_info->u1_tran_form8x8;
 1726|  4.43k|                ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
 1727|  4.43k|            }
 1728|    287|            else
 1729|    287|            {
 1730|    287|                p_curr_ctxt->u1_transform8x8_ctxt = 0;
 1731|    287|            }
 1732|       |
 1733|       |            /*--------------------------------------------------------------------*/
 1734|       |            /* Read the IntraPrediction modes for LUMA                            */
 1735|       |            /*--------------------------------------------------------------------*/
 1736|  4.71k|            if(!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (1736:16): [True: 988, False: 3.72k]
  ------------------
 1737|    988|            {
 1738|    988|                UWORD8 *pu1_temp;
 1739|    988|                ih264d_read_intra_pred_modes_cabac(ps_dec,
 1740|    988|                                                   ((UWORD8 *) ps_dec->pv_parse_tu_coeff_data),
 1741|    988|                                                   ((UWORD8 *) ps_dec->pv_parse_tu_coeff_data + 16),
 1742|    988|                                                   ps_cur_mb_info->u1_tran_form8x8);
 1743|    988|                pu1_temp = (UWORD8 *) ps_dec->pv_parse_tu_coeff_data;
 1744|    988|                pu1_temp += 32;
 1745|    988|                ps_dec->pv_parse_tu_coeff_data = (void *) pu1_temp;
 1746|    988|            }
 1747|  3.72k|            else
 1748|  3.72k|            {
 1749|  3.72k|                UWORD8 *pu1_temp;
 1750|  3.72k|                ih264d_read_intra_pred_modes_cabac(ps_dec,
 1751|  3.72k|                                                   ((UWORD8 *) ps_dec->pv_parse_tu_coeff_data),
 1752|  3.72k|                                                   ((UWORD8 *) ps_dec->pv_parse_tu_coeff_data + 4),
 1753|  3.72k|                                                   ps_cur_mb_info->u1_tran_form8x8);
 1754|  3.72k|                pu1_temp = (UWORD8 *) ps_dec->pv_parse_tu_coeff_data;
 1755|  3.72k|                pu1_temp += 8;
 1756|  3.72k|                ps_dec->pv_parse_tu_coeff_data = (void *) pu1_temp;
 1757|  3.72k|            }
 1758|       |            /*--------------------------------------------------------------------*/
 1759|       |            /* Read the IntraPrediction mode for CHROMA                           */
 1760|       |            /*--------------------------------------------------------------------*/
 1761|  4.71k|            u1_intra_chrom_pred_mode = ih264d_parse_chroma_pred_mode_cabac(ps_dec);
 1762|  4.71k|            COPYTHECONTEXT("intra_chroma_pred_mode", u1_intra_chrom_pred_mode);
 1763|  4.71k|            p_curr_ctxt->u1_intra_chroma_pred_mode = ps_cur_mb_info->u1_chroma_pred_mode =
 1764|  4.71k|                u1_intra_chrom_pred_mode;
 1765|       |
 1766|       |            /*--------------------------------------------------------------------*/
 1767|       |            /* Read the Coded block pattern                                       */
 1768|       |            /*--------------------------------------------------------------------*/
 1769|  4.71k|            u1_cbp = ih264d_parse_ctx_cbp_cabac(ps_dec);
 1770|  4.71k|            COPYTHECONTEXT("coded_block_pattern", u1_cbp);
 1771|  4.71k|            ps_cur_mb_info->u1_cbp = u1_cbp;
 1772|  4.71k|            p_curr_ctxt->u1_cbp = u1_cbp;
 1773|       |
 1774|       |            /*--------------------------------------------------------------------*/
 1775|       |            /* Read mb_qp_delta                                                   */
 1776|       |            /*--------------------------------------------------------------------*/
 1777|  4.71k|            if(ps_cur_mb_info->u1_cbp)
  ------------------
  |  Branch (1777:16): [True: 3.71k, False: 1.00k]
  ------------------
 1778|  3.71k|            {
 1779|  3.71k|                ret = ih264d_parse_mb_qp_delta_cabac(ps_dec, &i1_delta_qp);
 1780|  3.71k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  3.71k|#define OK        0
  ------------------
  |  Branch (1780:20): [True: 49, False: 3.66k]
  ------------------
 1781|  3.66k|                COPYTHECONTEXT("mb_qp_delta", i1_delta_qp);
 1782|  3.66k|                if(i1_delta_qp != 0)
  ------------------
  |  Branch (1782:20): [True: 970, False: 2.69k]
  ------------------
 1783|    970|                {
 1784|    970|                    ret = ih264d_update_qp(ps_dec, i1_delta_qp);
 1785|    970|                    if(ret != OK) return ret;
  ------------------
  |  |  114|    970|#define OK        0
  ------------------
  |  Branch (1785:24): [True: 0, False: 970]
  ------------------
 1786|    970|                }
 1787|  3.66k|            }
 1788|  1.00k|            else
 1789|  1.00k|                ps_dec->i1_prev_mb_qp_delta = 0;
 1790|  4.66k|            p_curr_ctxt->u1_yuv_dc_csbp &= 0xFE;
 1791|  4.66k|        }
 1792|  4.42k|        else
 1793|  4.42k|        {
 1794|  4.42k|            u1_offset = 1;
 1795|  4.42k|            ps_cur_mb_info->ps_curmb->u1_mb_type = I_16x16_MB;
  ------------------
  |  |  418|  4.42k|#define I_16x16_MB  1
  ------------------
 1796|  4.42k|            p_curr_ctxt->u1_mb_type = CAB_I16x16;
  ------------------
  |  |  395|  4.42k|#define CAB_I16x16        0x01 /* 0000 00x1 */
  ------------------
 1797|  4.42k|            ps_cur_mb_info->u1_tran_form8x8 = 0;
 1798|  4.42k|            p_curr_ctxt->u1_transform8x8_ctxt = 0;
 1799|  4.42k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
 1800|       |            /*--------------------------------------------------------------------*/
 1801|       |            /* Read the IntraPrediction mode for CHROMA                           */
 1802|       |            /*--------------------------------------------------------------------*/
 1803|  4.42k|            u1_intra_chrom_pred_mode = ih264d_parse_chroma_pred_mode_cabac(ps_dec);
 1804|  4.42k|            if(u1_intra_chrom_pred_mode > 3) return ERROR_CHROMA_PRED_MODE;
  ------------------
  |  Branch (1804:16): [True: 0, False: 4.42k]
  ------------------
 1805|       |
 1806|  4.42k|            COPYTHECONTEXT("Chroma intra_chroma_pred_mode pred mode", u1_intra_chrom_pred_mode);
 1807|  4.42k|            p_curr_ctxt->u1_intra_chroma_pred_mode = ps_cur_mb_info->u1_chroma_pred_mode =
 1808|  4.42k|                u1_intra_chrom_pred_mode;
 1809|       |
 1810|       |            /*--------------------------------------------------------------------*/
 1811|       |            /* Read the Coded block pattern                                       */
 1812|       |            /*--------------------------------------------------------------------*/
 1813|  4.42k|            u1_cbp = gau1_ih264d_cbp_tab[(u1_mb_type - 1) >> 2];
 1814|  4.42k|            ps_cur_mb_info->u1_cbp = u1_cbp;
 1815|  4.42k|            p_curr_ctxt->u1_cbp = u1_cbp;
 1816|       |
 1817|       |            /*--------------------------------------------------------------------*/
 1818|       |            /* Read mb_qp_delta                                                   */
 1819|       |            /*--------------------------------------------------------------------*/
 1820|  4.42k|            ret = ih264d_parse_mb_qp_delta_cabac(ps_dec, &i1_delta_qp);
 1821|  4.42k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  4.42k|#define OK        0
  ------------------
  |  Branch (1821:16): [True: 77, False: 4.34k]
  ------------------
 1822|  4.34k|            COPYTHECONTEXT("mb_qp_delta", i1_delta_qp);
 1823|  4.34k|            if(i1_delta_qp != 0)
  ------------------
  |  Branch (1823:16): [True: 866, False: 3.47k]
  ------------------
 1824|    866|            {
 1825|    866|                ret = ih264d_update_qp(ps_dec, i1_delta_qp);
 1826|    866|                if(ret != OK) return ret;
  ------------------
  |  |  114|    866|#define OK        0
  ------------------
  |  Branch (1826:20): [True: 0, False: 866]
  ------------------
 1827|    866|            }
 1828|       |
 1829|  4.34k|            {
 1830|  4.34k|                WORD16 i_scaleFactor;
 1831|  4.34k|                WORD16 *pi2_scale_matrix_ptr;
 1832|       |                /*******************************************************************/
 1833|       |                /* for luma DC coefficients the scaling is done during the parsing */
 1834|       |                /* to preserve the precision                                       */
 1835|       |                /*******************************************************************/
 1836|  4.34k|                if(ps_dec->s_high_profile.u1_scaling_present)
  ------------------
  |  Branch (1836:20): [True: 759, False: 3.58k]
  ------------------
 1837|    759|                {
 1838|    759|                    pi2_scale_matrix_ptr = ps_dec->s_high_profile.i2_scalinglist4x4[0];
 1839|    759|                }
 1840|  3.58k|                else
 1841|  3.58k|                {
 1842|  3.58k|                    i_scaleFactor = 16;
 1843|  3.58k|                    pi2_scale_matrix_ptr = &i_scaleFactor;
 1844|  3.58k|                }
 1845|  4.34k|                {
 1846|  4.34k|                    ctxt_inc_mb_info_t *ps_top_ctxt = ps_dec->p_top_ctxt_mb_info;
 1847|  4.34k|                    UWORD8 uc_a, uc_b;
 1848|  4.34k|                    UWORD32 u4_ctx_inc;
 1849|  4.34k|                    INC_SYM_COUNT(&(ps_dec->s_cab_dec_env));
 1850|       |
 1851|       |                    /* if MbAddrN not available then CondTermN = 1 */
 1852|  4.34k|                    uc_b = ((ps_top_ctxt->u1_yuv_dc_csbp) & 0x01);
 1853|       |
 1854|       |                    /* if MbAddrN not available then CondTermN = 1 */
 1855|  4.34k|                    uc_a = ((ps_dec->pu1_left_yuv_dc_csbp[0]) & 0x01);
 1856|       |
 1857|  4.34k|                    u4_ctx_inc = (uc_a + (uc_b << 1));
 1858|  4.34k|                    {
 1859|  4.34k|                        WORD16 pi2_dc_coef[16] = {0};
 1860|  4.34k|                        tu_sblk4x4_coeff_data_t *ps_tu_4x4 =
 1861|  4.34k|                            (tu_sblk4x4_coeff_data_t *) ps_dec->pv_parse_tu_coeff_data;
 1862|  4.34k|                        WORD16 *pi2_coeff_block = (WORD16 *) ps_dec->pv_parse_tu_coeff_data;
 1863|       |
 1864|  4.34k|                        p_bin_ctxt = (ps_dec->p_cbf_t[LUMA_DC_CTXCAT]) + u4_ctx_inc;
  ------------------
  |  |   71|  4.34k|#define LUMA_DC_CTXCAT    0
  ------------------
 1865|       |
 1866|  4.34k|                        u1_dc_block_flag = ih264d_read_coeff4x4_cabac(
 1867|  4.34k|                            ps_bitstrm, LUMA_DC_CTXCAT,
  ------------------
  |  |   71|  4.34k|#define LUMA_DC_CTXCAT    0
  ------------------
 1868|  4.34k|                            ps_dec->p_significant_coeff_flag_t[LUMA_DC_CTXCAT], ps_dec, p_bin_ctxt);
  ------------------
  |  |   71|  4.34k|#define LUMA_DC_CTXCAT    0
  ------------------
 1869|       |
 1870|       |                        /* Store coded_block_flag */
 1871|  4.34k|                        p_curr_ctxt->u1_yuv_dc_csbp &= 0xFE;
 1872|  4.34k|                        p_curr_ctxt->u1_yuv_dc_csbp |= u1_dc_block_flag;
 1873|  4.34k|                        if(u1_dc_block_flag)
  ------------------
  |  Branch (1873:28): [True: 2.82k, False: 1.51k]
  ------------------
 1874|  2.82k|                        {
 1875|  2.82k|                            WORD32 pi4_tmp[16] = {0};
 1876|  2.82k|                            memset(pi2_dc_coef, 0, sizeof(pi2_dc_coef));
 1877|  2.82k|                            ih264d_unpack_coeff4x4_dc_4x4blk(ps_tu_4x4, pi2_dc_coef,
 1878|  2.82k|                                                             ps_dec->pu1_inv_scan);
 1879|       |
 1880|  2.82k|                            PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  2.82k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
 1881|  2.82k|                            ps_dec->pf_ihadamard_scaling_4x4(
 1882|  2.82k|                                pi2_dc_coef, pi2_coeff_block, ps_dec->pu2_quant_scale_y,
 1883|  2.82k|                                (UWORD16 *) pi2_scale_matrix_ptr, ps_dec->u1_qp_y_div6, pi4_tmp);
 1884|  2.82k|                            pi2_coeff_block += 16;
 1885|  2.82k|                            ps_dec->pv_parse_tu_coeff_data = (void *) pi2_coeff_block;
 1886|  2.82k|                            SET_BIT(ps_cur_mb_info->u1_yuv_dc_block_flag, 0);
  ------------------
  |  |  106|  2.82k|#define SET_BIT(x, pos) (x) = (x) | (1 << pos);
  ------------------
 1887|  2.82k|                        }
 1888|  4.34k|                    }
 1889|  4.34k|                }
 1890|  4.34k|            }
 1891|  4.34k|        }
 1892|  9.01k|        ps_dec->pu1_left_yuv_dc_csbp[0] &= 0x6;
 1893|  9.01k|        ps_dec->pu1_left_yuv_dc_csbp[0] |= u1_dc_block_flag;
 1894|  9.01k|    }
 1895|  30.5k|    else
 1896|  30.5k|    {
 1897|  30.5k|        u1_offset = 0;
 1898|       |        /*--------------------------------------------------------------------*/
 1899|       |        /* Read the Coded block pattern                                       */
 1900|       |        /*--------------------------------------------------------------------*/
 1901|  30.5k|        u1_cbp = ih264d_parse_ctx_cbp_cabac(ps_dec);
 1902|  30.5k|        COPYTHECONTEXT("coded_block_pattern", u1_cbp);
 1903|       |
 1904|  30.5k|        ps_cur_mb_info->u1_cbp = u1_cbp;
 1905|  30.5k|        p_curr_ctxt->u1_cbp = u1_cbp;
 1906|  30.5k|        p_curr_ctxt->u1_yuv_dc_csbp &= 0xFE;
 1907|  30.5k|        ps_dec->pu1_left_yuv_dc_csbp[0] &= 0x6;
 1908|  30.5k|        p_curr_ctxt->u1_mb_type = CAB_INFERRED;
  ------------------
  |  |   74|  30.5k|#define CAB_INFERRED 0xFF
  ------------------
 1909|  30.5k|        p_curr_ctxt->u1_intra_chroma_pred_mode = 0;
 1910|  30.5k|        ps_cur_mb_info->u1_tran_form8x8 = 0;
 1911|  30.5k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
 1912|       |
 1913|       |        /*--------------------------------------------------------------------*/
 1914|       |        /* Read transform_size_8x8_flag if present                            */
 1915|       |        /*--------------------------------------------------------------------*/
 1916|  30.5k|        if((ps_dec->ps_cur_pps->i4_transform_8x8_mode_flag) && (u1_cbp & 0xf))
  ------------------
  |  Branch (1916:12): [True: 16.0k, False: 14.5k]
  |  Branch (1916:64): [True: 9.06k, False: 6.96k]
  ------------------
 1917|  9.06k|        {
 1918|  9.06k|            ps_cur_mb_info->u1_tran_form8x8 =
 1919|  9.06k|                ih264d_parse_transform8x8flag_cabac(ps_dec, ps_cur_mb_info);
 1920|  9.06k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
 1921|  9.06k|            p_curr_ctxt->u1_transform8x8_ctxt = ps_cur_mb_info->u1_tran_form8x8;
 1922|  9.06k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
 1923|  9.06k|        }
 1924|  21.5k|        else
 1925|  21.5k|        {
 1926|  21.5k|            p_curr_ctxt->u1_transform8x8_ctxt = 0;
 1927|  21.5k|        }
 1928|       |
 1929|       |        /*--------------------------------------------------------------------*/
 1930|       |        /* Read mb_qp_delta                                                   */
 1931|       |        /*--------------------------------------------------------------------*/
 1932|  30.5k|        if(ps_cur_mb_info->u1_cbp)
  ------------------
  |  Branch (1932:12): [True: 20.5k, False: 10.0k]
  ------------------
 1933|  20.5k|        {
 1934|  20.5k|            ret = ih264d_parse_mb_qp_delta_cabac(ps_dec, &i1_delta_qp);
 1935|  20.5k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  20.5k|#define OK        0
  ------------------
  |  Branch (1935:16): [True: 68, False: 20.4k]
  ------------------
 1936|  20.4k|            COPYTHECONTEXT("mb_qp_delta", i1_delta_qp);
 1937|  20.4k|            if(i1_delta_qp != 0)
  ------------------
  |  Branch (1937:16): [True: 2.88k, False: 17.6k]
  ------------------
 1938|  2.88k|            {
 1939|  2.88k|                ret = ih264d_update_qp(ps_dec, i1_delta_qp);
 1940|  2.88k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  2.88k|#define OK        0
  ------------------
  |  Branch (1940:20): [True: 0, False: 2.88k]
  ------------------
 1941|  2.88k|            }
 1942|  20.4k|        }
 1943|  10.0k|        else
 1944|  10.0k|            ps_dec->i1_prev_mb_qp_delta = 0;
 1945|  30.5k|    }
 1946|       |
 1947|  39.5k|    ih264d_parse_residual4x4_cabac(ps_dec, ps_cur_mb_info, u1_offset);
 1948|  39.5k|    if(EXCEED_OFFSET(ps_bitstrm)) return ERROR_EOB_TERMINATE_T;
  ------------------
  |  |   93|  39.5k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 1.17k, False: 38.3k]
  |  |  ------------------
  ------------------
 1949|  38.3k|    return OK;
  ------------------
  |  |  114|  38.3k|#define OK        0
  ------------------
 1950|  39.5k|}
isvcd_parse_islice:
 1965|  7.42k|{
 1966|  7.42k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1967|  7.42k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1968|  7.42k|    dec_slice_params_t *ps_slice = ps_dec->ps_cur_slice;
 1969|  7.42k|    UWORD32 *pu4_bitstrm_buf = ps_dec->ps_bitstrm->pu4_buffer;
 1970|  7.42k|    UWORD32 *pu4_bitstrm_ofst = &ps_dec->ps_bitstrm->u4_ofst;
 1971|  7.42k|    UWORD32 u4_temp;
 1972|  7.42k|    WORD32 i_temp;
 1973|  7.42k|    WORD32 ret;
 1974|       |
 1975|       |    /*--------------------------------------------------------------------*/
 1976|       |    /* Read remaining contents of the slice header                        */
 1977|       |    /*--------------------------------------------------------------------*/
 1978|       |    /* dec_ref_pic_marking function */
 1979|       |    /* G050 */
 1980|  7.42k|    if(ps_slice->u1_nal_ref_idc != 0)
  ------------------
  |  Branch (1980:8): [True: 6.92k, False: 504]
  ------------------
 1981|  6.92k|    {
 1982|  6.92k|        if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (1982:12): [True: 5.94k, False: 974]
  ------------------
 1983|  5.94k|        {
 1984|  5.94k|            dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1985|  5.94k|            dec_seq_params_t *ps_sps_tmp = ps_pps->ps_sps;
 1986|  5.94k|            UWORD8 u1_nal_unit_type_tmp = ps_dec->u1_nal_unit_type;
 1987|       |
 1988|  5.94k|            ps_pps->ps_sps = ps_dec->ps_cur_sps;
 1989|  5.94k|            if(ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag)
  ------------------
  |  Branch (1989:16): [True: 5.62k, False: 324]
  ------------------
 1990|  5.62k|                ps_dec->u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  5.62k|#define IDR_SLICE_NAL                   5
  ------------------
 1991|       |
 1992|  5.94k|            i_temp = ih264d_read_mmco_commands(ps_dec);
 1993|  5.94k|            ps_pps->ps_sps = ps_sps_tmp;
 1994|  5.94k|            ps_dec->u1_nal_unit_type = u1_nal_unit_type_tmp;
 1995|       |
 1996|  5.94k|            if(i_temp < 0)
  ------------------
  |  Branch (1996:16): [True: 144, False: 5.80k]
  ------------------
 1997|    144|            {
 1998|    144|                return ERROR_DBP_MANAGER_T;
 1999|    144|            }
 2000|  5.80k|            ps_dec->u4_bitoffset = i_temp;
 2001|  5.80k|        }
 2002|    974|        else
 2003|    974|            ps_dec->ps_bitstrm->u4_ofst += ps_dec->u4_bitoffset;
 2004|  6.92k|    }
 2005|       |
 2006|  7.28k|    {
 2007|       |        /* G050 */
 2008|       |        /* Read slice_qp_delta */
 2009|  7.28k|        WORD64 i8_temp =
 2010|  7.28k|            (WORD64) ps_pps->u1_pic_init_qp + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2011|  7.28k|        if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  |  629|  7.28k|#define MIN_H264_QP 0
  ------------------
                      if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  |  634|  7.03k|#define MAX_H264_QP 51
  ------------------
  |  Branch (2011:12): [True: 246, False: 7.03k]
  |  Branch (2011:39): [True: 464, False: 6.57k]
  ------------------
 2012|  6.57k|        ps_slice->u1_slice_qp = (UWORD8) i8_temp;
 2013|  6.57k|        COPYTHECONTEXT("SH: slice_qp_delta", ps_slice->u1_slice_qp - ps_pps->u1_pic_init_qp);
 2014|  6.57k|    }
 2015|  6.57k|    if(ps_pps->u1_deblocking_filter_parameters_present_flag == 1)
  ------------------
  |  Branch (2015:8): [True: 3.52k, False: 3.04k]
  ------------------
 2016|  3.52k|    {
 2017|  3.52k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2018|  3.52k|        COPYTHECONTEXT("SH: disable_deblocking_filter_idc", u4_temp);
 2019|       |
 2020|  3.52k|        if(u4_temp > SLICE_BOUNDARY_DBLK_DISABLED)
  ------------------
  |  |  547|  3.52k|#define SLICE_BOUNDARY_DBLK_DISABLED  2
  ------------------
  |  Branch (2020:12): [True: 231, False: 3.29k]
  ------------------
 2021|    231|        {
 2022|    231|            return ERROR_INV_SLICE_HDR_T;
 2023|    231|        }
 2024|  3.29k|        ps_slice->u1_disable_dblk_filter_idc = u4_temp;
 2025|  3.29k|        if(u4_temp != 1)
  ------------------
  |  Branch (2025:12): [True: 2.99k, False: 298]
  ------------------
 2026|  2.99k|        {
 2027|  2.99k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 2028|  2.99k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  2.99k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  2.88k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (2028:16): [True: 110, False: 2.88k]
  |  Branch (2028:47): [True: 101, False: 2.78k]
  ------------------
 2029|    211|            {
 2030|    211|                return ERROR_INV_SLICE_HDR_T;
 2031|    211|            }
 2032|  2.78k|            ps_slice->i1_slice_alpha_c0_offset = i_temp;
 2033|  2.78k|            COPYTHECONTEXT("SH: slice_alpha_c0_offset_div2",
 2034|  2.78k|                           ps_slice->i1_slice_alpha_c0_offset >> 1);
 2035|       |
 2036|  2.78k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 2037|  2.78k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  2.78k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  2.64k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (2037:16): [True: 140, False: 2.64k]
  |  Branch (2037:47): [True: 153, False: 2.49k]
  ------------------
 2038|    293|            {
 2039|    293|                return ERROR_INV_SLICE_HDR_T;
 2040|    293|            }
 2041|  2.49k|            ps_slice->i1_slice_beta_offset = i_temp;
 2042|  2.49k|            COPYTHECONTEXT("SH: slice_beta_offset_div2", ps_slice->i1_slice_beta_offset >> 1);
 2043|  2.49k|        }
 2044|    298|        else
 2045|    298|        {
 2046|    298|            ps_slice->i1_slice_alpha_c0_offset = 0;
 2047|    298|            ps_slice->i1_slice_beta_offset = 0;
 2048|    298|        }
 2049|  3.29k|    }
 2050|  3.04k|    else
 2051|  3.04k|    {
 2052|  3.04k|        ps_slice->u1_disable_dblk_filter_idc = 0;
 2053|  3.04k|        ps_slice->i1_slice_alpha_c0_offset = 0;
 2054|  3.04k|        ps_slice->i1_slice_beta_offset = 0;
 2055|  3.04k|    }
 2056|       |
 2057|       |    /* Initialization to check if number of motion vector per 2 Mbs */
 2058|       |    /* are exceeding the range or not */
 2059|  5.83k|    ps_dec->u2_mv_2mb[0] = 0;
 2060|  5.83k|    ps_dec->u2_mv_2mb[1] = 0;
 2061|       |
 2062|       |    /*set slice header cone to 2 ,to indicate  correct header*/
 2063|  5.83k|    ps_dec->u1_slice_header_done = 2;
 2064|  5.83k|    if(ps_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (2064:8): [True: 3.77k, False: 2.06k]
  ------------------
 2065|  3.77k|    {
 2066|  3.77k|        SWITCHOFFTRACE;
 2067|  3.77k|        SWITCHONTRACECABAC;
 2068|  3.77k|        if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (2068:12): [True: 0, False: 3.77k]
  ------------------
 2069|      0|        {
 2070|      0|            ps_dec->pf_get_mb_info = ih264d_get_mb_info_cabac_mbaff;
 2071|      0|        }
 2072|  3.77k|        else
 2073|  3.77k|            ps_dec->pf_get_mb_info = isvcd_get_mb_info_cabac_nonmbaff;
 2074|       |
 2075|  3.77k|        ret = isvcd_parse_islice_data_cabac(ps_svc_lyr_dec, ps_slice, u2_first_mb_in_slice);
 2076|  3.77k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  3.77k|#define OK        0
  ------------------
  |  Branch (2076:12): [True: 3.07k, False: 700]
  ------------------
 2077|    700|        SWITCHONTRACE;
 2078|    700|        SWITCHOFFTRACECABAC;
 2079|    700|    }
 2080|  2.06k|    else
 2081|  2.06k|    {
 2082|  2.06k|        if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (2082:12): [True: 0, False: 2.06k]
  ------------------
 2083|      0|        {
 2084|      0|            ps_dec->pf_get_mb_info = ih264d_get_mb_info_cavlc_mbaff;
 2085|      0|        }
 2086|  2.06k|        else
 2087|  2.06k|            ps_dec->pf_get_mb_info = isvcd_get_mb_info_cavlc_nonmbaff;
 2088|  2.06k|        ret = isvcd_parse_islice_data_cavlc(ps_svc_lyr_dec, ps_slice, u2_first_mb_in_slice);
 2089|  2.06k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  2.06k|#define OK        0
  ------------------
  |  Branch (2089:12): [True: 1.84k, False: 214]
  ------------------
 2090|  2.06k|    }
 2091|       |
 2092|    914|    return OK;
  ------------------
  |  |  114|    914|#define OK        0
  ------------------
 2093|  5.83k|}

isvcd_parse_epslice:
   99|  15.1k|{
  100|  15.1k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  101|  15.1k|    WORD32 i_status = OK;
  ------------------
  |  |  114|  15.1k|#define OK        0
  ------------------
  102|  15.1k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
  103|  15.1k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
  104|  15.1k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
  105|  15.1k|    dec_seq_params_t *ps_seq;
  106|  15.1k|    dec_svc_seq_params_t *ps_subset_seq;
  107|  15.1k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
  108|  15.1k|    dec_subset_seq_params_t *ps_sps_svc_ext = NULL;
  109|  15.1k|    dec_nal_unit_svc_ext_params_t *ps_nal_svc_ext = NULL;
  110|       |
  111|  15.1k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  112|  15.1k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  113|  15.1k|    UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  114|  15.1k|    UWORD8 u1_field_pic_flag = ps_cur_slice->u1_field_pic_flag;
  115|       |
  116|  15.1k|    UWORD64 u8_ref_idx_l0;
  117|  15.1k|    UWORD32 u4_temp;
  118|  15.1k|    WORD32 i_temp;
  119|  15.1k|    WORD32 ret;
  120|  15.1k|    WORD64 i8_temp;
  121|       |
  122|  15.1k|    ps_nal_svc_ext = ps_svc_lyr_dec->ps_nal_svc_ext;
  123|  15.1k|    ps_seq = ps_pps->ps_sps;
  124|  15.1k|    ps_seq += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  15.1k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  125|  15.1k|    ps_subset_seq =
  126|  15.1k|        &ps_svc_lyr_dec->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_seq->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  15.1k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  127|  15.1k|    ps_sps_svc_ext = &ps_subset_seq->s_sps_svc_ext;
  128|  15.1k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
  129|       |
  130|       |    /*--------------------------------------------------------------------*/
  131|       |    /* Read remaining contents of the slice header                        */
  132|       |    /*--------------------------------------------------------------------*/
  133|  15.1k|    {
  134|  15.1k|        WORD8 *pi1_buf;
  135|  15.1k|        WORD16 *pi2_mv = ps_dec->s_default_mv_pred.i2_mv;
  136|  15.1k|        WORD32 *pi4_mv = (WORD32 *) pi2_mv;
  137|  15.1k|        WORD16 *pi16_refFrame;
  138|       |
  139|  15.1k|        pi1_buf = ps_dec->s_default_mv_pred.i1_ref_frame;
  140|  15.1k|        pi16_refFrame = (WORD16 *) pi1_buf;
  141|  15.1k|        *pi4_mv = 0;
  142|  15.1k|        *(pi4_mv + 1) = 0;
  143|  15.1k|        *pi16_refFrame = OUT_OF_RANGE_REF;
  ------------------
  |  |   45|  15.1k|#define OUT_OF_RANGE_REF  -1
  ------------------
  144|  15.1k|        ps_dec->s_default_mv_pred.u1_col_ref_pic_idx = (UWORD8) -1;
  145|  15.1k|        ps_dec->s_default_mv_pred.u1_pic_type = (UWORD8) -1;
  146|  15.1k|    }
  147|       |
  148|  15.1k|    if(0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id)
  ------------------
  |  Branch (148:8): [True: 15.1k, False: 0]
  ------------------
  149|  15.1k|    {
  150|  15.1k|        ps_cur_slice->u1_num_ref_idx_active_override_flag = ih264d_get_bit_h264(ps_bitstrm);
  151|       |
  152|  15.1k|        COPYTHECONTEXT("Slice Header SVC ext: num_ref_idx_override_flag",
  153|  15.1k|                       ps_cur_slice->u1_num_ref_idx_active_override_flag);
  154|       |
  155|  15.1k|        u8_ref_idx_l0 = ps_dec->ps_cur_pps->u1_num_ref_idx_lx_active[0];
  156|  15.1k|        if(ps_cur_slice->u1_num_ref_idx_active_override_flag)
  ------------------
  |  Branch (156:12): [True: 9.35k, False: 5.80k]
  ------------------
  157|  9.35k|        {
  158|  9.35k|            u8_ref_idx_l0 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf) + (UWORD64) 1;
  159|  9.35k|        }
  160|       |
  161|  15.1k|        {
  162|  15.1k|            UWORD8 u1_max_ref_idx = H264_MAX_REF_PICS << u1_field_pic_flag;
  ------------------
  |  |  534|  15.1k|#define H264_MAX_REF_PICS         16
  ------------------
  163|  15.1k|            if(u8_ref_idx_l0 > u1_max_ref_idx)
  ------------------
  |  Branch (163:16): [True: 129, False: 15.0k]
  ------------------
  164|    129|            {
  165|    129|                return ERROR_NUM_REF;
  166|    129|            }
  167|  15.0k|            ps_cur_slice->u1_num_ref_idx_lx_active[0] = (UWORD8) u8_ref_idx_l0;
  168|  15.0k|            COPYTHECONTEXT("Slice Header SVC ext: num_ref_idx_l0_active_minus1",
  169|  15.0k|                           ps_cur_slice->u1_num_ref_idx_lx_active[0] - 1);
  170|  15.0k|        }
  171|       |
  172|      0|        {
  173|  15.0k|            UWORD8 uc_refIdxReFlagL0 = ih264d_get_bit_h264(ps_bitstrm);
  174|  15.0k|            COPYTHECONTEXT("Slice Header SVC ext: ref_pic_list_reordering_flag_l0",
  175|  15.0k|                           uc_refIdxReFlagL0);
  176|       |
  177|  15.0k|            ih264d_init_ref_idx_lx_p(ps_dec);
  178|       |            /* Store the value for future slices in the same picture */
  179|  15.0k|            ps_dec->u1_num_ref_idx_lx_active_prev = ps_cur_slice->u1_num_ref_idx_lx_active[0];
  180|       |
  181|       |            /* Modified temporarily */
  182|  15.0k|            if(uc_refIdxReFlagL0)
  ------------------
  |  Branch (182:16): [True: 8.05k, False: 6.97k]
  ------------------
  183|  8.05k|            {
  184|  8.05k|                WORD8 ret;
  185|  8.05k|                ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_mod_dpb[0];
  186|  8.05k|                ret = ih264d_ref_idx_reordering(ps_dec, 0);
  187|  8.05k|                if(ret == -1) return ERROR_REFIDX_ORDER_T;
  ------------------
  |  Branch (187:20): [True: 0, False: 8.05k]
  ------------------
  188|  8.05k|                ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_mod_dpb[0];
  189|  8.05k|            }
  190|  6.97k|            else
  191|  6.97k|                ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_init_dpb[0];
  192|  15.0k|        }
  193|       |        /* Create refIdx to POC mapping */
  194|  15.0k|        {
  195|  15.0k|            void **pui_map_ref_idx_to_poc_lx0, **pui_map_ref_idx_to_poc_lx1;
  196|  15.0k|            WORD8 idx;
  197|  15.0k|            struct pic_buffer_t *ps_pic;
  198|       |
  199|  15.0k|            pui_map_ref_idx_to_poc_lx0 = ps_dec->ppv_map_ref_idx_to_poc + FRM_LIST_L0;
  ------------------
  |  |   89|  15.0k|#define FRM_LIST_L0             0                                               //0
  ------------------
  200|  15.0k|            pui_map_ref_idx_to_poc_lx0[0] = 0;
  201|  15.0k|            pui_map_ref_idx_to_poc_lx0++;
  202|  49.1k|            for(idx = 0; idx < ps_cur_slice->u1_num_ref_idx_lx_active[0]; idx++)
  ------------------
  |  Branch (202:26): [True: 34.0k, False: 15.0k]
  ------------------
  203|  34.0k|            {
  204|  34.0k|                ps_pic = ps_dec->ps_ref_pic_buf_lx[0][idx];
  205|  34.0k|                pui_map_ref_idx_to_poc_lx0[idx] = (ps_pic->pu1_buf1);
  206|  34.0k|            }
  207|       |
  208|       |            /* Bug Fix Deblocking */
  209|  15.0k|            pui_map_ref_idx_to_poc_lx1 = ps_dec->ppv_map_ref_idx_to_poc + FRM_LIST_L1;
  ------------------
  |  |   90|  15.0k|#define FRM_LIST_L1             1 * POC_LIST_L0_TO_L1_DIFF//FRM_LIST_L0 + POC_LIST_L0_TO_L1_DIFF        //0+33                  //(1 * POC_LIST_L0_TO_L1_DIFF)
  |  |  ------------------
  |  |  |  |   86|  15.0k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|  15.0k|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  210|  15.0k|            pui_map_ref_idx_to_poc_lx1[0] = 0;
  211|       |
  212|  15.0k|            if(u1_mbaff)
  ------------------
  |  Branch (212:16): [True: 0, False: 15.0k]
  ------------------
  213|      0|            {
  214|      0|                void **ppv_map_ref_idx_to_poc_lx_t, **ppv_map_ref_idx_to_poc_lx_b;
  215|      0|                void **ppv_map_ref_idx_to_poc_lx_t1, **ppv_map_ref_idx_to_poc_lx_b1;
  216|      0|                ppv_map_ref_idx_to_poc_lx_t = ps_dec->ppv_map_ref_idx_to_poc + TOP_LIST_FLD_L0;
  ------------------
  |  |   91|      0|#define TOP_LIST_FLD_L0         2 * POC_LIST_L0_TO_L1_DIFF//FRM_LIST_L1 + POC_LIST_L0_TO_L1_DIFF        //0+33+33                   //(2 * POC_LIST_L0_TO_L1_DIFF)
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  217|      0|                ppv_map_ref_idx_to_poc_lx_b = ps_dec->ppv_map_ref_idx_to_poc + BOT_LIST_FLD_L0;
  ------------------
  |  |   93|      0|#define BOT_LIST_FLD_L0         4 * POC_LIST_L0_TO_L1_DIFF//TOP_LIST_FLD_L1 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  218|       |
  219|      0|                ppv_map_ref_idx_to_poc_lx_t[0] = 0;
  220|      0|                ppv_map_ref_idx_to_poc_lx_t++;
  221|      0|                ppv_map_ref_idx_to_poc_lx_b[0] = 0;
  222|      0|                ppv_map_ref_idx_to_poc_lx_b++;
  223|       |
  224|      0|                idx = 0;
  225|      0|                for(idx = 0; idx < ps_cur_slice->u1_num_ref_idx_lx_active[0]; idx++)
  ------------------
  |  Branch (225:30): [True: 0, False: 0]
  ------------------
  226|      0|                {
  227|      0|                    ps_pic = ps_dec->ps_ref_pic_buf_lx[0][idx];
  228|      0|                    ppv_map_ref_idx_to_poc_lx_t[0] = (ps_pic->pu1_buf1);
  229|      0|                    ppv_map_ref_idx_to_poc_lx_b[1] = (ps_pic->pu1_buf1);
  230|       |
  231|      0|                    ppv_map_ref_idx_to_poc_lx_b[0] = (ps_pic->pu1_buf1) + 1;
  232|      0|                    ppv_map_ref_idx_to_poc_lx_t[1] = (ps_pic->pu1_buf1) + 1;
  233|       |
  234|      0|                    ppv_map_ref_idx_to_poc_lx_t += 2;
  235|      0|                    ppv_map_ref_idx_to_poc_lx_b += 2;
  236|      0|                }
  237|      0|                ppv_map_ref_idx_to_poc_lx_t1 = ps_dec->ppv_map_ref_idx_to_poc + TOP_LIST_FLD_L1;
  ------------------
  |  |   92|      0|#define TOP_LIST_FLD_L1         3 * POC_LIST_L0_TO_L1_DIFF//TOP_LIST_FLD_L0 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17                //(3 * POC_LIST_L0_TO_L1_DIFF)
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|      0|                ppv_map_ref_idx_to_poc_lx_t1[0] = 0;
  239|      0|                ppv_map_ref_idx_to_poc_lx_b1 = ps_dec->ppv_map_ref_idx_to_poc + BOT_LIST_FLD_L1;
  ------------------
  |  |   94|      0|#define BOT_LIST_FLD_L1         5 * POC_LIST_L0_TO_L1_DIFF//BOT_LIST_FLD_L0 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17+17
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  240|      0|                ppv_map_ref_idx_to_poc_lx_b1[0] = 0;
  241|      0|            }
  242|       |            /* BS is moved post recon gen in libsvc*/
  243|  15.0k|            if(ps_dec->u4_num_cores >= 2)
  ------------------
  |  Branch (243:16): [True: 9.31k, False: 5.72k]
  ------------------
  244|  9.31k|            {
  245|  9.31k|                WORD32 num_entries;
  246|  9.31k|                WORD32 size;
  247|       |
  248|  9.31k|                num_entries = MAX_FRAMES;
  ------------------
  |  |  600|  9.31k|#define MAX_FRAMES              16
  ------------------
  249|  9.31k|                if((1 >= ps_dec->ps_cur_sps->u1_num_ref_frames) && (0 == ps_dec->i4_display_delay))
  ------------------
  |  Branch (249:20): [True: 7.03k, False: 2.28k]
  |  Branch (249:68): [True: 0, False: 7.03k]
  ------------------
  250|      0|                {
  251|      0|                    num_entries = 1;
  252|      0|                }
  253|  9.31k|                num_entries = ((2 * num_entries) + 1);
  254|  9.31k|                num_entries *= 2;
  255|       |
  256|  9.31k|                size = num_entries * sizeof(void *);
  257|  9.31k|                size += PAD_MAP_IDX_POC * sizeof(void *);
  ------------------
  |  |  100|  9.31k|#define PAD_MAP_IDX_POC             (1)
  ------------------
  258|       |
  259|  9.31k|                memcpy((void *) ps_dec->ps_parse_cur_slice->ppv_map_ref_idx_to_poc,
  260|  9.31k|                       ps_dec->ppv_map_ref_idx_to_poc, size);
  261|  9.31k|            }
  262|  15.0k|        }
  263|  15.0k|        if(ps_pps->u1_wted_pred_flag)
  ------------------
  |  Branch (263:12): [True: 2.31k, False: 12.7k]
  ------------------
  264|  2.31k|        {
  265|  2.31k|            if(!ps_nal_svc_ext->u1_no_inter_layer_pred_flag)
  ------------------
  |  Branch (265:16): [True: 2.31k, False: 0]
  ------------------
  266|  2.31k|            {
  267|  2.31k|                ps_svc_slice_params->u1_base_pred_weight_table_flag =
  268|  2.31k|                    ih264d_get_bit_h264(ps_bitstrm);
  269|  2.31k|                COPYTHECONTEXT("Slice Header SVC ext: u1_base_pred_weight_table_flag",
  270|  2.31k|                               ps_svc_slice_params->u1_base_pred_weight_table_flag);
  271|  2.31k|            }
  272|       |
  273|  2.31k|            if(ps_nal_svc_ext->u1_no_inter_layer_pred_flag ||
  ------------------
  |  Branch (273:16): [True: 0, False: 2.31k]
  ------------------
  274|  2.31k|               !ps_svc_slice_params->u1_base_pred_weight_table_flag)
  ------------------
  |  Branch (274:16): [True: 1.41k, False: 896]
  ------------------
  275|  1.41k|            {
  276|  1.41k|                ret = ih264d_parse_pred_weight_table(ps_cur_slice, ps_bitstrm);
  277|  1.41k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  1.41k|#define OK        0
  ------------------
  |  Branch (277:20): [True: 165, False: 1.25k]
  ------------------
  278|       |
  279|  1.25k|                ih264d_form_pred_weight_matrix(ps_dec);
  280|  1.25k|                ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
  281|  1.25k|            }
  282|  2.31k|        }
  283|  12.7k|        else
  284|  12.7k|        {
  285|  12.7k|            ps_dec->ps_cur_slice->u2_log2Y_crwd = 0;
  286|  12.7k|            ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
  287|  12.7k|        }
  288|       |
  289|  14.8k|        ps_dec->ps_parse_cur_slice->u2_log2Y_crwd = ps_dec->ps_cur_slice->u2_log2Y_crwd;
  290|       |
  291|  14.8k|        if(u1_mbaff && (u1_field_pic_flag == 0))
  ------------------
  |  Branch (291:12): [True: 0, False: 14.8k]
  |  Branch (291:24): [True: 0, False: 0]
  ------------------
  292|      0|        {
  293|      0|            ih264d_convert_frm_mbaff_list(ps_dec);
  294|      0|        }
  295|       |
  296|       |        /* G050 */
  297|  14.8k|        if(ps_cur_slice->u1_nal_ref_idc != 0)
  ------------------
  |  Branch (297:12): [True: 14.6k, False: 199]
  ------------------
  298|  14.6k|        {
  299|  14.6k|            if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (299:16): [True: 14.3k, False: 274]
  ------------------
  300|  14.3k|            {
  301|  14.3k|                dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
  302|  14.3k|                dec_seq_params_t *ps_sps_tmp = ps_pps->ps_sps;
  303|  14.3k|                UWORD8 u1_nal_unit_type_tmp = ps_dec->u1_nal_unit_type;
  304|       |
  305|  14.3k|                ps_pps->ps_sps = ps_dec->ps_cur_sps;
  306|       |
  307|  14.3k|                if(ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag)
  ------------------
  |  Branch (307:20): [True: 13.4k, False: 897]
  ------------------
  308|  13.4k|                    ps_dec->u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  13.4k|#define IDR_SLICE_NAL                   5
  ------------------
  309|       |
  310|  14.3k|                i_temp = ih264d_read_mmco_commands(ps_dec);
  311|       |
  312|  14.3k|                ps_pps->ps_sps = ps_sps_tmp;
  313|  14.3k|                ps_dec->u1_nal_unit_type = u1_nal_unit_type_tmp;
  314|       |
  315|  14.3k|                if(i_temp < 0)
  ------------------
  |  Branch (315:20): [True: 134, False: 14.2k]
  ------------------
  316|    134|                {
  317|    134|                    return ERROR_DBP_MANAGER_T;
  318|    134|                }
  319|  14.2k|                ps_dec->u4_bitoffset = i_temp;
  320|  14.2k|            }
  321|    274|            else
  322|    274|                ps_bitstrm->u4_ofst += ps_dec->u4_bitoffset;
  323|       |
  324|  14.5k|            if(!ps_sps_svc_ext->u1_slice_header_restriction_flag)
  ------------------
  |  Branch (324:16): [True: 11.2k, False: 3.25k]
  ------------------
  325|  11.2k|            {
  326|  11.2k|                ps_svc_slice_params->u1_store_ref_base_pic_flag = ih264d_get_bit_h264(ps_bitstrm);
  327|  11.2k|                COPYTHECONTEXT("SPS_SVC_EXT: u1_store_ref_base_pic_flag",
  328|  11.2k|                               ps_svc_slice_params->u1_store_ref_base_pic_flag);
  329|       |
  330|  11.2k|                if(0 != ps_svc_slice_params->u1_store_ref_base_pic_flag)
  ------------------
  |  Branch (330:20): [True: 495, False: 10.7k]
  ------------------
  331|    495|                {
  332|    495|                    return NOT_OK;
  ------------------
  |  |  116|    495|#define NOT_OK    -1
  ------------------
  333|    495|                }
  334|  10.7k|                if(((1 == ps_nal_svc_ext->u1_use_ref_base_pic_flag) ||
  ------------------
  |  Branch (334:21): [True: 0, False: 10.7k]
  ------------------
  335|  10.7k|                    (1 == ps_svc_slice_params->u1_store_ref_base_pic_flag)) &&
  ------------------
  |  Branch (335:21): [True: 0, False: 10.7k]
  ------------------
  336|      0|                   (!ps_nal_svc_ext->u1_idr_flag))
  ------------------
  |  Branch (336:20): [True: 0, False: 0]
  ------------------
  337|      0|                {
  338|      0|                    i_status = isvcd_dec_ref_base_pic_marking(
  339|      0|                        &ps_svc_slice_params->s_ref_base_pic_marking_svc_ext, ps_bitstrm);
  340|      0|                    if(i_status != OK)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (340:24): [True: 0, False: 0]
  ------------------
  341|      0|                    {
  342|      0|                        return i_status;
  343|      0|                    }
  344|      0|                }
  345|  10.7k|            }
  346|  14.5k|        }
  347|  14.8k|    }
  348|       |    /* G050 */
  349|       |
  350|  14.2k|    if(ps_pps->u1_entropy_coding_mode == CABAC)
  ------------------
  |  |  339|  14.2k|#define CABAC  1
  ------------------
  |  Branch (350:8): [True: 2.57k, False: 11.6k]
  ------------------
  351|  2.57k|    {
  352|  2.57k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  353|       |
  354|  2.57k|        if(u4_temp > MAX_CABAC_INIT_IDC)
  ------------------
  |  |  537|  2.57k|#define MAX_CABAC_INIT_IDC        2
  ------------------
  |  Branch (354:12): [True: 157, False: 2.41k]
  ------------------
  355|    157|        {
  356|    157|            return ERROR_INV_SLICE_HDR_T;
  357|    157|        }
  358|  2.41k|        ps_cur_slice->u1_cabac_init_idc = u4_temp;
  359|  2.41k|        COPYTHECONTEXT("Slice Header SVC ext: cabac_init_idc", ps_cur_slice->u1_cabac_init_idc);
  360|  2.41k|    }
  361|       |
  362|       |    /* Read slice_qp_delta */
  363|  14.0k|    i8_temp = (WORD64) ps_pps->u1_pic_init_qp + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  364|  14.0k|    if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  629|  14.0k|#define MIN_H264_QP 0
  ------------------
                  if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  634|  13.9k|#define MAX_H264_QP 51
  ------------------
  |  Branch (364:8): [True: 154, False: 13.9k]
  |  Branch (364:35): [True: 334, False: 13.5k]
  ------------------
  365|    488|    {
  366|    488|        return ERROR_INV_RANGE_QP_T;
  367|    488|    }
  368|  13.5k|    ps_cur_slice->u1_slice_qp = (UWORD8) i8_temp;
  369|  13.5k|    COPYTHECONTEXT("Slice Header SVC ext: slice_qp_delta",
  370|  13.5k|                   (WORD8) (ps_cur_slice->u1_slice_qp - ps_pps->u1_pic_init_qp));
  371|       |
  372|  13.5k|    if(ps_pps->u1_deblocking_filter_parameters_present_flag == 1)
  ------------------
  |  Branch (372:8): [True: 5.62k, False: 7.96k]
  ------------------
  373|  5.62k|    {
  374|  5.62k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  375|  5.62k|        if(u4_temp > SLICE_BOUNDARY_DBLK_DISABLED)
  ------------------
  |  |  547|  5.62k|#define SLICE_BOUNDARY_DBLK_DISABLED  2
  ------------------
  |  Branch (375:12): [True: 200, False: 5.42k]
  ------------------
  376|    200|        {
  377|    200|            return ERROR_INV_SLICE_HDR_T;
  378|    200|        }
  379|       |
  380|  5.42k|        COPYTHECONTEXT("Slice Header SVC ext: disable_deblocking_filter_idc", u4_temp);
  381|  5.42k|        ps_cur_slice->u1_disable_dblk_filter_idc = u4_temp;
  382|  5.42k|        if(u4_temp != 1)
  ------------------
  |  Branch (382:12): [True: 4.30k, False: 1.12k]
  ------------------
  383|  4.30k|        {
  384|  4.30k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
  385|  4.30k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  4.30k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  4.19k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (385:16): [True: 104, False: 4.19k]
  |  Branch (385:47): [True: 127, False: 4.06k]
  ------------------
  386|    231|            {
  387|    231|                return ERROR_INV_SLICE_HDR_T;
  388|    231|            }
  389|  4.06k|            ps_cur_slice->i1_slice_alpha_c0_offset = i_temp;
  390|  4.06k|            COPYTHECONTEXT("Slice Header SVC ext: slice_alpha_c0_offset_div2",
  391|  4.06k|                           ps_cur_slice->i1_slice_alpha_c0_offset >> 1);
  392|       |
  393|  4.06k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
  394|  4.06k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  4.06k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  3.97k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (394:16): [True: 97, False: 3.97k]
  |  Branch (394:47): [True: 83, False: 3.88k]
  ------------------
  395|    180|            {
  396|    180|                return ERROR_INV_SLICE_HDR_T;
  397|    180|            }
  398|  3.88k|            ps_cur_slice->i1_slice_beta_offset = i_temp;
  399|  3.88k|            COPYTHECONTEXT("Slice Header SVC ext: slice_beta_offset_div2",
  400|  3.88k|                           ps_cur_slice->i1_slice_beta_offset >> 1);
  401|  3.88k|        }
  402|  1.12k|        else
  403|  1.12k|        {
  404|  1.12k|            ps_cur_slice->i1_slice_alpha_c0_offset = 0;
  405|  1.12k|            ps_cur_slice->i1_slice_beta_offset = 0;
  406|  1.12k|        }
  407|  5.42k|    }
  408|  7.96k|    else
  409|  7.96k|    {
  410|  7.96k|        ps_cur_slice->u1_disable_dblk_filter_idc = 0;
  411|  7.96k|        ps_cur_slice->i1_slice_alpha_c0_offset = 0;
  412|  7.96k|        ps_cur_slice->i1_slice_beta_offset = 0;
  413|  7.96k|    }
  414|       |
  415|       |    /* add the remaining part of the code for svc extension from reference */
  416|  12.9k|    ret = isvcd_set_default_slice_header_ext(ps_svc_lyr_dec);
  417|  12.9k|    if(ret != OK)
  ------------------
  |  |  114|  12.9k|#define OK        0
  ------------------
  |  Branch (417:8): [True: 0, False: 12.9k]
  ------------------
  418|      0|    {
  419|      0|        return ERROR_INV_SLICE_HDR_T;
  420|      0|    }
  421|       |
  422|  12.9k|    ret = isvcd_parse_slice_header(ps_svc_lyr_dec);
  423|  12.9k|    if(ret != OK)
  ------------------
  |  |  114|  12.9k|#define OK        0
  ------------------
  |  Branch (423:8): [True: 1.06k, False: 11.9k]
  ------------------
  424|  1.06k|    {
  425|  1.06k|        return ERROR_INV_SLICE_HDR_T;
  426|  1.06k|    }
  427|       |
  428|  11.9k|    ps_dec->u1_slice_header_done = 2;
  429|       |
  430|  11.9k|    if(!ps_svc_slice_params->u1_slice_skip_flag)
  ------------------
  |  Branch (430:8): [True: 11.4k, False: 507]
  ------------------
  431|  11.4k|    {
  432|  11.4k|        if(ps_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (432:12): [True: 2.22k, False: 9.18k]
  ------------------
  433|  2.22k|        {
  434|  2.22k|            SWITCHOFFTRACE;
  435|  2.22k|            SWITCHONTRACECABAC;
  436|  2.22k|            ps_svc_lyr_dec->pf_parse_inter_slice_svc_ext =
  437|  2.22k|                isvcd_parse_inter_slice_data_cabac_enh_lyr;
  438|  2.22k|            ps_svc_lyr_dec->pf_parse_inter_mb_svc_ext = isvcd_parse_pmb_cabac;
  439|       |
  440|  2.22k|            isvcd_init_cabac_contexts(P_SLICE, ps_dec);
  ------------------
  |  |  368|  2.22k|#define P_SLICE  0
  ------------------
  441|       |
  442|  2.22k|            if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (442:16): [True: 0, False: 2.22k]
  ------------------
  443|      0|                ps_dec->pf_get_mb_info = ih264d_get_mb_info_cabac_mbaff;
  444|  2.22k|            else
  445|  2.22k|                ps_dec->pf_get_mb_info = isvcd_get_mb_info_cabac_nonmbaff;
  446|  2.22k|        }
  447|  9.18k|        else
  448|  9.18k|        {
  449|  9.18k|            SWITCHONTRACE;
  450|  9.18k|            SWITCHOFFTRACECABAC;
  451|  9.18k|            ps_svc_lyr_dec->pf_parse_inter_slice_svc_ext =
  452|  9.18k|                isvcd_parse_inter_slice_data_cavlc_enh_lyr;
  453|  9.18k|            ps_svc_lyr_dec->pf_parse_inter_mb_svc_ext = isvcd_parse_pmb_cavlc;
  454|       |
  455|  9.18k|            if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (455:16): [True: 0, False: 9.18k]
  ------------------
  456|      0|            {
  457|      0|                ps_dec->pf_get_mb_info = ih264d_get_mb_info_cavlc_mbaff;
  458|      0|            }
  459|  9.18k|            else
  460|  9.18k|                ps_dec->pf_get_mb_info = isvcd_get_mb_info_cavlc_nonmbaff;
  461|  9.18k|        }
  462|  11.4k|    }
  463|    507|    else
  464|    507|    {
  465|    507|        return ERROR_FEATURE_UNAVAIL;
  466|    507|    }
  467|       |
  468|  11.4k|    ps_dec->u1_B = 0;
  469|  11.4k|    ps_dec->pf_mvpred_ref_tfr_nby2mb = isvcd_mv_pred_ref_tfr_nby2_epmb;
  470|  11.4k|    ret = ps_svc_lyr_dec->pf_parse_inter_slice_svc_ext(ps_svc_lyr_dec, ps_cur_slice,
  471|  11.4k|                                                       u2_first_mb_in_slice);
  472|  11.4k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  11.4k|#define OK        0
  ------------------
  |  Branch (472:8): [True: 5.01k, False: 6.39k]
  ------------------
  473|       |
  474|  6.39k|    return OK;
  ------------------
  |  |  114|  6.39k|#define OK        0
  ------------------
  475|  11.4k|}
isvcd_parse_inter_slice_data_cabac:
  505|  16.8k|{
  506|  16.8k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  507|       |
  508|  16.8k|    UWORD32 uc_more_data_flag;
  509|  16.8k|    WORD32 i2_cur_mb_addr;
  510|  16.8k|    UWORD32 u1_num_mbs, u1_num_mbsNby2, u1_mb_idx;
  511|  16.8k|    UWORD32 u1_mbaff;
  512|  16.8k|    UWORD32 u1_num_mbs_next, u1_end_of_row;
  513|  16.8k|    const UWORD16 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
  514|  16.8k|    UWORD32 u1_slice_end = 0;
  515|  16.8k|    UWORD32 u1_tfr_n_mb = 0;
  516|  16.8k|    UWORD32 u1_decode_nmb = 0;
  517|       |
  518|  16.8k|    deblk_mb_t *ps_cur_deblk_mb;
  519|  16.8k|    dec_mb_info_t *ps_cur_mb_info;
  520|  16.8k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data;
  521|  16.8k|    UWORD32 u1_inter_mb_skip_type;
  522|  16.8k|    UWORD32 u1_inter_mb_type;
  523|  16.8k|    UWORD32 u1_deblk_mb_type;
  524|  16.8k|    UWORD32 u1_mb_threshold;
  525|  16.8k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
  526|  16.8k|    WORD32 ret = OK;
  ------------------
  |  |  114|  16.8k|#define OK        0
  ------------------
  527|       |
  528|       |    /******************************************************/
  529|       |    /* Initialisations specific to B or P slice           */
  530|       |    /******************************************************/
  531|  16.8k|    if(ps_slice->u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  16.8k|#define P_SLICE  0
  ------------------
  |  Branch (531:8): [True: 7.64k, False: 9.17k]
  ------------------
  532|  7.64k|    {
  533|  7.64k|        u1_inter_mb_skip_type = CAB_P_SKIP;
  ------------------
  |  |  403|  7.64k|#define CAB_P_SKIP        0x16 /* 0001 x11x */
  ------------------
  534|  7.64k|        u1_inter_mb_type = P_MB;
  ------------------
  |  |  419|  7.64k|#define P_MB        2
  ------------------
  535|  7.64k|        u1_deblk_mb_type = D_INTER_MB;
  ------------------
  |  |  381|  7.64k|#define D_INTER_MB        0
  ------------------
  536|  7.64k|        u1_mb_threshold = 5;
  537|  7.64k|    }
  538|  9.17k|    else  // B_SLICE
  539|  9.17k|    {
  540|  9.17k|        u1_inter_mb_skip_type = CAB_B_SKIP;
  ------------------
  |  |  404|  9.17k|#define CAB_B_SKIP        0x14 /* 0001 x100 */
  ------------------
  541|  9.17k|        u1_inter_mb_type = B_MB;
  ------------------
  |  |  420|  9.17k|#define B_MB        3
  ------------------
  542|  9.17k|        u1_deblk_mb_type = D_B_SLICE;
  ------------------
  |  |  384|  9.17k|#define D_B_SLICE         4
  ------------------
  543|  9.17k|        u1_mb_threshold = 23;
  544|  9.17k|    }
  545|       |
  546|       |    /******************************************************/
  547|       |    /* Slice Level Initialisations                        */
  548|       |    /******************************************************/
  549|  16.8k|    i2_cur_mb_addr = u2_first_mb_in_slice;
  550|  16.8k|    ps_dec->u1_qp = ps_slice->u1_slice_qp;
  551|  16.8k|    ih264d_update_qp(ps_dec, 0);
  552|  16.8k|    u1_mb_idx = ps_dec->u4_mb_idx;
  553|  16.8k|    u1_num_mbs = u1_mb_idx;
  554|  16.8k|    u1_num_mbsNby2 = 0;
  555|  16.8k|    u1_mbaff = ps_slice->u1_mbaff_frame_flag;
  556|  16.8k|    i2_cur_mb_addr = u2_first_mb_in_slice << u1_mbaff;
  557|  16.8k|    uc_more_data_flag = 1;
  558|       |
  559|       |    /* Initialisations specific to cabac */
  560|  16.8k|    if(ps_bitstrm->u4_ofst & 0x07)
  ------------------
  |  Branch (560:8): [True: 13.0k, False: 3.76k]
  ------------------
  561|  13.0k|    {
  562|  13.0k|        ps_bitstrm->u4_ofst += 8;
  563|  13.0k|        ps_bitstrm->u4_ofst &= 0xFFFFFFF8;
  564|  13.0k|    }
  565|       |
  566|  16.8k|    ret = ih264d_init_cabac_dec_envirnoment(&(ps_dec->s_cab_dec_env), ps_bitstrm);
  567|  16.8k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  16.8k|#define OK        0
  ------------------
  |  Branch (567:8): [True: 858, False: 15.9k]
  ------------------
  568|       |
  569|  15.9k|    ps_dec->i1_prev_mb_qp_delta = 0;
  570|       |
  571|  1.60M|    while(!u1_slice_end)
  ------------------
  |  Branch (571:11): [True: 1.60M, False: 3.58k]
  ------------------
  572|  1.60M|    {
  573|  1.60M|        UWORD8 u1_mb_type;
  574|  1.60M|        UWORD32 u4_mb_skip;
  575|       |
  576|  1.60M|        ps_dec->pv_prev_mb_parse_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
  577|       |
  578|  1.60M|        if(i2_cur_mb_addr > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (578:12): [True: 6.86k, False: 1.59M]
  ------------------
  579|  6.86k|        {
  580|  6.86k|            break;
  581|  6.86k|        }
  582|       |
  583|  1.59M|        ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs;
  584|  1.59M|        ps_dec->u4_num_mbs_cur_nmb = u1_num_mbs;
  585|       |
  586|  1.59M|        ps_cur_mb_info->u1_Mux = 0;
  587|  1.59M|        ps_dec->u4_num_pmbair = (u1_num_mbs >> u1_mbaff);
  588|  1.59M|        ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u1_num_mbs;
  589|  1.59M|        ps_cur_mb_info->u1_end_of_slice = 0;
  590|       |
  591|       |        /* Storing Default partition info */
  592|  1.59M|        ps_parse_mb_data->u1_num_part = 1;
  593|  1.59M|        ps_parse_mb_data->u4_isI_mb = 0;
  594|       |
  595|       |        /***************************************************************/
  596|       |        /* Get the required information for decoding of MB             */
  597|       |        /* mb_x, mb_y , neighbour availablity,                         */
  598|       |        /***************************************************************/
  599|  1.59M|        u4_mb_skip = ps_dec->pf_get_mb_info(ps_dec, i2_cur_mb_addr, ps_cur_mb_info, 1);
  600|       |
  601|       |        /*********************************************************************/
  602|       |        /* initialize u1_tran_form8x8 to zero to aviod uninitialized accesses */
  603|       |        /*********************************************************************/
  604|  1.59M|        ps_cur_mb_info->u1_tran_form8x8 = 0;
  605|  1.59M|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
  606|       |
  607|       |        /***************************************************************/
  608|       |        /* Set the deblocking parameters for this MB                   */
  609|       |        /***************************************************************/
  610|  1.59M|        if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (610:12): [True: 1.59M, False: 0]
  ------------------
  611|  1.59M|            ih264d_set_deblocking_parameters(ps_cur_deblk_mb, ps_slice,
  612|  1.59M|                                             ps_dec->u1_mb_ngbr_availablity,
  613|  1.59M|                                             ps_dec->u1_cur_mb_fld_dec_flag);
  614|       |
  615|  1.59M|        if(u4_mb_skip)
  ------------------
  |  Branch (615:12): [True: 1.38M, False: 203k]
  ------------------
  616|  1.38M|        {
  617|       |            /* Set appropriate flags in ps_cur_mb_info and ps_dec */
  618|  1.38M|            memset(ps_dec->ps_curr_ctxt_mb_info, 0, sizeof(ctxt_inc_mb_info_t));
  619|  1.38M|            ps_dec->ps_curr_ctxt_mb_info->u1_mb_type = u1_inter_mb_skip_type;
  620|       |
  621|  1.38M|            MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
  ------------------
  |  |  652|  1.38M|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  1.38M|{                                                               \
  |  |  654|  1.38M|    memset(pu4_start,value,16);                                 \
  |  |  655|  1.38M|}
  ------------------
  622|       |
  623|  1.38M|            *((UWORD32 *) ps_dec->pi1_left_ref_idx_ctxt_inc) = 0;
  624|  1.38M|            *(ps_dec->pu1_left_yuv_dc_csbp) = 0;
  625|  1.38M|            ps_dec->i1_prev_mb_qp_delta = 0;
  626|  1.38M|            ps_cur_mb_info->u1_mb_type = MB_SKIP;
  ------------------
  |  |   59|  1.38M|#define MB_SKIP 255
  ------------------
  627|  1.38M|            ps_cur_mb_info->u1_cbp = 0;
  628|       |
  629|  1.38M|            {
  630|       |                /* Storing Skip partition info */
  631|  1.38M|                parse_part_params_t *ps_part_info = ps_dec->ps_part;
  632|  1.38M|                ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  571|  1.38M|#define PART_DIRECT_16x16              2
  ------------------
  633|  1.38M|                ps_part_info->u1_sub_mb_num = 0;
  634|  1.38M|                ps_dec->ps_part++;
  635|  1.38M|            }
  636|       |
  637|       |            /* Update Nnzs */
  638|  1.38M|            ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CABAC);
  ------------------
  |  |  339|  1.38M|#define CABAC  1
  ------------------
  639|  1.38M|            ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
  640|  1.38M|            ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
  641|  1.38M|            ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
  642|  1.38M|            if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  1.38M|#define TARGET_LAYER 2
  ------------------
  |  Branch (642:16): [True: 497k, False: 892k]
  ------------------
  643|   497k|            {
  644|   497k|                ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|   497k|#define MB_DISABLE_FILTERING          0x01
  ------------------
  645|   497k|            }
  646|  1.38M|        }
  647|   203k|        else
  648|   203k|        {
  649|       |            /* Macroblock Layer Begins */
  650|       |            /* Decode the u1_mb_type */
  651|   203k|            u1_mb_type = ih264d_parse_mb_type_cabac(ps_dec);
  652|   203k|            ps_cur_mb_info->u1_mb_type = u1_mb_type;
  653|   203k|            if(u1_mb_type > (25 + u1_mb_threshold)) return ERROR_MB_TYPE;
  ------------------
  |  Branch (653:16): [True: 0, False: 203k]
  ------------------
  654|       |
  655|       |            /* Parse Macroblock Data */
  656|   203k|            if(u1_mb_type < u1_mb_threshold)
  ------------------
  |  Branch (656:16): [True: 198k, False: 5.75k]
  ------------------
  657|   198k|            {
  658|   198k|                ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
  659|   198k|                *(ps_dec->pu1_left_yuv_dc_csbp) &= 0x6;
  660|       |
  661|   198k|                ret = ps_dec->pf_parse_inter_mb(ps_dec, ps_cur_mb_info, u1_num_mbs, u1_num_mbsNby2);
  662|   198k|                if(ret != OK) return ret;
  ------------------
  |  |  114|   198k|#define OK        0
  ------------------
  |  Branch (662:20): [True: 4.79k, False: 193k]
  ------------------
  663|   193k|                ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
  664|   193k|                ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
  665|   193k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|   193k|#define TARGET_LAYER 2
  ------------------
  |  Branch (665:20): [True: 44.0k, False: 149k]
  ------------------
  666|  44.0k|                {
  667|  44.0k|                    ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|  44.0k|#define MB_DISABLE_FILTERING          0x01
  ------------------
  668|  44.0k|                }
  669|   193k|            }
  670|  5.75k|            else
  671|  5.75k|            {
  672|       |                /* Storing Intra partition info */
  673|  5.75k|                ps_parse_mb_data->u1_num_part = 0;
  674|  5.75k|                ps_parse_mb_data->u4_isI_mb = 1;
  675|       |
  676|  5.75k|                if((25 + u1_mb_threshold) == u1_mb_type)
  ------------------
  |  Branch (676:20): [True: 142, False: 5.61k]
  ------------------
  677|    142|                {
  678|       |                    /* I_PCM_MB */
  679|    142|                    ps_cur_mb_info->ps_curmb->u1_mb_type = I_PCM_MB;
  ------------------
  |  |  423|    142|#define I_PCM_MB    6
  ------------------
  680|    142|                    ret = ih264d_parse_ipcm_mb(ps_dec, ps_cur_mb_info, u1_num_mbs);
  681|    142|                    if(ret != OK) return ret;
  ------------------
  |  |  114|    142|#define OK        0
  ------------------
  |  Branch (681:24): [True: 106, False: 36]
  ------------------
  682|     36|                    ps_cur_deblk_mb->u1_mb_qp = 0;
  683|     36|                }
  684|  5.61k|                else
  685|  5.61k|                {
  686|  5.61k|                    if(u1_mb_type == u1_mb_threshold)
  ------------------
  |  Branch (686:24): [True: 3.66k, False: 1.94k]
  ------------------
  687|  3.66k|                        ps_cur_mb_info->ps_curmb->u1_mb_type = I_4x4_MB;
  ------------------
  |  |  417|  3.66k|#define I_4x4_MB    0
  ------------------
  688|  1.94k|                    else
  689|  1.94k|                        ps_cur_mb_info->ps_curmb->u1_mb_type = I_16x16_MB;
  ------------------
  |  |  418|  1.94k|#define I_16x16_MB  1
  ------------------
  690|       |
  691|  5.61k|                    ret = ih264d_parse_imb_cabac(ps_dec, ps_cur_mb_info,
  692|  5.61k|                                                 (UWORD8) (u1_mb_type - u1_mb_threshold));
  693|  5.61k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  5.61k|#define OK        0
  ------------------
  |  Branch (693:24): [True: 612, False: 4.99k]
  ------------------
  694|  4.99k|                    ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
  695|  4.99k|                }
  696|  5.03k|                ps_cur_deblk_mb->u1_mb_type |= D_INTRA_MB;
  ------------------
  |  |  382|  5.03k|#define D_INTRA_MB        1
  ------------------
  697|  5.03k|            }
  698|   203k|        }
  699|       |
  700|  1.58M|        if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (700:12): [True: 0, False: 1.58M]
  ------------------
  701|      0|        {
  702|      0|            ih264d_populate_mb_info_map(ps_dec, ps_cur_mb_info, ps_cur_mb_info->u2_mbx << 1,
  703|      0|                                        ps_cur_mb_info->u2_mby << 1, ps_cur_deblk_mb->u1_mb_qp);
  704|      0|        }
  705|  1.58M|        if(u1_mbaff)
  ------------------
  |  Branch (705:12): [True: 0, False: 1.58M]
  ------------------
  706|      0|        {
  707|      0|            ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
  708|      0|        }
  709|       |
  710|  1.58M|        if(ps_cur_mb_info->u1_topmb && u1_mbaff)
  ------------------
  |  Branch (710:12): [True: 1.58M, False: 0]
  |  Branch (710:40): [True: 0, False: 1.58M]
  ------------------
  711|      0|            uc_more_data_flag = 1;
  712|  1.58M|        else
  713|  1.58M|        {
  714|  1.58M|            uc_more_data_flag = ih264d_decode_terminate(&ps_dec->s_cab_dec_env, ps_bitstrm);
  715|  1.58M|            uc_more_data_flag = !uc_more_data_flag;
  716|  1.58M|            COPYTHECONTEXT("Decode Sliceterm", !uc_more_data_flag);
  717|  1.58M|        }
  718|       |
  719|  1.58M|        if(u1_mbaff)
  ------------------
  |  Branch (719:12): [True: 0, False: 1.58M]
  ------------------
  720|      0|        {
  721|      0|            if(!uc_more_data_flag && (0 == (i2_cur_mb_addr & 1)))
  ------------------
  |  Branch (721:16): [True: 0, False: 0]
  |  Branch (721:38): [True: 0, False: 0]
  ------------------
  722|      0|            {
  723|      0|                return ERROR_EOB_FLUSHBITS_T;
  724|      0|            }
  725|      0|        }
  726|       |        /* Next macroblock information */
  727|  1.58M|        i2_cur_mb_addr++;
  728|  1.58M|        u1_num_mbs++;
  729|  1.58M|        u1_num_mbsNby2++;
  730|  1.58M|        ps_parse_mb_data++;
  731|       |
  732|       |        /****************************************************************/
  733|       |        /* Check for End Of Row and other flags that determine when to  */
  734|       |        /* do DMA setup for N/2-Mb, Decode for N-Mb, and Transfer for   */
  735|       |        /* N-Mb                                                         */
  736|       |        /****************************************************************/
  737|  1.58M|        u1_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
  738|  1.58M|        u1_end_of_row = (!u1_num_mbs_next) && (!(u1_mbaff && (u1_num_mbs & 0x01)));
  ------------------
  |  Branch (738:25): [True: 110k, False: 1.47M]
  |  Branch (738:50): [True: 0, False: 110k]
  |  Branch (738:62): [True: 0, False: 0]
  ------------------
  739|  1.58M|        u1_slice_end = !uc_more_data_flag;
  740|  1.58M|        u1_tfr_n_mb = (u1_num_mbs == ps_dec->u4_recon_mb_grp) || u1_end_of_row || u1_slice_end;
  ------------------
  |  Branch (740:23): [True: 109k, False: 1.47M]
  |  Branch (740:66): [True: 1.59k, False: 1.47M]
  |  Branch (740:83): [True: 3.31k, False: 1.47M]
  ------------------
  741|  1.58M|        u1_decode_nmb = u1_tfr_n_mb || u1_slice_end;
  ------------------
  |  Branch (741:25): [True: 114k, False: 1.47M]
  |  Branch (741:40): [True: 0, False: 1.47M]
  ------------------
  742|  1.58M|        ps_cur_mb_info->u1_end_of_slice = u1_slice_end;
  743|       |
  744|  1.58M|        if(u1_decode_nmb)
  ------------------
  |  Branch (744:12): [True: 114k, False: 1.47M]
  ------------------
  745|   114k|        {
  746|   114k|            ret = ps_dec->pf_mvpred_ref_tfr_nby2mb(ps_dec, u1_mb_idx, u1_num_mbs);
  747|   114k|            u1_num_mbsNby2 = 0;
  748|   114k|            {
  749|   114k|                ps_parse_mb_data = ps_dec->ps_parse_mb_data;
  750|   114k|                ps_dec->ps_part = ps_dec->ps_parse_part_params;
  751|   114k|            }
  752|   114k|            if(ret != OK) return ret;
  ------------------
  |  |  114|   114k|#define OK        0
  ------------------
  |  Branch (752:16): [True: 0, False: 114k]
  ------------------
  753|   114k|        }
  754|       |
  755|  1.58M|        if(u1_decode_nmb)
  ------------------
  |  Branch (755:12): [True: 114k, False: 1.47M]
  ------------------
  756|   114k|        {
  757|   114k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (757:16): [True: 26.1k, False: 88.1k]
  ------------------
  758|  26.1k|            {
  759|  26.1k|                ih264d_parse_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next, u1_tfr_n_mb,
  760|  26.1k|                                     u1_end_of_row);
  761|  26.1k|                ps_dec->ps_nmb_info += u1_num_mbs;
  762|  26.1k|                ps_svc_lyr_dec->ps_svc_nmb_info += u1_num_mbs;
  763|  26.1k|            }
  764|  88.1k|            else
  765|  88.1k|            {
  766|  88.1k|                if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|  88.1k|#define TARGET_LAYER 2
  ------------------
  |  Branch (766:20): [True: 36.6k, False: 51.5k]
  ------------------
  767|  36.6k|                {
  768|  36.6k|                    ih264d_decode_recon_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next,
  769|  36.6k|                                                u1_tfr_n_mb, u1_end_of_row);
  770|  36.6k|                }
  771|  51.5k|                else
  772|  51.5k|                {
  773|  51.5k|                    isvcd_decode_recon_tfr_nmb_base_lyr(ps_svc_lyr_dec, u1_mb_idx, u1_num_mbs,
  774|  51.5k|                                                        u1_num_mbs_next, u1_tfr_n_mb,
  775|  51.5k|                                                        u1_end_of_row);
  776|  51.5k|                }
  777|  88.1k|            }
  778|   114k|            ps_dec->u4_total_mbs_coded += u1_num_mbs;
  779|   114k|            if(u1_tfr_n_mb) u1_num_mbs = 0;
  ------------------
  |  Branch (779:16): [True: 114k, False: 0]
  ------------------
  780|   114k|            u1_mb_idx = u1_num_mbs;
  781|   114k|            ps_dec->u4_mb_idx = u1_num_mbs;
  782|   114k|        }
  783|  1.58M|    }
  784|       |
  785|  10.4k|    ps_dec->u4_num_mbs_cur_nmb = 0;
  786|  10.4k|    ps_dec->ps_cur_slice->u4_mbs_in_slice = i2_cur_mb_addr - (u2_first_mb_in_slice << u1_mbaff);
  787|       |
  788|  10.4k|    return ret;
  789|  15.9k|}
isvcd_parse_inter_slice_data_cavlc:
  820|  59.1k|{
  821|  59.1k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  822|  59.1k|    UWORD32 uc_more_data_flag;
  823|  59.1k|    WORD32 i2_cur_mb_addr;
  824|  59.1k|    UWORD32 u1_num_mbs, u1_num_mbsNby2, u1_mb_idx;
  825|  59.1k|    UWORD32 i2_mb_skip_run;
  826|  59.1k|    UWORD32 u1_read_mb_type;
  827|       |
  828|  59.1k|    UWORD32 u1_mbaff;
  829|  59.1k|    UWORD32 u1_num_mbs_next, u1_end_of_row;
  830|  59.1k|    const UWORD32 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
  831|  59.1k|    UWORD32 u1_slice_end = 0;
  832|  59.1k|    UWORD32 u1_tfr_n_mb = 0;
  833|  59.1k|    UWORD32 u1_decode_nmb = 0;
  834|       |
  835|  59.1k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
  836|  59.1k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  837|  59.1k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  838|  59.1k|    deblk_mb_t *ps_cur_deblk_mb;
  839|  59.1k|    dec_mb_info_t *ps_cur_mb_info;
  840|  59.1k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data;
  841|  59.1k|    UWORD32 u1_inter_mb_type;
  842|  59.1k|    UWORD32 u1_deblk_mb_type;
  843|  59.1k|    UWORD32 u1_mb_threshold;
  844|  59.1k|    WORD32 ret = OK;
  ------------------
  |  |  114|  59.1k|#define OK        0
  ------------------
  845|       |
  846|       |    /******************************************************/
  847|       |    /* Initialisations specific to B or P slice           */
  848|       |    /******************************************************/
  849|  59.1k|    if(ps_slice->u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  59.1k|#define P_SLICE  0
  ------------------
  |  Branch (849:8): [True: 46.6k, False: 12.5k]
  ------------------
  850|  46.6k|    {
  851|  46.6k|        u1_inter_mb_type = P_MB;
  ------------------
  |  |  419|  46.6k|#define P_MB        2
  ------------------
  852|  46.6k|        u1_deblk_mb_type = D_INTER_MB;
  ------------------
  |  |  381|  46.6k|#define D_INTER_MB        0
  ------------------
  853|  46.6k|        u1_mb_threshold = 5;
  854|  46.6k|    }
  855|  12.5k|    else  // B_SLICE
  856|  12.5k|    {
  857|  12.5k|        u1_inter_mb_type = B_MB;
  ------------------
  |  |  420|  12.5k|#define B_MB        3
  ------------------
  858|  12.5k|        u1_deblk_mb_type = D_B_SLICE;
  ------------------
  |  |  384|  12.5k|#define D_B_SLICE         4
  ------------------
  859|  12.5k|        u1_mb_threshold = 23;
  860|  12.5k|    }
  861|       |
  862|       |    /******************************************************/
  863|       |    /* Slice Level Initialisations                        */
  864|       |    /******************************************************/
  865|  59.1k|    ps_dec->u1_qp = ps_slice->u1_slice_qp;
  866|  59.1k|    ih264d_update_qp(ps_dec, 0);
  867|  59.1k|    u1_mb_idx = ps_dec->u4_mb_idx;
  868|  59.1k|    u1_num_mbs = u1_mb_idx;
  869|       |
  870|  59.1k|    u1_num_mbsNby2 = 0;
  871|  59.1k|    u1_mbaff = ps_slice->u1_mbaff_frame_flag;
  872|  59.1k|    i2_cur_mb_addr = u2_first_mb_in_slice << u1_mbaff;
  873|  59.1k|    i2_mb_skip_run = 0;
  874|  59.1k|    uc_more_data_flag = 1;
  875|  59.1k|    u1_read_mb_type = 0;
  876|       |
  877|  1.12M|    while(!u1_slice_end)
  ------------------
  |  Branch (877:11): [True: 1.09M, False: 25.2k]
  ------------------
  878|  1.09M|    {
  879|  1.09M|        UWORD8 u1_mb_type;
  880|       |
  881|  1.09M|        ps_dec->pv_prev_mb_parse_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
  882|  1.09M|        if(i2_cur_mb_addr > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (882:12): [True: 18.6k, False: 1.08M]
  ------------------
  883|  18.6k|        {
  884|  18.6k|            break;
  885|  18.6k|        }
  886|       |
  887|  1.08M|        ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs;
  888|  1.08M|        ps_dec->u4_num_mbs_cur_nmb = u1_num_mbs;
  889|  1.08M|        ps_cur_mb_info->u1_Mux = 0;
  890|  1.08M|        ps_dec->u4_num_pmbair = (u1_num_mbs >> u1_mbaff);
  891|  1.08M|        ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u1_num_mbs;
  892|       |
  893|  1.08M|        ps_cur_mb_info->u1_end_of_slice = 0;
  894|       |
  895|       |        /* Storing Default partition info */
  896|  1.08M|        ps_parse_mb_data->u1_num_part = 1;
  897|  1.08M|        ps_parse_mb_data->u4_isI_mb = 0;
  898|       |
  899|  1.08M|        if((!i2_mb_skip_run) && (!u1_read_mb_type))
  ------------------
  |  Branch (899:12): [True: 222k, False: 858k]
  |  Branch (899:33): [True: 179k, False: 42.1k]
  ------------------
  900|   179k|        {
  901|       |            // Inlined ih264d_uev
  902|   179k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  903|   179k|            UWORD32 u4_word, u4_ldz;
  904|       |
  905|       |            /***************************************************************/
  906|       |            /* Find leading zeros in next 32 bits                          */
  907|       |            /***************************************************************/
  908|   179k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|   179k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|   179k|{                                                                           \
  |  |  152|   179k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|   179k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|   179k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|   179k|                                                                            \
  |  |  156|   179k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|   179k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 172k, False: 7.37k]
  |  |  ------------------
  |  |  158|   179k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|   172k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|   179k|}
  ------------------
  909|       |
  910|   179k|            u4_ldz = CLZ(u4_word);
  911|       |
  912|       |            /* Flush the ps_bitstrm */
  913|   179k|            u4_bitstream_offset += (u4_ldz + 1);
  914|       |            /* Read the suffix from the ps_bitstrm */
  915|   179k|            u4_word = 0;
  916|   179k|            if(u4_ldz)
  ------------------
  |  Branch (916:16): [True: 66.6k, False: 113k]
  ------------------
  917|  66.6k|            {
  918|  66.6k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  66.6k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  66.6k|{                                                                           \
  |  |  122|  66.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  66.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  66.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  66.6k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  66.6k|                                                                            \
  |  |  127|  66.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 61.8k, False: 4.87k]
  |  |  ------------------
  |  |  128|  66.6k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  61.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  66.6k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  66.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  66.6k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  66.6k|}                                                                           \
  ------------------
  919|  66.6k|            }
  920|   179k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
  921|   179k|            i2_mb_skip_run = ((1 << u4_ldz) + u4_word - 1);
  922|       |            // Inlined ih264d_uev
  923|   179k|            COPYTHECONTEXT("mb_skip_run", i2_mb_skip_run);
  924|   179k|            uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
  ------------------
  |  |   97|   179k|    CHECK_BITS_SUFFICIENT(ps_bitstrm, 1)
  |  |  ------------------
  |  |  |  |   95|   179k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  ------------------
  925|   179k|            u1_read_mb_type = uc_more_data_flag;
  926|   179k|        }
  927|       |
  928|       |        /***************************************************************/
  929|       |        /* Get the required information for decoding of MB            */
  930|       |        /* mb_x, mb_y , neighbour availablity,                              */
  931|       |        /***************************************************************/
  932|  1.08M|        ps_dec->pf_get_mb_info(ps_dec, i2_cur_mb_addr, ps_cur_mb_info, i2_mb_skip_run);
  933|       |
  934|       |        /***************************************************************/
  935|       |        /* Set the deblocking parameters for this MB */
  936|       |        /***************************************************************/
  937|  1.08M|        if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (937:12): [True: 1.08M, False: 0]
  ------------------
  938|  1.08M|            ih264d_set_deblocking_parameters(ps_cur_deblk_mb, ps_slice,
  939|  1.08M|                                             ps_dec->u1_mb_ngbr_availablity,
  940|  1.08M|                                             ps_dec->u1_cur_mb_fld_dec_flag);
  941|       |
  942|  1.08M|        if(i2_mb_skip_run)
  ------------------
  |  Branch (942:12): [True: 924k, False: 155k]
  ------------------
  943|   924k|        {
  944|       |            /* Set appropriate flags in ps_cur_mb_info and ps_dec */
  945|   924k|            ps_dec->i1_prev_mb_qp_delta = 0;
  946|   924k|            ps_dec->u1_sub_mb_num = 0;
  947|   924k|            ps_cur_mb_info->u1_mb_type = MB_SKIP;
  ------------------
  |  |   59|   924k|#define MB_SKIP 255
  ------------------
  948|   924k|            ps_cur_mb_info->u1_mb_mc_mode = PRED_16x16;
  ------------------
  |  |  450|   924k|#define PRED_16x16  0
  ------------------
  949|   924k|            ps_cur_mb_info->u1_cbp = 0;
  950|       |
  951|   924k|            {
  952|       |                /* Storing Skip partition info */
  953|   924k|                parse_part_params_t *ps_part_info = ps_dec->ps_part;
  954|   924k|                ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  571|   924k|#define PART_DIRECT_16x16              2
  ------------------
  955|   924k|                ps_part_info->u1_sub_mb_num = 0;
  956|   924k|                ps_dec->ps_part++;
  957|   924k|            }
  958|       |
  959|       |            /* Update Nnzs */
  960|   924k|            ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|   924k|#define CAVLC  0
  ------------------
  961|       |
  962|   924k|            ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
  963|   924k|            ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
  964|       |
  965|   924k|            if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|   924k|#define TARGET_LAYER 2
  ------------------
  |  Branch (965:16): [True: 210k, False: 714k]
  ------------------
  966|   210k|            {
  967|   210k|                ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|   210k|#define MB_DISABLE_FILTERING          0x01
  ------------------
  968|   210k|            }
  969|       |
  970|   924k|            i2_mb_skip_run--;
  971|   924k|        }
  972|   155k|        else
  973|   155k|        {
  974|   155k|            u1_read_mb_type = 0;
  975|       |            /**************************************************************/
  976|       |            /* Macroblock Layer Begins, Decode the u1_mb_type                */
  977|       |            /**************************************************************/
  978|   155k|            {
  979|   155k|                UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
  980|   155k|                UWORD32 u4_word, u4_ldz, u4_temp;
  981|       |
  982|       |                // Inlined ih264d_uev
  983|       |                /***************************************************************/
  984|       |                /* Find leading zeros in next 32 bits                          */
  985|       |                /***************************************************************/
  986|   155k|                NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|   155k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|   155k|{                                                                           \
  |  |  152|   155k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|   155k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|   155k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|   155k|                                                                            \
  |  |  156|   155k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|   155k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 151k, False: 4.31k]
  |  |  ------------------
  |  |  158|   155k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|   151k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|   155k|}
  ------------------
  987|   155k|                u4_ldz = CLZ(u4_word);
  988|       |                /* Flush the ps_bitstrm */
  989|   155k|                u4_bitstream_offset += (u4_ldz + 1);
  990|       |                /* Read the suffix from the ps_bitstrm */
  991|   155k|                u4_word = 0;
  992|   155k|                if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  73.8k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  73.8k|{                                                                           \
  |  |  122|  73.8k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  73.8k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  73.8k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  73.8k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  73.8k|                                                                            \
  |  |  127|  73.8k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 68.5k, False: 5.29k]
  |  |  ------------------
  |  |  128|  73.8k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  68.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  73.8k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  73.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  73.8k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  73.8k|}                                                                           \
  ------------------
  |  Branch (992:20): [True: 73.8k, False: 81.5k]
  ------------------
  993|   155k|                *pu4_bitstrm_ofst = u4_bitstream_offset;
  994|   155k|                u4_temp = ((1 << u4_ldz) + u4_word - 1);
  995|       |                // Inlined ih264d_uev
  996|   155k|                if(u4_temp > (UWORD32) (25 + u1_mb_threshold)) return ERROR_MB_TYPE;
  ------------------
  |  Branch (996:20): [True: 1.22k, False: 154k]
  ------------------
  997|   154k|                u1_mb_type = u4_temp;
  998|   154k|                COPYTHECONTEXT("u1_mb_type", u1_mb_type);
  999|   154k|            }
 1000|      0|            ps_cur_mb_info->u1_mb_type = u1_mb_type;
 1001|       |
 1002|       |            /**************************************************************/
 1003|       |            /* Parse Macroblock data                                      */
 1004|       |            /**************************************************************/
 1005|   154k|            if(u1_mb_type < u1_mb_threshold)
  ------------------
  |  Branch (1005:16): [True: 127k, False: 27.0k]
  ------------------
 1006|   127k|            {
 1007|   127k|                ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
 1008|       |
 1009|   127k|                ret = ps_dec->pf_parse_inter_mb(ps_dec, ps_cur_mb_info, u1_num_mbs, u1_num_mbsNby2);
 1010|   127k|                if(ret != OK) return ret;
  ------------------
  |  |  114|   127k|#define OK        0
  ------------------
  |  Branch (1010:20): [True: 11.0k, False: 116k]
  ------------------
 1011|   116k|                ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 1012|       |
 1013|   116k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|   116k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1013:20): [True: 44.3k, False: 71.7k]
  ------------------
 1014|  44.3k|                {
 1015|  44.3k|                    ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|  44.3k|#define MB_DISABLE_FILTERING          0x01
  ------------------
 1016|  44.3k|                }
 1017|   116k|            }
 1018|  27.0k|            else
 1019|  27.0k|            {
 1020|       |                /* Storing Intra partition info */
 1021|  27.0k|                ps_parse_mb_data->u1_num_part = 0;
 1022|  27.0k|                ps_parse_mb_data->u4_isI_mb = 1;
 1023|       |
 1024|  27.0k|                if((25 + u1_mb_threshold) == u1_mb_type)
  ------------------
  |  Branch (1024:20): [True: 1.17k, False: 25.8k]
  ------------------
 1025|  1.17k|                {
 1026|       |                    /* I_PCM_MB */
 1027|  1.17k|                    ps_cur_mb_info->ps_curmb->u1_mb_type = I_PCM_MB;
  ------------------
  |  |  423|  1.17k|#define I_PCM_MB    6
  ------------------
 1028|  1.17k|                    ret = ih264d_parse_ipcm_mb(ps_dec, ps_cur_mb_info, u1_num_mbs);
 1029|  1.17k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  1.17k|#define OK        0
  ------------------
  |  Branch (1029:24): [True: 0, False: 1.17k]
  ------------------
 1030|  1.17k|                    ps_dec->u1_qp = 0;
 1031|  1.17k|                }
 1032|  25.8k|                else
 1033|  25.8k|                {
 1034|  25.8k|                    ret = ih264d_parse_imb_cavlc(ps_dec, ps_cur_mb_info, u1_num_mbs,
 1035|  25.8k|                                                 (UWORD8) (u1_mb_type - u1_mb_threshold));
 1036|  25.8k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  25.8k|#define OK        0
  ------------------
  |  Branch (1036:24): [True: 2.96k, False: 22.9k]
  ------------------
 1037|  25.8k|                }
 1038|       |
 1039|  24.0k|                ps_cur_deblk_mb->u1_mb_type |= D_INTRA_MB;
  ------------------
  |  |  382|  24.0k|#define D_INTRA_MB        1
  ------------------
 1040|  24.0k|            }
 1041|   140k|            uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
  ------------------
  |  |   97|   140k|    CHECK_BITS_SUFFICIENT(ps_bitstrm, 1)
  |  |  ------------------
  |  |  |  |   95|   140k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  ------------------
 1042|   140k|        }
 1043|  1.06M|        ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
 1044|       |
 1045|  1.06M|        if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (1045:12): [True: 0, False: 1.06M]
  ------------------
 1046|      0|        {
 1047|      0|            ih264d_populate_mb_info_map(ps_dec, ps_cur_mb_info, ps_cur_mb_info->u2_mbx << 1,
 1048|      0|                                        ps_cur_mb_info->u2_mby << 1, ps_cur_deblk_mb->u1_mb_qp);
 1049|      0|        }
 1050|  1.06M|        if(u1_mbaff)
  ------------------
  |  Branch (1050:12): [True: 0, False: 1.06M]
  ------------------
 1051|      0|        {
 1052|      0|            ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
 1053|      0|            if(!uc_more_data_flag && !i2_mb_skip_run && (0 == (i2_cur_mb_addr & 1)))
  ------------------
  |  Branch (1053:16): [True: 0, False: 0]
  |  Branch (1053:38): [True: 0, False: 0]
  |  Branch (1053:57): [True: 0, False: 0]
  ------------------
 1054|      0|            {
 1055|      0|                return ERROR_EOB_FLUSHBITS_T;
 1056|      0|            }
 1057|      0|        }
 1058|       |
 1059|       |        /**************************************************************/
 1060|       |        /* Get next Macroblock address                                */
 1061|       |        /**************************************************************/
 1062|  1.06M|        i2_cur_mb_addr++;
 1063|       |
 1064|  1.06M|        u1_num_mbs++;
 1065|  1.06M|        u1_num_mbsNby2++;
 1066|  1.06M|        ps_parse_mb_data++;
 1067|       |
 1068|       |        /****************************************************************/
 1069|       |        /* Check for End Of Row and other flags that determine when to  */
 1070|       |        /* do DMA setup for N/2-Mb, Decode for N-Mb, and Transfer for   */
 1071|       |        /* N-Mb                                                         */
 1072|       |        /****************************************************************/
 1073|  1.06M|        u1_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
 1074|  1.06M|        u1_end_of_row = (!u1_num_mbs_next) && (!(u1_mbaff && (u1_num_mbs & 0x01)));
  ------------------
  |  Branch (1074:25): [True: 188k, False: 875k]
  |  Branch (1074:50): [True: 0, False: 188k]
  |  Branch (1074:62): [True: 0, False: 0]
  ------------------
 1075|  1.06M|        u1_slice_end = (!(uc_more_data_flag || i2_mb_skip_run));
  ------------------
  |  Branch (1075:27): [True: 429k, False: 635k]
  |  Branch (1075:48): [True: 610k, False: 25.2k]
  ------------------
 1076|  1.06M|        u1_tfr_n_mb = (u1_num_mbs == ps_dec->u4_recon_mb_grp) || u1_end_of_row || u1_slice_end;
  ------------------
  |  Branch (1076:23): [True: 188k, False: 876k]
  |  Branch (1076:66): [True: 276, False: 875k]
  |  Branch (1076:83): [True: 22.2k, False: 853k]
  ------------------
 1077|  1.06M|        u1_decode_nmb = u1_tfr_n_mb || u1_slice_end;
  ------------------
  |  Branch (1077:25): [True: 211k, False: 853k]
  |  Branch (1077:40): [True: 0, False: 853k]
  ------------------
 1078|  1.06M|        ps_cur_mb_info->u1_end_of_slice = u1_slice_end;
 1079|       |
 1080|  1.06M|        if(u1_decode_nmb)
  ------------------
  |  Branch (1080:12): [True: 211k, False: 853k]
  ------------------
 1081|   211k|        {
 1082|   211k|            ret = ps_dec->pf_mvpred_ref_tfr_nby2mb(ps_dec, u1_mb_idx, u1_num_mbs);
 1083|   211k|            u1_num_mbsNby2 = 0;
 1084|   211k|            ps_parse_mb_data = ps_dec->ps_parse_mb_data;
 1085|   211k|            ps_dec->ps_part = ps_dec->ps_parse_part_params;
 1086|   211k|            if(ret != OK) return ret;
  ------------------
  |  |  114|   211k|#define OK        0
  ------------------
  |  Branch (1086:16): [True: 0, False: 211k]
  ------------------
 1087|   211k|        }
 1088|       |
 1089|  1.06M|        if(u1_decode_nmb)
  ------------------
  |  Branch (1089:12): [True: 211k, False: 853k]
  ------------------
 1090|   211k|        {
 1091|   211k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1091:16): [True: 49.8k, False: 161k]
  ------------------
 1092|  49.8k|            {
 1093|  49.8k|                ih264d_parse_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next, u1_tfr_n_mb,
 1094|  49.8k|                                     u1_end_of_row);
 1095|  49.8k|                ps_dec->ps_nmb_info += u1_num_mbs;
 1096|  49.8k|                ps_svc_lyr_dec->ps_svc_nmb_info += u1_num_mbs;
 1097|  49.8k|            }
 1098|   161k|            else
 1099|   161k|            {
 1100|   161k|                if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|   161k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1100:20): [True: 41.5k, False: 119k]
  ------------------
 1101|  41.5k|                {
 1102|  41.5k|                    ih264d_decode_recon_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next,
 1103|  41.5k|                                                u1_tfr_n_mb, u1_end_of_row);
 1104|  41.5k|                }
 1105|   119k|                else
 1106|   119k|                {
 1107|   119k|                    isvcd_decode_recon_tfr_nmb_base_lyr(ps_svc_lyr_dec, u1_mb_idx, u1_num_mbs,
 1108|   119k|                                                        u1_num_mbs_next, u1_tfr_n_mb,
 1109|   119k|                                                        u1_end_of_row);
 1110|   119k|                }
 1111|   161k|            }
 1112|   211k|            ps_dec->u4_total_mbs_coded += u1_num_mbs;
 1113|   211k|            if(u1_tfr_n_mb) u1_num_mbs = 0;
  ------------------
  |  Branch (1113:16): [True: 211k, False: 0]
  ------------------
 1114|   211k|            u1_mb_idx = u1_num_mbs;
 1115|   211k|            ps_dec->u4_mb_idx = u1_num_mbs;
 1116|   211k|        }
 1117|  1.06M|    }
 1118|       |
 1119|  43.9k|    ps_dec->u4_num_mbs_cur_nmb = 0;
 1120|  43.9k|    ps_dec->ps_cur_slice->u4_mbs_in_slice = i2_cur_mb_addr - (u2_first_mb_in_slice << u1_mbaff);
 1121|       |
 1122|  43.9k|    return ret;
 1123|  59.1k|}
isvcd_parse_inter_slice_data_cabac_enh_lyr:
 1154|  4.43k|{
 1155|  4.43k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1156|  4.43k|    UWORD32 uc_more_data_flag;
 1157|  4.43k|    WORD32 i2_cur_mb_addr;
 1158|  4.43k|    UWORD32 u1_num_mbs, u1_num_mbsNby2, u1_mb_idx;
 1159|  4.43k|    UWORD32 u1_mbaff;
 1160|  4.43k|    UWORD32 u1_num_mbs_next, u1_end_of_row;
 1161|  4.43k|    const UWORD16 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
 1162|  4.43k|    UWORD32 u1_slice_end = 0;
 1163|  4.43k|    UWORD32 u1_tfr_n_mb = 0;
 1164|  4.43k|    UWORD32 u1_decode_nmb = 0;
 1165|       |
 1166|  4.43k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1167|  4.43k|    deblk_mb_t *ps_cur_deblk_mb;
 1168|  4.43k|    dec_mb_info_t *ps_cur_mb_info;
 1169|  4.43k|    dec_svc_mb_info_t *ps_svc_cur_mb_info;
 1170|       |
 1171|  4.43k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data;
 1172|  4.43k|    UWORD32 u1_inter_mb_skip_type;
 1173|  4.43k|    UWORD32 u1_inter_mb_type;
 1174|  4.43k|    UWORD32 u1_deblk_mb_type;
 1175|  4.43k|    UWORD32 u1_mb_threshold;
 1176|  4.43k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
 1177|  4.43k|    decoding_envirnoment_t *ps_cab_env = NULL;
 1178|  4.43k|    WORD32 ret = OK;
  ------------------
  |  |  114|  4.43k|#define OK        0
  ------------------
 1179|       |
 1180|  4.43k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1181|       |
 1182|       |    /******************************************************/
 1183|       |    /* Initialisations specific to B or P slice           */
 1184|       |    /******************************************************/
 1185|  4.43k|    if(ps_slice->u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  4.43k|#define P_SLICE  0
  ------------------
  |  Branch (1185:8): [True: 2.22k, False: 2.20k]
  ------------------
 1186|  2.22k|    {
 1187|  2.22k|        u1_inter_mb_skip_type = CAB_P_SKIP;
  ------------------
  |  |  403|  2.22k|#define CAB_P_SKIP        0x16 /* 0001 x11x */
  ------------------
 1188|  2.22k|        u1_inter_mb_type = P_MB;
  ------------------
  |  |  419|  2.22k|#define P_MB        2
  ------------------
 1189|  2.22k|        u1_deblk_mb_type = D_INTER_MB;
  ------------------
  |  |  381|  2.22k|#define D_INTER_MB        0
  ------------------
 1190|  2.22k|        u1_mb_threshold = 5;
 1191|  2.22k|    }
 1192|  2.20k|    else  // EB_SLICE
 1193|  2.20k|    {
 1194|  2.20k|        u1_inter_mb_skip_type = CAB_B_SKIP;
  ------------------
  |  |  404|  2.20k|#define CAB_B_SKIP        0x14 /* 0001 x100 */
  ------------------
 1195|  2.20k|        u1_inter_mb_type = B_MB;
  ------------------
  |  |  420|  2.20k|#define B_MB        3
  ------------------
 1196|  2.20k|        u1_deblk_mb_type = D_B_SLICE;
  ------------------
  |  |  384|  2.20k|#define D_B_SLICE         4
  ------------------
 1197|  2.20k|        u1_mb_threshold = 23;
 1198|  2.20k|    }
 1199|       |
 1200|       |    /******************************************************/
 1201|       |    /* Slice Level Initialisations                        */
 1202|       |    /******************************************************/
 1203|  4.43k|    i2_cur_mb_addr = u2_first_mb_in_slice;
 1204|  4.43k|    ps_dec->u1_qp = ps_slice->u1_slice_qp;
 1205|  4.43k|    ih264d_update_qp(ps_dec, 0);
 1206|  4.43k|    u1_mb_idx = ps_dec->u4_mb_idx;
 1207|  4.43k|    u1_num_mbs = u1_mb_idx;
 1208|  4.43k|    u1_num_mbsNby2 = 0;
 1209|  4.43k|    u1_mbaff = ps_slice->u1_mbaff_frame_flag;
 1210|  4.43k|    i2_cur_mb_addr = u2_first_mb_in_slice << u1_mbaff;
 1211|  4.43k|    uc_more_data_flag = 1;
 1212|       |
 1213|       |    /* Initialisations specific to cabac */
 1214|  4.43k|    if(ps_bitstrm->u4_ofst & 0x07)
  ------------------
  |  Branch (1214:8): [True: 3.91k, False: 519]
  ------------------
 1215|  3.91k|    {
 1216|  3.91k|        ps_bitstrm->u4_ofst += 8;
 1217|  3.91k|        ps_bitstrm->u4_ofst &= 0xFFFFFFF8;
 1218|  3.91k|    }
 1219|       |
 1220|  4.43k|    ret = ih264d_init_cabac_dec_envirnoment(&(ps_dec->s_cab_dec_env), ps_bitstrm);
 1221|  4.43k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  4.43k|#define OK        0
  ------------------
  |  Branch (1221:8): [True: 115, False: 4.31k]
  ------------------
 1222|       |
 1223|  4.31k|    ps_cab_env = &ps_dec->s_cab_dec_env;
 1224|  4.31k|    ps_dec->i1_prev_mb_qp_delta = 0;
 1225|       |
 1226|  74.1k|    while(!u1_slice_end)
  ------------------
  |  Branch (1226:11): [True: 73.5k, False: 642]
  ------------------
 1227|  73.5k|    {
 1228|  73.5k|        UWORD8 u1_mb_type;
 1229|  73.5k|        UWORD32 u4_mb_skip;
 1230|  73.5k|        ps_dec->pv_prev_mb_parse_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
 1231|  73.5k|        if(i2_cur_mb_addr > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (1231:12): [True: 838, False: 72.6k]
  ------------------
 1232|    838|        {
 1233|    838|            break;
 1234|    838|        }
 1235|       |
 1236|  72.6k|        ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs;
 1237|  72.6k|        ps_svc_cur_mb_info = ps_svc_lyr_dec->ps_svc_nmb_info + u1_num_mbs;
 1238|  72.6k|        ps_dec->u4_num_mbs_cur_nmb = u1_num_mbs;
 1239|  72.6k|        ps_cur_mb_info->u1_Mux = 0;
 1240|  72.6k|        ps_dec->u4_num_pmbair = (u1_num_mbs >> u1_mbaff);
 1241|  72.6k|        ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u1_num_mbs;
 1242|  72.6k|        ps_cur_mb_info->u1_end_of_slice = 0;
 1243|       |
 1244|       |        /* Storing Default partition info */
 1245|  72.6k|        ps_parse_mb_data->u1_num_part = 1;
 1246|  72.6k|        ps_parse_mb_data->u4_isI_mb = 0;
 1247|       |
 1248|       |        /***************************************************************/
 1249|       |        /* Get the required information for decoding of MB             */
 1250|       |        /* mb_x, mb_y , neighbour availablity,                         */
 1251|       |        /***************************************************************/
 1252|  72.6k|        u4_mb_skip = ps_dec->pf_get_mb_info(ps_dec, i2_cur_mb_addr, ps_cur_mb_info, 1);
 1253|  72.6k|        ps_svc_cur_mb_info->u1_crop_window_flag =
 1254|  72.6k|            *(ps_svc_lyr_dec->pu1_crop_wnd_flag + ps_cur_mb_info->u2_mbx +
 1255|  72.6k|              (ps_cur_mb_info->u2_mby * ps_dec->u2_frm_wd_in_mbs));
 1256|       |        /*********************************************************************/
 1257|       |        /* initialize u1_tran_form8x8 to zero to aviod uninitialized accesses */
 1258|       |        /*********************************************************************/
 1259|  72.6k|        ps_cur_mb_info->u1_tran_form8x8 = 0;
 1260|  72.6k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
 1261|       |
 1262|       |        /***************************************************************/
 1263|       |        /* Set the deblocking parameters for this MB                   */
 1264|       |        /***************************************************************/
 1265|  72.6k|        if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (1265:12): [True: 72.6k, False: 0]
  ------------------
 1266|  72.6k|            ih264d_set_deblocking_parameters(ps_cur_deblk_mb, ps_slice,
 1267|  72.6k|                                             ps_dec->u1_mb_ngbr_availablity,
 1268|  72.6k|                                             ps_dec->u1_cur_mb_fld_dec_flag);
 1269|       |
 1270|  72.6k|        if(u4_mb_skip)
  ------------------
  |  Branch (1270:12): [True: 21.2k, False: 51.4k]
  ------------------
 1271|  21.2k|        {
 1272|       |            /* Set appropriate flags in ps_cur_mb_info and ps_dec */
 1273|  21.2k|            memset(ps_dec->ps_curr_ctxt_mb_info, 0, sizeof(ctxt_inc_mb_info_t));
 1274|  21.2k|            ps_dec->ps_curr_ctxt_mb_info->u1_mb_type = u1_inter_mb_skip_type;
 1275|       |
 1276|  21.2k|            MEMSET_16BYTES(&ps_dec->pu1_left_mv_ctxt_inc[0][0], 0);
  ------------------
  |  |  652|  21.2k|#define MEMSET_16BYTES(pu4_start,value)                         \
  |  |  653|  21.2k|{                                                               \
  |  |  654|  21.2k|    memset(pu4_start,value,16);                                 \
  |  |  655|  21.2k|}
  ------------------
 1277|       |
 1278|  21.2k|            *((UWORD32 *) ps_dec->pi1_left_ref_idx_ctxt_inc) = 0;
 1279|  21.2k|            *(ps_dec->pu1_left_yuv_dc_csbp) = 0;
 1280|       |
 1281|  21.2k|            ps_dec->i1_prev_mb_qp_delta = 0;
 1282|  21.2k|            ps_cur_mb_info->u1_mb_type = MB_SKIP;
  ------------------
  |  |   59|  21.2k|#define MB_SKIP 255
  ------------------
 1283|  21.2k|            ps_cur_mb_info->u1_cbp = 0;
 1284|  21.2k|            ps_svc_cur_mb_info->u1_base_mode_flag = 0;
 1285|  21.2k|            ps_svc_cur_mb_info->au1_motion_pred_flag[0] = 0;
 1286|  21.2k|            ps_svc_cur_mb_info->au1_motion_pred_flag[1] = 0;
 1287|  21.2k|            ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
 1288|       |
 1289|  21.2k|            {
 1290|       |                /* Storing Skip partition info */
 1291|  21.2k|                parse_part_params_t *ps_part_info = ps_dec->ps_part;
 1292|  21.2k|                ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  571|  21.2k|#define PART_DIRECT_16x16              2
  ------------------
 1293|  21.2k|                ps_part_info->u1_sub_mb_num = 0;
 1294|  21.2k|                ps_dec->ps_part++;
 1295|  21.2k|            }
 1296|       |
 1297|       |            /* Update Nnzs */
 1298|  21.2k|            ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CABAC);
  ------------------
  |  |  339|  21.2k|#define CABAC  1
  ------------------
 1299|  21.2k|            ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
 1300|  21.2k|            ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 1301|  21.2k|            ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
 1302|  21.2k|            if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  21.2k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1302:16): [True: 0, False: 21.2k]
  ------------------
 1303|      0|            {
 1304|      0|                ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|      0|#define MB_DISABLE_FILTERING          0x01
  ------------------
 1305|      0|            }
 1306|  21.2k|        }
 1307|  51.4k|        else
 1308|  51.4k|        {
 1309|       |            /* Variables for handling Cabac contexts */
 1310|  51.4k|            UWORD8 *pu1_cur_svc_base_mode_flag;
 1311|  51.4k|            UWORD8 u1_left_svc_base_mode_flag;
 1312|  51.4k|            UWORD8 u1_top_svc_base_mode_flag;
 1313|       |
 1314|  51.4k|            UWORD32 u4_a, u4_b, u4_ctxt_inc;
 1315|  51.4k|            ps_svc_cur_mb_info->u1_base_mode_flag = 0;
 1316|       |            /* Macroblock Layer Begins */
 1317|  51.4k|            if(ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (1317:16): [True: 51.1k, False: 295]
  ------------------
 1318|  51.1k|               ps_svc_slice_params->u1_adaptive_base_mode_flag)
  ------------------
  |  Branch (1318:16): [True: 12.7k, False: 38.4k]
  ------------------
 1319|  12.7k|            {
 1320|  12.7k|                pu1_cur_svc_base_mode_flag =
 1321|  12.7k|                    ps_svc_lyr_dec->pu1_svc_base_mode_flag + ps_cur_mb_info->u2_mbx;
 1322|  12.7k|                pu1_cur_svc_base_mode_flag +=
 1323|  12.7k|                    ps_cur_mb_info->u2_mby * ps_svc_lyr_dec->i4_frm_svc_base_mode_cabac_stride;
 1324|       |
 1325|  12.7k|                u1_left_svc_base_mode_flag = 0;
 1326|  12.7k|                if(ps_dec->u1_mb_ngbr_availablity & LEFT_MB_AVAILABLE_MASK)
  ------------------
  |  |   53|  12.7k|#define LEFT_MB_AVAILABLE_MASK      0x01
  ------------------
  |  Branch (1326:20): [True: 9.71k, False: 3.02k]
  ------------------
 1327|  9.71k|                    u1_left_svc_base_mode_flag = *(pu1_cur_svc_base_mode_flag - 1);
 1328|       |
 1329|  12.7k|                u1_top_svc_base_mode_flag = 0;
 1330|  12.7k|                if(ps_dec->u1_mb_ngbr_availablity & TOP_MB_AVAILABLE_MASK)
  ------------------
  |  |   55|  12.7k|#define TOP_MB_AVAILABLE_MASK       0x04
  ------------------
  |  Branch (1330:20): [True: 10.8k, False: 1.93k]
  ------------------
 1331|  10.8k|                    u1_top_svc_base_mode_flag =
 1332|  10.8k|                        *(pu1_cur_svc_base_mode_flag -
 1333|  10.8k|                          ps_svc_lyr_dec->i4_frm_svc_base_mode_cabac_stride);
 1334|       |
 1335|  12.7k|                u4_a = 1;
 1336|  12.7k|                u4_b = 1;
 1337|       |
 1338|  12.7k|                if(u1_top_svc_base_mode_flag)
  ------------------
  |  Branch (1338:20): [True: 2.94k, False: 9.80k]
  ------------------
 1339|  2.94k|                {
 1340|  2.94k|                    u4_a = 0;
 1341|  2.94k|                }
 1342|       |
 1343|  12.7k|                if(u1_left_svc_base_mode_flag)
  ------------------
  |  Branch (1343:20): [True: 2.72k, False: 10.0k]
  ------------------
 1344|  2.72k|                {
 1345|  2.72k|                    u4_b = 0;
 1346|  2.72k|                }
 1347|       |
 1348|  12.7k|                u4_ctxt_inc = u4_a + u4_b;
 1349|  12.7k|                ps_svc_cur_mb_info->u1_base_mode_flag = ih264d_decode_bin(
 1350|  12.7k|                    u4_ctxt_inc, ps_svc_lyr_dec->ps_base_mode_flag, ps_bitstrm, ps_cab_env);
 1351|  12.7k|                COPYTHECONTEXT("SVC ext: u1_base_mode_flag", ps_svc_cur_mb_info->u1_base_mode_flag);
 1352|  12.7k|                *pu1_cur_svc_base_mode_flag = ps_svc_cur_mb_info->u1_base_mode_flag;
 1353|  12.7k|            }
 1354|  38.7k|            else if(ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1354:21): [True: 38.4k, False: 295]
  ------------------
 1355|  38.4k|            {
 1356|  38.4k|                ps_svc_cur_mb_info->u1_base_mode_flag =
 1357|  38.4k|                    ps_svc_slice_params->u1_default_base_mode_flag;
 1358|  38.4k|            }
 1359|       |
 1360|  51.4k|            if(!ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (1360:16): [True: 31.6k, False: 19.8k]
  ------------------
 1361|  31.6k|            {
 1362|       |                /* Decode the u1_mb_type */
 1363|  31.6k|                u1_mb_type = ih264d_parse_mb_type_cabac(ps_dec);
 1364|  31.6k|                ps_cur_mb_info->u1_mb_type = u1_mb_type;
 1365|  31.6k|                if(u1_mb_type > (25 + u1_mb_threshold)) return ERROR_MB_TYPE;
  ------------------
  |  Branch (1365:20): [True: 0, False: 31.6k]
  ------------------
 1366|  31.6k|                COPYTHECONTEXT("u1_mb_type", u1_mb_type);
 1367|  31.6k|            }
 1368|  19.8k|            else
 1369|  19.8k|            {
 1370|       |                // default intialization for Base mode flag : reserved
 1371|  19.8k|                ps_dec->ps_part += MAX_NUM_MB_PART;
  ------------------
  |  |   62|  19.8k|#define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   59|  19.8k|#define NUM_MB_PARTS 4
  |  |  ------------------
  |  |               #define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   60|  19.8k|#define NUM_SUB_MB_PARTS 4
  |  |  ------------------
  ------------------
 1372|       |
 1373|  19.8k|                ps_svc_cur_mb_info->au1_motion_pred_flag[0] = 0;
 1374|  19.8k|                ps_svc_cur_mb_info->au1_motion_pred_flag[1] = 0;
 1375|  19.8k|                ps_cur_mb_info->u1_mb_type = MB_INFER;
  ------------------
  |  |  112|  19.8k|#define MB_INFER 250
  ------------------
 1376|  19.8k|                ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 1377|  19.8k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  19.8k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1377:20): [True: 0, False: 19.8k]
  ------------------
 1378|      0|                {
 1379|      0|                    ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|      0|#define MB_DISABLE_FILTERING          0x01
  ------------------
 1380|      0|                }
 1381|       |
 1382|       |                /*SVC EXT needs to update incropwindow*/
 1383|  19.8k|                if(ps_svc_slice_params->u1_adaptive_residual_prediction_flag &&
  ------------------
  |  Branch (1383:20): [True: 16.2k, False: 3.61k]
  ------------------
 1384|  16.2k|                   ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1384:20): [True: 16.2k, False: 0]
  ------------------
 1385|  16.2k|                {
 1386|  16.2k|                    ps_svc_cur_mb_info->u1_residual_prediction_flag = ih264d_decode_bin(
 1387|  16.2k|                        0, ps_svc_lyr_dec->ps_residual_prediction_flag, ps_bitstrm, ps_cab_env);
 1388|  16.2k|                    COPYTHECONTEXT("SVC ext: u1_residual_prediction_flag",
 1389|  16.2k|                                   ps_svc_cur_mb_info->u1_residual_prediction_flag);
 1390|  16.2k|                }
 1391|  3.61k|                else
 1392|  3.61k|                {
 1393|       |                    /*residual flag inference code */
 1394|  3.61k|                    if(1 == ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1394:24): [True: 3.61k, False: 0]
  ------------------
 1395|  3.61k|                    {
 1396|  3.61k|                        ps_svc_cur_mb_info->u1_residual_prediction_flag =
 1397|  3.61k|                            ps_svc_slice_params->u1_default_residual_prediction_flag;
 1398|  3.61k|                    }
 1399|      0|                    else
 1400|      0|                    {
 1401|      0|                        ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
 1402|      0|                    }
 1403|  3.61k|                }
 1404|  19.8k|            }
 1405|       |
 1406|       |            /* Parse Macroblock Data */
 1407|  51.4k|            u1_mb_type = ps_cur_mb_info->u1_mb_type;
 1408|  51.4k|            if(u1_mb_type < u1_mb_threshold)
  ------------------
  |  Branch (1408:16): [True: 29.2k, False: 22.1k]
  ------------------
 1409|  29.2k|            {
 1410|  29.2k|                ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
 1411|  29.2k|                *(ps_dec->pu1_left_yuv_dc_csbp) &= 0x6;
 1412|       |
 1413|  29.2k|                ret = ps_svc_lyr_dec->pf_parse_inter_mb_svc_ext(
 1414|  29.2k|                    ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info, u1_num_mbs, u1_num_mbsNby2);
 1415|  29.2k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  29.2k|#define OK        0
  ------------------
  |  Branch (1415:20): [True: 1.85k, False: 27.4k]
  ------------------
 1416|  27.4k|                ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
 1417|  27.4k|                ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 1418|  27.4k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  27.4k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1418:20): [True: 0, False: 27.4k]
  ------------------
 1419|      0|                {
 1420|      0|                    ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|      0|#define MB_DISABLE_FILTERING          0x01
  ------------------
 1421|      0|                }
 1422|  27.4k|            }
 1423|  22.1k|            else
 1424|  22.1k|            {
 1425|       |                /* Storing Intra partition info */
 1426|  22.1k|                ps_parse_mb_data->u1_num_part = 0;
 1427|  22.1k|                ps_parse_mb_data->u4_isI_mb = 1;
 1428|       |
 1429|  22.1k|                if((25 + u1_mb_threshold) == u1_mb_type)
  ------------------
  |  Branch (1429:20): [True: 216, False: 21.9k]
  ------------------
 1430|    216|                {
 1431|       |                    /* I_PCM_MB */
 1432|    216|                    ps_cur_mb_info->ps_curmb->u1_mb_type = I_PCM_MB;
  ------------------
  |  |  423|    216|#define I_PCM_MB    6
  ------------------
 1433|    216|                    ret = ih264d_parse_ipcm_mb(ps_dec, ps_cur_mb_info, u1_num_mbs);
 1434|    216|                    if(ret != OK) return ret;
  ------------------
  |  |  114|    216|#define OK        0
  ------------------
  |  Branch (1434:24): [True: 150, False: 66]
  ------------------
 1435|     66|                    ps_cur_deblk_mb->u1_mb_qp = 0;
 1436|     66|                    ps_cur_deblk_mb->u1_mb_type |= D_INTRA_MB;
  ------------------
  |  |  382|     66|#define D_INTRA_MB        1
  ------------------
 1437|     66|                }
 1438|  21.9k|                else
 1439|  21.9k|                {
 1440|  21.9k|                    if(u1_mb_type == u1_mb_threshold)
  ------------------
  |  Branch (1440:24): [True: 1.06k, False: 20.9k]
  ------------------
 1441|  1.06k|                        ps_cur_mb_info->ps_curmb->u1_mb_type = I_4x4_MB;
  ------------------
  |  |  417|  1.06k|#define I_4x4_MB    0
  ------------------
 1442|  20.9k|                    else
 1443|  20.9k|                        ps_cur_mb_info->ps_curmb->u1_mb_type = I_16x16_MB;
  ------------------
  |  |  418|  20.9k|#define I_16x16_MB  1
  ------------------
 1444|       |
 1445|  21.9k|                    ret = isvcd_parse_imb_cabac(ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info,
 1446|  21.9k|                                                (UWORD8) (u1_mb_type - u1_mb_threshold));
 1447|  21.9k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  21.9k|#define OK        0
  ------------------
  |  Branch (1447:24): [True: 742, False: 21.2k]
  ------------------
 1448|  21.2k|                    ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
 1449|  21.2k|                    if(0 == ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (1449:24): [True: 2.06k, False: 19.1k]
  ------------------
 1450|  2.06k|                    {
 1451|  2.06k|                        ps_cur_deblk_mb->u1_mb_type |= D_INTRA_MB;
  ------------------
  |  |  382|  2.06k|#define D_INTRA_MB        1
  ------------------
 1452|  2.06k|                    }
 1453|  21.2k|                }
 1454|  21.3k|                ps_parse_mb_data->u4_isI_mb = !ps_svc_cur_mb_info->u1_base_mode_flag;
 1455|  21.3k|            }
 1456|  51.4k|        }
 1457|       |
 1458|  69.9k|        if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (1458:12): [True: 0, False: 69.9k]
  ------------------
 1459|      0|        {
 1460|      0|            ih264d_populate_mb_info_map(ps_dec, ps_cur_mb_info, ps_cur_mb_info->u2_mbx << 1,
 1461|      0|                                        ps_cur_mb_info->u2_mby << 1, ps_cur_deblk_mb->u1_mb_qp);
 1462|      0|        }
 1463|  69.9k|        if(u1_mbaff)
  ------------------
  |  Branch (1463:12): [True: 0, False: 69.9k]
  ------------------
 1464|      0|        {
 1465|      0|            ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
 1466|      0|        }
 1467|       |
 1468|  69.9k|        if(ps_cur_mb_info->u1_topmb && u1_mbaff)
  ------------------
  |  Branch (1468:12): [True: 69.9k, False: 0]
  |  Branch (1468:40): [True: 0, False: 69.9k]
  ------------------
 1469|      0|            uc_more_data_flag = 1;
 1470|  69.9k|        else
 1471|  69.9k|        {
 1472|  69.9k|            uc_more_data_flag = ih264d_decode_terminate(&ps_dec->s_cab_dec_env, ps_bitstrm);
 1473|  69.9k|            uc_more_data_flag = !uc_more_data_flag;
 1474|  69.9k|            COPYTHECONTEXT("Decode Sliceterm", !uc_more_data_flag);
 1475|  69.9k|        }
 1476|       |
 1477|  69.9k|        if(u1_mbaff)
  ------------------
  |  Branch (1477:12): [True: 0, False: 69.9k]
  ------------------
 1478|      0|        {
 1479|      0|            if(!uc_more_data_flag && (0 == (i2_cur_mb_addr & 1)))
  ------------------
  |  Branch (1479:16): [True: 0, False: 0]
  |  Branch (1479:38): [True: 0, False: 0]
  ------------------
 1480|      0|            {
 1481|      0|                return ERROR_EOB_FLUSHBITS_T;
 1482|      0|            }
 1483|      0|        }
 1484|       |        /* Next macroblock information */
 1485|  69.9k|        i2_cur_mb_addr++;
 1486|  69.9k|        u1_num_mbs++;
 1487|  69.9k|        u1_num_mbsNby2++;
 1488|  69.9k|        ps_parse_mb_data++;
 1489|       |
 1490|       |        /****************************************************************/
 1491|       |        /* Check for End Of Row and other flags that determine when to  */
 1492|       |        /* do DMA setup for N/2-Mb, Decode for N-Mb, and Transfer for   */
 1493|       |        /* N-Mb                                                         */
 1494|       |        /****************************************************************/
 1495|  69.9k|        u1_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
 1496|  69.9k|        u1_end_of_row = (!u1_num_mbs_next) && (!(u1_mbaff && (u1_num_mbs & 0x01)));
  ------------------
  |  Branch (1496:25): [True: 16.5k, False: 53.4k]
  |  Branch (1496:50): [True: 0, False: 16.5k]
  |  Branch (1496:62): [True: 0, False: 0]
  ------------------
 1497|  69.9k|        u1_slice_end = !uc_more_data_flag;
 1498|  69.9k|        u1_tfr_n_mb = (u1_num_mbs == ps_dec->u4_recon_mb_grp) || u1_end_of_row || u1_slice_end;
  ------------------
  |  Branch (1498:23): [True: 16.3k, False: 53.6k]
  |  Branch (1498:66): [True: 218, False: 53.4k]
  |  Branch (1498:83): [True: 623, False: 52.7k]
  ------------------
 1499|  69.9k|        u1_decode_nmb = u1_tfr_n_mb || u1_slice_end;
  ------------------
  |  Branch (1499:25): [True: 17.1k, False: 52.7k]
  |  Branch (1499:40): [True: 0, False: 52.7k]
  ------------------
 1500|  69.9k|        ps_cur_mb_info->u1_end_of_slice = u1_slice_end;
 1501|       |
 1502|  69.9k|        if(u1_decode_nmb)
  ------------------
  |  Branch (1502:12): [True: 17.1k, False: 52.7k]
  ------------------
 1503|  17.1k|        {
 1504|  17.1k|            ret = ps_dec->pf_mvpred_ref_tfr_nby2mb(ps_dec, u1_mb_idx, u1_num_mbs);
 1505|  17.1k|            u1_num_mbsNby2 = 0;
 1506|  17.1k|            ps_parse_mb_data = ps_dec->ps_parse_mb_data;
 1507|  17.1k|            ps_dec->ps_part = ps_dec->ps_parse_part_params;
 1508|  17.1k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  17.1k|#define OK        0
  ------------------
  |  Branch (1508:16): [True: 86, False: 17.0k]
  ------------------
 1509|  17.1k|        }
 1510|       |
 1511|  69.8k|        if(u1_decode_nmb)
  ------------------
  |  Branch (1511:12): [True: 17.0k, False: 52.7k]
  ------------------
 1512|  17.0k|        {
 1513|  17.0k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1513:16): [True: 10.4k, False: 6.61k]
  ------------------
 1514|  10.4k|            {
 1515|  10.4k|                ih264d_parse_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next, u1_tfr_n_mb,
 1516|  10.4k|                                     u1_end_of_row);
 1517|  10.4k|                ps_dec->ps_nmb_info += u1_num_mbs;
 1518|  10.4k|                ps_svc_lyr_dec->ps_svc_nmb_info += u1_num_mbs;
 1519|  10.4k|            }
 1520|  6.61k|            else
 1521|  6.61k|            {
 1522|  6.61k|                ret = isvcd_decode_recon_tfr_nmb_non_base_lyr(ps_svc_lyr_dec, u1_mb_idx, u1_num_mbs,
 1523|  6.61k|                                                              u1_num_mbs_next, u1_tfr_n_mb,
 1524|  6.61k|                                                              u1_end_of_row);
 1525|  6.61k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  6.61k|#define OK        0
  ------------------
  |  Branch (1525:20): [True: 0, False: 6.61k]
  ------------------
 1526|  6.61k|            }
 1527|  17.0k|            ps_dec->u4_total_mbs_coded += u1_num_mbs;
 1528|  17.0k|            if(u1_tfr_n_mb) u1_num_mbs = 0;
  ------------------
  |  Branch (1528:16): [True: 17.0k, False: 0]
  ------------------
 1529|  17.0k|            u1_mb_idx = u1_num_mbs;
 1530|  17.0k|            ps_dec->u4_mb_idx = u1_num_mbs;
 1531|  17.0k|        }
 1532|  69.8k|    }
 1533|       |
 1534|  1.48k|    ps_dec->u4_num_mbs_cur_nmb = 0;
 1535|  1.48k|    ps_dec->ps_cur_slice->u4_mbs_in_slice = i2_cur_mb_addr - (u2_first_mb_in_slice << u1_mbaff);
 1536|       |
 1537|  1.48k|    return ret;
 1538|  4.31k|}
isvcd_parse_inter_slice_data_cavlc_enh_lyr:
 1569|  15.1k|{
 1570|  15.1k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1571|  15.1k|    UWORD32 uc_more_data_flag;
 1572|  15.1k|    WORD32 i2_cur_mb_addr;
 1573|  15.1k|    UWORD32 u1_num_mbs, u1_num_mbsNby2, u1_mb_idx;
 1574|  15.1k|    UWORD32 i2_mb_skip_run;
 1575|  15.1k|    UWORD32 u1_read_mb_type;
 1576|       |
 1577|  15.1k|    UWORD32 u1_mbaff;
 1578|  15.1k|    UWORD32 u1_num_mbs_next, u1_end_of_row;
 1579|  15.1k|    const UWORD32 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
 1580|  15.1k|    UWORD32 u1_slice_end = 0;
 1581|  15.1k|    UWORD32 u1_tfr_n_mb = 0;
 1582|  15.1k|    UWORD32 u1_decode_nmb = 0;
 1583|       |
 1584|  15.1k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
 1585|  15.1k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1586|  15.1k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 1587|       |
 1588|  15.1k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1589|       |
 1590|  15.1k|    deblk_mb_t *ps_cur_deblk_mb;
 1591|  15.1k|    dec_mb_info_t *ps_cur_mb_info;
 1592|  15.1k|    dec_svc_mb_info_t *ps_svc_cur_mb_info;
 1593|       |
 1594|  15.1k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data;
 1595|  15.1k|    UWORD32 u1_inter_mb_type;
 1596|  15.1k|    UWORD32 u1_deblk_mb_type;
 1597|  15.1k|    UWORD32 u1_mb_threshold;
 1598|  15.1k|    WORD32 ret = OK;
  ------------------
  |  |  114|  15.1k|#define OK        0
  ------------------
 1599|       |
 1600|  15.1k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1601|       |
 1602|       |    /******************************************************/
 1603|       |    /* Initialisations specific to EB or EP slice           */
 1604|       |    /******************************************************/
 1605|       |
 1606|  15.1k|    if(ps_slice->u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  15.1k|#define P_SLICE  0
  ------------------
  |  Branch (1606:8): [True: 9.18k, False: 5.91k]
  ------------------
 1607|  9.18k|    {
 1608|  9.18k|        u1_inter_mb_type = P_MB;
  ------------------
  |  |  419|  9.18k|#define P_MB        2
  ------------------
 1609|  9.18k|        u1_deblk_mb_type = D_INTER_MB;
  ------------------
  |  |  381|  9.18k|#define D_INTER_MB        0
  ------------------
 1610|  9.18k|        u1_mb_threshold = 5;
 1611|  9.18k|    }
 1612|  5.91k|    else
 1613|  5.91k|    {
 1614|  5.91k|        u1_inter_mb_type = B_MB;
  ------------------
  |  |  420|  5.91k|#define B_MB        3
  ------------------
 1615|  5.91k|        u1_deblk_mb_type = D_B_SLICE;
  ------------------
  |  |  384|  5.91k|#define D_B_SLICE         4
  ------------------
 1616|  5.91k|        u1_mb_threshold = 23;
 1617|  5.91k|    }
 1618|       |
 1619|       |    /******************************************************/
 1620|       |    /* Slice Level Initialisations                        */
 1621|       |    /******************************************************/
 1622|  15.1k|    ps_dec->u1_qp = ps_slice->u1_slice_qp;
 1623|  15.1k|    ih264d_update_qp(ps_dec, 0);
 1624|  15.1k|    u1_mb_idx = ps_dec->u4_mb_idx;
 1625|  15.1k|    u1_num_mbs = u1_mb_idx;
 1626|  15.1k|    u1_num_mbsNby2 = 0;
 1627|  15.1k|    u1_mbaff = ps_slice->u1_mbaff_frame_flag;
 1628|  15.1k|    i2_cur_mb_addr = u2_first_mb_in_slice << u1_mbaff;
 1629|  15.1k|    i2_mb_skip_run = 0;
 1630|  15.1k|    uc_more_data_flag = 1;
 1631|  15.1k|    u1_read_mb_type = 0;
 1632|       |
 1633|   315k|    while(!u1_slice_end)
  ------------------
  |  Branch (1633:11): [True: 311k, False: 3.37k]
  ------------------
 1634|   311k|    {
 1635|   311k|        UWORD8 u1_mb_type;
 1636|       |
 1637|   311k|        ps_dec->pv_prev_mb_parse_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
 1638|       |
 1639|   311k|        if(i2_cur_mb_addr > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (1639:12): [True: 5.47k, False: 306k]
  ------------------
 1640|  5.47k|        {
 1641|  5.47k|            break;
 1642|  5.47k|        }
 1643|       |
 1644|   306k|        ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs;
 1645|   306k|        ps_svc_cur_mb_info = ps_svc_lyr_dec->ps_svc_nmb_info + u1_num_mbs;
 1646|   306k|        ps_dec->u4_num_mbs_cur_nmb = u1_num_mbs;
 1647|       |
 1648|   306k|        ps_cur_mb_info->u1_Mux = 0;
 1649|   306k|        ps_dec->u4_num_pmbair = (u1_num_mbs >> u1_mbaff);
 1650|   306k|        ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u1_num_mbs;
 1651|       |
 1652|   306k|        ps_cur_mb_info->u1_end_of_slice = 0;
 1653|       |
 1654|       |        /* Storing Default partition info */
 1655|   306k|        ps_parse_mb_data->u1_num_part = 1;
 1656|   306k|        ps_parse_mb_data->u4_isI_mb = 0;
 1657|       |
 1658|   306k|        if((!i2_mb_skip_run) && (!u1_read_mb_type))
  ------------------
  |  Branch (1658:12): [True: 227k, False: 78.8k]
  |  Branch (1658:33): [True: 206k, False: 21.4k]
  ------------------
 1659|   206k|        {
 1660|   206k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 1661|   206k|            UWORD32 u4_word, u4_ldz;
 1662|       |
 1663|       |            /***************************************************************/
 1664|       |            /* Find leading zeros in next 32 bits                          */
 1665|       |            /***************************************************************/
 1666|   206k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|   206k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|   206k|{                                                                           \
  |  |  152|   206k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|   206k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|   206k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|   206k|                                                                            \
  |  |  156|   206k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|   206k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 199k, False: 6.52k]
  |  |  ------------------
  |  |  158|   206k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|   199k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|   206k|}
  ------------------
 1667|       |
 1668|   206k|            u4_ldz = CLZ(u4_word);
 1669|       |
 1670|       |            /* Flush the ps_bitstrm */
 1671|   206k|            u4_bitstream_offset += (u4_ldz + 1);
 1672|       |            /* Read the suffix from the ps_bitstrm */
 1673|   206k|            u4_word = 0;
 1674|   206k|            if(u4_ldz)
  ------------------
  |  Branch (1674:16): [True: 25.6k, False: 180k]
  ------------------
 1675|  25.6k|            {
 1676|  25.6k|                GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  25.6k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  25.6k|{                                                                           \
  |  |  122|  25.6k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  25.6k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  25.6k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  25.6k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  25.6k|                                                                            \
  |  |  127|  25.6k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 24.0k, False: 1.67k]
  |  |  ------------------
  |  |  128|  25.6k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  24.0k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  25.6k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  25.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  25.6k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  25.6k|}                                                                           \
  ------------------
 1677|  25.6k|            }
 1678|   206k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
 1679|   206k|            i2_mb_skip_run = ((1 << u4_ldz) + u4_word - 1);
 1680|       |
 1681|   206k|            COPYTHECONTEXT("mb_skip_run", i2_mb_skip_run);
 1682|   206k|            uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
  ------------------
  |  |   97|   206k|    CHECK_BITS_SUFFICIENT(ps_bitstrm, 1)
  |  |  ------------------
  |  |  |  |   95|   206k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  ------------------
 1683|   206k|            u1_read_mb_type = uc_more_data_flag;
 1684|   206k|        }
 1685|       |
 1686|       |        /***************************************************************/
 1687|       |        /* Get the required information for decoding of MB             */
 1688|       |        /* mb_x, mb_y , neighbour availablity,                         */
 1689|       |        /***************************************************************/
 1690|   306k|        ps_dec->pf_get_mb_info(ps_dec, i2_cur_mb_addr, ps_cur_mb_info, i2_mb_skip_run);
 1691|   306k|        ps_svc_cur_mb_info->u1_crop_window_flag =
 1692|   306k|            *(ps_svc_lyr_dec->pu1_crop_wnd_flag + ps_cur_mb_info->u2_mbx +
 1693|   306k|              (ps_cur_mb_info->u2_mby * ps_dec->u2_frm_wd_in_mbs));
 1694|       |        /***************************************************************/
 1695|       |        /* Set the deblocking parameters for this MB                   */
 1696|       |        /***************************************************************/
 1697|   306k|        if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (1697:12): [True: 306k, False: 0]
  ------------------
 1698|   306k|            ih264d_set_deblocking_parameters(ps_cur_deblk_mb, ps_slice,
 1699|   306k|                                             ps_dec->u1_mb_ngbr_availablity,
 1700|   306k|                                             ps_dec->u1_cur_mb_fld_dec_flag);
 1701|       |
 1702|   306k|        if(i2_mb_skip_run)
  ------------------
  |  Branch (1702:12): [True: 104k, False: 201k]
  ------------------
 1703|   104k|        {
 1704|       |            /* Set appropriate flags in ps_cur_mb_info and ps_dec */
 1705|   104k|            ps_dec->i1_prev_mb_qp_delta = 0;
 1706|   104k|            ps_dec->u1_sub_mb_num = 0;
 1707|   104k|            ps_cur_mb_info->u1_mb_type = MB_SKIP;
  ------------------
  |  |   59|   104k|#define MB_SKIP 255
  ------------------
 1708|   104k|            ps_cur_mb_info->u1_mb_mc_mode = PRED_16x16;
  ------------------
  |  |  450|   104k|#define PRED_16x16  0
  ------------------
 1709|   104k|            ps_cur_mb_info->u1_cbp = 0;
 1710|   104k|            ps_svc_cur_mb_info->u1_base_mode_flag = 0;
 1711|   104k|            ps_svc_cur_mb_info->au1_motion_pred_flag[0] = 0;
 1712|   104k|            ps_svc_cur_mb_info->au1_motion_pred_flag[1] = 0;
 1713|   104k|            ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
 1714|       |
 1715|   104k|            {
 1716|       |                /* Storing Skip partition info */
 1717|   104k|                parse_part_params_t *ps_part_info = ps_dec->ps_part;
 1718|   104k|                ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  571|   104k|#define PART_DIRECT_16x16              2
  ------------------
 1719|   104k|                ps_part_info->u1_sub_mb_num = 0;
 1720|   104k|                ps_dec->ps_part++;
 1721|   104k|            }
 1722|       |
 1723|       |            /* Update Nnzs */
 1724|   104k|            ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|   104k|#define CAVLC  0
  ------------------
 1725|       |
 1726|   104k|            ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
 1727|   104k|            ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 1728|       |
 1729|   104k|            if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|   104k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1729:16): [True: 0, False: 104k]
  ------------------
 1730|      0|            {
 1731|      0|                ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|      0|#define MB_DISABLE_FILTERING          0x01
  ------------------
 1732|      0|            }
 1733|   104k|            i2_mb_skip_run--;
 1734|   104k|        }
 1735|   201k|        else
 1736|   201k|        {
 1737|   201k|            UWORD32 u4_word, u4_ldz, u4_temp;
 1738|       |
 1739|   201k|            ps_svc_cur_mb_info->u1_base_mode_flag = 0;
 1740|   201k|            if(ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (1740:16): [True: 200k, False: 1.41k]
  ------------------
 1741|   200k|               ps_svc_slice_params->u1_adaptive_base_mode_flag)
  ------------------
  |  Branch (1741:16): [True: 108k, False: 91.6k]
  ------------------
 1742|   108k|            {
 1743|   108k|                ps_svc_cur_mb_info->u1_base_mode_flag = ih264d_get_bit_h264(ps_bitstrm);
 1744|   108k|                COPYTHECONTEXT("SVC :u1_base_mode_flag", ps_cur_mb_info->u1_base_mode_flag);
 1745|   108k|            }
 1746|  93.0k|            else if(ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1746:21): [True: 91.6k, False: 1.41k]
  ------------------
 1747|  91.6k|            {
 1748|  91.6k|                ps_svc_cur_mb_info->u1_base_mode_flag =
 1749|  91.6k|                    ps_svc_slice_params->u1_default_base_mode_flag;
 1750|  91.6k|            }
 1751|       |
 1752|   201k|            if(!ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (1752:16): [True: 53.5k, False: 148k]
  ------------------
 1753|  53.5k|            {
 1754|  53.5k|                UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 1755|       |
 1756|  53.5k|                u1_read_mb_type = 0;
 1757|       |                /**************************************************************/
 1758|       |                /* Macroblock Layer Begins, Decode the u1_mb_type              */
 1759|       |                /**************************************************************/
 1760|  53.5k|                {
 1761|       |                    /***************************************************************/
 1762|       |                    /* Find leading zeros in next 32 bits                          */
 1763|       |                    /***************************************************************/
 1764|  53.5k|                    NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  53.5k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  53.5k|{                                                                           \
  |  |  152|  53.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  53.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  53.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  53.5k|                                                                            \
  |  |  156|  53.5k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  53.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 51.5k, False: 1.96k]
  |  |  ------------------
  |  |  158|  53.5k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  51.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  53.5k|}
  ------------------
 1765|  53.5k|                    u4_ldz = CLZ(u4_word);
 1766|       |                    /* Flush the ps_bitstrm */
 1767|  53.5k|                    u4_bitstream_offset += (u4_ldz + 1);
 1768|       |                    /* Read the suffix from the ps_bitstrm */
 1769|  53.5k|                    u4_word = 0;
 1770|  53.5k|                    if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  28.5k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  28.5k|{                                                                           \
  |  |  122|  28.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  28.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  28.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  28.5k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  28.5k|                                                                            \
  |  |  127|  28.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 27.6k, False: 977]
  |  |  ------------------
  |  |  128|  28.5k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  27.6k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  28.5k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  28.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  28.5k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  28.5k|}                                                                           \
  ------------------
  |  Branch (1770:24): [True: 28.5k, False: 24.9k]
  ------------------
 1771|  53.5k|                    *pu4_bitstrm_ofst = u4_bitstream_offset;
 1772|  53.5k|                    u4_temp = ((1 << u4_ldz) + u4_word - 1);
 1773|       |
 1774|  53.5k|                    if(u4_temp > (UWORD32) (25 + u1_mb_threshold)) return ERROR_MB_TYPE;
  ------------------
  |  Branch (1774:24): [True: 417, False: 53.0k]
  ------------------
 1775|  53.0k|                    u1_mb_type = u4_temp;
 1776|  53.0k|                    COPYTHECONTEXT("u1_mb_type", u1_mb_type);
 1777|  53.0k|                }
 1778|      0|                ps_cur_mb_info->u1_mb_type = u1_mb_type;
 1779|  53.0k|            }
 1780|   148k|            else
 1781|   148k|            {
 1782|       |                /* default intialization for Base mode flag : reserved */
 1783|   148k|                ps_dec->ps_part += MAX_NUM_MB_PART;
  ------------------
  |  |   62|   148k|#define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   59|   148k|#define NUM_MB_PARTS 4
  |  |  ------------------
  |  |               #define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   60|   148k|#define NUM_SUB_MB_PARTS 4
  |  |  ------------------
  ------------------
 1784|   148k|                u1_read_mb_type = 0;
 1785|   148k|                ps_svc_cur_mb_info->au1_motion_pred_flag[0] = 0;
 1786|   148k|                ps_svc_cur_mb_info->au1_motion_pred_flag[1] = 0;
 1787|   148k|                ps_cur_mb_info->u1_mb_type = MB_INFER;
  ------------------
  |  |  112|   148k|#define MB_INFER 250
  ------------------
 1788|   148k|                ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 1789|   148k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|   148k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1789:20): [True: 0, False: 148k]
  ------------------
 1790|      0|                {
 1791|      0|                    ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|      0|#define MB_DISABLE_FILTERING          0x01
  ------------------
 1792|      0|                }
 1793|       |
 1794|       |                /*SVC EXT needs to update incropwindow*/
 1795|   148k|                if(ps_svc_slice_params->u1_adaptive_residual_prediction_flag &&
  ------------------
  |  Branch (1795:20): [True: 21.4k, False: 126k]
  ------------------
 1796|  21.4k|                   ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1796:20): [True: 21.4k, False: 0]
  ------------------
 1797|  21.4k|                {
 1798|  21.4k|                    ps_svc_cur_mb_info->u1_residual_prediction_flag =
 1799|  21.4k|                        ih264d_get_bit_h264(ps_bitstrm);
 1800|  21.4k|                    COPYTHECONTEXT("SVC ext: u1_residual_prediction_flag",
 1801|  21.4k|                                   ps_cur_mb_info->u1_residual_prediction_flag);
 1802|  21.4k|                }
 1803|   126k|                else
 1804|   126k|                {
 1805|       |                    /*residual flag inference code */
 1806|   126k|                    if(1 == ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (1806:24): [True: 126k, False: 0]
  ------------------
 1807|   126k|                    {
 1808|   126k|                        ps_svc_cur_mb_info->u1_residual_prediction_flag =
 1809|   126k|                            ps_svc_slice_params->u1_default_residual_prediction_flag;
 1810|   126k|                    }
 1811|      0|                    else
 1812|      0|                    {
 1813|      0|                        ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
 1814|      0|                    }
 1815|   126k|                }
 1816|   148k|            }
 1817|       |
 1818|       |            /**************************************************************/
 1819|       |            /* Parse Macroblock data                                      */
 1820|       |            /**************************************************************/
 1821|   201k|            u1_mb_type = ps_cur_mb_info->u1_mb_type;
 1822|   201k|            if(u1_mb_type < u1_mb_threshold)
  ------------------
  |  Branch (1822:16): [True: 51.1k, False: 150k]
  ------------------
 1823|  51.1k|            {
 1824|  51.1k|                ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
 1825|       |
 1826|  51.1k|                ret = ps_svc_lyr_dec->pf_parse_inter_mb_svc_ext(
 1827|  51.1k|                    ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info, u1_num_mbs, u1_num_mbsNby2);
 1828|  51.1k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  51.1k|#define OK        0
  ------------------
  |  Branch (1828:20): [True: 3.17k, False: 47.9k]
  ------------------
 1829|  47.9k|                ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 1830|       |
 1831|  47.9k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  47.9k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1831:20): [True: 0, False: 47.9k]
  ------------------
 1832|      0|                {
 1833|      0|                    ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|      0|#define MB_DISABLE_FILTERING          0x01
  ------------------
 1834|      0|                }
 1835|  47.9k|            }
 1836|   150k|            else
 1837|   150k|            {
 1838|       |                /* Storing Intra partition info */
 1839|   150k|                ps_parse_mb_data->u1_num_part = 0;
 1840|       |
 1841|   150k|                if((25 + u1_mb_threshold) == u1_mb_type)
  ------------------
  |  Branch (1841:20): [True: 69, False: 150k]
  ------------------
 1842|     69|                {
 1843|       |                    /* I_PCM_MB */
 1844|     69|                    ps_cur_mb_info->ps_curmb->u1_mb_type = I_PCM_MB;
  ------------------
  |  |  423|     69|#define I_PCM_MB    6
  ------------------
 1845|     69|                    ret = ih264d_parse_ipcm_mb(ps_dec, ps_cur_mb_info, u1_num_mbs);
 1846|     69|                    if(ret != OK) return ret;
  ------------------
  |  |  114|     69|#define OK        0
  ------------------
  |  Branch (1846:24): [True: 0, False: 69]
  ------------------
 1847|     69|                    ps_dec->u1_qp = 0;
 1848|     69|                    ps_cur_deblk_mb->u1_mb_type |= D_INTRA_MB;
  ------------------
  |  |  382|     69|#define D_INTRA_MB        1
  ------------------
 1849|     69|                }
 1850|   150k|                else
 1851|   150k|                {
 1852|   150k|                    ret =
 1853|   150k|                        isvcd_parse_imb_cavlc(ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info,
 1854|   150k|                                              u1_num_mbs, (UWORD8) (u1_mb_type - u1_mb_threshold));
 1855|   150k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|   150k|#define OK        0
  ------------------
  |  Branch (1855:24): [True: 2.46k, False: 147k]
  ------------------
 1856|       |
 1857|   147k|                    if(0 == ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (1857:24): [True: 1.17k, False: 146k]
  ------------------
 1858|  1.17k|                    {
 1859|  1.17k|                        ps_cur_deblk_mb->u1_mb_type |= D_INTRA_MB;
  ------------------
  |  |  382|  1.17k|#define D_INTRA_MB        1
  ------------------
 1860|  1.17k|                    }
 1861|   147k|                }
 1862|   147k|                ps_parse_mb_data->u4_isI_mb = !ps_svc_cur_mb_info->u1_base_mode_flag;
 1863|   147k|            }
 1864|   195k|            uc_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
  ------------------
  |  |   97|   195k|    CHECK_BITS_SUFFICIENT(ps_bitstrm, 1)
  |  |  ------------------
  |  |  |  |   95|   195k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  ------------------
 1865|   195k|        }
 1866|   300k|        ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
 1867|       |
 1868|   300k|        if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (1868:12): [True: 0, False: 300k]
  ------------------
 1869|      0|        {
 1870|      0|            ih264d_populate_mb_info_map(ps_dec, ps_cur_mb_info, ps_cur_mb_info->u2_mbx << 1,
 1871|      0|                                        ps_cur_mb_info->u2_mby << 1, ps_cur_deblk_mb->u1_mb_qp);
 1872|      0|        }
 1873|   300k|        if(u1_mbaff)
  ------------------
  |  Branch (1873:12): [True: 0, False: 300k]
  ------------------
 1874|      0|        {
 1875|      0|            ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
 1876|      0|            if(!uc_more_data_flag && !i2_mb_skip_run && (0 == (i2_cur_mb_addr & 1)))
  ------------------
  |  Branch (1876:16): [True: 0, False: 0]
  |  Branch (1876:38): [True: 0, False: 0]
  |  Branch (1876:57): [True: 0, False: 0]
  ------------------
 1877|      0|            {
 1878|      0|                return ERROR_EOB_FLUSHBITS_T;
 1879|      0|            }
 1880|      0|        }
 1881|       |        /**************************************************************/
 1882|       |        /* Get next Macroblock address                                */
 1883|       |        /**************************************************************/
 1884|   300k|        i2_cur_mb_addr++;
 1885|   300k|        u1_num_mbs++;
 1886|   300k|        u1_num_mbsNby2++;
 1887|   300k|        ps_parse_mb_data++;
 1888|       |
 1889|       |        /****************************************************************/
 1890|       |        /* Check for End Of Row and other flags that determine when to  */
 1891|       |        /* do DMA setup for N/2-Mb, Decode for N-Mb, and Transfer for   */
 1892|       |        /* N-Mb                                                         */
 1893|       |        /****************************************************************/
 1894|   300k|        u1_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
 1895|   300k|        u1_end_of_row = (!u1_num_mbs_next) && (!(u1_mbaff && (u1_num_mbs & 0x01)));
  ------------------
  |  Branch (1895:25): [True: 90.2k, False: 210k]
  |  Branch (1895:50): [True: 0, False: 90.2k]
  |  Branch (1895:62): [True: 0, False: 0]
  ------------------
 1896|   300k|        u1_slice_end = (!(uc_more_data_flag || i2_mb_skip_run));
  ------------------
  |  Branch (1896:27): [True: 258k, False: 41.7k]
  |  Branch (1896:48): [True: 38.2k, False: 3.49k]
  ------------------
 1897|   300k|        u1_tfr_n_mb = (u1_num_mbs == ps_dec->u4_recon_mb_grp) || u1_end_of_row || u1_slice_end;
  ------------------
  |  Branch (1897:23): [True: 90.1k, False: 210k]
  |  Branch (1897:66): [True: 124, False: 210k]
  |  Branch (1897:83): [True: 2.63k, False: 207k]
  ------------------
 1898|   300k|        u1_decode_nmb = u1_tfr_n_mb || u1_slice_end;
  ------------------
  |  Branch (1898:25): [True: 92.8k, False: 207k]
  |  Branch (1898:40): [True: 0, False: 207k]
  ------------------
 1899|   300k|        ps_cur_mb_info->u1_end_of_slice = u1_slice_end;
 1900|       |
 1901|   300k|        if(u1_decode_nmb)
  ------------------
  |  Branch (1901:12): [True: 92.8k, False: 207k]
  ------------------
 1902|  92.8k|        {
 1903|  92.8k|            ret = ps_dec->pf_mvpred_ref_tfr_nby2mb(ps_dec, u1_mb_idx, u1_num_mbs);
 1904|  92.8k|            u1_num_mbsNby2 = 0;
 1905|  92.8k|            ps_parse_mb_data = ps_dec->ps_parse_mb_data;
 1906|  92.8k|            ps_dec->ps_part = ps_dec->ps_parse_part_params;
 1907|  92.8k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  92.8k|#define OK        0
  ------------------
  |  Branch (1907:16): [True: 205, False: 92.6k]
  ------------------
 1908|  92.8k|        }
 1909|       |
 1910|   300k|        if(u1_decode_nmb)
  ------------------
  |  Branch (1910:12): [True: 92.6k, False: 207k]
  ------------------
 1911|  92.6k|        {
 1912|  92.6k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1912:16): [True: 64.6k, False: 27.9k]
  ------------------
 1913|  64.6k|            {
 1914|  64.6k|                ih264d_parse_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next, u1_tfr_n_mb,
 1915|  64.6k|                                     u1_end_of_row);
 1916|  64.6k|                ps_dec->ps_nmb_info += u1_num_mbs;
 1917|  64.6k|                ps_svc_lyr_dec->ps_svc_nmb_info += u1_num_mbs;
 1918|  64.6k|            }
 1919|  27.9k|            else
 1920|  27.9k|            {
 1921|  27.9k|                ret = isvcd_decode_recon_tfr_nmb_non_base_lyr(ps_svc_lyr_dec, u1_mb_idx, u1_num_mbs,
 1922|  27.9k|                                                              u1_num_mbs_next, u1_tfr_n_mb,
 1923|  27.9k|                                                              u1_end_of_row);
 1924|  27.9k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  27.9k|#define OK        0
  ------------------
  |  Branch (1924:20): [True: 0, False: 27.9k]
  ------------------
 1925|  27.9k|            }
 1926|  92.6k|            ps_dec->u4_total_mbs_coded += u1_num_mbs;
 1927|  92.6k|            if(u1_tfr_n_mb) u1_num_mbs = 0;
  ------------------
  |  Branch (1927:16): [True: 92.6k, False: 0]
  ------------------
 1928|  92.6k|            u1_mb_idx = u1_num_mbs;
 1929|  92.6k|            ps_dec->u4_mb_idx = u1_num_mbs;
 1930|  92.6k|        }
 1931|   300k|    }
 1932|       |
 1933|  8.84k|    ps_dec->u4_num_mbs_cur_nmb = 0;
 1934|  8.84k|    ps_dec->ps_cur_slice->u4_mbs_in_slice = i2_cur_mb_addr - (u2_first_mb_in_slice << u1_mbaff);
 1935|       |
 1936|  8.84k|    return ret;
 1937|  15.1k|}
isvcd_parse_pmb_cabac:
 1953|  14.9k|{
 1954|  14.9k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1955|  14.9k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1956|       |
 1957|  14.9k|    UWORD32 u1_num_mb_part;
 1958|  14.9k|    UWORD32 uc_sub_mb;
 1959|  14.9k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data + u4_num_mbsNby2;
 1960|  14.9k|    WORD8 *pi1_ref_idx = ps_parse_mb_data->i1_ref_idx[0];
 1961|  14.9k|    const UWORD8 *pu1_num_mb_part = (const UWORD8 *) gau1_ih264d_num_mb_part;
 1962|  14.9k|    const UWORD32 u1_mb_type = ps_cur_mb_info->u1_mb_type;
 1963|  14.9k|    UWORD8 *pu1_col_info = ps_parse_mb_data->u1_col_info;
 1964|  14.9k|    UWORD32 u1_mb_mc_mode = u1_mb_type;
 1965|  14.9k|    ctxt_inc_mb_info_t *p_curr_ctxt = ps_dec->ps_curr_ctxt_mb_info;
 1966|  14.9k|    decoding_envirnoment_t *ps_cab_env = &ps_dec->s_cab_dec_env;
 1967|  14.9k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1968|  14.9k|    UWORD32 u4_sub_mb_pack = 0;
 1969|  14.9k|    WORD32 ret;
 1970|       |
 1971|  14.9k|    UWORD8 u1_no_submb_part_size_lt8x8_flag = 1;
 1972|  14.9k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1973|       |
 1974|  14.9k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
 1975|  14.9k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
 1976|  14.9k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
 1977|  14.9k|    p_curr_ctxt->u1_mb_type = CAB_P;
  ------------------
  |  |  398|  14.9k|#define CAB_P             0x07 /* 0000 0111 */
  ------------------
 1978|  14.9k|    ps_cur_mb_info->u1_mb_mc_mode = u1_mb_type;
 1979|  14.9k|    uc_sub_mb = ((u1_mb_type == PRED_8x8) | (u1_mb_type == PRED_8x8R0));
  ------------------
  |  |  453|  14.9k|#define PRED_8x8    3
  ------------------
                  uc_sub_mb = ((u1_mb_type == PRED_8x8) | (u1_mb_type == PRED_8x8R0));
  ------------------
  |  |  454|  14.9k|#define PRED_8x8R0  4
  ------------------
 1980|       |
 1981|       |    /* Reading the subMB type */
 1982|  14.9k|    if(uc_sub_mb)
  ------------------
  |  Branch (1982:8): [True: 3.41k, False: 11.5k]
  ------------------
 1983|  3.41k|    {
 1984|  3.41k|        UWORD8 u1_colz = (PRED_8x8 << 6);
  ------------------
  |  |  453|  3.41k|#define PRED_8x8    3
  ------------------
 1985|  3.41k|        u1_mb_mc_mode = 0;
 1986|  3.41k|        {
 1987|  3.41k|            UWORD8 u1_sub_mb_mode;
 1988|  3.41k|            u1_sub_mb_mode =
 1989|  3.41k|                ih264d_parse_submb_type_cabac(0, ps_cab_env, ps_bitstrm, ps_dec->p_sub_mb_type_t);
 1990|  3.41k|            if(u1_sub_mb_mode > 3) return ERROR_SUB_MB_TYPE;
  ------------------
  |  Branch (1990:16): [True: 0, False: 3.41k]
  ------------------
 1991|       |
 1992|  3.41k|            u4_sub_mb_pack = (u4_sub_mb_pack << 8) | u1_sub_mb_mode;
 1993|       |            /* Storing collocated information */
 1994|  3.41k|            *pu1_col_info++ = u1_colz | ((UWORD8) (u1_sub_mb_mode << 4));
 1995|  3.41k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
 1996|       |            /* check if Motion compensation is done below 8x8 */
 1997|  3.41k|            if(u1_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  3.41k|#define P_L0_8x8    0
  ------------------
  |  Branch (1997:16): [True: 2.03k, False: 1.38k]
  ------------------
 1998|  2.03k|            {
 1999|  2.03k|                u1_no_submb_part_size_lt8x8_flag = 0;
 2000|  2.03k|            }
 2001|  3.41k|        }
 2002|      0|        {
 2003|  3.41k|            UWORD8 u1_sub_mb_mode;
 2004|  3.41k|            u1_sub_mb_mode =
 2005|  3.41k|                ih264d_parse_submb_type_cabac(0, ps_cab_env, ps_bitstrm, ps_dec->p_sub_mb_type_t);
 2006|  3.41k|            if(u1_sub_mb_mode > 3) return ERROR_SUB_MB_TYPE;
  ------------------
  |  Branch (2006:16): [True: 0, False: 3.41k]
  ------------------
 2007|       |
 2008|  3.41k|            u4_sub_mb_pack = (u4_sub_mb_pack << 8) | u1_sub_mb_mode;
 2009|       |            /* Storing collocated information */
 2010|  3.41k|            *pu1_col_info++ = u1_colz | ((UWORD8) (u1_sub_mb_mode << 4));
 2011|  3.41k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
 2012|       |            /* check if Motion compensation is done below 8x8 */
 2013|  3.41k|            if(u1_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  3.41k|#define P_L0_8x8    0
  ------------------
  |  Branch (2013:16): [True: 1.92k, False: 1.49k]
  ------------------
 2014|  1.92k|            {
 2015|  1.92k|                u1_no_submb_part_size_lt8x8_flag = 0;
 2016|  1.92k|            }
 2017|  3.41k|        }
 2018|      0|        {
 2019|  3.41k|            UWORD8 u1_sub_mb_mode;
 2020|  3.41k|            u1_sub_mb_mode =
 2021|  3.41k|                ih264d_parse_submb_type_cabac(0, ps_cab_env, ps_bitstrm, ps_dec->p_sub_mb_type_t);
 2022|  3.41k|            if(u1_sub_mb_mode > 3) return ERROR_SUB_MB_TYPE;
  ------------------
  |  Branch (2022:16): [True: 0, False: 3.41k]
  ------------------
 2023|       |
 2024|  3.41k|            u4_sub_mb_pack = (u4_sub_mb_pack << 8) | u1_sub_mb_mode;
 2025|       |            /* Storing collocated information */
 2026|  3.41k|            *pu1_col_info++ = u1_colz | ((UWORD8) (u1_sub_mb_mode << 4));
 2027|  3.41k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
 2028|       |            /* check if Motion compensation is done below 8x8 */
 2029|  3.41k|            if(u1_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  3.41k|#define P_L0_8x8    0
  ------------------
  |  Branch (2029:16): [True: 2.18k, False: 1.22k]
  ------------------
 2030|  2.18k|            {
 2031|  2.18k|                u1_no_submb_part_size_lt8x8_flag = 0;
 2032|  2.18k|            }
 2033|  3.41k|        }
 2034|      0|        {
 2035|  3.41k|            UWORD8 u1_sub_mb_mode;
 2036|  3.41k|            u1_sub_mb_mode =
 2037|  3.41k|                ih264d_parse_submb_type_cabac(0, ps_cab_env, ps_bitstrm, ps_dec->p_sub_mb_type_t);
 2038|  3.41k|            if(u1_sub_mb_mode > 3) return ERROR_SUB_MB_TYPE;
  ------------------
  |  Branch (2038:16): [True: 0, False: 3.41k]
  ------------------
 2039|       |
 2040|  3.41k|            u4_sub_mb_pack = (u4_sub_mb_pack << 8) | u1_sub_mb_mode;
 2041|       |            /* Storing collocated information */
 2042|  3.41k|            *pu1_col_info++ = u1_colz | ((UWORD8) (u1_sub_mb_mode << 4));
 2043|  3.41k|            COPYTHECONTEXT("sub_mb_type", u1_sub_mb_mode);
 2044|       |            /* check if Motion compensation is done below 8x8 */
 2045|  3.41k|            if(u1_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  3.41k|#define P_L0_8x8    0
  ------------------
  |  Branch (2045:16): [True: 2.14k, False: 1.27k]
  ------------------
 2046|  2.14k|            {
 2047|  2.14k|                u1_no_submb_part_size_lt8x8_flag = 0;
 2048|  2.14k|            }
 2049|  3.41k|        }
 2050|      0|        u1_num_mb_part = 4;
 2051|  3.41k|    }
 2052|  11.5k|    else
 2053|  11.5k|    {
 2054|  11.5k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_type];
 2055|       |        /* Storing collocated Mb and SubMb mode information */
 2056|  11.5k|        *pu1_col_info++ = (u1_mb_type << 6);
 2057|  11.5k|        if(u1_mb_type) *pu1_col_info++ = (u1_mb_type << 6);
  ------------------
  |  Branch (2057:12): [True: 2.00k, False: 9.52k]
  ------------------
 2058|  11.5k|    }
 2059|       |
 2060|       |    /*Adding code to get Motion Prediction Flags*/
 2061|  14.9k|    {
 2062|  14.9k|        UWORD8 uc_i;
 2063|  14.9k|        UWORD8 *pu1_motion_pred_flag_l0;
 2064|  14.9k|        UWORD8 u1_mvp_flag;
 2065|  14.9k|        WORD8 *pi1_top_ref_idx_ctx_inc_arr = p_curr_ctxt->i1_ref_idx;
 2066|  14.9k|        WORD8 *pi1_left_ref_idx_ctxt_inc = ps_dec->pi1_left_ref_idx_ctxt_inc;
 2067|  14.9k|        UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 2068|  14.9k|        UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
 2069|  14.9k|        UWORD8 uc_num_ref_idx_l0_active_minus1 =
 2070|  14.9k|            (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0] << (u1_mbaff & uc_field)) - 1;
 2071|  14.9k|        pu1_motion_pred_flag_l0 = &ps_svc_cur_mb_info->au1_motion_pred_flag[0];
 2072|  14.9k|        *pu1_motion_pred_flag_l0 = 0;
 2073|       |
 2074|  14.9k|        if(ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (2074:12): [True: 14.8k, False: 70]
  ------------------
 2075|  14.8k|           ps_svc_slice_params->u1_adaptive_motion_prediction_flag)
  ------------------
  |  Branch (2075:12): [True: 5.85k, False: 9.02k]
  ------------------
 2076|  5.85k|        {
 2077|  19.9k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (2077:27): [True: 14.0k, False: 5.85k]
  ------------------
 2078|  14.0k|            {
 2079|       |                /*usage of bins and ctxt check*/
 2080|  14.0k|                u1_mvp_flag = ih264d_decode_bin(0, ps_svc_lyr_dec->ps_motion_prediction_flag_l0,
 2081|  14.0k|                                                ps_bitstrm, ps_cab_env);
 2082|  14.0k|                COPYTHECONTEXT("SVC ext: ps_motion_prediction_flag_l0", u1_mvp_flag);
 2083|       |
 2084|  14.0k|                *pu1_motion_pred_flag_l0 |= (u1_mvp_flag << uc_i);
 2085|  14.0k|                if(u1_mvp_flag)
  ------------------
  |  Branch (2085:20): [True: 4.68k, False: 9.40k]
  ------------------
 2086|  4.68k|                {
 2087|  4.68k|                    pi1_ref_idx[uc_i] = -1;
 2088|  4.68k|                }
 2089|  14.0k|            }
 2090|  5.85k|        }
 2091|  9.09k|        else if(ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (2091:17): [True: 9.02k, False: 70]
  ------------------
 2092|  9.02k|        {
 2093|  9.02k|            *pu1_motion_pred_flag_l0 = ps_svc_slice_params->u1_default_motion_prediction_flag
  ------------------
  |  Branch (2093:40): [True: 555, False: 8.46k]
  ------------------
 2094|  9.02k|                                           ? ((1 << u1_num_mb_part) - 1)
 2095|  9.02k|                                           : 0;
 2096|  9.02k|            if(ps_svc_slice_params->u1_default_motion_prediction_flag)
  ------------------
  |  Branch (2096:16): [True: 555, False: 8.46k]
  ------------------
 2097|    555|            {
 2098|    555|                pi1_ref_idx[0] = -1;
 2099|    555|                pi1_ref_idx[1] = -1;
 2100|    555|                pi1_ref_idx[2] = -1;
 2101|    555|                pi1_ref_idx[3] = -1;
 2102|    555|            }
 2103|  9.02k|        }
 2104|       |
 2105|       |        /* Decoding reference index 0: For simple profile the following   */
 2106|       |        /* conditions are always true (mb_field_decoding_flag == 0);      */
 2107|       |        /* (MbPartPredMode != PredL1)                                     */
 2108|  14.9k|        if((uc_num_ref_idx_l0_active_minus1 > 0) & (u1_mb_type != PRED_8x8R0))
  ------------------
  |  |  454|  14.9k|#define PRED_8x8R0  4
  ------------------
  |  Branch (2108:12): [True: 745, False: 14.1k]
  ------------------
 2109|    745|        {
 2110|       |            /* force the routine to decode ref idx for each partition */
 2111|       |            /*SVC added motion_prediction_flag to force it to take it only for
 2112|       |             * !motion_pred_flag_l0*/
 2113|       |
 2114|    745|            ret = ih264d_parse_ref_idx_cabac(u1_num_mb_part, 0, uc_num_ref_idx_l0_active_minus1,
 2115|    745|                                             u1_mb_mc_mode, pi1_ref_idx, pi1_left_ref_idx_ctxt_inc,
 2116|    745|                                             pi1_top_ref_idx_ctx_inc_arr, ps_cab_env, ps_bitstrm,
 2117|    745|                                             ps_dec->p_ref_idx_t);
 2118|    745|            if(ret != OK)
  ------------------
  |  |  114|    745|#define OK        0
  ------------------
  |  Branch (2118:16): [True: 66, False: 679]
  ------------------
 2119|     66|            {
 2120|     66|                return ret;
 2121|     66|            }
 2122|    745|        }
 2123|  14.1k|        else
 2124|  14.1k|        {
 2125|       |            /* When there exists only a single frame to predict from */
 2126|  14.1k|            pi1_left_ref_idx_ctxt_inc[0] = 0;
 2127|  14.1k|            pi1_left_ref_idx_ctxt_inc[1] = 0;
 2128|  14.1k|            pi1_top_ref_idx_ctx_inc_arr[0] = 0;
 2129|  14.1k|            pi1_top_ref_idx_ctx_inc_arr[1] = 0;
 2130|  14.1k|            *((UWORD32 *) pi1_ref_idx) = 0;
 2131|  14.1k|        }
 2132|  14.9k|    }
 2133|       |
 2134|  14.8k|    {
 2135|  14.8k|        UWORD8 u1_p_idx;
 2136|  14.8k|        UWORD32 uc_i;
 2137|  14.8k|        parse_part_params_t *ps_part = ps_dec->ps_part;
 2138|  14.8k|        UWORD8 u1_sub_mb_mode, u1_num_subpart, u1_mb_part_width, u1_mb_part_height;
 2139|  14.8k|        UWORD32 u4_sub_mb_num;
 2140|  14.8k|        const UWORD8 *pu1_top_left_sub_mb_indx;
 2141|  14.8k|        mv_pred_t *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
 2142|  14.8k|        UWORD16 u2_sub_mb_num_pack = 0x028A;
 2143|       |
 2144|       |        /* Loading the table pointers */
 2145|  14.8k|        const UWORD8 *pu1_mb_partw = (const UWORD8 *) gau1_ih264d_mb_partw;
 2146|  14.8k|        const UWORD8 *pu1_mb_parth = (const UWORD8 *) gau1_ih264d_mb_parth;
 2147|  14.8k|        const UWORD8 *pu1_sub_mb_indx_mod =
 2148|  14.8k|            (const UWORD8 *) (gau1_ih264d_submb_indx_mod) + (uc_sub_mb * 6);
 2149|  14.8k|        const UWORD8 *pu1_sub_mb_partw = (const UWORD8 *) gau1_ih264d_submb_partw;
 2150|  14.8k|        const UWORD8 *pu1_sub_mb_parth = (const UWORD8 *) gau1_ih264d_submb_parth;
 2151|  14.8k|        const UWORD8 *pu1_num_sub_mb_part = (const UWORD8 *) gau1_ih264d_num_submb_part;
 2152|       |
 2153|       |        /*********************************************************/
 2154|       |        /* default initialisations for condition (uc_sub_mb == 0) */
 2155|       |        /* i.e. all are subpartitions of 8x8                     */
 2156|       |        /*********************************************************/
 2157|  14.8k|        u1_sub_mb_mode = 0;
 2158|  14.8k|        u1_num_subpart = 1;
 2159|  14.8k|        u1_mb_part_width = pu1_mb_partw[u1_mb_type];
 2160|  14.8k|        u1_mb_part_height = pu1_mb_parth[u1_mb_type];
 2161|  14.8k|        pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_type << 1);
 2162|  14.8k|        u4_sub_mb_num = 0;
 2163|       |
 2164|       |        /* Loop on number of partitions */
 2165|  41.9k|        for(uc_i = 0, u1_p_idx = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (2165:37): [True: 27.0k, False: 14.8k]
  ------------------
 2166|  27.0k|        {
 2167|  27.0k|            UWORD8 uc_j;
 2168|  27.0k|            if(uc_sub_mb)
  ------------------
  |  Branch (2168:16): [True: 13.6k, False: 13.4k]
  ------------------
 2169|  13.6k|            {
 2170|  13.6k|                u1_sub_mb_mode = u4_sub_mb_pack >> 24;
 2171|  13.6k|                u1_num_subpart = pu1_num_sub_mb_part[u1_sub_mb_mode];
 2172|  13.6k|                u1_mb_part_width = pu1_sub_mb_partw[u1_sub_mb_mode];
 2173|  13.6k|                u1_mb_part_height = pu1_sub_mb_parth[u1_sub_mb_mode];
 2174|  13.6k|                pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_sub_mb_mode << 1);
 2175|  13.6k|                u4_sub_mb_num = u2_sub_mb_num_pack >> 12;
 2176|  13.6k|                u4_sub_mb_pack <<= 8;
 2177|  13.6k|                u2_sub_mb_num_pack <<= 4;
 2178|  13.6k|            }
 2179|       |            /* Loop on Number of sub-partitions */
 2180|  65.1k|            for(uc_j = 0; uc_j < u1_num_subpart; uc_j++, pu1_top_left_sub_mb_indx++)
  ------------------
  |  Branch (2180:27): [True: 38.0k, False: 27.0k]
  ------------------
 2181|  38.0k|            {
 2182|  38.0k|                mv_pred_t *ps_mv;
 2183|  38.0k|                u4_sub_mb_num += *pu1_top_left_sub_mb_indx;
 2184|  38.0k|                ps_mv = ps_mv_start + u4_sub_mb_num;
 2185|       |
 2186|       |                /* Storing Info for partitions */
 2187|  38.0k|                ps_part->u1_is_direct = PART_NOT_DIRECT;
  ------------------
  |  |  569|  38.0k|#define PART_NOT_DIRECT                0
  ------------------
 2188|  38.0k|                ps_part->u1_sub_mb_num = u4_sub_mb_num;
 2189|  38.0k|                ps_part->u1_partheight = u1_mb_part_height;
 2190|  38.0k|                ps_part->u1_partwidth = u1_mb_part_width;
 2191|       |
 2192|       |                /* Increment partition Index */
 2193|  38.0k|                u1_p_idx++;
 2194|  38.0k|                ps_part++;
 2195|       |
 2196|  38.0k|                ih264d_get_mvd_cabac(u4_sub_mb_num, 0, u1_mb_part_width, u1_mb_part_height, 1,
 2197|  38.0k|                                     ps_dec, ps_mv);
 2198|  38.0k|            }
 2199|  27.0k|        }
 2200|  14.8k|        ps_parse_mb_data->u1_num_part = u1_p_idx;
 2201|  14.8k|        ps_dec->ps_part = ps_part;
 2202|  14.8k|    }
 2203|       |
 2204|       |    /* update incropwindow*/
 2205|  14.8k|    if(ps_svc_slice_params->u1_adaptive_residual_prediction_flag &&
  ------------------
  |  Branch (2205:8): [True: 1.18k, False: 13.6k]
  ------------------
 2206|  1.18k|       ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (2206:8): [True: 1.11k, False: 70]
  ------------------
 2207|  1.11k|    {
 2208|  1.11k|        ps_svc_cur_mb_info->u1_residual_prediction_flag = ih264d_decode_bin(
 2209|  1.11k|            1, ps_svc_lyr_dec->ps_residual_prediction_flag, ps_bitstrm, ps_cab_env);
 2210|  1.11k|        COPYTHECONTEXT("SVC ext: u1_residual_prediction_flag",
 2211|  1.11k|                       ps_cur_mb_info->u1_residual_prediction_flag);
 2212|  1.11k|    }
 2213|  13.7k|    else
 2214|  13.7k|    {
 2215|       |        /*residual flag inference code */
 2216|  13.7k|        if(1 == ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (2216:12): [True: 13.6k, False: 70]
  ------------------
 2217|  13.6k|        {
 2218|  13.6k|            ps_svc_cur_mb_info->u1_residual_prediction_flag =
 2219|  13.6k|                ps_svc_slice_params->u1_default_residual_prediction_flag;
 2220|  13.6k|        }
 2221|     70|        else
 2222|     70|        {
 2223|     70|            ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
 2224|     70|        }
 2225|  13.7k|    }
 2226|       |
 2227|  14.8k|    if(ps_svc_slice_params->u1_scan_idx_end >= ps_svc_slice_params->u1_scan_idx_start)
  ------------------
  |  Branch (2227:8): [True: 14.8k, False: 0]
  ------------------
 2228|  14.8k|    {
 2229|  14.8k|        UWORD8 u1_cbp;
 2230|       |        /* Read the Coded block pattern */
 2231|  14.8k|        u1_cbp = (WORD8) ih264d_parse_ctx_cbp_cabac(ps_dec);
 2232|  14.8k|        COPYTHECONTEXT("coded_block_pattern", u1_cbp);
 2233|  14.8k|        ps_cur_mb_info->u1_cbp = u1_cbp;
 2234|  14.8k|        p_curr_ctxt->u1_cbp = u1_cbp;
 2235|  14.8k|        p_curr_ctxt->u1_intra_chroma_pred_mode = 0;
 2236|  14.8k|        p_curr_ctxt->u1_yuv_dc_csbp &= 0xFE;
 2237|  14.8k|        ps_dec->pu1_left_yuv_dc_csbp[0] &= 0x6;
 2238|       |
 2239|  14.8k|        if(u1_cbp > 47) return ERROR_CBP;
  ------------------
  |  Branch (2239:12): [True: 0, False: 14.8k]
  ------------------
 2240|       |
 2241|  14.8k|        ps_cur_mb_info->u1_tran_form8x8 = 0;
 2242|  14.8k|        ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
 2243|       |
 2244|       |        /* Read the transform8x8 u4_flag if present */
 2245|  14.8k|        if((ps_dec->s_high_profile.u1_transform8x8_present) && (u1_cbp & 0xf) &&
  ------------------
  |  Branch (2245:12): [True: 12.1k, False: 2.72k]
  |  Branch (2245:64): [True: 9.60k, False: 2.55k]
  ------------------
 2246|  9.60k|           u1_no_submb_part_size_lt8x8_flag)
  ------------------
  |  Branch (2246:12): [True: 7.42k, False: 2.17k]
  ------------------
 2247|  7.42k|        {
 2248|  7.42k|            ps_cur_mb_info->u1_tran_form8x8 =
 2249|  7.42k|                ih264d_parse_transform8x8flag_cabac(ps_dec, ps_cur_mb_info);
 2250|  7.42k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
 2251|  7.42k|            p_curr_ctxt->u1_transform8x8_ctxt = ps_cur_mb_info->u1_tran_form8x8;
 2252|  7.42k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
 2253|  7.42k|        }
 2254|  7.45k|        else
 2255|  7.45k|        {
 2256|  7.45k|            p_curr_ctxt->u1_transform8x8_ctxt = 0;
 2257|  7.45k|        }
 2258|       |
 2259|       |        /* Read mb_qp_delta */
 2260|  14.8k|        if(u1_cbp)
  ------------------
  |  Branch (2260:12): [True: 11.0k, False: 3.80k]
  ------------------
 2261|  11.0k|        {
 2262|  11.0k|            WORD8 c_temp;
 2263|  11.0k|            ret = ih264d_parse_mb_qp_delta_cabac(ps_dec, &c_temp);
 2264|  11.0k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  11.0k|#define OK        0
  ------------------
  |  Branch (2264:16): [True: 148, False: 10.9k]
  ------------------
 2265|  10.9k|            COPYTHECONTEXT("mb_qp_delta", c_temp);
 2266|  10.9k|            if(c_temp != 0)
  ------------------
  |  Branch (2266:16): [True: 5.49k, False: 5.43k]
  ------------------
 2267|  5.49k|            {
 2268|  5.49k|                ret = ih264d_update_qp(ps_dec, c_temp);
 2269|  5.49k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  5.49k|#define OK        0
  ------------------
  |  Branch (2269:20): [True: 0, False: 5.49k]
  ------------------
 2270|  5.49k|            }
 2271|  10.9k|        }
 2272|  3.80k|        else
 2273|  3.80k|            ps_dec->i1_prev_mb_qp_delta = 0;
 2274|       |
 2275|       |        /*residual from start to end idx */
 2276|  14.7k|        ih264d_parse_residual4x4_cabac(ps_dec, ps_cur_mb_info, 0);
 2277|  14.7k|        if(EXCEED_OFFSET(ps_dec->ps_bitstrm)) return ERROR_EOB_TERMINATE_T;
  ------------------
  |  |   93|  14.7k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 695, False: 14.0k]
  |  |  ------------------
  ------------------
 2278|  14.7k|    }
 2279|  14.0k|    return OK;
  ------------------
  |  |  114|  14.0k|#define OK        0
  ------------------
 2280|  14.8k|}
isvcd_parse_pmb_cavlc:
 2296|  23.2k|{
 2297|  23.2k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 2298|  23.2k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 2299|  23.2k|    UWORD32 u1_num_mb_part;
 2300|  23.2k|    UWORD32 uc_sub_mb;
 2301|  23.2k|    dec_bit_stream_t *const ps_bitstrm = ps_dec->ps_bitstrm;
 2302|  23.2k|    UWORD32 *const pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 2303|  23.2k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 2304|  23.2k|    parse_pmbarams_t *ps_parse_mb_data = ps_dec->ps_parse_mb_data + u4_num_mbsNby2;
 2305|  23.2k|    WORD8 *pi1_ref_idx = ps_parse_mb_data->i1_ref_idx[0];
 2306|  23.2k|    const UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 2307|  23.2k|    const UWORD8 *pu1_num_mb_part = (const UWORD8 *) gau1_ih264d_num_mb_part;
 2308|  23.2k|    UWORD8 *pu1_col_info = ps_parse_mb_data->u1_col_info;
 2309|  23.2k|    UWORD32 u1_mb_type = ps_cur_mb_info->u1_mb_type;
 2310|  23.2k|    UWORD32 u4_sum_mb_mode_pack = 0;
 2311|  23.2k|    WORD32 ret;
 2312|  23.2k|    UWORD8 u1_no_submb_part_size_lt8x8_flag = 1;
 2313|       |
 2314|  23.2k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 2315|  23.2k|    ps_cur_mb_info->u1_tran_form8x8 = 0;
 2316|  23.2k|    ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = 0;
 2317|  23.2k|    ps_cur_mb_info->u1_yuv_dc_block_flag = 0;
 2318|  23.2k|    ps_cur_mb_info->u1_mb_mc_mode = u1_mb_type;
 2319|  23.2k|    uc_sub_mb = ((u1_mb_type == PRED_8x8) | (u1_mb_type == PRED_8x8R0));
  ------------------
  |  |  453|  23.2k|#define PRED_8x8    3
  ------------------
                  uc_sub_mb = ((u1_mb_type == PRED_8x8) | (u1_mb_type == PRED_8x8R0));
  ------------------
  |  |  454|  23.2k|#define PRED_8x8R0  4
  ------------------
 2320|       |
 2321|       |    /* Reading the subMB type */
 2322|  23.2k|    if(uc_sub_mb)
  ------------------
  |  Branch (2322:8): [True: 1.91k, False: 21.3k]
  ------------------
 2323|  1.91k|    {
 2324|  1.91k|        WORD32 i;
 2325|  1.91k|        UWORD8 u1_colz = (PRED_8x8 << 6);
  ------------------
  |  |  453|  1.91k|#define PRED_8x8    3
  ------------------
 2326|       |
 2327|  8.88k|        for(i = 0; i < 4; i++)
  ------------------
  |  Branch (2327:20): [True: 7.18k, False: 1.70k]
  ------------------
 2328|  7.18k|        {
 2329|  7.18k|            UWORD32 ui_sub_mb_mode;
 2330|       |
 2331|       |            // Inlined ih264d_uev
 2332|  7.18k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 2333|  7.18k|            UWORD32 u4_word, u4_ldz;
 2334|       |
 2335|       |            /***************************************************************/
 2336|       |            /* Find leading zeros in next 32 bits                          */
 2337|       |            /***************************************************************/
 2338|  7.18k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  7.18k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  7.18k|{                                                                           \
  |  |  152|  7.18k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  7.18k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  7.18k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  7.18k|                                                                            \
  |  |  156|  7.18k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  7.18k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 6.41k, False: 766]
  |  |  ------------------
  |  |  158|  7.18k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  6.41k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  7.18k|}
  ------------------
 2339|  7.18k|            u4_ldz = CLZ(u4_word);
 2340|       |            /* Flush the ps_bitstrm */
 2341|  7.18k|            u4_bitstream_offset += (u4_ldz + 1);
 2342|       |            /* Read the suffix from the ps_bitstrm */
 2343|  7.18k|            u4_word = 0;
 2344|  7.18k|            if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  2.96k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  2.96k|{                                                                           \
  |  |  122|  2.96k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  2.96k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  2.96k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  2.96k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  2.96k|                                                                            \
  |  |  127|  2.96k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 2.31k, False: 652]
  |  |  ------------------
  |  |  128|  2.96k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  2.31k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  2.96k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  2.96k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  2.96k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  2.96k|}                                                                           \
  ------------------
  |  Branch (2344:16): [True: 2.96k, False: 4.22k]
  ------------------
 2345|  7.18k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
 2346|  7.18k|            ui_sub_mb_mode = ((1 << u4_ldz) + u4_word - 1);
 2347|       |            // Inlined ih264d_uev
 2348|       |
 2349|  7.18k|            if(ui_sub_mb_mode > 3)
  ------------------
  |  Branch (2349:16): [True: 216, False: 6.96k]
  ------------------
 2350|    216|            {
 2351|    216|                return ERROR_SUB_MB_TYPE;
 2352|    216|            }
 2353|  6.96k|            else
 2354|  6.96k|            {
 2355|  6.96k|                u4_sum_mb_mode_pack = (u4_sum_mb_mode_pack << 8) | ui_sub_mb_mode;
 2356|       |                /* Storing collocated information */
 2357|  6.96k|                *pu1_col_info++ = u1_colz | (UWORD8) (ui_sub_mb_mode << 4);
 2358|       |
 2359|  6.96k|                COPYTHECONTEXT("sub_mb_type", ui_sub_mb_mode);
 2360|  6.96k|            }
 2361|       |
 2362|       |            /* check if Motion compensation is done below 8x8 */
 2363|  6.96k|            if(ui_sub_mb_mode != P_L0_8x8)
  ------------------
  |  |  459|  6.96k|#define P_L0_8x8    0
  ------------------
  |  Branch (2363:16): [True: 2.74k, False: 4.22k]
  ------------------
 2364|  2.74k|            {
 2365|  2.74k|                u1_no_submb_part_size_lt8x8_flag = 0;
 2366|  2.74k|            }
 2367|  6.96k|        }
 2368|  1.70k|        u1_num_mb_part = 4;
 2369|  1.70k|    }
 2370|  21.3k|    else
 2371|  21.3k|    {
 2372|  21.3k|        *pu1_col_info++ = (u1_mb_type << 6);
 2373|  21.3k|        if(u1_mb_type) *pu1_col_info++ = (u1_mb_type << 6);
  ------------------
  |  Branch (2373:12): [True: 8.02k, False: 13.2k]
  ------------------
 2374|  21.3k|        u1_num_mb_part = pu1_num_mb_part[u1_mb_type];
 2375|  21.3k|    }
 2376|       |
 2377|       |    /*Adding code to get Motion Prediction Flags*/
 2378|  23.0k|    {
 2379|       |        /*free the scratch buffer once used*/
 2380|  23.0k|        UWORD8 uc_i;
 2381|  23.0k|        UWORD8 *pu1_motion_pred_flag_l0;
 2382|  23.0k|        UWORD8 u1_mvp_flag;
 2383|  23.0k|        UWORD8 uc_field = ps_cur_mb_info->u1_mb_field_decodingflag;
 2384|  23.0k|        UWORD8 uc_num_ref_idx_l0_active_minus1 =
 2385|  23.0k|            (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0] << (u1_mbaff & uc_field)) - 1;
 2386|       |
 2387|  23.0k|        pu1_motion_pred_flag_l0 = &ps_svc_cur_mb_info->au1_motion_pred_flag[0];
 2388|  23.0k|        *pu1_motion_pred_flag_l0 = 0;
 2389|  23.0k|        if(ps_svc_cur_mb_info->u1_crop_window_flag &&
  ------------------
  |  Branch (2389:12): [True: 22.4k, False: 590]
  ------------------
 2390|  22.4k|           ps_svc_slice_params->u1_adaptive_motion_prediction_flag)
  ------------------
  |  Branch (2390:12): [True: 7.87k, False: 14.5k]
  ------------------
 2391|  7.87k|        {
 2392|  22.7k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (2392:27): [True: 14.8k, False: 7.87k]
  ------------------
 2393|  14.8k|            {
 2394|       |                /*usage of bins and ctxt check*/
 2395|  14.8k|                u1_mvp_flag = ih264d_get_bit_h264(ps_bitstrm);
 2396|  14.8k|                COPYTHECONTEXT("SVC ext: ps_motion_prediction_flag_l0", u1_mvp_flag);
 2397|       |
 2398|  14.8k|                *pu1_motion_pred_flag_l0 |= (u1_mvp_flag << uc_i);
 2399|  14.8k|            }
 2400|  7.87k|        }
 2401|  15.1k|        else if(ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (2401:17): [True: 14.5k, False: 590]
  ------------------
 2402|  14.5k|        {
 2403|  14.5k|            *pu1_motion_pred_flag_l0 = ps_svc_slice_params->u1_default_motion_prediction_flag
  ------------------
  |  Branch (2403:40): [True: 3.87k, False: 10.6k]
  ------------------
 2404|  14.5k|                                           ? ((1 << u1_num_mb_part) - 1)
 2405|  14.5k|                                           : 0;
 2406|  14.5k|        }
 2407|       |
 2408|       |        /* Decoding reference index 0: For simple profile the following   */
 2409|       |        /* conditions are always true (mb_field_decoding_flag == 0);      */
 2410|       |        /* (MbPartPredMode != PredL1)                                     */
 2411|  23.0k|        if((uc_num_ref_idx_l0_active_minus1 > 0) & (u1_mb_type != PRED_8x8R0))
  ------------------
  |  |  454|  23.0k|#define PRED_8x8R0  4
  ------------------
  |  Branch (2411:12): [True: 13.0k, False: 9.92k]
  ------------------
 2412|  13.0k|        {
 2413|  13.0k|            if(1 == uc_num_ref_idx_l0_active_minus1)
  ------------------
  |  Branch (2413:16): [True: 3.79k, False: 9.30k]
  ------------------
 2414|  3.79k|                isvcd_parse_pmb_ref_index_cavlc_range1(u1_num_mb_part, ps_bitstrm, pi1_ref_idx,
 2415|  3.79k|                                                       uc_num_ref_idx_l0_active_minus1,
 2416|  3.79k|                                                       pu1_motion_pred_flag_l0);
 2417|  9.30k|            else
 2418|  9.30k|            {
 2419|  9.30k|                ret = isvcd_parse_pmb_ref_index_cavlc(u1_num_mb_part, ps_bitstrm, pi1_ref_idx,
 2420|  9.30k|                                                      uc_num_ref_idx_l0_active_minus1,
 2421|  9.30k|                                                      pu1_motion_pred_flag_l0);
 2422|  9.30k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  9.30k|#define OK        0
  ------------------
  |  Branch (2422:20): [True: 115, False: 9.19k]
  ------------------
 2423|  9.30k|            }
 2424|  13.0k|        }
 2425|  9.92k|        else
 2426|  9.92k|        {
 2427|       |            /* When there exists only a single frame to predict from */
 2428|  9.92k|            UWORD32 uc_i;
 2429|  23.3k|            for(uc_i = 0; uc_i < u1_num_mb_part; uc_i++) /* Storing Reference Idx Information */
  ------------------
  |  Branch (2429:27): [True: 13.3k, False: 9.92k]
  ------------------
 2430|  13.3k|                pi1_ref_idx[uc_i] = 0;
 2431|  9.92k|        }
 2432|  23.0k|    }
 2433|       |
 2434|  22.9k|    {
 2435|  22.9k|        UWORD8 u1_p_idx;
 2436|  22.9k|        UWORD32 uc_i;
 2437|  22.9k|        parse_part_params_t *ps_part = ps_dec->ps_part;
 2438|  22.9k|        UWORD8 u1_sub_mb_mode, u1_num_subpart, u1_mb_part_width, u1_mb_part_height;
 2439|  22.9k|        UWORD32 u4_sub_mb_num;
 2440|  22.9k|        const UWORD8 *pu1_top_left_sub_mb_indx;
 2441|  22.9k|        mv_pred_t *ps_mv, *ps_mv_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
 2442|       |        /* Loading the table pointers */
 2443|  22.9k|        const UWORD8 *pu1_mb_partw = (const UWORD8 *) gau1_ih264d_mb_partw;
 2444|  22.9k|        const UWORD8 *pu1_mb_parth = (const UWORD8 *) gau1_ih264d_mb_parth;
 2445|  22.9k|        const UWORD8 *pu1_sub_mb_indx_mod =
 2446|  22.9k|            (const UWORD8 *) (gau1_ih264d_submb_indx_mod) + (uc_sub_mb * 6);
 2447|  22.9k|        const UWORD8 *pu1_sub_mb_partw = (const UWORD8 *) gau1_ih264d_submb_partw;
 2448|  22.9k|        const UWORD8 *pu1_sub_mb_parth = (const UWORD8 *) gau1_ih264d_submb_parth;
 2449|  22.9k|        const UWORD8 *pu1_num_sub_mb_part = (const UWORD8 *) gau1_ih264d_num_submb_part;
 2450|  22.9k|        UWORD16 u2_sub_mb_num = 0x028A;
 2451|       |
 2452|       |        /*********************************************************/
 2453|       |        /* default initialisations for condition (uc_sub_mb == 0) */
 2454|       |        /* i.e. all are subpartitions of 8x8                     */
 2455|       |        /*********************************************************/
 2456|  22.9k|        u1_sub_mb_mode = 0;
 2457|  22.9k|        u1_num_subpart = 1;
 2458|  22.9k|        u1_mb_part_width = pu1_mb_partw[u1_mb_type];
 2459|  22.9k|        u1_mb_part_height = pu1_mb_parth[u1_mb_type];
 2460|  22.9k|        pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_mb_type << 1);
 2461|  22.9k|        u4_sub_mb_num = 0;
 2462|       |
 2463|       |        /* Loop on number of partitions */
 2464|  58.8k|        for(uc_i = 0, u1_p_idx = 0; uc_i < u1_num_mb_part; uc_i++)
  ------------------
  |  Branch (2464:37): [True: 35.9k, False: 22.9k]
  ------------------
 2465|  35.9k|        {
 2466|  35.9k|            UWORD8 uc_j;
 2467|  35.9k|            if(uc_sub_mb)
  ------------------
  |  Branch (2467:16): [True: 6.80k, False: 29.1k]
  ------------------
 2468|  6.80k|            {
 2469|  6.80k|                u1_sub_mb_mode = u4_sum_mb_mode_pack >> 24;
 2470|  6.80k|                u1_num_subpart = pu1_num_sub_mb_part[u1_sub_mb_mode];
 2471|  6.80k|                u1_mb_part_width = pu1_sub_mb_partw[u1_sub_mb_mode];
 2472|  6.80k|                u1_mb_part_height = pu1_sub_mb_parth[u1_sub_mb_mode];
 2473|  6.80k|                pu1_top_left_sub_mb_indx = pu1_sub_mb_indx_mod + (u1_sub_mb_mode << 1);
 2474|  6.80k|                u4_sub_mb_num = u2_sub_mb_num >> 12;
 2475|  6.80k|                u4_sum_mb_mode_pack <<= 8;
 2476|  6.80k|                u2_sub_mb_num <<= 4;
 2477|  6.80k|            }
 2478|       |            /* Loop on Number of sub-partitions */
 2479|  76.4k|            for(uc_j = 0; uc_j < u1_num_subpart; uc_j++, pu1_top_left_sub_mb_indx++)
  ------------------
  |  Branch (2479:27): [True: 40.5k, False: 35.9k]
  ------------------
 2480|  40.5k|            {
 2481|  40.5k|                WORD16 i2_mvx, i2_mvy;
 2482|  40.5k|                u4_sub_mb_num += *pu1_top_left_sub_mb_indx;
 2483|  40.5k|                ps_mv = ps_mv_start + u4_sub_mb_num;
 2484|       |
 2485|       |                /* Reading the differential Mv from the bitstream */
 2486|       |                // inlining ih264d_sev
 2487|  40.5k|                {
 2488|  40.5k|                    UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 2489|  40.5k|                    UWORD32 u4_word, u4_ldz, u4_abs_val;
 2490|       |
 2491|       |                    /***************************************************************/
 2492|       |                    /* Find leading zeros in next 32 bits                          */
 2493|       |                    /***************************************************************/
 2494|  40.5k|                    NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  40.5k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  40.5k|{                                                                           \
  |  |  152|  40.5k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  40.5k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  40.5k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  40.5k|                                                                            \
  |  |  156|  40.5k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  40.5k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 38.8k, False: 1.64k]
  |  |  ------------------
  |  |  158|  40.5k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  38.8k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  40.5k|}
  ------------------
 2495|  40.5k|                    u4_ldz = CLZ(u4_word);
 2496|       |
 2497|       |                    /* Flush the ps_bitstrm */
 2498|  40.5k|                    u4_bitstream_offset += (u4_ldz + 1);
 2499|       |
 2500|       |                    /* Read the suffix from the ps_bitstrm */
 2501|  40.5k|                    u4_word = 0;
 2502|  40.5k|                    if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  20.3k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  20.3k|{                                                                           \
  |  |  122|  20.3k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  20.3k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  20.3k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  20.3k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  20.3k|                                                                            \
  |  |  127|  20.3k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 18.5k, False: 1.75k]
  |  |  ------------------
  |  |  128|  20.3k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  18.5k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  20.3k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  20.3k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  20.3k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  20.3k|}                                                                           \
  ------------------
  |  Branch (2502:24): [True: 20.3k, False: 20.2k]
  ------------------
 2503|       |
 2504|  40.5k|                    *pu4_bitstrm_ofst = u4_bitstream_offset;
 2505|  40.5k|                    u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
 2506|       |
 2507|  40.5k|                    if(u4_word & 0x1)
  ------------------
  |  Branch (2507:24): [True: 12.7k, False: 27.8k]
  ------------------
 2508|  12.7k|                        i2_mvx = (-(WORD32) u4_abs_val);
 2509|  27.8k|                    else
 2510|  27.8k|                        i2_mvx = (u4_abs_val);
 2511|  40.5k|                }
 2512|       |                // inlinined ih264d_sev
 2513|  40.5k|                COPYTHECONTEXT("MVD", i2_mvx);
 2514|  40.5k|                i2_mvy = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2515|  40.5k|                COPYTHECONTEXT("MVD", i2_mvy);
 2516|       |
 2517|       |                /* Storing Info for partitions */
 2518|  40.5k|                ps_part->u1_is_direct = PART_NOT_DIRECT;
  ------------------
  |  |  569|  40.5k|#define PART_NOT_DIRECT                0
  ------------------
 2519|  40.5k|                ps_part->u1_sub_mb_num = u4_sub_mb_num;
 2520|  40.5k|                ps_part->u1_partheight = u1_mb_part_height;
 2521|  40.5k|                ps_part->u1_partwidth = u1_mb_part_width;
 2522|       |
 2523|       |                /* Storing Mv residuals */
 2524|  40.5k|                ps_mv->i2_mv[0] = i2_mvx;
 2525|  40.5k|                ps_mv->i2_mv[1] = i2_mvy;
 2526|       |
 2527|       |                /* Increment partition Index */
 2528|  40.5k|                u1_p_idx++;
 2529|  40.5k|                ps_part++;
 2530|  40.5k|            }
 2531|  35.9k|        }
 2532|  22.9k|        ps_parse_mb_data->u1_num_part = u1_p_idx;
 2533|  22.9k|        ps_dec->ps_part = ps_part;
 2534|  22.9k|    }
 2535|       |
 2536|  22.9k|    if(ps_svc_slice_params->u1_adaptive_residual_prediction_flag &&
  ------------------
  |  Branch (2536:8): [True: 5.52k, False: 17.3k]
  ------------------
 2537|  5.52k|       ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (2537:8): [True: 4.93k, False: 590]
  ------------------
 2538|  4.93k|    {
 2539|  4.93k|        ps_svc_cur_mb_info->u1_residual_prediction_flag = ih264d_get_bit_h264(ps_bitstrm);
 2540|  4.93k|        COPYTHECONTEXT("SVC ext: u1_residual_prediction_flag",
 2541|  4.93k|                       ps_svc_cur_mb_info->u1_residual_prediction_flag);
 2542|  4.93k|    }
 2543|  17.9k|    else
 2544|  17.9k|    {
 2545|       |        /*residual flag inference code */
 2546|  17.9k|        if(1 == ps_svc_cur_mb_info->u1_crop_window_flag)
  ------------------
  |  Branch (2546:12): [True: 17.3k, False: 590]
  ------------------
 2547|  17.3k|        {
 2548|  17.3k|            ps_svc_cur_mb_info->u1_residual_prediction_flag =
 2549|  17.3k|                ps_svc_slice_params->u1_default_residual_prediction_flag;
 2550|  17.3k|        }
 2551|    590|        else
 2552|    590|        {
 2553|    590|            ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
 2554|    590|        }
 2555|  17.9k|    }
 2556|       |
 2557|  22.9k|    if(ps_svc_slice_params->u1_scan_idx_end >= ps_svc_slice_params->u1_scan_idx_start)
  ------------------
  |  Branch (2557:8): [True: 22.9k, False: 0]
  ------------------
 2558|  22.9k|    {
 2559|  22.9k|        UWORD32 u4_cbp;
 2560|       |        /* Read the Coded block pattern */
 2561|  22.9k|        UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 2562|  22.9k|        UWORD32 u4_word, u4_ldz;
 2563|       |
 2564|       |        /***************************************************************/
 2565|       |        /* Find leading zeros in next 32 bits                          */
 2566|       |        /***************************************************************/
 2567|  22.9k|        NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  22.9k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  22.9k|{                                                                           \
  |  |  152|  22.9k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  22.9k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  22.9k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  22.9k|                                                                            \
  |  |  156|  22.9k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  22.9k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 22.4k, False: 446]
  |  |  ------------------
  |  |  158|  22.9k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  22.4k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  22.9k|}
  ------------------
 2568|  22.9k|        u4_ldz = CLZ(u4_word);
 2569|       |        /* Flush the ps_bitstrm */
 2570|  22.9k|        u4_bitstream_offset += (u4_ldz + 1);
 2571|       |        /* Read the suffix from the ps_bitstrm */
 2572|  22.9k|        u4_word = 0;
 2573|  22.9k|        if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  7.69k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  7.69k|{                                                                           \
  |  |  122|  7.69k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  7.69k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  7.69k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  7.69k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  7.69k|                                                                            \
  |  |  127|  7.69k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 7.00k, False: 682]
  |  |  ------------------
  |  |  128|  7.69k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  7.00k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  7.69k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  7.69k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  7.69k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  7.69k|}                                                                           \
  ------------------
  |  Branch (2573:12): [True: 7.69k, False: 15.2k]
  ------------------
 2574|  22.9k|        *pu4_bitstrm_ofst = u4_bitstream_offset;
 2575|  22.9k|        u4_cbp = ((1 << u4_ldz) + u4_word - 1);
 2576|       |
 2577|  22.9k|        if(u4_cbp > 47) return ERROR_CBP;
  ------------------
  |  Branch (2577:12): [True: 554, False: 22.3k]
  ------------------
 2578|       |
 2579|  22.3k|        u4_cbp = *((UWORD8 *) gau1_ih264d_cbp_inter + u4_cbp);
 2580|  22.3k|        COPYTHECONTEXT("coded_block_pattern", u4_cbp);
 2581|  22.3k|        ps_cur_mb_info->u1_cbp = u4_cbp;
 2582|       |
 2583|       |        /* Read the transform8x8 u4_flag if present */
 2584|  22.3k|        if((ps_dec->s_high_profile.u1_transform8x8_present) && (u4_cbp & 0xf) &&
  ------------------
  |  Branch (2584:12): [True: 2.30k, False: 20.0k]
  |  Branch (2584:64): [True: 1.18k, False: 1.12k]
  ------------------
 2585|  1.18k|           u1_no_submb_part_size_lt8x8_flag)
  ------------------
  |  Branch (2585:12): [True: 1.11k, False: 73]
  ------------------
 2586|  1.11k|        {
 2587|  1.11k|            ps_cur_mb_info->u1_tran_form8x8 = ih264d_get_bit_h264(ps_bitstrm);
 2588|  1.11k|            COPYTHECONTEXT("transform_size_8x8_flag", ps_cur_mb_info->u1_tran_form8x8);
 2589|  1.11k|            ps_cur_mb_info->ps_curmb->u1_tran_form8x8 = ps_cur_mb_info->u1_tran_form8x8;
 2590|  1.11k|        }
 2591|       |
 2592|       |        /* Read mb_qp_delta */
 2593|  22.3k|        if(u4_cbp)
  ------------------
  |  Branch (2593:12): [True: 7.13k, False: 15.2k]
  ------------------
 2594|  7.13k|        {
 2595|  7.13k|            WORD32 i_temp;
 2596|  7.13k|            UWORD32 u4_bitstream_offset = *pu4_bitstrm_ofst;
 2597|  7.13k|            UWORD32 u4_word, u4_ldz, u4_abs_val;
 2598|       |
 2599|       |            /***************************************************************/
 2600|       |            /* Find leading zeros in next 32 bits                          */
 2601|       |            /***************************************************************/
 2602|  7.13k|            NEXTBITS_32(u4_word, u4_bitstream_offset, pu4_bitstrm_buf);
  ------------------
  |  |  150|  7.13k|#define     NEXTBITS_32(u4_word, u4_offset, pu4_bitstream)                  \
  |  |  151|  7.13k|{                                                                           \
  |  |  152|  7.13k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  153|  7.13k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  154|  7.13k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  155|  7.13k|                                                                            \
  |  |  156|  7.13k|    u4_word = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  157|  7.13k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (157:8): [True: 6.61k, False: 518]
  |  |  ------------------
  |  |  158|  7.13k|    u4_word |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));        \
  |  |  ------------------
  |  |  |  |   45|  6.61k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  159|  7.13k|}
  ------------------
 2603|  7.13k|            u4_ldz = CLZ(u4_word);
 2604|       |
 2605|       |            /* Flush the ps_bitstrm */
 2606|  7.13k|            u4_bitstream_offset += (u4_ldz + 1);
 2607|       |
 2608|       |            /* Read the suffix from the ps_bitstrm */
 2609|  7.13k|            u4_word = 0;
 2610|  7.13k|            if(u4_ldz) GETBITS(u4_word, u4_bitstream_offset, pu4_bitstrm_buf, u4_ldz);
  ------------------
  |  |  120|  4.21k|#define     GETBITS(u4_code, u4_offset, pu4_bitstream, u4_no_bits)          \
  |  |  121|  4.21k|{                                                                           \
  |  |  122|  4.21k|    UWORD32 *pu4_buf =  (pu4_bitstream);                                    \
  |  |  123|  4.21k|    UWORD32 u4_word_off = ((u4_offset) >> 5);                               \
  |  |  124|  4.21k|    UWORD32 u4_bit_off = (u4_offset) & 0x1F;                                \
  |  |  125|  4.21k|    u4_code = pu4_buf[u4_word_off++] << u4_bit_off;                         \
  |  |  126|  4.21k|                                                                            \
  |  |  127|  4.21k|    if(u4_bit_off)                                                          \
  |  |  ------------------
  |  |  |  Branch (127:8): [True: 3.73k, False: 474]
  |  |  ------------------
  |  |  128|  4.21k|        u4_code |= (pu4_buf[u4_word_off] >> (INT_IN_BITS - u4_bit_off));    \
  |  |  ------------------
  |  |  |  |   45|  3.73k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  129|  4.21k|    u4_code = u4_code >> (INT_IN_BITS - u4_no_bits);                        \
  |  |  ------------------
  |  |  |  |   45|  4.21k|#define INT_IN_BITS         32
  |  |  ------------------
  |  |  130|  4.21k|    (u4_offset) += u4_no_bits;                                              \
  |  |  131|  4.21k|}                                                                           \
  ------------------
  |  Branch (2610:16): [True: 4.21k, False: 2.92k]
  ------------------
 2611|       |
 2612|  7.13k|            *pu4_bitstrm_ofst = u4_bitstream_offset;
 2613|  7.13k|            u4_abs_val = ((1 << u4_ldz) + u4_word) >> 1;
 2614|       |
 2615|  7.13k|            if(u4_word & 0x1)
  ------------------
  |  Branch (2615:16): [True: 2.53k, False: 4.60k]
  ------------------
 2616|  2.53k|                i_temp = (-(WORD32) u4_abs_val);
 2617|  4.60k|            else
 2618|  4.60k|                i_temp = (u4_abs_val);
 2619|       |
 2620|  7.13k|            if((i_temp < -26) || (i_temp > 25)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  Branch (2620:16): [True: 102, False: 7.03k]
  |  Branch (2620:34): [True: 178, False: 6.85k]
  ------------------
 2621|       |            // inlinined ih264d_sev
 2622|       |
 2623|  6.85k|            COPYTHECONTEXT("mb_qp_delta", i_temp);
 2624|  6.85k|            if(i_temp)
  ------------------
  |  Branch (2624:16): [True: 3.93k, False: 2.92k]
  ------------------
 2625|  3.93k|            {
 2626|  3.93k|                ret = ih264d_update_qp(ps_dec, (WORD8) i_temp);
 2627|  3.93k|                if(ret != OK) return ret;
  ------------------
  |  |  114|  3.93k|#define OK        0
  ------------------
  |  Branch (2627:20): [True: 0, False: 3.93k]
  ------------------
 2628|  3.93k|            }
 2629|       |
 2630|       |            /*change to support start to end idx*/
 2631|  6.85k|            ret = ih264d_parse_residual4x4_cavlc(ps_dec, ps_cur_mb_info, 0);
 2632|  6.85k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  6.85k|#define OK        0
  ------------------
  |  Branch (2632:16): [True: 267, False: 6.58k]
  ------------------
 2633|  6.58k|            if(EXCEED_OFFSET(ps_bitstrm)) return ERROR_EOB_TERMINATE_T;
  ------------------
  |  |   93|  6.58k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 217, False: 6.37k]
  |  |  ------------------
  ------------------
 2634|  6.58k|        }
 2635|  15.2k|        else
 2636|  15.2k|        {
 2637|  15.2k|            ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|  15.2k|#define CAVLC  0
  ------------------
 2638|  15.2k|        }
 2639|  22.3k|    }
 2640|       |
 2641|  21.5k|    return OK;
  ------------------
  |  |  114|  21.5k|#define OK        0
  ------------------
 2642|  22.9k|}
isvcd_mark_err_slice_skip:
 2657|  97.0k|{
 2658|  97.0k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 2659|  97.0k|    WORD32 i2_cur_mb_addr;
 2660|  97.0k|    UWORD32 u1_num_mbs;
 2661|  97.0k|    UWORD32 u1_mb_idx = ps_dec->u4_mb_idx;
 2662|  97.0k|    UWORD32 i2_mb_skip_run;
 2663|  97.0k|    UWORD32 u1_num_mbs_next, u1_end_of_row;
 2664|  97.0k|    const UWORD32 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
 2665|  97.0k|    UWORD32 u1_slice_end;
 2666|  97.0k|    UWORD32 u1_tfr_n_mb;
 2667|  97.0k|    UWORD32 u1_decode_nmb;
 2668|  97.0k|    dec_slice_params_t *ps_slice = ps_dec->ps_cur_slice;
 2669|  97.0k|    deblk_mb_t *ps_cur_deblk_mb;
 2670|  97.0k|    dec_mb_info_t *ps_cur_mb_info;
 2671|  97.0k|    dec_svc_mb_info_t *ps_svc_cur_mb_info;
 2672|  97.0k|    parse_pmbarams_t *ps_parse_mb_data;
 2673|  97.0k|    UWORD32 u1_inter_mb_type;
 2674|  97.0k|    UWORD32 u1_deblk_mb_type;
 2675|  97.0k|    UWORD32 u1_mbaff;
 2676|  97.0k|    parse_part_params_t *ps_part_info;
 2677|  97.0k|    WORD32 ret;
 2678|  97.0k|    UNUSED(u1_is_idr_slice);
  ------------------
  |  |   45|  97.0k|#define UNUSED(x) ((void)(x))
  ------------------
 2679|       |
 2680|  97.0k|    ps_svc_lyr_dec->u1_error_in_cur_frame = 1;
 2681|  97.0k|    if(ps_dec->ps_dec_err_status->u1_err_flag & REJECT_CUR_PIC)
  ------------------
  |  |  601|  97.0k|#define REJECT_CUR_PIC    (0x01)
  ------------------
  |  Branch (2681:8): [True: 0, False: 97.0k]
  ------------------
 2682|      0|    {
 2683|      0|        ih264d_err_pic_dispbuf_mgr(ps_dec);
 2684|      0|        return 0;
 2685|      0|    }
 2686|       |
 2687|  97.0k|    if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag && (num_mb_skip & 1))
  ------------------
  |  Branch (2687:8): [True: 0, False: 97.0k]
  |  Branch (2687:53): [True: 0, False: 0]
  ------------------
 2688|      0|    {
 2689|      0|        num_mb_skip++;
 2690|      0|    }
 2691|  97.0k|    ps_dec->ps_dpb_cmds->u1_long_term_reference_flag = 0;
 2692|  97.0k|    if(prev_slice_err == 1)
  ------------------
  |  Branch (2692:8): [True: 51.3k, False: 45.6k]
  ------------------
 2693|  51.3k|    {
 2694|       |        /* first slice - missing/header corruption */
 2695|  51.3k|        ps_dec->ps_cur_slice->u2_frame_num = u2_frame_num;
 2696|  51.3k|        {
 2697|  51.3k|            WORD32 i, j, poc = 0;
 2698|  51.3k|            ps_dec->ps_cur_slice->u2_first_mb_in_slice = 0;
 2699|  51.3k|            ps_dec->pf_mvpred = ih264d_mvpred_nonmbaff;
 2700|  51.3k|            ps_dec->p_form_mb_part_info = ih264d_form_mb_part_info_bp;
 2701|  51.3k|            ps_dec->p_motion_compensate = ih264d_motion_compensate_bp;
 2702|       |
 2703|  51.3k|            if(ps_dec->ps_cur_pic != NULL)
  ------------------
  |  Branch (2703:16): [True: 51.3k, False: 0]
  ------------------
 2704|  51.3k|            {
 2705|  51.3k|                poc = ps_dec->ps_cur_pic->i4_poc;
 2706|  51.3k|                if(poc <= INT32_MAX - 2) poc += 2;
  ------------------
  |  Branch (2706:20): [True: 51.1k, False: 242]
  ------------------
 2707|  51.3k|            }
 2708|       |
 2709|  51.3k|            j = -1;
 2710|  84.9k|            for(i = 0; i < MAX_NUM_PIC_PARAMS; i++)
  ------------------
  |  |  524|  84.9k|#define MAX_NUM_PIC_PARAMS 256
  ------------------
  |  Branch (2710:24): [True: 84.9k, False: 0]
  ------------------
 2711|  84.9k|            {
 2712|  84.9k|                if(ps_dec->ps_pps[i].u1_is_valid == TRUE)
  ------------------
  |  |  591|  84.9k|#define TRUE    1
  ------------------
  |  Branch (2712:20): [True: 51.6k, False: 33.2k]
  ------------------
 2713|  51.6k|                {
 2714|  51.6k|                    if(ps_dec->ps_pps[i].ps_sps->u1_is_valid == TRUE)
  ------------------
  |  |  591|  51.6k|#define TRUE    1
  ------------------
  |  Branch (2714:24): [True: 51.3k, False: 249]
  ------------------
 2715|  51.3k|                    {
 2716|  51.3k|                        j = i;
 2717|  51.3k|                        break;
 2718|  51.3k|                    }
 2719|  51.6k|                }
 2720|  84.9k|            }
 2721|       |
 2722|       |            // if valid SPS PPS is not found return error
 2723|  51.3k|            if(j == -1)
  ------------------
  |  Branch (2723:16): [True: 0, False: 51.3k]
  ------------------
 2724|      0|            {
 2725|      0|                return ERROR_INV_SLICE_HDR_T;
 2726|      0|            }
 2727|       |
 2728|       |            /* call ih264d_start_of_pic only if it was not called earlier*/
 2729|  51.3k|            if(ps_dec->u4_pic_buf_got == 0)
  ------------------
  |  Branch (2729:16): [True: 0, False: 51.3k]
  ------------------
 2730|      0|            {
 2731|       |                // initialize slice params required by isvcd_start_of_pic to valid values
 2732|      0|                ps_dec->ps_cur_slice->u1_slice_type = P_SLICE;
  ------------------
  |  |  368|      0|#define P_SLICE  0
  ------------------
 2733|      0|                ps_dec->ps_cur_slice->u1_nal_ref_idc = 1;
 2734|      0|                ps_dec->ps_cur_slice->u1_nal_unit_type = 1;
 2735|      0|                ret = isvcd_start_of_pic(ps_svc_lyr_dec, poc, ps_cur_poc,
 2736|      0|                                         ps_dec->ps_cur_slice->u2_frame_num, &ps_dec->ps_pps[j]);
 2737|       |
 2738|      0|                if(ret != OK)
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (2738:20): [True: 0, False: 0]
  ------------------
 2739|      0|                {
 2740|      0|                    return ret;
 2741|      0|                }
 2742|       |                /*inter layer buffer intialization */
 2743|      0|                ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
 2744|      0|                    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start;
 2745|      0|                ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_cur_mb =
 2746|      0|                    ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_base;
 2747|      0|            }
 2748|       |
 2749|  51.3k|            ps_dec->ps_ref_pic_buf_lx[0][0]->u1_pic_buf_id = 0;
 2750|  51.3k|            ps_dec->u4_output_present = 0;
 2751|       |
 2752|  51.3k|            {
 2753|  51.3k|                ih264d_get_next_display_field(ps_dec, ps_dec->ps_out_buffer, &(ps_dec->s_disp_op));
 2754|       |                /* If error code is non-zero then there is no buffer available for
 2755|       |                display, hence avoid format conversion */
 2756|       |
 2757|  51.3k|                if(0 != ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (2757:20): [True: 47.9k, False: 3.47k]
  ------------------
 2758|  47.9k|                {
 2759|  47.9k|                    ps_dec->u4_output_present = 0;
 2760|  47.9k|                    ps_dec->u4_fmt_conv_cur_row = ps_dec->s_disp_frame_info.u4_y_ht;
 2761|  47.9k|                }
 2762|  3.47k|                else
 2763|  3.47k|                    ps_dec->u4_output_present = 1;
 2764|  51.3k|            }
 2765|       |
 2766|  51.3k|            if(ps_dec->u1_separate_parse == 1)
  ------------------
  |  Branch (2766:16): [True: 29.4k, False: 21.9k]
  ------------------
 2767|  29.4k|            {
 2768|       |#ifdef KEEP_THREADS_ACTIVE
 2769|       |                ret = ithread_mutex_lock(ps_dec->apv_proc_start_mutex[0]);
 2770|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 2771|       |
 2772|       |                ps_dec->ai4_process_start[0] = PROC_START;
 2773|       |                ret = ithread_cond_signal(ps_dec->apv_proc_start_condition[0]);
 2774|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 2775|       |
 2776|       |                ret = ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[0]);
 2777|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 2778|       |#endif
 2779|       |#ifdef KEEP_THREADS_ACTIVE
 2780|       |                if(ps_dec->u4_bs_deblk_thread_created)
 2781|       |                {
 2782|       |                    ret = ithread_mutex_lock(ps_dec->apv_proc_start_mutex[1]);
 2783|       |                    RETURN_IF((ret != IV_SUCCESS), ret);
 2784|       |
 2785|       |                    ps_dec->ai4_process_start[1] = PROC_START;
 2786|       |                    ret = ithread_cond_signal(ps_dec->apv_proc_start_condition[1]);
 2787|       |                    RETURN_IF((ret != IV_SUCCESS), ret);
 2788|       |
 2789|       |                    ret = ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[1]);
 2790|       |                    RETURN_IF((ret != IV_SUCCESS), ret);
 2791|       |                }
 2792|       |#endif
 2793|  29.4k|            }
 2794|  51.3k|        }
 2795|  51.3k|    }
 2796|  45.6k|    else
 2797|  45.6k|    {
 2798|       |        // Middle / last slice
 2799|  45.6k|        dec_slice_struct_t *ps_parse_cur_slice;
 2800|  45.6k|        ps_parse_cur_slice = ps_dec->ps_dec_slice_buf + ps_dec->u2_cur_slice_num;
 2801|       |
 2802|  45.6k|        if(ps_dec->u1_slice_header_done && ps_parse_cur_slice == ps_dec->ps_parse_cur_slice)
  ------------------
  |  Branch (2802:12): [True: 45.2k, False: 318]
  |  Branch (2802:44): [True: 45.2k, False: 0]
  ------------------
 2803|  45.2k|        {
 2804|       |            // Slice data corrupted
 2805|       |            // in the case of mbaff, conceal from the even mb.
 2806|  45.2k|            if((ps_dec->ps_cur_slice->u1_mbaff_frame_flag) && (ps_dec->u4_num_mbs_cur_nmb & 1))
  ------------------
  |  Branch (2806:16): [True: 0, False: 45.2k]
  |  Branch (2806:63): [True: 0, False: 0]
  ------------------
 2807|      0|            {
 2808|      0|                ps_dec->u4_num_mbs_cur_nmb = ps_dec->u4_num_mbs_cur_nmb - 1;
 2809|      0|                ps_dec->u4_cur_mb_addr--;
 2810|      0|            }
 2811|       |
 2812|  45.2k|            u1_num_mbs = ps_dec->u4_num_mbs_cur_nmb;
 2813|  45.2k|            if(u1_num_mbs)
  ------------------
  |  Branch (2813:16): [True: 10.4k, False: 34.8k]
  ------------------
 2814|  10.4k|            {
 2815|  10.4k|                ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs - 1;
 2816|  10.4k|            }
 2817|  34.8k|            else
 2818|  34.8k|            {
 2819|  34.8k|                if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2819:20): [True: 9.44k, False: 25.3k]
  ------------------
 2820|  9.44k|                {
 2821|  9.44k|                    ps_cur_mb_info = ps_dec->ps_nmb_info;
 2822|  9.44k|                }
 2823|  25.3k|                else
 2824|  25.3k|                {
 2825|  25.3k|                    ps_cur_mb_info = ps_dec->ps_nmb_info + ps_dec->u4_num_mbs_prev_nmb - 1;
 2826|  25.3k|                }
 2827|  34.8k|            }
 2828|       |
 2829|  45.2k|            ps_dec->u2_mby = ps_cur_mb_info->u2_mby;
 2830|  45.2k|            ps_dec->u2_mbx = ps_cur_mb_info->u2_mbx;
 2831|  45.2k|            ps_dec->u1_mb_ngbr_availablity = ps_cur_mb_info->u1_mb_ngbr_availablity;
 2832|       |
 2833|  45.2k|            if(u1_num_mbs)
  ------------------
  |  Branch (2833:16): [True: 10.4k, False: 34.8k]
  ------------------
 2834|  10.4k|            {
 2835|       |                // Going back 1 mb
 2836|  10.4k|                ps_dec->pv_parse_tu_coeff_data = ps_dec->pv_prev_mb_parse_tu_coeff_data;
 2837|  10.4k|                ps_dec->u4_cur_mb_addr--;
 2838|  10.4k|                ps_dec->i4_submb_ofst -= SUB_BLK_SIZE;
  ------------------
  |  |  562|  10.4k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  10.4k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  10.4k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
 2839|       |
 2840|       |                // Parse/decode N-MB left unparsed
 2841|  10.4k|                if(ps_dec->u1_pr_sl_type == P_SLICE || ps_dec->u1_pr_sl_type == B_SLICE)
  ------------------
  |  |  368|  20.9k|#define P_SLICE  0
  ------------------
                              if(ps_dec->u1_pr_sl_type == P_SLICE || ps_dec->u1_pr_sl_type == B_SLICE)
  ------------------
  |  |  369|  6.62k|#define B_SLICE  1
  ------------------
  |  Branch (2841:20): [True: 3.84k, False: 6.62k]
  |  Branch (2841:56): [True: 4.28k, False: 2.33k]
  ------------------
 2842|  8.13k|                {
 2843|  8.13k|                    if((ps_dec->i4_submb_ofst - ((WORD32) ((u1_num_mbs - u1_mb_idx) << 4))) < 0)
  ------------------
  |  Branch (2843:24): [True: 0, False: 8.13k]
  ------------------
 2844|      0|                    {
 2845|      0|                        ps_dec->i4_submb_ofst = ((u1_num_mbs - u1_mb_idx) << 4);
 2846|      0|                    }
 2847|       |
 2848|  8.13k|                    ret = ps_dec->pf_mvpred_ref_tfr_nby2mb(ps_dec, u1_mb_idx, u1_num_mbs);
 2849|  8.13k|                    ps_dec->ps_part = ps_dec->ps_parse_part_params;
 2850|  8.13k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  8.13k|#define OK        0
  ------------------
  |  Branch (2850:24): [True: 203, False: 7.92k]
  ------------------
 2851|  8.13k|                }
 2852|       |
 2853|  10.2k|                u1_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
 2854|  10.2k|                u1_end_of_row =
 2855|  10.2k|                    (!u1_num_mbs_next) &&
  ------------------
  |  Branch (2855:21): [True: 0, False: 10.2k]
  ------------------
 2856|      0|                    (!(ps_dec->ps_cur_slice->u1_mbaff_frame_flag && (u1_num_mbs & 0x01)));
  ------------------
  |  Branch (2856:24): [True: 0, False: 0]
  |  Branch (2856:69): [True: 0, False: 0]
  ------------------
 2857|  10.2k|                u1_slice_end = 1;
 2858|  10.2k|                u1_tfr_n_mb = 1;
 2859|  10.2k|                ps_cur_mb_info->u1_end_of_slice = u1_slice_end;
 2860|       |
 2861|  10.2k|                if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2861:20): [True: 5.42k, False: 4.83k]
  ------------------
 2862|  5.42k|                {
 2863|  5.42k|                    ih264d_parse_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next,
 2864|  5.42k|                                         u1_tfr_n_mb, u1_end_of_row);
 2865|  5.42k|                    ps_dec->ps_nmb_info += u1_num_mbs;
 2866|  5.42k|                    ps_svc_lyr_dec->ps_svc_nmb_info += u1_num_mbs;
 2867|  5.42k|                }
 2868|  4.83k|                else
 2869|  4.83k|                {
 2870|  4.83k|                    ih264d_decode_recon_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next,
 2871|  4.83k|                                                u1_tfr_n_mb, u1_end_of_row);
 2872|  4.83k|                }
 2873|  10.2k|                ps_dec->u4_total_mbs_coded += u1_num_mbs;
 2874|  10.2k|                ps_dec->u4_mb_idx = 0;
 2875|  10.2k|                ps_dec->u4_num_mbs_cur_nmb = 0;
 2876|  10.2k|            }
 2877|       |
 2878|  45.0k|            if(ps_dec->u4_total_mbs_coded >= ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs)
  ------------------
  |  Branch (2878:16): [True: 0, False: 45.0k]
  ------------------
 2879|      0|            {
 2880|      0|                ps_dec->u1_pic_decode_done = 1;
 2881|      0|                return 0;
 2882|      0|            }
 2883|       |
 2884|       |            /* Inserting new slice only if the current slice has atleast 1 MB*/
 2885|  45.0k|            if(ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice <
  ------------------
  |  Branch (2885:16): [True: 44.8k, False: 216]
  ------------------
 2886|  45.0k|               (UWORD32) (ps_dec->u4_total_mbs_coded >> ps_slice->u1_mbaff_frame_flag))
 2887|  44.8k|            {
 2888|  44.8k|                ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
 2889|  44.8k|                ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;
 2890|  44.8k|                ps_dec->u2_cur_slice_num++;
 2891|  44.8k|                ps_dec->ps_parse_cur_slice++;
 2892|  44.8k|            }
 2893|  45.0k|        }
 2894|    318|        else
 2895|    318|        {
 2896|       |            // Slice missing / header corrupted
 2897|    318|            ps_dec->ps_parse_cur_slice = ps_dec->ps_dec_slice_buf + ps_dec->u2_cur_slice_num;
 2898|    318|        }
 2899|  45.6k|    }
 2900|       |
 2901|       |    /******************************************************/
 2902|       |    /* Initializations to new slice                       */
 2903|       |    /******************************************************/
 2904|  96.8k|    {
 2905|  96.8k|        WORD32 num_entries;
 2906|  96.8k|        WORD32 size;
 2907|  96.8k|        UWORD8 *pu1_buf;
 2908|       |
 2909|  96.8k|        num_entries = MAX_FRAMES;
  ------------------
  |  |  600|  96.8k|#define MAX_FRAMES              16
  ------------------
 2910|  96.8k|        if((1 >= ps_dec->ps_cur_sps->u1_num_ref_frames) && (0 == ps_dec->i4_display_delay))
  ------------------
  |  Branch (2910:12): [True: 70.2k, False: 26.5k]
  |  Branch (2910:60): [True: 0, False: 70.2k]
  ------------------
 2911|      0|        {
 2912|      0|            num_entries = 1;
 2913|      0|        }
 2914|  96.8k|        num_entries = ((2 * num_entries) + 1);
 2915|  96.8k|        num_entries *= 2;
 2916|       |
 2917|  96.8k|        size = num_entries * sizeof(void *);
 2918|  96.8k|        size += PAD_MAP_IDX_POC * sizeof(void *);
  ------------------
  |  |  100|  96.8k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 2919|       |
 2920|  96.8k|        pu1_buf = (UWORD8 *) ps_dec->pv_map_ref_idx_to_poc_buf;
 2921|  96.8k|        pu1_buf += size * ps_dec->u2_cur_slice_num;
 2922|  96.8k|        ps_dec->ps_parse_cur_slice->ppv_map_ref_idx_to_poc = (volatile void **) pu1_buf;
 2923|  96.8k|    }
 2924|  96.8k|    u1_mbaff = ps_slice->u1_mbaff_frame_flag;
 2925|  96.8k|    ps_dec->ps_cur_slice->u2_first_mb_in_slice = ps_dec->u4_total_mbs_coded >> u1_mbaff;
 2926|  96.8k|    ps_dec->ps_cur_slice->i1_slice_alpha_c0_offset = 0;
 2927|  96.8k|    ps_dec->ps_cur_slice->i1_slice_beta_offset = 0;
 2928|       |
 2929|  96.8k|    if(ps_dec->ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (2929:8): [True: 0, False: 96.8k]
  ------------------
 2930|      0|        ps_dec->u2_prv_frame_num = ps_dec->ps_cur_slice->u2_frame_num;
 2931|       |
 2932|  96.8k|    ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice = ps_dec->u4_total_mbs_coded >> u1_mbaff;
 2933|  96.8k|    ps_dec->ps_parse_cur_slice->u2_log2Y_crwd = ps_dec->ps_cur_slice->u2_log2Y_crwd;
 2934|       |
 2935|  96.8k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2935:8): [True: 44.4k, False: 52.3k]
  ------------------
 2936|  44.4k|    {
 2937|  44.4k|        ps_dec->ps_parse_cur_slice->pv_tu_coeff_data_start = ps_dec->pv_parse_tu_coeff_data;
 2938|  44.4k|    }
 2939|  52.3k|    else
 2940|  52.3k|    {
 2941|  52.3k|        ps_dec->pv_proc_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
 2942|  52.3k|    }
 2943|       |
 2944|       |    /******************************************************/
 2945|       |    /* Initializations specific to P slice                */
 2946|       |    /******************************************************/
 2947|  96.8k|    u1_inter_mb_type = P_MB;
  ------------------
  |  |  419|  96.8k|#define P_MB        2
  ------------------
 2948|  96.8k|    u1_deblk_mb_type = D_INTER_MB;
  ------------------
  |  |  381|  96.8k|#define D_INTER_MB        0
  ------------------
 2949|       |
 2950|  96.8k|    ps_dec->ps_cur_slice->u1_slice_type = P_SLICE;
  ------------------
  |  |  368|  96.8k|#define P_SLICE  0
  ------------------
 2951|  96.8k|    ps_dec->ps_parse_cur_slice->slice_type = P_SLICE;
  ------------------
  |  |  368|  96.8k|#define P_SLICE  0
  ------------------
 2952|  96.8k|    ps_dec->pf_mvpred_ref_tfr_nby2mb = ih264d_mv_pred_ref_tfr_nby2_pmb;
 2953|  96.8k|    ps_dec->ps_part = ps_dec->ps_parse_part_params;
 2954|  96.8k|    ps_dec->u2_mbx =
 2955|  96.8k|        (MOD(ps_dec->ps_cur_slice->u2_first_mb_in_slice - 1, ps_dec->u2_frm_wd_in_mbs));
  ------------------
  |  |   64|  96.8k|#define MOD(x,y) ((x)%(y))
  ------------------
 2956|  96.8k|    ps_dec->u2_mby =
 2957|  96.8k|        (DIV(ps_dec->ps_cur_slice->u2_first_mb_in_slice - 1, ps_dec->u2_frm_wd_in_mbs));
  ------------------
  |  |   65|  96.8k|#define DIV(x,y) ((x)/(y))
  ------------------
 2958|  96.8k|    ps_dec->u2_mby <<= u1_mbaff;
 2959|       |
 2960|       |    /******************************************************/
 2961|       |    /* Parsing / decoding the slice                       */
 2962|       |    /******************************************************/
 2963|  96.8k|    ret = isvcd_parse_interlayer_resamp_func_init(ps_svc_lyr_dec,
 2964|  96.8k|                                                  ps_dec->ps_cur_slice->u2_first_mb_in_slice);
 2965|  96.8k|    ps_dec->u1_slice_header_done = 2;
 2966|       |
 2967|  96.8k|    ps_dec->u1_qp = ps_slice->u1_slice_qp;
 2968|  96.8k|    ih264d_update_qp(ps_dec, 0);
 2969|  96.8k|    u1_mb_idx = ps_dec->u4_mb_idx;
 2970|  96.8k|    ps_parse_mb_data = ps_dec->ps_parse_mb_data;
 2971|  96.8k|    u1_num_mbs = u1_mb_idx;
 2972|  96.8k|    u1_slice_end = 0;
 2973|  96.8k|    u1_tfr_n_mb = 0;
 2974|  96.8k|    u1_decode_nmb = 0;
 2975|  96.8k|    i2_cur_mb_addr = ps_dec->u4_total_mbs_coded;
 2976|  96.8k|    i2_mb_skip_run = num_mb_skip;
 2977|  96.8k|    if(0 == ps_dec->u4_total_mbs_coded)
  ------------------
  |  Branch (2977:8): [True: 51.3k, False: 45.4k]
  ------------------
 2978|  51.3k|    {
 2979|  51.3k|        ps_dec->ps_cur_mb_row = ps_dec->ps_nbr_mb_row;  //[0];
 2980|       |        // Increment by 2 ,so that left mb (mbaff decrements by 2)  will always be valid
 2981|  51.3k|        ps_dec->ps_cur_mb_row += 2;
 2982|  51.3k|        ps_dec->ps_top_mb_row = ps_dec->ps_nbr_mb_row;
 2983|  51.3k|        ps_dec->ps_top_mb_row +=
 2984|  51.3k|            ((ps_dec->u2_frm_wd_in_mbs + 2) << (1 - ps_dec->ps_cur_sps->u1_frame_mbs_only_flag));
 2985|       |        // Increment by 2 ,so that left mb (mbaff decrements by 2)  will always be valid
 2986|  51.3k|        ps_dec->ps_top_mb_row += 2;
 2987|       |
 2988|       |        /* CHANGED CODE */
 2989|  51.3k|        ps_dec->ps_mv_cur = ps_dec->s_cur_pic.ps_mv;
 2990|  51.3k|        ps_dec->ps_mv_left = ps_dec->s_cur_pic.ps_mv;
 2991|  51.3k|        ps_dec->ps_mv_top = ps_dec->ps_mv_top_p[0];
 2992|  51.3k|        ps_dec->ps_deblk_mbn = ps_dec->ps_deblk_pic;
 2993|  51.3k|        ps_dec->ps_mv = ps_dec->s_cur_pic.ps_mv;
 2994|  51.3k|        ps_dec->ps_mv_bank_cur = ps_dec->s_cur_pic.ps_mv;
 2995|  51.3k|        ps_dec->pu1_col_zero_flag = ps_dec->s_cur_pic.pu1_col_zero_flag;
 2996|  51.3k|        ps_dec->ps_part = ps_dec->ps_parse_part_params;
 2997|  51.3k|        ps_dec->pf_mvpred_ref_tfr_nby2mb = isvcd_mv_pred_ref_tfr_nby2_epmb;
 2998|  51.3k|    }
 2999|  10.8M|    while(!u1_slice_end)
  ------------------
  |  Branch (2999:11): [True: 10.7M, False: 86.5k]
  ------------------
 3000|  10.7M|    {
 3001|  10.7M|        if(i2_cur_mb_addr > ps_dec->ps_cur_sps->u4_max_mb_addr) break;
  ------------------
  |  Branch (3001:12): [True: 10.2k, False: 10.7M]
  ------------------
 3002|       |
 3003|  10.7M|        ps_svc_cur_mb_info = ps_svc_lyr_dec->ps_svc_nmb_info + u1_num_mbs;
 3004|  10.7M|        ps_cur_mb_info = ps_dec->ps_nmb_info + u1_num_mbs;
 3005|  10.7M|        ps_dec->u4_num_mbs_cur_nmb = u1_num_mbs;
 3006|  10.7M|        ps_cur_mb_info->u1_Mux = 0;
 3007|  10.7M|        ps_dec->u4_num_pmbair = (u1_num_mbs >> u1_mbaff);
 3008|  10.7M|        ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + u1_num_mbs;
 3009|  10.7M|        ps_cur_mb_info->u1_end_of_slice = 0;
 3010|       |
 3011|       |        /* Storing Default partition info */
 3012|  10.7M|        ps_parse_mb_data->u1_num_part = 1;
 3013|  10.7M|        ps_parse_mb_data->u4_isI_mb = 0;
 3014|       |
 3015|       |        /**************************************************************/
 3016|       |        /* Get the required information for decoding of MB            */
 3017|       |        /**************************************************************/
 3018|       |        /* mb_x, mb_y, neighbor availablity, */
 3019|  10.7M|        if(u1_mbaff)
  ------------------
  |  Branch (3019:12): [True: 0, False: 10.7M]
  ------------------
 3020|      0|            ih264d_get_mb_info_cavlc_mbaff(ps_dec, i2_cur_mb_addr, ps_cur_mb_info, i2_mb_skip_run);
 3021|  10.7M|        else
 3022|  10.7M|            isvcd_get_mb_info_cavlc_nonmbaff(ps_dec, i2_cur_mb_addr, ps_cur_mb_info,
 3023|  10.7M|                                             i2_mb_skip_run);
 3024|       |
 3025|  10.7M|        {
 3026|  10.7M|            UWORD16 *pu2_res_luma_csbp;
 3027|       |
 3028|       |            /*Pointer assignment for Residual NNZ */
 3029|  10.7M|            pu2_res_luma_csbp = ps_svc_lyr_dec->pu2_frm_res_luma_csbp + ps_cur_mb_info->u2_mbx;
 3030|  10.7M|            pu2_res_luma_csbp +=
 3031|  10.7M|                ps_cur_mb_info->u2_mby * ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride;
 3032|  10.7M|            *pu2_res_luma_csbp = 0;
 3033|  10.7M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
 3034|  10.7M|                ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start + ps_cur_mb_info->u2_mbx +
 3035|  10.7M|                (ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride * (ps_cur_mb_info->u2_mby));
 3036|  10.7M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_mb_mode = SVC_INTER_MB;
  ------------------
  |  |  114|  10.7M|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
 3037|  10.7M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_tx_size =
 3038|  10.7M|                ps_cur_mb_info->u1_tran_form8x8;
 3039|  10.7M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u2_luma_nnz = 0;
 3040|  10.7M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz = 0;
 3041|  10.7M|        }
 3042|       |
 3043|       |        /* Set the deblocking parameters for this MB */
 3044|  10.7M|        if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (3044:12): [True: 10.7M, False: 0]
  ------------------
 3045|  10.7M|        {
 3046|  10.7M|            ih264d_set_deblocking_parameters(ps_cur_deblk_mb, ps_slice,
 3047|  10.7M|                                             ps_dec->u1_mb_ngbr_availablity,
 3048|  10.7M|                                             ps_dec->u1_cur_mb_fld_dec_flag);
 3049|  10.7M|        }
 3050|       |
 3051|       |        /* Set appropriate flags in ps_cur_mb_info and ps_dec */
 3052|  10.7M|        ps_dec->i1_prev_mb_qp_delta = 0;
 3053|  10.7M|        ps_dec->u1_sub_mb_num = 0;
 3054|  10.7M|        ps_cur_mb_info->u1_mb_type = MB_SKIP;
  ------------------
  |  |   59|  10.7M|#define MB_SKIP 255
  ------------------
 3055|  10.7M|        ps_cur_mb_info->u1_mb_mc_mode = PRED_16x16;
  ------------------
  |  |  450|  10.7M|#define PRED_16x16  0
  ------------------
 3056|  10.7M|        ps_cur_mb_info->u1_cbp = 0;
 3057|       |
 3058|       |        /* set appropriat flags in svc cur MB info */
 3059|  10.7M|        ps_svc_cur_mb_info->u1_base_mode_flag = 0;
 3060|  10.7M|        ps_svc_cur_mb_info->u1_residual_prediction_flag = 0;
 3061|  10.7M|        ps_svc_cur_mb_info->u1_crop_window_flag = 0;
 3062|  10.7M|        ps_svc_cur_mb_info->au1_motion_pred_flag[0] = 0;
 3063|  10.7M|        ps_svc_cur_mb_info->au1_motion_pred_flag[1] = 0;
 3064|       |
 3065|       |        /* Storing Skip partition info */
 3066|  10.7M|        ps_part_info = ps_dec->ps_part;
 3067|  10.7M|        ps_part_info->u1_is_direct = PART_DIRECT_16x16;
  ------------------
  |  |  571|  10.7M|#define PART_DIRECT_16x16              2
  ------------------
 3068|  10.7M|        ps_part_info->u1_sub_mb_num = 0;
 3069|  10.7M|        ps_dec->ps_part++;
 3070|       |
 3071|       |        /* Update Nnzs */
 3072|  10.7M|        ih264d_update_nnz_for_skipmb(ps_dec, ps_cur_mb_info, CAVLC);
  ------------------
  |  |  338|  10.7M|#define CAVLC  0
  ------------------
 3073|       |
 3074|  10.7M|        ps_cur_mb_info->ps_curmb->u1_mb_type = u1_inter_mb_type;
 3075|  10.7M|        ps_cur_deblk_mb->u1_mb_type |= u1_deblk_mb_type;
 3076|       |
 3077|  10.7M|        if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  10.7M|#define TARGET_LAYER 2
  ------------------
  |  Branch (3077:12): [True: 335k, False: 10.4M]
  ------------------
 3078|   335k|        {
 3079|   335k|            ps_cur_deblk_mb->u1_deblocking_mode = MB_DISABLE_FILTERING;
  ------------------
  |  |   70|   335k|#define MB_DISABLE_FILTERING          0x01
  ------------------
 3080|   335k|        }
 3081|       |
 3082|  10.7M|        i2_mb_skip_run--;
 3083|  10.7M|        ps_cur_deblk_mb->u1_mb_qp = ps_dec->u1_qp;
 3084|       |
 3085|  10.7M|        if(u1_mbaff)
  ------------------
  |  Branch (3085:12): [True: 0, False: 10.7M]
  ------------------
 3086|      0|        {
 3087|      0|            ih264d_update_mbaff_left_nnz(ps_dec, ps_cur_mb_info);
 3088|      0|        }
 3089|       |
 3090|       |        /**************************************************************/
 3091|       |        /* Get next Macroblock address                                */
 3092|       |        /**************************************************************/
 3093|  10.7M|        i2_cur_mb_addr++;
 3094|  10.7M|        u1_num_mbs++;
 3095|  10.7M|        ps_parse_mb_data++;
 3096|       |
 3097|       |        /****************************************************************/
 3098|       |        /* Check for End Of Row and other flags that determine when to  */
 3099|       |        /* do DMA setup for N/2-Mb, Decode for N-Mb, and Transfer for   */
 3100|       |        /* N-Mb                                                         */
 3101|       |        /****************************************************************/
 3102|  10.7M|        u1_num_mbs_next = i2_pic_wdin_mbs - ps_dec->u2_mbx - 1;
 3103|  10.7M|        u1_end_of_row = (!u1_num_mbs_next) && (!(u1_mbaff && (u1_num_mbs & 0x01)));
  ------------------
  |  Branch (3103:25): [True: 1.88M, False: 8.85M]
  |  Branch (3103:50): [True: 0, False: 1.88M]
  |  Branch (3103:62): [True: 0, False: 0]
  ------------------
 3104|  10.7M|        u1_slice_end = !i2_mb_skip_run;
 3105|  10.7M|        u1_tfr_n_mb = (u1_num_mbs == ps_dec->u4_recon_mb_grp) || u1_end_of_row || u1_slice_end;
  ------------------
  |  Branch (3105:23): [True: 1.84M, False: 8.89M]
  |  Branch (3105:66): [True: 36.6k, False: 8.85M]
  |  Branch (3105:83): [True: 54, False: 8.85M]
  ------------------
 3106|  10.7M|        u1_decode_nmb = u1_tfr_n_mb || u1_slice_end;
  ------------------
  |  Branch (3106:25): [True: 1.88M, False: 8.85M]
  |  Branch (3106:40): [True: 0, False: 8.85M]
  ------------------
 3107|  10.7M|        ps_cur_mb_info->u1_end_of_slice = u1_slice_end;
 3108|       |
 3109|  10.7M|        if(u1_decode_nmb)
  ------------------
  |  Branch (3109:12): [True: 1.88M, False: 8.85M]
  ------------------
 3110|  1.88M|        {
 3111|  1.88M|            if((ps_dec->i4_submb_ofst - ((WORD32) ((u1_num_mbs - u1_mb_idx) << 4))) < 0)
  ------------------
  |  Branch (3111:16): [True: 32.3k, False: 1.84M]
  ------------------
 3112|  32.3k|            {
 3113|  32.3k|                ps_dec->i4_submb_ofst = ((u1_num_mbs - u1_mb_idx) << 4);
 3114|  32.3k|            }
 3115|       |
 3116|  1.88M|            ps_dec->pf_mvpred_ref_tfr_nby2mb(ps_dec, u1_mb_idx, u1_num_mbs);
 3117|  1.88M|            ps_parse_mb_data = ps_dec->ps_parse_mb_data;
 3118|  1.88M|            ps_dec->ps_part = ps_dec->ps_parse_part_params;
 3119|       |
 3120|  1.88M|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (3120:16): [True: 980k, False: 901k]
  ------------------
 3121|   980k|            {
 3122|   980k|                ih264d_parse_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next, u1_tfr_n_mb,
 3123|   980k|                                     u1_end_of_row);
 3124|   980k|                ps_dec->ps_nmb_info += u1_num_mbs;
 3125|   980k|                ps_svc_lyr_dec->ps_svc_nmb_info += u1_num_mbs;
 3126|   980k|            }
 3127|   901k|            else
 3128|   901k|            {
 3129|   901k|                if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|   901k|#define TARGET_LAYER 2
  ------------------
  |  Branch (3129:20): [True: 798k, False: 102k]
  ------------------
 3130|   798k|                {
 3131|   798k|                    ih264d_decode_recon_tfr_nmb(ps_dec, u1_mb_idx, u1_num_mbs, u1_num_mbs_next,
 3132|   798k|                                                u1_tfr_n_mb, u1_end_of_row);
 3133|   798k|                }
 3134|   102k|                else
 3135|   102k|                {
 3136|   102k|                    isvcd_decode_recon_tfr_nmb_base_lyr(ps_svc_lyr_dec, u1_mb_idx, u1_num_mbs,
 3137|   102k|                                                        u1_num_mbs_next, u1_tfr_n_mb,
 3138|   102k|                                                        u1_end_of_row);
 3139|   102k|                }
 3140|   901k|            }
 3141|  1.88M|            ps_dec->u4_total_mbs_coded += u1_num_mbs;
 3142|  1.88M|            if(u1_tfr_n_mb) u1_num_mbs = 0;
  ------------------
  |  Branch (3142:16): [True: 1.88M, False: 0]
  ------------------
 3143|  1.88M|            u1_mb_idx = u1_num_mbs;
 3144|  1.88M|            ps_dec->u4_mb_idx = u1_num_mbs;
 3145|  1.88M|        }
 3146|  10.7M|    }
 3147|       |
 3148|  96.8k|    ps_dec->u4_num_mbs_cur_nmb = 0;
 3149|  96.8k|    ps_dec->ps_cur_slice->u4_mbs_in_slice =
 3150|  96.8k|        i2_cur_mb_addr - ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice;
 3151|       |
 3152|  96.8k|    H264_DEC_DEBUG_PRINT("Mbs in slice: %d\n", ps_dec->ps_cur_slice->u4_mbs_in_slice);
  ------------------
  |  |   39|  96.8k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 3153|       |
 3154|       |    /* incremented here only if first slice is inserted */
 3155|  96.8k|    if(ps_dec->u4_first_slice_in_pic != 0)
  ------------------
  |  Branch (3155:8): [True: 0, False: 96.8k]
  ------------------
 3156|      0|    {
 3157|      0|        ps_dec->ps_parse_cur_slice++;
 3158|      0|        ps_dec->u2_cur_slice_num++;
 3159|      0|    }
 3160|       |
 3161|  96.8k|    ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
 3162|  96.8k|    ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;
 3163|       |
 3164|  96.8k|    if(ps_dec->u4_total_mbs_coded >= ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs)
  ------------------
  |  Branch (3164:8): [True: 96.6k, False: 152]
  ------------------
 3165|  96.6k|    {
 3166|  96.6k|        ps_dec->u1_pic_decode_done = 1;
 3167|  96.6k|    }
 3168|       |
 3169|  96.8k|    return 0;
 3170|  97.0k|}
isvcd_parse_interlayer_resamp_func_init:
 3184|   234k|{
 3185|   234k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 3186|   234k|    dec_slice_params_t *ps_slice = ps_dec->ps_cur_slice;
 3187|   234k|    WORD32 ret = OK;
  ------------------
  |  |  114|   234k|#define OK        0
  ------------------
 3188|   234k|    if(ps_svc_lyr_dec->u1_res_init_done == 1)
  ------------------
  |  Branch (3188:8): [True: 96.8k, False: 137k]
  ------------------
 3189|  96.8k|        return ret;
 3190|       |
 3191|   137k|    if(TARGET_LAYER != ps_svc_lyr_dec->u1_layer_identifier)
  ------------------
  |  |  110|   137k|#define TARGET_LAYER 2
  ------------------
  |  Branch (3191:8): [True: 46.3k, False: 91.2k]
  ------------------
 3192|  46.3k|    {
 3193|  46.3k|        ps_slice->u1_disable_dblk_filter_idc = ps_svc_lyr_dec->u1_inter_lyr_disable_dblk_filter_idc;
 3194|  46.3k|        ps_slice->i1_slice_alpha_c0_offset = ps_svc_lyr_dec->i1_inter_lyr_slice_alpha_c0_offset;
 3195|  46.3k|        ps_slice->i1_slice_beta_offset = ps_svc_lyr_dec->i1_inter_lyr_slice_beta_offset;
 3196|  46.3k|    }
 3197|       |
 3198|   137k|    if(0 == u2_first_mb_in_slice)
  ------------------
  |  Branch (3198:8): [True: 137k, False: 0]
  ------------------
 3199|   137k|    {
 3200|   137k|        ret = isvcd_populate_res_prms(ps_svc_lyr_dec);
 3201|   137k|        if(ret != OK) return NOT_OK;
  ------------------
  |  |  114|   137k|#define OK        0
  ------------------
                      if(ret != OK) return NOT_OK;
  ------------------
  |  |  116|    442|#define NOT_OK    -1
  ------------------
  |  Branch (3201:12): [True: 442, False: 137k]
  ------------------
 3202|   137k|        isvcd_crop_wnd_flag_res_int(ps_svc_lyr_dec);
 3203|   137k|        ret = isvcd_comp_mode_mv_res_init(ps_svc_lyr_dec);
 3204|   137k|        if(ret != OK) return NOT_OK;
  ------------------
  |  |  114|   137k|#define OK        0
  ------------------
                      if(ret != OK) return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (3204:12): [True: 0, False: 137k]
  ------------------
 3205|   137k|        ret = isvcd_ii_pred_res_init(ps_svc_lyr_dec);
 3206|   137k|        if(ret != OK) return NOT_OK;
  ------------------
  |  |  114|   137k|#define OK        0
  ------------------
                      if(ret != OK) return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (3206:12): [True: 0, False: 137k]
  ------------------
 3207|   137k|        ret = isvcd_intra_resamp_res_init(ps_svc_lyr_dec);
 3208|   137k|        if(ret != OK) return NOT_OK;
  ------------------
  |  |  114|   137k|#define OK        0
  ------------------
                      if(ret != OK) return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (3208:12): [True: 0, False: 137k]
  ------------------
 3209|   137k|        ret = isvcd_residual_samp_res_init(ps_svc_lyr_dec);
 3210|   137k|        if(ret != OK) return NOT_OK;
  ------------------
  |  |  114|   137k|#define OK        0
  ------------------
                      if(ret != OK) return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (3210:12): [True: 0, False: 137k]
  ------------------
 3211|       |
 3212|   137k|        ps_svc_lyr_dec->u1_res_init_done = 1;
 3213|   137k|    }
 3214|       |
 3215|   137k|    return ret;
 3216|   137k|}
isvcd_parse_pslice:
 3231|  66.9k|{
 3232|  66.9k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 3233|  66.9k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 3234|  66.9k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
 3235|  66.9k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 3236|  66.9k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 3237|  66.9k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 3238|  66.9k|    UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 3239|  66.9k|    UWORD8 u1_field_pic_flag = ps_cur_slice->u1_field_pic_flag;
 3240|  66.9k|    UWORD64 u8_ref_idx_l0;
 3241|  66.9k|    UWORD32 u4_temp;
 3242|  66.9k|    WORD32 i_temp;
 3243|  66.9k|    WORD32 ret;
 3244|  66.9k|    WORD64 i8_temp;
 3245|       |
 3246|       |    /*--------------------------------------------------------------------*/
 3247|       |    /* Read remaining contents of the slice header                        */
 3248|       |    /*--------------------------------------------------------------------*/
 3249|  66.9k|    {
 3250|  66.9k|        WORD8 *pi1_buf;
 3251|  66.9k|        WORD16 *pi2_mv = ps_dec->s_default_mv_pred.i2_mv;
 3252|  66.9k|        WORD32 *pi4_mv = (WORD32 *) pi2_mv;
 3253|  66.9k|        WORD16 *pi16_refFrame;
 3254|       |
 3255|  66.9k|        pi1_buf = ps_dec->s_default_mv_pred.i1_ref_frame;
 3256|  66.9k|        pi16_refFrame = (WORD16 *) pi1_buf;
 3257|  66.9k|        *pi4_mv = 0;
 3258|  66.9k|        *(pi4_mv + 1) = 0;
 3259|  66.9k|        *pi16_refFrame = OUT_OF_RANGE_REF;
  ------------------
  |  |   45|  66.9k|#define OUT_OF_RANGE_REF  -1
  ------------------
 3260|  66.9k|        ps_dec->s_default_mv_pred.u1_col_ref_pic_idx = (UWORD8) -1;
 3261|  66.9k|        ps_dec->s_default_mv_pred.u1_pic_type = (UWORD8) -1;
 3262|  66.9k|    }
 3263|       |
 3264|  66.9k|    ps_cur_slice->u1_num_ref_idx_active_override_flag = ih264d_get_bit_h264(ps_bitstrm);
 3265|  66.9k|    COPYTHECONTEXT("SH: num_ref_idx_override_flag",
 3266|  66.9k|                   ps_cur_slice->u1_num_ref_idx_active_override_flag);
 3267|       |
 3268|  66.9k|    u8_ref_idx_l0 = ps_dec->ps_cur_pps->u1_num_ref_idx_lx_active[0];
 3269|  66.9k|    if(ps_cur_slice->u1_num_ref_idx_active_override_flag)
  ------------------
  |  Branch (3269:8): [True: 40.0k, False: 26.8k]
  ------------------
 3270|  40.0k|    {
 3271|  40.0k|        u8_ref_idx_l0 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf) + (UWORD64) 1;
 3272|  40.0k|    }
 3273|       |
 3274|  66.9k|    {
 3275|  66.9k|        UWORD8 u1_max_ref_idx = H264_MAX_REF_PICS << u1_field_pic_flag;
  ------------------
  |  |  534|  66.9k|#define H264_MAX_REF_PICS         16
  ------------------
 3276|  66.9k|        if(u8_ref_idx_l0 >= u1_max_ref_idx)
  ------------------
  |  Branch (3276:12): [True: 899, False: 66.0k]
  ------------------
 3277|    899|        {
 3278|    899|            return ERROR_NUM_REF;
 3279|    899|        }
 3280|  66.0k|        ps_cur_slice->u1_num_ref_idx_lx_active[0] = (UWORD8) u8_ref_idx_l0;
 3281|  66.0k|        COPYTHECONTEXT("SH: num_ref_idx_l0_active_minus1",
 3282|  66.0k|                       ps_cur_slice->u1_num_ref_idx_lx_active[0] - 1);
 3283|  66.0k|    }
 3284|       |
 3285|      0|    {
 3286|  66.0k|        UWORD8 uc_refIdxReFlagL0 = ih264d_get_bit_h264(ps_bitstrm);
 3287|  66.0k|        COPYTHECONTEXT("SH: ref_pic_list_reordering_flag_l0", uc_refIdxReFlagL0);
 3288|       |
 3289|  66.0k|        ih264d_init_ref_idx_lx_p(ps_dec);
 3290|       |        /* Store the value for future slices in the same picture */
 3291|  66.0k|        ps_dec->u1_num_ref_idx_lx_active_prev = ps_cur_slice->u1_num_ref_idx_lx_active[0];
 3292|       |
 3293|       |        /* Modified temporarily */
 3294|  66.0k|        if(uc_refIdxReFlagL0)
  ------------------
  |  Branch (3294:12): [True: 26.9k, False: 39.0k]
  ------------------
 3295|  26.9k|        {
 3296|  26.9k|            WORD8 ret;
 3297|  26.9k|            ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_mod_dpb[0];
 3298|  26.9k|            ret = ih264d_ref_idx_reordering(ps_dec, 0);
 3299|  26.9k|            if(ret == -1) return ERROR_REFIDX_ORDER_T;
  ------------------
  |  Branch (3299:16): [True: 0, False: 26.9k]
  ------------------
 3300|  26.9k|            ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_mod_dpb[0];
 3301|  26.9k|        }
 3302|  39.0k|        else
 3303|  39.0k|            ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_init_dpb[0];
 3304|  66.0k|    }
 3305|       |    /* Create refIdx to POC mapping */
 3306|  66.0k|    {
 3307|  66.0k|        void **pui_map_ref_idx_to_poc_lx0, **pui_map_ref_idx_to_poc_lx1;
 3308|  66.0k|        WORD8 idx;
 3309|  66.0k|        struct pic_buffer_t *ps_pic;
 3310|       |
 3311|  66.0k|        pui_map_ref_idx_to_poc_lx0 = ps_dec->ppv_map_ref_idx_to_poc + FRM_LIST_L0;
  ------------------
  |  |   89|  66.0k|#define FRM_LIST_L0             0                                               //0
  ------------------
 3312|  66.0k|        pui_map_ref_idx_to_poc_lx0[0] = 0;
 3313|  66.0k|        pui_map_ref_idx_to_poc_lx0++;
 3314|   202k|        for(idx = 0; idx < ps_cur_slice->u1_num_ref_idx_lx_active[0]; idx++)
  ------------------
  |  Branch (3314:22): [True: 136k, False: 66.0k]
  ------------------
 3315|   136k|        {
 3316|   136k|            ps_pic = ps_dec->ps_ref_pic_buf_lx[0][idx];
 3317|   136k|            pui_map_ref_idx_to_poc_lx0[idx] = (ps_pic->pu1_buf1);
 3318|   136k|        }
 3319|       |
 3320|       |        /* Bug Fix Deblocking */
 3321|  66.0k|        pui_map_ref_idx_to_poc_lx1 = ps_dec->ppv_map_ref_idx_to_poc + FRM_LIST_L1;
  ------------------
  |  |   90|  66.0k|#define FRM_LIST_L1             1 * POC_LIST_L0_TO_L1_DIFF//FRM_LIST_L0 + POC_LIST_L0_TO_L1_DIFF        //0+33                  //(1 * POC_LIST_L0_TO_L1_DIFF)
  |  |  ------------------
  |  |  |  |   86|  66.0k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|  66.0k|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3322|  66.0k|        pui_map_ref_idx_to_poc_lx1[0] = 0;
 3323|       |
 3324|  66.0k|        if(u1_mbaff)
  ------------------
  |  Branch (3324:12): [True: 0, False: 66.0k]
  ------------------
 3325|      0|        {
 3326|      0|            void **ppv_map_ref_idx_to_poc_lx_t, **ppv_map_ref_idx_to_poc_lx_b;
 3327|      0|            void **ppv_map_ref_idx_to_poc_lx_t1, **ppv_map_ref_idx_to_poc_lx_b1;
 3328|      0|            ppv_map_ref_idx_to_poc_lx_t = ps_dec->ppv_map_ref_idx_to_poc + TOP_LIST_FLD_L0;
  ------------------
  |  |   91|      0|#define TOP_LIST_FLD_L0         2 * POC_LIST_L0_TO_L1_DIFF//FRM_LIST_L1 + POC_LIST_L0_TO_L1_DIFF        //0+33+33                   //(2 * POC_LIST_L0_TO_L1_DIFF)
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3329|      0|            ppv_map_ref_idx_to_poc_lx_b = ps_dec->ppv_map_ref_idx_to_poc + BOT_LIST_FLD_L0;
  ------------------
  |  |   93|      0|#define BOT_LIST_FLD_L0         4 * POC_LIST_L0_TO_L1_DIFF//TOP_LIST_FLD_L1 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3330|      0|            ppv_map_ref_idx_to_poc_lx_t[0] = 0;
 3331|      0|            ppv_map_ref_idx_to_poc_lx_t++;
 3332|      0|            ppv_map_ref_idx_to_poc_lx_b[0] = 0;
 3333|      0|            ppv_map_ref_idx_to_poc_lx_b++;
 3334|      0|            idx = 0;
 3335|      0|            for(idx = 0; idx < ps_cur_slice->u1_num_ref_idx_lx_active[0]; idx++)
  ------------------
  |  Branch (3335:26): [True: 0, False: 0]
  ------------------
 3336|      0|            {
 3337|      0|                ps_pic = ps_dec->ps_ref_pic_buf_lx[0][idx];
 3338|      0|                ppv_map_ref_idx_to_poc_lx_t[0] = (ps_pic->pu1_buf1);
 3339|      0|                ppv_map_ref_idx_to_poc_lx_b[1] = (ps_pic->pu1_buf1);
 3340|      0|                ppv_map_ref_idx_to_poc_lx_b[0] = (ps_pic->pu1_buf1) + 1;
 3341|      0|                ppv_map_ref_idx_to_poc_lx_t[1] = (ps_pic->pu1_buf1) + 1;
 3342|      0|                ppv_map_ref_idx_to_poc_lx_t += 2;
 3343|      0|                ppv_map_ref_idx_to_poc_lx_b += 2;
 3344|      0|            }
 3345|      0|            ppv_map_ref_idx_to_poc_lx_t1 = ps_dec->ppv_map_ref_idx_to_poc + TOP_LIST_FLD_L1;
  ------------------
  |  |   92|      0|#define TOP_LIST_FLD_L1         3 * POC_LIST_L0_TO_L1_DIFF//TOP_LIST_FLD_L0 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17                //(3 * POC_LIST_L0_TO_L1_DIFF)
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3346|      0|            ppv_map_ref_idx_to_poc_lx_t1[0] = 0;
 3347|      0|            ppv_map_ref_idx_to_poc_lx_b1 = ps_dec->ppv_map_ref_idx_to_poc + BOT_LIST_FLD_L1;
  ------------------
  |  |   94|      0|#define BOT_LIST_FLD_L1         5 * POC_LIST_L0_TO_L1_DIFF//BOT_LIST_FLD_L0 + POC_LIST_L0_TO_L1_DIFF_1  //0+33+33+17+17+17
  |  |  ------------------
  |  |  |  |   86|      0|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  |  |  ------------------
  |  |  |  |  |  |  600|      0|#define MAX_FRAMES              16
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3348|      0|            ppv_map_ref_idx_to_poc_lx_b1[0] = 0;
 3349|      0|        }
 3350|  66.0k|    }
 3351|  66.0k|    if(ps_pps->u1_wted_pred_flag)
  ------------------
  |  Branch (3351:8): [True: 16.5k, False: 49.5k]
  ------------------
 3352|  16.5k|    {
 3353|  16.5k|        ret = ih264d_parse_pred_weight_table(ps_cur_slice, ps_bitstrm);
 3354|  16.5k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  16.5k|#define OK        0
  ------------------
  |  Branch (3354:12): [True: 5.08k, False: 11.4k]
  ------------------
 3355|       |
 3356|  11.4k|        ih264d_form_pred_weight_matrix(ps_dec);
 3357|  11.4k|        ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
 3358|  11.4k|    }
 3359|  49.5k|    else
 3360|  49.5k|    {
 3361|  49.5k|        ps_dec->ps_cur_slice->u2_log2Y_crwd = 0;
 3362|  49.5k|        ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
 3363|  49.5k|    }
 3364|       |
 3365|  60.9k|    ps_dec->ps_parse_cur_slice->u2_log2Y_crwd = ps_dec->ps_cur_slice->u2_log2Y_crwd;
 3366|       |
 3367|  60.9k|    if(u1_mbaff && (u1_field_pic_flag == 0))
  ------------------
  |  Branch (3367:8): [True: 0, False: 60.9k]
  |  Branch (3367:20): [True: 0, False: 0]
  ------------------
 3368|      0|    {
 3369|      0|        ih264d_convert_frm_mbaff_list(ps_dec);
 3370|      0|    }
 3371|       |
 3372|       |    /* G050 */
 3373|  60.9k|    if(ps_cur_slice->u1_nal_ref_idc != 0)
  ------------------
  |  Branch (3373:8): [True: 58.8k, False: 2.10k]
  ------------------
 3374|  58.8k|    {
 3375|  58.8k|        if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (3375:12): [True: 58.5k, False: 314]
  ------------------
 3376|  58.5k|        {
 3377|  58.5k|            dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 3378|  58.5k|            dec_seq_params_t *ps_sps_tmp = ps_pps->ps_sps;
 3379|  58.5k|            UWORD8 u1_nal_unit_type_tmp = ps_dec->u1_nal_unit_type;
 3380|       |
 3381|  58.5k|            ps_pps->ps_sps = ps_dec->ps_cur_sps;
 3382|  58.5k|            if(ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag)
  ------------------
  |  Branch (3382:16): [True: 56.8k, False: 1.63k]
  ------------------
 3383|  56.8k|                ps_dec->u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  56.8k|#define IDR_SLICE_NAL                   5
  ------------------
 3384|       |
 3385|  58.5k|            i_temp = ih264d_read_mmco_commands(ps_dec);
 3386|       |
 3387|  58.5k|            ps_pps->ps_sps = ps_sps_tmp;
 3388|  58.5k|            ps_dec->u1_nal_unit_type = u1_nal_unit_type_tmp;
 3389|       |
 3390|  58.5k|            if(i_temp < 0)
  ------------------
  |  Branch (3390:16): [True: 97, False: 58.4k]
  ------------------
 3391|     97|            {
 3392|     97|                return ERROR_DBP_MANAGER_T;
 3393|     97|            }
 3394|  58.4k|            ps_dec->u4_bitoffset = i_temp;
 3395|  58.4k|        }
 3396|    314|        else
 3397|    314|            ps_bitstrm->u4_ofst += ps_dec->u4_bitoffset;
 3398|  58.8k|    }
 3399|       |    /* G050 */
 3400|       |
 3401|  60.8k|    if(ps_pps->u1_entropy_coding_mode == CABAC)
  ------------------
  |  |  339|  60.8k|#define CABAC  1
  ------------------
  |  Branch (3401:8): [True: 8.45k, False: 52.3k]
  ------------------
 3402|  8.45k|    {
 3403|  8.45k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3404|       |
 3405|  8.45k|        if(u4_temp > MAX_CABAC_INIT_IDC)
  ------------------
  |  |  537|  8.45k|#define MAX_CABAC_INIT_IDC        2
  ------------------
  |  Branch (3405:12): [True: 622, False: 7.82k]
  ------------------
 3406|    622|        {
 3407|    622|            return ERROR_INV_SLICE_HDR_T;
 3408|    622|        }
 3409|  7.82k|        ps_cur_slice->u1_cabac_init_idc = u4_temp;
 3410|  7.82k|        COPYTHECONTEXT("SH: cabac_init_idc", ps_cur_slice->u1_cabac_init_idc);
 3411|  7.82k|    }
 3412|       |
 3413|       |    /* Read slice_qp_delta */
 3414|  60.2k|    i8_temp = (WORD64) ps_pps->u1_pic_init_qp + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3415|  60.2k|    if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  629|  60.2k|#define MIN_H264_QP 0
  ------------------
                  if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP))
  ------------------
  |  |  634|  59.5k|#define MAX_H264_QP 51
  ------------------
  |  Branch (3415:8): [True: 656, False: 59.5k]
  |  Branch (3415:35): [True: 2.77k, False: 56.7k]
  ------------------
 3416|  3.42k|    {
 3417|  3.42k|        return ERROR_INV_RANGE_QP_T;
 3418|  3.42k|    }
 3419|  56.7k|    ps_cur_slice->u1_slice_qp = (UWORD8) i8_temp;
 3420|  56.7k|    COPYTHECONTEXT("SH: slice_qp_delta",
 3421|  56.7k|                   (WORD8) (ps_cur_slice->u1_slice_qp - ps_pps->u1_pic_init_qp));
 3422|       |
 3423|  56.7k|    if(ps_pps->u1_deblocking_filter_parameters_present_flag == 1)
  ------------------
  |  Branch (3423:8): [True: 32.2k, False: 24.5k]
  ------------------
 3424|  32.2k|    {
 3425|  32.2k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 3426|  32.2k|        if(u4_temp > SLICE_BOUNDARY_DBLK_DISABLED)
  ------------------
  |  |  547|  32.2k|#define SLICE_BOUNDARY_DBLK_DISABLED  2
  ------------------
  |  Branch (3426:12): [True: 1.32k, False: 30.9k]
  ------------------
 3427|  1.32k|        {
 3428|  1.32k|            return ERROR_INV_SLICE_HDR_T;
 3429|  1.32k|        }
 3430|       |
 3431|  30.9k|        COPYTHECONTEXT("SH: disable_deblocking_filter_idc", u4_temp);
 3432|  30.9k|        ps_cur_slice->u1_disable_dblk_filter_idc = u4_temp;
 3433|  30.9k|        if(u4_temp != 1)
  ------------------
  |  Branch (3433:12): [True: 26.0k, False: 4.86k]
  ------------------
 3434|  26.0k|        {
 3435|  26.0k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 3436|  26.0k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  26.0k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  25.8k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (3436:16): [True: 231, False: 25.8k]
  |  Branch (3436:47): [True: 394, False: 25.4k]
  ------------------
 3437|    625|            {
 3438|    625|                return ERROR_INV_SLICE_HDR_T;
 3439|    625|            }
 3440|  25.4k|            ps_cur_slice->i1_slice_alpha_c0_offset = i_temp;
 3441|  25.4k|            COPYTHECONTEXT("SH: slice_alpha_c0_offset_div2",
 3442|  25.4k|                           ps_cur_slice->i1_slice_alpha_c0_offset >> 1);
 3443|       |
 3444|  25.4k|            i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf) << 1;
 3445|  25.4k|            if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  550|  25.4k|#define MIN_DBLK_FIL_OFF              -12
  ------------------
                          if((MIN_DBLK_FIL_OFF > i_temp) || (i_temp > MAX_DBLK_FIL_OFF))
  ------------------
  |  |  551|  25.1k|#define MAX_DBLK_FIL_OFF              12
  ------------------
  |  Branch (3445:16): [True: 339, False: 25.1k]
  |  Branch (3445:47): [True: 251, False: 24.8k]
  ------------------
 3446|    590|            {
 3447|    590|                return ERROR_INV_SLICE_HDR_T;
 3448|    590|            }
 3449|  24.8k|            ps_cur_slice->i1_slice_beta_offset = i_temp;
 3450|  24.8k|            COPYTHECONTEXT("SH: slice_beta_offset_div2", ps_cur_slice->i1_slice_beta_offset >> 1);
 3451|  24.8k|        }
 3452|  4.86k|        else
 3453|  4.86k|        {
 3454|  4.86k|            ps_cur_slice->i1_slice_alpha_c0_offset = 0;
 3455|  4.86k|            ps_cur_slice->i1_slice_beta_offset = 0;
 3456|  4.86k|        }
 3457|  30.9k|    }
 3458|  24.5k|    else
 3459|  24.5k|    {
 3460|  24.5k|        ps_cur_slice->u1_disable_dblk_filter_idc = 0;
 3461|  24.5k|        ps_cur_slice->i1_slice_alpha_c0_offset = 0;
 3462|  24.5k|        ps_cur_slice->i1_slice_beta_offset = 0;
 3463|  24.5k|    }
 3464|       |
 3465|  54.2k|    ps_dec->u1_slice_header_done = 2;
 3466|  54.2k|    if(ps_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (3466:8): [True: 7.64k, False: 46.6k]
  ------------------
 3467|  7.64k|    {
 3468|  7.64k|        SWITCHOFFTRACE;
 3469|  7.64k|        SWITCHONTRACECABAC;
 3470|  7.64k|        ps_svc_lyr_dec->pf_parse_svc_inter_slice = isvcd_parse_inter_slice_data_cabac;
 3471|  7.64k|        ps_dec->pf_parse_inter_mb = ih264d_parse_pmb_cabac;
 3472|  7.64k|        ih264d_init_cabac_contexts(P_SLICE, ps_dec);
  ------------------
  |  |  368|  7.64k|#define P_SLICE  0
  ------------------
 3473|       |
 3474|  7.64k|        if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (3474:12): [True: 0, False: 7.64k]
  ------------------
 3475|      0|            ps_dec->pf_get_mb_info = ih264d_get_mb_info_cabac_mbaff;
 3476|  7.64k|        else
 3477|  7.64k|            ps_dec->pf_get_mb_info = isvcd_get_mb_info_cabac_nonmbaff;
 3478|  7.64k|    }
 3479|  46.6k|    else
 3480|  46.6k|    {
 3481|  46.6k|        SWITCHONTRACE;
 3482|  46.6k|        SWITCHOFFTRACECABAC;
 3483|  46.6k|        ps_svc_lyr_dec->pf_parse_svc_inter_slice = isvcd_parse_inter_slice_data_cavlc;
 3484|  46.6k|        ps_dec->pf_parse_inter_mb = ih264d_parse_pmb_cavlc;
 3485|  46.6k|        if(ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (3485:12): [True: 0, False: 46.6k]
  ------------------
 3486|      0|        {
 3487|      0|            ps_dec->pf_get_mb_info = ih264d_get_mb_info_cavlc_mbaff;
 3488|      0|        }
 3489|  46.6k|        else
 3490|  46.6k|            ps_dec->pf_get_mb_info = isvcd_get_mb_info_cavlc_nonmbaff;
 3491|  46.6k|    }
 3492|       |
 3493|  54.2k|    ps_dec->u1_B = 0;
 3494|  54.2k|    ps_dec->pf_mvpred_ref_tfr_nby2mb = ih264d_mv_pred_ref_tfr_nby2_pmb;
 3495|  54.2k|    ret = ps_svc_lyr_dec->pf_parse_svc_inter_slice(ps_svc_lyr_dec, ps_cur_slice,
 3496|  54.2k|                                                   u2_first_mb_in_slice);
 3497|  54.2k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  54.2k|#define OK        0
  ------------------
  |  Branch (3497:8): [True: 14.4k, False: 39.7k]
  ------------------
 3498|       |
 3499|  39.7k|    return OK;
  ------------------
  |  |  114|  39.7k|#define OK        0
  ------------------
 3500|  54.2k|}

isvcd_set_default_seq_svc_ext:
   97|  20.2k|{
   98|  20.2k|    ps_seq_svc_ext->u1_inter_layer_deblocking_filter_control_present_flag = 0;
   99|  20.2k|    ps_seq_svc_ext->u1_extended_spatial_scalability_idc = 0;
  100|  20.2k|    ps_seq_svc_ext->u1_chroma_phase_x_plus1_flag = 1;
  101|  20.2k|    ps_seq_svc_ext->u1_chroma_phase_y_plus1 = 1;
  102|  20.2k|    ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_x_plus1_flag =
  103|  20.2k|        ps_seq_svc_ext->u1_chroma_phase_x_plus1_flag;
  104|  20.2k|    ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_y_plus1 = ps_seq_svc_ext->u1_chroma_phase_y_plus1;
  105|  20.2k|    ps_seq_svc_ext->i4_seq_scaled_ref_layer_left_offset = 0;
  106|  20.2k|    ps_seq_svc_ext->i4_seq_scaled_ref_layer_top_offset = 0;
  107|  20.2k|    ps_seq_svc_ext->i4_seq_scaled_ref_layer_right_offset = 0;
  108|  20.2k|    ps_seq_svc_ext->i4_seq_scaled_ref_layer_bottom_offset = 0;
  109|  20.2k|    ps_seq_svc_ext->u1_seq_tcoeff_level_prediction_flag =
  110|  20.2k|        ps_seq_svc_ext->u1_adaptive_tcoeff_level_prediction_flag = 0;
  111|  20.2k|    ps_seq_svc_ext->u1_slice_header_restriction_flag = 0;
  112|  20.2k|    ps_seq_svc_ext->u1_svc_vui_parameters_present_flag = 0;
  113|  20.2k|}
isvcd_parse_subset_sps:
  127|  24.7k|{
  128|  24.7k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  129|  24.7k|    UWORD8 i;
  130|  24.7k|    dec_seq_params_t *ps_seq = NULL;
  131|  24.7k|    dec_svc_seq_params_t *ps_subset_seq = NULL;
  132|  24.7k|    dec_subset_seq_params_t *ps_seq_svc_ext;
  133|  24.7k|    UWORD8 u1_profile_idc, u1_level_idc, u1_seq_parameter_set_id, u1_mb_aff_flag = 0;
  134|  24.7k|    UWORD16 i2_max_frm_num;
  135|  24.7k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  136|  24.7k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  137|  24.7k|    UWORD8 u1_frm, uc_constraint_set0_flag, uc_constraint_set1_flag, uc_constraint_set2_flag;
  138|  24.7k|    WORD32 i4_cropped_ht, i4_cropped_wd;
  139|  24.7k|    UWORD32 u4_temp;
  140|  24.7k|    UWORD64 u8_temp;
  141|  24.7k|    UWORD32 u4_pic_height_in_map_units, u4_pic_width_in_mbs;
  142|  24.7k|    UWORD32 u2_pic_wd = 0;
  143|  24.7k|    UWORD32 u2_pic_ht = 0;
  144|  24.7k|    UWORD32 u2_frm_wd_y = 0;
  145|  24.7k|    UWORD32 u2_frm_ht_y = 0;
  146|  24.7k|    UWORD32 u2_frm_wd_uv = 0;
  147|  24.7k|    UWORD32 u2_frm_ht_uv = 0;
  148|  24.7k|    UWORD32 u2_crop_offset_y = 0;
  149|  24.7k|    UWORD32 u2_crop_offset_uv = 0;
  150|  24.7k|    WORD32 ret;
  151|       |    /* High profile related syntax element */
  152|  24.7k|    WORD32 i4_i;
  153|       |    /* G050 */
  154|  24.7k|    UWORD8 u1_frame_cropping_flag,
  155|  24.7k|        u1_frame_cropping_rect_left_ofst = 0, u1_frame_cropping_rect_right_ofst = 0,
  156|  24.7k|        u1_frame_cropping_rect_top_ofst = 0, u1_frame_cropping_rect_bottom_ofst = 0;
  157|       |    /* G050 */
  158|       |    /*--------------------------------------------------------------------*/
  159|       |    /* Decode seq_parameter_set_id and profile and level values           */
  160|       |    /*--------------------------------------------------------------------*/
  161|  24.7k|    SWITCHONTRACE;
  162|  24.7k|    u1_profile_idc = ih264d_get_bits_h264(ps_bitstrm, 8);
  163|  24.7k|    COPYTHECONTEXT("SPS: profile_idc", u1_profile_idc);
  164|       |
  165|       |    /* G050 */
  166|  24.7k|    uc_constraint_set0_flag = ih264d_get_bit_h264(ps_bitstrm);
  167|  24.7k|    uc_constraint_set1_flag = ih264d_get_bit_h264(ps_bitstrm);
  168|  24.7k|    uc_constraint_set2_flag = ih264d_get_bit_h264(ps_bitstrm);
  169|  24.7k|    UNUSED(uc_constraint_set1_flag);
  ------------------
  |  |   45|  24.7k|#define UNUSED(x) ((void)(x))
  ------------------
  170|  24.7k|    UNUSED(uc_constraint_set2_flag);
  ------------------
  |  |   45|  24.7k|#define UNUSED(x) ((void)(x))
  ------------------
  171|       |
  172|       |    /*****************************************************/
  173|       |    /* Read 5 bits for uc_constraint_set3_flag (1 bit)   */
  174|       |    /* and reserved_zero_4bits (4 bits) - Sushant        */
  175|       |    /*****************************************************/
  176|  24.7k|    ih264d_get_bits_h264(ps_bitstrm, 5);
  177|       |    /* G050 */
  178|  24.7k|    u1_level_idc = (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 8);
  179|  24.7k|    COPYTHECONTEXT("SPS: u4_level_idc", u1_level_idc);
  180|       |
  181|  24.7k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  182|  24.7k|    if(u4_temp & MASK_ERR_SEQ_SET_ID) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  |  526|  24.7k|#define MASK_ERR_SEQ_SET_ID   (0xFFFFFFE0)
  ------------------
  |  Branch (182:8): [True: 550, False: 24.2k]
  ------------------
  183|  24.2k|    u1_seq_parameter_set_id = u4_temp;
  184|  24.2k|    COPYTHECONTEXT("SPS: seq_parameter_set_id", u1_seq_parameter_set_id);
  185|       |
  186|  24.2k|    if(u1_seq_parameter_set_id >= MAX_NUM_SEQ_PARAMS) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  |  521|  24.2k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  |  Branch (186:8): [True: 0, False: 24.2k]
  ------------------
  187|       |
  188|       |    /*--------------------------------------------------------------------*/
  189|       |    /* Find an seq param entry in seqparam array of decStruct             */
  190|       |    /*--------------------------------------------------------------------*/
  191|  24.2k|    ps_subset_seq = ps_svc_lyr_dec->pv_scratch_subset_sps;
  192|  24.2k|    memset(ps_subset_seq, 0, sizeof(dec_svc_seq_params_t));
  193|  24.2k|    ps_seq = ps_dec->pv_scratch_sps_pps;
  194|  24.2k|    memset(ps_seq, 0, sizeof(dec_seq_params_t));
  195|       |
  196|  24.2k|    ps_seq->u1_profile_idc = u1_profile_idc;
  197|  24.2k|    ps_seq->u1_level_idc = u1_level_idc;
  198|  24.2k|    ps_seq->u1_seq_parameter_set_id = u1_seq_parameter_set_id;
  199|       |
  200|       |    /* subset_seq_sps_will be stored from location 32 : MAX_NUM_SEQ_PARAMS*/
  201|  24.2k|    u1_seq_parameter_set_id += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  24.2k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  202|  24.2k|    ps_subset_seq->ps_seq = &ps_dec->ps_sps[u1_seq_parameter_set_id];
  203|       |
  204|  24.2k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (204:8): [True: 12.0k, False: 12.1k]
  ------------------
  205|  12.0k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (205:8): [True: 10.7k, False: 1.35k]
  ------------------
  206|  10.7k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_profile_idc != u1_profile_idc))
  ------------------
  |  Branch (206:8): [True: 295, False: 10.4k]
  ------------------
  207|    295|    {
  208|    295|        ps_dec->u1_res_changed = 1;
  209|    295|        return IVD_RES_CHANGED;
  210|    295|    }
  211|       |
  212|  23.9k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (212:8): [True: 11.7k, False: 12.1k]
  ------------------
  213|  11.7k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (213:8): [True: 10.4k, False: 1.35k]
  ------------------
  214|  10.4k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_level_idc != u1_level_idc))
  ------------------
  |  Branch (214:8): [True: 165, False: 10.2k]
  ------------------
  215|    165|    {
  216|    165|        ps_dec->u1_res_changed = 1;
  217|    165|        return IVD_RES_CHANGED;
  218|    165|    }
  219|       |    /*******************************************************************/
  220|       |    /* Initializations for high profile - Sushant                      */
  221|       |    /*******************************************************************/
  222|  23.7k|    ps_seq->i4_chroma_format_idc = 1;
  223|  23.7k|    ps_seq->i4_bit_depth_luma_minus8 = 0;
  224|  23.7k|    ps_seq->i4_bit_depth_chroma_minus8 = 0;
  225|  23.7k|    ps_seq->i4_qpprime_y_zero_transform_bypass_flag = 0;
  226|  23.7k|    ps_seq->i4_seq_scaling_matrix_present_flag = 0;
  227|  23.7k|    if(u1_profile_idc == HIGH_PROFILE_IDC || u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC ||
  ------------------
  |  |  278|  47.5k|#define HIGH_PROFILE_IDC   100
  ------------------
                  if(u1_profile_idc == HIGH_PROFILE_IDC || u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC ||
  ------------------
  |  |   59|  47.3k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (227:8): [True: 215, False: 23.5k]
  |  Branch (227:46): [True: 2.34k, False: 21.2k]
  ------------------
  228|  21.2k|       u1_profile_idc == SCALABLE_HIGH_PROFILE_IDC)
  ------------------
  |  |   60|  21.2k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (228:8): [True: 3.08k, False: 18.1k]
  ------------------
  229|  5.63k|    {
  230|       |        /* reading chroma_format_idc   */
  231|  5.63k|        ps_seq->i4_chroma_format_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  232|       |
  233|       |        /* Monochrome is not supported */
  234|  5.63k|        if(ps_seq->i4_chroma_format_idc != 1)
  ------------------
  |  Branch (234:12): [True: 249, False: 5.39k]
  ------------------
  235|    249|        {
  236|    249|            return ERROR_FEATURE_UNAVAIL;
  237|    249|        }
  238|       |
  239|       |        /* reading bit_depth_luma_minus8   */
  240|  5.39k|        ps_seq->i4_bit_depth_luma_minus8 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  241|       |
  242|  5.39k|        if(ps_seq->i4_bit_depth_luma_minus8 != 0)
  ------------------
  |  Branch (242:12): [True: 78, False: 5.31k]
  ------------------
  243|     78|        {
  244|     78|            return ERROR_FEATURE_UNAVAIL;
  245|     78|        }
  246|       |
  247|       |        /* reading bit_depth_chroma_minus8   */
  248|  5.31k|        ps_seq->i4_bit_depth_chroma_minus8 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  249|       |
  250|  5.31k|        if(ps_seq->i4_bit_depth_chroma_minus8 != 0)
  ------------------
  |  Branch (250:12): [True: 81, False: 5.23k]
  ------------------
  251|     81|        {
  252|     81|            return ERROR_FEATURE_UNAVAIL;
  253|     81|        }
  254|       |
  255|       |        /* reading qpprime_y_zero_transform_bypass_flag   */
  256|  5.23k|        ps_seq->i4_qpprime_y_zero_transform_bypass_flag = (WORD32) ih264d_get_bit_h264(ps_bitstrm);
  257|       |
  258|  5.23k|        if(ps_seq->i4_qpprime_y_zero_transform_bypass_flag != 0)
  ------------------
  |  Branch (258:12): [True: 70, False: 5.16k]
  ------------------
  259|     70|        {
  260|     70|            return ERROR_INV_SPS_PPS_T;
  261|     70|        }
  262|       |
  263|       |        /* reading seq_scaling_matrix_present_flag   */
  264|  5.16k|        ps_seq->i4_seq_scaling_matrix_present_flag = (WORD32) ih264d_get_bit_h264(ps_bitstrm);
  265|       |
  266|  5.16k|        if(ps_seq->i4_seq_scaling_matrix_present_flag)
  ------------------
  |  Branch (266:12): [True: 3.57k, False: 1.58k]
  ------------------
  267|  3.57k|        {
  268|  31.1k|            for(i4_i = 0; i4_i < 8; i4_i++)
  ------------------
  |  Branch (268:27): [True: 27.7k, False: 3.36k]
  ------------------
  269|  27.7k|            {
  270|  27.7k|                ps_seq->u1_seq_scaling_list_present_flag[i4_i] = ih264d_get_bit_h264(ps_bitstrm);
  271|       |
  272|       |                /* initialize u1_use_default_scaling_matrix_flag[i4_i] to zero */
  273|       |                /* before calling scaling list                             */
  274|  27.7k|                ps_seq->u1_use_default_scaling_matrix_flag[i4_i] = 0;
  275|       |
  276|  27.7k|                if(ps_seq->u1_seq_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (276:20): [True: 13.3k, False: 14.4k]
  ------------------
  277|  13.3k|                {
  278|  13.3k|                    if(i4_i < 6)
  ------------------
  |  Branch (278:24): [True: 10.2k, False: 3.10k]
  ------------------
  279|  10.2k|                    {
  280|  10.2k|                        ret = ih264d_scaling_list(ps_seq->i2_scalinglist4x4[i4_i], 16,
  281|  10.2k|                                                  &ps_seq->u1_use_default_scaling_matrix_flag[i4_i],
  282|  10.2k|                                                  ps_bitstrm);
  283|  10.2k|                    }
  284|  3.10k|                    else
  285|  3.10k|                    {
  286|  3.10k|                        ret = ih264d_scaling_list(ps_seq->i2_scalinglist8x8[i4_i - 6], 64,
  287|  3.10k|                                                  &ps_seq->u1_use_default_scaling_matrix_flag[i4_i],
  288|  3.10k|                                                  ps_bitstrm);
  289|  3.10k|                    }
  290|  13.3k|                    if(ret != OK)
  ------------------
  |  |  114|  13.3k|#define OK        0
  ------------------
  |  Branch (290:24): [True: 210, False: 13.1k]
  ------------------
  291|    210|                    {
  292|    210|                        return ret;
  293|    210|                    }
  294|  13.3k|                }
  295|  27.7k|            }
  296|  3.57k|        }
  297|  5.16k|    }
  298|       |    /*--------------------------------------------------------------------*/
  299|       |    /* Decode MaxFrameNum                                                 */
  300|       |    /*--------------------------------------------------------------------*/
  301|  23.0k|    u8_temp = (UWORD64) 4 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  302|  23.0k|    if(u8_temp > MAX_BITS_IN_FRAME_NUM)
  ------------------
  |  |  531|  23.0k|#define MAX_BITS_IN_FRAME_NUM     16
  ------------------
  |  Branch (302:8): [True: 210, False: 22.8k]
  ------------------
  303|    210|    {
  304|    210|        return ERROR_INV_SPS_PPS_T;
  305|    210|    }
  306|  22.8k|    ps_seq->u1_bits_in_frm_num = (UWORD8) u8_temp;
  307|  22.8k|    COPYTHECONTEXT("SPS: log2_max_frame_num_minus4", (ps_seq->u1_bits_in_frm_num - 4));
  308|       |
  309|  22.8k|    i2_max_frm_num = (1 << (ps_seq->u1_bits_in_frm_num));
  310|  22.8k|    ps_seq->u2_u4_max_pic_num_minus1 = i2_max_frm_num - 1;
  311|       |    /*--------------------------------------------------------------------*/
  312|       |    /* Decode picture order count and related values                      */
  313|       |    /*--------------------------------------------------------------------*/
  314|  22.8k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  315|       |
  316|  22.8k|    if(u4_temp > MAX_PIC_ORDER_CNT_TYPE)
  ------------------
  |  |  529|  22.8k|#define MAX_PIC_ORDER_CNT_TYPE    2
  ------------------
  |  Branch (316:8): [True: 197, False: 22.6k]
  ------------------
  317|    197|    {
  318|    197|        return ERROR_INV_POC_TYPE_T;
  319|    197|    }
  320|  22.6k|    ps_seq->u1_pic_order_cnt_type = u4_temp;
  321|  22.6k|    COPYTHECONTEXT("SPS: pic_order_cnt_type", ps_seq->u1_pic_order_cnt_type);
  322|       |
  323|  22.6k|    ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle = 1;
  324|  22.6k|    if(ps_seq->u1_pic_order_cnt_type == 0)
  ------------------
  |  Branch (324:8): [True: 17.1k, False: 5.46k]
  ------------------
  325|  17.1k|    {
  326|  17.1k|        u8_temp = (UWORD64) 4 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  327|  17.1k|        if(u8_temp > MAX_BITS_IN_POC_LSB)
  ------------------
  |  |  532|  17.1k|#define MAX_BITS_IN_POC_LSB       16
  ------------------
  |  Branch (327:12): [True: 132, False: 17.0k]
  ------------------
  328|    132|        {
  329|    132|            return ERROR_INV_SPS_PPS_T;
  330|    132|        }
  331|  17.0k|        ps_seq->u1_log2_max_pic_order_cnt_lsb_minus = (UWORD8) u8_temp;
  332|  17.0k|        ps_seq->i4_max_pic_order_cntLsb = (1 << u8_temp);
  333|  17.0k|        COPYTHECONTEXT("SPS: log2_max_pic_order_cnt_lsb_minus4", (u8_temp - 4));
  334|  17.0k|    }
  335|  5.46k|    else if(ps_seq->u1_pic_order_cnt_type == 1)
  ------------------
  |  Branch (335:13): [True: 2.73k, False: 2.73k]
  ------------------
  336|  2.73k|    {
  337|  2.73k|        ps_seq->u1_delta_pic_order_always_zero_flag = ih264d_get_bit_h264(ps_bitstrm);
  338|  2.73k|        COPYTHECONTEXT("SPS: delta_pic_order_always_zero_flag",
  339|  2.73k|                       ps_seq->u1_delta_pic_order_always_zero_flag);
  340|       |
  341|  2.73k|        ps_seq->i4_ofst_for_non_ref_pic = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  342|  2.73k|        COPYTHECONTEXT("SPS: offset_for_non_ref_pic", ps_seq->i4_ofst_for_non_ref_pic);
  343|       |
  344|  2.73k|        ps_seq->i4_ofst_for_top_to_bottom_field = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  345|  2.73k|        COPYTHECONTEXT("SPS: offset_for_top_to_bottom_field",
  346|  2.73k|                       ps_seq->i4_ofst_for_top_to_bottom_field);
  347|       |
  348|  2.73k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  349|  2.73k|        if(u4_temp > 255) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  Branch (349:12): [True: 136, False: 2.60k]
  ------------------
  350|  2.60k|        ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle = u4_temp;
  351|  2.60k|        COPYTHECONTEXT("SPS: num_ref_frames_in_pic_order_cnt_cycle",
  352|  2.60k|                       ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle);
  353|       |
  354|  18.9k|        for(i = 0; i < ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle; i++)
  ------------------
  |  Branch (354:20): [True: 16.3k, False: 2.60k]
  ------------------
  355|  16.3k|        {
  356|  16.3k|            ps_seq->i4_ofst_for_ref_frame[i] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  357|  16.3k|            COPYTHECONTEXT("SPS: offset_for_ref_frame", ps_seq->i4_ofst_for_ref_frame[i]);
  358|  16.3k|        }
  359|  2.60k|    }
  360|       |
  361|  22.3k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  362|       |
  363|  22.3k|    if((u4_temp > H264_MAX_REF_PICS))
  ------------------
  |  |  534|  22.3k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (363:8): [True: 170, False: 22.2k]
  ------------------
  364|    170|    {
  365|    170|        return ERROR_NUM_REF;
  366|    170|    }
  367|       |
  368|       |    /* Compare with older num_ref_frames is header is already once */
  369|  22.2k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (369:8): [True: 11.4k, False: 10.7k]
  ------------------
  370|  11.4k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (370:8): [True: 10.2k, False: 1.22k]
  ------------------
  371|  10.2k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_num_ref_frames != u4_temp))
  ------------------
  |  Branch (371:8): [True: 83, False: 10.1k]
  ------------------
  372|     83|    {
  373|     83|        ps_dec->u1_res_changed = 1;
  374|     83|        return IVD_RES_CHANGED;
  375|     83|    }
  376|  22.1k|    ps_seq->u1_num_ref_frames = u4_temp;
  377|  22.1k|    COPYTHECONTEXT("SPS: num_ref_frames", ps_seq->u1_num_ref_frames);
  378|       |
  379|  22.1k|    ps_seq->u1_gaps_in_frame_num_value_allowed_flag = ih264d_get_bit_h264(ps_bitstrm);
  380|  22.1k|    COPYTHECONTEXT("SPS: gaps_in_frame_num_value_allowed_flag",
  381|  22.1k|                   ps_seq->u1_gaps_in_frame_num_value_allowed_flag);
  382|       |    /* SVC_DEC_REVIEW */
  383|  22.1k|    ps_seq->u1_gaps_in_frame_num_value_allowed_flag = 0;
  384|       |
  385|       |    /*--------------------------------------------------------------------*/
  386|       |    /* Decode FrameWidth and FrameHeight and related values               */
  387|       |    /*--------------------------------------------------------------------*/
  388|  22.1k|    u8_temp = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  389|       |    /* Check  for unsupported resolutions*/
  390|  22.1k|    if(u8_temp > (H264_MAX_FRAME_WIDTH >> 4))
  ------------------
  |  |   39|  22.1k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (390:8): [True: 183, False: 21.9k]
  ------------------
  391|    183|    {
  392|    183|        return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
  393|    183|    }
  394|  21.9k|    u4_pic_width_in_mbs = (UWORD32) u8_temp;
  395|  21.9k|    COPYTHECONTEXT("SPS: pic_width_in_mbs_minus1", u4_pic_width_in_mbs - 1);
  396|       |
  397|  21.9k|    u8_temp = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  398|  21.9k|    if(u8_temp > (H264_MAX_FRAME_HEIGHT >> 4))
  ------------------
  |  |   40|  21.9k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (398:8): [True: 172, False: 21.7k]
  ------------------
  399|    172|    {
  400|    172|        return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
  401|    172|    }
  402|  21.7k|    u4_pic_height_in_map_units = (UWORD32) u8_temp;
  403|       |
  404|  21.7k|    ps_seq->u2_frm_wd_in_mbs = u4_pic_width_in_mbs;
  405|  21.7k|    ps_seq->u2_frm_ht_in_mbs = u4_pic_height_in_map_units;
  406|       |
  407|  21.7k|    u2_pic_wd = (u4_pic_width_in_mbs << 4);
  408|  21.7k|    u2_pic_ht = (u4_pic_height_in_map_units << 4);
  409|  21.7k|    if(ps_svc_lyr_dec->pic_width < u2_pic_wd)
  ------------------
  |  Branch (409:8): [True: 7.58k, False: 14.2k]
  ------------------
  410|  7.58k|    {
  411|  7.58k|        ps_svc_lyr_dec->pic_width = u2_pic_wd;
  412|  7.58k|    }
  413|  21.7k|    if(ps_svc_lyr_dec->pic_height < u2_pic_ht)
  ------------------
  |  Branch (413:8): [True: 7.62k, False: 14.1k]
  ------------------
  414|  7.62k|    {
  415|  7.62k|        ps_svc_lyr_dec->pic_height = u2_pic_ht;
  416|  7.62k|    }
  417|       |
  418|       |    /*--------------------------------------------------------------------*/
  419|       |    /* Get the value of MaxMbAddress and Number of bits needed for it     */
  420|       |    /*--------------------------------------------------------------------*/
  421|  21.7k|    ps_seq->u4_max_mb_addr = (ps_seq->u2_frm_wd_in_mbs * ps_seq->u2_frm_ht_in_mbs) - 1;
  422|       |
  423|  21.7k|    ps_seq->u4_total_num_of_mbs = ps_seq->u4_max_mb_addr + 1;
  424|       |
  425|  21.7k|    ps_seq->u1_level_idc = ih264d_correct_level_idc(u1_level_idc, ps_seq->u4_total_num_of_mbs);
  426|       |
  427|  21.7k|    u1_frm = ih264d_get_bit_h264(ps_bitstrm);
  428|       |
  429|  21.7k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (429:8): [True: 11.3k, False: 10.4k]
  ------------------
  430|  11.3k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (430:8): [True: 10.1k, False: 1.15k]
  ------------------
  431|  10.1k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_frame_mbs_only_flag != u1_frm))
  ------------------
  |  Branch (431:8): [True: 118, False: 10.0k]
  ------------------
  432|    118|    {
  433|    118|        ps_dec->u1_res_changed = 1;
  434|    118|        return IVD_RES_CHANGED;
  435|    118|    }
  436|  21.6k|    ps_seq->u1_frame_mbs_only_flag = u1_frm;
  437|       |
  438|  21.6k|    COPYTHECONTEXT("SPS: frame_mbs_only_flag", u1_frm);
  439|       |
  440|  21.6k|    if(!u1_frm) u1_mb_aff_flag = ih264d_get_bit_h264(ps_bitstrm);
  ------------------
  |  Branch (440:8): [True: 4.75k, False: 16.9k]
  ------------------
  441|  21.6k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (441:8): [True: 11.2k, False: 10.4k]
  ------------------
  442|  11.2k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (442:8): [True: 10.0k, False: 1.15k]
  ------------------
  443|  10.0k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_mb_aff_flag != u1_mb_aff_flag))
  ------------------
  |  Branch (443:8): [True: 115, False: 9.93k]
  ------------------
  444|    115|    {
  445|    115|        ps_dec->u1_res_changed = 1;
  446|    115|        return IVD_RES_CHANGED;
  447|    115|    }
  448|  21.5k|    if(!u1_frm)
  ------------------
  |  Branch (448:8): [True: 4.64k, False: 16.9k]
  ------------------
  449|  4.64k|    {
  450|  4.64k|        u2_pic_ht <<= 1;
  451|  4.64k|        ps_seq->u1_mb_aff_flag = u1_mb_aff_flag;
  452|  4.64k|        COPYTHECONTEXT("SPS: mb_adaptive_frame_field_flag", ps_seq->u1_mb_aff_flag);
  453|  4.64k|    }
  454|  16.9k|    else
  455|  16.9k|        ps_seq->u1_mb_aff_flag = 0;
  456|       |
  457|  21.5k|    ps_seq->u1_direct_8x8_inference_flag = ih264d_get_bit_h264(ps_bitstrm);
  458|       |
  459|  21.5k|    COPYTHECONTEXT("SPS: direct_8x8_inference_flag", ps_seq->u1_direct_8x8_inference_flag);
  460|       |
  461|       |    /* G050 */
  462|  21.5k|    u1_frame_cropping_flag = ih264d_get_bit_h264(ps_bitstrm);
  463|  21.5k|    COPYTHECONTEXT("SPS: frame_cropping_flag", u1_frame_cropping_flag);
  464|       |
  465|  21.5k|    if(u1_frame_cropping_flag)
  ------------------
  |  Branch (465:8): [True: 6.07k, False: 15.4k]
  ------------------
  466|  6.07k|    {
  467|  6.07k|        u1_frame_cropping_rect_left_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  468|  6.07k|        COPYTHECONTEXT("SPS: frame_cropping_rect_left_offset", u1_frame_cropping_rect_left_ofst);
  469|  6.07k|        u1_frame_cropping_rect_right_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  470|  6.07k|        COPYTHECONTEXT("SPS: frame_cropping_rect_right_offset", u1_frame_cropping_rect_right_ofst);
  471|  6.07k|        u1_frame_cropping_rect_top_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  472|  6.07k|        COPYTHECONTEXT("SPS: frame_cropping_rect_top_offset", u1_frame_cropping_rect_top_ofst);
  473|  6.07k|        u1_frame_cropping_rect_bottom_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  474|  6.07k|        COPYTHECONTEXT("SPS: frame_cropping_rect_bottom_offset",
  475|  6.07k|                       u1_frame_cropping_rect_bottom_ofst);
  476|  6.07k|    }
  477|       |    /* G050 */
  478|  21.5k|    ps_seq->u1_vui_parameters_present_flag = ih264d_get_bit_h264(ps_bitstrm);
  479|  21.5k|    COPYTHECONTEXT("SPS: vui_parameters_present_flag", ps_seq->u1_vui_parameters_present_flag);
  480|       |
  481|  21.5k|    u2_frm_wd_y = u2_pic_wd + (UWORD8) (PAD_LEN_Y_H << 1);
  ------------------
  |  |  571|  21.5k|#define PAD_LEN_Y_H                   32
  ------------------
  482|  21.5k|    if(1 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (482:8): [True: 0, False: 21.5k]
  ------------------
  483|      0|    {
  484|      0|        if(ps_dec->u4_app_disp_width > u2_frm_wd_y) u2_frm_wd_y = ps_dec->u4_app_disp_width;
  ------------------
  |  Branch (484:12): [True: 0, False: 0]
  ------------------
  485|      0|    }
  486|       |
  487|  21.5k|    u2_frm_ht_y = u2_pic_ht + (UWORD8) (PAD_LEN_Y_V << 2);
  ------------------
  |  |  572|  21.5k|#define PAD_LEN_Y_V                   20
  ------------------
  488|  21.5k|    u2_frm_wd_uv = u2_pic_wd + (UWORD8) (PAD_LEN_UV_H << 2);
  ------------------
  |  |  573|  21.5k|#define PAD_LEN_UV_H                  16
  ------------------
  489|  21.5k|    u2_frm_wd_uv = MAX(u2_frm_wd_uv, u2_frm_wd_y);
  ------------------
  |  |   60|  21.5k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
  490|       |
  491|  21.5k|    u2_frm_ht_uv = (u2_pic_ht >> 1) + (UWORD8) (PAD_LEN_UV_V << 2);
  ------------------
  |  |  574|  21.5k|#define PAD_LEN_UV_V                  8
  ------------------
  492|  21.5k|    u2_frm_ht_uv = MAX(u2_frm_ht_uv, (u2_frm_ht_y >> 1));
  ------------------
  |  |   60|  21.5k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 21.5k]
  |  |  ------------------
  ------------------
  493|       |
  494|       |    /* Calculate display picture width, height and start u4_ofst from YUV420 */
  495|       |    /* pictute buffers as per cropping information parsed above             */
  496|  21.5k|    {
  497|  21.5k|        UWORD16 u2_rgt_ofst = 0;
  498|  21.5k|        UWORD16 u2_lft_ofst = 0;
  499|  21.5k|        UWORD16 u2_top_ofst = 0;
  500|  21.5k|        UWORD16 u2_btm_ofst = 0;
  501|  21.5k|        UWORD8 u1_frm_mbs_flag;
  502|  21.5k|        UWORD8 u1_vert_mult_factor;
  503|       |
  504|  21.5k|        if(u1_frame_cropping_flag)
  ------------------
  |  Branch (504:12): [True: 6.07k, False: 15.4k]
  ------------------
  505|  6.07k|        {
  506|       |            /* Calculate right and left u4_ofst for cropped picture           */
  507|  6.07k|            u2_rgt_ofst = u1_frame_cropping_rect_right_ofst << 1;
  508|  6.07k|            u2_lft_ofst = u1_frame_cropping_rect_left_ofst << 1;
  509|       |
  510|       |            /* Know frame MBs only u4_flag                                      */
  511|  6.07k|            u1_frm_mbs_flag = (1 == ps_seq->u1_frame_mbs_only_flag);
  512|       |
  513|       |            /* Simplify the vertical u4_ofst calculation from field/frame     */
  514|  6.07k|            u1_vert_mult_factor = (2 - u1_frm_mbs_flag);
  515|       |
  516|       |            /* Calculate bottom and top u4_ofst for cropped  picture          */
  517|  6.07k|            u2_btm_ofst = (u1_frame_cropping_rect_bottom_ofst << u1_vert_mult_factor);
  518|  6.07k|            u2_top_ofst = (u1_frame_cropping_rect_top_ofst << u1_vert_mult_factor);
  519|  6.07k|        }
  520|       |
  521|       |        /* Calculate u4_ofst from start of YUV 420 picture buffer to start of*/
  522|       |        /* cropped picture buffer                                           */
  523|  21.5k|        u2_crop_offset_y = (u2_frm_wd_y * u2_top_ofst) + (u2_lft_ofst);
  524|  21.5k|        u2_crop_offset_uv =
  525|  21.5k|            (u2_frm_wd_uv * (u2_top_ofst >> 1)) + (u2_lft_ofst >> 1) * YUV420SP_FACTOR;
  ------------------
  |  |  119|  21.5k|#define YUV420SP_FACTOR 2
  ------------------
  526|       |        /* Calculate the display picture width and height based on crop      */
  527|       |        /* information                                                       */
  528|  21.5k|        i4_cropped_ht = (WORD32) u2_pic_ht - (WORD32) (u2_btm_ofst + u2_top_ofst);
  529|  21.5k|        i4_cropped_wd = (WORD32) u2_pic_wd - (WORD32) (u2_rgt_ofst + u2_lft_ofst);
  530|       |
  531|  21.5k|        if((i4_cropped_ht < MB_SIZE) || (i4_cropped_wd < MB_SIZE))
  ------------------
  |  |  554|  21.5k|#define MB_SIZE             16
  ------------------
                      if((i4_cropped_ht < MB_SIZE) || (i4_cropped_wd < MB_SIZE))
  ------------------
  |  |  554|  21.4k|#define MB_SIZE             16
  ------------------
  |  Branch (531:12): [True: 142, False: 21.4k]
  |  Branch (531:41): [True: 114, False: 21.3k]
  ------------------
  532|    256|        {
  533|    256|            return ERROR_INV_SPS_PPS_T;
  534|    256|        }
  535|       |
  536|  21.3k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (536:12): [True: 11.0k, False: 10.2k]
  ------------------
  537|  11.0k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (537:12): [True: 9.93k, False: 1.14k]
  ------------------
  538|  9.93k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_pic_wd != u2_pic_wd))
  ------------------
  |  Branch (538:12): [True: 84, False: 9.85k]
  ------------------
  539|     84|        {
  540|     84|            ps_dec->u1_res_changed = 1;
  541|     84|            return IVD_RES_CHANGED;
  542|     84|        }
  543|       |
  544|  21.2k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (544:12): [True: 11.0k, False: 10.2k]
  ------------------
  545|  11.0k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (545:12): [True: 9.85k, False: 1.14k]
  ------------------
  546|  9.85k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_disp_width != i4_cropped_wd))
  ------------------
  |  Branch (546:12): [True: 76, False: 9.77k]
  ------------------
  547|     76|        {
  548|     76|            ps_dec->u1_res_changed = 1;
  549|     76|            return IVD_RES_CHANGED;
  550|     76|        }
  551|       |
  552|  21.1k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (552:12): [True: 10.9k, False: 10.2k]
  ------------------
  553|  10.9k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (553:12): [True: 9.77k, False: 1.14k]
  ------------------
  554|  9.77k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_pic_ht != u2_pic_ht))
  ------------------
  |  Branch (554:12): [True: 93, False: 9.68k]
  ------------------
  555|     93|        {
  556|     93|            ps_dec->u1_res_changed = 1;
  557|     93|            return IVD_RES_CHANGED;
  558|     93|        }
  559|       |
  560|  21.0k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (560:12): [True: 10.8k, False: 10.2k]
  ------------------
  561|  10.8k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (561:12): [True: 9.68k, False: 1.14k]
  ------------------
  562|  9.68k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_disp_height != i4_cropped_ht))
  ------------------
  |  Branch (562:12): [True: 67, False: 9.61k]
  ------------------
  563|     67|        {
  564|     67|            ps_dec->u1_res_changed = 1;
  565|     67|            return IVD_RES_CHANGED;
  566|     67|        }
  567|       |        /* Check again for unsupported resolutions with updated values*/
  568|  20.9k|        if((u2_pic_wd > SVCD_MAX_FRAME_WIDTH) || (u2_pic_ht > SVCD_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   52|  20.9k|#define SVCD_MAX_FRAME_WIDTH 4096
  ------------------
                      if((u2_pic_wd > SVCD_MAX_FRAME_WIDTH) || (u2_pic_ht > SVCD_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   53|  20.9k|#define SVCD_MAX_FRAME_HEIGHT 4096
  ------------------
  |  Branch (568:12): [True: 0, False: 20.9k]
  |  Branch (568:50): [True: 89, False: 20.8k]
  ------------------
  569|  20.8k|           (u2_pic_wd < SVCD_MIN_FRAME_WIDTH) || (u2_pic_ht < SVCD_MIN_FRAME_HEIGHT) ||
  ------------------
  |  |   56|  20.8k|#define SVCD_MIN_FRAME_WIDTH 32
  ------------------
                         (u2_pic_wd < SVCD_MIN_FRAME_WIDTH) || (u2_pic_ht < SVCD_MIN_FRAME_HEIGHT) ||
  ------------------
  |  |   57|  20.7k|#define SVCD_MIN_FRAME_HEIGHT 32
  ------------------
  |  Branch (569:12): [True: 160, False: 20.7k]
  |  Branch (569:50): [True: 112, False: 20.6k]
  ------------------
  570|  20.6k|           (u2_pic_wd * (UWORD32) u2_pic_ht > SVCD_MAX_FRAME_SIZE))
  ------------------
  |  |   54|  20.6k|#define SVCD_MAX_FRAME_SIZE (4096 * 4096)
  ------------------
  |  Branch (570:12): [True: 0, False: 20.6k]
  ------------------
  571|    361|        {
  572|    361|            return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
  573|    361|        }
  574|       |
  575|       |        /* If MBAff is enabled, decoder support is limited to streams with
  576|       |         * width less than half of H264_MAX_FRAME_WIDTH.
  577|       |         * In case of MBAff decoder processes two rows at a time
  578|       |         */
  579|  20.6k|        if((u2_pic_wd << ps_seq->u1_mb_aff_flag) > H264_MAX_FRAME_WIDTH)
  ------------------
  |  |   39|  20.6k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (579:12): [True: 128, False: 20.4k]
  ------------------
  580|    128|        {
  581|    128|            return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
  582|    128|        }
  583|  20.6k|    }
  584|       |
  585|  20.4k|    if(1 == ps_seq->u1_vui_parameters_present_flag)
  ------------------
  |  Branch (585:8): [True: 4.11k, False: 16.3k]
  ------------------
  586|  4.11k|    {
  587|  4.11k|        ret = ih264d_parse_vui_parametres(&ps_seq->s_vui, ps_bitstrm);
  588|  4.11k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  4.11k|#define OK        0
  ------------------
  |  Branch (588:12): [True: 270, False: 3.84k]
  ------------------
  589|  4.11k|    }
  590|  20.2k|    ps_seq_svc_ext = &ps_subset_seq->s_sps_svc_ext;
  591|       |
  592|  20.2k|    isvcd_set_default_seq_svc_ext(ps_seq_svc_ext);
  593|       |
  594|  20.2k|    if(SCALABLE_BASELINE_PROFILE_IDC == ps_seq->u1_profile_idc ||
  ------------------
  |  |   59|  20.2k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (594:8): [True: 1.99k, False: 18.2k]
  ------------------
  595|  18.2k|       SCALABLE_HIGH_PROFILE_IDC == ps_seq->u1_profile_idc)
  ------------------
  |  |   60|  18.2k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (595:8): [True: 2.64k, False: 15.5k]
  ------------------
  596|  4.64k|    {
  597|  4.64k|        SWITCHONTRACE;
  598|  4.64k|        ps_seq_svc_ext->u1_inter_layer_deblocking_filter_control_present_flag =
  599|  4.64k|            ih264d_get_bit_h264(ps_bitstrm);
  600|  4.64k|        COPYTHECONTEXT("SPS_EXt: u1_inter_layer_deblocking_filter_control_present_flag",
  601|  4.64k|                       ps_seq_svc_ext->u1_inter_layer_deblocking_filter_control_present_flag);
  602|       |
  603|  4.64k|        ps_seq_svc_ext->u1_extended_spatial_scalability_idc = ih264d_get_bits_h264(ps_bitstrm, 2);
  604|  4.64k|        COPYTHECONTEXT("SPS_EXt: u1_extended_spatial_scalability_idc",
  605|  4.64k|                       ps_seq_svc_ext->u1_extended_spatial_scalability_idc);
  606|       |
  607|       |        /* u1_extended_spatial_scalability_idc value 0, 1 and 2 are supported */
  608|  4.64k|        if(ps_seq_svc_ext->u1_extended_spatial_scalability_idc > 2)
  ------------------
  |  Branch (608:12): [True: 107, False: 4.54k]
  ------------------
  609|    107|        {
  610|    107|            return ERROR_SVC_INV_SUBSET_SPS;
  611|    107|        }
  612|       |
  613|       |        /* ChromaArrayType = i4_chroma_format_idc  if  separate_colour_plane_flag =
  614|       |         * 0 for all chroma format except 4:4:4 */
  615|  4.54k|        if(1 == ps_seq->i4_chroma_format_idc || 2 == ps_seq->i4_chroma_format_idc)
  ------------------
  |  Branch (615:12): [True: 4.54k, False: 0]
  |  Branch (615:49): [True: 0, False: 0]
  ------------------
  616|  4.54k|        {
  617|  4.54k|            ps_seq_svc_ext->u1_chroma_phase_x_plus1_flag = ih264d_get_bit_h264(ps_bitstrm);
  618|  4.54k|            COPYTHECONTEXT("SPS_EXt: u1_chroma_phase_x_plus1_flag",
  619|  4.54k|                           ps_seq_svc_ext->u1_chroma_phase_x_plus1_flag);
  620|  4.54k|        }
  621|       |
  622|  4.54k|        if(1 == ps_seq->i4_chroma_format_idc)
  ------------------
  |  Branch (622:12): [True: 4.54k, False: 0]
  ------------------
  623|  4.54k|        {
  624|  4.54k|            ps_seq_svc_ext->u1_chroma_phase_y_plus1 = ih264d_get_bits_h264(ps_bitstrm, 2);
  625|  4.54k|            COPYTHECONTEXT("SPS_EXt: u1_chroma_phase_y_plus1",
  626|  4.54k|                           ps_seq_svc_ext->u1_chroma_phase_y_plus1);
  627|       |
  628|  4.54k|            if(ps_seq_svc_ext->u1_chroma_phase_y_plus1 >= 3)
  ------------------
  |  Branch (628:16): [True: 69, False: 4.47k]
  ------------------
  629|     69|            {
  630|     69|                return ERROR_SVC_INV_SUBSET_SPS;
  631|     69|            }
  632|  4.54k|        }
  633|       |
  634|       |        /* inferred values not covered in isvcd_set_default_seq_svc_ext*/
  635|  4.47k|        ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_x_plus1_flag =
  636|  4.47k|            ps_seq_svc_ext->u1_chroma_phase_x_plus1_flag;
  637|  4.47k|        ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_y_plus1 =
  638|  4.47k|            ps_seq_svc_ext->u1_chroma_phase_y_plus1;
  639|       |
  640|  4.47k|        if(1 == ps_seq_svc_ext->u1_extended_spatial_scalability_idc)
  ------------------
  |  Branch (640:12): [True: 1.43k, False: 3.03k]
  ------------------
  641|  1.43k|        {
  642|  1.43k|            if(ps_seq->i4_chroma_format_idc > 0)
  ------------------
  |  Branch (642:16): [True: 1.43k, False: 0]
  ------------------
  643|  1.43k|            {
  644|  1.43k|                ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_x_plus1_flag =
  645|  1.43k|                    ih264d_get_bit_h264(ps_bitstrm);
  646|  1.43k|                COPYTHECONTEXT("SPS_EXt: u1_seq_ref_layer_chroma_phase_x_plus1_flag",
  647|  1.43k|                               ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_x_plus1_flag);
  648|       |
  649|  1.43k|                ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_y_plus1 =
  650|  1.43k|                    ih264d_get_bits_h264(ps_bitstrm, 2);
  651|  1.43k|                COPYTHECONTEXT("SPS_EXt: u1_seq_ref_layer_chroma_phase_y_plus1",
  652|  1.43k|                               ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_y_plus1);
  653|       |
  654|  1.43k|                if(ps_seq_svc_ext->u1_seq_ref_layer_chroma_phase_y_plus1 >= 3)
  ------------------
  |  Branch (654:20): [True: 68, False: 1.36k]
  ------------------
  655|     68|                {
  656|     68|                    return ERROR_SVC_INV_SUBSET_SPS;
  657|     68|                }
  658|  1.43k|            }
  659|       |
  660|  1.36k|            ps_seq_svc_ext->i4_seq_scaled_ref_layer_left_offset =
  661|  1.36k|                ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  662|  1.36k|            COPYTHECONTEXT("SPS_EXt: i4_seq_scaled_ref_layer_left_offset",
  663|  1.36k|                           ps_seq_svc_ext->i4_seq_scaled_ref_layer_left_offset);
  664|       |
  665|  1.36k|            if(ps_seq_svc_ext->i4_seq_scaled_ref_layer_left_offset != 0)
  ------------------
  |  Branch (665:16): [True: 131, False: 1.23k]
  ------------------
  666|    131|            {
  667|    131|                return ERROR_SVC_INV_SUBSET_SPS;
  668|    131|            }
  669|       |
  670|  1.23k|            if(ps_seq_svc_ext->i4_seq_scaled_ref_layer_left_offset >= MAX_SCLD_REF_LAYER_OFFSET ||
  ------------------
  |  |   71|  2.46k|#define MAX_SCLD_REF_LAYER_OFFSET 32768
  ------------------
  |  Branch (670:16): [True: 0, False: 1.23k]
  ------------------
  671|  1.23k|               ps_seq_svc_ext->i4_seq_scaled_ref_layer_left_offset < MIN_SCLD_REF_LAYER_OFFSET)
  ------------------
  |  |   72|  1.23k|#define MIN_SCLD_REF_LAYER_OFFSET -32768
  ------------------
  |  Branch (671:16): [True: 0, False: 1.23k]
  ------------------
  672|      0|            {
  673|      0|                return ERROR_SVC_INV_SUBSET_SPS;
  674|      0|            }
  675|       |
  676|  1.23k|            ps_seq_svc_ext->i4_seq_scaled_ref_layer_top_offset =
  677|  1.23k|                ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  678|  1.23k|            COPYTHECONTEXT("SPS_EXt: i4_seq_scaled_ref_layer_top_offset",
  679|  1.23k|                           ps_seq_svc_ext->i4_seq_scaled_ref_layer_top_offset);
  680|       |
  681|  1.23k|            if(ps_seq_svc_ext->i4_seq_scaled_ref_layer_top_offset != 0)
  ------------------
  |  Branch (681:16): [True: 133, False: 1.10k]
  ------------------
  682|    133|            {
  683|    133|                return ERROR_SVC_INV_SUBSET_SPS;
  684|    133|            }
  685|       |
  686|  1.10k|            if(ps_seq_svc_ext->i4_seq_scaled_ref_layer_top_offset >= MAX_SCLD_REF_LAYER_OFFSET ||
  ------------------
  |  |   71|  2.20k|#define MAX_SCLD_REF_LAYER_OFFSET 32768
  ------------------
  |  Branch (686:16): [True: 0, False: 1.10k]
  ------------------
  687|  1.10k|               ps_seq_svc_ext->i4_seq_scaled_ref_layer_top_offset < MIN_SCLD_REF_LAYER_OFFSET)
  ------------------
  |  |   72|  1.10k|#define MIN_SCLD_REF_LAYER_OFFSET -32768
  ------------------
  |  Branch (687:16): [True: 0, False: 1.10k]
  ------------------
  688|      0|            {
  689|      0|                return ERROR_SVC_INV_SUBSET_SPS;
  690|      0|            }
  691|       |
  692|  1.10k|            ps_seq_svc_ext->i4_seq_scaled_ref_layer_right_offset =
  693|  1.10k|                ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  694|  1.10k|            COPYTHECONTEXT("SPS_EXt: i4_seq_scaled_ref_layer_right_offset",
  695|  1.10k|                           ps_seq_svc_ext->i4_seq_scaled_ref_layer_right_offset);
  696|       |
  697|  1.10k|            if(ps_seq_svc_ext->i4_seq_scaled_ref_layer_right_offset >= MAX_SCLD_REF_LAYER_OFFSET ||
  ------------------
  |  |   71|  2.20k|#define MAX_SCLD_REF_LAYER_OFFSET 32768
  ------------------
  |  Branch (697:16): [True: 84, False: 1.01k]
  ------------------
  698|  1.01k|               ps_seq_svc_ext->i4_seq_scaled_ref_layer_right_offset < MIN_SCLD_REF_LAYER_OFFSET)
  ------------------
  |  |   72|  1.01k|#define MIN_SCLD_REF_LAYER_OFFSET -32768
  ------------------
  |  Branch (698:16): [True: 77, False: 940]
  ------------------
  699|    161|            {
  700|    161|                return ERROR_SVC_INV_SUBSET_SPS;
  701|    161|            }
  702|       |
  703|    940|            ps_seq_svc_ext->i4_seq_scaled_ref_layer_bottom_offset =
  704|    940|                ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  705|    940|            COPYTHECONTEXT("SPS_EXt: i4_seq_scaled_ref_layer_bottom_offset",
  706|    940|                           ps_seq_svc_ext->i4_seq_scaled_ref_layer_bottom_offset);
  707|       |
  708|    940|            if(ps_seq_svc_ext->i4_seq_scaled_ref_layer_bottom_offset >= MAX_SCLD_REF_LAYER_OFFSET ||
  ------------------
  |  |   71|  1.88k|#define MAX_SCLD_REF_LAYER_OFFSET 32768
  ------------------
  |  Branch (708:16): [True: 101, False: 839]
  ------------------
  709|    839|               ps_seq_svc_ext->i4_seq_scaled_ref_layer_bottom_offset < MIN_SCLD_REF_LAYER_OFFSET)
  ------------------
  |  |   72|    839|#define MIN_SCLD_REF_LAYER_OFFSET -32768
  ------------------
  |  Branch (709:16): [True: 95, False: 744]
  ------------------
  710|    196|            {
  711|    196|                return ERROR_INV_SLICE_HDR_T;
  712|    196|            }
  713|    940|        }
  714|       |
  715|  3.78k|        ps_seq_svc_ext->u1_seq_tcoeff_level_prediction_flag = ih264d_get_bit_h264(ps_bitstrm);
  716|  3.78k|        COPYTHECONTEXT("SPS_EXt: u1_seq_tcoeff_level_prediction_flag",
  717|  3.78k|                       ps_seq_svc_ext->u1_seq_tcoeff_level_prediction_flag);
  718|       |
  719|  3.78k|        if(1 == ps_seq_svc_ext->u1_seq_tcoeff_level_prediction_flag)
  ------------------
  |  Branch (719:12): [True: 2.56k, False: 1.22k]
  ------------------
  720|  2.56k|        {
  721|  2.56k|            ps_seq_svc_ext->u1_adaptive_tcoeff_level_prediction_flag =
  722|  2.56k|                ih264d_get_bit_h264(ps_bitstrm);
  723|  2.56k|            COPYTHECONTEXT("SPS_EXt: u1_adaptive_tcoeff_level_prediction_flag",
  724|  2.56k|                           ps_seq_svc_ext->u1_adaptive_tcoeff_level_prediction_flag);
  725|  2.56k|        }
  726|       |
  727|  3.78k|        ps_seq_svc_ext->u1_slice_header_restriction_flag = ih264d_get_bit_h264(ps_bitstrm);
  728|  3.78k|        COPYTHECONTEXT("SPS_EXt: u1_slice_header_restriction_flag",
  729|  3.78k|                       ps_seq_svc_ext->u1_slice_header_restriction_flag);
  730|       |
  731|  3.78k|        ps_seq_svc_ext->u1_svc_vui_parameters_present_flag = ih264d_get_bit_h264(ps_bitstrm);
  732|  3.78k|        COPYTHECONTEXT("SPS_EXt: u1_svc_vui_parameters_present_flag",
  733|  3.78k|                       ps_seq_svc_ext->u1_svc_vui_parameters_present_flag);
  734|       |
  735|  3.78k|        if(1 == ps_seq_svc_ext->u1_svc_vui_parameters_present_flag)
  ------------------
  |  Branch (735:12): [True: 1.25k, False: 2.52k]
  ------------------
  736|  1.25k|        {
  737|  1.25k|            if(NULL ==
  ------------------
  |  Branch (737:16): [True: 446, False: 809]
  ------------------
  738|  1.25k|               ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].s_sps_svc_ext.ps_svc_vui_ext)
  739|    446|            {
  740|    446|                void *pv_buf;
  741|    446|                UWORD32 size;
  742|       |                /* Memory allocation only if VUI is enabled in a particular subset SPS*/
  743|    446|                size = sizeof(svc_vui_ext_t);
  744|    446|                pv_buf = ps_dec->pf_aligned_alloc(ps_dec->pv_mem_ctxt, 128, size);
  745|    446|                RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|    446|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 446]
  |  |  ------------------
  ------------------
  746|    446|                memset(pv_buf, 0, size);
  747|    446|                ps_seq_svc_ext->ps_svc_vui_ext = pv_buf;
  748|    446|                ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id]
  749|    446|                    .s_sps_svc_ext.ps_svc_vui_ext = pv_buf;
  750|    446|            }
  751|    809|            else
  752|    809|            {
  753|    809|                ps_seq_svc_ext->ps_svc_vui_ext =
  754|    809|                    ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id]
  755|    809|                        .s_sps_svc_ext.ps_svc_vui_ext;
  756|    809|            }
  757|  1.25k|            ret = isvcd_parse_vui_ext_parametres(ps_seq_svc_ext->ps_svc_vui_ext, ps_bitstrm);
  758|  1.25k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  1.25k|#define OK        0
  ------------------
  |  Branch (758:16): [True: 314, False: 941]
  ------------------
  759|  1.25k|        }
  760|  3.78k|    }
  761|       |    /* Add conditions for SCALABLE BASELINE PROFILE */
  762|  19.0k|    if(SCALABLE_BASELINE_PROFILE_IDC == ps_seq->u1_profile_idc ||
  ------------------
  |  |   59|  19.0k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (762:8): [True: 1.79k, False: 17.2k]
  ------------------
  763|  17.2k|       ((SCALABLE_HIGH_PROFILE_IDC == ps_seq->u1_profile_idc) && (1 == uc_constraint_set0_flag)))
  ------------------
  |  |   60|  17.2k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (763:9): [True: 1.67k, False: 15.5k]
  |  Branch (763:66): [True: 285, False: 1.38k]
  ------------------
  764|  2.08k|    {
  765|  2.08k|        if(ps_seq->i4_chroma_format_idc != 1)
  ------------------
  |  Branch (765:12): [True: 0, False: 2.08k]
  ------------------
  766|      0|        {
  767|      0|            return ERROR_FEATURE_UNAVAIL;
  768|      0|        }
  769|       |
  770|  2.08k|        if(ps_seq->i4_bit_depth_luma_minus8 != 0)
  ------------------
  |  Branch (770:12): [True: 0, False: 2.08k]
  ------------------
  771|      0|        {
  772|      0|            return ERROR_FEATURE_UNAVAIL;
  773|      0|        }
  774|       |
  775|  2.08k|        if(ps_seq->i4_bit_depth_chroma_minus8 != 0)
  ------------------
  |  Branch (775:12): [True: 0, False: 2.08k]
  ------------------
  776|      0|        {
  777|      0|            return ERROR_FEATURE_UNAVAIL;
  778|      0|        }
  779|       |
  780|  2.08k|        if(ps_seq->i4_qpprime_y_zero_transform_bypass_flag != 0)
  ------------------
  |  Branch (780:12): [True: 0, False: 2.08k]
  ------------------
  781|      0|        {
  782|      0|            return ERROR_FEATURE_UNAVAIL;
  783|      0|        }
  784|       |
  785|  2.08k|        if(ps_seq->u1_frame_mbs_only_flag != 1)
  ------------------
  |  Branch (785:12): [True: 210, False: 1.87k]
  ------------------
  786|    210|        {
  787|    210|            return ERROR_FEATURE_UNAVAIL;
  788|    210|        }
  789|       |
  790|  1.87k|        if((0 != ps_seq_svc_ext->i4_seq_scaled_ref_layer_left_offset % 16) &&
  ------------------
  |  Branch (790:12): [True: 0, False: 1.87k]
  ------------------
  791|      0|           (0 != ps_seq_svc_ext->i4_seq_scaled_ref_layer_top_offset % 16))
  ------------------
  |  Branch (791:12): [True: 0, False: 0]
  ------------------
  792|      0|        {
  793|      0|            return ERROR_FEATURE_UNAVAIL;
  794|      0|        }
  795|  1.87k|    }
  796|       |    /* Compare older num_reorder_frames with the new one if header is already
  797|       |     * decoded */
  798|  18.8k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (798:8): [True: 10.7k, False: 8.11k]
  ------------------
  799|  10.7k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (799:8): [True: 9.61k, False: 1.10k]
  ------------------
  800|  9.61k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_vui_parameters_present_flag) &&
  ------------------
  |  Branch (800:8): [True: 1.38k, False: 8.23k]
  ------------------
  801|  1.38k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].s_vui.u1_bitstream_restriction_flag))
  ------------------
  |  Branch (801:8): [True: 76, False: 1.30k]
  ------------------
  802|     76|    {
  803|     76|        ps_dec->u1_res_changed = 1;
  804|     76|        return IVD_RES_CHANGED;
  805|     76|    }
  806|       |    /* In case bitstream read has exceeded the filled size, then return an error */
  807|  18.7k|    if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|  18.7k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 604, False: 18.1k]
  |  |  ------------------
  ------------------
  808|    604|    {
  809|    604|        return ERROR_INV_SPS_PPS_T;
  810|    604|    }
  811|       |
  812|       |    /*--------------------------------------------------------------------*/
  813|       |    /* All initializations to ps_dec are beyond this point                */
  814|       |    /*--------------------------------------------------------------------*/
  815|  18.1k|    {
  816|  18.1k|        WORD32 reorder_depth = ih264d_get_dpb_size(ps_seq);
  817|  18.1k|        if((1 == ps_seq->u1_vui_parameters_present_flag) &&
  ------------------
  |  Branch (817:12): [True: 3.19k, False: 14.9k]
  ------------------
  818|  3.19k|           (1 == ps_seq->s_vui.u1_bitstream_restriction_flag))
  ------------------
  |  Branch (818:12): [True: 217, False: 2.98k]
  ------------------
  819|    217|        {
  820|    217|            reorder_depth = ps_seq->s_vui.u4_num_reorder_frames + 1;
  821|    217|        }
  822|       |
  823|  18.1k|        if(reorder_depth > H264_MAX_REF_PICS)
  ------------------
  |  |  534|  18.1k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (823:12): [True: 66, False: 18.0k]
  ------------------
  824|     66|        {
  825|     66|            return ERROR_INV_SPS_PPS_T;
  826|     66|        }
  827|       |
  828|  18.0k|        if(ps_seq->u1_frame_mbs_only_flag != 1) reorder_depth *= 2;
  ------------------
  |  Branch (828:12): [True: 2.32k, False: 15.7k]
  ------------------
  829|  18.0k|        ps_subset_seq->i4_reorder_depth = reorder_depth + DISPLAY_LATENCY;
  ------------------
  |  |   51|  18.0k|#define DISPLAY_LATENCY         2
  ------------------
  830|  18.0k|    }
  831|      0|    ps_subset_seq->u2_disp_height = i4_cropped_ht;
  832|  18.0k|    ps_subset_seq->u2_disp_width = i4_cropped_wd;
  833|  18.0k|    ps_subset_seq->u2_pic_wd = u2_pic_wd;
  834|  18.0k|    ps_subset_seq->u2_pic_ht = u2_pic_ht;
  835|       |
  836|       |    /* Assuming 8k is the maximum resolution svc dec supports*/
  837|  18.0k|    if(u2_frm_wd_y > H264_MAX_FRAME_WIDTH) return (NOT_OK);
  ------------------
  |  |   39|  18.0k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                  if(u2_frm_wd_y > H264_MAX_FRAME_WIDTH) return (NOT_OK);
  ------------------
  |  |  116|    211|#define NOT_OK    -1
  ------------------
  |  Branch (837:8): [True: 211, False: 17.8k]
  ------------------
  838|  17.8k|    if(u2_frm_ht_y > H264_MAX_FRAME_HEIGHT) return (NOT_OK);
  ------------------
  |  |   40|  17.8k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                  if(u2_frm_ht_y > H264_MAX_FRAME_HEIGHT) return (NOT_OK);
  ------------------
  |  |  116|     71|#define NOT_OK    -1
  ------------------
  |  Branch (838:8): [True: 71, False: 17.8k]
  ------------------
  839|  17.8k|    if(u2_frm_wd_uv > H264_MAX_FRAME_WIDTH) return (NOT_OK);
  ------------------
  |  |   39|  17.8k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
                  if(u2_frm_wd_uv > H264_MAX_FRAME_WIDTH) return (NOT_OK);
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (839:8): [True: 0, False: 17.8k]
  ------------------
  840|  17.8k|    if(u2_frm_ht_uv > H264_MAX_FRAME_HEIGHT) return (NOT_OK);
  ------------------
  |  |   40|  17.8k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
                  if(u2_frm_ht_uv > H264_MAX_FRAME_HEIGHT) return (NOT_OK);
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  |  Branch (840:8): [True: 0, False: 17.8k]
  ------------------
  841|       |
  842|       |    /* Determining the Width and Height of Frame from that of Picture */
  843|  17.8k|    ps_subset_seq->u2_frm_wd_y = u2_frm_wd_y;
  844|  17.8k|    ps_subset_seq->u2_frm_ht_y = u2_frm_ht_y;
  845|  17.8k|    ps_subset_seq->u2_frm_wd_uv = u2_frm_wd_uv;
  846|  17.8k|    ps_subset_seq->u2_frm_ht_uv = u2_frm_ht_uv;
  847|       |
  848|  17.8k|    ps_subset_seq->u1_pad_len_y_v = (UWORD8) (PAD_LEN_Y_V << (1 - u1_frm));
  ------------------
  |  |  572|  17.8k|#define PAD_LEN_Y_V                   20
  ------------------
  849|  17.8k|    ps_subset_seq->u1_pad_len_cr_v = (UWORD8) (PAD_LEN_UV_V << (1 - u1_frm));
  ------------------
  |  |  574|  17.8k|#define PAD_LEN_UV_V                  8
  ------------------
  850|       |
  851|  17.8k|    ps_subset_seq->u2_crop_offset_y = u2_crop_offset_y;
  852|  17.8k|    ps_subset_seq->u2_crop_offset_uv = u2_crop_offset_uv;
  853|       |
  854|  17.8k|    ps_seq->u1_is_valid = TRUE;
  ------------------
  |  |  591|  17.8k|#define TRUE    1
  ------------------
  855|  17.8k|    ps_dec->ps_sps[u1_seq_parameter_set_id] = *ps_seq;
  856|  17.8k|    if(NULL != ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].s_sps_svc_ext.ps_svc_vui_ext)
  ------------------
  |  Branch (856:8): [True: 764, False: 17.0k]
  ------------------
  857|    764|    {
  858|    764|        ps_seq_svc_ext->ps_svc_vui_ext =
  859|    764|            ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].s_sps_svc_ext.ps_svc_vui_ext;
  860|    764|    }
  861|  17.8k|    ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id] = *ps_subset_seq;
  862|  17.8k|    ps_svc_lyr_dec->ps_cur_subset_sps = &ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id];
  863|       |
  864|  17.8k|    return OK;
  ------------------
  |  |  114|  17.8k|#define OK        0
  ------------------
  865|  17.8k|}
isvcd_parse_nal_unit:
  943|   178k|{
  944|   178k|    dec_bit_stream_t *ps_bitstrm;
  945|       |
  946|   178k|    dec_struct_t *ps_dec;
  947|   178k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec;
  948|   178k|    UWORD8 u1_nal_unit_type;
  949|   178k|    WORD32 i_status = OK;
  ------------------
  |  |  114|   178k|#define OK        0
  ------------------
  950|       |
  951|   178k|    ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) dec_svc_hdl;
  952|   178k|    ps_dec = &ps_svc_lyr_dec->s_dec;
  953|       |
  954|   178k|    {
  955|   178k|        SWITCHOFFTRACE;
  956|   178k|        u1_nal_unit_type = ps_dec->u1_nal_unit_type;
  957|       |
  958|   178k|        ps_bitstrm = ps_dec->ps_bitstrm;
  959|       |
  960|       |        // Skip all NALUs if SPS and PPS are not decoded
  961|   178k|        switch(u1_nal_unit_type)
  962|   178k|        {
  963|      0|            case SLICE_DATA_PARTITION_A_NAL:
  ------------------
  |  |  325|      0|#define SLICE_DATA_PARTITION_A_NAL      2
  ------------------
  |  Branch (963:13): [True: 0, False: 178k]
  ------------------
  964|      0|            case SLICE_DATA_PARTITION_B_NAL:
  ------------------
  |  |  326|      0|#define SLICE_DATA_PARTITION_B_NAL      3
  ------------------
  |  Branch (964:13): [True: 0, False: 178k]
  ------------------
  965|      0|            case SLICE_DATA_PARTITION_C_NAL:
  ------------------
  |  |  327|      0|#define SLICE_DATA_PARTITION_C_NAL      4
  ------------------
  |  Branch (965:13): [True: 0, False: 178k]
  ------------------
  966|      0|                if(!ps_dec->i4_decode_header) ih264d_parse_slice_partition(ps_dec, ps_bitstrm);
  ------------------
  |  Branch (966:20): [True: 0, False: 0]
  ------------------
  967|      0|                break;
  968|       |
  969|   111k|            case IDR_SLICE_NAL:
  ------------------
  |  |  328|   111k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (969:13): [True: 111k, False: 66.9k]
  ------------------
  970|   135k|            case SLICE_NAL:
  ------------------
  |  |  324|   135k|#define SLICE_NAL                       1
  ------------------
  |  Branch (970:13): [True: 24.4k, False: 153k]
  ------------------
  971|       |
  972|   135k|                if(ps_svc_lyr_dec->u1_base_res_flag != 1)
  ------------------
  |  Branch (972:20): [True: 66, False: 135k]
  ------------------
  973|     66|                {
  974|     66|                    return NOT_OK;
  ------------------
  |  |  116|     66|#define NOT_OK    -1
  ------------------
  975|     66|                }
  976|   135k|                if(!ps_dec->i4_decode_header)
  ------------------
  |  Branch (976:20): [True: 135k, False: 0]
  ------------------
  977|   135k|                {
  978|   135k|                    if(ps_dec->i4_header_decoded == 3)
  ------------------
  |  Branch (978:24): [True: 135k, False: 0]
  ------------------
  979|   135k|                    {
  980|       |                        /* ! */
  981|   135k|                        DEBUG_THREADS_PRINTF("Decoding  a slice NAL\n");
  982|   135k|                        {
  983|   135k|                            ih264d_get_pre_sei_params(ps_dec, u1_nal_unit_type);
  984|       |                            /* ! */
  985|   135k|                            ps_dec->u4_slice_start_code_found = 1;
  986|       |
  987|   135k|                            i_status = isvcd_parse_decode_slice(
  988|   135k|                                (UWORD8) (u1_nal_unit_type == IDR_SLICE_NAL), u1_nal_ref_idc,
  ------------------
  |  |  328|   135k|#define IDR_SLICE_NAL                   5
  ------------------
  989|   135k|                                ps_svc_lyr_dec);
  990|       |
  991|   135k|                            if(i_status != OK)
  ------------------
  |  |  114|   135k|#define OK        0
  ------------------
  |  Branch (991:32): [True: 80.4k, False: 55.2k]
  ------------------
  992|  80.4k|                            {
  993|  80.4k|                                return i_status;
  994|  80.4k|                            }
  995|   135k|                        }
  996|   135k|                    }
  997|   135k|                }
  998|  55.2k|                break;
  999|       |
 1000|  55.2k|            case SEI_NAL:
  ------------------
  |  |  329|      0|#define SEI_NAL                         6
  ------------------
  |  Branch (1000:13): [True: 0, False: 178k]
  ------------------
 1001|      0|            case PREFIX_UNIT_NAL:
  ------------------
  |  |   64|      0|#define PREFIX_UNIT_NAL 14
  ------------------
  |  Branch (1001:13): [True: 0, False: 178k]
  ------------------
 1002|      0|            case SEQ_PARAM_NAL:
  ------------------
  |  |  330|      0|#define SEQ_PARAM_NAL                   7
  ------------------
  |  Branch (1002:13): [True: 0, False: 178k]
  ------------------
 1003|      0|            case PIC_PARAM_NAL:
  ------------------
  |  |  331|      0|#define PIC_PARAM_NAL                   8
  ------------------
  |  Branch (1003:13): [True: 0, False: 178k]
  ------------------
 1004|      0|            case SUBSET_SPS_NAL:
  ------------------
  |  |   65|      0|#define SUBSET_SPS_NAL 15
  ------------------
  |  Branch (1004:13): [True: 0, False: 178k]
  ------------------
 1005|      0|                H264_DEC_DEBUG_PRINT("\nUnknown NAL type %d\n", u1_nal_unit_type);
  ------------------
  |  |   39|      0|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 1006|      0|                break;
 1007|       |
 1008|      0|            case ACCESS_UNIT_DELIMITER_RBSP:
  ------------------
  |  |  332|      0|#define ACCESS_UNIT_DELIMITER_RBSP      9
  ------------------
  |  Branch (1008:13): [True: 0, False: 178k]
  ------------------
 1009|      0|                if(!ps_dec->i4_decode_header)
  ------------------
  |  Branch (1009:20): [True: 0, False: 0]
  ------------------
 1010|      0|                {
 1011|      0|                    ih264d_access_unit_delimiter_rbsp(ps_dec);
 1012|      0|                }
 1013|      0|                break;
 1014|       |                // ignore the END_OF_SEQ_RBSP NAL and decode even after this NAL
 1015|      0|            case END_OF_STREAM_RBSP:
  ------------------
  |  |  334|      0|#define END_OF_STREAM_RBSP              11
  ------------------
  |  Branch (1015:13): [True: 0, False: 178k]
  ------------------
 1016|      0|                if(!ps_dec->i4_decode_header)
  ------------------
  |  Branch (1016:20): [True: 0, False: 0]
  ------------------
 1017|      0|                {
 1018|      0|                    ih264d_parse_end_of_stream(ps_dec);
 1019|      0|                }
 1020|      0|                break;
 1021|      0|            case FILLER_DATA_NAL:
  ------------------
  |  |  335|      0|#define FILLER_DATA_NAL                 12
  ------------------
  |  Branch (1021:13): [True: 0, False: 178k]
  ------------------
 1022|      0|                if(!ps_dec->i4_decode_header)
  ------------------
  |  Branch (1022:20): [True: 0, False: 0]
  ------------------
 1023|      0|                {
 1024|      0|                    ih264d_parse_filler_data(ps_dec, ps_bitstrm);
 1025|      0|                }
 1026|      0|                break;
 1027|  42.5k|            case CODED_SLICE_EXTENSION_NAL:
  ------------------
  |  |   66|  42.5k|#define CODED_SLICE_EXTENSION_NAL 20
  ------------------
  |  Branch (1027:13): [True: 42.5k, False: 135k]
  ------------------
 1028|       |
 1029|  42.5k|                if(ps_svc_lyr_dec->u1_base_res_flag == 1)
  ------------------
  |  Branch (1029:20): [True: 3.11k, False: 39.3k]
  ------------------
 1030|  3.11k|                {
 1031|  3.11k|                    return NOT_OK;
  ------------------
  |  |  116|  3.11k|#define NOT_OK    -1
  ------------------
 1032|  3.11k|                }
 1033|  39.3k|                if(!ps_dec->i4_decode_header)
  ------------------
  |  Branch (1033:20): [True: 39.3k, False: 0]
  ------------------
 1034|  39.3k|                {
 1035|  39.3k|                    if(ps_dec->i4_header_decoded == 3)
  ------------------
  |  Branch (1035:24): [True: 39.3k, False: 0]
  ------------------
 1036|  39.3k|                    {
 1037|       |                        /* ! */
 1038|  39.3k|                        DEBUG_THREADS_PRINTF("Decoding  an SVC slice NAL\n");
 1039|  39.3k|                        {
 1040|  39.3k|                            {
 1041|  39.3k|                                ih264d_get_pre_sei_params(ps_dec, u1_nal_unit_type);
 1042|       |                                /* ! */
 1043|  39.3k|                                ps_dec->u4_slice_start_code_found = 1;
 1044|       |
 1045|  39.3k|                                i_status = isvcd_parse_decode_slice_ext_nal(
 1046|  39.3k|                                    (UWORD8) (ps_svc_lyr_dec->ps_nal_svc_ext->u1_idr_flag),
 1047|  39.3k|                                    u1_nal_ref_idc, ps_svc_lyr_dec);
 1048|       |
 1049|  39.3k|                                if(i_status != OK)
  ------------------
  |  |  114|  39.3k|#define OK        0
  ------------------
  |  Branch (1049:36): [True: 27.4k, False: 11.9k]
  ------------------
 1050|  27.4k|                                {
 1051|  27.4k|                                    return i_status;
 1052|  27.4k|                                }
 1053|  39.3k|                            }
 1054|  39.3k|                        }
 1055|  39.3k|                    }
 1056|  39.3k|                }
 1057|  11.9k|                break;
 1058|       |
 1059|  11.9k|            default:
  ------------------
  |  Branch (1059:13): [True: 0, False: 178k]
  ------------------
 1060|      0|                H264_DEC_DEBUG_PRINT("\nUnknown NAL type %d\n", u1_nal_unit_type);
  ------------------
  |  |   39|      0|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
 1061|      0|                break;
 1062|   178k|        }
 1063|   178k|    }
 1064|  67.2k|    return i_status;
 1065|   178k|}
isvcd_parse_sps:
 1079|   123k|{
 1080|   123k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1081|   123k|    UWORD8 i;
 1082|   123k|    dec_seq_params_t *ps_seq = NULL;
 1083|   123k|    dec_svc_seq_params_t *ps_subset_seq = NULL;
 1084|   123k|    UWORD8 u1_profile_idc, u1_level_idc, u1_seq_parameter_set_id, u1_mb_aff_flag = 0;
 1085|   123k|    UWORD16 i2_max_frm_num;
 1086|   123k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1087|   123k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 1088|   123k|    UWORD8 u1_frm, uc_constraint_set0_flag, uc_constraint_set1_flag, uc_constraint_set2_flag;
 1089|   123k|    WORD32 i4_cropped_ht, i4_cropped_wd;
 1090|   123k|    UWORD32 u4_temp;
 1091|   123k|    UWORD64 u8_temp;
 1092|   123k|    UWORD32 u4_pic_height_in_map_units, u4_pic_width_in_mbs;
 1093|   123k|    UWORD32 u2_pic_wd = 0;
 1094|   123k|    UWORD32 u2_pic_ht = 0;
 1095|   123k|    UWORD32 u2_frm_wd_y = 0;
 1096|   123k|    UWORD32 u2_frm_ht_y = 0;
 1097|   123k|    UWORD32 u2_frm_wd_uv = 0;
 1098|   123k|    UWORD32 u2_frm_ht_uv = 0;
 1099|   123k|    UWORD32 u2_crop_offset_y = 0;
 1100|   123k|    UWORD32 u2_crop_offset_uv = 0;
 1101|   123k|    WORD32 ret;
 1102|   123k|    WORD32 num_reorder_frames;
 1103|       |    /* High profile related syntax element */
 1104|   123k|    WORD32 i4_i;
 1105|       |    /* G050 */
 1106|   123k|    UWORD8 u1_frame_cropping_flag,
 1107|   123k|        u1_frame_cropping_rect_left_ofst = 0, u1_frame_cropping_rect_right_ofst = 0,
 1108|   123k|        u1_frame_cropping_rect_top_ofst = 0, u1_frame_cropping_rect_bottom_ofst = 0;
 1109|       |    /* G050 */
 1110|       |    /*--------------------------------------------------------------------*/
 1111|       |    /* Decode seq_parameter_set_id and profile and level values           */
 1112|       |    /*--------------------------------------------------------------------*/
 1113|   123k|    SWITCHONTRACE;
 1114|   123k|    u1_profile_idc = ih264d_get_bits_h264(ps_bitstrm, 8);
 1115|   123k|    COPYTHECONTEXT("SPS: profile_idc", u1_profile_idc);
 1116|       |
 1117|       |    /* G050 */
 1118|   123k|    uc_constraint_set0_flag = ih264d_get_bit_h264(ps_bitstrm);
 1119|   123k|    uc_constraint_set1_flag = ih264d_get_bit_h264(ps_bitstrm);
 1120|   123k|    uc_constraint_set2_flag = ih264d_get_bit_h264(ps_bitstrm);
 1121|   123k|    UNUSED(uc_constraint_set2_flag);
  ------------------
  |  |   45|   123k|#define UNUSED(x) ((void)(x))
  ------------------
 1122|       |    /*****************************************************/
 1123|       |    /* Read 5 bits for uc_constraint_set3_flag (1 bit)   */
 1124|       |    /* and reserved_zero_4bits (4 bits) - Sushant        */
 1125|       |    /*****************************************************/
 1126|   123k|    ih264d_get_bits_h264(ps_bitstrm, 5);
 1127|       |    /* G050 */
 1128|       |    /* Check whether particular profile is suported or not */
 1129|       |    /* Check whether particular profile is suported or not */
 1130|   123k|    if((u1_profile_idc != MAIN_PROFILE_IDC) && (u1_profile_idc != BASE_PROFILE_IDC) &&
  ------------------
  |  |  276|   123k|#define MAIN_PROFILE_IDC    77
  ------------------
                  if((u1_profile_idc != MAIN_PROFILE_IDC) && (u1_profile_idc != BASE_PROFILE_IDC) &&
  ------------------
  |  |  275|  95.7k|#define BASE_PROFILE_IDC    66
  ------------------
  |  Branch (1130:8): [True: 95.7k, False: 28.0k]
  |  Branch (1130:48): [True: 83.2k, False: 12.5k]
  ------------------
 1131|  83.2k|       (u1_profile_idc != HIGH_PROFILE_IDC))
  ------------------
  |  |  278|  83.2k|#define HIGH_PROFILE_IDC   100
  ------------------
  |  Branch (1131:8): [True: 79.2k, False: 3.93k]
  ------------------
 1132|  79.2k|    {
 1133|       |        /* Apart from Baseline, main and high profile,
 1134|       |         * only extended profile is supported provided
 1135|       |         * uc_constraint_set0_flag or uc_constraint_set1_flag are set to 1
 1136|       |         */
 1137|  79.2k|        if((u1_profile_idc != EXTENDED_PROFILE_IDC) ||
  ------------------
  |  |  277|  79.2k|#define EXTENDED_PROFILE_IDC    88
  ------------------
  |  Branch (1137:12): [True: 577, False: 78.7k]
  ------------------
 1138|  78.7k|           ((uc_constraint_set1_flag != 1) && (uc_constraint_set0_flag != 1)))
  ------------------
  |  Branch (1138:13): [True: 57.4k, False: 21.2k]
  |  Branch (1138:47): [True: 165, False: 57.3k]
  ------------------
 1139|    742|        {
 1140|    742|            return (ERROR_FEATURE_UNAVAIL);
 1141|    742|        }
 1142|  79.2k|    }
 1143|       |
 1144|   123k|    u1_level_idc = ih264d_get_bits_h264(ps_bitstrm, 8);
 1145|   123k|    COPYTHECONTEXT("SPS: u4_level_idc", u1_level_idc);
 1146|       |
 1147|   123k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1148|   123k|    if(u4_temp & MASK_ERR_SEQ_SET_ID) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  |  526|   123k|#define MASK_ERR_SEQ_SET_ID   (0xFFFFFFE0)
  ------------------
  |  Branch (1148:8): [True: 406, False: 122k]
  ------------------
 1149|   122k|    u1_seq_parameter_set_id = u4_temp;
 1150|   122k|    COPYTHECONTEXT("SPS: seq_parameter_set_id", u1_seq_parameter_set_id);
 1151|       |
 1152|       |    /*--------------------------------------------------------------------*/
 1153|       |    /* Find an seq param entry in seqparam array of decStruct             */
 1154|       |    /*--------------------------------------------------------------------*/
 1155|   122k|    ps_subset_seq = ps_svc_lyr_dec->pv_scratch_subset_sps;
 1156|   122k|    memset(ps_subset_seq, 0, sizeof(dec_svc_seq_params_t));
 1157|   122k|    ps_seq = ps_dec->pv_scratch_sps_pps;
 1158|   122k|    memset(ps_seq, 0, sizeof(dec_seq_params_t));
 1159|       |
 1160|   122k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1160:8): [True: 101k, False: 20.7k]
  ------------------
 1161|   101k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1161:8): [True: 95.7k, False: 6.19k]
  ------------------
 1162|  95.7k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_profile_idc != u1_profile_idc))
  ------------------
  |  Branch (1162:8): [True: 341, False: 95.3k]
  ------------------
 1163|    341|    {
 1164|    341|        ps_dec->u1_res_changed = 1;
 1165|    341|        return IVD_RES_CHANGED;
 1166|    341|    }
 1167|       |
 1168|   122k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1168:8): [True: 101k, False: 20.7k]
  ------------------
 1169|   101k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1169:8): [True: 95.3k, False: 6.19k]
  ------------------
 1170|  95.3k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_level_idc != u1_level_idc))
  ------------------
  |  Branch (1170:8): [True: 1.30k, False: 94.0k]
  ------------------
 1171|  1.30k|    {
 1172|  1.30k|        ps_dec->u1_res_changed = 1;
 1173|  1.30k|        return IVD_RES_CHANGED;
 1174|  1.30k|    }
 1175|       |
 1176|   120k|    ps_seq->u1_profile_idc = u1_profile_idc;
 1177|   120k|    ps_seq->u1_level_idc = u1_level_idc;
 1178|   120k|    ps_seq->u1_seq_parameter_set_id = u1_seq_parameter_set_id;
 1179|   120k|    ps_subset_seq->ps_seq = &ps_dec->ps_sps[u1_seq_parameter_set_id];
 1180|       |
 1181|       |    /*******************************************************************/
 1182|       |    /* Initializations for high profile - Sushant                      */
 1183|       |    /*******************************************************************/
 1184|   120k|    ps_seq->i4_chroma_format_idc = 1;
 1185|   120k|    ps_seq->i4_bit_depth_luma_minus8 = 0;
 1186|   120k|    ps_seq->i4_bit_depth_chroma_minus8 = 0;
 1187|   120k|    ps_seq->i4_qpprime_y_zero_transform_bypass_flag = 0;
 1188|   120k|    ps_seq->i4_seq_scaling_matrix_present_flag = 0;
 1189|   120k|    if(u1_profile_idc == HIGH_PROFILE_IDC || u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC ||
  ------------------
  |  |  278|   241k|#define HIGH_PROFILE_IDC   100
  ------------------
                  if(u1_profile_idc == HIGH_PROFILE_IDC || u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC ||
  ------------------
  |  |   59|   238k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (1189:8): [True: 3.84k, False: 117k]
  |  Branch (1189:46): [True: 0, False: 117k]
  ------------------
 1190|   117k|       u1_profile_idc == SCALABLE_HIGH_PROFILE_IDC)
  ------------------
  |  |   60|   117k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (1190:8): [True: 0, False: 117k]
  ------------------
 1191|  3.84k|    {
 1192|       |        /* reading chroma_format_idc   */
 1193|  3.84k|        ps_seq->i4_chroma_format_idc = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1194|       |
 1195|       |        /* Monochrome is not supported */
 1196|  3.84k|        if(ps_seq->i4_chroma_format_idc != 1)
  ------------------
  |  Branch (1196:12): [True: 133, False: 3.71k]
  ------------------
 1197|    133|        {
 1198|    133|            return ERROR_FEATURE_UNAVAIL;
 1199|    133|        }
 1200|       |
 1201|       |        /* reading bit_depth_luma_minus8   */
 1202|  3.71k|        ps_seq->i4_bit_depth_luma_minus8 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1203|       |
 1204|  3.71k|        if(ps_seq->i4_bit_depth_luma_minus8 != 0)
  ------------------
  |  Branch (1204:12): [True: 152, False: 3.55k]
  ------------------
 1205|    152|        {
 1206|    152|            return ERROR_FEATURE_UNAVAIL;
 1207|    152|        }
 1208|       |
 1209|       |        /* reading bit_depth_chroma_minus8   */
 1210|  3.55k|        ps_seq->i4_bit_depth_chroma_minus8 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1211|       |
 1212|  3.55k|        if(ps_seq->i4_bit_depth_chroma_minus8 != 0)
  ------------------
  |  Branch (1212:12): [True: 106, False: 3.45k]
  ------------------
 1213|    106|        {
 1214|    106|            return ERROR_FEATURE_UNAVAIL;
 1215|    106|        }
 1216|       |
 1217|       |        /* reading qpprime_y_zero_transform_bypass_flag   */
 1218|  3.45k|        ps_seq->i4_qpprime_y_zero_transform_bypass_flag = (WORD32) ih264d_get_bit_h264(ps_bitstrm);
 1219|       |
 1220|  3.45k|        if(ps_seq->i4_qpprime_y_zero_transform_bypass_flag != 0)
  ------------------
  |  Branch (1220:12): [True: 66, False: 3.38k]
  ------------------
 1221|     66|        {
 1222|     66|            return ERROR_INV_SPS_PPS_T;
 1223|     66|        }
 1224|       |
 1225|       |        /* reading seq_scaling_matrix_present_flag   */
 1226|  3.38k|        ps_seq->i4_seq_scaling_matrix_present_flag = (WORD32) ih264d_get_bit_h264(ps_bitstrm);
 1227|       |
 1228|  3.38k|        if(ps_seq->i4_seq_scaling_matrix_present_flag)
  ------------------
  |  Branch (1228:12): [True: 1.10k, False: 2.28k]
  ------------------
 1229|  1.10k|        {
 1230|  9.62k|            for(i4_i = 0; i4_i < 8; i4_i++)
  ------------------
  |  Branch (1230:27): [True: 8.69k, False: 924]
  ------------------
 1231|  8.69k|            {
 1232|  8.69k|                ps_seq->u1_seq_scaling_list_present_flag[i4_i] = ih264d_get_bit_h264(ps_bitstrm);
 1233|       |
 1234|       |                /* initialize u1_use_default_scaling_matrix_flag[i4_i] to zero */
 1235|       |                /* before calling scaling list                             */
 1236|  8.69k|                ps_seq->u1_use_default_scaling_matrix_flag[i4_i] = 0;
 1237|       |
 1238|  8.69k|                if(ps_seq->u1_seq_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (1238:20): [True: 2.23k, False: 6.46k]
  ------------------
 1239|  2.23k|                {
 1240|  2.23k|                    if(i4_i < 6)
  ------------------
  |  Branch (1240:24): [True: 1.68k, False: 553]
  ------------------
 1241|  1.68k|                    {
 1242|  1.68k|                        ret = ih264d_scaling_list(ps_seq->i2_scalinglist4x4[i4_i], 16,
 1243|  1.68k|                                                  &ps_seq->u1_use_default_scaling_matrix_flag[i4_i],
 1244|  1.68k|                                                  ps_bitstrm);
 1245|  1.68k|                    }
 1246|    553|                    else
 1247|    553|                    {
 1248|    553|                        ret = ih264d_scaling_list(ps_seq->i2_scalinglist8x8[i4_i - 6], 64,
 1249|    553|                                                  &ps_seq->u1_use_default_scaling_matrix_flag[i4_i],
 1250|    553|                                                  ps_bitstrm);
 1251|    553|                    }
 1252|  2.23k|                    if(ret != OK)
  ------------------
  |  |  114|  2.23k|#define OK        0
  ------------------
  |  Branch (1252:24): [True: 179, False: 2.05k]
  ------------------
 1253|    179|                    {
 1254|    179|                        return ret;
 1255|    179|                    }
 1256|  2.23k|                }
 1257|  8.69k|            }
 1258|  1.10k|        }
 1259|  3.38k|    }
 1260|       |    /*--------------------------------------------------------------------*/
 1261|       |    /* Decode MaxFrameNum                                                 */
 1262|       |    /*--------------------------------------------------------------------*/
 1263|   120k|    u8_temp = (UWORD64) 4 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1264|   120k|    if(u8_temp > MAX_BITS_IN_FRAME_NUM)
  ------------------
  |  |  531|   120k|#define MAX_BITS_IN_FRAME_NUM     16
  ------------------
  |  Branch (1264:8): [True: 196, False: 120k]
  ------------------
 1265|    196|    {
 1266|    196|        return ERROR_INV_SPS_PPS_T;
 1267|    196|    }
 1268|   120k|    ps_seq->u1_bits_in_frm_num = (UWORD8) u8_temp;
 1269|   120k|    COPYTHECONTEXT("SPS: log2_max_frame_num_minus4", (ps_seq->u1_bits_in_frm_num - 4));
 1270|       |
 1271|   120k|    i2_max_frm_num = (1 << (ps_seq->u1_bits_in_frm_num));
 1272|   120k|    ps_seq->u2_u4_max_pic_num_minus1 = i2_max_frm_num - 1;
 1273|       |    /*--------------------------------------------------------------------*/
 1274|       |    /* Decode picture order count and related values                      */
 1275|       |    /*--------------------------------------------------------------------*/
 1276|   120k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1277|   120k|    if(u4_temp > MAX_PIC_ORDER_CNT_TYPE)
  ------------------
  |  |  529|   120k|#define MAX_PIC_ORDER_CNT_TYPE    2
  ------------------
  |  Branch (1277:8): [True: 161, False: 119k]
  ------------------
 1278|    161|    {
 1279|    161|        return ERROR_INV_POC_TYPE_T;
 1280|    161|    }
 1281|   119k|    ps_seq->u1_pic_order_cnt_type = u4_temp;
 1282|   119k|    COPYTHECONTEXT("SPS: pic_order_cnt_type", ps_seq->u1_pic_order_cnt_type);
 1283|       |
 1284|   119k|    ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle = 1;
 1285|   119k|    if(ps_seq->u1_pic_order_cnt_type == 0)
  ------------------
  |  Branch (1285:8): [True: 104k, False: 15.0k]
  ------------------
 1286|   104k|    {
 1287|   104k|        u8_temp = (UWORD64) 4 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1288|   104k|        if(u8_temp > MAX_BITS_IN_POC_LSB)
  ------------------
  |  |  532|   104k|#define MAX_BITS_IN_POC_LSB       16
  ------------------
  |  Branch (1288:12): [True: 104, False: 104k]
  ------------------
 1289|    104|        {
 1290|    104|            return ERROR_INV_SPS_PPS_T;
 1291|    104|        }
 1292|   104k|        ps_seq->u1_log2_max_pic_order_cnt_lsb_minus = (UWORD8) u8_temp;
 1293|   104k|        ps_seq->i4_max_pic_order_cntLsb = (1 << u8_temp);
 1294|   104k|        COPYTHECONTEXT("SPS: log2_max_pic_order_cnt_lsb_minus4", (u8_temp - 4));
 1295|   104k|    }
 1296|  15.0k|    else if(ps_seq->u1_pic_order_cnt_type == 1)
  ------------------
  |  Branch (1296:13): [True: 13.9k, False: 1.06k]
  ------------------
 1297|  13.9k|    {
 1298|  13.9k|        ps_seq->u1_delta_pic_order_always_zero_flag = ih264d_get_bit_h264(ps_bitstrm);
 1299|  13.9k|        COPYTHECONTEXT("SPS: delta_pic_order_always_zero_flag",
 1300|  13.9k|                       ps_seq->u1_delta_pic_order_always_zero_flag);
 1301|       |
 1302|  13.9k|        ps_seq->i4_ofst_for_non_ref_pic = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1303|  13.9k|        COPYTHECONTEXT("SPS: offset_for_non_ref_pic", ps_seq->i4_ofst_for_non_ref_pic);
 1304|       |
 1305|  13.9k|        ps_seq->i4_ofst_for_top_to_bottom_field = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1306|  13.9k|        COPYTHECONTEXT("SPS: offset_for_top_to_bottom_field",
 1307|  13.9k|                       ps_seq->i4_ofst_for_top_to_bottom_field);
 1308|       |
 1309|  13.9k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1310|  13.9k|        if(u4_temp > 255) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  Branch (1310:12): [True: 197, False: 13.7k]
  ------------------
 1311|  13.7k|        ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle = u4_temp;
 1312|  13.7k|        COPYTHECONTEXT("SPS: num_ref_frames_in_pic_order_cnt_cycle",
 1313|  13.7k|                       ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle);
 1314|       |
 1315|  44.3k|        for(i = 0; i < ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle; i++)
  ------------------
  |  Branch (1315:20): [True: 30.5k, False: 13.7k]
  ------------------
 1316|  30.5k|        {
 1317|  30.5k|            ps_seq->i4_ofst_for_ref_frame[i] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1318|  30.5k|            COPYTHECONTEXT("SPS: offset_for_ref_frame", ps_seq->i4_ofst_for_ref_frame[i]);
 1319|  30.5k|        }
 1320|  13.7k|    }
 1321|       |
 1322|   119k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1323|       |
 1324|   119k|    if((u4_temp > H264_MAX_REF_PICS))
  ------------------
  |  |  534|   119k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (1324:8): [True: 296, False: 119k]
  ------------------
 1325|    296|    {
 1326|    296|        return ERROR_NUM_REF;
 1327|    296|    }
 1328|       |
 1329|       |    /* Compare with older num_ref_frames is header is already once */
 1330|   119k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1330:8): [True: 100k, False: 19.3k]
  ------------------
 1331|   100k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1331:8): [True: 94.0k, False: 6.00k]
  ------------------
 1332|  94.0k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_num_ref_frames != u4_temp))
  ------------------
  |  Branch (1332:8): [True: 212, False: 93.8k]
  ------------------
 1333|    212|    {
 1334|    212|        ps_dec->u1_res_changed = 1;
 1335|    212|        return IVD_RES_CHANGED;
 1336|    212|    }
 1337|       |
 1338|   119k|    ps_seq->u1_num_ref_frames = u4_temp;
 1339|   119k|    COPYTHECONTEXT("SPS: num_ref_frames", ps_seq->u1_num_ref_frames);
 1340|       |
 1341|   119k|    ps_seq->u1_gaps_in_frame_num_value_allowed_flag = ih264d_get_bit_h264(ps_bitstrm);
 1342|   119k|    COPYTHECONTEXT("SPS: gaps_in_frame_num_value_allowed_flag",
 1343|   119k|                   ps_seq->u1_gaps_in_frame_num_value_allowed_flag);
 1344|       |
 1345|   119k|    ps_seq->u1_gaps_in_frame_num_value_allowed_flag = 0;
 1346|       |
 1347|       |    /*--------------------------------------------------------------------*/
 1348|       |    /* Decode FrameWidth and FrameHeight and related values               */
 1349|       |    /*--------------------------------------------------------------------*/
 1350|   119k|    u8_temp = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1351|       |    /* Check  for unsupported resolutions*/
 1352|   119k|    if(u8_temp > (H264_MAX_FRAME_WIDTH >> 4))
  ------------------
  |  |   39|   119k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (1352:8): [True: 158, False: 119k]
  ------------------
 1353|    158|    {
 1354|    158|        return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
 1355|    158|    }
 1356|   119k|    u4_pic_width_in_mbs = (UWORD32) u8_temp;
 1357|   119k|    COPYTHECONTEXT("SPS: pic_width_in_mbs_minus1", u4_pic_width_in_mbs - 1);
 1358|       |
 1359|   119k|    u8_temp = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1360|   119k|    if(u8_temp > (H264_MAX_FRAME_HEIGHT >> 4))
  ------------------
  |  |   40|   119k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (1360:8): [True: 161, False: 118k]
  ------------------
 1361|    161|    {
 1362|    161|        return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
 1363|    161|    }
 1364|   118k|    u4_pic_height_in_map_units = (UWORD32) u8_temp;
 1365|       |
 1366|   118k|    ps_seq->u2_frm_wd_in_mbs = u4_pic_width_in_mbs;
 1367|   118k|    ps_seq->u2_frm_ht_in_mbs = u4_pic_height_in_map_units;
 1368|   118k|    u2_pic_wd = (u4_pic_width_in_mbs << 4);
 1369|   118k|    u2_pic_ht = (u4_pic_height_in_map_units << 4);
 1370|   118k|    if(ps_svc_lyr_dec->pic_width < u2_pic_wd)
  ------------------
  |  Branch (1370:8): [True: 12.6k, False: 106k]
  ------------------
 1371|  12.6k|    {
 1372|  12.6k|        ps_svc_lyr_dec->pic_width = u2_pic_wd;
 1373|  12.6k|    }
 1374|   118k|    if(ps_svc_lyr_dec->pic_height < u2_pic_ht)
  ------------------
  |  Branch (1374:8): [True: 12.7k, False: 106k]
  ------------------
 1375|  12.7k|    {
 1376|  12.7k|        ps_svc_lyr_dec->pic_height = u2_pic_ht;
 1377|  12.7k|    }
 1378|       |
 1379|       |    /*--------------------------------------------------------------------*/
 1380|       |    /* Get the value of MaxMbAddress and Number of bits needed for it     */
 1381|       |    /*--------------------------------------------------------------------*/
 1382|   118k|    ps_seq->u4_max_mb_addr = ((UWORD32)ps_seq->u2_frm_wd_in_mbs * (UWORD32)ps_seq->u2_frm_ht_in_mbs) - 1;
 1383|   118k|    ps_seq->u4_total_num_of_mbs = ps_seq->u4_max_mb_addr + 1;
 1384|   118k|    ps_seq->u1_level_idc = ih264d_correct_level_idc(u1_level_idc, ps_seq->u4_total_num_of_mbs);
 1385|       |
 1386|   118k|    u1_frm = ih264d_get_bit_h264(ps_bitstrm);
 1387|   118k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1387:8): [True: 99.8k, False: 19.0k]
  ------------------
 1388|  99.8k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1388:8): [True: 93.8k, False: 5.99k]
  ------------------
 1389|  93.8k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_frame_mbs_only_flag != u1_frm))
  ------------------
  |  Branch (1389:8): [True: 2.66k, False: 91.1k]
  ------------------
 1390|  2.66k|    {
 1391|  2.66k|        ps_dec->u1_res_changed = 1;
 1392|  2.66k|        return IVD_RES_CHANGED;
 1393|  2.66k|    }
 1394|   116k|    ps_seq->u1_frame_mbs_only_flag = u1_frm;
 1395|   116k|    COPYTHECONTEXT("SPS: frame_mbs_only_flag", u1_frm);
 1396|       |
 1397|   116k|    if(!u1_frm) u1_mb_aff_flag = ih264d_get_bit_h264(ps_bitstrm);
  ------------------
  |  Branch (1397:8): [True: 57.9k, False: 58.2k]
  ------------------
 1398|       |
 1399|   116k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1399:8): [True: 97.1k, False: 19.0k]
  ------------------
 1400|  97.1k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1400:8): [True: 91.1k, False: 5.99k]
  ------------------
 1401|  91.1k|       (ps_dec->ps_sps[u1_seq_parameter_set_id].u1_mb_aff_flag != u1_mb_aff_flag))
  ------------------
  |  Branch (1401:8): [True: 653, False: 90.4k]
  ------------------
 1402|    653|    {
 1403|    653|        ps_dec->u1_res_changed = 1;
 1404|    653|        return IVD_RES_CHANGED;
 1405|    653|    }
 1406|       |
 1407|   115k|    if(!u1_frm)
  ------------------
  |  Branch (1407:8): [True: 57.3k, False: 58.2k]
  ------------------
 1408|  57.3k|    {
 1409|  57.3k|        u2_pic_ht <<= 1;
 1410|  57.3k|        ps_seq->u1_mb_aff_flag = u1_mb_aff_flag;
 1411|  57.3k|        COPYTHECONTEXT("SPS: mb_adaptive_frame_field_flag", ps_seq->u1_mb_aff_flag);
 1412|  57.3k|    }
 1413|  58.2k|    else
 1414|  58.2k|        ps_seq->u1_mb_aff_flag = 0;
 1415|       |
 1416|   115k|    ps_seq->u1_direct_8x8_inference_flag = ih264d_get_bit_h264(ps_bitstrm);
 1417|   115k|    COPYTHECONTEXT("SPS: direct_8x8_inference_flag", ps_seq->u1_direct_8x8_inference_flag);
 1418|       |
 1419|       |    /* G050 */
 1420|   115k|    u1_frame_cropping_flag = ih264d_get_bit_h264(ps_bitstrm);
 1421|   115k|    COPYTHECONTEXT("SPS: frame_cropping_flag", u1_frame_cropping_flag);
 1422|       |
 1423|   115k|    if(u1_frame_cropping_flag)
  ------------------
  |  Branch (1423:8): [True: 15.4k, False: 100k]
  ------------------
 1424|  15.4k|    {
 1425|  15.4k|        u1_frame_cropping_rect_left_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1426|  15.4k|        COPYTHECONTEXT("SPS: frame_cropping_rect_left_offset", u1_frame_cropping_rect_left_ofst);
 1427|  15.4k|        u1_frame_cropping_rect_right_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1428|  15.4k|        COPYTHECONTEXT("SPS: frame_cropping_rect_right_offset", u1_frame_cropping_rect_right_ofst);
 1429|  15.4k|        u1_frame_cropping_rect_top_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1430|  15.4k|        COPYTHECONTEXT("SPS: frame_cropping_rect_top_offset", u1_frame_cropping_rect_top_ofst);
 1431|  15.4k|        u1_frame_cropping_rect_bottom_ofst = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1432|  15.4k|        COPYTHECONTEXT("SPS: frame_cropping_rect_bottom_offset",
 1433|  15.4k|                       u1_frame_cropping_rect_bottom_ofst);
 1434|  15.4k|    }
 1435|       |    /* G050 */
 1436|   115k|    ps_seq->u1_vui_parameters_present_flag = ih264d_get_bit_h264(ps_bitstrm);
 1437|   115k|    COPYTHECONTEXT("SPS: vui_parameters_present_flag", ps_seq->u1_vui_parameters_present_flag);
 1438|       |
 1439|   115k|    u2_frm_wd_y = u2_pic_wd + (UWORD8) (PAD_LEN_Y_H << 1);
  ------------------
  |  |  571|   115k|#define PAD_LEN_Y_H                   32
  ------------------
 1440|       |
 1441|   115k|    if(1 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (1441:8): [True: 0, False: 115k]
  ------------------
 1442|      0|    {
 1443|      0|        if(ps_dec->u4_app_disp_width > u2_frm_wd_y) u2_frm_wd_y = ps_dec->u4_app_disp_width;
  ------------------
  |  Branch (1443:12): [True: 0, False: 0]
  ------------------
 1444|      0|    }
 1445|       |
 1446|   115k|    u2_frm_ht_y = u2_pic_ht + (UWORD8) (PAD_LEN_Y_V << 2);
  ------------------
  |  |  572|   115k|#define PAD_LEN_Y_V                   20
  ------------------
 1447|   115k|    u2_frm_wd_uv = u2_pic_wd + (UWORD8) (PAD_LEN_UV_H << 2);
  ------------------
  |  |  573|   115k|#define PAD_LEN_UV_H                  16
  ------------------
 1448|   115k|    u2_frm_wd_uv = MAX(u2_frm_wd_uv, u2_frm_wd_y);
  ------------------
  |  |   60|   115k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 115k]
  |  |  ------------------
  ------------------
 1449|   115k|    u2_frm_ht_uv = (u2_pic_ht >> 1) + (UWORD8) (PAD_LEN_UV_V << 2);
  ------------------
  |  |  574|   115k|#define PAD_LEN_UV_V                  8
  ------------------
 1450|   115k|    u2_frm_ht_uv = MAX(u2_frm_ht_uv, (u2_frm_ht_y >> 1));
  ------------------
  |  |   60|   115k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 115k]
  |  |  ------------------
  ------------------
 1451|       |
 1452|       |    /* Calculate display picture width, height and start u4_ofst from YUV420 */
 1453|       |    /* pictute buffers as per cropping information parsed above             */
 1454|   115k|    {
 1455|   115k|        UWORD16 u2_rgt_ofst = 0;
 1456|   115k|        UWORD16 u2_lft_ofst = 0;
 1457|   115k|        UWORD16 u2_top_ofst = 0;
 1458|   115k|        UWORD16 u2_btm_ofst = 0;
 1459|   115k|        UWORD8 u1_frm_mbs_flag;
 1460|   115k|        UWORD8 u1_vert_mult_factor;
 1461|       |
 1462|   115k|        if(u1_frame_cropping_flag)
  ------------------
  |  Branch (1462:12): [True: 15.4k, False: 100k]
  ------------------
 1463|  15.4k|        {
 1464|       |            /* Calculate right and left u4_ofst for cropped picture           */
 1465|  15.4k|            u2_rgt_ofst = u1_frame_cropping_rect_right_ofst << 1;
 1466|  15.4k|            u2_lft_ofst = u1_frame_cropping_rect_left_ofst << 1;
 1467|       |
 1468|       |            /* Know frame MBs only u4_flag                                      */
 1469|  15.4k|            u1_frm_mbs_flag = (1 == ps_seq->u1_frame_mbs_only_flag);
 1470|       |
 1471|       |            /* Simplify the vertical u4_ofst calculation from field/frame     */
 1472|  15.4k|            u1_vert_mult_factor = (2 - u1_frm_mbs_flag);
 1473|       |
 1474|       |            /* Calculate bottom and top u4_ofst for cropped  picture          */
 1475|  15.4k|            u2_btm_ofst = (u1_frame_cropping_rect_bottom_ofst << u1_vert_mult_factor);
 1476|  15.4k|            u2_top_ofst = (u1_frame_cropping_rect_top_ofst << u1_vert_mult_factor);
 1477|  15.4k|        }
 1478|       |
 1479|       |        /* Calculate u4_ofst from start of YUV 420 picture buffer to start of*/
 1480|       |        /* cropped picture buffer                                           */
 1481|   115k|        u2_crop_offset_y = (u2_frm_wd_y * u2_top_ofst) + (u2_lft_ofst);
 1482|   115k|        u2_crop_offset_uv =
 1483|   115k|            (u2_frm_wd_uv * (u2_top_ofst >> 1)) + (u2_lft_ofst >> 1) * YUV420SP_FACTOR;
  ------------------
  |  |  119|   115k|#define YUV420SP_FACTOR 2
  ------------------
 1484|       |        /* Calculate the display picture width and height based on crop      */
 1485|       |        /* information                                                       */
 1486|   115k|        i4_cropped_ht = (WORD32) u2_pic_ht - (WORD32) (u2_btm_ofst + u2_top_ofst);
 1487|   115k|        i4_cropped_wd = (WORD32) u2_pic_wd - (WORD32) (u2_rgt_ofst + u2_lft_ofst);
 1488|       |
 1489|   115k|        if((i4_cropped_ht < MB_SIZE) || (i4_cropped_wd < MB_SIZE))
  ------------------
  |  |  554|   115k|#define MB_SIZE             16
  ------------------
                      if((i4_cropped_ht < MB_SIZE) || (i4_cropped_wd < MB_SIZE))
  ------------------
  |  |  554|   115k|#define MB_SIZE             16
  ------------------
  |  Branch (1489:12): [True: 175, False: 115k]
  |  Branch (1489:41): [True: 138, False: 115k]
  ------------------
 1490|    313|        {
 1491|    313|            return ERROR_INV_SPS_PPS_T;
 1492|    313|        }
 1493|       |
 1494|   115k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1494:12): [True: 96.4k, False: 18.7k]
  ------------------
 1495|  96.4k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1495:12): [True: 90.4k, False: 5.96k]
  ------------------
 1496|  90.4k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_pic_wd != u2_pic_wd))
  ------------------
  |  Branch (1496:12): [True: 230, False: 90.2k]
  ------------------
 1497|    230|        {
 1498|    230|            ps_dec->u1_res_changed = 1;
 1499|    230|            return IVD_RES_CHANGED;
 1500|    230|        }
 1501|       |
 1502|   115k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1502:12): [True: 96.2k, False: 18.7k]
  ------------------
 1503|  96.2k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1503:12): [True: 90.2k, False: 5.96k]
  ------------------
 1504|  90.2k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_disp_width != i4_cropped_wd))
  ------------------
  |  Branch (1504:12): [True: 120, False: 90.1k]
  ------------------
 1505|    120|        {
 1506|    120|            ps_dec->u1_res_changed = 1;
 1507|    120|            return IVD_RES_CHANGED;
 1508|    120|        }
 1509|       |
 1510|   114k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1510:12): [True: 96.1k, False: 18.7k]
  ------------------
 1511|  96.1k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1511:12): [True: 90.1k, False: 5.96k]
  ------------------
 1512|  90.1k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_pic_ht != u2_pic_ht))
  ------------------
  |  Branch (1512:12): [True: 431, False: 89.7k]
  ------------------
 1513|    431|        {
 1514|    431|            ps_dec->u1_res_changed = 1;
 1515|    431|            return IVD_RES_CHANGED;
 1516|    431|        }
 1517|       |
 1518|   114k|        if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1518:12): [True: 95.6k, False: 18.7k]
  ------------------
 1519|  95.6k|           (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) &&
  ------------------
  |  Branch (1519:12): [True: 89.7k, False: 5.96k]
  ------------------
 1520|  89.7k|           (ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id].u2_disp_height != i4_cropped_ht))
  ------------------
  |  Branch (1520:12): [True: 169, False: 89.5k]
  ------------------
 1521|    169|        {
 1522|    169|            ps_dec->u1_res_changed = 1;
 1523|    169|            return IVD_RES_CHANGED;
 1524|    169|        }
 1525|       |        /* Check again for unsupported resolutions with updated values*/
 1526|   114k|        if((u2_pic_wd > SVCD_MAX_FRAME_WIDTH) || (u2_pic_ht > SVCD_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   52|   114k|#define SVCD_MAX_FRAME_WIDTH 4096
  ------------------
                      if((u2_pic_wd > SVCD_MAX_FRAME_WIDTH) || (u2_pic_ht > SVCD_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   53|   114k|#define SVCD_MAX_FRAME_HEIGHT 4096
  ------------------
  |  Branch (1526:12): [True: 0, False: 114k]
  |  Branch (1526:50): [True: 81, False: 114k]
  ------------------
 1527|   114k|           (u2_pic_wd < SVCD_MIN_FRAME_WIDTH) || (u2_pic_ht < SVCD_MIN_FRAME_HEIGHT) ||
  ------------------
  |  |   56|   114k|#define SVCD_MIN_FRAME_WIDTH 32
  ------------------
                         (u2_pic_wd < SVCD_MIN_FRAME_WIDTH) || (u2_pic_ht < SVCD_MIN_FRAME_HEIGHT) ||
  ------------------
  |  |   57|   113k|#define SVCD_MIN_FRAME_HEIGHT 32
  ------------------
  |  Branch (1527:12): [True: 550, False: 113k]
  |  Branch (1527:50): [True: 109, False: 113k]
  ------------------
 1528|   113k|           (u2_pic_wd * (UWORD32) u2_pic_ht > SVCD_MAX_FRAME_SIZE))
  ------------------
  |  |   54|   113k|#define SVCD_MAX_FRAME_SIZE (4096 * 4096)
  ------------------
  |  Branch (1528:12): [True: 0, False: 113k]
  ------------------
 1529|    740|        {
 1530|    740|            return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
 1531|    740|        }
 1532|       |
 1533|       |        /* If MBAff is enabled, decoder support is limited to streams with
 1534|       |         * width less than half of H264_MAX_FRAME_WIDTH.
 1535|       |         * In case of MBAff decoder processes two rows at a time
 1536|       |         */
 1537|   113k|        if((u2_pic_wd << ps_seq->u1_mb_aff_flag) > H264_MAX_FRAME_WIDTH)
  ------------------
  |  |   39|   113k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (1537:12): [True: 41, False: 113k]
  ------------------
 1538|     41|        {
 1539|     41|            return IVD_STREAM_WIDTH_HEIGHT_NOT_SUPPORTED;
 1540|     41|        }
 1541|   113k|    }
 1542|       |
 1543|       |    /* Backup num_reorder_frames if header is already decoded */
 1544|   113k|    if((ps_dec->i4_header_decoded & 1) && (1 == ps_seq->u1_vui_parameters_present_flag) &&
  ------------------
  |  Branch (1544:8): [True: 95.1k, False: 18.3k]
  |  Branch (1544:43): [True: 5.95k, False: 89.1k]
  ------------------
 1545|  5.95k|       (1 == ps_seq->s_vui.u1_bitstream_restriction_flag))
  ------------------
  |  Branch (1545:8): [True: 0, False: 5.95k]
  ------------------
 1546|      0|    {
 1547|      0|        num_reorder_frames = (WORD32) ps_seq->s_vui.u4_num_reorder_frames;
 1548|      0|    }
 1549|   113k|    else
 1550|   113k|    {
 1551|   113k|        num_reorder_frames = -1;
 1552|   113k|    }
 1553|   113k|    if(1 == ps_seq->u1_vui_parameters_present_flag)
  ------------------
  |  Branch (1553:8): [True: 6.99k, False: 106k]
  ------------------
 1554|  6.99k|    {
 1555|  6.99k|        ret = ih264d_parse_vui_parametres(&ps_seq->s_vui, ps_bitstrm);
 1556|  6.99k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  6.99k|#define OK        0
  ------------------
  |  Branch (1556:12): [True: 168, False: 6.82k]
  ------------------
 1557|  6.99k|    }
 1558|       |
 1559|       |    /* Compare older num_reorder_frames with the new one if header is already
 1560|       |     * decoded */
 1561|   113k|    if((ps_dec->i4_header_decoded & 1) &&
  ------------------
  |  Branch (1561:8): [True: 95.1k, False: 18.2k]
  ------------------
 1562|  95.1k|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_is_valid) && (-1 != num_reorder_frames) &&
  ------------------
  |  Branch (1562:8): [True: 89.5k, False: 5.60k]
  |  Branch (1562:70): [True: 0, False: 89.5k]
  ------------------
 1563|      0|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].u1_vui_parameters_present_flag) &&
  ------------------
  |  Branch (1563:8): [True: 0, False: 0]
  ------------------
 1564|      0|       (1 == ps_dec->ps_sps[u1_seq_parameter_set_id].s_vui.u1_bitstream_restriction_flag) &&
  ------------------
  |  Branch (1564:8): [True: 0, False: 0]
  ------------------
 1565|      0|       ((WORD32) ps_dec->ps_sps[u1_seq_parameter_set_id].s_vui.u4_num_reorder_frames !=
  ------------------
  |  Branch (1565:8): [True: 0, False: 0]
  ------------------
 1566|      0|        num_reorder_frames))
 1567|      0|    {
 1568|      0|        ps_dec->u1_res_changed = 1;
 1569|      0|        return IVD_RES_CHANGED;
 1570|      0|    }
 1571|       |
 1572|       |    /* In case bitstream read has exceeded the filled size, then return an error */
 1573|   113k|    if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|   113k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 300, False: 113k]
  |  |  ------------------
  ------------------
 1574|    300|    {
 1575|    300|        return ERROR_INV_SPS_PPS_T;
 1576|    300|    }
 1577|       |
 1578|       |    /*--------------------------------------------------------------------*/
 1579|       |    /* All initializations to ps_dec are beyond this point                */
 1580|       |    /*--------------------------------------------------------------------*/
 1581|   113k|    {
 1582|   113k|        WORD32 reorder_depth = ih264d_get_dpb_size(ps_seq);
 1583|   113k|        if((1 == ps_seq->u1_vui_parameters_present_flag) &&
  ------------------
  |  Branch (1583:12): [True: 6.60k, False: 106k]
  ------------------
 1584|  6.60k|           (1 == ps_seq->s_vui.u1_bitstream_restriction_flag))
  ------------------
  |  Branch (1584:12): [True: 1.07k, False: 5.52k]
  ------------------
 1585|  1.07k|        {
 1586|  1.07k|            reorder_depth = ps_seq->s_vui.u4_num_reorder_frames + 1;
 1587|  1.07k|        }
 1588|       |
 1589|   113k|        if(reorder_depth > H264_MAX_REF_PICS)
  ------------------
  |  |  534|   113k|#define H264_MAX_REF_PICS         16
  ------------------
  |  Branch (1589:12): [True: 76, False: 112k]
  ------------------
 1590|     76|        {
 1591|     76|            return ERROR_INV_SPS_PPS_T;
 1592|     76|        }
 1593|       |
 1594|   112k|        if(ps_seq->u1_frame_mbs_only_flag != 1) reorder_depth *= 2;
  ------------------
  |  Branch (1594:12): [True: 56.2k, False: 56.7k]
  ------------------
 1595|   112k|        ps_subset_seq->i4_reorder_depth = reorder_depth + DISPLAY_LATENCY;
  ------------------
  |  |   51|   112k|#define DISPLAY_LATENCY         2
  ------------------
 1596|   112k|    }
 1597|      0|    ps_subset_seq->u2_disp_height = i4_cropped_ht;
 1598|   112k|    ps_subset_seq->u2_disp_width = i4_cropped_wd;
 1599|   112k|    ps_subset_seq->u2_pic_wd = u2_pic_wd;
 1600|   112k|    ps_subset_seq->u2_pic_ht = u2_pic_ht;
 1601|       |
 1602|       |    /* Determining the Width and Height of Frame from that of Picture */
 1603|   112k|    ps_subset_seq->u2_frm_wd_y = u2_frm_wd_y;
 1604|   112k|    ps_subset_seq->u2_frm_ht_y = u2_frm_ht_y;
 1605|   112k|    ps_subset_seq->u2_frm_wd_uv = u2_frm_wd_uv;
 1606|   112k|    ps_subset_seq->u2_frm_ht_uv = u2_frm_ht_uv;
 1607|       |
 1608|   112k|    ps_subset_seq->u1_pad_len_y_v = (UWORD8) (PAD_LEN_Y_V << (1 - u1_frm));
  ------------------
  |  |  572|   112k|#define PAD_LEN_Y_V                   20
  ------------------
 1609|   112k|    ps_subset_seq->u1_pad_len_cr_v = (UWORD8) (PAD_LEN_UV_V << (1 - u1_frm));
  ------------------
  |  |  574|   112k|#define PAD_LEN_UV_V                  8
  ------------------
 1610|       |
 1611|   112k|    ps_subset_seq->u2_crop_offset_y = u2_crop_offset_y;
 1612|   112k|    ps_subset_seq->u2_crop_offset_uv = u2_crop_offset_uv;
 1613|       |
 1614|   112k|    ps_seq->u1_is_valid = TRUE;
  ------------------
  |  |  591|   112k|#define TRUE    1
  ------------------
 1615|   112k|    ps_dec->ps_sps[u1_seq_parameter_set_id] = *ps_seq;
 1616|   112k|    ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id] = *ps_subset_seq;
 1617|   112k|    ps_svc_lyr_dec->ps_cur_subset_sps = &ps_svc_lyr_dec->ps_subset_sps[u1_seq_parameter_set_id];
 1618|       |
 1619|   112k|    return OK;
  ------------------
  |  |  114|   112k|#define OK        0
  ------------------
 1620|   113k|}
isvcd_parse_pps:
 1634|   107k|{
 1635|   107k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1636|   107k|    UWORD8 uc_temp;
 1637|   107k|    dec_seq_params_t *ps_sps = NULL;
 1638|   107k|    dec_pic_params_t *ps_pps = NULL;
 1639|   107k|    UWORD32 *pu4_bitstrm_buf = ps_dec->ps_bitstrm->pu4_buffer;
 1640|   107k|    UWORD32 *pu4_bitstrm_ofst = &ps_dec->ps_bitstrm->u4_ofst;
 1641|       |
 1642|       |    /* Variables used for error resilience checks */
 1643|   107k|    UWORD64 u8_temp;
 1644|   107k|    UWORD32 u4_temp;
 1645|   107k|    WORD32 i_temp;
 1646|       |
 1647|       |    /* For High profile related syntax elements */
 1648|   107k|    UWORD8 u1_more_data_flag;
 1649|   107k|    WORD32 i4_i;
 1650|       |
 1651|       |    /*--------------------------------------------------------------------*/
 1652|       |    /* Decode pic_parameter_set_id and find corresponding pic params      */
 1653|       |    /*--------------------------------------------------------------------*/
 1654|   107k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1655|   107k|    if(u4_temp & MASK_ERR_PIC_SET_ID) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  |  527|   107k|#define MASK_ERR_PIC_SET_ID   (0xFFFFFF00)
  ------------------
  |  Branch (1655:8): [True: 124, False: 107k]
  ------------------
 1656|   107k|    ps_pps = ps_dec->pv_scratch_sps_pps;
 1657|   107k|    *ps_pps = ps_dec->ps_pps[u4_temp];
 1658|   107k|    ps_pps->u1_pic_parameter_set_id = (UWORD8) u4_temp;
 1659|   107k|    COPYTHECONTEXT("PPS: pic_parameter_set_id", ps_pps->u1_pic_parameter_set_id);
 1660|       |
 1661|       |    /************************************************/
 1662|       |    /* initilization of High profile syntax element */
 1663|       |    /************************************************/
 1664|   107k|    ps_pps->i4_transform_8x8_mode_flag = 0;
 1665|   107k|    ps_pps->i4_pic_scaling_matrix_present_flag = 0;
 1666|       |
 1667|       |    /*--------------------------------------------------------------------*/
 1668|       |    /* Decode seq_parameter_set_id and map it to a seq_parameter_set      */
 1669|       |    /*--------------------------------------------------------------------*/
 1670|   107k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1671|   107k|    if(u4_temp & MASK_ERR_SEQ_SET_ID) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  |  526|   107k|#define MASK_ERR_SEQ_SET_ID   (0xFFFFFFE0)
  ------------------
  |  Branch (1671:8): [True: 160, False: 107k]
  ------------------
 1672|   107k|    COPYTHECONTEXT("PPS: seq_parameter_set_id", u4_temp);
 1673|   107k|    ps_sps = &ps_dec->ps_sps[u4_temp];
 1674|   107k|    ps_pps->ps_sps = ps_sps;
 1675|       |
 1676|       |    /*--------------------------------------------------------------------*/
 1677|       |    /* Decode entropy_coding_mode                                         */
 1678|       |    /*--------------------------------------------------------------------*/
 1679|   107k|    ps_pps->u1_entropy_coding_mode = ih264d_get_bit_h264(ps_bitstrm);
 1680|   107k|    COPYTHECONTEXT("PPS: entropy_coding_mode_flag", ps_pps->u1_entropy_coding_mode);
 1681|       |
 1682|   107k|    ps_pps->u1_pic_order_present_flag = ih264d_get_bit_h264(ps_bitstrm);
 1683|   107k|    COPYTHECONTEXT("PPS: pic_order_present_flag", ps_pps->u1_pic_order_present_flag);
 1684|       |
 1685|       |    /*--------------------------------------------------------------------*/
 1686|       |    /* Decode num_slice_groups_minus1                                     */
 1687|       |    /*--------------------------------------------------------------------*/
 1688|   107k|    u8_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf) + (UWORD64) 1;
 1689|   107k|    if(u8_temp != 1)
  ------------------
  |  Branch (1689:8): [True: 429, False: 106k]
  ------------------
 1690|    429|    {
 1691|    429|        return ERROR_FEATURE_UNAVAIL;
 1692|    429|    }
 1693|   106k|    ps_pps->u1_num_slice_groups = (UWORD8) u8_temp;
 1694|   106k|    COPYTHECONTEXT("PPS: num_slice_groups_minus1", ps_pps->u1_num_slice_groups - 1);
 1695|       |
 1696|       |    /*--------------------------------------------------------------------*/
 1697|       |    /* Other parameter set values                                         */
 1698|       |    /*--------------------------------------------------------------------*/
 1699|   106k|    u8_temp = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1700|   106k|    if(u8_temp >= H264_MAX_REF_IDX) return ERROR_REF_IDX;
  ------------------
  |  |  535|   106k|#define H264_MAX_REF_IDX          32
  ------------------
  |  Branch (1700:8): [True: 115, False: 106k]
  ------------------
 1701|   106k|    ps_pps->u1_num_ref_idx_lx_active[0] = (UWORD8) u8_temp;
 1702|   106k|    COPYTHECONTEXT("PPS: num_ref_idx_l0_active_minus1", ps_pps->u1_num_ref_idx_lx_active[0] - 1);
 1703|       |
 1704|   106k|    u8_temp = (UWORD64) 1 + ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1705|   106k|    if(u8_temp >= H264_MAX_REF_IDX) return ERROR_REF_IDX;
  ------------------
  |  |  535|   106k|#define H264_MAX_REF_IDX          32
  ------------------
  |  Branch (1705:8): [True: 356, False: 106k]
  ------------------
 1706|   106k|    ps_pps->u1_num_ref_idx_lx_active[1] = (UWORD8) u8_temp;
 1707|   106k|    COPYTHECONTEXT("PPS: num_ref_idx_l1_active_minus1", ps_pps->u1_num_ref_idx_lx_active[1] - 1);
 1708|       |
 1709|   106k|    ps_pps->u1_wted_pred_flag = ih264d_get_bit_h264(ps_bitstrm);
 1710|   106k|    COPYTHECONTEXT("PPS: weighted prediction u4_flag", ps_pps->u1_wted_pred_flag);
 1711|   106k|    uc_temp = (UWORD8) ih264d_get_bits_h264(ps_bitstrm, 2);
 1712|   106k|    COPYTHECONTEXT("PPS: weighted_bipred_idc", uc_temp);
 1713|   106k|    ps_pps->u1_wted_bipred_idc = uc_temp;
 1714|       |
 1715|   106k|    if(ps_pps->u1_wted_bipred_idc > MAX_WEIGHT_BIPRED_IDC) return ERROR_INV_SPS_PPS_T;
  ------------------
  |  |  536|   106k|#define MAX_WEIGHT_BIPRED_IDC     2
  ------------------
  |  Branch (1715:8): [True: 189, False: 106k]
  ------------------
 1716|       |
 1717|   106k|    {
 1718|   106k|        WORD64 i8_temp = (WORD64) 26 + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1719|       |
 1720|   106k|        if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  |  629|   106k|#define MIN_H264_QP 0
  ------------------
                      if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  |  634|   106k|#define MAX_H264_QP 51
  ------------------
  |  Branch (1720:12): [True: 104, False: 106k]
  |  Branch (1720:39): [True: 203, False: 105k]
  ------------------
 1721|       |
 1722|   105k|        ps_pps->u1_pic_init_qp = (UWORD8) i8_temp;
 1723|   105k|        COPYTHECONTEXT("PPS: pic_init_qp_minus26", ps_pps->u1_pic_init_qp - 26);
 1724|       |
 1725|   105k|        i8_temp = (WORD64) 26 + ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1726|   105k|        if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  |  629|   105k|#define MIN_H264_QP 0
  ------------------
                      if((i8_temp < MIN_H264_QP) || (i8_temp > MAX_H264_QP)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  |  634|   105k|#define MAX_H264_QP 51
  ------------------
  |  Branch (1726:12): [True: 102, False: 105k]
  |  Branch (1726:39): [True: 114, False: 105k]
  ------------------
 1727|       |
 1728|   105k|        ps_pps->u1_pic_init_qs = (UWORD8) i8_temp;
 1729|   105k|        COPYTHECONTEXT("PPS: pic_init_qs_minus26", ps_pps->u1_pic_init_qs - 26);
 1730|   105k|    }
 1731|       |
 1732|      0|    i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1733|   105k|    if((i_temp < -12) || (i_temp > 12)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  Branch (1733:8): [True: 98, False: 105k]
  |  Branch (1733:26): [True: 139, False: 105k]
  ------------------
 1734|   105k|    ps_pps->i1_chroma_qp_index_offset = i_temp;
 1735|   105k|    COPYTHECONTEXT("PPS: chroma_qp_index_offset", ps_pps->i1_chroma_qp_index_offset);
 1736|       |
 1737|       |    /***************************************************************************/
 1738|       |    /* initialize second_chroma_qp_index_offset to i1_chroma_qp_index_offset if */
 1739|       |    /* second_chroma_qp_index_offset is not present in bit-ps_bitstrm */
 1740|       |    /***************************************************************************/
 1741|   105k|    ps_pps->i1_second_chroma_qp_index_offset = ps_pps->i1_chroma_qp_index_offset;
 1742|       |
 1743|   105k|    ps_pps->u1_deblocking_filter_parameters_present_flag = ih264d_get_bit_h264(ps_bitstrm);
 1744|   105k|    COPYTHECONTEXT("PPS: deblocking_filter_control_present_flag",
 1745|   105k|                   ps_pps->u1_deblocking_filter_parameters_present_flag);
 1746|   105k|    ps_pps->u1_constrained_intra_pred_flag = ih264d_get_bit_h264(ps_bitstrm);
 1747|   105k|    COPYTHECONTEXT("PPS: constrained_intra_pred_flag", ps_pps->u1_constrained_intra_pred_flag);
 1748|   105k|    ps_pps->u1_redundant_pic_cnt_present_flag = ih264d_get_bit_h264(ps_bitstrm);
 1749|   105k|    COPYTHECONTEXT("PPS: redundant_pic_cnt_present_flag",
 1750|   105k|                   ps_pps->u1_redundant_pic_cnt_present_flag);
 1751|       |
 1752|       |    /* High profile related syntax elements */
 1753|   105k|    u1_more_data_flag = MORE_RBSP_DATA(ps_bitstrm);
  ------------------
  |  |   97|   105k|    CHECK_BITS_SUFFICIENT(ps_bitstrm, 1)
  |  |  ------------------
  |  |  |  |   95|   105k|  (ps_bitstrm->u4_ofst + bits_to_read <= ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  ------------------
 1754|       |
 1755|   105k|    if(u1_more_data_flag)
  ------------------
  |  Branch (1755:8): [True: 102k, False: 2.52k]
  ------------------
 1756|   102k|    {
 1757|       |        /* read transform_8x8_mode_flag  */
 1758|   102k|        ps_pps->i4_transform_8x8_mode_flag = (WORD32) ih264d_get_bit_h264(ps_bitstrm);
 1759|       |
 1760|       |        /* read pic_scaling_matrix_present_flag */
 1761|   102k|        ps_pps->i4_pic_scaling_matrix_present_flag = (WORD32) ih264d_get_bit_h264(ps_bitstrm);
 1762|       |
 1763|   102k|        if(ps_pps->i4_pic_scaling_matrix_present_flag)
  ------------------
  |  Branch (1763:12): [True: 2.44k, False: 100k]
  ------------------
 1764|  2.44k|        {
 1765|       |            /* read the scaling matrices */
 1766|  18.1k|            for(i4_i = 0; i4_i < (6 + (ps_pps->i4_transform_8x8_mode_flag << 1)); i4_i++)
  ------------------
  |  Branch (1766:27): [True: 16.0k, False: 2.14k]
  ------------------
 1767|  16.0k|            {
 1768|  16.0k|                ps_pps->u1_pic_scaling_list_present_flag[i4_i] = ih264d_get_bit_h264(ps_bitstrm);
 1769|       |
 1770|  16.0k|                if(ps_pps->u1_pic_scaling_list_present_flag[i4_i])
  ------------------
  |  Branch (1770:20): [True: 4.36k, False: 11.6k]
  ------------------
 1771|  4.36k|                {
 1772|  4.36k|                    WORD32 ret;
 1773|  4.36k|                    if(i4_i < 6)
  ------------------
  |  Branch (1773:24): [True: 3.44k, False: 917]
  ------------------
 1774|  3.44k|                    {
 1775|  3.44k|                        ret = ih264d_scaling_list(
 1776|  3.44k|                            ps_pps->i2_pic_scalinglist4x4[i4_i], 16,
 1777|  3.44k|                            &ps_pps->u1_pic_use_default_scaling_matrix_flag[i4_i], ps_bitstrm);
 1778|  3.44k|                    }
 1779|    917|                    else
 1780|    917|                    {
 1781|    917|                        ret = ih264d_scaling_list(
 1782|    917|                            ps_pps->i2_pic_scalinglist8x8[i4_i - 6], 64,
 1783|    917|                            &ps_pps->u1_pic_use_default_scaling_matrix_flag[i4_i], ps_bitstrm);
 1784|    917|                    }
 1785|       |
 1786|  4.36k|                    if(ret != OK)
  ------------------
  |  |  114|  4.36k|#define OK        0
  ------------------
  |  Branch (1786:24): [True: 304, False: 4.05k]
  ------------------
 1787|    304|                    {
 1788|    304|                        return ret;
 1789|    304|                    }
 1790|  4.36k|                }
 1791|  16.0k|            }
 1792|  2.44k|        }
 1793|       |
 1794|       |        /* read second_chroma_qp_index_offset syntax element */
 1795|   102k|        i_temp = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1796|   102k|        if((i_temp < -12) || (i_temp > 12)) return ERROR_INV_RANGE_QP_T;
  ------------------
  |  Branch (1796:12): [True: 123, False: 102k]
  |  Branch (1796:30): [True: 140, False: 102k]
  ------------------
 1797|       |
 1798|   102k|        ps_pps->i1_second_chroma_qp_index_offset = i_temp;
 1799|   102k|    }
 1800|       |
 1801|   104k|    if(SCALABLE_BASELINE_PROFILE_IDC == ps_sps->u1_profile_idc)
  ------------------
  |  |   59|   104k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (1801:8): [True: 0, False: 104k]
  ------------------
 1802|       |
 1803|      0|    {
 1804|      0|        if(ps_pps->u1_num_slice_groups > 7)
  ------------------
  |  Branch (1804:12): [True: 0, False: 0]
  ------------------
 1805|      0|        {
 1806|      0|            return ERROR_INV_SPS_PPS_T;
 1807|      0|        }
 1808|      0|    }
 1809|       |
 1810|       |    /* In case bitstream read has exceeded the filled size, then return an error */
 1811|   104k|    if(EXCEED_OFFSET(ps_bitstrm))
  ------------------
  |  |   93|   104k|  (ps_bitstrm->u4_ofst > ps_bitstrm->u4_max_ofst)
  |  |  ------------------
  |  |  |  Branch (93:3): [True: 97, False: 104k]
  |  |  ------------------
  ------------------
 1812|     97|    {
 1813|     97|        return ERROR_INV_SPS_PPS_T;
 1814|     97|    }
 1815|   104k|    ps_pps->u1_is_valid = TRUE;
  ------------------
  |  |  591|   104k|#define TRUE    1
  ------------------
 1816|   104k|    ps_dec->ps_pps[ps_pps->u1_pic_parameter_set_id] = *ps_pps;
 1817|   104k|    return OK;
  ------------------
  |  |  114|   104k|#define OK        0
  ------------------
 1818|   104k|}

isvcd_verify_level:
   95|   148k|{
   96|   148k|    switch(u1_level_idc)
   97|   148k|    {
   98|    318|        case H264_LEVEL_1_0:
  ------------------
  |  |  291|    318|#define H264_LEVEL_1_0     10
  ------------------
  |  Branch (98:9): [True: 318, False: 148k]
  ------------------
   99|  36.6k|        case H264_LEVEL_1_1:
  ------------------
  |  |  292|  36.6k|#define H264_LEVEL_1_1     11
  ------------------
  |  Branch (99:9): [True: 36.3k, False: 112k]
  ------------------
  100|  40.8k|        case H264_LEVEL_1_2:
  ------------------
  |  |  293|  40.8k|#define H264_LEVEL_1_2     12
  ------------------
  |  Branch (100:9): [True: 4.17k, False: 144k]
  ------------------
  101|  43.4k|        case H264_LEVEL_1_3:
  ------------------
  |  |  294|  43.4k|#define H264_LEVEL_1_3     13
  ------------------
  |  Branch (101:9): [True: 2.58k, False: 145k]
  ------------------
  102|  96.2k|        case H264_LEVEL_2_0:
  ------------------
  |  |  295|  96.2k|#define H264_LEVEL_2_0     20
  ------------------
  |  Branch (102:9): [True: 52.7k, False: 95.5k]
  ------------------
  103|   103k|        case H264_LEVEL_2_1:
  ------------------
  |  |  296|   103k|#define H264_LEVEL_2_1     21
  ------------------
  |  Branch (103:9): [True: 7.00k, False: 141k]
  ------------------
  104|   104k|        case H264_LEVEL_2_2:
  ------------------
  |  |  297|   104k|#define H264_LEVEL_2_2     22
  ------------------
  |  Branch (104:9): [True: 801, False: 147k]
  ------------------
  105|   107k|        case H264_LEVEL_3_0:
  ------------------
  |  |  298|   107k|#define H264_LEVEL_3_0     30
  ------------------
  |  Branch (105:9): [True: 3.60k, False: 144k]
  ------------------
  106|   108k|        case H264_LEVEL_3_1:
  ------------------
  |  |  299|   108k|#define H264_LEVEL_3_1     31
  ------------------
  |  Branch (106:9): [True: 1.33k, False: 147k]
  ------------------
  107|   127k|        case H264_LEVEL_3_2:
  ------------------
  |  |  300|   127k|#define H264_LEVEL_3_2     32
  ------------------
  |  Branch (107:9): [True: 18.5k, False: 129k]
  ------------------
  108|   142k|        case H264_LEVEL_4_0:
  ------------------
  |  |  301|   142k|#define H264_LEVEL_4_0     40
  ------------------
  |  Branch (108:9): [True: 14.8k, False: 133k]
  ------------------
  109|   144k|        case H264_LEVEL_4_1:
  ------------------
  |  |  302|   144k|#define H264_LEVEL_4_1     41
  ------------------
  |  Branch (109:9): [True: 2.27k, False: 146k]
  ------------------
  110|   148k|        case H264_LEVEL_4_2:
  ------------------
  |  |  303|   148k|#define H264_LEVEL_4_2     42
  ------------------
  |  Branch (110:9): [True: 3.48k, False: 144k]
  ------------------
  111|   148k|        case H264_LEVEL_5_0:
  ------------------
  |  |  304|   148k|#define H264_LEVEL_5_0     50
  ------------------
  |  Branch (111:9): [True: 0, False: 148k]
  ------------------
  112|   148k|        case H264_LEVEL_5_1:
  ------------------
  |  |  305|   148k|#define H264_LEVEL_5_1     51
  ------------------
  |  Branch (112:9): [True: 0, False: 148k]
  ------------------
  113|   148k|            return OK;
  ------------------
  |  |  114|   148k|#define OK        0
  ------------------
  114|    236|        default:
  ------------------
  |  Branch (114:9): [True: 236, False: 148k]
  ------------------
  115|    236|            return NOT_OK;
  ------------------
  |  |  116|    236|#define NOT_OK    -1
  ------------------
  116|   148k|    }
  117|   148k|}
isvcd_start_of_pic:
  133|   139k|{
  134|   139k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  135|   139k|    pocstruct_t *ps_prev_poc = &ps_dec->s_cur_pic_poc;
  136|   139k|    pocstruct_t *ps_cur_poc = ps_temp_poc;
  137|       |
  138|   139k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
  139|   139k|    dec_seq_params_t *ps_seq = ps_dec->ps_cur_sps;
  140|   139k|    UWORD8 u1_bottom_field_flag = ps_cur_slice->u1_bottom_field_flag;
  141|   139k|    UWORD8 u1_field_pic_flag = ps_cur_slice->u1_field_pic_flag;
  142|       |    /* high profile related declarations */
  143|   139k|    WORD32 ret;
  144|       |
  145|   139k|    H264_MUTEX_LOCK(&ps_dec->process_disp_mutex);
  146|       |
  147|   139k|    if(u1_field_pic_flag == 1)
  ------------------
  |  Branch (147:8): [True: 0, False: 139k]
  ------------------
  148|      0|    {
  149|      0|        ps_dec->i4_error_code = ERROR_SVC_FIELD_PIC_UNSUPPORTED;
  150|      0|        return ERROR_SVC_FIELD_PIC_UNSUPPORTED;
  151|      0|    }
  152|       |
  153|       |    /* check output buffer size given by the application */
  154|   139k|    if(check_app_out_buf_size(ps_dec) != IV_SUCCESS) return IVD_DISP_FRM_ZERO_OP_BUF_SIZE;
  ------------------
  |  Branch (154:8): [True: 1.39k, False: 138k]
  ------------------
  155|       |
  156|   138k|    ps_prev_poc->i4_pic_order_cnt_lsb = ps_cur_poc->i4_pic_order_cnt_lsb;
  157|   138k|    ps_prev_poc->i4_pic_order_cnt_msb = ps_cur_poc->i4_pic_order_cnt_msb;
  158|   138k|    ps_prev_poc->i4_delta_pic_order_cnt_bottom = ps_cur_poc->i4_delta_pic_order_cnt_bottom;
  159|   138k|    ps_prev_poc->i4_delta_pic_order_cnt[0] = ps_cur_poc->i4_delta_pic_order_cnt[0];
  160|   138k|    ps_prev_poc->i4_delta_pic_order_cnt[1] = ps_cur_poc->i4_delta_pic_order_cnt[1];
  161|   138k|    ps_prev_poc->u1_bot_field = ps_dec->ps_cur_slice->u1_bottom_field_flag;
  162|   138k|    ps_prev_poc->i4_prev_frame_num_ofst = ps_cur_poc->i4_prev_frame_num_ofst;
  163|   138k|    ps_prev_poc->u2_frame_num = u2_frame_num;
  164|   138k|    ps_dec->i1_prev_mb_qp_delta = 0;
  165|   138k|    ps_dec->i1_next_ctxt_idx = 0;
  166|       |
  167|   138k|    ps_dec->u4_nmb_deblk = 0;
  168|   138k|    if(ps_dec->u4_num_cores == 1) ps_dec->u4_nmb_deblk = 1;
  ------------------
  |  Branch (168:8): [True: 85.9k, False: 52.4k]
  ------------------
  169|       |
  170|   138k|    if(ps_seq->u1_mb_aff_flag == 1)
  ------------------
  |  Branch (170:8): [True: 0, False: 138k]
  ------------------
  171|      0|    {
  172|      0|        ps_dec->u4_nmb_deblk = 0;
  173|      0|        if(ps_dec->u4_num_cores > 2) ps_dec->u4_num_cores = 2;
  ------------------
  |  Branch (173:12): [True: 0, False: 0]
  ------------------
  174|      0|    }
  175|       |
  176|   138k|    ps_dec->u4_use_intrapred_line_copy = 0;
  177|       |
  178|   138k|    if(ps_seq->u1_mb_aff_flag == 0)
  ------------------
  |  Branch (178:8): [True: 138k, False: 0]
  ------------------
  179|   138k|    {
  180|   138k|        ps_dec->u4_use_intrapred_line_copy = 1;
  181|   138k|    }
  182|       |
  183|   138k|    ps_dec->u4_app_disable_deblk_frm = 0;
  184|       |    /* If degrade is enabled, set the degrade flags appropriately */
  185|   138k|    if(ps_dec->i4_degrade_type && ps_dec->i4_degrade_pics)
  ------------------
  |  Branch (185:8): [True: 0, False: 138k]
  |  Branch (185:35): [True: 0, False: 0]
  ------------------
  186|      0|    {
  187|      0|        WORD32 degrade_pic;
  188|      0|        ps_dec->i4_degrade_pic_cnt++;
  189|      0|        degrade_pic = 0;
  190|       |
  191|       |        /* If degrade is to be done in all frames, then do not check further */
  192|      0|        switch(ps_dec->i4_degrade_pics)
  ------------------
  |  Branch (192:16): [True: 0, False: 0]
  ------------------
  193|      0|        {
  194|      0|            case 4:
  ------------------
  |  Branch (194:13): [True: 0, False: 0]
  ------------------
  195|      0|            {
  196|      0|                degrade_pic = 1;
  197|      0|                break;
  198|      0|            }
  199|      0|            case 3:
  ------------------
  |  Branch (199:13): [True: 0, False: 0]
  ------------------
  200|      0|            {
  201|      0|                if(ps_cur_slice->u1_slice_type != I_SLICE) degrade_pic = 1;
  ------------------
  |  |  370|      0|#define I_SLICE  2
  ------------------
  |  Branch (201:20): [True: 0, False: 0]
  ------------------
  202|       |
  203|      0|                break;
  204|      0|            }
  205|      0|            case 2:
  ------------------
  |  Branch (205:13): [True: 0, False: 0]
  ------------------
  206|      0|            {
  207|       |                /* If pic count hits non-degrade interval or it is an islice, then do not
  208|       |                 * degrade */
  209|      0|                if((ps_cur_slice->u1_slice_type != I_SLICE) &&
  ------------------
  |  |  370|      0|#define I_SLICE  2
  ------------------
  |  Branch (209:20): [True: 0, False: 0]
  ------------------
  210|      0|                   (ps_dec->i4_degrade_pic_cnt != ps_dec->i4_nondegrade_interval))
  ------------------
  |  Branch (210:20): [True: 0, False: 0]
  ------------------
  211|      0|                    degrade_pic = 1;
  212|       |
  213|      0|                break;
  214|      0|            }
  215|      0|            case 1:
  ------------------
  |  Branch (215:13): [True: 0, False: 0]
  ------------------
  216|      0|            {
  217|       |                /* Check if the current picture is non-ref */
  218|      0|                if(0 == ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (218:20): [True: 0, False: 0]
  ------------------
  219|      0|                {
  220|      0|                    degrade_pic = 1;
  221|      0|                }
  222|      0|                break;
  223|      0|            }
  224|      0|        }
  225|      0|        if(degrade_pic)
  ------------------
  |  Branch (225:12): [True: 0, False: 0]
  ------------------
  226|      0|        {
  227|      0|            if(ps_dec->i4_degrade_type & 0x2) ps_dec->u4_app_disable_deblk_frm = 1;
  ------------------
  |  Branch (227:16): [True: 0, False: 0]
  ------------------
  228|       |
  229|       |            /* MC degrading is done only for non-ref pictures */
  230|      0|            if(0 == ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (230:16): [True: 0, False: 0]
  ------------------
  231|      0|            {
  232|      0|                if(ps_dec->i4_degrade_type & 0x4) ps_dec->i4_mv_frac_mask = 0;
  ------------------
  |  Branch (232:20): [True: 0, False: 0]
  ------------------
  233|       |
  234|      0|                if(ps_dec->i4_degrade_type & 0x8) ps_dec->i4_mv_frac_mask = 0;
  ------------------
  |  Branch (234:20): [True: 0, False: 0]
  ------------------
  235|      0|            }
  236|      0|        }
  237|      0|        else
  238|      0|            ps_dec->i4_degrade_pic_cnt = 0;
  239|      0|    }
  240|       |
  241|   138k|    {
  242|   138k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
  243|   138k|        if((ps_cur_slice->u1_slice_type == I_SLICE) || (ps_cur_slice->u1_slice_type == SI_SLICE))
  ------------------
  |  |  370|   138k|#define I_SLICE  2
  ------------------
                      if((ps_cur_slice->u1_slice_type == I_SLICE) || (ps_cur_slice->u1_slice_type == SI_SLICE))
  ------------------
  |  |  372|   125k|#define SI_SLICE 4
  ------------------
  |  Branch (243:12): [True: 12.9k, False: 125k]
  |  Branch (243:56): [True: 351, False: 125k]
  ------------------
  244|  13.3k|            ps_err->u1_cur_pic_type = PIC_TYPE_I;
  ------------------
  |  |  608|  13.3k|#define PIC_TYPE_I        (0x00)
  ------------------
  245|   125k|        else
  246|   125k|            ps_err->u1_cur_pic_type = PIC_TYPE_UNKNOWN;
  ------------------
  |  |  607|   125k|#define PIC_TYPE_UNKNOWN  (0xFF)
  ------------------
  247|       |
  248|   138k|        if(ps_err->u1_pic_aud_i == PIC_TYPE_I)
  ------------------
  |  |  608|   138k|#define PIC_TYPE_I        (0x00)
  ------------------
  |  Branch (248:12): [True: 0, False: 138k]
  ------------------
  249|      0|        {
  250|      0|            ps_err->u1_cur_pic_type = PIC_TYPE_I;
  ------------------
  |  |  608|      0|#define PIC_TYPE_I        (0x00)
  ------------------
  251|      0|            ps_err->u1_pic_aud_i = PIC_TYPE_UNKNOWN;
  ------------------
  |  |  607|      0|#define PIC_TYPE_UNKNOWN  (0xFF)
  ------------------
  252|      0|        }
  253|       |
  254|   138k|        if(ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL)
  ------------------
  |  |  328|   138k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (254:12): [True: 114k, False: 23.4k]
  ------------------
  255|   114k|        {
  256|   114k|            if(ps_err->u1_err_flag) ih264d_reset_ref_bufs(ps_dec->ps_dpb_mgr);
  ------------------
  |  Branch (256:16): [True: 0, False: 114k]
  ------------------
  257|   114k|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  600|   114k|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
  258|   114k|        }
  259|   138k|    }
  260|       |
  261|   138k|    if(ps_dec->u1_init_dec_flag && ps_dec->s_prev_seq_params.u1_eoseq_pending)
  ------------------
  |  Branch (261:8): [True: 114k, False: 23.6k]
  |  Branch (261:36): [True: 0, False: 114k]
  ------------------
  262|      0|    {
  263|       |        /* Reset the decoder picture buffers */
  264|      0|        WORD32 j;
  265|      0|        for(j = 0; j < MAX_DISP_BUFS_NEW; j++)
  ------------------
  |  |   76|      0|#define MAX_DISP_BUFS_NEW 64
  ------------------
  |  Branch (265:20): [True: 0, False: 0]
  ------------------
  266|      0|        {
  267|      0|            ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_pic_buf_mgr, j, BUF_MGR_REF);
  ------------------
  |  |   50|      0|#define BUF_MGR_REF          (1 << 2)
  ------------------
  268|      0|            ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_mv_buf_mgr,
  269|      0|                                  ps_dec->as_buf_id_info_map[j].mv_buf_id, BUF_MGR_REF);
  ------------------
  |  |   50|      0|#define BUF_MGR_REF          (1 << 2)
  ------------------
  270|      0|            ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_pic_buf_mgr, j, BUF_MGR_IO);
  ------------------
  |  |   53|      0|#define BUF_MGR_IO           (1 << 3)
  ------------------
  271|      0|        }
  272|       |
  273|       |        /* reset the decoder structure parameters related to buffer handling */
  274|      0|        ps_dec->u1_second_field = 0;
  275|      0|        ps_dec->i4_cur_display_seq = 0;
  276|       |
  277|       |        /********************************************************************/
  278|       |        /* indicate in the decoder output i4_status that some frames are being */
  279|       |        /* dropped, so that it resets timestamp and wait for a new sequence */
  280|       |        /********************************************************************/
  281|      0|        ps_dec->s_prev_seq_params.u1_eoseq_pending = 0;
  282|      0|    }
  283|   138k|    ret = isvcd_init_pic(ps_svc_lyr_dec, u2_frame_num, i4_poc, ps_pps);
  284|   138k|    if(ret != OK) return ret;
  ------------------
  |  |  114|   138k|#define OK        0
  ------------------
  |  Branch (284:8): [True: 0, False: 138k]
  ------------------
  285|       |
  286|   138k|    ps_dec->pv_parse_tu_coeff_data = ps_dec->pv_pic_tu_coeff_data;
  287|   138k|    ps_dec->pv_proc_tu_coeff_data = ps_dec->pv_pic_tu_coeff_data;
  288|   138k|    ps_dec->ps_nmb_info = ps_dec->ps_frm_mb_info;
  289|   138k|    ps_svc_lyr_dec->ps_svc_nmb_info = ps_svc_lyr_dec->ps_svc_frm_mb_info;
  290|   138k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (290:8): [True: 52.4k, False: 85.9k]
  ------------------
  291|  52.4k|    {
  292|  52.4k|        UWORD32 num_mbs;
  293|  52.4k|        num_mbs = ps_dec->ps_cur_sps->u4_total_num_of_mbs
  294|  52.4k|                  << (1 - ps_dec->ps_cur_sps->u1_frame_mbs_only_flag);
  295|       |
  296|  52.4k|        if(ps_dec->pu1_dec_mb_map)
  ------------------
  |  Branch (296:12): [True: 52.4k, False: 0]
  ------------------
  297|  52.4k|        {
  298|  52.4k|            memset((void *) ps_dec->pu1_dec_mb_map, 0, num_mbs);
  299|  52.4k|        }
  300|       |
  301|  52.4k|        if(ps_dec->pu1_recon_mb_map)
  ------------------
  |  Branch (301:12): [True: 52.4k, False: 0]
  ------------------
  302|  52.4k|        {
  303|  52.4k|            memset((void *) ps_dec->pu1_recon_mb_map, 0, num_mbs);
  304|  52.4k|        }
  305|       |
  306|  52.4k|        if(ps_dec->pu2_slice_num_map)
  ------------------
  |  Branch (306:12): [True: 52.4k, False: 0]
  ------------------
  307|  52.4k|        {
  308|  52.4k|            memset((void *) ps_dec->pu2_slice_num_map, 0, (num_mbs * sizeof(UWORD16)));
  309|  52.4k|        }
  310|  52.4k|    }
  311|       |
  312|   138k|    ps_dec->ps_parse_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
  313|   138k|    ps_dec->ps_decode_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
  314|   138k|    ps_dec->ps_computebs_cur_slice = &(ps_dec->ps_dec_slice_buf[0]);
  315|   138k|    ps_dec->u2_cur_slice_num = 0;
  316|       |
  317|       |    /* Initialize all the HP toolsets to zero */
  318|   138k|    ps_dec->s_high_profile.u1_scaling_present = 0;
  319|   138k|    ps_dec->s_high_profile.u1_transform8x8_present = 0;
  320|       |
  321|       |    /* Get Next Free Picture */
  322|   138k|    if(1 == ps_dec->u4_share_disp_buf)
  ------------------
  |  Branch (322:8): [True: 0, False: 138k]
  ------------------
  323|      0|    {
  324|      0|        UWORD32 i;
  325|       |        /* Free any buffer that is in the queue to be freed */
  326|      0|        for(i = 0; i < MAX_DISP_BUFS_NEW; i++)
  ------------------
  |  |   76|      0|#define MAX_DISP_BUFS_NEW 64
  ------------------
  |  Branch (326:20): [True: 0, False: 0]
  ------------------
  327|      0|        {
  328|      0|            if(0 == ps_dec->u4_disp_buf_to_be_freed[i]) continue;
  ------------------
  |  Branch (328:16): [True: 0, False: 0]
  ------------------
  329|      0|            ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_pic_buf_mgr, i, BUF_MGR_IO);
  ------------------
  |  |   53|      0|#define BUF_MGR_IO           (1 << 3)
  ------------------
  330|      0|            ps_dec->u4_disp_buf_to_be_freed[i] = 0;
  331|      0|            ps_dec->u4_disp_buf_mapping[i] = 0;
  332|      0|        }
  333|      0|    }
  334|   138k|    if(!(u1_field_pic_flag && 0 != ps_dec->u1_top_bottom_decoded))
  ------------------
  |  Branch (334:10): [True: 0, False: 138k]
  |  Branch (334:31): [True: 0, False: 0]
  ------------------
  335|   138k|    {
  336|   138k|        pic_buffer_t *ps_cur_pic;
  337|   138k|        WORD32 cur_pic_buf_id, cur_mv_buf_id;
  338|   138k|        col_mv_buf_t *ps_col_mv;
  339|   138k|        while(1)
  ------------------
  |  Branch (339:15): [True: 138k, Folded]
  ------------------
  340|   138k|        {
  341|   138k|            ps_cur_pic = (pic_buffer_t *) ih264_buf_mgr_get_next_free(
  342|   138k|                (buf_mgr_t *) ps_dec->pv_pic_buf_mgr, &cur_pic_buf_id);
  343|       |
  344|       |            /* In case of IDR slices, if there is no free picture buffer, then release
  345|       |             * all buffers from display and reference
  346|       |             */
  347|   138k|            if((ps_cur_pic == NULL) && (ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL))
  ------------------
  |  |  328|  1.14k|#define IDR_SLICE_NAL                   5
  ------------------
  |  Branch (347:16): [True: 1.14k, False: 137k]
  |  Branch (347:40): [True: 1.03k, False: 119]
  ------------------
  348|  1.03k|            {
  349|  1.03k|                WORD32 j;
  350|       |
  351|  66.9k|                for(j = 0; j < MAX_DISP_BUFS_NEW; j++)
  ------------------
  |  |   76|  66.9k|#define MAX_DISP_BUFS_NEW 64
  ------------------
  |  Branch (351:28): [True: 65.9k, False: 1.03k]
  ------------------
  352|  65.9k|                {
  353|  65.9k|                    ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_pic_buf_mgr, j, BUF_MGR_REF);
  ------------------
  |  |   50|  65.9k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  354|  65.9k|                    ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_mv_buf_mgr,
  355|  65.9k|                                          ps_dec->as_buf_id_info_map[j].mv_buf_id, BUF_MGR_REF);
  ------------------
  |  |   50|  65.9k|#define BUF_MGR_REF          (1 << 2)
  ------------------
  356|       |
  357|  65.9k|                    ih264_buf_mgr_release((buf_mgr_t *) ps_dec->pv_pic_buf_mgr, j, BUF_MGR_IO);
  ------------------
  |  |   53|  65.9k|#define BUF_MGR_IO           (1 << 3)
  ------------------
  358|  65.9k|                }
  359|  1.03k|                ps_cur_pic = (pic_buffer_t *) ih264_buf_mgr_get_next_free(
  360|  1.03k|                    (buf_mgr_t *) ps_dec->pv_pic_buf_mgr, &cur_pic_buf_id);
  361|  1.03k|            }
  362|   138k|            if(ps_cur_pic == NULL)
  ------------------
  |  Branch (362:16): [True: 119, False: 138k]
  ------------------
  363|    119|            {
  364|    119|                ps_dec->i4_error_code = ERROR_UNAVAIL_PICBUF_T;
  365|    119|                ps_dec->ps_dec_err_status->u1_err_flag |= REJECT_CUR_PIC;
  ------------------
  |  |  601|    119|#define REJECT_CUR_PIC    (0x01)
  ------------------
  366|    119|                return ERROR_UNAVAIL_PICBUF_T;
  367|    119|            }
  368|   138k|            if(0 == ps_dec->u4_disp_buf_mapping[cur_pic_buf_id])
  ------------------
  |  Branch (368:16): [True: 138k, False: 0]
  ------------------
  369|   138k|            {
  370|   138k|                break;
  371|   138k|            }
  372|   138k|        }
  373|   138k|        ps_col_mv = (col_mv_buf_t *) ih264_buf_mgr_get_next_free(
  374|   138k|            (buf_mgr_t *) ps_dec->pv_mv_buf_mgr, &cur_mv_buf_id);
  375|   138k|        if(ps_col_mv == NULL)
  ------------------
  |  Branch (375:12): [True: 734, False: 137k]
  ------------------
  376|    734|        {
  377|    734|            ps_dec->i4_error_code = ERROR_UNAVAIL_MVBUF_T;
  378|    734|            ps_dec->ps_dec_err_status->u1_err_flag |= REJECT_CUR_PIC;
  ------------------
  |  |  601|    734|#define REJECT_CUR_PIC    (0x01)
  ------------------
  379|    734|            return ERROR_UNAVAIL_MVBUF_T;
  380|    734|        }
  381|       |
  382|   137k|        ps_dec->ps_cur_pic = ps_cur_pic;
  383|   137k|        ps_dec->u1_pic_buf_id = cur_pic_buf_id;
  384|   137k|        ps_cur_pic->u4_ts = ps_dec->u4_ts;
  385|   137k|        memcpy(&ps_cur_pic->s_sei_pic, ps_dec->ps_sei, sizeof(sei));
  386|       |
  387|   137k|        ps_cur_pic->u1_mv_buf_id = cur_mv_buf_id;
  388|   137k|        ps_dec->as_buf_id_info_map[cur_pic_buf_id].mv_buf_id = cur_mv_buf_id;
  389|       |
  390|   137k|        if(ps_dec->u1_enable_mb_info)
  ------------------
  |  Branch (390:12): [True: 0, False: 137k]
  ------------------
  391|      0|        {
  392|      0|            UWORD32 mb_info_map_size = ps_dec->u4_total_mbs << 2;
  393|      0|            ps_dec->as_buf_id_info_map[cur_pic_buf_id].pu1_qp_map =
  394|      0|                ps_dec->pu1_qp_map_base + cur_pic_buf_id * mb_info_map_size;
  395|      0|            ps_dec->as_buf_id_info_map[cur_pic_buf_id].pu1_mb_type_map =
  396|      0|                ps_dec->pu1_mb_type_map_base + cur_pic_buf_id * mb_info_map_size;
  397|      0|            memset(ps_dec->as_buf_id_info_map[cur_pic_buf_id].pu1_qp_map, 0, mb_info_map_size);
  398|      0|            memset(ps_dec->as_buf_id_info_map[cur_pic_buf_id].pu1_mb_type_map, 0, mb_info_map_size);
  399|      0|        }
  400|   137k|        ps_cur_pic->pu1_col_zero_flag = (UWORD8 *) ps_col_mv->pv_col_zero_flag;
  401|   137k|        ps_cur_pic->ps_mv = (mv_pred_t *) ps_col_mv->pv_mv;
  402|   137k|        ps_dec->au1_pic_buf_ref_flag[cur_pic_buf_id] = 0;
  403|       |
  404|   137k|        {
  405|       |            /*make first entry of list0 and list1 point to cur pic,
  406|       |             *so that if first slice is in error, ref pic struct will have valid
  407|       |             *entries*/
  408|   137k|            ps_dec->ps_ref_pic_buf_lx[0] = ps_dec->ps_dpb_mgr->ps_init_dpb[0];
  409|   137k|            ps_dec->ps_ref_pic_buf_lx[1] = ps_dec->ps_dpb_mgr->ps_init_dpb[1];
  410|   137k|            *(ps_dec->ps_dpb_mgr->ps_init_dpb[0][0]) = *ps_cur_pic;
  411|       |            /* Initialize for field reference as well */
  412|   137k|            *(ps_dec->ps_dpb_mgr->ps_init_dpb[0][MAX_REF_BUFS]) = *ps_cur_pic;
  ------------------
  |  |   75|   137k|#define MAX_REF_BUFS    32
  ------------------
  413|       |
  414|   137k|            *(ps_dec->ps_dpb_mgr->ps_mod_dpb[0][0]) = *ps_cur_pic;
  415|       |            /* Initialize for field reference as well */
  416|   137k|            *(ps_dec->ps_dpb_mgr->ps_mod_dpb[0][MAX_REF_BUFS]) = *ps_cur_pic;
  ------------------
  |  |   75|   137k|#define MAX_REF_BUFS    32
  ------------------
  417|   137k|            *(ps_dec->ps_dpb_mgr->ps_init_dpb[1][0]) = *ps_cur_pic;
  418|       |            /* Initialize for field reference as well */
  419|   137k|            *(ps_dec->ps_dpb_mgr->ps_init_dpb[1][MAX_REF_BUFS]) = *ps_cur_pic;
  ------------------
  |  |   75|   137k|#define MAX_REF_BUFS    32
  ------------------
  420|   137k|            *(ps_dec->ps_dpb_mgr->ps_mod_dpb[1][0]) = *ps_cur_pic;
  421|       |            /* Initialize for field reference as well */
  422|   137k|            *(ps_dec->ps_dpb_mgr->ps_mod_dpb[1][MAX_REF_BUFS]) = *ps_cur_pic;
  ------------------
  |  |   75|   137k|#define MAX_REF_BUFS    32
  ------------------
  423|   137k|        }
  424|       |
  425|   137k|        ps_dec->ps_cur_pic->u1_picturetype = u1_field_pic_flag;
  426|   137k|        ps_dec->ps_cur_pic->u4_pack_slc_typ = SKIP_NONE;
  ------------------
  |  |  375|   137k|#define SKIP_NONE  (0x0)
  ------------------
  427|   137k|        H264_DEC_DEBUG_PRINT("got a buffer\n");
  ------------------
  |  |   39|   137k|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
  428|   137k|    }
  429|      0|    else
  430|      0|    {
  431|      0|        H264_DEC_DEBUG_PRINT("did not get a buffer\n");
  ------------------
  |  |   39|      0|#define H264_DEC_DEBUG_PRINT(...) {}
  ------------------
  432|      0|    }
  433|       |
  434|   137k|    ps_dec->u4_pic_buf_got = 1;
  435|       |
  436|   137k|    ps_dec->ps_cur_pic->i4_poc = i4_poc;
  437|   137k|    ps_dec->ps_cur_pic->i4_frame_num = u2_frame_num;
  438|   137k|    ps_dec->ps_cur_pic->i4_pic_num = u2_frame_num;
  439|   137k|    ps_dec->ps_cur_pic->i4_top_field_order_cnt = ps_pps->i4_top_field_order_cnt;
  440|   137k|    ps_dec->ps_cur_pic->i4_bottom_field_order_cnt = ps_pps->i4_bottom_field_order_cnt;
  441|   137k|    ps_dec->ps_cur_pic->i4_avg_poc = ps_pps->i4_avg_poc;
  442|   137k|    ps_dec->ps_cur_pic->u4_time_stamp = ps_dec->u4_pts;
  443|       |
  444|   137k|    ps_dec->s_cur_pic = *(ps_dec->ps_cur_pic);
  445|   137k|    if(u1_field_pic_flag && u1_bottom_field_flag)
  ------------------
  |  Branch (445:8): [True: 0, False: 137k]
  |  Branch (445:29): [True: 0, False: 0]
  ------------------
  446|      0|    {
  447|      0|        WORD32 i4_temp_poc;
  448|      0|        WORD32 i4_top_field_order_poc, i4_bot_field_order_poc;
  449|       |        /* Point to odd lines, since it's bottom field */
  450|      0|        ps_dec->s_cur_pic.pu1_buf1 += ps_dec->s_cur_pic.u2_frm_wd_y;
  451|      0|        ps_dec->s_cur_pic.pu1_buf2 += ps_dec->s_cur_pic.u2_frm_wd_uv;
  452|      0|        ps_dec->s_cur_pic.pu1_buf3 += ps_dec->s_cur_pic.u2_frm_wd_uv;
  453|      0|        ps_dec->s_cur_pic.ps_mv += ((ps_dec->u2_pic_ht * ps_dec->u2_pic_wd) >> 5);
  454|      0|        ps_dec->s_cur_pic.pu1_col_zero_flag += ((ps_dec->u2_pic_ht * ps_dec->u2_pic_wd) >> 5);
  455|      0|        ps_dec->ps_cur_pic->u1_picturetype |= BOT_FLD;
  ------------------
  |  |  354|      0|#define BOT_FLD         0x02
  ------------------
  456|      0|        i4_top_field_order_poc = ps_dec->ps_cur_pic->i4_top_field_order_cnt;
  457|      0|        i4_bot_field_order_poc = ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
  458|      0|        i4_temp_poc = MIN(i4_top_field_order_poc, i4_bot_field_order_poc);
  ------------------
  |  |   61|      0|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  459|      0|        ps_dec->ps_cur_pic->i4_avg_poc = i4_temp_poc;
  460|      0|    }
  461|       |
  462|   137k|    ps_cur_slice->u1_mbaff_frame_flag = ps_seq->u1_mb_aff_flag && (!u1_field_pic_flag);
  ------------------
  |  Branch (462:41): [True: 0, False: 137k]
  |  Branch (462:67): [True: 0, False: 0]
  ------------------
  463|   137k|    ps_dec->ps_cur_pic->u1_picturetype |= (ps_cur_slice->u1_mbaff_frame_flag << 2);
  464|       |
  465|   137k|    ps_dec->ps_cur_mb_row = ps_dec->ps_nbr_mb_row;
  466|   137k|    ps_dec->ps_cur_mb_row += 2;
  467|   137k|    ps_dec->ps_top_mb_row = ps_dec->ps_nbr_mb_row;
  468|   137k|    ps_dec->ps_top_mb_row +=
  469|   137k|        ((ps_dec->u2_frm_wd_in_mbs + 2) << (1 - ps_dec->ps_cur_sps->u1_frame_mbs_only_flag));
  470|       |    // Increment by 2 ,so that left mb (mbaff decrements by 2)  will always be valid
  471|   137k|    ps_dec->ps_top_mb_row += 2;
  472|   137k|    ps_dec->ps_mv_cur = ps_dec->s_cur_pic.ps_mv;
  473|   137k|    ps_dec->ps_mv_top = ps_dec->ps_mv_top_p[0];
  474|   137k|    ps_dec->u1_mv_top_p = 0;
  475|   137k|    ps_dec->u4_mb_idx = 0;
  476|   137k|    ps_dec->ps_mv_left = ps_dec->s_cur_pic.ps_mv;
  477|   137k|    ps_dec->u4_total_mbs_coded = 0;
  478|   137k|    ps_dec->i4_submb_ofst = -(SUB_BLK_SIZE);
  ------------------
  |  |  562|   137k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   137k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   137k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
  479|   137k|    ps_dec->u4_pred_info_idx = 0;
  480|   137k|    ps_dec->u4_pred_info_pkd_idx = 0;
  481|   137k|    ps_dec->u4_dma_buf_idx = 0;
  482|   137k|    ps_dec->ps_mv = ps_dec->s_cur_pic.ps_mv;
  483|   137k|    ps_dec->ps_mv_bank_cur = ps_dec->s_cur_pic.ps_mv;
  484|   137k|    ps_dec->pu1_col_zero_flag = ps_dec->s_cur_pic.pu1_col_zero_flag;
  485|   137k|    ps_dec->ps_part = ps_dec->ps_parse_part_params;
  486|   137k|    ps_dec->i2_prev_slice_mbx = -1;
  487|   137k|    ps_dec->i2_prev_slice_mby = 0;
  488|   137k|    ps_dec->u2_mv_2mb[0] = 0;
  489|   137k|    ps_dec->u2_mv_2mb[1] = 0;
  490|   137k|    ps_dec->u1_last_pic_not_decoded = 0;
  491|       |
  492|   137k|    ps_dec->u2_cur_slice_num_dec_thread = 0;
  493|   137k|    ps_dec->u2_cur_slice_num_bs = 0;
  494|   137k|    ps_dec->u4_intra_pred_line_ofst = 0;
  495|   137k|    ps_dec->pu1_cur_y_intra_pred_line = ps_dec->pu1_y_intra_pred_line;
  496|   137k|    ps_dec->pu1_cur_u_intra_pred_line = ps_dec->pu1_u_intra_pred_line;
  497|   137k|    ps_dec->pu1_cur_v_intra_pred_line = ps_dec->pu1_v_intra_pred_line;
  498|       |
  499|   137k|    ps_dec->pu1_cur_y_intra_pred_line_base = ps_dec->pu1_y_intra_pred_line;
  500|   137k|    ps_dec->pu1_cur_u_intra_pred_line_base = ps_dec->pu1_u_intra_pred_line;
  501|   137k|    ps_dec->pu1_cur_v_intra_pred_line_base = ps_dec->pu1_v_intra_pred_line;
  502|       |
  503|   137k|    ps_dec->pu1_prev_y_intra_pred_line =
  504|   137k|        ps_dec->pu1_y_intra_pred_line + (ps_dec->u2_frm_wd_in_mbs * MB_SIZE);
  ------------------
  |  |  554|   137k|#define MB_SIZE             16
  ------------------
  505|       |
  506|   137k|    ps_dec->pu1_prev_u_intra_pred_line =
  507|   137k|        ps_dec->pu1_u_intra_pred_line + ps_dec->u2_frm_wd_in_mbs * BLK8x8SIZE * YUV420SP_FACTOR;
  ------------------
  |  |  555|   137k|#define BLK8x8SIZE          8
  ------------------
                      ps_dec->pu1_u_intra_pred_line + ps_dec->u2_frm_wd_in_mbs * BLK8x8SIZE * YUV420SP_FACTOR;
  ------------------
  |  |  119|   137k|#define YUV420SP_FACTOR 2
  ------------------
  508|   137k|    ps_dec->pu1_prev_v_intra_pred_line =
  509|   137k|        ps_dec->pu1_v_intra_pred_line + ps_dec->u2_frm_wd_in_mbs * BLK8x8SIZE;
  ------------------
  |  |  555|   137k|#define BLK8x8SIZE          8
  ------------------
  510|       |
  511|   137k|    ps_dec->ps_deblk_mbn = ps_dec->ps_deblk_pic;
  512|       |    /* Initialize The Function Pointer Depending Upon the Entropy and MbAff Flag
  513|       |     */
  514|   137k|    {
  515|   137k|        if(ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (515:12): [True: 0, False: 137k]
  ------------------
  516|      0|        {
  517|      0|            ps_dec->pf_compute_bs = ih264d_compute_bs_mbaff;
  518|      0|            ps_dec->pf_mvpred = ih264d_mvpred_mbaff;
  519|      0|            ps_svc_lyr_dec->pf_svc_compute_bs = isvcd_compute_bs_non_mbaff;
  520|      0|        }
  521|   137k|        else
  522|   137k|        {
  523|   137k|            ps_dec->pf_compute_bs = ih264d_compute_bs_non_mbaff;
  524|   137k|            ps_svc_lyr_dec->pf_svc_compute_bs = isvcd_compute_bs_non_mbaff;
  525|   137k|            ps_dec->u1_cur_mb_fld_dec_flag = ps_cur_slice->u1_field_pic_flag;
  526|       |
  527|   137k|            if((ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) &&
  ------------------
  |  |  110|   137k|#define TARGET_LAYER 2
  ------------------
  |  Branch (527:16): [True: 91.2k, False: 46.3k]
  ------------------
  528|  91.2k|               (0 == ps_svc_lyr_dec->u1_base_res_flag))
  ------------------
  |  Branch (528:16): [True: 35.0k, False: 56.1k]
  ------------------
  529|  35.0k|            {
  530|  35.0k|                ps_svc_lyr_dec->pf_svc_compute_bs = isvcd_compute_bs_non_mbaff_target_lyr;
  531|  35.0k|            }
  532|       |
  533|   137k|            if((ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) &&
  ------------------
  |  |  110|   137k|#define TARGET_LAYER 2
  ------------------
  |  Branch (533:16): [True: 91.2k, False: 46.3k]
  ------------------
  534|  91.2k|               (1 == ps_svc_lyr_dec->u1_base_res_flag))
  ------------------
  |  Branch (534:16): [True: 56.1k, False: 35.0k]
  ------------------
  535|  56.1k|            {
  536|  56.1k|                ps_svc_lyr_dec->pf_svc_compute_bs =
  537|  56.1k|                    isvcd_compute_bs_non_mbaff_target_lyr_no_inter_layer;
  538|  56.1k|            }
  539|       |
  540|   137k|            if((ps_svc_lyr_dec->u1_layer_identifier == MEDIAL_ENHANCEMENT_LAYER) &&
  ------------------
  |  |  109|   137k|#define MEDIAL_ENHANCEMENT_LAYER 1
  ------------------
  |  Branch (540:16): [True: 0, False: 137k]
  ------------------
  541|      0|               (0 == ps_svc_lyr_dec->u1_base_res_flag))
  ------------------
  |  Branch (541:16): [True: 0, False: 0]
  ------------------
  542|      0|            {
  543|      0|                ps_svc_lyr_dec->pf_svc_compute_bs = isvcd_compute_bs_non_mbaff_medial_lyr;
  544|      0|            }
  545|   137k|        }
  546|   137k|    }
  547|       |    /* Set up the Parameter for DMA transfer */
  548|   137k|    {
  549|   137k|        UWORD8 u1_field_pic_flag = ps_dec->ps_cur_slice->u1_field_pic_flag;
  550|   137k|        UWORD8 u1_mbaff = ps_cur_slice->u1_mbaff_frame_flag;
  551|   137k|        UWORD16 uc_lastmbs = (((ps_dec->u2_pic_wd) >> 4) % (ps_dec->u4_recon_mb_grp >> u1_mbaff));
  552|   137k|        UWORD16 ui16_lastmbs_widthY =
  553|   137k|            (uc_lastmbs ? (uc_lastmbs << 4) : ((ps_dec->u4_recon_mb_grp >> u1_mbaff) << 4));
  ------------------
  |  Branch (553:14): [True: 0, False: 137k]
  ------------------
  554|   137k|        UWORD16 ui16_lastmbs_widthUV =
  555|   137k|            uc_lastmbs ? (uc_lastmbs << 3) : ((ps_dec->u4_recon_mb_grp >> u1_mbaff) << 3);
  ------------------
  |  Branch (555:13): [True: 0, False: 137k]
  ------------------
  556|       |
  557|   137k|        ps_dec->s_tran_addrecon.pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1;
  558|   137k|        ps_dec->s_tran_addrecon.pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2;
  559|   137k|        ps_dec->s_tran_addrecon.pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3;
  560|       |
  561|   137k|        ps_dec->s_tran_addrecon.u2_frm_wd_y = ps_dec->u2_frm_wd_y << u1_field_pic_flag;
  562|   137k|        ps_dec->s_tran_addrecon.u2_frm_wd_uv = ps_dec->u2_frm_wd_uv << u1_field_pic_flag;
  563|       |
  564|   137k|        if(u1_field_pic_flag)
  ------------------
  |  Branch (564:12): [True: 0, False: 137k]
  ------------------
  565|      0|        {
  566|      0|            ui16_lastmbs_widthY += ps_dec->u2_frm_wd_y;
  567|      0|            ui16_lastmbs_widthUV += ps_dec->u2_frm_wd_uv;
  568|      0|        }
  569|       |
  570|       |        /* Normal Increment of Pointer */
  571|   137k|        ps_dec->s_tran_addrecon.u4_inc_y[0] = ((ps_dec->u4_recon_mb_grp << 4) >> u1_mbaff);
  572|   137k|        ps_dec->s_tran_addrecon.u4_inc_uv[0] = ((ps_dec->u4_recon_mb_grp << 4) >> u1_mbaff);
  573|       |
  574|       |        /* End of Row Increment */
  575|   137k|        ps_dec->s_tran_addrecon.u4_inc_y[1] =
  576|   137k|            (ui16_lastmbs_widthY + (PAD_LEN_Y_H << 1) +
  ------------------
  |  |  571|   137k|#define PAD_LEN_Y_H                   32
  ------------------
  577|   137k|             ps_dec->s_tran_addrecon.u2_frm_wd_y * ((15 << u1_mbaff) + u1_mbaff));
  578|   137k|        ps_dec->s_tran_addrecon.u4_inc_uv[1] =
  579|   137k|            (ui16_lastmbs_widthUV + (PAD_LEN_UV_H << 2) +
  ------------------
  |  |  573|   137k|#define PAD_LEN_UV_H                  16
  ------------------
  580|   137k|             ps_dec->s_tran_addrecon.u2_frm_wd_uv * ((15 << u1_mbaff) + u1_mbaff));
  581|       |
  582|       |        /* Assign picture numbers to each frame/field  */
  583|       |        /* only once per picture.                      */
  584|   137k|        ih264d_assign_pic_num(ps_dec);
  585|   137k|        ps_dec->s_tran_addrecon.u2_mv_top_left_inc =
  586|   137k|            (ps_dec->u4_recon_mb_grp << 2) - 1 - (u1_mbaff << 2);
  587|   137k|        ps_dec->s_tran_addrecon.u2_mv_left_inc = ((ps_dec->u4_recon_mb_grp >> u1_mbaff) - 1)
  588|   137k|                                                 << (4 + u1_mbaff);
  589|   137k|    }
  590|       |    /**********************************************************************/
  591|       |    /* High profile related initialization at pictrue level               */
  592|       |    /**********************************************************************/
  593|   137k|    if((ps_seq->u1_profile_idc == HIGH_PROFILE_IDC) ||
  ------------------
  |  |  278|   137k|#define HIGH_PROFILE_IDC   100
  ------------------
  |  Branch (593:8): [True: 8.20k, False: 129k]
  ------------------
  594|   129k|       (ps_seq->u1_profile_idc == SCALABLE_HIGH_PROFILE_IDC) ||
  ------------------
  |  |   60|   129k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (594:8): [True: 2.32k, False: 127k]
  ------------------
  595|   127k|       (ps_seq->u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC))
  ------------------
  |  |   59|   127k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (595:8): [True: 4.02k, False: 122k]
  ------------------
  596|  14.5k|    {
  597|  14.5k|        if((ps_seq->i4_seq_scaling_matrix_present_flag) ||
  ------------------
  |  Branch (597:12): [True: 9.68k, False: 4.87k]
  ------------------
  598|  4.87k|           (ps_pps->i4_pic_scaling_matrix_present_flag))
  ------------------
  |  Branch (598:12): [True: 1.24k, False: 3.63k]
  ------------------
  599|  10.9k|        {
  600|  10.9k|            ret = ih264d_form_scaling_matrix_picture(ps_seq, ps_pps, ps_dec);
  601|  10.9k|            ps_dec->s_high_profile.u1_scaling_present = 1;
  602|  10.9k|        }
  603|  3.63k|        else
  604|  3.63k|        {
  605|  3.63k|            ret = ih264d_form_default_scaling_matrix(ps_dec);
  606|  3.63k|        }
  607|       |
  608|  14.5k|        if(ps_pps->i4_transform_8x8_mode_flag)
  ------------------
  |  Branch (608:12): [True: 8.52k, False: 6.03k]
  ------------------
  609|  8.52k|        {
  610|  8.52k|            ps_dec->s_high_profile.u1_transform8x8_present = 1;
  611|  8.52k|        }
  612|  14.5k|    }
  613|   122k|    else
  614|   122k|    {
  615|   122k|        ret = ih264d_form_default_scaling_matrix(ps_dec);
  616|   122k|    }
  617|       |
  618|   137k|    if(ret != OK) return ret;
  ------------------
  |  |  114|   137k|#define OK        0
  ------------------
  |  Branch (618:8): [True: 0, False: 137k]
  ------------------
  619|       |
  620|       |    /* required while reading the transform_size_8x8 u4_flag */
  621|   137k|    ps_dec->s_high_profile.u1_direct_8x8_inference_flag = ps_seq->u1_direct_8x8_inference_flag;
  622|   137k|    ps_dec->s_high_profile.s_cavlc_ctxt = ps_dec->s_cavlc_ctxt;
  623|       |
  624|   137k|    ps_dec->i1_recon_in_thread3_flag = 1;
  625|   137k|    ps_dec->ps_frame_buf_ip_recon = &ps_dec->s_tran_addrecon;
  626|   137k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (626:8): [True: 51.8k, False: 85.6k]
  ------------------
  627|  51.8k|    {
  628|  51.8k|        memcpy(&ps_dec->s_tran_addrecon_parse, &ps_dec->s_tran_addrecon, sizeof(tfr_ctxt_t));
  629|  51.8k|    }
  630|       |
  631|   137k|    ih264d_init_deblk_tfr_ctxt(ps_dec, &(ps_dec->s_pad_mgr), &(ps_dec->s_tran_addrecon),
  632|   137k|                               ps_dec->u2_frm_wd_in_mbs, 0);
  633|       |
  634|   137k|    ps_dec->ps_cur_deblk_mb = ps_dec->ps_deblk_pic;
  635|   137k|    ps_dec->u4_cur_deblk_mb_num = 0;
  636|   137k|    ps_dec->u4_deblk_mb_x = 0;
  637|   137k|    ps_dec->u4_deblk_mb_y = 0;
  638|   137k|    ps_dec->pu4_wt_ofsts = ps_dec->pu4_wts_ofsts_mat;
  639|       |
  640|   137k|    ps_dec->u4_first_slice_in_pic = 0;
  641|   137k|    H264_MUTEX_UNLOCK(&ps_dec->process_disp_mutex);
  642|   137k|    return OK;
  ------------------
  |  |  114|   137k|#define OK        0
  ------------------
  643|   137k|}
isvcd_parse_decode_slice_ext_nal:
  657|  39.3k|{
  658|  39.3k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  659|  39.3k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
  660|  39.3k|    dec_pic_params_t *ps_pps;
  661|  39.3k|    dec_seq_params_t *ps_seq;
  662|  39.3k|    dec_svc_seq_params_t *ps_subset_seq;
  663|  39.3k|    dec_slice_params_t *ps_cur_slice = NULL;
  664|  39.3k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
  665|       |
  666|  39.3k|    pocstruct_t s_tmp_poc = {0};
  667|  39.3k|    WORD32 i_delta_poc[2] = {0};
  668|  39.3k|    WORD32 i4_poc = 0;
  669|  39.3k|    UWORD16 u2_first_mb_in_slice, u2_frame_num;
  670|  39.3k|    UWORD8 u1_field_pic_flag, u1_redundant_pic_cnt = 0, u1_slice_type;
  671|  39.3k|    UWORD32 u4_idr_pic_id = 0;
  672|  39.3k|    UWORD8 u1_bottom_field_flag, u1_pic_order_cnt_type;
  673|       |
  674|  39.3k|    UWORD8 u1_nal_unit_type;
  675|  39.3k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
  676|  39.3k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
  677|  39.3k|    WORD8 i1_is_end_of_poc;
  678|  39.3k|    WORD32 ret;
  679|  39.3k|    WORD32 prev_slice_err, num_mb_skipped;
  680|  39.3k|    UWORD8 u1_mbaff;
  681|  39.3k|    pocstruct_t *ps_cur_poc;
  682|  39.3k|    UWORD32 u4_temp;
  683|  39.3k|    WORD32 i_temp;
  684|  39.3k|    svc_dec_ctxt_t *psvcd_dec_ctxt;
  685|  39.3k|    dec_struct_t *ps_dec_cur_lyr_minus_1;
  686|  39.3k|    svc_dec_lyr_struct_t *ps_svc_cur_lyr_dec_minus_1;
  687|       |
  688|  39.3k|    ps_cur_slice = ps_dec->ps_cur_slice;
  689|  39.3k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
  690|       |
  691|       |    /* read FirstMbInSlice  and slice type*/
  692|  39.3k|    ps_dec->ps_dpb_cmds->u1_dpb_commands_read_slc = 0;
  693|  39.3k|    u2_first_mb_in_slice = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  694|  39.3k|    if(u2_first_mb_in_slice > (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs))
  ------------------
  |  Branch (694:8): [True: 173, False: 39.2k]
  ------------------
  695|    173|    {
  696|    173|        return ERROR_CORRUPTED_SLICE;
  697|    173|    }
  698|       |
  699|       |    /*we currently don not support ASO*/
  700|  39.2k|    if(((u2_first_mb_in_slice << ps_cur_slice->u1_mbaff_frame_flag) <= ps_dec->u4_cur_mb_addr) &&
  ------------------
  |  Branch (700:8): [True: 38.2k, False: 1.00k]
  ------------------
  701|  38.2k|       (ps_dec->u4_first_slice_in_pic == 0))
  ------------------
  |  Branch (701:8): [True: 88, False: 38.1k]
  ------------------
  702|     88|    {
  703|     88|        return ERROR_CORRUPTED_SLICE;
  704|     88|    }
  705|       |
  706|  39.1k|    if(ps_dec->u4_first_slice_in_pic == 1)
  ------------------
  |  Branch (706:8): [True: 38.2k, False: 917]
  ------------------
  707|  38.2k|    {
  708|  38.2k|        if(u2_first_mb_in_slice != 0)
  ------------------
  |  Branch (708:12): [True: 86, False: 38.1k]
  ------------------
  709|     86|        {
  710|     86|            return ERROR_CORRUPTED_SLICE;
  711|     86|        }
  712|  38.2k|    }
  713|       |
  714|  39.0k|    COPYTHECONTEXT("Slice Header SVC ext: first_mb_in_slice", u2_first_mb_in_slice);
  715|       |
  716|  39.0k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  717|       |
  718|  39.0k|    if(u4_temp > 9) return ERROR_INV_SLC_TYPE_T;
  ------------------
  |  Branch (718:8): [True: 101, False: 38.9k]
  ------------------
  719|       |
  720|  38.9k|    u1_slice_type = u4_temp;
  721|  38.9k|    COPYTHECONTEXT("Slice Header SVC ext: slice_type", (u1_slice_type));
  722|       |    /* Find Out the Slice Type is 5 to 9 or not then Set the Flag   */
  723|       |    /* u1_sl_typ_5_9 = 1 .Which tells that all the slices in the Pic*/
  724|       |    /* will be of same type of current                            */
  725|  38.9k|    if(u1_slice_type > 4)
  ------------------
  |  Branch (725:8): [True: 385, False: 38.5k]
  ------------------
  726|    385|    {
  727|    385|        u1_slice_type -= 5;
  728|    385|    }
  729|       |
  730|  38.9k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  731|  38.9k|    if(u4_temp & MASK_ERR_PIC_SET_ID) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  527|  38.9k|#define MASK_ERR_PIC_SET_ID   (0xFFFFFF00)
  ------------------
  |  Branch (731:8): [True: 66, False: 38.8k]
  ------------------
  732|       |    /* discard slice if pic param is invalid */
  733|  38.8k|    COPYTHECONTEXT("Slice Header SVC ext: pic_parameter_set_id", u4_temp);
  734|  38.8k|    ps_pps = &ps_dec->ps_pps[u4_temp];
  735|  38.8k|    if(FALSE == ps_pps->u1_is_valid)
  ------------------
  |  |  592|  38.8k|#define FALSE   0
  ------------------
  |  Branch (735:8): [True: 78, False: 38.8k]
  ------------------
  736|     78|    {
  737|     78|        return ERROR_INV_SLICE_HDR_T;
  738|     78|    }
  739|       |    /* slices in a layer should have same PPS id*/
  740|  38.8k|    if(UINT32_MAX == ps_svc_lyr_dec->u4_pps_id_for_layer)
  ------------------
  |  Branch (740:8): [True: 37.8k, False: 909]
  ------------------
  741|  37.8k|    {
  742|  37.8k|        ps_svc_lyr_dec->u4_pps_id_for_layer = u4_temp;
  743|  37.8k|    }
  744|    909|    else if(u4_temp != ps_svc_lyr_dec->u4_pps_id_for_layer)
  ------------------
  |  Branch (744:13): [True: 72, False: 837]
  ------------------
  745|     72|    {
  746|     72|        return ERROR_INV_SLICE_HDR_T;
  747|     72|    }
  748|  38.7k|    ps_seq = ps_pps->ps_sps;
  749|  38.7k|    ps_seq += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  38.7k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  750|  38.7k|    ps_subset_seq =
  751|  38.7k|        &ps_svc_lyr_dec->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_seq->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  38.7k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
  752|       |
  753|  38.7k|    ps_dec->ps_cur_sps = ps_seq;
  754|  38.7k|    ps_svc_lyr_dec->ps_cur_subset_sps = ps_subset_seq;
  755|       |
  756|  38.7k|    if(!ps_seq) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (756:8): [True: 0, False: 38.7k]
  ------------------
  757|  38.7k|    if(FALSE == ps_seq->u1_is_valid) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  592|  38.7k|#define FALSE   0
  ------------------
  |  Branch (757:8): [True: 324, False: 38.4k]
  ------------------
  758|  38.4k|    if(ps_seq->u1_mb_aff_flag) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (758:8): [True: 66, False: 38.3k]
  ------------------
  759|  38.3k|    if(ps_seq->u1_level_idc > H264_LEVEL_4_2) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  303|  38.3k|#define H264_LEVEL_4_2     42
  ------------------
  |  Branch (759:8): [True: 74, False: 38.2k]
  ------------------
  760|  38.2k|    if(!ps_seq->u1_frame_mbs_only_flag) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (760:8): [True: 68, False: 38.1k]
  ------------------
  761|  38.1k|    if(OK != isvcd_verify_level(ps_seq->u1_level_idc)) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  114|  38.1k|#define OK        0
  ------------------
  |  Branch (761:8): [True: 66, False: 38.1k]
  ------------------
  762|       |
  763|  38.1k|    if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (763:8): [True: 31.0k, False: 7.10k]
  ------------------
  764|  31.0k|    {
  765|  31.0k|        if(ps_dec->u2_frm_wd_in_mbs != ps_seq->u2_frm_wd_in_mbs) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (765:12): [True: 67, False: 30.9k]
  ------------------
  766|  30.9k|        if(ps_dec->u2_frm_ht_in_mbs != ps_seq->u2_frm_ht_in_mbs) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (766:12): [True: 68, False: 30.8k]
  ------------------
  767|  30.9k|    }
  768|       |
  769|  37.9k|    if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (769:8): [True: 30.8k, False: 7.10k]
  ------------------
  770|  30.8k|    {
  771|  30.8k|        if(ps_dec->u2_disp_height != ps_subset_seq->u2_disp_height) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (771:12): [True: 67, False: 30.8k]
  ------------------
  772|  30.8k|        if(ps_dec->u2_disp_width != ps_subset_seq->u2_disp_width) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (772:12): [True: 67, False: 30.7k]
  ------------------
  773|  30.8k|    }
  774|       |
  775|  37.8k|    ps_dec->i4_reorder_depth = ps_subset_seq->i4_reorder_depth;
  776|       |
  777|  37.8k|    ps_dec->u2_disp_height = ps_subset_seq->u2_disp_height;
  778|  37.8k|    ps_dec->u2_disp_width = ps_subset_seq->u2_disp_width;
  779|       |
  780|  37.8k|    if(ps_svc_lyr_dec->u1_layer_id > 0)
  ------------------
  |  Branch (780:8): [True: 37.8k, False: 0]
  ------------------
  781|  37.8k|    {
  782|  37.8k|        psvcd_dec_ctxt = ps_svc_lyr_dec->ps_svcd_ctxt;
  783|  37.8k|        ps_svc_cur_lyr_dec_minus_1 =
  784|  37.8k|            &psvcd_dec_ctxt->ps_svc_dec_lyr[ps_svc_lyr_dec->u1_layer_id - 1];
  785|       |
  786|  37.8k|        ps_dec_cur_lyr_minus_1 = &ps_svc_cur_lyr_dec_minus_1->s_dec;
  787|       |
  788|  37.8k|        if((ps_dec_cur_lyr_minus_1->u2_pic_wd > ps_subset_seq->u2_pic_wd) ||
  ------------------
  |  Branch (788:12): [True: 76, False: 37.7k]
  ------------------
  789|  37.7k|           (ps_dec_cur_lyr_minus_1->u2_pic_ht > ps_subset_seq->u2_pic_ht))
  ------------------
  |  Branch (789:12): [True: 86, False: 37.7k]
  ------------------
  790|    162|        {
  791|    162|            return ERROR_CORRUPTED_SLICE;
  792|    162|        }
  793|  37.8k|    }
  794|       |
  795|  37.7k|    ps_dec->u2_pic_wd = ps_subset_seq->u2_pic_wd;
  796|  37.7k|    ps_dec->u2_pic_ht = ps_subset_seq->u2_pic_ht;
  797|  37.7k|    ps_dec->u4_total_mbs = ps_seq->u4_total_num_of_mbs << (1 - ps_seq->u1_frame_mbs_only_flag);
  798|       |
  799|       |    /* Determining the Width and Height of Frame from that of Picture */
  800|  37.7k|    ps_dec->u2_frm_wd_y = ps_subset_seq->u2_frm_wd_y;
  801|  37.7k|    ps_dec->u2_frm_ht_y = ps_subset_seq->u2_frm_ht_y;
  802|       |
  803|  37.7k|    ps_dec->u2_frm_wd_uv = ps_subset_seq->u2_frm_wd_uv;
  804|  37.7k|    ps_dec->u2_frm_ht_uv = ps_subset_seq->u2_frm_ht_uv;
  805|       |
  806|  37.7k|    ps_dec->s_pad_mgr.u1_pad_len_y_v = ps_subset_seq->u1_pad_len_y_v;
  807|  37.7k|    ps_dec->s_pad_mgr.u1_pad_len_cr_v = ps_subset_seq->u1_pad_len_cr_v;
  808|       |
  809|  37.7k|    ps_dec->u2_frm_wd_in_mbs = ps_seq->u2_frm_wd_in_mbs;
  810|  37.7k|    ps_dec->u2_frm_ht_in_mbs = ps_seq->u2_frm_ht_in_mbs;
  811|       |
  812|  37.7k|    ps_dec->u2_crop_offset_y = ps_subset_seq->u2_crop_offset_y;
  813|  37.7k|    ps_dec->u2_crop_offset_uv = ps_subset_seq->u2_crop_offset_uv;
  814|       |
  815|       |    /* Get the frame num */
  816|  37.7k|    u2_frame_num = ih264d_get_bits_h264(ps_bitstrm, ps_seq->u1_bits_in_frm_num);
  817|       |
  818|  37.7k|    COPYTHECONTEXT("Slice Header SVC ext: frame_num", u2_frame_num);
  819|  37.7k|    if(!ps_dec->u1_first_slice_in_stream && ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (819:8): [True: 23.7k, False: 13.9k]
  |  Branch (819:45): [True: 22.9k, False: 837]
  ------------------
  820|  22.9k|    {
  821|  22.9k|        pocstruct_t *ps_prev_poc = &ps_dec->s_prev_pic_poc;
  822|  22.9k|        pocstruct_t *ps_cur_poc = &ps_dec->s_cur_pic_poc;
  823|       |
  824|  22.9k|        ps_dec->u2_mbx = 0xffff;
  825|  22.9k|        ps_dec->u2_mby = 0;
  826|       |
  827|  22.9k|        if((0 == u1_is_idr_slice) && ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (827:12): [True: 1.90k, False: 21.0k]
  |  Branch (827:38): [True: 1.74k, False: 157]
  ------------------
  828|  1.74k|            ps_dec->u2_prev_ref_frame_num = ps_cur_slice->u2_frame_num;
  829|       |
  830|  22.9k|        if(u1_is_idr_slice || ps_cur_slice->u1_mmco_equalto5) ps_dec->u2_prev_ref_frame_num = 0;
  ------------------
  |  Branch (830:12): [True: 21.0k, False: 1.90k]
  |  Branch (830:31): [True: 440, False: 1.46k]
  ------------------
  831|       |
  832|  22.9k|        if(ps_dec->ps_cur_sps->u1_gaps_in_frame_num_value_allowed_flag)
  ------------------
  |  Branch (832:12): [True: 0, False: 22.9k]
  ------------------
  833|      0|        {
  834|      0|            isvcd_decode_gaps_in_frame_num(ps_dec, u2_frame_num);
  835|      0|        }
  836|       |
  837|  22.9k|        ps_prev_poc->i4_prev_frame_num_ofst = ps_cur_poc->i4_prev_frame_num_ofst;
  838|  22.9k|        ps_prev_poc->u2_frame_num = ps_cur_poc->u2_frame_num;
  839|  22.9k|        ps_prev_poc->u1_mmco_equalto5 = ps_cur_slice->u1_mmco_equalto5;
  840|  22.9k|        if(ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (840:12): [True: 19.5k, False: 3.34k]
  ------------------
  841|  19.5k|        {
  842|  19.5k|            ps_prev_poc->i4_pic_order_cnt_lsb = ps_cur_poc->i4_pic_order_cnt_lsb;
  843|  19.5k|            ps_prev_poc->i4_pic_order_cnt_msb = ps_cur_poc->i4_pic_order_cnt_msb;
  844|  19.5k|            ps_prev_poc->i4_delta_pic_order_cnt_bottom = ps_cur_poc->i4_delta_pic_order_cnt_bottom;
  845|  19.5k|            ps_prev_poc->i4_delta_pic_order_cnt[0] = ps_cur_poc->i4_delta_pic_order_cnt[0];
  846|  19.5k|            ps_prev_poc->i4_delta_pic_order_cnt[1] = ps_cur_poc->i4_delta_pic_order_cnt[1];
  847|  19.5k|            ps_prev_poc->u1_bot_field = ps_cur_poc->u1_bot_field;
  848|  19.5k|        }
  849|       |
  850|  22.9k|        ps_dec->u4_total_mbs_coded = 0;
  851|  22.9k|    }
  852|       |    /* Get the field related flags  */
  853|  37.7k|    if(!ps_seq->u1_frame_mbs_only_flag)
  ------------------
  |  Branch (853:8): [True: 0, False: 37.7k]
  ------------------
  854|      0|    {
  855|      0|        u1_field_pic_flag = ih264d_get_bit_h264(ps_bitstrm);
  856|      0|        COPYTHECONTEXT("Slice Header SVC ext: field_pic_flag", u1_field_pic_flag);
  857|      0|        u1_bottom_field_flag = 0;
  858|       |
  859|      0|        if(u1_field_pic_flag)
  ------------------
  |  Branch (859:12): [True: 0, False: 0]
  ------------------
  860|      0|        {
  861|      0|            ps_dec->pu1_inv_scan = (UWORD8 *) gau1_ih264d_inv_scan_fld;
  862|      0|            u1_bottom_field_flag = ih264d_get_bit_h264(ps_bitstrm);
  863|      0|            COPYTHECONTEXT("Slice Header SVC ext: bottom_field_flag", u1_bottom_field_flag);
  864|      0|        }
  865|      0|        else
  866|      0|        {
  867|      0|            ps_dec->pu1_inv_scan = (UWORD8 *) gau1_ih264d_inv_scan;
  868|      0|        }
  869|      0|    }
  870|  37.7k|    else
  871|  37.7k|    {
  872|  37.7k|        u1_field_pic_flag = 0;
  873|  37.7k|        u1_bottom_field_flag = 0;
  874|  37.7k|        ps_dec->pu1_inv_scan = (UWORD8 *) gau1_ih264d_inv_scan;
  875|  37.7k|    }
  876|       |
  877|  37.7k|    u1_nal_unit_type = SLICE_NAL;
  ------------------
  |  |  324|  37.7k|#define SLICE_NAL                       1
  ------------------
  878|  37.7k|    if(u1_is_idr_slice)
  ------------------
  |  Branch (878:8): [True: 33.6k, False: 4.02k]
  ------------------
  879|  33.6k|    {
  880|  33.6k|        u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  33.6k|#define IDR_SLICE_NAL                   5
  ------------------
  881|  33.6k|        u4_idr_pic_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  882|  33.6k|        if(u4_idr_pic_id > 65535) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (882:12): [True: 361, False: 33.3k]
  ------------------
  883|  33.3k|        COPYTHECONTEXT("Slice Header SVC ext:  ", u4_idr_pic_id);
  884|  33.3k|    }
  885|       |
  886|       |    /* read delta pic order count information*/
  887|  37.3k|    i_delta_poc[0] = i_delta_poc[1] = 0;
  888|  37.3k|    s_tmp_poc.i4_pic_order_cnt_lsb = 0;
  889|  37.3k|    s_tmp_poc.i4_delta_pic_order_cnt_bottom = 0;
  890|  37.3k|    u1_pic_order_cnt_type = ps_seq->u1_pic_order_cnt_type;
  891|  37.3k|    if(u1_pic_order_cnt_type == 0)
  ------------------
  |  Branch (891:8): [True: 35.7k, False: 1.60k]
  ------------------
  892|  35.7k|    {
  893|  35.7k|        i_temp = ih264d_get_bits_h264(ps_bitstrm, ps_seq->u1_log2_max_pic_order_cnt_lsb_minus);
  894|  35.7k|        if(i_temp < 0 || i_temp >= ps_seq->i4_max_pic_order_cntLsb) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (894:12): [True: 0, False: 35.7k]
  |  Branch (894:26): [True: 0, False: 35.7k]
  ------------------
  895|  35.7k|        s_tmp_poc.i4_pic_order_cnt_lsb = i_temp;
  896|  35.7k|        COPYTHECONTEXT("Slice Header SVC ext: pic_order_cnt_lsb", s_tmp_poc.i4_pic_order_cnt_lsb);
  897|       |
  898|  35.7k|        if((ps_pps->u1_pic_order_present_flag == 1) && (!u1_field_pic_flag))
  ------------------
  |  Branch (898:12): [True: 4.08k, False: 31.6k]
  |  Branch (898:56): [True: 4.08k, False: 0]
  ------------------
  899|  4.08k|        {
  900|  4.08k|            s_tmp_poc.i4_delta_pic_order_cnt_bottom = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  901|  4.08k|            COPYTHECONTEXT("Slice Header SVC ext: delta_pic_order_cnt_bottom",
  902|  4.08k|                           s_tmp_poc.i4_delta_pic_order_cnt_bottom);
  903|  4.08k|        }
  904|  35.7k|    }
  905|       |
  906|  37.3k|    s_tmp_poc.i4_delta_pic_order_cnt[0] = 0;
  907|  37.3k|    s_tmp_poc.i4_delta_pic_order_cnt[1] = 0;
  908|  37.3k|    if(u1_pic_order_cnt_type == 1 && (!ps_seq->u1_delta_pic_order_always_zero_flag))
  ------------------
  |  Branch (908:8): [True: 1.25k, False: 36.0k]
  |  Branch (908:38): [True: 734, False: 520]
  ------------------
  909|    734|    {
  910|    734|        s_tmp_poc.i4_delta_pic_order_cnt[0] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  911|    734|        COPYTHECONTEXT("Slice Header SVC ext: delta_pic_order_cnt[0]",
  912|    734|                       s_tmp_poc.i4_delta_pic_order_cnt[0]);
  913|       |
  914|    734|        if(ps_pps->u1_pic_order_present_flag && !u1_field_pic_flag)
  ------------------
  |  Branch (914:12): [True: 425, False: 309]
  |  Branch (914:49): [True: 425, False: 0]
  ------------------
  915|    425|        {
  916|    425|            s_tmp_poc.i4_delta_pic_order_cnt[1] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  917|    425|            COPYTHECONTEXT("Slice Header SVC ext: delta_pic_order_cnt[1]",
  918|    425|                           s_tmp_poc.i4_delta_pic_order_cnt[1]);
  919|    425|        }
  920|    734|    }
  921|       |
  922|  37.3k|    if(ps_pps->u1_redundant_pic_cnt_present_flag)
  ------------------
  |  Branch (922:8): [True: 13.0k, False: 24.3k]
  ------------------
  923|  13.0k|    {
  924|  13.0k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
  925|  13.0k|        if(u4_temp > MAX_REDUNDANT_PIC_CNT) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  611|  13.0k|#define MAX_REDUNDANT_PIC_CNT       127
  ------------------
  |  Branch (925:12): [True: 137, False: 12.8k]
  ------------------
  926|  12.8k|        u1_redundant_pic_cnt = u4_temp;
  927|  12.8k|        COPYTHECONTEXT("Slice Header SVC ext: redundant_pic_cnt", u1_redundant_pic_cnt);
  928|  12.8k|    }
  929|       |
  930|       |    /*--------------------------------------------------------------------*/
  931|       |    /* Check if the slice is part of new picture                          */
  932|       |    /*--------------------------------------------------------------------*/
  933|       |    /* First slice of a picture is always considered as part of new picture */
  934|  37.2k|    i1_is_end_of_poc = 1;
  935|  37.2k|    ps_dec->ps_dec_err_status->u1_err_flag &= MASK_REJECT_CUR_PIC;
  ------------------
  |  |  604|  37.2k|#define MASK_REJECT_CUR_PIC (0xFE)
  ------------------
  936|       |
  937|  37.2k|    if(ps_dec->u4_first_slice_in_pic == 0)
  ------------------
  |  Branch (937:8): [True: 837, False: 36.3k]
  ------------------
  938|    837|    {
  939|    837|        i1_is_end_of_poc =
  940|    837|            ih264d_is_end_of_pic(u2_frame_num, u1_nal_ref_idc, &s_tmp_poc, &ps_dec->s_cur_pic_poc,
  941|    837|                                 ps_cur_slice, u1_pic_order_cnt_type, u1_nal_unit_type,
  942|    837|                                 u4_idr_pic_id, u1_field_pic_flag, u1_bottom_field_flag);
  943|    837|        if(i1_is_end_of_poc)
  ------------------
  |  Branch (943:12): [True: 76, False: 761]
  ------------------
  944|     76|        {
  945|     76|            ps_dec->u1_first_slice_in_stream = 0;
  946|     76|            return ERROR_INCOMPLETE_FRAME;
  947|     76|        }
  948|    837|    }
  949|       |
  950|       |    /*--------------------------------------------------------------------*/
  951|       |    /* Check for error in slice and parse the missing/corrupted MB's      */
  952|       |    /* as skip-MB's in an inserted P-slice                                */
  953|       |    /*--------------------------------------------------------------------*/
  954|  37.1k|    u1_mbaff = ps_seq->u1_mb_aff_flag && (!u1_field_pic_flag);
  ------------------
  |  Branch (954:16): [True: 0, False: 37.1k]
  |  Branch (954:42): [True: 0, False: 0]
  ------------------
  955|  37.1k|    prev_slice_err = 0;
  956|       |
  957|  37.1k|    if(i1_is_end_of_poc || ps_dec->u1_first_slice_in_stream)
  ------------------
  |  Branch (957:8): [True: 36.3k, False: 761]
  |  Branch (957:28): [True: 0, False: 761]
  ------------------
  958|  36.3k|    {
  959|       |        /* If the current slice is not a field or frame number of the current
  960|       |         * slice doesn't match with previous slice, and decoder is expecting
  961|       |         * to decode a field i.e. ps_dec->u1_top_bottom_decoded is not 0 and
  962|       |         * is not (TOP_FIELD_ONLY | BOT_FIELD_ONLY), treat it as a dangling
  963|       |         * field */
  964|  36.3k|        if((u1_field_pic_flag == 0 || u2_frame_num != ps_dec->u2_prv_frame_num) &&
  ------------------
  |  Branch (964:13): [True: 36.3k, False: 0]
  |  Branch (964:39): [True: 0, False: 0]
  ------------------
  965|  36.3k|           ps_dec->u1_top_bottom_decoded != 0 &&
  ------------------
  |  Branch (965:12): [True: 0, False: 36.3k]
  ------------------
  966|      0|           ps_dec->u1_top_bottom_decoded != (TOP_FIELD_ONLY | BOT_FIELD_ONLY))
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                         ps_dec->u1_top_bottom_decoded != (TOP_FIELD_ONLY | BOT_FIELD_ONLY))
  ------------------
  |  |   65|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
  |  Branch (966:12): [True: 0, False: 0]
  ------------------
  967|      0|        {
  968|      0|            ps_dec->u1_dangling_field = 1;
  969|      0|            if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (969:16): [True: 0, False: 0]
  ------------------
  970|      0|            {
  971|       |                // first slice - dangling field
  972|      0|                prev_slice_err = 1;
  973|      0|            }
  974|      0|            else
  975|      0|            {
  976|       |                // last slice - dangling field
  977|      0|                prev_slice_err = 2;
  978|      0|            }
  979|       |
  980|      0|            if(ps_dec->u1_top_bottom_decoded == TOP_FIELD_ONLY)
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
  |  Branch (980:16): [True: 0, False: 0]
  ------------------
  981|      0|                ps_cur_slice->u1_bottom_field_flag = 1;
  982|      0|            else
  983|      0|                ps_cur_slice->u1_bottom_field_flag = 0;
  984|       |
  985|      0|            num_mb_skipped =
  986|      0|                (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs) - ps_dec->u4_total_mbs_coded;
  987|      0|            ps_cur_poc = &ps_dec->s_cur_pic_poc;
  988|       |
  989|      0|            u1_is_idr_slice = ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL;
  ------------------
  |  |  328|      0|#define IDR_SLICE_NAL                   5
  ------------------
  990|      0|        }
  991|  36.3k|        else if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (991:17): [True: 36.3k, False: 0]
  ------------------
  992|  36.3k|        {
  993|  36.3k|            if(u2_first_mb_in_slice > 0)
  ------------------
  |  Branch (993:16): [True: 0, False: 36.3k]
  ------------------
  994|      0|            {
  995|       |                // first slice - missing/header corruption
  996|      0|                prev_slice_err = 1;
  997|      0|                num_mb_skipped = u2_first_mb_in_slice << u1_mbaff;
  998|      0|                ps_cur_poc = &s_tmp_poc;
  999|       |
 1000|       |                // initializing slice parameters
 1001|      0|                ps_cur_slice->u4_idr_pic_id = u4_idr_pic_id;
 1002|      0|                ps_cur_slice->u1_field_pic_flag = u1_field_pic_flag;
 1003|      0|                ps_cur_slice->u1_bottom_field_flag = u1_bottom_field_flag;
 1004|      0|                ps_cur_slice->i4_pic_order_cnt_lsb = s_tmp_poc.i4_pic_order_cnt_lsb;
 1005|      0|                ps_cur_slice->u1_nal_unit_type = u1_nal_unit_type;
 1006|      0|                ps_cur_slice->u1_redundant_pic_cnt = u1_redundant_pic_cnt;
 1007|      0|                ps_cur_slice->u1_nal_ref_idc = u1_nal_ref_idc;
 1008|      0|                ps_cur_slice->u1_pic_order_cnt_type = u1_pic_order_cnt_type;
 1009|      0|                ps_cur_slice->u1_mbaff_frame_flag = ps_seq->u1_mb_aff_flag && (!u1_field_pic_flag);
  ------------------
  |  Branch (1009:53): [True: 0, False: 0]
  |  Branch (1009:79): [True: 0, False: 0]
  ------------------
 1010|      0|            }
 1011|  36.3k|        }
 1012|      0|        else
 1013|      0|        {
 1014|       |            /* since i1_is_end_of_poc is set ,means new frame num is encountered. so
 1015|       |             * conceal the current frame completely */
 1016|      0|            prev_slice_err = 2;
 1017|      0|            num_mb_skipped =
 1018|      0|                (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs) - ps_dec->u4_total_mbs_coded;
 1019|      0|            ps_cur_poc = &s_tmp_poc;
 1020|      0|        }
 1021|  36.3k|    }
 1022|    761|    else
 1023|    761|    {
 1024|    761|        if((u2_first_mb_in_slice << u1_mbaff) > ps_dec->u4_total_mbs_coded)
  ------------------
  |  Branch (1024:12): [True: 110, False: 651]
  ------------------
 1025|    110|        {
 1026|       |            // previous slice - missing/corruption
 1027|    110|            prev_slice_err = 2;
 1028|    110|            num_mb_skipped = (u2_first_mb_in_slice << u1_mbaff) - ps_dec->u4_total_mbs_coded;
 1029|    110|            ps_cur_poc = &s_tmp_poc;
 1030|    110|        }
 1031|    651|        else if((u2_first_mb_in_slice << u1_mbaff) < ps_dec->u4_total_mbs_coded)
  ------------------
  |  Branch (1031:17): [True: 0, False: 651]
  ------------------
 1032|      0|        {
 1033|      0|            return ERROR_CORRUPTED_SLICE;
 1034|      0|        }
 1035|    761|    }
 1036|  37.1k|    if(prev_slice_err)
  ------------------
  |  Branch (1036:8): [True: 110, False: 37.0k]
  ------------------
 1037|    110|    {
 1038|    110|        ret = isvcd_mark_err_slice_skip((svc_dec_lyr_struct_t *) ps_dec, num_mb_skipped,
 1039|    110|                                        u1_is_idr_slice, u2_frame_num, ps_cur_poc, prev_slice_err);
 1040|       |
 1041|    110|        if(ps_dec->u1_dangling_field == 1)
  ------------------
  |  Branch (1041:12): [True: 0, False: 110]
  ------------------
 1042|      0|        {
 1043|      0|            ps_dec->u1_second_field = 1 - ps_dec->u1_second_field;
 1044|      0|            ps_dec->u1_first_slice_in_stream = 0;
 1045|      0|            ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                          ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   65|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
 1046|      0|            return ERROR_DANGLING_FIELD_IN_PIC;
 1047|      0|        }
 1048|       |
 1049|    110|        if(prev_slice_err == 2)
  ------------------
  |  Branch (1049:12): [True: 110, False: 0]
  ------------------
 1050|    110|        {
 1051|    110|            ps_dec->u1_first_slice_in_stream = 0;
 1052|    110|            return ERROR_INCOMPLETE_FRAME;
 1053|    110|        }
 1054|       |
 1055|      0|        if(ps_dec->u4_total_mbs_coded >= ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs)
  ------------------
  |  Branch (1055:12): [True: 0, False: 0]
  ------------------
 1056|      0|        {
 1057|       |            /* return if all MBs in frame are parsed*/
 1058|      0|            ps_dec->u1_first_slice_in_stream = 0;
 1059|      0|            return ERROR_IN_LAST_SLICE_OF_PIC;
 1060|      0|        }
 1061|       |
 1062|      0|        if(ps_dec->ps_dec_err_status->u1_err_flag & REJECT_CUR_PIC)
  ------------------
  |  |  601|      0|#define REJECT_CUR_PIC    (0x01)
  ------------------
  |  Branch (1062:12): [True: 0, False: 0]
  ------------------
 1063|      0|        {
 1064|      0|            ih264d_err_pic_dispbuf_mgr(ps_dec);
 1065|      0|            return ERROR_NEW_FRAME_EXPECTED;
 1066|      0|        }
 1067|       |
 1068|      0|        if(ret != OK) return ret;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (1068:12): [True: 0, False: 0]
  ------------------
 1069|       |
 1070|      0|        i1_is_end_of_poc = 0;
 1071|      0|    }
 1072|       |
 1073|  37.0k|    if(u1_field_pic_flag)
  ------------------
  |  Branch (1073:8): [True: 0, False: 37.0k]
  ------------------
 1074|      0|    {
 1075|      0|        ps_dec->u2_prv_frame_num = u2_frame_num;
 1076|      0|    }
 1077|       |
 1078|  37.0k|    if(ps_cur_slice->u1_mmco_equalto5)
  ------------------
  |  Branch (1078:8): [True: 855, False: 36.1k]
  ------------------
 1079|    855|    {
 1080|    855|        WORD32 i4_temp_poc;
 1081|    855|        WORD32 i4_top_field_order_poc, i4_bot_field_order_poc;
 1082|    855|        WORD64 i8_result;
 1083|    855|        if(!ps_cur_slice->u1_field_pic_flag)  // or a complementary field pair
  ------------------
  |  Branch (1083:12): [True: 855, False: 0]
  ------------------
 1084|    855|        {
 1085|    855|            i4_top_field_order_poc = ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 1086|    855|            i4_bot_field_order_poc = ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 1087|    855|            i4_temp_poc = MIN(i4_top_field_order_poc, i4_bot_field_order_poc);
  ------------------
  |  |   61|    855|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 165, False: 690]
  |  |  ------------------
  ------------------
 1088|    855|        }
 1089|      0|        else if(!ps_cur_slice->u1_bottom_field_flag)
  ------------------
  |  Branch (1089:17): [True: 0, False: 0]
  ------------------
 1090|      0|            i4_temp_poc = ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 1091|      0|        else
 1092|      0|            i4_temp_poc = ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 1093|       |
 1094|    855|        i8_result = (WORD64) i4_temp_poc - ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 1095|    855|        if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|    855|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 855]
  |  |  |  Branch (58:54): [True: 0, False: 855]
  |  |  ------------------
  ------------------
 1096|      0|        {
 1097|      0|            return ERROR_INV_POC;
 1098|      0|        }
 1099|    855|        ps_dec->ps_cur_pic->i4_top_field_order_cnt = (WORD32) i8_result;
 1100|    855|        i8_result = (WORD64) i4_temp_poc - ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 1101|    855|        if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|    855|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 855]
  |  |  |  Branch (58:54): [True: 0, False: 855]
  |  |  ------------------
  ------------------
 1102|      0|        {
 1103|      0|            return ERROR_INV_POC;
 1104|      0|        }
 1105|    855|        ps_dec->ps_cur_pic->i4_bottom_field_order_cnt = (WORD32) i8_result;
 1106|    855|        ps_dec->ps_cur_pic->i4_poc = i4_temp_poc;
 1107|    855|        ps_dec->ps_cur_pic->i4_avg_poc = i4_temp_poc;
 1108|    855|    }
 1109|  37.0k|    if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (1109:8): [True: 36.3k, False: 651]
  ------------------
 1110|  36.3k|    {
 1111|  36.3k|        ret = isvcd_decode_pic_order_cnt(u1_is_idr_slice, u2_frame_num, &ps_dec->s_prev_pic_poc,
 1112|  36.3k|                                         &s_tmp_poc, ps_cur_slice, ps_pps, u1_nal_ref_idc,
 1113|  36.3k|                                         u1_bottom_field_flag, u1_field_pic_flag, &i4_poc, ps_dec);
 1114|  36.3k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  36.3k|#define OK        0
  ------------------
  |  Branch (1114:12): [True: 71, False: 36.2k]
  ------------------
 1115|       |        /* Display seq no calculations */
 1116|  36.2k|        if(i4_poc >= ps_dec->i4_max_poc) ps_dec->i4_max_poc = i4_poc;
  ------------------
  |  Branch (1116:12): [True: 15.7k, False: 20.5k]
  ------------------
 1117|       |        /* IDR Picture or POC wrap around */
 1118|  36.2k|        if(i4_poc == 0)
  ------------------
  |  Branch (1118:12): [True: 4.71k, False: 31.5k]
  ------------------
 1119|  4.71k|        {
 1120|  4.71k|            WORD64 i8_temp;
 1121|  4.71k|            i8_temp = (WORD64) ps_dec->i4_prev_max_display_seq + ps_dec->i4_max_poc +
 1122|  4.71k|                      ps_dec->u1_max_dec_frame_buffering + 1;
 1123|       |            /*If i4_prev_max_display_seq overflows integer range, reset it */
 1124|  4.71k|            ps_dec->i4_prev_max_display_seq = IS_OUT_OF_RANGE_S32(i8_temp) ? 0 : i8_temp;
  ------------------
  |  |   58|  4.71k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 4.71k]
  |  |  |  Branch (58:54): [True: 50, False: 4.66k]
  |  |  ------------------
  ------------------
 1125|  4.71k|            ps_dec->i4_max_poc = 0;
 1126|  4.71k|        }
 1127|  36.2k|    }
 1128|       |
 1129|       |    /* Increment only if the current slice has atleast 1 more MB */
 1130|  36.9k|    if(ps_dec->u4_first_slice_in_pic == 0 &&
  ------------------
  |  Branch (1130:8): [True: 651, False: 36.2k]
  ------------------
 1131|    651|       (ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice <
  ------------------
  |  Branch (1131:8): [True: 651, False: 0]
  ------------------
 1132|    651|        (UWORD32) (ps_dec->u4_total_mbs_coded >> ps_dec->ps_cur_slice->u1_mbaff_frame_flag)))
 1133|    651|    {
 1134|    651|        ps_dec->ps_parse_cur_slice++;
 1135|    651|        ps_dec->u2_cur_slice_num++;
 1136|       |        // in the case of single core increment ps_decode_cur_slice
 1137|    651|        if(ps_dec->u1_separate_parse == 0)
  ------------------
  |  Branch (1137:12): [True: 390, False: 261]
  ------------------
 1138|    390|        {
 1139|    390|            ps_dec->ps_decode_cur_slice++;
 1140|    390|        }
 1141|    651|    }
 1142|       |
 1143|  36.9k|    ps_dec->u1_slice_header_done = 0;
 1144|       |
 1145|       |    /*--------------------------------------------------------------------*/
 1146|       |    /* Copy the values read from the bitstream to the slice header and then*/
 1147|       |    /* If the slice is first slice in picture, then do Start of Picture   */
 1148|       |    /* processing.                                                        */
 1149|       |    /*--------------------------------------------------------------------*/
 1150|  36.9k|    ps_cur_slice->i4_delta_pic_order_cnt[0] = i_delta_poc[0];
 1151|  36.9k|    ps_cur_slice->i4_delta_pic_order_cnt[1] = i_delta_poc[1];
 1152|  36.9k|    ps_cur_slice->u4_idr_pic_id = u4_idr_pic_id;
 1153|  36.9k|    ps_cur_slice->u2_first_mb_in_slice = u2_first_mb_in_slice;
 1154|  36.9k|    ps_cur_slice->u1_field_pic_flag = u1_field_pic_flag;
 1155|  36.9k|    ps_cur_slice->u1_bottom_field_flag = u1_bottom_field_flag;
 1156|  36.9k|    ps_cur_slice->u1_slice_type = u1_slice_type;
 1157|  36.9k|    ps_cur_slice->i4_pic_order_cnt_lsb = s_tmp_poc.i4_pic_order_cnt_lsb;
 1158|       |
 1159|  36.9k|    ps_cur_slice->u1_nal_unit_type = u1_nal_unit_type;
 1160|  36.9k|    ps_cur_slice->u1_redundant_pic_cnt = u1_redundant_pic_cnt;
 1161|  36.9k|    ps_cur_slice->u1_nal_ref_idc = u1_nal_ref_idc;
 1162|  36.9k|    ps_cur_slice->u1_pic_order_cnt_type = u1_pic_order_cnt_type;
 1163|       |
 1164|  36.9k|    if(ps_seq->u1_frame_mbs_only_flag)
  ------------------
  |  Branch (1164:8): [True: 36.9k, False: 0]
  ------------------
 1165|  36.9k|        ps_cur_slice->u1_direct_8x8_inference_flag = ps_seq->u1_direct_8x8_inference_flag;
 1166|      0|    else
 1167|      0|        ps_cur_slice->u1_direct_8x8_inference_flag = 1;
 1168|       |
 1169|  36.9k|    if(0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id)
  ------------------
  |  Branch (1169:8): [True: 36.9k, False: 0]
  ------------------
 1170|  36.9k|    {
 1171|  36.9k|        if(B_SLICE == u1_slice_type)
  ------------------
  |  |  369|  36.9k|#define B_SLICE  1
  ------------------
  |  Branch (1171:12): [True: 13.8k, False: 23.1k]
  ------------------
 1172|  13.8k|        {
 1173|  13.8k|            ps_cur_slice->u1_direct_spatial_mv_pred_flag = ih264d_get_bit_h264(ps_bitstrm);
 1174|  13.8k|            COPYTHECONTEXT("Slice Header SVC ext: direct_spatial_mv_pred_flag",
 1175|  13.8k|                           ps_cur_slice->u1_direct_spatial_mv_pred_flag);
 1176|       |
 1177|  13.8k|            if(ps_cur_slice->u1_direct_spatial_mv_pred_flag)
  ------------------
  |  Branch (1177:16): [True: 5.22k, False: 8.60k]
  ------------------
 1178|  5.22k|                ps_cur_slice->pf_decodeDirect = isvcd_decode_spatial_direct;
 1179|  8.60k|            else
 1180|  8.60k|                ps_cur_slice->pf_decodeDirect = ih264d_decode_temporal_direct;
 1181|  13.8k|            if(!((ps_seq->u1_mb_aff_flag) && (!u1_field_pic_flag)))
  ------------------
  |  Branch (1181:18): [True: 0, False: 13.8k]
  |  Branch (1181:46): [True: 0, False: 0]
  ------------------
 1182|  13.8k|                ps_dec->pf_mvpred = ih264d_mvpred_nonmbaffB;
 1183|  13.8k|        }
 1184|  23.1k|        else
 1185|  23.1k|        {
 1186|  23.1k|            if(!((ps_seq->u1_mb_aff_flag) && (!u1_field_pic_flag))) /*check if this is valid here */
  ------------------
  |  Branch (1186:18): [True: 0, False: 23.1k]
  |  Branch (1186:46): [True: 0, False: 0]
  ------------------
 1187|  23.1k|                ps_dec->pf_mvpred = ih264d_mvpred_nonmbaff;
 1188|  23.1k|        }
 1189|  36.9k|    }
 1190|       |
 1191|  36.9k|    if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (1191:8): [True: 36.2k, False: 651]
  ------------------
 1192|  36.2k|    {
 1193|  36.2k|        if(u2_first_mb_in_slice == 0)
  ------------------
  |  Branch (1193:12): [True: 36.2k, False: 0]
  ------------------
 1194|  36.2k|        {
 1195|  36.2k|            ret = isvcd_start_of_pic(ps_svc_lyr_dec, i4_poc, &s_tmp_poc, u2_frame_num, ps_pps);
 1196|  36.2k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  36.2k|#define OK        0
  ------------------
  |  Branch (1196:16): [True: 1.25k, False: 35.0k]
  ------------------
 1197|       |            /*inter layer buffer intialization */
 1198|  35.0k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
 1199|  35.0k|                ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start;
 1200|  35.0k|            ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_cur_mb =
 1201|  35.0k|                ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_base;
 1202|  35.0k|        }
 1203|       |
 1204|  35.0k|        ps_dec->u4_output_present = 0;
 1205|       |
 1206|  35.0k|        {
 1207|  35.0k|            ih264d_get_next_display_field(ps_dec, ps_dec->ps_out_buffer, &(ps_dec->s_disp_op));
 1208|       |            /* If error code is non-zero then there is no buffer available for
 1209|       |            display, hence avoid format conversion */
 1210|       |
 1211|  35.0k|            if(0 != ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (1211:16): [True: 11.0k, False: 23.9k]
  ------------------
 1212|  11.0k|            {
 1213|  11.0k|                ps_dec->u4_output_present = 0;
 1214|  11.0k|                ps_dec->u4_fmt_conv_cur_row = ps_dec->s_disp_frame_info.u4_y_ht;
 1215|  11.0k|            }
 1216|  23.9k|            else
 1217|  23.9k|                ps_dec->u4_output_present = 1;
 1218|  35.0k|        }
 1219|  35.0k|        ret = isvcd_parse_interlayer_resamp_func_init(ps_svc_lyr_dec, u2_first_mb_in_slice);
 1220|  35.0k|        if(ret != OK)
  ------------------
  |  |  114|  35.0k|#define OK        0
  ------------------
  |  Branch (1220:12): [True: 442, False: 34.5k]
  ------------------
 1221|    442|        {
 1222|    442|            return ERROR_CORRUPTED_SLICE;
 1223|    442|        }
 1224|  34.5k|        if((ps_dec->u1_separate_parse == 1) &&
  ------------------
  |  Branch (1224:12): [True: 21.3k, False: 13.1k]
  ------------------
 1225|  21.3k|           (ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER) && (ps_svc_lyr_dec->u1_res_init_done == 1))
  ------------------
  |  |  110|  21.3k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1225:12): [True: 21.3k, False: 0]
  |  Branch (1225:69): [True: 21.3k, False: 0]
  ------------------
 1226|  21.3k|        {
 1227|  21.3k|            if(ps_dec->u4_dec_thread_created == 0)
  ------------------
  |  Branch (1227:16): [True: 21.3k, False: 0]
  ------------------
 1228|  21.3k|            {
 1229|  21.3k|                ithread_create(ps_dec->pv_dec_thread_handle, NULL,
 1230|  21.3k|                               (void *) isvcd_decode_picture_thread, (void *) ps_dec);
 1231|       |
 1232|  21.3k|                ps_dec->u4_dec_thread_created = 1;
 1233|  21.3k|            }
 1234|       |#ifdef KEEP_THREADS_ACTIVE
 1235|       |            ret = ithread_mutex_lock(ps_dec->apv_proc_start_mutex[0]);
 1236|       |            RETURN_IF((ret != IV_SUCCESS), ret);
 1237|       |
 1238|       |            ps_dec->ai4_process_start[0] = PROC_START;
 1239|       |            ret = ithread_cond_signal(ps_dec->apv_proc_start_condition[0]);
 1240|       |            RETURN_IF((ret != IV_SUCCESS), ret);
 1241|       |
 1242|       |            ret = ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[0]);
 1243|       |            RETURN_IF((ret != IV_SUCCESS), ret);
 1244|       |#endif
 1245|       |#ifdef KEEP_THREADS_ACTIVE
 1246|       |            if(ps_dec->u4_bs_deblk_thread_created)
 1247|       |            {
 1248|       |                ret = ithread_mutex_lock(ps_dec->apv_proc_start_mutex[1]);
 1249|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 1250|       |
 1251|       |                ps_dec->ai4_process_start[1] = PROC_START;
 1252|       |                ret = ithread_cond_signal(ps_dec->apv_proc_start_condition[1]);
 1253|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 1254|       |
 1255|       |                ret = ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[1]);
 1256|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 1257|       |            }
 1258|       |#endif
 1259|  21.3k|        }
 1260|  34.5k|    }
 1261|       |
 1262|       |    /* INITIALIZATION of fn ptrs for MC and formMbPartInfo functions */
 1263|  35.2k|    {
 1264|  35.2k|        UWORD8 uc_nofield_nombaff;
 1265|       |
 1266|  35.2k|        uc_nofield_nombaff =
 1267|  35.2k|            ((ps_dec->ps_cur_slice->u1_field_pic_flag == 0) &&
  ------------------
  |  Branch (1267:14): [True: 35.2k, False: 0]
  ------------------
 1268|  35.2k|             (ps_dec->ps_cur_slice->u1_mbaff_frame_flag == 0) && (u1_slice_type != B_SLICE) &&
  ------------------
  |  |  369|  35.2k|#define B_SLICE  1
  ------------------
  |  Branch (1268:14): [True: 35.2k, False: 0]
  |  Branch (1268:66): [True: 21.9k, False: 13.2k]
  ------------------
 1269|  21.9k|             (ps_dec->ps_cur_pps->u1_wted_pred_flag == 0));
  ------------------
  |  Branch (1269:14): [True: 18.5k, False: 3.36k]
  ------------------
 1270|       |
 1271|       |        /* Initialise MC and formMbPartInfo fn ptrs one time based on profile_idc */
 1272|       |
 1273|  35.2k|        if(uc_nofield_nombaff)
  ------------------
  |  Branch (1273:12): [True: 18.5k, False: 16.6k]
  ------------------
 1274|  18.5k|        {
 1275|  18.5k|            ps_dec->p_form_mb_part_info = ih264d_form_mb_part_info_bp;
 1276|  18.5k|            ps_dec->p_motion_compensate = ih264d_motion_compensate_bp;
 1277|  18.5k|        }
 1278|  16.6k|        else
 1279|  16.6k|        {
 1280|  16.6k|            ps_dec->p_form_mb_part_info = ih264d_form_mb_part_info_mp;
 1281|  16.6k|            ps_dec->p_motion_compensate = ih264d_motion_compensate_mp;
 1282|  16.6k|        }
 1283|  35.2k|    }
 1284|       |
 1285|       |    /*
 1286|       |     * Decide whether to decode the current picture or not
 1287|       |     */
 1288|  35.2k|    {
 1289|  35.2k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
 1290|  35.2k|        if(ps_err->u4_frm_sei_sync == u2_frame_num)
  ------------------
  |  Branch (1290:12): [True: 0, False: 35.2k]
  ------------------
 1291|      0|        {
 1292|      0|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  600|      0|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 1293|      0|            ps_err->u4_frm_sei_sync = SYNC_FRM_DEFAULT;
  ------------------
  |  |  609|      0|#define SYNC_FRM_DEFAULT  (0xFFFFFFFF)
  ------------------
 1294|      0|        }
 1295|  35.2k|        ps_err->u4_cur_frm = u2_frame_num;
 1296|  35.2k|    }
 1297|       |
 1298|       |    /* Decision for decoding if the picture is to be skipped */
 1299|  35.2k|    {
 1300|  35.2k|        WORD32 i4_skip_b_pic, i4_skip_p_pic;
 1301|       |
 1302|  35.2k|        i4_skip_b_pic = (ps_dec->u4_skip_frm_mask & B_SLC_BIT) && (B_SLICE == u1_slice_type) &&
  ------------------
  |  |  378|  35.2k|#define B_SLC_BIT  (0x4)
  ------------------
                      i4_skip_b_pic = (ps_dec->u4_skip_frm_mask & B_SLC_BIT) && (B_SLICE == u1_slice_type) &&
  ------------------
  |  |  369|      0|#define B_SLICE  1
  ------------------
  |  Branch (1302:25): [True: 0, False: 35.2k]
  |  Branch (1302:67): [True: 0, False: 0]
  ------------------
 1303|      0|                        (0 == u1_nal_ref_idc);
  ------------------
  |  Branch (1303:25): [True: 0, False: 0]
  ------------------
 1304|       |
 1305|  35.2k|        i4_skip_p_pic = (ps_dec->u4_skip_frm_mask & P_SLC_BIT) && (P_SLICE == u1_slice_type) &&
  ------------------
  |  |  377|  35.2k|#define P_SLC_BIT  (0x2)
  ------------------
                      i4_skip_p_pic = (ps_dec->u4_skip_frm_mask & P_SLC_BIT) && (P_SLICE == u1_slice_type) &&
  ------------------
  |  |  368|      0|#define P_SLICE  0
  ------------------
  |  Branch (1305:25): [True: 0, False: 35.2k]
  |  Branch (1305:67): [True: 0, False: 0]
  ------------------
 1306|      0|                        (0 == u1_nal_ref_idc);
  ------------------
  |  Branch (1306:25): [True: 0, False: 0]
  ------------------
 1307|       |
 1308|       |        /**************************************************************/
 1309|       |        /* Skip the B picture if skip mask is set for B picture and   */
 1310|       |        /* Current B picture is a non reference B picture or there is */
 1311|       |        /* no user for reference B picture                            */
 1312|       |        /**************************************************************/
 1313|  35.2k|        if(i4_skip_b_pic)
  ------------------
  |  Branch (1313:12): [True: 0, False: 35.2k]
  ------------------
 1314|      0|        {
 1315|      0|            ps_dec->ps_cur_pic->u4_pack_slc_typ |= B_SLC_BIT;
  ------------------
  |  |  378|      0|#define B_SLC_BIT  (0x4)
  ------------------
 1316|       |            /* Don't decode the picture in SKIP-B mode if that picture is B */
 1317|       |            /* and also it is not to be used as a reference picture         */
 1318|      0|            ps_dec->u1_last_pic_not_decoded = 1;
 1319|       |
 1320|      0|            return OK;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
 1321|      0|        }
 1322|       |        /**************************************************************/
 1323|       |        /* Skip the P picture if skip mask is set for P picture and   */
 1324|       |        /* Current P picture is a non reference P picture or there is */
 1325|       |        /* no user for reference P picture                            */
 1326|       |        /**************************************************************/
 1327|  35.2k|        if(i4_skip_p_pic)
  ------------------
  |  Branch (1327:12): [True: 0, False: 35.2k]
  ------------------
 1328|      0|        {
 1329|      0|            ps_dec->ps_cur_pic->u4_pack_slc_typ |= P_SLC_BIT;
  ------------------
  |  |  377|      0|#define P_SLC_BIT  (0x2)
  ------------------
 1330|       |            /* Don't decode the picture in SKIP-P mode if that picture is P */
 1331|       |            /* and also it is not to be used as a reference picture         */
 1332|      0|            ps_dec->u1_last_pic_not_decoded = 1;
 1333|       |
 1334|      0|            return OK;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
 1335|      0|        }
 1336|  35.2k|    }
 1337|       |
 1338|  35.2k|    {
 1339|  35.2k|        UWORD16 u2_mb_x, u2_mb_y;
 1340|       |
 1341|  35.2k|        ps_dec->i4_submb_ofst =
 1342|  35.2k|            ((u2_first_mb_in_slice << ps_cur_slice->u1_mbaff_frame_flag) * SUB_BLK_SIZE) -
  ------------------
  |  |  562|  35.2k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  35.2k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  35.2k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
 1343|  35.2k|            SUB_BLK_SIZE;
  ------------------
  |  |  562|  35.2k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  35.2k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  35.2k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
 1344|  35.2k|        if(u2_first_mb_in_slice)
  ------------------
  |  Branch (1344:12): [True: 651, False: 34.5k]
  ------------------
 1345|    651|        {
 1346|    651|            UWORD8 u1_mb_aff;
 1347|    651|            UWORD8 u1_field_pic;
 1348|    651|            UWORD16 u2_frm_wd_in_mbs;
 1349|    651|            u2_frm_wd_in_mbs = ps_seq->u2_frm_wd_in_mbs;
 1350|    651|            u1_mb_aff = ps_cur_slice->u1_mbaff_frame_flag;
 1351|    651|            u1_field_pic = ps_cur_slice->u1_field_pic_flag;
 1352|       |
 1353|    651|            {
 1354|    651|                UWORD32 x_offset;
 1355|    651|                UWORD32 y_offset;
 1356|    651|                UWORD32 u4_frame_stride;
 1357|    651|                tfr_ctxt_t *ps_trns_addr;  // = &ps_dec->s_tran_addrecon_parse;
 1358|       |
 1359|    651|                if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1359:20): [True: 261, False: 390]
  ------------------
 1360|    261|                {
 1361|    261|                    ps_trns_addr = &ps_dec->s_tran_addrecon_parse;
 1362|    261|                }
 1363|    390|                else
 1364|    390|                {
 1365|    390|                    ps_trns_addr = &ps_dec->s_tran_addrecon;
 1366|    390|                }
 1367|    651|                u2_mb_x = MOD(u2_first_mb_in_slice, u2_frm_wd_in_mbs);
  ------------------
  |  |   64|    651|#define MOD(x,y) ((x)%(y))
  ------------------
 1368|    651|                u2_mb_y = DIV(u2_first_mb_in_slice, u2_frm_wd_in_mbs);
  ------------------
  |  |   65|    651|#define DIV(x,y) ((x)/(y))
  ------------------
 1369|       |
 1370|    651|                u2_mb_y <<= u1_mb_aff;
 1371|       |
 1372|    651|                if((u2_mb_x > u2_frm_wd_in_mbs - 1) || (u2_mb_y > ps_dec->u2_frm_ht_in_mbs - 1))
  ------------------
  |  Branch (1372:20): [True: 0, False: 651]
  |  Branch (1372:56): [True: 0, False: 651]
  ------------------
 1373|      0|                {
 1374|      0|                    return ERROR_CORRUPTED_SLICE;
 1375|      0|                }
 1376|       |
 1377|    651|                u4_frame_stride = ps_dec->u2_frm_wd_y << u1_field_pic;
 1378|    651|                x_offset = u2_mb_x << 4;
 1379|    651|                y_offset = (u2_mb_y * u4_frame_stride) << 4;
 1380|       |
 1381|    651|                ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1 + x_offset + y_offset;
 1382|       |
 1383|    651|                u4_frame_stride = ps_dec->u2_frm_wd_uv << u1_field_pic;
 1384|    651|                x_offset >>= 1;
 1385|    651|                y_offset = (u2_mb_y * u4_frame_stride) << 3;
 1386|       |
 1387|    651|                x_offset *= YUV420SP_FACTOR;
  ------------------
  |  |  119|    651|#define YUV420SP_FACTOR 2
  ------------------
 1388|       |
 1389|    651|                ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2 + x_offset + y_offset;
 1390|    651|                ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3 + x_offset + y_offset;
 1391|       |
 1392|    651|                ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 1393|    651|                ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 1394|    651|                ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
 1395|       |
 1396|       |                // assign the deblock structure pointers to start of slice
 1397|    651|                if(ps_dec->u1_separate_parse == 1)
  ------------------
  |  Branch (1397:20): [True: 261, False: 390]
  ------------------
 1398|    261|                {
 1399|    261|                    ps_dec->ps_deblk_mbn =
 1400|    261|                        ps_dec->ps_deblk_pic + (u2_first_mb_in_slice << u1_mb_aff);
 1401|    261|                }
 1402|    390|                else
 1403|    390|                {
 1404|    390|                    ps_dec->ps_deblk_mbn =
 1405|    390|                        ps_dec->ps_deblk_pic + (u2_first_mb_in_slice << u1_mb_aff);
 1406|    390|                }
 1407|       |
 1408|    651|                ps_dec->u4_cur_mb_addr = (u2_first_mb_in_slice << u1_mb_aff);
 1409|       |
 1410|    651|                ps_dec->ps_mv_cur =
 1411|    651|                    ps_dec->s_cur_pic.ps_mv + ((u2_first_mb_in_slice << u1_mb_aff) << 4);
 1412|    651|            }
 1413|    651|        }
 1414|  34.5k|        else
 1415|  34.5k|        {
 1416|  34.5k|            tfr_ctxt_t *ps_trns_addr;
 1417|       |
 1418|  34.5k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1418:16): [True: 21.3k, False: 13.1k]
  ------------------
 1419|  21.3k|            {
 1420|  21.3k|                ps_trns_addr = &ps_dec->s_tran_addrecon_parse;
 1421|  21.3k|            }
 1422|  13.1k|            else
 1423|  13.1k|            {
 1424|  13.1k|                ps_trns_addr = &ps_dec->s_tran_addrecon;
 1425|  13.1k|            }
 1426|       |
 1427|  34.5k|            u2_mb_x = 0xffff;
 1428|  34.5k|            u2_mb_y = 0;
 1429|       |            // assign the deblock structure pointers to start of slice
 1430|  34.5k|            ps_dec->u4_cur_mb_addr = 0;
 1431|  34.5k|            ps_dec->ps_deblk_mbn = ps_dec->ps_deblk_pic;
 1432|  34.5k|            ps_dec->ps_mv_cur = ps_dec->s_cur_pic.ps_mv;
 1433|  34.5k|            ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1;
 1434|  34.5k|            ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2;
 1435|  34.5k|            ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3;
 1436|       |
 1437|  34.5k|            ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 1438|  34.5k|            ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 1439|  34.5k|            ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
 1440|  34.5k|        }
 1441|       |
 1442|  35.2k|        ps_dec->ps_part = ps_dec->ps_parse_part_params;
 1443|       |
 1444|  35.2k|        ps_dec->u2_mbx = (MOD(u2_first_mb_in_slice - 1, ps_seq->u2_frm_wd_in_mbs));
  ------------------
  |  |   64|  35.2k|#define MOD(x,y) ((x)%(y))
  ------------------
 1445|  35.2k|        ps_dec->u2_mby = (DIV(u2_first_mb_in_slice - 1, ps_seq->u2_frm_wd_in_mbs));
  ------------------
  |  |   65|  35.2k|#define DIV(x,y) ((x)/(y))
  ------------------
 1446|  35.2k|        ps_dec->u2_mby <<= ps_cur_slice->u1_mbaff_frame_flag;
 1447|  35.2k|        ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
 1448|  35.2k|        ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;
 1449|  35.2k|    }
 1450|       |
 1451|       |    /* RBSP stop bit is used for CABAC decoding*/
 1452|      0|    ps_bitstrm->u4_max_ofst += ps_dec->ps_cur_pps->u1_entropy_coding_mode;
 1453|       |
 1454|  35.2k|    ps_dec->u1_B = (u1_slice_type == B_SLICE);
  ------------------
  |  |  369|  35.2k|#define B_SLICE  1
  ------------------
 1455|  35.2k|    ps_dec->u4_next_mb_skip = 0;
 1456|       |
 1457|  35.2k|    ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice = ps_dec->ps_cur_slice->u2_first_mb_in_slice;
 1458|  35.2k|    ps_dec->ps_parse_cur_slice->slice_type = ps_dec->ps_cur_slice->u1_slice_type;
 1459|       |
 1460|  35.2k|    ps_dec->u4_start_recon_deblk = 1;
 1461|  35.2k|    {
 1462|  35.2k|        WORD32 num_entries;
 1463|  35.2k|        WORD32 size;
 1464|  35.2k|        UWORD8 *pu1_buf;
 1465|       |
 1466|  35.2k|        num_entries = MAX_FRAMES;
  ------------------
  |  |  600|  35.2k|#define MAX_FRAMES              16
  ------------------
 1467|  35.2k|        if((1 >= ps_dec->ps_cur_sps->u1_num_ref_frames) && (0 == ps_dec->i4_display_delay))
  ------------------
  |  Branch (1467:12): [True: 24.0k, False: 11.1k]
  |  Branch (1467:60): [True: 0, False: 24.0k]
  ------------------
 1468|      0|        {
 1469|      0|            num_entries = 1;
 1470|      0|        }
 1471|  35.2k|        num_entries = ((2 * num_entries) + 1);
 1472|  35.2k|        num_entries *= 2;
 1473|       |
 1474|  35.2k|        size = num_entries * sizeof(void *);
 1475|  35.2k|        size += PAD_MAP_IDX_POC * sizeof(void *);
  ------------------
  |  |  100|  35.2k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 1476|       |
 1477|  35.2k|        pu1_buf = (UWORD8 *) ps_dec->pv_map_ref_idx_to_poc_buf;
 1478|  35.2k|        pu1_buf += size * ps_dec->u2_cur_slice_num;
 1479|  35.2k|        ps_dec->ps_parse_cur_slice->ppv_map_ref_idx_to_poc = (void *) pu1_buf;
 1480|  35.2k|    }
 1481|       |
 1482|  35.2k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (1482:8): [True: 21.6k, False: 13.5k]
  ------------------
 1483|  21.6k|    {
 1484|  21.6k|        ps_dec->ps_parse_cur_slice->pv_tu_coeff_data_start = ps_dec->pv_parse_tu_coeff_data;
 1485|  21.6k|    }
 1486|  13.5k|    else
 1487|  13.5k|    {
 1488|  13.5k|        ps_dec->pv_proc_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
 1489|  13.5k|    }
 1490|       |
 1491|  35.2k|    ret = ih264d_fix_error_in_dpb(ps_dec);
 1492|  35.2k|    if(ret < 0) return ERROR_DBP_MANAGER_T;
  ------------------
  |  Branch (1492:8): [True: 0, False: 35.2k]
  ------------------
 1493|       |
 1494|       |    /*Default initializing default values for some parameters*/
 1495|  35.2k|    ps_svc_slice_params->u1_slice_skip_flag = 0;
 1496|  35.2k|    ps_svc_slice_params->u1_adaptive_base_mode_flag = 0;
 1497|  35.2k|    ps_svc_slice_params->u1_default_base_mode_flag = 0;
 1498|  35.2k|    ps_svc_slice_params->u1_adaptive_motion_prediction_flag = 0;
 1499|  35.2k|    ps_svc_slice_params->u1_default_motion_prediction_flag = 0;
 1500|  35.2k|    ps_svc_slice_params->u1_adaptive_residual_prediction_flag = 0;
 1501|  35.2k|    ps_svc_slice_params->u1_default_residual_prediction_flag = 0;
 1502|       |
 1503|  35.2k|    if(u1_slice_type == I_SLICE)
  ------------------
  |  |  370|  35.2k|#define I_SLICE  2
  ------------------
  |  Branch (1503:8): [True: 6.68k, False: 28.5k]
  ------------------
 1504|  6.68k|    {
 1505|  6.68k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= I_SLC_BIT;
  ------------------
  |  |  376|  6.68k|#define I_SLC_BIT  (0x1)
  ------------------
 1506|       |
 1507|  6.68k|        ret = isvcd_parse_eislice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 1508|  6.68k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 1509|  6.68k|        if(ps_dec->i4_pic_type != B_SLICE && ps_dec->i4_pic_type != P_SLICE)
  ------------------
  |  |  369|  13.3k|#define B_SLICE  1
  ------------------
                      if(ps_dec->i4_pic_type != B_SLICE && ps_dec->i4_pic_type != P_SLICE)
  ------------------
  |  |  368|  6.52k|#define P_SLICE  0
  ------------------
  |  Branch (1509:12): [True: 6.52k, False: 159]
  |  Branch (1509:46): [True: 6.45k, False: 73]
  ------------------
 1510|  6.45k|            ps_dec->i4_pic_type = I_SLICE;
  ------------------
  |  |  370|  6.45k|#define I_SLICE  2
  ------------------
 1511|  6.68k|    }
 1512|  28.5k|    else if(u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  28.5k|#define P_SLICE  0
  ------------------
  |  Branch (1512:13): [True: 15.1k, False: 13.3k]
  ------------------
 1513|  15.1k|    {
 1514|  15.1k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= P_SLC_BIT;
  ------------------
  |  |  377|  15.1k|#define P_SLC_BIT  (0x2)
  ------------------
 1515|  15.1k|        ret = isvcd_parse_epslice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 1516|  15.1k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 1517|  15.1k|        if(ps_dec->i4_pic_type != B_SLICE) ps_dec->i4_pic_type = P_SLICE;
  ------------------
  |  |  369|  15.1k|#define B_SLICE  1
  ------------------
                      if(ps_dec->i4_pic_type != B_SLICE) ps_dec->i4_pic_type = P_SLICE;
  ------------------
  |  |  368|  15.0k|#define P_SLICE  0
  ------------------
  |  Branch (1517:12): [True: 15.0k, False: 70]
  ------------------
 1518|  15.1k|    }
 1519|  13.3k|    else if(u1_slice_type == B_SLICE)
  ------------------
  |  |  369|  13.3k|#define B_SLICE  1
  ------------------
  |  Branch (1519:13): [True: 13.2k, False: 109]
  ------------------
 1520|  13.2k|    {
 1521|  13.2k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= B_SLC_BIT;
  ------------------
  |  |  378|  13.2k|#define B_SLC_BIT  (0x4)
  ------------------
 1522|  13.2k|        ret = isvcd_parse_ebslice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 1523|  13.2k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 1524|  13.2k|        ps_dec->i4_pic_type = B_SLICE;
  ------------------
  |  |  369|  13.2k|#define B_SLICE  1
  ------------------
 1525|  13.2k|    }
 1526|    109|    else
 1527|    109|        return ERROR_INV_SLC_TYPE_T;
 1528|       |
 1529|  35.1k|    if(ps_dec->u1_slice_header_done)
  ------------------
  |  Branch (1529:8): [True: 25.3k, False: 9.80k]
  ------------------
 1530|  25.3k|    {
 1531|       |        /* set to zero to indicate a valid slice has been decoded */
 1532|  25.3k|        ps_dec->u1_first_slice_in_stream = 0;
 1533|  25.3k|    }
 1534|       |
 1535|  35.1k|    if(ret != OK) return ret;
  ------------------
  |  |  114|  35.1k|#define OK        0
  ------------------
  |  Branch (1535:8): [True: 23.1k, False: 11.9k]
  ------------------
 1536|       |
 1537|  11.9k|    if(u1_nal_ref_idc != 0)
  ------------------
  |  Branch (1537:8): [True: 10.6k, False: 1.27k]
  ------------------
 1538|  10.6k|    {
 1539|  10.6k|        if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (1539:12): [True: 10.4k, False: 268]
  ------------------
 1540|  10.4k|        {
 1541|  10.4k|            memcpy((void *) ps_dec->ps_dpb_cmds, (void *) (&(ps_dec->s_dpb_cmds_scratch)),
 1542|  10.4k|                   sizeof(dpb_commands_t));
 1543|  10.4k|        }
 1544|  10.6k|    }
 1545|       |
 1546|       |    /* storing last Mb X and MbY of the slice */
 1547|  11.9k|    ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
 1548|  11.9k|    ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;
 1549|       |
 1550|       |    /* End of Picture detection */
 1551|  11.9k|    if(ps_dec->u4_total_mbs_coded >= (ps_seq->u4_max_mb_addr + 1))
  ------------------
  |  Branch (1551:8): [True: 7.64k, False: 4.30k]
  ------------------
 1552|  7.64k|    {
 1553|  7.64k|        ps_dec->u1_pic_decode_done = 1;
 1554|  7.64k|    }
 1555|       |
 1556|  11.9k|    {
 1557|  11.9k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
 1558|  11.9k|        if((ps_err->u1_err_flag & REJECT_PB_PICS) && (ps_err->u1_cur_pic_type == PIC_TYPE_I))
  ------------------
  |  |  602|  11.9k|#define REJECT_PB_PICS    (0x02)
  ------------------
                      if((ps_err->u1_err_flag & REJECT_PB_PICS) && (ps_err->u1_cur_pic_type == PIC_TYPE_I))
  ------------------
  |  |  608|      0|#define PIC_TYPE_I        (0x00)
  ------------------
  |  Branch (1558:12): [True: 0, False: 11.9k]
  |  Branch (1558:54): [True: 0, False: 0]
  ------------------
 1559|      0|        {
 1560|      0|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  600|      0|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 1561|      0|        }
 1562|  11.9k|    }
 1563|       |
 1564|  11.9k|    PRINT_BIN_BIT_RATIO(ps_dec)
 1565|       |
 1566|  11.9k|    return ret;
 1567|  35.1k|}
isvcd_set_default_slice_header_ext:
 1581|  27.5k|{
 1582|  27.5k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1583|  27.5k|    WORD32 i_status = OK;
  ------------------
  |  |  114|  27.5k|#define OK        0
  ------------------
 1584|  27.5k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1585|  27.5k|    dec_seq_params_t *ps_seq;
 1586|  27.5k|    dec_svc_seq_params_t *ps_subset_seq;
 1587|  27.5k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1588|  27.5k|    dec_subset_seq_params_t *ps_sps_svc_ext = NULL;
 1589|  27.5k|    ps_seq = ps_pps->ps_sps;
 1590|  27.5k|    ps_seq += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  27.5k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1591|  27.5k|    ps_subset_seq =
 1592|  27.5k|        &ps_svc_lyr_dec->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_seq->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  27.5k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1593|  27.5k|    ps_sps_svc_ext = &ps_subset_seq->s_sps_svc_ext;
 1594|  27.5k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1595|       |
 1596|  27.5k|    if(0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id)
  ------------------
  |  Branch (1596:8): [True: 27.5k, False: 0]
  ------------------
 1597|  27.5k|    {
 1598|  27.5k|        ps_svc_slice_params->u1_ref_layer_chroma_phase_y_plus1 =
 1599|  27.5k|            ps_sps_svc_ext->u1_seq_ref_layer_chroma_phase_y_plus1;
 1600|       |
 1601|  27.5k|        ps_svc_slice_params->u1_ref_layer_chroma_phase_x_plus1_flag =
 1602|  27.5k|            ps_sps_svc_ext->u1_seq_ref_layer_chroma_phase_x_plus1_flag;
 1603|  27.5k|    }
 1604|       |
 1605|  27.5k|    ps_svc_slice_params->u4_ref_layer_dq_id = UINT32_MAX;
 1606|  27.5k|    ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc = 0;
 1607|  27.5k|    ps_svc_slice_params->u1_scan_idx_start = 0;
 1608|  27.5k|    ps_svc_slice_params->u1_scan_idx_end = 15;
 1609|  27.5k|    ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2 = 0;
 1610|  27.5k|    ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2 = 0;
 1611|  27.5k|    ps_svc_slice_params->u1_constrained_intra_resampling_flag = 0;
 1612|       |
 1613|  27.5k|    return i_status;
 1614|  27.5k|}
isvcd_parse_slice_header:
 1628|  27.5k|{
 1629|  27.5k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1630|  27.5k|    dec_pic_params_t *ps_pps = ps_dec->ps_cur_pps;
 1631|  27.5k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1632|  27.5k|    dec_seq_params_t *ps_seq;
 1633|  27.5k|    dec_svc_seq_params_t *ps_subset_seq;
 1634|  27.5k|    dec_slice_svc_ext_params_t *ps_svc_slice_params = NULL;
 1635|  27.5k|    dec_subset_seq_params_t *ps_sps_svc_ext = NULL;
 1636|  27.5k|    svc_dec_ctxt_t *ps_svcd_ctxt;
 1637|  27.5k|    UWORD32 *pu4_bitstrm_buf = ps_dec->ps_bitstrm->pu4_buffer;
 1638|  27.5k|    UWORD32 *pu4_bitstrm_ofst = &ps_dec->ps_bitstrm->u4_ofst;
 1639|  27.5k|    ps_svcd_ctxt = ps_svc_lyr_dec->ps_svcd_ctxt;
 1640|  27.5k|    ps_seq = ps_pps->ps_sps;
 1641|  27.5k|    ps_seq += MAX_NUM_SEQ_PARAMS;
  ------------------
  |  |  521|  27.5k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1642|  27.5k|    ps_subset_seq =
 1643|  27.5k|        &ps_svc_lyr_dec->ps_subset_sps[MAX_NUM_SEQ_PARAMS + ps_seq->u1_seq_parameter_set_id];
  ------------------
  |  |  521|  27.5k|#define MAX_NUM_SEQ_PARAMS 32
  ------------------
 1644|  27.5k|    ps_sps_svc_ext = &ps_subset_seq->s_sps_svc_ext;
 1645|  27.5k|    ps_svc_slice_params = &ps_svc_lyr_dec->s_svc_slice_params;
 1646|       |
 1647|  27.5k|    if(!ps_svc_lyr_dec->ps_nal_svc_ext->u1_no_inter_layer_pred_flag &&
  ------------------
  |  Branch (1647:8): [True: 27.5k, False: 0]
  ------------------
 1648|  27.5k|       (0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id))
  ------------------
  |  Branch (1648:8): [True: 27.5k, False: 0]
  ------------------
 1649|  27.5k|    {
 1650|  27.5k|        ps_svc_slice_params->u4_ref_layer_dq_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1651|  27.5k|        COPYTHECONTEXT("Slice Header SVC ext: u4_ref_layer_dq_id",
 1652|  27.5k|                       ps_svc_slice_params->u4_ref_layer_dq_id);
 1653|  27.5k|        if(ps_svc_slice_params->u4_ref_layer_dq_id > MAX_REF_DEP_ID)
  ------------------
  |  |  106|  27.5k|#define MAX_REF_DEP_ID ((MAX_DEPENDENCY_ID << 4) | MAX_QUALITY_ID)
  |  |  ------------------
  |  |  |  |  103|  27.5k|#define MAX_DEPENDENCY_ID 4
  |  |  ------------------
  |  |               #define MAX_REF_DEP_ID ((MAX_DEPENDENCY_ID << 4) | MAX_QUALITY_ID)
  |  |  ------------------
  |  |  |  |  102|  27.5k|#define MAX_QUALITY_ID 0
  |  |  ------------------
  ------------------
  |  Branch (1653:12): [True: 473, False: 27.1k]
  ------------------
 1654|    473|        {
 1655|    473|            return ERROR_INV_SLICE_HDR_T;
 1656|    473|        }
 1657|       |        /* Reference layer id update is taken care during resolution init */
 1658|       |        /*
 1659|       |        ps_svc_lyr_dec->u1_ref_layer_id = ps_svc_slice_params->u4_ref_layer_dq_id >> 4;
 1660|       |        if(ps_svc_lyr_dec->u1_ref_layer_id >= ps_svc_lyr_dec->u1_layer_id)
 1661|       |        {
 1662|       |            return ERROR_INV_SLICE_HDR_T;
 1663|       |        }
 1664|       |        */
 1665|  27.1k|        ps_svc_lyr_dec->ps_dec_svc_ref_layer =
 1666|  27.1k|            &ps_svcd_ctxt->ps_svc_dec_lyr[ps_svc_lyr_dec->u1_ref_layer_id];
 1667|       |
 1668|  27.1k|        if(ps_sps_svc_ext->u1_inter_layer_deblocking_filter_control_present_flag)
  ------------------
  |  Branch (1668:12): [True: 1.86k, False: 25.2k]
  ------------------
 1669|  1.86k|        {
 1670|  1.86k|            ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc =
 1671|  1.86k|                ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1672|  1.86k|            COPYTHECONTEXT("Slice Header SVC ext: u4_disable_inter_layer_deblk_filter_idc",
 1673|  1.86k|                           ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc);
 1674|       |
 1675|  1.86k|            if(ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc > 6)
  ------------------
  |  Branch (1675:16): [True: 97, False: 1.76k]
  ------------------
 1676|     97|            {
 1677|     97|                return ERROR_INV_SLICE_HDR_T;
 1678|     97|            }
 1679|       |
 1680|  1.76k|            if(1 != ps_svc_slice_params->u4_disable_inter_layer_deblk_filter_idc)
  ------------------
  |  Branch (1680:16): [True: 1.52k, False: 237]
  ------------------
 1681|  1.52k|            {
 1682|  1.52k|                ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2 =
 1683|  1.52k|                    ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1684|  1.52k|                COPYTHECONTEXT("Slice Header SVC ext: i4_inter_layer_slice_alpha_c0_offset_div2",
 1685|  1.52k|                               ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2);
 1686|       |
 1687|  1.52k|                if(ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2 > 6 ||
  ------------------
  |  Branch (1687:20): [True: 100, False: 1.42k]
  ------------------
 1688|  1.42k|                   ps_svc_slice_params->i4_inter_layer_slice_alpha_c0_offset_div2 < -6)
  ------------------
  |  Branch (1688:20): [True: 137, False: 1.29k]
  ------------------
 1689|    237|                {
 1690|    237|                    return ERROR_INV_SLICE_HDR_T;
 1691|    237|                }
 1692|       |
 1693|  1.29k|                ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2 =
 1694|  1.29k|                    ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1695|  1.29k|                COPYTHECONTEXT("Slice Header SVC ext: i4_inter_layer_slice_beta_offset_div2",
 1696|  1.29k|                               ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2);
 1697|       |
 1698|  1.29k|                if(ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2 > 6 ||
  ------------------
  |  Branch (1698:20): [True: 156, False: 1.13k]
  ------------------
 1699|  1.13k|                   ps_svc_slice_params->i4_inter_layer_slice_beta_offset_div2 < -6)
  ------------------
  |  Branch (1699:20): [True: 164, False: 970]
  ------------------
 1700|    320|                {
 1701|    320|                    return ERROR_INV_SLICE_HDR_T;
 1702|    320|                }
 1703|  1.29k|            }
 1704|  1.76k|        }
 1705|       |
 1706|  26.4k|        ps_svc_slice_params->u1_constrained_intra_resampling_flag = ih264d_get_bit_h264(ps_bitstrm);
 1707|  26.4k|        COPYTHECONTEXT("Slice Header SVC ext: u1_constrained_intra_resampling_flag",
 1708|  26.4k|                       ps_svc_slice_params->u1_constrained_intra_resampling_flag);
 1709|       |
 1710|  26.4k|        ps_svc_lyr_dec->s_res_prms.i1_constrained_intra_rsmpl_flag =
 1711|  26.4k|            ps_svc_lyr_dec->s_svc_slice_params.u1_constrained_intra_resampling_flag;
 1712|  26.4k|        isvcd_intra_resamp_res_init_update_flags(ps_svc_lyr_dec);
 1713|       |
 1714|  26.4k|        if(2 == ps_sps_svc_ext->u1_extended_spatial_scalability_idc)
  ------------------
  |  Branch (1714:12): [True: 0, False: 26.4k]
  ------------------
 1715|      0|        {
 1716|       |            /* ChromaArrayType = i4_chroma_format_idc  if  separate_colour_plane_flag
 1717|       |             * = 0 for all chroma format except 4:4:4 */
 1718|      0|            if(ps_dec->ps_cur_sps->i4_chroma_format_idc >= 0)
  ------------------
  |  Branch (1718:16): [True: 0, False: 0]
  ------------------
 1719|      0|            {
 1720|      0|                ps_svc_slice_params->u1_ref_layer_chroma_phase_x_plus1_flag =
 1721|      0|                    ih264d_get_bit_h264(ps_bitstrm);
 1722|      0|                COPYTHECONTEXT("Slice Header SVC ext: u1_ref_layer_chroma_phase_x_plus1_flag",
 1723|      0|                               ps_svc_slice_params->u1_ref_layer_chroma_phase_x_plus1_flag);
 1724|       |
 1725|      0|                ps_svc_slice_params->u1_ref_layer_chroma_phase_y_plus1 =
 1726|      0|                    ih264d_get_bits_h264(ps_bitstrm, 2);
 1727|      0|                COPYTHECONTEXT("Slice Header SVC ext: u1_ref_layer_chroma_phase_y_plus1",
 1728|      0|                               ps_svc_slice_params->u1_ref_layer_chroma_phase_y_plus1);
 1729|       |
 1730|      0|                if(ps_svc_slice_params->u1_ref_layer_chroma_phase_y_plus1 > 2)
  ------------------
  |  Branch (1730:20): [True: 0, False: 0]
  ------------------
 1731|      0|                {
 1732|      0|                    return ERROR_INV_SLICE_HDR_T;
 1733|      0|                }
 1734|      0|            }
 1735|      0|            else
 1736|      0|            {
 1737|      0|                if(0 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_quality_id)
  ------------------
  |  Branch (1737:20): [True: 0, False: 0]
  ------------------
 1738|      0|                {
 1739|      0|                    ps_svc_slice_params->u1_ref_layer_chroma_phase_y_plus1 =
 1740|      0|                        ps_sps_svc_ext->u1_seq_ref_layer_chroma_phase_y_plus1;
 1741|      0|                }
 1742|      0|            }
 1743|       |
 1744|      0|            ps_svc_slice_params->i4_scaled_ref_layer_left_offset =
 1745|      0|                ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1746|      0|            COPYTHECONTEXT("Slice Header SVC ext: i4_scaled_ref_layer_left_offset",
 1747|      0|                           ps_svc_slice_params->i4_scaled_ref_layer_left_offset);
 1748|       |
 1749|      0|            if(ps_svc_slice_params->i4_scaled_ref_layer_left_offset != 0)
  ------------------
  |  Branch (1749:16): [True: 0, False: 0]
  ------------------
 1750|      0|            {
 1751|      0|                return ERROR_INV_SLICE_HDR_T;
 1752|      0|            }
 1753|       |
 1754|      0|            if(ps_svc_slice_params->i4_scaled_ref_layer_left_offset >= MAX_SCLD_REF_LAYER_OFFSET ||
  ------------------
  |  |   71|      0|#define MAX_SCLD_REF_LAYER_OFFSET 32768
  ------------------
  |  Branch (1754:16): [True: 0, False: 0]
  ------------------
 1755|      0|               ps_svc_slice_params->i4_scaled_ref_layer_left_offset < MIN_SCLD_REF_LAYER_OFFSET)
  ------------------
  |  |   72|      0|#define MIN_SCLD_REF_LAYER_OFFSET -32768
  ------------------
  |  Branch (1755:16): [True: 0, False: 0]
  ------------------
 1756|      0|            {
 1757|      0|                return ERROR_INV_SLICE_HDR_T;
 1758|      0|            }
 1759|       |
 1760|      0|            ps_svc_slice_params->i4_scaled_ref_layer_top_offset =
 1761|      0|                ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1762|      0|            COPYTHECONTEXT("Slice Header SVC ext: i4_scaled_ref_layer_top_offset",
 1763|      0|                           ps_svc_slice_params->i4_scaled_ref_layer_top_offset);
 1764|       |
 1765|      0|            if(ps_svc_slice_params->i4_scaled_ref_layer_top_offset != 0)
  ------------------
  |  Branch (1765:16): [True: 0, False: 0]
  ------------------
 1766|      0|            {
 1767|      0|                return ERROR_INV_SLICE_HDR_T;
 1768|      0|            }
 1769|       |
 1770|      0|            if(ps_svc_slice_params->i4_scaled_ref_layer_top_offset >= MAX_SCLD_REF_LAYER_OFFSET ||
  ------------------
  |  |   71|      0|#define MAX_SCLD_REF_LAYER_OFFSET 32768
  ------------------
  |  Branch (1770:16): [True: 0, False: 0]
  ------------------
 1771|      0|               ps_svc_slice_params->i4_scaled_ref_layer_top_offset < MIN_SCLD_REF_LAYER_OFFSET)
  ------------------
  |  |   72|      0|#define MIN_SCLD_REF_LAYER_OFFSET -32768
  ------------------
  |  Branch (1771:16): [True: 0, False: 0]
  ------------------
 1772|      0|            {
 1773|      0|                return ERROR_INV_SLICE_HDR_T;
 1774|      0|            }
 1775|       |
 1776|      0|            ps_svc_slice_params->i4_scaled_ref_layer_right_offset =
 1777|      0|                ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1778|      0|            COPYTHECONTEXT("Slice Header SVC ext: i4_scaled_ref_layer_right_offset",
 1779|      0|                           ps_svc_slice_params->i4_scaled_ref_layer_right_offset);
 1780|       |
 1781|      0|            if(ps_svc_slice_params->i4_scaled_ref_layer_right_offset >= MAX_SCLD_REF_LAYER_OFFSET ||
  ------------------
  |  |   71|      0|#define MAX_SCLD_REF_LAYER_OFFSET 32768
  ------------------
  |  Branch (1781:16): [True: 0, False: 0]
  ------------------
 1782|      0|               ps_svc_slice_params->i4_scaled_ref_layer_right_offset < MIN_SCLD_REF_LAYER_OFFSET)
  ------------------
  |  |   72|      0|#define MIN_SCLD_REF_LAYER_OFFSET -32768
  ------------------
  |  Branch (1782:16): [True: 0, False: 0]
  ------------------
 1783|      0|            {
 1784|      0|                return ERROR_INV_SLICE_HDR_T;
 1785|      0|            }
 1786|       |
 1787|      0|            ps_svc_slice_params->i4_scaled_ref_layer_bottom_offset =
 1788|      0|                ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1789|      0|            COPYTHECONTEXT("Slice Header SVC ext: i4_scaled_ref_layer_bottom_offset",
 1790|      0|                           ps_svc_slice_params->i4_scaled_ref_layer_bottom_offset);
 1791|       |
 1792|      0|            if(ps_svc_slice_params->i4_scaled_ref_layer_bottom_offset >=
  ------------------
  |  Branch (1792:16): [True: 0, False: 0]
  ------------------
 1793|      0|                   MAX_SCLD_REF_LAYER_OFFSET ||
  ------------------
  |  |   71|      0|#define MAX_SCLD_REF_LAYER_OFFSET 32768
  ------------------
 1794|      0|               ps_svc_slice_params->i4_scaled_ref_layer_bottom_offset < MIN_SCLD_REF_LAYER_OFFSET)
  ------------------
  |  |   72|      0|#define MIN_SCLD_REF_LAYER_OFFSET -32768
  ------------------
  |  Branch (1794:16): [True: 0, False: 0]
  ------------------
 1795|      0|            {
 1796|      0|                return ERROR_INV_SLICE_HDR_T;
 1797|      0|            }
 1798|      0|        }
 1799|  26.4k|        else
 1800|  26.4k|        {
 1801|  26.4k|            ps_svc_slice_params->i4_scaled_ref_layer_left_offset =
 1802|  26.4k|                ps_sps_svc_ext->i4_seq_scaled_ref_layer_left_offset;
 1803|  26.4k|            ps_svc_slice_params->i4_scaled_ref_layer_top_offset =
 1804|  26.4k|                ps_sps_svc_ext->i4_seq_scaled_ref_layer_top_offset;
 1805|  26.4k|            ps_svc_slice_params->i4_scaled_ref_layer_right_offset =
 1806|  26.4k|                ps_sps_svc_ext->i4_seq_scaled_ref_layer_right_offset;
 1807|  26.4k|            ps_svc_slice_params->i4_scaled_ref_layer_bottom_offset =
 1808|  26.4k|                ps_sps_svc_ext->i4_seq_scaled_ref_layer_bottom_offset;
 1809|  26.4k|        }
 1810|  26.4k|    }
 1811|       |
 1812|  26.4k|    if(!ps_svc_lyr_dec->ps_nal_svc_ext->u1_no_inter_layer_pred_flag)
  ------------------
  |  Branch (1812:8): [True: 26.4k, False: 0]
  ------------------
 1813|  26.4k|    {
 1814|  26.4k|        ps_svc_slice_params->u1_slice_skip_flag = ih264d_get_bit_h264(ps_bitstrm);
 1815|  26.4k|        COPYTHECONTEXT("Slice Header SVC ext: u1_slice_skip_flag",
 1816|  26.4k|                       ps_svc_slice_params->u1_slice_skip_flag);
 1817|       |
 1818|  26.4k|        if(ps_svc_slice_params->u1_slice_skip_flag)
  ------------------
  |  Branch (1818:12): [True: 1.08k, False: 25.3k]
  ------------------
 1819|  1.08k|        {
 1820|  1.08k|            ps_svc_slice_params->u4_num_mbs_in_slice_minus1 =
 1821|  1.08k|                ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1822|  1.08k|            COPYTHECONTEXT("Slice Header SVC ext: u4_num_mbs_in_slice_minus1",
 1823|  1.08k|                           ps_svc_slice_params->u4_num_mbs_in_slice_minus1);
 1824|  1.08k|        }
 1825|  25.3k|        else
 1826|  25.3k|        {
 1827|  25.3k|            ps_svc_slice_params->u1_adaptive_base_mode_flag = ih264d_get_bit_h264(ps_bitstrm);
 1828|  25.3k|            COPYTHECONTEXT("Slice Header SVC ext: u1_adaptive_base_mode_flag",
 1829|  25.3k|                           ps_svc_slice_params->u1_adaptive_base_mode_flag);
 1830|       |
 1831|  25.3k|            if(!ps_svc_slice_params->u1_adaptive_base_mode_flag)
  ------------------
  |  Branch (1831:16): [True: 14.0k, False: 11.3k]
  ------------------
 1832|  14.0k|            {
 1833|  14.0k|                ps_svc_slice_params->u1_default_base_mode_flag = ih264d_get_bit_h264(ps_bitstrm);
 1834|  14.0k|                COPYTHECONTEXT("Slice Header SVC ext: u1_default_base_mode_flag",
 1835|  14.0k|                               ps_svc_slice_params->u1_default_base_mode_flag);
 1836|  14.0k|            }
 1837|  25.3k|            if(!ps_svc_slice_params->u1_default_base_mode_flag)
  ------------------
  |  Branch (1837:16): [True: 19.5k, False: 5.77k]
  ------------------
 1838|  19.5k|            {
 1839|  19.5k|                ps_svc_slice_params->u1_adaptive_motion_prediction_flag =
 1840|  19.5k|                    ih264d_get_bit_h264(ps_bitstrm);
 1841|  19.5k|                COPYTHECONTEXT("Slice Header SVC ext: u1_adaptive_motion_prediction_flag",
 1842|  19.5k|                               ps_svc_slice_params->u1_adaptive_motion_prediction_flag);
 1843|       |
 1844|  19.5k|                if(!ps_svc_slice_params->u1_adaptive_motion_prediction_flag)
  ------------------
  |  Branch (1844:20): [True: 13.2k, False: 6.36k]
  ------------------
 1845|  13.2k|                {
 1846|  13.2k|                    ps_svc_slice_params->u1_default_motion_prediction_flag =
 1847|  13.2k|                        ih264d_get_bit_h264(ps_bitstrm);
 1848|  13.2k|                    COPYTHECONTEXT("Slice Header SVC ext: u1_default_motion_prediction_flag",
 1849|  13.2k|                                   ps_svc_slice_params->u1_default_motion_prediction_flag);
 1850|  13.2k|                }
 1851|  19.5k|            }
 1852|  25.3k|            ps_svc_slice_params->u1_adaptive_residual_prediction_flag =
 1853|  25.3k|                ih264d_get_bit_h264(ps_bitstrm);
 1854|  25.3k|            COPYTHECONTEXT("Slice Header SVC ext: u1_adaptive_residual_prediction_flag",
 1855|  25.3k|                           ps_svc_slice_params->u1_adaptive_residual_prediction_flag);
 1856|       |
 1857|  25.3k|            if(!ps_svc_slice_params->u1_adaptive_residual_prediction_flag)
  ------------------
  |  Branch (1857:16): [True: 17.5k, False: 7.84k]
  ------------------
 1858|  17.5k|            {
 1859|  17.5k|                ps_svc_slice_params->u1_default_residual_prediction_flag =
 1860|  17.5k|                    ih264d_get_bit_h264(ps_bitstrm);
 1861|  17.5k|                COPYTHECONTEXT("Slice Header SVC ext: u1_default_residual_prediction_flag",
 1862|  17.5k|                               ps_svc_slice_params->u1_default_residual_prediction_flag);
 1863|  17.5k|            }
 1864|  25.3k|        }
 1865|       |
 1866|  26.4k|        if(ps_sps_svc_ext->u1_adaptive_tcoeff_level_prediction_flag)
  ------------------
  |  Branch (1866:12): [True: 1.58k, False: 24.8k]
  ------------------
 1867|  1.58k|        {
 1868|  1.58k|            ps_svc_slice_params->u1_tcoeff_level_prediction_flag = ih264d_get_bit_h264(ps_bitstrm);
 1869|  1.58k|            COPYTHECONTEXT("Slice Header SVC ext: u1_tcoeff_level_prediction_flag",
 1870|  1.58k|                           ps_svc_slice_params->u1_tcoeff_level_prediction_flag);
 1871|       |
 1872|  1.58k|            if(ps_svc_slice_params->u1_tcoeff_level_prediction_flag != 0)
  ------------------
  |  Branch (1872:16): [True: 204, False: 1.37k]
  ------------------
 1873|    204|            {
 1874|    204|                return ERROR_INV_SPS_PPS_T;
 1875|    204|            }
 1876|  1.58k|        }
 1877|  26.4k|    }
 1878|       |
 1879|  26.2k|    if(!ps_sps_svc_ext->u1_slice_header_restriction_flag &&
  ------------------
  |  Branch (1879:8): [True: 21.9k, False: 4.34k]
  ------------------
 1880|  21.9k|       !ps_svc_slice_params->u1_slice_skip_flag)
  ------------------
  |  Branch (1880:8): [True: 21.1k, False: 742]
  ------------------
 1881|  21.1k|    {
 1882|  21.1k|        ps_svc_slice_params->u1_scan_idx_start = ih264d_get_bits_h264(ps_bitstrm, 4);
 1883|  21.1k|        COPYTHECONTEXT("Slice Header SVC ext: u1_scan_idx_start",
 1884|  21.1k|                       ps_svc_slice_params->u1_scan_idx_start);
 1885|  21.1k|        ps_svc_slice_params->u1_scan_idx_end = ih264d_get_bits_h264(ps_bitstrm, 4);
 1886|  21.1k|        COPYTHECONTEXT("Slice Header SVC ext: u1_scan_idx_end",
 1887|  21.1k|                       ps_svc_slice_params->u1_scan_idx_end);
 1888|       |
 1889|  21.1k|        if(0 != ps_svc_slice_params->u1_scan_idx_start &&
  ------------------
  |  Branch (1889:12): [True: 12.0k, False: 9.10k]
  ------------------
 1890|  12.0k|           15 != ps_svc_slice_params->u1_scan_idx_end)
  ------------------
  |  Branch (1890:12): [True: 913, False: 11.1k]
  ------------------
 1891|    913|            return ERROR_SVC_INV_SCAN_IDX;
 1892|  21.1k|    }
 1893|  25.3k|    return OK;
  ------------------
  |  |  114|  25.3k|#define OK        0
  ------------------
 1894|  26.2k|}
isvcd_parse_decode_slice:
 1911|   135k|{
 1912|   135k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1913|   135k|    dec_bit_stream_t *ps_bitstrm = ps_dec->ps_bitstrm;
 1914|   135k|    dec_pic_params_t *ps_pps;
 1915|   135k|    dec_seq_params_t *ps_seq;
 1916|   135k|    dec_svc_seq_params_t *ps_subset_seq;
 1917|   135k|    dec_slice_params_t *ps_cur_slice = ps_dec->ps_cur_slice;
 1918|   135k|    pocstruct_t s_tmp_poc = {0};
 1919|   135k|    WORD32 i_delta_poc[2] = {0};
 1920|   135k|    WORD32 i4_poc = 0;
 1921|   135k|    UWORD16 u2_first_mb_in_slice, u2_frame_num;
 1922|   135k|    UWORD8 u1_field_pic_flag, u1_redundant_pic_cnt = 0, u1_slice_type;
 1923|   135k|    UWORD32 u4_idr_pic_id = 0;
 1924|   135k|    UWORD8 u1_bottom_field_flag, u1_pic_order_cnt_type;
 1925|   135k|    UWORD8 u1_nal_unit_type;
 1926|   135k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
 1927|   135k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
 1928|   135k|    WORD8 i1_is_end_of_poc;
 1929|       |
 1930|   135k|    WORD32 ret;
 1931|   135k|    WORD32 prev_slice_err, num_mb_skipped;
 1932|   135k|    UWORD32 u4_mbaff;
 1933|   135k|    pocstruct_t *ps_cur_poc;
 1934|       |
 1935|   135k|    UWORD32 u4_temp;
 1936|   135k|    WORD32 i_temp;
 1937|   135k|    svc_dec_ctxt_t *psvcd_dec_ctxt;
 1938|   135k|    dec_struct_t *ps_dec_cur_lyr_minus_1;
 1939|   135k|    svc_dec_lyr_struct_t *ps_svc_cur_lyr_dec_minus_1;
 1940|       |
 1941|       |    /* read FirstMbInSlice  and slice type*/
 1942|   135k|    ps_dec->ps_dpb_cmds->u1_dpb_commands_read_slc = 0;
 1943|   135k|    u2_first_mb_in_slice = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1944|   135k|    if(u2_first_mb_in_slice > (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs))
  ------------------
  |  Branch (1944:8): [True: 14.1k, False: 121k]
  ------------------
 1945|  14.1k|    {
 1946|  14.1k|        return ERROR_CORRUPTED_SLICE;
 1947|  14.1k|    }
 1948|       |
 1949|       |    /*we currently don not support ASO*/
 1950|   121k|    if(((u2_first_mb_in_slice << ps_cur_slice->u1_mbaff_frame_flag) <= ps_dec->u4_cur_mb_addr) &&
  ------------------
  |  Branch (1950:8): [True: 113k, False: 8.27k]
  ------------------
 1951|   113k|       (ps_dec->u4_first_slice_in_pic == 0))
  ------------------
  |  Branch (1951:8): [True: 910, False: 112k]
  ------------------
 1952|    910|    {
 1953|    910|        return ERROR_CORRUPTED_SLICE;
 1954|    910|    }
 1955|       |
 1956|   120k|    if(ps_dec->u4_first_slice_in_pic == 1)
  ------------------
  |  Branch (1956:8): [True: 117k, False: 3.45k]
  ------------------
 1957|   117k|    {
 1958|   117k|        if(u2_first_mb_in_slice != 0)
  ------------------
  |  Branch (1958:12): [True: 4.81k, False: 112k]
  ------------------
 1959|  4.81k|        {
 1960|  4.81k|            return ERROR_CORRUPTED_SLICE;
 1961|  4.81k|        }
 1962|   117k|    }
 1963|       |
 1964|   115k|    COPYTHECONTEXT("SH: first_mb_in_slice", u2_first_mb_in_slice);
 1965|       |
 1966|   115k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1967|   115k|    if(u4_temp > 9) return ERROR_INV_SLC_TYPE_T;
  ------------------
  |  Branch (1967:8): [True: 770, False: 115k]
  ------------------
 1968|       |
 1969|   115k|    u1_slice_type = u4_temp;
 1970|   115k|    COPYTHECONTEXT("SH: slice_type", (u1_slice_type));
 1971|       |    /* Find Out the Slice Type is 5 to 9 or not then Set the Flag   */
 1972|       |    /* u1_sl_typ_5_9 = 1 .Which tells that all the slices in the Pic*/
 1973|       |    /* will be of same type of current                            */
 1974|   115k|    if(u1_slice_type > 4)
  ------------------
  |  Branch (1974:8): [True: 4.10k, False: 110k]
  ------------------
 1975|  4.10k|    {
 1976|  4.10k|        u1_slice_type -= 5;
 1977|  4.10k|    }
 1978|       |
 1979|   115k|    u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 1980|   115k|    if(u4_temp & MASK_ERR_PIC_SET_ID) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  527|   115k|#define MASK_ERR_PIC_SET_ID   (0xFFFFFF00)
  ------------------
  |  Branch (1980:8): [True: 113, False: 114k]
  ------------------
 1981|       |    /* discard slice if pic param is invalid */
 1982|   114k|    COPYTHECONTEXT("SH: pic_parameter_set_id", u4_temp);
 1983|   114k|    ps_pps = &ps_dec->ps_pps[u4_temp];
 1984|   114k|    if(FALSE == ps_pps->u1_is_valid)
  ------------------
  |  |  592|   114k|#define FALSE   0
  ------------------
  |  Branch (1984:8): [True: 3.58k, False: 111k]
  ------------------
 1985|  3.58k|    {
 1986|  3.58k|        return ERROR_INV_SLICE_HDR_T;
 1987|  3.58k|    }
 1988|       |    /* slices in a layer should have same PPS id*/
 1989|   111k|    if(UINT32_MAX == ps_svc_lyr_dec->u4_pps_id_for_layer)
  ------------------
  |  Branch (1989:8): [True: 107k, False: 3.45k]
  ------------------
 1990|   107k|    {
 1991|   107k|        ps_svc_lyr_dec->u4_pps_id_for_layer = u4_temp;
 1992|   107k|    }
 1993|  3.45k|    else if(u4_temp != ps_svc_lyr_dec->u4_pps_id_for_layer)
  ------------------
  |  Branch (1993:13): [True: 68, False: 3.38k]
  ------------------
 1994|     68|    {
 1995|     68|        return ERROR_INV_SLICE_HDR_T;
 1996|     68|    }
 1997|   111k|    ps_seq = ps_pps->ps_sps;
 1998|   111k|    ps_dec->ps_cur_sps = ps_seq;
 1999|   111k|    ps_subset_seq = &ps_svc_lyr_dec->ps_subset_sps[ps_seq->u1_seq_parameter_set_id];
 2000|   111k|    ps_svc_lyr_dec->ps_cur_subset_sps = ps_subset_seq;
 2001|   111k|    if(!ps_seq) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2001:8): [True: 0, False: 111k]
  ------------------
 2002|   111k|    if(FALSE == ps_seq->u1_is_valid) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  592|   111k|#define FALSE   0
  ------------------
  |  Branch (2002:8): [True: 526, False: 110k]
  ------------------
 2003|   110k|    if(ps_seq->u1_mb_aff_flag) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2003:8): [True: 85, False: 110k]
  ------------------
 2004|   110k|    if(ps_seq->u1_level_idc > H264_LEVEL_4_2) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  303|   110k|#define H264_LEVEL_4_2     42
  ------------------
  |  Branch (2004:8): [True: 236, False: 110k]
  ------------------
 2005|   110k|    if(!ps_seq->u1_frame_mbs_only_flag) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2005:8): [True: 220, False: 110k]
  ------------------
 2006|   110k|    if(OK != isvcd_verify_level(ps_seq->u1_level_idc)) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  114|   110k|#define OK        0
  ------------------
  |  Branch (2006:8): [True: 170, False: 110k]
  ------------------
 2007|   110k|    if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (2007:8): [True: 91.7k, False: 18.2k]
  ------------------
 2008|  91.7k|    {
 2009|  91.7k|        if(ps_dec->u2_frm_wd_in_mbs != ps_seq->u2_frm_wd_in_mbs) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2009:12): [True: 144, False: 91.5k]
  ------------------
 2010|  91.5k|        if(ps_dec->u2_frm_ht_in_mbs != ps_seq->u2_frm_ht_in_mbs) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2010:12): [True: 66, False: 91.5k]
  ------------------
 2011|  91.5k|    }
 2012|       |
 2013|   109k|    if(ps_dec->u1_init_dec_flag == 1)
  ------------------
  |  Branch (2013:8): [True: 91.5k, False: 18.2k]
  ------------------
 2014|  91.5k|    {
 2015|  91.5k|        if(ps_dec->u2_disp_height != ps_subset_seq->u2_disp_height) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2015:12): [True: 67, False: 91.4k]
  ------------------
 2016|  91.4k|        if(ps_dec->u2_disp_width != ps_subset_seq->u2_disp_width) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2016:12): [True: 70, False: 91.3k]
  ------------------
 2017|  91.4k|    }
 2018|       |
 2019|   109k|    if(ps_seq->u1_profile_idc == BASE_PROFILE_IDC)
  ------------------
  |  |  275|   109k|#define BASE_PROFILE_IDC    66
  ------------------
  |  Branch (2019:8): [True: 19.6k, False: 89.9k]
  ------------------
 2020|  19.6k|    {
 2021|  19.6k|        if(ps_pps->u1_entropy_coding_mode != 0)
  ------------------
  |  Branch (2021:12): [True: 86, False: 19.6k]
  ------------------
 2022|     86|        {
 2023|     86|            return ERROR_INV_SPS_PPS_T;
 2024|     86|        }
 2025|  19.6k|    }
 2026|       |
 2027|   109k|    ps_dec->i4_reorder_depth = ps_subset_seq->i4_reorder_depth;
 2028|   109k|    ps_dec->u2_disp_height = ps_subset_seq->u2_disp_height;
 2029|   109k|    ps_dec->u2_disp_width = ps_subset_seq->u2_disp_width;
 2030|       |
 2031|   109k|    if(ps_svc_lyr_dec->u1_layer_id > 0)
  ------------------
  |  Branch (2031:8): [True: 0, False: 109k]
  ------------------
 2032|      0|    {
 2033|      0|        psvcd_dec_ctxt = ps_svc_lyr_dec->ps_svcd_ctxt;
 2034|      0|        ps_svc_cur_lyr_dec_minus_1 =
 2035|      0|            &psvcd_dec_ctxt->ps_svc_dec_lyr[ps_svc_lyr_dec->u1_layer_id - 1];
 2036|       |
 2037|      0|        ps_dec_cur_lyr_minus_1 = &ps_svc_cur_lyr_dec_minus_1->s_dec;
 2038|       |
 2039|      0|        if((ps_dec_cur_lyr_minus_1->u2_pic_wd > ps_subset_seq->u2_pic_wd) ||
  ------------------
  |  Branch (2039:12): [True: 0, False: 0]
  ------------------
 2040|      0|           (ps_dec_cur_lyr_minus_1->u2_pic_ht > ps_subset_seq->u2_pic_ht))
  ------------------
  |  Branch (2040:12): [True: 0, False: 0]
  ------------------
 2041|      0|        {
 2042|      0|            return ERROR_CORRUPTED_SLICE;
 2043|      0|        }
 2044|      0|    }
 2045|       |
 2046|   109k|    ps_dec->u2_pic_wd = ps_subset_seq->u2_pic_wd;
 2047|   109k|    ps_dec->u2_pic_ht = ps_subset_seq->u2_pic_ht;
 2048|   109k|    ps_dec->u4_total_mbs = ps_seq->u4_total_num_of_mbs << (1 - ps_seq->u1_frame_mbs_only_flag);
 2049|       |
 2050|       |    /* Determining the Width and Height of Frame from that of Picture */
 2051|   109k|    ps_dec->u2_frm_wd_y = ps_subset_seq->u2_frm_wd_y;
 2052|   109k|    ps_dec->u2_frm_ht_y = ps_subset_seq->u2_frm_ht_y;
 2053|       |
 2054|   109k|    ps_dec->u2_frm_wd_uv = ps_subset_seq->u2_frm_wd_uv;
 2055|   109k|    ps_dec->u2_frm_ht_uv = ps_subset_seq->u2_frm_ht_uv;
 2056|       |
 2057|   109k|    ps_dec->s_pad_mgr.u1_pad_len_y_v = ps_subset_seq->u1_pad_len_y_v;
 2058|   109k|    ps_dec->s_pad_mgr.u1_pad_len_cr_v = ps_subset_seq->u1_pad_len_cr_v;
 2059|   109k|    ps_dec->u2_frm_wd_in_mbs = ps_seq->u2_frm_wd_in_mbs;
 2060|   109k|    ps_dec->u2_frm_ht_in_mbs = ps_seq->u2_frm_ht_in_mbs;
 2061|       |
 2062|   109k|    ps_dec->u2_crop_offset_y = ps_subset_seq->u2_crop_offset_y;
 2063|   109k|    ps_dec->u2_crop_offset_uv = ps_subset_seq->u2_crop_offset_uv;
 2064|       |
 2065|       |    /* Get the frame num */
 2066|   109k|    u2_frame_num = ih264d_get_bits_h264(ps_bitstrm, ps_seq->u1_bits_in_frm_num);
 2067|   109k|    COPYTHECONTEXT("SH: frame_num", u2_frame_num);
 2068|       |
 2069|   109k|    if(!ps_dec->u1_first_slice_in_stream && ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (2069:8): [True: 84.4k, False: 25.0k]
  |  Branch (2069:45): [True: 81.0k, False: 3.38k]
  ------------------
 2070|  81.0k|    {
 2071|  81.0k|        pocstruct_t *ps_prev_poc = &ps_dec->s_prev_pic_poc;
 2072|  81.0k|        pocstruct_t *ps_cur_poc = &ps_dec->s_cur_pic_poc;
 2073|       |
 2074|  81.0k|        ps_dec->u2_mbx = 0xffff;
 2075|  81.0k|        ps_dec->u2_mby = 0;
 2076|       |
 2077|  81.0k|        if((0 == u1_is_idr_slice) && ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (2077:12): [True: 18.0k, False: 63.0k]
  |  Branch (2077:38): [True: 10.9k, False: 7.09k]
  ------------------
 2078|  10.9k|            ps_dec->u2_prev_ref_frame_num = ps_cur_slice->u2_frame_num;
 2079|       |
 2080|  81.0k|        if(u1_is_idr_slice || ps_cur_slice->u1_mmco_equalto5) ps_dec->u2_prev_ref_frame_num = 0;
  ------------------
  |  Branch (2080:12): [True: 63.0k, False: 18.0k]
  |  Branch (2080:31): [True: 1.34k, False: 16.6k]
  ------------------
 2081|       |
 2082|  81.0k|        if(ps_dec->ps_cur_sps->u1_gaps_in_frame_num_value_allowed_flag)
  ------------------
  |  Branch (2082:12): [True: 0, False: 81.0k]
  ------------------
 2083|      0|        {
 2084|      0|            isvcd_decode_gaps_in_frame_num(ps_dec, u2_frame_num);
 2085|      0|        }
 2086|       |
 2087|  81.0k|        ps_prev_poc->i4_prev_frame_num_ofst = ps_cur_poc->i4_prev_frame_num_ofst;
 2088|  81.0k|        ps_prev_poc->u2_frame_num = ps_cur_poc->u2_frame_num;
 2089|  81.0k|        ps_prev_poc->u1_mmco_equalto5 = ps_cur_slice->u1_mmco_equalto5;
 2090|  81.0k|        if(ps_cur_slice->u1_nal_ref_idc)
  ------------------
  |  Branch (2090:12): [True: 71.6k, False: 9.40k]
  ------------------
 2091|  71.6k|        {
 2092|  71.6k|            ps_prev_poc->i4_pic_order_cnt_lsb = ps_cur_poc->i4_pic_order_cnt_lsb;
 2093|  71.6k|            ps_prev_poc->i4_pic_order_cnt_msb = ps_cur_poc->i4_pic_order_cnt_msb;
 2094|  71.6k|            ps_prev_poc->i4_delta_pic_order_cnt_bottom = ps_cur_poc->i4_delta_pic_order_cnt_bottom;
 2095|  71.6k|            ps_prev_poc->i4_delta_pic_order_cnt[0] = ps_cur_poc->i4_delta_pic_order_cnt[0];
 2096|  71.6k|            ps_prev_poc->i4_delta_pic_order_cnt[1] = ps_cur_poc->i4_delta_pic_order_cnt[1];
 2097|  71.6k|            ps_prev_poc->u1_bot_field = ps_cur_poc->u1_bot_field;
 2098|  71.6k|        }
 2099|       |
 2100|  81.0k|        ps_dec->u4_total_mbs_coded = 0;
 2101|  81.0k|    }
 2102|       |    /* Get the field related flags  */
 2103|   109k|    if(!ps_seq->u1_frame_mbs_only_flag)
  ------------------
  |  Branch (2103:8): [True: 0, False: 109k]
  ------------------
 2104|      0|    {
 2105|      0|        u1_field_pic_flag = ih264d_get_bit_h264(ps_bitstrm);
 2106|      0|        COPYTHECONTEXT("SH: field_pic_flag", u1_field_pic_flag);
 2107|      0|        u1_bottom_field_flag = 0;
 2108|       |
 2109|      0|        if(u1_field_pic_flag)
  ------------------
  |  Branch (2109:12): [True: 0, False: 0]
  ------------------
 2110|      0|        {
 2111|      0|            ps_dec->pu1_inv_scan = (UWORD8 *) gau1_ih264d_inv_scan_fld;
 2112|      0|            u1_bottom_field_flag = ih264d_get_bit_h264(ps_bitstrm);
 2113|      0|            COPYTHECONTEXT("SH: bottom_field_flag", u1_bottom_field_flag);
 2114|      0|        }
 2115|      0|        else
 2116|      0|        {
 2117|      0|            ps_dec->pu1_inv_scan = (UWORD8 *) gau1_ih264d_inv_scan;
 2118|      0|        }
 2119|      0|    }
 2120|   109k|    else
 2121|   109k|    {
 2122|   109k|        u1_field_pic_flag = 0;
 2123|   109k|        u1_bottom_field_flag = 0;
 2124|       |
 2125|   109k|        ps_dec->pu1_inv_scan = (UWORD8 *) gau1_ih264d_inv_scan;
 2126|   109k|    }
 2127|       |
 2128|   109k|    u1_nal_unit_type = SLICE_NAL;
  ------------------
  |  |  324|   109k|#define SLICE_NAL                       1
  ------------------
 2129|   109k|    if(u1_is_idr_slice)
  ------------------
  |  Branch (2129:8): [True: 86.8k, False: 22.7k]
  ------------------
 2130|  86.8k|    {
 2131|  86.8k|        u1_nal_unit_type = IDR_SLICE_NAL;
  ------------------
  |  |  328|  86.8k|#define IDR_SLICE_NAL                   5
  ------------------
 2132|  86.8k|        u4_idr_pic_id = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2133|  86.8k|        if(u4_idr_pic_id > 65535) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2133:12): [True: 829, False: 85.9k]
  ------------------
 2134|  85.9k|        COPYTHECONTEXT("SH:  ", u4_idr_pic_id);
 2135|  85.9k|    }
 2136|       |
 2137|       |    /* read delta pic order count information*/
 2138|   108k|    i_delta_poc[0] = i_delta_poc[1] = 0;
 2139|   108k|    s_tmp_poc.i4_pic_order_cnt_lsb = 0;
 2140|   108k|    s_tmp_poc.i4_delta_pic_order_cnt_bottom = 0;
 2141|   108k|    u1_pic_order_cnt_type = ps_seq->u1_pic_order_cnt_type;
 2142|   108k|    if(u1_pic_order_cnt_type == 0)
  ------------------
  |  Branch (2142:8): [True: 81.0k, False: 27.6k]
  ------------------
 2143|  81.0k|    {
 2144|  81.0k|        i_temp = ih264d_get_bits_h264(ps_bitstrm, ps_seq->u1_log2_max_pic_order_cnt_lsb_minus);
 2145|  81.0k|        if(i_temp < 0 || i_temp >= ps_seq->i4_max_pic_order_cntLsb) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  Branch (2145:12): [True: 0, False: 81.0k]
  |  Branch (2145:26): [True: 0, False: 81.0k]
  ------------------
 2146|  81.0k|        s_tmp_poc.i4_pic_order_cnt_lsb = i_temp;
 2147|  81.0k|        COPYTHECONTEXT("SH: pic_order_cnt_lsb", s_tmp_poc.i4_pic_order_cnt_lsb);
 2148|       |
 2149|  81.0k|        if((ps_pps->u1_pic_order_present_flag == 1) && (!u1_field_pic_flag))
  ------------------
  |  Branch (2149:12): [True: 34.5k, False: 46.4k]
  |  Branch (2149:56): [True: 34.5k, False: 0]
  ------------------
 2150|  34.5k|        {
 2151|  34.5k|            s_tmp_poc.i4_delta_pic_order_cnt_bottom = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2152|  34.5k|            COPYTHECONTEXT("SH: delta_pic_order_cnt_bottom",
 2153|  34.5k|                           s_tmp_poc.i4_delta_pic_order_cnt_bottom);
 2154|  34.5k|        }
 2155|  81.0k|    }
 2156|       |
 2157|   108k|    s_tmp_poc.i4_delta_pic_order_cnt[0] = 0;
 2158|   108k|    s_tmp_poc.i4_delta_pic_order_cnt[1] = 0;
 2159|   108k|    if(u1_pic_order_cnt_type == 1 && (!ps_seq->u1_delta_pic_order_always_zero_flag))
  ------------------
  |  Branch (2159:8): [True: 24.3k, False: 84.3k]
  |  Branch (2159:38): [True: 23.0k, False: 1.32k]
  ------------------
 2160|  23.0k|    {
 2161|  23.0k|        s_tmp_poc.i4_delta_pic_order_cnt[0] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2162|  23.0k|        COPYTHECONTEXT("SH: delta_pic_order_cnt[0]", s_tmp_poc.i4_delta_pic_order_cnt[0]);
 2163|       |
 2164|  23.0k|        if(ps_pps->u1_pic_order_present_flag && !u1_field_pic_flag)
  ------------------
  |  Branch (2164:12): [True: 20.6k, False: 2.40k]
  |  Branch (2164:49): [True: 20.6k, False: 0]
  ------------------
 2165|  20.6k|        {
 2166|  20.6k|            s_tmp_poc.i4_delta_pic_order_cnt[1] = ih264d_sev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2167|  20.6k|            COPYTHECONTEXT("SH: delta_pic_order_cnt[1]", s_tmp_poc.i4_delta_pic_order_cnt[1]);
 2168|  20.6k|        }
 2169|  23.0k|    }
 2170|       |
 2171|   108k|    if(ps_pps->u1_redundant_pic_cnt_present_flag)
  ------------------
  |  Branch (2171:8): [True: 31.1k, False: 77.5k]
  ------------------
 2172|  31.1k|    {
 2173|  31.1k|        u4_temp = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
 2174|  31.1k|        if(u4_temp > MAX_REDUNDANT_PIC_CNT) return ERROR_INV_SLICE_HDR_T;
  ------------------
  |  |  611|  31.1k|#define MAX_REDUNDANT_PIC_CNT       127
  ------------------
  |  Branch (2174:12): [True: 656, False: 30.4k]
  ------------------
 2175|  30.4k|        u1_redundant_pic_cnt = u4_temp;
 2176|  30.4k|        COPYTHECONTEXT("SH: redundant_pic_cnt", u1_redundant_pic_cnt);
 2177|  30.4k|    }
 2178|       |
 2179|       |    /*--------------------------------------------------------------------*/
 2180|       |    /* Check if the slice is part of new picture                          */
 2181|       |    /*--------------------------------------------------------------------*/
 2182|       |    /* First slice of a picture is always considered as part of new picture */
 2183|   108k|    i1_is_end_of_poc = 1;
 2184|   108k|    ps_dec->ps_dec_err_status->u1_err_flag &= MASK_REJECT_CUR_PIC;
  ------------------
  |  |  604|   108k|#define MASK_REJECT_CUR_PIC (0xFE)
  ------------------
 2185|       |
 2186|   108k|    if(ps_dec->u4_first_slice_in_pic == 0)
  ------------------
  |  Branch (2186:8): [True: 3.38k, False: 104k]
  ------------------
 2187|  3.38k|    {
 2188|  3.38k|        i1_is_end_of_poc =
 2189|  3.38k|            ih264d_is_end_of_pic(u2_frame_num, u1_nal_ref_idc, &s_tmp_poc, &ps_dec->s_cur_pic_poc,
 2190|  3.38k|                                 ps_cur_slice, u1_pic_order_cnt_type, u1_nal_unit_type,
 2191|  3.38k|                                 u4_idr_pic_id, u1_field_pic_flag, u1_bottom_field_flag);
 2192|  3.38k|        if(i1_is_end_of_poc)
  ------------------
  |  Branch (2192:12): [True: 202, False: 3.18k]
  ------------------
 2193|    202|        {
 2194|    202|            ps_dec->u1_first_slice_in_stream = 0;
 2195|    202|            return ERROR_INCOMPLETE_FRAME;
 2196|    202|        }
 2197|  3.38k|    }
 2198|       |
 2199|       |    /*--------------------------------------------------------------------*/
 2200|       |    /* Check for error in slice and parse the missing/corrupted MB's      */
 2201|       |    /* as skip-MB's in an inserted P-slice                                */
 2202|       |    /*--------------------------------------------------------------------*/
 2203|   107k|    u4_mbaff = ps_seq->u1_mb_aff_flag && (!u1_field_pic_flag);
  ------------------
  |  Branch (2203:16): [True: 0, False: 107k]
  |  Branch (2203:42): [True: 0, False: 0]
  ------------------
 2204|   107k|    prev_slice_err = 0;
 2205|       |
 2206|   107k|    if(i1_is_end_of_poc || ps_dec->u1_first_slice_in_stream)
  ------------------
  |  Branch (2206:8): [True: 104k, False: 3.18k]
  |  Branch (2206:28): [True: 0, False: 3.18k]
  ------------------
 2207|   104k|    {
 2208|       |        /* If the current slice is not a field or frame number of the current
 2209|       |         * slice doesn't match with previous slice, and decoder is expecting
 2210|       |         * to decode a field i.e. ps_dec->u1_top_bottom_decoded is not 0 and
 2211|       |         * is not (TOP_FIELD_ONLY | BOT_FIELD_ONLY), treat it as a dangling
 2212|       |         * field */
 2213|   104k|        if((u1_field_pic_flag == 0 || u2_frame_num != ps_dec->u2_prv_frame_num) &&
  ------------------
  |  Branch (2213:13): [True: 104k, False: 0]
  |  Branch (2213:39): [True: 0, False: 0]
  ------------------
 2214|   104k|           ps_dec->u1_top_bottom_decoded != 0 &&
  ------------------
  |  Branch (2214:12): [True: 0, False: 104k]
  ------------------
 2215|      0|           ps_dec->u1_top_bottom_decoded != (TOP_FIELD_ONLY | BOT_FIELD_ONLY))
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                         ps_dec->u1_top_bottom_decoded != (TOP_FIELD_ONLY | BOT_FIELD_ONLY))
  ------------------
  |  |   65|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
  |  Branch (2215:12): [True: 0, False: 0]
  ------------------
 2216|      0|        {
 2217|      0|            ps_dec->u1_dangling_field = 1;
 2218|      0|            if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (2218:16): [True: 0, False: 0]
  ------------------
 2219|      0|            {
 2220|       |                // first slice - dangling field
 2221|      0|                prev_slice_err = 1;
 2222|      0|            }
 2223|      0|            else
 2224|      0|            {
 2225|       |                // last slice - dangling field
 2226|      0|                prev_slice_err = 2;
 2227|      0|            }
 2228|       |
 2229|      0|            if(ps_dec->u1_top_bottom_decoded == TOP_FIELD_ONLY)
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
  |  Branch (2229:16): [True: 0, False: 0]
  ------------------
 2230|      0|                ps_cur_slice->u1_bottom_field_flag = 1;
 2231|      0|            else
 2232|      0|                ps_cur_slice->u1_bottom_field_flag = 0;
 2233|       |
 2234|      0|            num_mb_skipped =
 2235|      0|                (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs) - ps_dec->u4_total_mbs_coded;
 2236|      0|            ps_cur_poc = &ps_dec->s_cur_pic_poc;
 2237|       |
 2238|      0|            u1_is_idr_slice = ps_cur_slice->u1_nal_unit_type == IDR_SLICE_NAL;
  ------------------
  |  |  328|      0|#define IDR_SLICE_NAL                   5
  ------------------
 2239|      0|        }
 2240|   104k|        else if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (2240:17): [True: 104k, False: 0]
  ------------------
 2241|   104k|        {
 2242|   104k|            if(u2_first_mb_in_slice > 0)
  ------------------
  |  Branch (2242:16): [True: 0, False: 104k]
  ------------------
 2243|      0|            {
 2244|       |                /* first slice - missing/header corruption */
 2245|      0|                prev_slice_err = 1;
 2246|      0|                num_mb_skipped = u2_first_mb_in_slice << u4_mbaff;
 2247|      0|                ps_cur_poc = &s_tmp_poc;
 2248|       |
 2249|       |                /* initializing slice parameters */
 2250|      0|                ps_cur_slice->u4_idr_pic_id = u4_idr_pic_id;
 2251|      0|                ps_cur_slice->u1_field_pic_flag = u1_field_pic_flag;
 2252|      0|                ps_cur_slice->u1_bottom_field_flag = u1_bottom_field_flag;
 2253|      0|                ps_cur_slice->i4_pic_order_cnt_lsb = s_tmp_poc.i4_pic_order_cnt_lsb;
 2254|      0|                ps_cur_slice->u1_nal_unit_type = u1_nal_unit_type;
 2255|      0|                ps_cur_slice->u1_redundant_pic_cnt = u1_redundant_pic_cnt;
 2256|      0|                ps_cur_slice->u1_nal_ref_idc = u1_nal_ref_idc;
 2257|      0|                ps_cur_slice->u1_pic_order_cnt_type = u1_pic_order_cnt_type;
 2258|      0|                ps_cur_slice->u1_mbaff_frame_flag = ps_seq->u1_mb_aff_flag && (!u1_field_pic_flag);
  ------------------
  |  Branch (2258:53): [True: 0, False: 0]
  |  Branch (2258:79): [True: 0, False: 0]
  ------------------
 2259|      0|            }
 2260|   104k|        }
 2261|      0|        else
 2262|      0|        {
 2263|       |            /* since i1_is_end_of_poc is set ,means new frame num is encountered. so
 2264|       |             * conceal the current frame completely */
 2265|      0|            prev_slice_err = 2;
 2266|      0|            num_mb_skipped =
 2267|      0|                (ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs) - ps_dec->u4_total_mbs_coded;
 2268|      0|            ps_cur_poc = &s_tmp_poc;
 2269|      0|        }
 2270|   104k|    }
 2271|  3.18k|    else
 2272|  3.18k|    {
 2273|  3.18k|        if((u2_first_mb_in_slice << u4_mbaff) > ps_dec->u4_total_mbs_coded)
  ------------------
  |  Branch (2273:12): [True: 42, False: 3.14k]
  ------------------
 2274|     42|        {
 2275|       |            // previous slice - missing/corruption
 2276|     42|            prev_slice_err = 2;
 2277|     42|            num_mb_skipped = (u2_first_mb_in_slice << u4_mbaff) - ps_dec->u4_total_mbs_coded;
 2278|     42|            ps_cur_poc = &s_tmp_poc;
 2279|     42|        }
 2280|  3.14k|        else if((u2_first_mb_in_slice << u4_mbaff) < ps_dec->u4_total_mbs_coded)
  ------------------
  |  Branch (2280:17): [True: 0, False: 3.14k]
  ------------------
 2281|      0|        {
 2282|      0|            return ERROR_CORRUPTED_SLICE;
 2283|      0|        }
 2284|  3.18k|    }
 2285|   107k|    if(prev_slice_err)
  ------------------
  |  Branch (2285:8): [True: 42, False: 107k]
  ------------------
 2286|     42|    {
 2287|     42|        ret = isvcd_mark_err_slice_skip((svc_dec_lyr_struct_t *) ps_dec, num_mb_skipped,
 2288|     42|                                        u1_is_idr_slice, u2_frame_num, ps_cur_poc, prev_slice_err);
 2289|       |
 2290|     42|        if(ps_dec->u1_dangling_field == 1)
  ------------------
  |  Branch (2290:12): [True: 0, False: 42]
  ------------------
 2291|      0|        {
 2292|      0|            ps_dec->u1_second_field = 1 - ps_dec->u1_second_field;
 2293|      0|            ps_dec->u1_first_slice_in_stream = 0;
 2294|      0|            ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   64|      0|#define TOP_FIELD_ONLY      0x02
  ------------------
                          ps_dec->u1_top_bottom_decoded = TOP_FIELD_ONLY | BOT_FIELD_ONLY;
  ------------------
  |  |   65|      0|#define BOT_FIELD_ONLY      0x01
  ------------------
 2295|      0|            return ERROR_DANGLING_FIELD_IN_PIC;
 2296|      0|        }
 2297|       |
 2298|     42|        if(prev_slice_err == 2)
  ------------------
  |  Branch (2298:12): [True: 42, False: 0]
  ------------------
 2299|     42|        {
 2300|     42|            ps_dec->u1_first_slice_in_stream = 0;
 2301|     42|            return ERROR_INCOMPLETE_FRAME;
 2302|     42|        }
 2303|       |
 2304|      0|        if(ps_dec->u4_total_mbs_coded >= ps_dec->u2_frm_ht_in_mbs * ps_dec->u2_frm_wd_in_mbs)
  ------------------
  |  Branch (2304:12): [True: 0, False: 0]
  ------------------
 2305|      0|        {
 2306|       |            /* return if all MBs in frame are parsed*/
 2307|      0|            ps_dec->u1_first_slice_in_stream = 0;
 2308|      0|            return ERROR_IN_LAST_SLICE_OF_PIC;
 2309|      0|        }
 2310|       |
 2311|      0|        if(ps_dec->ps_dec_err_status->u1_err_flag & REJECT_CUR_PIC)
  ------------------
  |  |  601|      0|#define REJECT_CUR_PIC    (0x01)
  ------------------
  |  Branch (2311:12): [True: 0, False: 0]
  ------------------
 2312|      0|        {
 2313|      0|            ih264d_err_pic_dispbuf_mgr(ps_dec);
 2314|      0|            return ERROR_NEW_FRAME_EXPECTED;
 2315|      0|        }
 2316|       |
 2317|      0|        if(ret != OK) return ret;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (2317:12): [True: 0, False: 0]
  ------------------
 2318|       |
 2319|      0|        i1_is_end_of_poc = 0;
 2320|      0|    }
 2321|       |
 2322|   107k|    if(u1_field_pic_flag)
  ------------------
  |  Branch (2322:8): [True: 0, False: 107k]
  ------------------
 2323|      0|    {
 2324|      0|        ps_dec->u2_prv_frame_num = u2_frame_num;
 2325|      0|    }
 2326|       |
 2327|   107k|    if(ps_cur_slice->u1_mmco_equalto5 && NULL != ps_dec->ps_cur_pic)
  ------------------
  |  Branch (2327:8): [True: 2.35k, False: 105k]
  |  Branch (2327:42): [True: 2.22k, False: 124]
  ------------------
 2328|  2.22k|    {
 2329|  2.22k|        WORD32 i4_temp_poc;
 2330|  2.22k|        WORD32 i4_top_field_order_poc, i4_bot_field_order_poc;
 2331|  2.22k|        WORD64 i8_result;
 2332|  2.22k|        if(!ps_cur_slice->u1_field_pic_flag)
  ------------------
  |  Branch (2332:12): [True: 2.22k, False: 0]
  ------------------
 2333|  2.22k|        {
 2334|  2.22k|            i4_top_field_order_poc = ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 2335|  2.22k|            i4_bot_field_order_poc = ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 2336|  2.22k|            i4_temp_poc = MIN(i4_top_field_order_poc, i4_bot_field_order_poc);
  ------------------
  |  |   61|  2.22k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 1.14k, False: 1.08k]
  |  |  ------------------
  ------------------
 2337|  2.22k|        }
 2338|      0|        else if(!ps_cur_slice->u1_bottom_field_flag)
  ------------------
  |  Branch (2338:17): [True: 0, False: 0]
  ------------------
 2339|      0|            i4_temp_poc = ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 2340|      0|        else
 2341|      0|            i4_temp_poc = ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 2342|       |
 2343|  2.22k|        i8_result = (WORD64) i4_temp_poc - ps_dec->ps_cur_pic->i4_top_field_order_cnt;
 2344|  2.22k|        if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|  2.22k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 66, False: 2.16k]
  |  |  |  Branch (58:54): [True: 0, False: 2.16k]
  |  |  ------------------
  ------------------
 2345|     66|        {
 2346|     66|            return ERROR_INV_POC;
 2347|     66|        }
 2348|  2.16k|        ps_dec->ps_cur_pic->i4_top_field_order_cnt = (WORD32) i8_result;
 2349|  2.16k|        i8_result = (WORD64) i4_temp_poc - ps_dec->ps_cur_pic->i4_bottom_field_order_cnt;
 2350|  2.16k|        if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|  2.16k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 70, False: 2.09k]
  |  |  |  Branch (58:54): [True: 0, False: 2.09k]
  |  |  ------------------
  ------------------
 2351|     70|        {
 2352|     70|            return ERROR_INV_POC;
 2353|     70|        }
 2354|  2.09k|        ps_dec->ps_cur_pic->i4_bottom_field_order_cnt = (WORD32) i8_result;
 2355|  2.09k|        ps_dec->ps_cur_pic->i4_poc = i4_temp_poc;
 2356|  2.09k|        ps_dec->ps_cur_pic->i4_avg_poc = i4_temp_poc;
 2357|  2.09k|    }
 2358|   107k|    if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (2358:8): [True: 104k, False: 3.14k]
  ------------------
 2359|   104k|    {
 2360|   104k|        ret = isvcd_decode_pic_order_cnt(u1_is_idr_slice, u2_frame_num, &ps_dec->s_prev_pic_poc,
 2361|   104k|                                         &s_tmp_poc, ps_cur_slice, ps_pps, u1_nal_ref_idc,
 2362|   104k|                                         u1_bottom_field_flag, u1_field_pic_flag, &i4_poc, ps_dec);
 2363|   104k|        if(ret != OK) return ret;
  ------------------
  |  |  114|   104k|#define OK        0
  ------------------
  |  Branch (2363:12): [True: 1.05k, False: 103k]
  ------------------
 2364|       |        /* Display seq no calculations */
 2365|   103k|        if(i4_poc >= ps_dec->i4_max_poc) ps_dec->i4_max_poc = i4_poc;
  ------------------
  |  Branch (2365:12): [True: 52.4k, False: 51.0k]
  ------------------
 2366|       |        /* IDR Picture or POC wrap around */
 2367|   103k|        if(i4_poc == 0)
  ------------------
  |  Branch (2367:12): [True: 23.2k, False: 80.2k]
  ------------------
 2368|  23.2k|        {
 2369|  23.2k|            WORD64 i8_temp;
 2370|  23.2k|            i8_temp = (WORD64) ps_dec->i4_prev_max_display_seq + ps_dec->i4_max_poc +
 2371|  23.2k|                      ps_dec->u1_max_dec_frame_buffering + 1;
 2372|       |            /*If i4_prev_max_display_seq overflows integer range, reset it */
 2373|  23.2k|            ps_dec->i4_prev_max_display_seq = IS_OUT_OF_RANGE_S32(i8_temp) ? 0 : i8_temp;
  ------------------
  |  |   58|  23.2k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 23.2k]
  |  |  |  Branch (58:54): [True: 141, False: 23.1k]
  |  |  ------------------
  ------------------
 2374|  23.2k|            ps_dec->i4_max_poc = 0;
 2375|  23.2k|        }
 2376|   103k|    }
 2377|       |
 2378|       |    /* Increment only if the current slice has atleast 1 more MB */
 2379|   106k|    if(ps_dec->u4_first_slice_in_pic == 0 &&
  ------------------
  |  Branch (2379:8): [True: 3.14k, False: 103k]
  ------------------
 2380|  3.14k|       (ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice <
  ------------------
  |  Branch (2380:8): [True: 3.14k, False: 0]
  ------------------
 2381|  3.14k|        (UWORD32) (ps_dec->u4_total_mbs_coded >> ps_dec->ps_cur_slice->u1_mbaff_frame_flag)))
 2382|  3.14k|    {
 2383|  3.14k|        ps_dec->ps_parse_cur_slice++;
 2384|  3.14k|        ps_dec->u2_cur_slice_num++;
 2385|       |        // in the case of single core increment ps_decode_cur_slice
 2386|  3.14k|        if(ps_dec->u1_separate_parse == 0)
  ------------------
  |  Branch (2386:12): [True: 2.22k, False: 918]
  ------------------
 2387|  2.22k|        {
 2388|  2.22k|            ps_dec->ps_decode_cur_slice++;
 2389|  2.22k|        }
 2390|  3.14k|    }
 2391|       |
 2392|   106k|    ps_dec->u1_slice_header_done = 0;
 2393|       |
 2394|       |    /*--------------------------------------------------------------------*/
 2395|       |    /* Copy the values read from the bitstream to the slice header and then*/
 2396|       |    /* If the slice is first slice in picture, then do Start of Picture   */
 2397|       |    /* processing.                                                        */
 2398|       |    /*--------------------------------------------------------------------*/
 2399|   106k|    ps_cur_slice->i4_delta_pic_order_cnt[0] = i_delta_poc[0];
 2400|   106k|    ps_cur_slice->i4_delta_pic_order_cnt[1] = i_delta_poc[1];
 2401|   106k|    ps_cur_slice->u4_idr_pic_id = u4_idr_pic_id;
 2402|   106k|    ps_cur_slice->u2_first_mb_in_slice = u2_first_mb_in_slice;
 2403|   106k|    ps_cur_slice->u1_field_pic_flag = u1_field_pic_flag;
 2404|   106k|    ps_cur_slice->u1_bottom_field_flag = u1_bottom_field_flag;
 2405|   106k|    ps_cur_slice->u1_slice_type = u1_slice_type;
 2406|   106k|    ps_cur_slice->i4_pic_order_cnt_lsb = s_tmp_poc.i4_pic_order_cnt_lsb;
 2407|       |
 2408|   106k|    ps_cur_slice->u1_nal_unit_type = u1_nal_unit_type;
 2409|   106k|    ps_cur_slice->u1_redundant_pic_cnt = u1_redundant_pic_cnt;
 2410|   106k|    ps_cur_slice->u1_nal_ref_idc = u1_nal_ref_idc;
 2411|   106k|    ps_cur_slice->u1_pic_order_cnt_type = u1_pic_order_cnt_type;
 2412|       |
 2413|   106k|    if(ps_seq->u1_frame_mbs_only_flag)
  ------------------
  |  Branch (2413:8): [True: 106k, False: 0]
  ------------------
 2414|   106k|        ps_cur_slice->u1_direct_8x8_inference_flag = ps_seq->u1_direct_8x8_inference_flag;
 2415|      0|    else
 2416|      0|        ps_cur_slice->u1_direct_8x8_inference_flag = 1;
 2417|       |
 2418|   106k|    if(u1_slice_type == B_SLICE)
  ------------------
  |  |  369|   106k|#define B_SLICE  1
  ------------------
  |  Branch (2418:8): [True: 31.3k, False: 75.2k]
  ------------------
 2419|  31.3k|    {
 2420|  31.3k|        ps_cur_slice->u1_direct_spatial_mv_pred_flag = ih264d_get_bit_h264(ps_bitstrm);
 2421|  31.3k|        COPYTHECONTEXT("SH: direct_spatial_mv_pred_flag",
 2422|  31.3k|                       ps_cur_slice->u1_direct_spatial_mv_pred_flag);
 2423|       |
 2424|  31.3k|        if(ps_cur_slice->u1_direct_spatial_mv_pred_flag)
  ------------------
  |  Branch (2424:12): [True: 16.7k, False: 14.5k]
  ------------------
 2425|  16.7k|            ps_cur_slice->pf_decodeDirect = ih264d_decode_spatial_direct;
 2426|  14.5k|        else
 2427|  14.5k|            ps_cur_slice->pf_decodeDirect = ih264d_decode_temporal_direct;
 2428|  31.3k|        if(!((ps_seq->u1_mb_aff_flag) && (!u1_field_pic_flag)))
  ------------------
  |  Branch (2428:14): [True: 0, False: 31.3k]
  |  Branch (2428:42): [True: 0, False: 0]
  ------------------
 2429|  31.3k|            ps_dec->pf_mvpred = ih264d_mvpred_nonmbaffB;
 2430|  31.3k|    }
 2431|  75.2k|    else
 2432|  75.2k|    {
 2433|  75.2k|        if(!((ps_seq->u1_mb_aff_flag) && (!u1_field_pic_flag)))
  ------------------
  |  Branch (2433:14): [True: 0, False: 75.2k]
  |  Branch (2433:42): [True: 0, False: 0]
  ------------------
 2434|  75.2k|            ps_dec->pf_mvpred = ih264d_mvpred_nonmbaff;
 2435|  75.2k|    }
 2436|       |
 2437|   106k|    if(ps_dec->u4_first_slice_in_pic)
  ------------------
  |  Branch (2437:8): [True: 103k, False: 3.14k]
  ------------------
 2438|   103k|    {
 2439|   103k|        if(u2_first_mb_in_slice == 0)
  ------------------
  |  Branch (2439:12): [True: 103k, False: 0]
  ------------------
 2440|   103k|        {
 2441|   103k|            ret = isvcd_start_of_pic(ps_svc_lyr_dec, i4_poc, &s_tmp_poc, u2_frame_num, ps_pps);
 2442|   103k|            if(ret != OK) return ret;
  ------------------
  |  |  114|   103k|#define OK        0
  ------------------
  |  Branch (2442:16): [True: 988, False: 102k]
  ------------------
 2443|       |            /*inter layer buffer intialization */
 2444|   102k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
 2445|   102k|                ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start;
 2446|   102k|            ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_cur_mb =
 2447|   102k|                ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_base;
 2448|   102k|        }
 2449|       |
 2450|   102k|        ps_dec->u4_output_present = 0;
 2451|       |
 2452|   102k|        {
 2453|   102k|            ih264d_get_next_display_field(ps_dec, ps_dec->ps_out_buffer, &(ps_dec->s_disp_op));
 2454|       |            /* If error code is non-zero then there is no buffer available for
 2455|       |            display, hence avoid format conversion */
 2456|       |
 2457|   102k|            if(0 != ps_dec->s_disp_op.u4_error_code)
  ------------------
  |  Branch (2457:16): [True: 41.9k, False: 60.5k]
  ------------------
 2458|  41.9k|            {
 2459|  41.9k|                ps_dec->u4_output_present = 0;
 2460|  41.9k|                ps_dec->u4_fmt_conv_cur_row = ps_dec->s_disp_frame_info.u4_y_ht;
 2461|  41.9k|            }
 2462|  60.5k|            else
 2463|  60.5k|                ps_dec->u4_output_present = 1;
 2464|   102k|        }
 2465|   102k|        ret = isvcd_parse_interlayer_resamp_func_init(ps_svc_lyr_dec, u2_first_mb_in_slice);
 2466|   102k|        if(ret != OK)
  ------------------
  |  |  114|   102k|#define OK        0
  ------------------
  |  Branch (2466:12): [True: 0, False: 102k]
  ------------------
 2467|      0|        {
 2468|      0|            return ERROR_CORRUPTED_SLICE;
 2469|      0|        }
 2470|   102k|        if((ps_dec->u1_separate_parse == 1) && (ps_svc_lyr_dec->u1_res_init_done == 1))
  ------------------
  |  Branch (2470:12): [True: 30.2k, False: 72.2k]
  |  Branch (2470:48): [True: 30.2k, False: 0]
  ------------------
 2471|  30.2k|        {
 2472|  30.2k|            if(ps_dec->u4_dec_thread_created == 0)
  ------------------
  |  Branch (2472:16): [True: 30.2k, False: 0]
  ------------------
 2473|  30.2k|            {
 2474|  30.2k|                if(ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER)
  ------------------
  |  |  110|  30.2k|#define TARGET_LAYER 2
  ------------------
  |  Branch (2474:20): [True: 0, False: 30.2k]
  ------------------
 2475|      0|                {
 2476|      0|                    ithread_create(ps_dec->pv_dec_thread_handle, NULL,
 2477|      0|                                   (void *) isvcd_decode_picture_thread, (void *) ps_dec);
 2478|       |
 2479|      0|                    ps_dec->u4_dec_thread_created = 1;
 2480|      0|                }
 2481|  30.2k|                else
 2482|  30.2k|                {
 2483|  30.2k|                    ithread_create(ps_dec->pv_dec_thread_handle, NULL,
 2484|  30.2k|                                   (void *) ih264d_decode_picture_thread, (void *) ps_dec);
 2485|       |
 2486|  30.2k|                    ps_dec->u4_dec_thread_created = 1;
 2487|  30.2k|                }
 2488|  30.2k|            }
 2489|       |#ifdef KEEP_THREADS_ACTIVE
 2490|       |            ret = ithread_mutex_lock(ps_dec->apv_proc_start_mutex[0]);
 2491|       |            RETURN_IF((ret != IV_SUCCESS), ret);
 2492|       |
 2493|       |            ps_dec->ai4_process_start[0] = PROC_START;
 2494|       |            ret = ithread_cond_signal(ps_dec->apv_proc_start_condition[0]);
 2495|       |            RETURN_IF((ret != IV_SUCCESS), ret);
 2496|       |
 2497|       |            ret = ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[0]);
 2498|       |            RETURN_IF((ret != IV_SUCCESS), ret);
 2499|       |#endif
 2500|       |#ifdef KEEP_THREADS_ACTIVE
 2501|       |            if(ps_dec->u4_bs_deblk_thread_created)
 2502|       |            {
 2503|       |                ret = ithread_mutex_lock(ps_dec->apv_proc_start_mutex[1]);
 2504|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 2505|       |
 2506|       |                ps_dec->ai4_process_start[1] = PROC_START;
 2507|       |                ret = ithread_cond_signal(ps_dec->apv_proc_start_condition[1]);
 2508|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 2509|       |
 2510|       |                ret = ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[1]);
 2511|       |                RETURN_IF((ret != IV_SUCCESS), ret);
 2512|       |            }
 2513|       |#endif
 2514|  30.2k|        }
 2515|   102k|    }
 2516|       |
 2517|       |    /* INITIALIZATION of fn ptrs for MC and formMbPartInfo functions */
 2518|   105k|    {
 2519|   105k|        UWORD8 uc_nofield_nombaff;
 2520|       |
 2521|   105k|        uc_nofield_nombaff =
 2522|   105k|            ((ps_dec->ps_cur_slice->u1_field_pic_flag == 0) &&
  ------------------
  |  Branch (2522:14): [True: 105k, False: 0]
  ------------------
 2523|   105k|             (ps_dec->ps_cur_slice->u1_mbaff_frame_flag == 0) && (u1_slice_type != B_SLICE) &&
  ------------------
  |  |  369|   105k|#define B_SLICE  1
  ------------------
  |  Branch (2523:14): [True: 105k, False: 0]
  |  Branch (2523:66): [True: 74.7k, False: 30.8k]
  ------------------
 2524|  74.7k|             (ps_dec->ps_cur_pps->u1_wted_pred_flag == 0));
  ------------------
  |  Branch (2524:14): [True: 51.6k, False: 23.1k]
  ------------------
 2525|       |
 2526|       |        /* Initialise MC and formMbPartInfo fn ptrs one time based on profile_idc */
 2527|       |
 2528|   105k|        if(uc_nofield_nombaff)
  ------------------
  |  Branch (2528:12): [True: 51.6k, False: 54.0k]
  ------------------
 2529|  51.6k|        {
 2530|  51.6k|            ps_dec->p_form_mb_part_info = ih264d_form_mb_part_info_bp;
 2531|  51.6k|            ps_dec->p_motion_compensate = ih264d_motion_compensate_bp;
 2532|  51.6k|        }
 2533|  54.0k|        else
 2534|  54.0k|        {
 2535|  54.0k|            ps_dec->p_form_mb_part_info = ih264d_form_mb_part_info_mp;
 2536|  54.0k|            ps_dec->p_motion_compensate = ih264d_motion_compensate_mp;
 2537|  54.0k|        }
 2538|   105k|    }
 2539|       |
 2540|       |    /*
 2541|       |     * Decide whether to decode the current picture or not
 2542|       |     */
 2543|   105k|    {
 2544|   105k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
 2545|   105k|        if(ps_err->u4_frm_sei_sync == u2_frame_num)
  ------------------
  |  Branch (2545:12): [True: 66, False: 105k]
  ------------------
 2546|     66|        {
 2547|     66|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  600|     66|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 2548|     66|            ps_err->u4_frm_sei_sync = SYNC_FRM_DEFAULT;
  ------------------
  |  |  609|     66|#define SYNC_FRM_DEFAULT  (0xFFFFFFFF)
  ------------------
 2549|     66|        }
 2550|   105k|        ps_err->u4_cur_frm = u2_frame_num;
 2551|   105k|    }
 2552|       |
 2553|       |    /* Decision for decoding if the picture is to be skipped */
 2554|   105k|    {
 2555|   105k|        WORD32 i4_skip_b_pic, i4_skip_p_pic;
 2556|       |
 2557|   105k|        i4_skip_b_pic = (ps_dec->u4_skip_frm_mask & B_SLC_BIT) && (B_SLICE == u1_slice_type) &&
  ------------------
  |  |  378|   105k|#define B_SLC_BIT  (0x4)
  ------------------
                      i4_skip_b_pic = (ps_dec->u4_skip_frm_mask & B_SLC_BIT) && (B_SLICE == u1_slice_type) &&
  ------------------
  |  |  369|      0|#define B_SLICE  1
  ------------------
  |  Branch (2557:25): [True: 0, False: 105k]
  |  Branch (2557:67): [True: 0, False: 0]
  ------------------
 2558|      0|                        (0 == u1_nal_ref_idc);
  ------------------
  |  Branch (2558:25): [True: 0, False: 0]
  ------------------
 2559|       |
 2560|   105k|        i4_skip_p_pic = (ps_dec->u4_skip_frm_mask & P_SLC_BIT) && (P_SLICE == u1_slice_type) &&
  ------------------
  |  |  377|   105k|#define P_SLC_BIT  (0x2)
  ------------------
                      i4_skip_p_pic = (ps_dec->u4_skip_frm_mask & P_SLC_BIT) && (P_SLICE == u1_slice_type) &&
  ------------------
  |  |  368|      0|#define P_SLICE  0
  ------------------
  |  Branch (2560:25): [True: 0, False: 105k]
  |  Branch (2560:67): [True: 0, False: 0]
  ------------------
 2561|      0|                        (0 == u1_nal_ref_idc);
  ------------------
  |  Branch (2561:25): [True: 0, False: 0]
  ------------------
 2562|       |
 2563|       |        /**************************************************************/
 2564|       |        /* Skip the B picture if skip mask is set for B picture and   */
 2565|       |        /* Current B picture is a non reference B picture or there is */
 2566|       |        /* no user for reference B picture                            */
 2567|       |        /**************************************************************/
 2568|   105k|        if(i4_skip_b_pic)
  ------------------
  |  Branch (2568:12): [True: 0, False: 105k]
  ------------------
 2569|      0|        {
 2570|      0|            ps_dec->ps_cur_pic->u4_pack_slc_typ |= B_SLC_BIT;
  ------------------
  |  |  378|      0|#define B_SLC_BIT  (0x4)
  ------------------
 2571|       |            /* Don't decode the picture in SKIP-B mode if that picture is B */
 2572|       |            /* and also it is not to be used as a reference picture         */
 2573|      0|            ps_dec->u1_last_pic_not_decoded = 1;
 2574|       |
 2575|      0|            return OK;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
 2576|      0|        }
 2577|       |        /**************************************************************/
 2578|       |        /* Skip the P picture if skip mask is set for P picture and   */
 2579|       |        /* Current P picture is a non reference P picture or there is */
 2580|       |        /* no user for reference P picture                            */
 2581|       |        /**************************************************************/
 2582|   105k|        if(i4_skip_p_pic)
  ------------------
  |  Branch (2582:12): [True: 0, False: 105k]
  ------------------
 2583|      0|        {
 2584|      0|            ps_dec->ps_cur_pic->u4_pack_slc_typ |= P_SLC_BIT;
  ------------------
  |  |  377|      0|#define P_SLC_BIT  (0x2)
  ------------------
 2585|       |            /* Don't decode the picture in SKIP-P mode if that picture is P */
 2586|       |            /* and also it is not to be used as a reference picture         */
 2587|      0|            ps_dec->u1_last_pic_not_decoded = 1;
 2588|       |
 2589|      0|            return OK;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
 2590|      0|        }
 2591|   105k|    }
 2592|       |
 2593|   105k|    {
 2594|   105k|        UWORD16 u2_mb_x, u2_mb_y;
 2595|       |
 2596|   105k|        ps_dec->i4_submb_ofst =
 2597|   105k|            ((u2_first_mb_in_slice << ps_cur_slice->u1_mbaff_frame_flag) * SUB_BLK_SIZE) -
  ------------------
  |  |  562|   105k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   105k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   105k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
 2598|   105k|            SUB_BLK_SIZE;
  ------------------
  |  |  562|   105k|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   105k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|   105k|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
 2599|   105k|        if(u2_first_mb_in_slice)
  ------------------
  |  Branch (2599:12): [True: 3.14k, False: 102k]
  ------------------
 2600|  3.14k|        {
 2601|  3.14k|            UWORD8 u1_mb_aff;
 2602|  3.14k|            UWORD8 u1_field_pic;
 2603|  3.14k|            UWORD16 u2_frm_wd_in_mbs;
 2604|  3.14k|            u2_frm_wd_in_mbs = ps_seq->u2_frm_wd_in_mbs;
 2605|  3.14k|            u1_mb_aff = ps_cur_slice->u1_mbaff_frame_flag;
 2606|  3.14k|            u1_field_pic = ps_cur_slice->u1_field_pic_flag;
 2607|       |
 2608|  3.14k|            {
 2609|  3.14k|                UWORD32 x_offset;
 2610|  3.14k|                UWORD32 y_offset;
 2611|  3.14k|                UWORD32 u4_frame_stride;
 2612|  3.14k|                tfr_ctxt_t *ps_trns_addr;
 2613|       |
 2614|  3.14k|                if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2614:20): [True: 918, False: 2.22k]
  ------------------
 2615|    918|                {
 2616|    918|                    ps_trns_addr = &ps_dec->s_tran_addrecon_parse;
 2617|    918|                }
 2618|  2.22k|                else
 2619|  2.22k|                {
 2620|  2.22k|                    ps_trns_addr = &ps_dec->s_tran_addrecon;
 2621|  2.22k|                }
 2622|  3.14k|                u2_mb_x = MOD(u2_first_mb_in_slice, u2_frm_wd_in_mbs);
  ------------------
  |  |   64|  3.14k|#define MOD(x,y) ((x)%(y))
  ------------------
 2623|  3.14k|                u2_mb_y = DIV(u2_first_mb_in_slice, u2_frm_wd_in_mbs);
  ------------------
  |  |   65|  3.14k|#define DIV(x,y) ((x)/(y))
  ------------------
 2624|       |
 2625|  3.14k|                u2_mb_y <<= u1_mb_aff;
 2626|       |
 2627|  3.14k|                if((u2_mb_x > u2_frm_wd_in_mbs - 1) || (u2_mb_y > ps_dec->u2_frm_ht_in_mbs - 1))
  ------------------
  |  Branch (2627:20): [True: 0, False: 3.14k]
  |  Branch (2627:56): [True: 74, False: 3.06k]
  ------------------
 2628|     74|                {
 2629|     74|                    return ERROR_CORRUPTED_SLICE;
 2630|     74|                }
 2631|       |
 2632|  3.06k|                u4_frame_stride = ps_dec->u2_frm_wd_y << u1_field_pic;
 2633|  3.06k|                x_offset = u2_mb_x << 4;
 2634|  3.06k|                y_offset = (u2_mb_y * u4_frame_stride) << 4;
 2635|       |
 2636|  3.06k|                ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1 + x_offset + y_offset;
 2637|       |
 2638|  3.06k|                u4_frame_stride = ps_dec->u2_frm_wd_uv << u1_field_pic;
 2639|  3.06k|                x_offset >>= 1;
 2640|  3.06k|                y_offset = (u2_mb_y * u4_frame_stride) << 3;
 2641|       |
 2642|  3.06k|                x_offset *= YUV420SP_FACTOR;
  ------------------
  |  |  119|  3.06k|#define YUV420SP_FACTOR 2
  ------------------
 2643|       |
 2644|  3.06k|                ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2 + x_offset + y_offset;
 2645|  3.06k|                ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3 + x_offset + y_offset;
 2646|       |
 2647|  3.06k|                ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 2648|  3.06k|                ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 2649|  3.06k|                ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
 2650|       |
 2651|       |                /* assign the deblock structure pointers to start of slice */
 2652|  3.06k|                if(ps_dec->u1_separate_parse == 1)
  ------------------
  |  Branch (2652:20): [True: 849, False: 2.21k]
  ------------------
 2653|    849|                {
 2654|    849|                    ps_dec->ps_deblk_mbn =
 2655|    849|                        ps_dec->ps_deblk_pic + (u2_first_mb_in_slice << u1_mb_aff);
 2656|    849|                }
 2657|  2.21k|                else
 2658|  2.21k|                {
 2659|  2.21k|                    ps_dec->ps_deblk_mbn =
 2660|  2.21k|                        ps_dec->ps_deblk_pic + (u2_first_mb_in_slice << u1_mb_aff);
 2661|  2.21k|                }
 2662|       |
 2663|  3.06k|                ps_dec->u4_cur_mb_addr = (u2_first_mb_in_slice << u1_mb_aff);
 2664|       |
 2665|  3.06k|                ps_dec->ps_mv_cur =
 2666|  3.06k|                    ps_dec->s_cur_pic.ps_mv + ((u2_first_mb_in_slice << u1_mb_aff) << 4);
 2667|  3.06k|            }
 2668|  3.06k|        }
 2669|   102k|        else
 2670|   102k|        {
 2671|   102k|            tfr_ctxt_t *ps_trns_addr;
 2672|       |
 2673|   102k|            if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2673:16): [True: 30.2k, False: 72.2k]
  ------------------
 2674|  30.2k|            {
 2675|  30.2k|                ps_trns_addr = &ps_dec->s_tran_addrecon_parse;
 2676|  30.2k|            }
 2677|  72.2k|            else
 2678|  72.2k|            {
 2679|  72.2k|                ps_trns_addr = &ps_dec->s_tran_addrecon;
 2680|  72.2k|            }
 2681|       |
 2682|   102k|            u2_mb_x = 0xffff;
 2683|   102k|            u2_mb_y = 0;
 2684|       |            // assign the deblock structure pointers to start of slice
 2685|   102k|            ps_dec->u4_cur_mb_addr = 0;
 2686|   102k|            ps_dec->ps_deblk_mbn = ps_dec->ps_deblk_pic;
 2687|   102k|            ps_dec->ps_mv_cur = ps_dec->s_cur_pic.ps_mv;
 2688|   102k|            ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1;
 2689|   102k|            ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2;
 2690|   102k|            ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3;
 2691|       |
 2692|   102k|            ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
 2693|   102k|            ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
 2694|   102k|            ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
 2695|   102k|        }
 2696|       |
 2697|   105k|        ps_dec->ps_part = ps_dec->ps_parse_part_params;
 2698|       |
 2699|   105k|        ps_dec->u2_mbx = (MOD(u2_first_mb_in_slice - 1, ps_seq->u2_frm_wd_in_mbs));
  ------------------
  |  |   64|   105k|#define MOD(x,y) ((x)%(y))
  ------------------
 2700|   105k|        ps_dec->u2_mby = (DIV(u2_first_mb_in_slice - 1, ps_seq->u2_frm_wd_in_mbs));
  ------------------
  |  |   65|   105k|#define DIV(x,y) ((x)/(y))
  ------------------
 2701|   105k|        ps_dec->u2_mby <<= ps_cur_slice->u1_mbaff_frame_flag;
 2702|   105k|        ps_dec->i2_prev_slice_mbx = (WORD16) ps_dec->u2_mbx;
 2703|   105k|        ps_dec->i2_prev_slice_mby = (WORD16) ps_dec->u2_mby;
 2704|   105k|    }
 2705|       |
 2706|       |    /* RBSP stop bit is used for CABAC decoding*/
 2707|      0|    ps_bitstrm->u4_max_ofst += ps_dec->ps_cur_pps->u1_entropy_coding_mode;
 2708|       |
 2709|   105k|    ps_dec->u1_B = (u1_slice_type == B_SLICE);
  ------------------
  |  |  369|   105k|#define B_SLICE  1
  ------------------
 2710|   105k|    ps_dec->u4_next_mb_skip = 0;
 2711|       |
 2712|   105k|    ps_dec->ps_parse_cur_slice->u4_first_mb_in_slice = ps_dec->ps_cur_slice->u2_first_mb_in_slice;
 2713|   105k|    ps_dec->ps_parse_cur_slice->slice_type = ps_dec->ps_cur_slice->u1_slice_type;
 2714|       |
 2715|   105k|    ps_dec->u4_start_recon_deblk = 1;
 2716|   105k|    {
 2717|   105k|        WORD32 num_entries;
 2718|   105k|        WORD32 size;
 2719|   105k|        UWORD8 *pu1_buf;
 2720|       |
 2721|   105k|        num_entries = MAX_FRAMES;
  ------------------
  |  |  600|   105k|#define MAX_FRAMES              16
  ------------------
 2722|   105k|        if((1 >= ps_dec->ps_cur_sps->u1_num_ref_frames) && (0 == ps_dec->i4_display_delay))
  ------------------
  |  Branch (2722:12): [True: 84.7k, False: 20.8k]
  |  Branch (2722:60): [True: 0, False: 84.7k]
  ------------------
 2723|      0|        {
 2724|      0|            num_entries = 1;
 2725|      0|        }
 2726|   105k|        num_entries = ((2 * num_entries) + 1);
 2727|   105k|        num_entries *= 2;
 2728|       |
 2729|   105k|        size = num_entries * sizeof(void *);
 2730|   105k|        size += PAD_MAP_IDX_POC * sizeof(void *);
  ------------------
  |  |  100|   105k|#define PAD_MAP_IDX_POC             (1)
  ------------------
 2731|       |
 2732|   105k|        pu1_buf = (UWORD8 *) ps_dec->pv_map_ref_idx_to_poc_buf;
 2733|   105k|        pu1_buf += size * ps_dec->u2_cur_slice_num;
 2734|   105k|        ps_dec->ps_parse_cur_slice->ppv_map_ref_idx_to_poc = (void *) pu1_buf;
 2735|   105k|    }
 2736|       |
 2737|   105k|    if(ps_dec->u1_separate_parse)
  ------------------
  |  Branch (2737:8): [True: 31.1k, False: 74.4k]
  ------------------
 2738|  31.1k|    {
 2739|  31.1k|        ps_dec->ps_parse_cur_slice->pv_tu_coeff_data_start = ps_dec->pv_parse_tu_coeff_data;
 2740|  31.1k|    }
 2741|  74.4k|    else
 2742|  74.4k|    {
 2743|  74.4k|        ps_dec->pv_proc_tu_coeff_data = ps_dec->pv_parse_tu_coeff_data;
 2744|  74.4k|    }
 2745|       |
 2746|   105k|    ret = ih264d_fix_error_in_dpb(ps_dec);
 2747|   105k|    if(ret < 0) return ERROR_DBP_MANAGER_T;
  ------------------
  |  Branch (2747:8): [True: 0, False: 105k]
  ------------------
 2748|       |
 2749|   105k|    if(u1_slice_type == I_SLICE)
  ------------------
  |  |  370|   105k|#define I_SLICE  2
  ------------------
  |  Branch (2749:8): [True: 7.42k, False: 98.1k]
  ------------------
 2750|  7.42k|    {
 2751|  7.42k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= I_SLC_BIT;
  ------------------
  |  |  376|  7.42k|#define I_SLC_BIT  (0x1)
  ------------------
 2752|       |
 2753|  7.42k|        ret = isvcd_parse_islice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 2754|  7.42k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 2755|  7.42k|        if(ps_dec->i4_pic_type != B_SLICE && ps_dec->i4_pic_type != P_SLICE)
  ------------------
  |  |  369|  14.8k|#define B_SLICE  1
  ------------------
                      if(ps_dec->i4_pic_type != B_SLICE && ps_dec->i4_pic_type != P_SLICE)
  ------------------
  |  |  368|  7.31k|#define P_SLICE  0
  ------------------
  |  Branch (2755:12): [True: 7.31k, False: 107]
  |  Branch (2755:46): [True: 6.45k, False: 867]
  ------------------
 2756|  6.45k|            ps_dec->i4_pic_type = I_SLICE;
  ------------------
  |  |  370|  6.45k|#define I_SLICE  2
  ------------------
 2757|  7.42k|    }
 2758|  98.1k|    else if(u1_slice_type == P_SLICE)
  ------------------
  |  |  368|  98.1k|#define P_SLICE  0
  ------------------
  |  Branch (2758:13): [True: 66.9k, False: 31.2k]
  ------------------
 2759|  66.9k|    {
 2760|  66.9k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= P_SLC_BIT;
  ------------------
  |  |  377|  66.9k|#define P_SLC_BIT  (0x2)
  ------------------
 2761|  66.9k|        ret = isvcd_parse_pslice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 2762|  66.9k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 2763|  66.9k|        if(ps_dec->i4_pic_type != B_SLICE) ps_dec->i4_pic_type = P_SLICE;
  ------------------
  |  |  369|  66.9k|#define B_SLICE  1
  ------------------
                      if(ps_dec->i4_pic_type != B_SLICE) ps_dec->i4_pic_type = P_SLICE;
  ------------------
  |  |  368|  66.6k|#define P_SLICE  0
  ------------------
  |  Branch (2763:12): [True: 66.6k, False: 311]
  ------------------
 2764|  66.9k|    }
 2765|  31.2k|    else if(u1_slice_type == B_SLICE)
  ------------------
  |  |  369|  31.2k|#define B_SLICE  1
  ------------------
  |  Branch (2765:13): [True: 30.8k, False: 420]
  ------------------
 2766|  30.8k|    {
 2767|  30.8k|        ps_dec->ps_cur_pic->u4_pack_slc_typ |= B_SLC_BIT;
  ------------------
  |  |  378|  30.8k|#define B_SLC_BIT  (0x4)
  ------------------
 2768|  30.8k|        ret = isvcd_parse_bslice(ps_svc_lyr_dec, u2_first_mb_in_slice);
 2769|  30.8k|        ps_dec->u1_pr_sl_type = u1_slice_type;
 2770|  30.8k|        ps_dec->i4_pic_type = B_SLICE;
  ------------------
  |  |  369|  30.8k|#define B_SLICE  1
  ------------------
 2771|  30.8k|    }
 2772|    420|    else
 2773|    420|        return ERROR_INV_SLC_TYPE_T;
 2774|       |
 2775|   105k|    if(ps_dec->u1_slice_header_done)
  ------------------
  |  Branch (2775:8): [True: 81.8k, False: 23.3k]
  ------------------
 2776|  81.8k|    {
 2777|       |        /* set to zero to indicate a valid slice has been decoded */
 2778|  81.8k|        ps_dec->u1_first_slice_in_stream = 0;
 2779|  81.8k|    }
 2780|       |
 2781|   105k|    if(ret != OK) return ret;
  ------------------
  |  |  114|   105k|#define OK        0
  ------------------
  |  Branch (2781:8): [True: 49.8k, False: 55.2k]
  ------------------
 2782|       |
 2783|  55.2k|    if(u1_nal_ref_idc != 0)
  ------------------
  |  Branch (2783:8): [True: 49.6k, False: 5.67k]
  ------------------
 2784|  49.6k|    {
 2785|  49.6k|        if(!ps_dec->ps_dpb_cmds->u1_dpb_commands_read)
  ------------------
  |  Branch (2785:12): [True: 48.8k, False: 767]
  ------------------
 2786|  48.8k|        {
 2787|  48.8k|            memcpy((void *) ps_dec->ps_dpb_cmds, (void *) (&(ps_dec->s_dpb_cmds_scratch)),
 2788|  48.8k|                   sizeof(dpb_commands_t));
 2789|  48.8k|        }
 2790|  49.6k|    }
 2791|       |
 2792|       |    /* storing last Mb X and MbY of the slice */
 2793|  55.2k|    ps_dec->i2_prev_slice_mbx = ps_dec->u2_mbx;
 2794|  55.2k|    ps_dec->i2_prev_slice_mby = ps_dec->u2_mby;
 2795|       |
 2796|       |    /* End of Picture detection */
 2797|       |
 2798|  55.2k|    if(ps_dec->u4_total_mbs_coded >= (ps_seq->u4_max_mb_addr + 1))
  ------------------
  |  Branch (2798:8): [True: 26.1k, False: 29.0k]
  ------------------
 2799|  26.1k|    {
 2800|  26.1k|        ps_dec->u1_pic_decode_done = 1;
 2801|  26.1k|    }
 2802|       |
 2803|  55.2k|    {
 2804|  55.2k|        dec_err_status_t *ps_err = ps_dec->ps_dec_err_status;
 2805|  55.2k|        if((ps_err->u1_err_flag & REJECT_PB_PICS) && (ps_err->u1_cur_pic_type == PIC_TYPE_I))
  ------------------
  |  |  602|  55.2k|#define REJECT_PB_PICS    (0x02)
  ------------------
                      if((ps_err->u1_err_flag & REJECT_PB_PICS) && (ps_err->u1_cur_pic_type == PIC_TYPE_I))
  ------------------
  |  |  608|      0|#define PIC_TYPE_I        (0x00)
  ------------------
  |  Branch (2805:12): [True: 0, False: 55.2k]
  |  Branch (2805:54): [True: 0, False: 0]
  ------------------
 2806|      0|        {
 2807|      0|            ps_err->u1_err_flag = ACCEPT_ALL_PICS;
  ------------------
  |  |  600|      0|#define ACCEPT_ALL_PICS   (0x00)
  ------------------
 2808|      0|        }
 2809|  55.2k|    }
 2810|       |
 2811|  55.2k|    PRINT_BIN_BIT_RATIO(ps_dec)
 2812|       |
 2813|  55.2k|    return ret;
 2814|   105k|}

isvcd_pred_residual_recon_chroma_8x8:
   88|   152k|{
   89|   152k|    UWORD8 *pu1_pred_ptr = pu1_pred;
   90|   152k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
   91|   152k|    UWORD8 *pu1_out_ptr = pu1_out;
   92|   152k|    WORD16 i, j;
   93|   152k|    WORD16 i_macro;
   94|       |
   95|  1.37M|    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (95:16): [True: 1.22M, False: 152k]
  ------------------
   96|  1.22M|    {
   97|  1.22M|        pu1_pred_ptr = pu1_pred;
   98|  1.22M|        pi2_rsd_ptr = pi2_rsd;
   99|  1.22M|        pu1_out = pu1_out_ptr;
  100|       |
  101|  10.9M|        for(j = 0; j < 8; j++)
  ------------------
  |  Branch (101:20): [True: 9.76M, False: 1.22M]
  ------------------
  102|  9.76M|        {
  103|  9.76M|            i_macro = *pu1_pred_ptr + *pi2_rsd_ptr;
  104|  9.76M|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  9.76M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  9.76M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 112k, False: 9.65M]
  |  |  |  |  |  Branch (77:54): [True: 2.23k, False: 9.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  105|  9.76M|            pu1_pred_ptr += pred_strd;
  106|  9.76M|            pi2_rsd_ptr += rsd_strd;
  107|  9.76M|            pu1_out += out_strd;
  108|  9.76M|        }
  109|       |
  110|  1.22M|        pu1_out_ptr += 2;  // Interleaved store for output
  111|  1.22M|        pu1_pred += 2;     // Interleaved load for pred buffer
  112|  1.22M|        pi2_rsd += 2;
  113|  1.22M|    }
  114|   152k|}
isvcd_pred_residual_recon_chroma_4x4:
  190|  11.2k|{
  191|  11.2k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  192|  11.2k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  193|  11.2k|    UWORD8 *pu1_out_ptr = pu1_out;
  194|  11.2k|    WORD16 i, j;
  195|  11.2k|    WORD16 i_macro;
  196|       |
  197|  56.0k|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (197:16): [True: 44.8k, False: 11.2k]
  ------------------
  198|  44.8k|    {
  199|  44.8k|        pu1_pred_ptr = pu1_pred;
  200|  44.8k|        pi2_rsd_ptr = pi2_rsd;
  201|  44.8k|        pu1_out = pu1_out_ptr;
  202|       |
  203|   224k|        for(j = 0; j < 4; j++)
  ------------------
  |  Branch (203:20): [True: 179k, False: 44.8k]
  ------------------
  204|   179k|        {
  205|   179k|            i_macro = *pu1_pred_ptr + *pi2_rsd_ptr;
  206|   179k|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   179k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   179k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 4.06k, False: 175k]
  |  |  |  |  |  Branch (77:54): [True: 244, False: 174k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  207|   179k|            pu1_pred_ptr += pred_strd;
  208|   179k|            pi2_rsd_ptr += rsd_strd;
  209|   179k|            pu1_out += out_strd;
  210|   179k|        }
  211|       |
  212|  44.8k|        pu1_out_ptr += 2;  // Interleaved store for output
  213|  44.8k|        pu1_pred += 2;     // Interleaved load for pred buffer
  214|  44.8k|        pi2_rsd += 2;
  215|  44.8k|    }
  216|  11.2k|}
isvcd_pred_residual_recon_16x16:
  242|  69.4k|{
  243|  69.4k|    WORD32 i4_nnz = 0, i4_nnz_blk[4][4] = {0};
  244|  69.4k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  245|  69.4k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  246|  69.4k|    UWORD8 *pu1_out_ptr = pu1_out;
  247|  69.4k|    WORD16 i, j;
  248|  69.4k|    WORD16 i_macro;
  249|       |
  250|  1.18M|    for(i = 0; i < 16; i++)
  ------------------
  |  Branch (250:16): [True: 1.11M, False: 69.4k]
  ------------------
  251|  1.11M|    {
  252|  1.11M|        pu1_pred_ptr = pu1_pred;
  253|  1.11M|        pi2_rsd_ptr = pi2_rsd;
  254|  1.11M|        pu1_out = pu1_out_ptr;
  255|       |
  256|  18.9M|        for(j = 0; j < 16; j++)
  ------------------
  |  Branch (256:20): [True: 17.7M, False: 1.11M]
  ------------------
  257|  17.7M|        {
  258|  17.7M|            i_macro = *pi2_rsd_ptr;
  259|  17.7M|            i4_nnz_blk[j >> 2][i >> 2] |= !!i_macro;
  260|  17.7M|            i_macro += *pu1_pred_ptr;
  261|  17.7M|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  17.7M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  17.7M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 63.4k, False: 17.7M]
  |  |  |  |  |  Branch (77:54): [True: 16.7k, False: 17.7M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  262|  17.7M|            pu1_pred_ptr += pred_strd;
  263|  17.7M|            pi2_rsd_ptr += rsd_strd;
  264|  17.7M|            pu1_out += out_strd;
  265|  17.7M|        }
  266|       |
  267|  1.11M|        pu1_out_ptr++;
  268|  1.11M|        pi2_rsd++;
  269|  1.11M|        pu1_pred++;
  270|  1.11M|    }
  271|       |
  272|   347k|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (272:16): [True: 277k, False: 69.4k]
  ------------------
  273|   277k|    {
  274|  1.38M|        for(j = 0; j < 4; j++)
  ------------------
  |  Branch (274:20): [True: 1.11M, False: 277k]
  ------------------
  275|  1.11M|        {
  276|  1.11M|            i4_nnz |= (i4_nnz_blk[j][i]) << (i + (j << 2));
  277|  1.11M|        }
  278|   277k|    }
  279|       |
  280|  69.4k|    return i4_nnz;
  281|  69.4k|}
isvcd_pred_residual_recon_4x4:
  307|  86.0k|{
  308|  86.0k|    WORD32 i4_nnz_blk[4][4] = {0};
  309|  86.0k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  310|  86.0k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  311|  86.0k|    UWORD8 *pu1_out_ptr = pu1_out;
  312|  86.0k|    WORD16 i, j;
  313|  86.0k|    WORD16 i_macro;
  314|       |
  315|   430k|    for(i = 0; i < 4; i++)
  ------------------
  |  Branch (315:16): [True: 344k, False: 86.0k]
  ------------------
  316|   344k|    {
  317|   344k|        pu1_pred_ptr = pu1_pred;
  318|   344k|        pi2_rsd_ptr = pi2_rsd;
  319|   344k|        pu1_out = pu1_out_ptr;
  320|       |
  321|  1.72M|        for(j = 0; j < 4; j++)
  ------------------
  |  Branch (321:20): [True: 1.37M, False: 344k]
  ------------------
  322|  1.37M|        {
  323|  1.37M|            i_macro = *pi2_rsd_ptr;
  324|  1.37M|            i4_nnz_blk[j >> 2][i >> 2] |= !!i_macro;
  325|  1.37M|            i_macro += *pu1_pred_ptr;
  326|  1.37M|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|  1.37M|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|  1.37M|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 18.1k, False: 1.35M]
  |  |  |  |  |  Branch (77:54): [True: 1.47k, False: 1.35M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  327|  1.37M|            pu1_pred_ptr += pred_strd;
  328|  1.37M|            pi2_rsd_ptr += rsd_strd;
  329|  1.37M|            pu1_out += out_strd;
  330|  1.37M|        }
  331|       |
  332|   344k|        pu1_out_ptr++;
  333|   344k|        pi2_rsd++;
  334|   344k|        pu1_pred++;
  335|   344k|    }
  336|       |
  337|  86.0k|    return i4_nnz_blk[0][0];
  338|  86.0k|}
isvcd_pred_residual_recon_8x8:
  364|  9.20k|{
  365|  9.20k|    WORD32 i4_nnz = 0, i4_nnz_blk[4][4] = {0};
  366|  9.20k|    UWORD8 *pu1_pred_ptr = pu1_pred;
  367|  9.20k|    WORD16 *pi2_rsd_ptr = pi2_rsd;
  368|  9.20k|    UWORD8 *pu1_out_ptr = pu1_out;
  369|  9.20k|    WORD16 i, j;
  370|  9.20k|    WORD16 i_macro;
  371|       |
  372|  82.8k|    for(i = 0; i < 8; i++)
  ------------------
  |  Branch (372:16): [True: 73.6k, False: 9.20k]
  ------------------
  373|  73.6k|    {
  374|  73.6k|        pu1_pred_ptr = pu1_pred;
  375|  73.6k|        pi2_rsd_ptr = pi2_rsd;
  376|  73.6k|        pu1_out = pu1_out_ptr;
  377|       |
  378|   662k|        for(j = 0; j < 8; j++)
  ------------------
  |  Branch (378:20): [True: 589k, False: 73.6k]
  ------------------
  379|   589k|        {
  380|   589k|            i_macro = *pi2_rsd_ptr;
  381|   589k|            i4_nnz_blk[j >> 2][i >> 2] |= !!i_macro;
  382|   589k|            i_macro += *pu1_pred_ptr;
  383|   589k|            *pu1_out = CLIP_U8(i_macro);
  ------------------
  |  |   58|   589k|#define CLIP_U8(x) CLIP3(0, UINT8_MAX, (x))
  |  |  ------------------
  |  |  |  |   77|   589k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (77:31): [True: 15.0k, False: 573k]
  |  |  |  |  |  Branch (77:54): [True: 1.52k, False: 572k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  384|   589k|            pu1_pred_ptr += pred_strd;
  385|   589k|            pi2_rsd_ptr += rsd_strd;
  386|   589k|            pu1_out += out_strd;
  387|   589k|        }
  388|       |
  389|  73.6k|        pu1_out_ptr++;
  390|  73.6k|        pi2_rsd++;
  391|  73.6k|        pu1_pred++;
  392|  73.6k|    }
  393|       |
  394|  9.20k|    i4_nnz = i4_nnz_blk[0][0] | (i4_nnz_blk[1][0] << 4);
  395|  9.20k|    i4_nnz |= (i4_nnz_blk[0][1] << 1) | (i4_nnz_blk[1][1] << 5);
  396|       |
  397|  9.20k|    return i4_nnz;
  398|  9.20k|}

isvcd_one_to_one:
   72|  85.9k|{
   73|  85.9k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
   74|  85.9k|    UWORD8 *pu1_col_zero_flag_start, u1_col_mb_pred_mode, u1_num_blks, u1_sub_mb_num;
   75|  85.9k|    UWORD8 u1_init_colzero_flag;
   76|  85.9k|    UNUSED(ps_cur_mb_info);
  ------------------
  |  |   45|  85.9k|#define UNUSED(x) ((void)(x))
  ------------------
   77|  85.9k|    pu1_col_zero_flag_start = ps_col_pic->pu1_col_zero_flag + u2_sub_mb_ofst;
   78|  85.9k|    u1_col_mb_pred_mode = pu1_col_zero_flag_start[ps_dec->u1_sub_mb_num];
   79|  85.9k|    u1_init_colzero_flag = u1_col_mb_pred_mode & 1;
   80|  85.9k|    u1_col_mb_pred_mode >>= 6;
   81|  85.9k|    ps_direct->u1_vert_mv_scale = ONE_TO_ONE;
  ------------------
  |  |   47|  85.9k|#define ONE_TO_ONE    0
  ------------------
   82|  85.9k|    ps_direct->u1_col_zeroflag_change = (ps_svc_lyr_dec->u1_base_res_flag) ? 0 : 1;
  ------------------
  |  Branch (82:41): [True: 0, False: 85.9k]
  ------------------
   83|       |
   84|  85.9k|    if(u1_wd_x == MB_SIZE)
  ------------------
  |  |  554|  85.9k|#define MB_SIZE             16
  ------------------
  |  Branch (84:8): [True: 80.9k, False: 4.90k]
  ------------------
   85|  80.9k|    {
   86|  80.9k|        ps_dec->u1_currB_type = (!!u1_col_mb_pred_mode);
   87|  80.9k|        if(u1_col_mb_pred_mode == PRED_16x16)
  ------------------
  |  |  450|  80.9k|#define PRED_16x16  0
  ------------------
  |  Branch (87:12): [True: 76.0k, False: 4.95k]
  ------------------
   88|  76.0k|        {
   89|  76.0k|            ps_direct->i1_num_partitions = 1;
   90|  76.0k|            ps_direct->i4_mv_indices[0] = u2_sub_mb_ofst;
   91|  76.0k|            ps_direct->i1_submb_num[0] = 0;
   92|  76.0k|            ps_direct->i1_partitionsize[0] = PRED_16x16;
  ------------------
  |  |  450|  76.0k|#define PRED_16x16  0
  ------------------
   93|       |
   94|  76.0k|            return;
   95|  76.0k|        }
   96|  4.95k|        else if(u1_col_mb_pred_mode < PRED_8x8)
  ------------------
  |  |  453|  4.95k|#define PRED_8x8    3
  ------------------
  |  Branch (96:17): [True: 2.48k, False: 2.46k]
  ------------------
   97|  2.48k|        {
   98|  2.48k|            ps_direct->i1_num_partitions = 2;
   99|  2.48k|            ps_direct->i4_mv_indices[0] = u2_sub_mb_ofst;
  100|  2.48k|            ps_direct->i1_submb_num[0] = 0;
  101|  2.48k|            ps_direct->i1_partitionsize[0] = u1_col_mb_pred_mode;
  102|  2.48k|            u1_sub_mb_num = (u1_col_mb_pred_mode == PRED_16x8) ? 8 : 2;
  ------------------
  |  |  451|  2.48k|#define PRED_16x8   1
  ------------------
  |  Branch (102:29): [True: 2.00k, False: 481]
  ------------------
  103|  2.48k|            ps_direct->i1_submb_num[1] = u1_sub_mb_num;
  104|  2.48k|            ps_direct->i4_mv_indices[1] = u2_sub_mb_ofst + ps_direct->i1_submb_num[1];
  105|  2.48k|            ps_direct->i1_partitionsize[1] = u1_col_mb_pred_mode;
  106|  2.48k|            if((pu1_col_zero_flag_start[u1_sub_mb_num] & 1) != u1_init_colzero_flag)
  ------------------
  |  Branch (106:16): [True: 727, False: 1.75k]
  ------------------
  107|    727|                ps_direct->u1_col_zeroflag_change = 1;
  108|  2.48k|            return;
  109|  2.48k|        }
  110|  2.46k|        else
  111|  2.46k|        {
  112|  2.46k|            u1_num_blks = 4;
  113|  2.46k|        }
  114|  80.9k|    }
  115|  4.90k|    else
  116|  4.90k|    {
  117|  4.90k|        u1_num_blks = 1;
  118|  4.90k|    }
  119|       |
  120|  7.37k|    {
  121|  7.37k|        const UWORD8 *pu1_top_lt_mb_part_idx;
  122|  7.37k|        UWORD8 u1_col_sub_mb_pred_mode, uc_blk, u1_sub_blk, u1_submb_col = 0;
  123|  7.37k|        UWORD8 u1_num_sub_blks, uc_direct8x8inf, *pu1_col_zero_flag, u1_sub_mb_num;
  124|  7.37k|        const UWORD8 *pu1_num_sub_mb_part = (const UWORD8 *) gau1_ih264d_num_submb_part;
  125|  7.37k|        UWORD8 i1_num_partitions = 0, partition_size;
  126|  7.37k|        WORD32 mv_index;
  127|  7.37k|        const UWORD8 *pu1_top_lt_sub_mb_idx = gau1_ih264d_submb_indx_mod_sp_drct;
  128|       |
  129|  7.37k|        u1_sub_mb_num = ps_dec->u1_sub_mb_num;
  130|  7.37k|        uc_direct8x8inf = ps_dec->ps_cur_slice->u1_direct_8x8_inference_flag;
  131|  7.37k|        pu1_top_lt_mb_part_idx = gau1_ih264d_top_left_mb_part_indx_mod + (PRED_8x8 << 1) + 1;
  ------------------
  |  |  453|  7.37k|#define PRED_8x8    3
  ------------------
  132|       |
  133|  22.1k|        for(uc_blk = 0; uc_blk < u1_num_blks; uc_blk++)
  ------------------
  |  Branch (133:25): [True: 14.7k, False: 7.37k]
  ------------------
  134|  14.7k|        {
  135|  14.7k|            partition_size = PRED_8x8;
  ------------------
  |  |  453|  14.7k|#define PRED_8x8    3
  ------------------
  136|  14.7k|            pu1_top_lt_sub_mb_idx = gau1_ih264d_submb_indx_mod_sp_drct;
  137|  14.7k|            if(uc_direct8x8inf == 1)
  ------------------
  |  Branch (137:16): [True: 2.18k, False: 12.5k]
  ------------------
  138|  2.18k|            {
  139|  2.18k|                u1_submb_col = u1_sub_mb_num | (u1_sub_mb_num >> 1);
  140|  2.18k|                mv_index = u2_sub_mb_ofst + u1_submb_col;
  141|  2.18k|                u1_num_sub_blks = 1;
  142|  2.18k|            }
  143|  12.5k|            else
  144|  12.5k|            {
  145|       |                /* colMbPart is either 8x8, 8x4, 4x8, 4x4 */
  146|  12.5k|                pu1_col_zero_flag = pu1_col_zero_flag_start + u1_sub_mb_num;
  147|  12.5k|                u1_col_sub_mb_pred_mode = *pu1_col_zero_flag;
  148|  12.5k|                u1_col_sub_mb_pred_mode = (u1_col_sub_mb_pred_mode & 0x30) >> 4;
  149|  12.5k|                partition_size = (UWORD8) ((u1_col_sub_mb_pred_mode) | (PRED_8x8 << 2));
  ------------------
  |  |  453|  12.5k|#define PRED_8x8    3
  ------------------
  150|  12.5k|                mv_index = u2_sub_mb_ofst + u1_sub_mb_num;
  151|  12.5k|                pu1_top_lt_sub_mb_idx += (u1_col_sub_mb_pred_mode << 1);
  152|  12.5k|                u1_num_sub_blks = pu1_num_sub_mb_part[u1_col_sub_mb_pred_mode];
  153|  12.5k|            }
  154|       |
  155|  31.3k|            for(u1_sub_blk = 0; u1_sub_blk < u1_num_sub_blks; u1_sub_blk++, pu1_top_lt_sub_mb_idx++)
  ------------------
  |  Branch (155:33): [True: 16.5k, False: 14.7k]
  ------------------
  156|  16.5k|            {
  157|  16.5k|                u1_sub_mb_num += *pu1_top_lt_sub_mb_idx;
  158|  16.5k|                mv_index += *pu1_top_lt_sub_mb_idx;
  159|  16.5k|                ps_direct->i4_mv_indices[i1_num_partitions] = mv_index;
  160|  16.5k|                ps_direct->i1_submb_num[i1_num_partitions] = u1_sub_mb_num;
  161|  16.5k|                ps_direct->i1_partitionsize[i1_num_partitions] = partition_size;
  162|  16.5k|                i1_num_partitions++;
  163|  16.5k|                if(!uc_direct8x8inf) u1_submb_col = u1_sub_mb_num;
  ------------------
  |  Branch (163:20): [True: 14.4k, False: 2.18k]
  ------------------
  164|  16.5k|                if((pu1_col_zero_flag_start[u1_submb_col] & 1) != u1_init_colzero_flag)
  ------------------
  |  Branch (164:20): [True: 1.42k, False: 15.1k]
  ------------------
  165|  1.42k|                    ps_direct->u1_col_zeroflag_change = 1;
  166|  16.5k|            }
  167|  14.7k|            u1_sub_mb_num = *pu1_top_lt_mb_part_idx++;
  168|  14.7k|        }
  169|  7.37k|        ps_direct->i1_num_partitions = i1_num_partitions;
  170|  7.37k|    }
  171|  7.37k|}
isvcd_decode_spatial_direct:
  187|  85.9k|{
  188|  85.9k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) ps_dec;
  189|  85.9k|    mv_pred_t s_mv_pred = {0};
  190|  85.9k|    mv_pred_t *ps_mv;
  191|  85.9k|    UWORD8 u1_col_zero_flag, u1_direct_zero_pred_flag = 0;
  192|  85.9k|    UWORD32 u4_sub_mb_num;
  193|  85.9k|    UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  194|  85.9k|    mv_pred_t *ps_mv_ntop_start;
  195|  85.9k|    mv_pred_t *ps_mv_nmb_start = ps_dec->ps_mv_cur + (u4_mb_num << 4);
  196|  85.9k|    UWORD8 partition_size, sub_partition, u1_mb_partw, u1_mb_parth;
  197|  85.9k|    UWORD8 i;
  198|  85.9k|    WORD8 i1_pred, i1_ref_frame0, i1_ref_frame1;
  199|  85.9k|    struct pic_buffer_t *ps_ref_frame = NULL, *ps_col_pic, *ps_pic_buff0 = NULL,
  200|  85.9k|                        *ps_pic_buff1 = NULL;
  201|       |
  202|  85.9k|    UWORD8 u1_zero_pred_cond_f, u1_zero_pred_cond_b;
  203|  85.9k|    WORD16 i2_spat_pred_mv[4] = {0};
  204|  85.9k|    WORD16 *pi2_final_mv0, *pi2_final_mv1;
  205|  85.9k|    UWORD16 ui2_mask_fwd = 0, ui2_mask_bwd = 0;
  206|  85.9k|    UWORD32 *pui32_weight_ofsts = NULL;
  207|  85.9k|    directmv_t s_mvdirect = {0};
  208|  85.9k|    UWORD8 u1_colz;
  209|  85.9k|    UWORD8 u1_final_ref_idx = 0;
  210|  85.9k|    const UWORD8 *pu1_mb_parth = (const UWORD8 *) gau1_ih264d_mb_parth;
  211|  85.9k|    const UWORD8 *pu1_mb_partw = (const UWORD8 *) gau1_ih264d_mb_partw;
  212|       |
  213|  85.9k|    mv_pred_t s_temp_mv_pred = {0};
  214|  85.9k|    ps_mv_ntop_start =
  215|  85.9k|        ps_dec->ps_mv_cur + (u4_mb_num << 4) - (ps_dec->u2_frm_wd_in_mbs << (4 + u1_mbaff)) + 12;
  216|       |
  217|  85.9k|    u1_direct_zero_pred_flag =
  218|  85.9k|        ps_dec->pf_mvpred(ps_dec, ps_cur_mb_info, (ps_mv_nmb_start + ps_dec->u1_sub_mb_num),
  219|  85.9k|                          ps_mv_ntop_start + (ps_dec->u1_sub_mb_num & 0x03), &s_mv_pred,
  220|  85.9k|                          ps_dec->u1_sub_mb_num, (u1_wd_x >> 2), 0, 1, B_DIRECT_SPATIAL);
  ------------------
  |  |  489|  85.9k|#define B_DIRECT_SPATIAL  26
  ------------------
  221|       |
  222|  85.9k|    i2_spat_pred_mv[0] = s_mv_pred.i2_mv[0];
  223|  85.9k|    i2_spat_pred_mv[1] = s_mv_pred.i2_mv[1];
  224|  85.9k|    i2_spat_pred_mv[2] = s_mv_pred.i2_mv[2];
  225|  85.9k|    i2_spat_pred_mv[3] = s_mv_pred.i2_mv[3];
  226|       |
  227|  85.9k|    i1_ref_frame0 = s_mv_pred.i1_ref_frame[0];
  228|  85.9k|    i1_ref_frame1 = s_mv_pred.i1_ref_frame[1];
  229|       |
  230|  85.9k|    i1_ref_frame0 = (i1_ref_frame0 < 0) ? -1 : i1_ref_frame0;
  ------------------
  |  Branch (230:21): [True: 4.56k, False: 81.3k]
  ------------------
  231|  85.9k|    i1_ref_frame1 = (i1_ref_frame1 < 0) ? -1 : i1_ref_frame1;
  ------------------
  |  Branch (231:21): [True: 7.77k, False: 78.1k]
  ------------------
  232|       |
  233|  85.9k|    i1_pred = 0;
  234|       |
  235|  85.9k|    {
  236|  85.9k|        WORD8 u1_ref_idx, u1_ref_idx1;
  237|  85.9k|        UWORD32 uc_Idx, uc_Idx1;
  238|  85.9k|        UWORD8 u1_scale_ref =
  239|  85.9k|            (ps_dec->ps_cur_slice->u1_mbaff_frame_flag && ps_cur_mb_info->u1_mb_field_decodingflag);
  ------------------
  |  Branch (239:14): [True: 0, False: 85.9k]
  |  Branch (239:59): [True: 0, False: 0]
  ------------------
  240|  85.9k|        u1_final_ref_idx = i1_ref_frame0;
  241|  85.9k|        if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (241:12): [True: 81.3k, False: 4.56k]
  ------------------
  242|  81.3k|        {
  243|       |            /* convert RefIdx if it is MbAff */
  244|  81.3k|            u1_ref_idx = i1_ref_frame0;
  245|  81.3k|            u1_ref_idx1 = i1_ref_frame0;
  246|  81.3k|            if(u1_scale_ref)
  ------------------
  |  Branch (246:16): [True: 0, False: 81.3k]
  ------------------
  247|      0|            {
  248|      0|                u1_ref_idx1 = u1_ref_idx >> 1;
  249|      0|                if((u1_ref_idx & 0x01) != (1 - ps_cur_mb_info->u1_topmb))
  ------------------
  |  Branch (249:20): [True: 0, False: 0]
  ------------------
  250|      0|                    u1_ref_idx1 += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  251|      0|            }
  252|       |            /* If i1_ref_frame0 < 0 then refIdxCol is obtained from ps_pic_buff1 */
  253|  81.3k|            ps_pic_buff0 = ps_dec->ps_ref_pic_buf_lx[0][u1_ref_idx1];
  254|  81.3k|            ps_ref_frame = ps_pic_buff0;
  255|  81.3k|            i1_pred = PRED_L0;
  ------------------
  |  |  483|  81.3k|#define PRED_L0   1
  ------------------
  256|  81.3k|        }
  257|       |
  258|  85.9k|        if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (258:12): [True: 78.1k, False: 7.77k]
  ------------------
  259|  78.1k|        {
  260|       |            /* convert RefIdx if it is MbAff */
  261|  78.1k|            u1_ref_idx = i1_ref_frame1;
  262|  78.1k|            u1_ref_idx1 = i1_ref_frame1;
  263|  78.1k|            if(u1_scale_ref)
  ------------------
  |  Branch (263:16): [True: 0, False: 78.1k]
  ------------------
  264|      0|            {
  265|      0|                u1_ref_idx1 = u1_ref_idx >> 1;
  266|      0|                if((u1_ref_idx & 0x01) != (1 - ps_cur_mb_info->u1_topmb))
  ------------------
  |  Branch (266:20): [True: 0, False: 0]
  ------------------
  267|      0|                    u1_ref_idx1 += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  268|      0|            }
  269|  78.1k|            ps_pic_buff1 = ps_dec->ps_ref_pic_buf_lx[1][u1_ref_idx1];
  270|  78.1k|            i1_pred = i1_pred | PRED_L1;
  ------------------
  |  |  484|  78.1k|#define PRED_L1   2
  ------------------
  271|  78.1k|        }
  272|  85.9k|        if(i1_ref_frame0 < 0)
  ------------------
  |  Branch (272:12): [True: 4.56k, False: 81.3k]
  ------------------
  273|  4.56k|        {
  274|  4.56k|            ps_ref_frame = ps_pic_buff1;
  275|  4.56k|            u1_final_ref_idx = i1_ref_frame1;
  276|  4.56k|        }
  277|       |
  278|  85.9k|        u1_zero_pred_cond_f = (u1_direct_zero_pred_flag) || (i1_ref_frame0 < 0);
  ------------------
  |  Branch (278:31): [True: 4.88k, False: 81.0k]
  |  Branch (278:61): [True: 4.56k, False: 76.4k]
  ------------------
  279|  85.9k|        u1_zero_pred_cond_b = (u1_direct_zero_pred_flag) || (i1_ref_frame1 < 0);
  ------------------
  |  Branch (279:31): [True: 4.88k, False: 81.0k]
  |  Branch (279:61): [True: 7.77k, False: 73.2k]
  ------------------
  280|       |
  281|  85.9k|        if(ps_dec->ps_cur_pps->u1_wted_bipred_idc)
  ------------------
  |  Branch (281:12): [True: 50.6k, False: 35.2k]
  ------------------
  282|  50.6k|        {
  283|  50.6k|            uc_Idx = ((i1_ref_frame0 < 1) ? 0 : i1_ref_frame0) *
  ------------------
  |  Branch (283:23): [True: 50.1k, False: 467]
  ------------------
  284|  50.6k|                     ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1];
  285|  50.6k|            if(u1_scale_ref) uc_Idx >>= 1;
  ------------------
  |  Branch (285:16): [True: 0, False: 50.6k]
  ------------------
  286|  50.6k|            uc_Idx1 = (i1_ref_frame1 < 0) ? 0 : i1_ref_frame1;
  ------------------
  |  Branch (286:23): [True: 4.09k, False: 46.5k]
  ------------------
  287|  50.6k|            uc_Idx += (u1_scale_ref) ? (uc_Idx1 >> 1) : uc_Idx1;
  ------------------
  |  Branch (287:23): [True: 0, False: 50.6k]
  ------------------
  288|  50.6k|            pui32_weight_ofsts = (UWORD32 *) &ps_dec->pu4_wt_ofsts[2 * X3(uc_Idx)];
  ------------------
  |  |   92|  50.6k|#define X3(a)   (((a) << 1) + (a))
  ------------------
  289|       |
  290|  50.6k|            if(i1_ref_frame0 < 0) pui32_weight_ofsts += 1;
  ------------------
  |  Branch (290:16): [True: 3.40k, False: 47.2k]
  ------------------
  291|       |
  292|  50.6k|            if(u1_scale_ref && (ps_dec->ps_cur_pps->u1_wted_bipred_idc == 2))
  ------------------
  |  Branch (292:16): [True: 0, False: 50.6k]
  |  Branch (292:32): [True: 0, False: 0]
  ------------------
  293|      0|            {
  294|      0|                WORD16 i2_ref_idx;
  295|      0|                i2_ref_idx = MAX(i1_ref_frame0, 0);
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  296|      0|                i2_ref_idx *= (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1] << 1);
  297|      0|                i2_ref_idx += MAX(i1_ref_frame1, 0);
  ------------------
  |  |   60|      0|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  298|      0|                if(!ps_cur_mb_info->u1_topmb)
  ------------------
  |  Branch (298:20): [True: 0, False: 0]
  ------------------
  299|      0|                    i2_ref_idx += (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0] << 1) *
  300|      0|                                  (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[1] << 1);
  301|      0|                pui32_weight_ofsts = (UWORD32 *) &ps_dec->pu4_mbaff_wt_mat[2 * X3(i2_ref_idx)];
  ------------------
  |  |   92|      0|#define X3(a)   (((a) << 1) + (a))
  ------------------
  302|      0|            }
  303|  50.6k|        }
  304|  85.9k|    }
  305|       |
  306|  85.9k|    s_temp_mv_pred.i1_ref_frame[0] = i1_ref_frame0;
  307|  85.9k|    s_temp_mv_pred.i1_ref_frame[1] = i1_ref_frame1;
  308|  85.9k|    s_temp_mv_pred.u1_col_ref_pic_idx = ps_ref_frame->u1_mv_buf_id;
  309|  85.9k|    s_temp_mv_pred.u1_pic_type = ps_ref_frame->u1_pic_type;
  310|       |
  311|       |    /**********************************************************************/
  312|       |    /* Call the function which gets the number of partitions and          */
  313|       |    /* partition info of colocated Mb                                     */
  314|       |    /**********************************************************************/
  315|       |
  316|  85.9k|    isvcd_one_to_one(ps_svc_lyr_dec, ps_dec->ps_col_pic, &s_mvdirect, u1_wd_x,
  317|  85.9k|                     ps_dec->i4_submb_ofst, ps_cur_mb_info);
  318|       |
  319|  85.9k|    ps_col_pic = ps_dec->ps_col_pic;
  320|  85.9k|    if((s_mvdirect.u1_col_zeroflag_change == 0) || u1_direct_zero_pred_flag)
  ------------------
  |  Branch (320:8): [True: 0, False: 85.9k]
  |  Branch (320:52): [True: 4.88k, False: 81.0k]
  ------------------
  321|  4.88k|    {
  322|  4.88k|        WORD16 i2_mv_x, i2_mv_y, i2_mvX1, i2_mvY1;
  323|       |        /* Most probable case */
  324|  4.88k|        u1_col_zero_flag = *(ps_col_pic->pu1_col_zero_flag + s_mvdirect.i4_mv_indices[0]);
  325|  4.88k|        u1_col_zero_flag = u1_col_zero_flag & 0x01;
  326|       |
  327|  4.88k|        if(u1_zero_pred_cond_f || ((i1_ref_frame0 == 0) && (u1_col_zero_flag == 1)))
  ------------------
  |  Branch (327:12): [True: 4.88k, False: 0]
  |  Branch (327:36): [True: 0, False: 0]
  |  Branch (327:60): [True: 0, False: 0]
  ------------------
  328|  4.88k|        {
  329|  4.88k|            i2_mv_x = 0;
  330|  4.88k|            i2_mv_y = 0;
  331|  4.88k|        }
  332|      0|        else
  333|      0|        {
  334|      0|            i2_mv_x = i2_spat_pred_mv[0];
  335|      0|            i2_mv_y = i2_spat_pred_mv[1];
  336|      0|        }
  337|       |
  338|  4.88k|        if(u1_zero_pred_cond_b || ((i1_ref_frame1 == 0) && (u1_col_zero_flag == 1)))
  ------------------
  |  Branch (338:12): [True: 4.88k, False: 0]
  |  Branch (338:36): [True: 0, False: 0]
  |  Branch (338:60): [True: 0, False: 0]
  ------------------
  339|  4.88k|        {
  340|  4.88k|            i2_mvX1 = 0;
  341|  4.88k|            i2_mvY1 = 0;
  342|  4.88k|        }
  343|      0|        else
  344|      0|        {
  345|      0|            i2_mvX1 = i2_spat_pred_mv[2];
  346|      0|            i2_mvY1 = i2_spat_pred_mv[3];
  347|      0|        }
  348|       |
  349|  4.88k|        u4_sub_mb_num = ps_dec->u1_sub_mb_num;
  350|  4.88k|        u1_mb_partw = (u1_wd_x >> 2);
  351|       |
  352|  4.88k|        if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (352:12): [True: 4.88k, False: 0]
  ------------------
  353|  4.88k|        {
  354|  4.88k|            {
  355|  4.88k|                pred_info_pkd_t *ps_pred_pkd;
  356|  4.88k|                WORD16 i2_mv[2];
  357|  4.88k|                WORD8 i1_ref_idx = 0;
  358|       |
  359|  4.88k|                i2_mv[0] = i2_mv_x;
  360|  4.88k|                i2_mv[1] = i2_mv_y;
  361|       |
  362|  4.88k|                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  363|  4.88k|                ih264d_fill_pred_info(i2_mv, u1_mb_partw, u1_mb_partw, u4_sub_mb_num, i1_pred,
  364|  4.88k|                                      ps_pred_pkd, ps_pic_buff0->u1_pic_buf_id, i1_ref_idx,
  365|  4.88k|                                      pui32_weight_ofsts, ps_pic_buff0->u1_pic_type);
  366|  4.88k|                ps_dec->u4_pred_info_pkd_idx++;
  367|  4.88k|                ps_cur_mb_info->u1_num_pred_parts++;
  368|  4.88k|            }
  369|  4.88k|        }
  370|       |
  371|  4.88k|        if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (371:12): [True: 4.88k, False: 0]
  ------------------
  372|  4.88k|        {
  373|  4.88k|            {
  374|  4.88k|                pred_info_pkd_t *ps_pred_pkd;
  375|  4.88k|                WORD16 i2_mv[2];
  376|  4.88k|                WORD8 i1_ref_idx = 0;
  377|       |
  378|  4.88k|                i2_mv[0] = i2_mvX1;
  379|  4.88k|                i2_mv[1] = i2_mvY1;
  380|       |
  381|  4.88k|                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  382|  4.88k|                ih264d_fill_pred_info(i2_mv, u1_mb_partw, u1_mb_partw, u4_sub_mb_num, i1_pred,
  383|  4.88k|                                      ps_pred_pkd, ps_pic_buff1->u1_pic_buf_id, i1_ref_idx,
  384|  4.88k|                                      pui32_weight_ofsts, ps_pic_buff1->u1_pic_type);
  385|  4.88k|                ps_dec->u4_pred_info_pkd_idx++;
  386|  4.88k|                ps_cur_mb_info->u1_num_pred_parts++;
  387|  4.88k|            }
  388|  4.88k|        }
  389|       |
  390|       |        /* Replication optimisation */
  391|  4.88k|        s_temp_mv_pred.i2_mv[0] = i2_mv_x;
  392|  4.88k|        s_temp_mv_pred.i2_mv[1] = i2_mv_y;
  393|  4.88k|        s_temp_mv_pred.i2_mv[2] = i2_mvX1;
  394|  4.88k|        s_temp_mv_pred.i2_mv[3] = i2_mvY1;
  395|       |
  396|       |        /* Calculating colocated zero information */
  397|  4.88k|        {
  398|       |            /*************************************/
  399|       |            /* If(bit2 and bit3 set)             */
  400|       |            /* then                              */
  401|       |            /*  (bit0 and bit1) => submmbmode    */
  402|       |            /*  (bit2 and bit3) => mbmode        */
  403|       |            /* else                              */
  404|       |            /*  (bit0 and bit1) => mbmode        */
  405|       |            /*************************************/
  406|       |            /*UWORD8 u1_packed_mb_sub_mb_mode = sub_partition ?
  407|       |             (s_mvdirect.i1_partitionsize[0]) : ((s_mvdirect.i1_partitionsize[0]) <<
  408|       |             2);*/
  409|  4.88k|            UWORD8 u1_packed_mb_sub_mb_mode = (u1_mb_partw == 2) ? 0x03 : 0;
  ------------------
  |  Branch (409:47): [True: 146, False: 4.74k]
  ------------------
  410|       |
  411|  4.88k|            if(i1_ref_frame0 < 0)
  ------------------
  |  Branch (411:16): [True: 0, False: 4.88k]
  ------------------
  412|      0|            {
  413|      0|                i2_mv_x = i2_mvX1;
  414|      0|                i2_mv_y = i2_mvY1;
  415|      0|            }
  416|       |
  417|       |            /* Change from left shift 4 to 6 - Varun */
  418|  4.88k|            u1_colz = (ps_cur_mb_info->u1_mb_field_decodingflag << 1) |
  419|  4.88k|                      ((u1_final_ref_idx == 0) && (ABS(i2_mv_x) <= 1) && (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|  4.88k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 0, False: 4.88k]
  |  |  ------------------
  ------------------
                                    ((u1_final_ref_idx == 0) && (ABS(i2_mv_x) <= 1) && (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|  4.88k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 0, False: 4.88k]
  |  |  ------------------
  ------------------
  |  Branch (419:24): [True: 4.88k, False: 0]
  |  Branch (419:51): [True: 4.88k, False: 0]
  |  Branch (419:74): [True: 4.88k, False: 0]
  ------------------
  420|  4.88k|            u1_colz |= (u1_packed_mb_sub_mb_mode << 6);
  421|  4.88k|        }
  422|  4.88k|        ps_mv = ps_mv_nmb_start + u4_sub_mb_num;
  423|  4.88k|        if(ps_mv)
  ------------------
  |  Branch (423:12): [True: 4.88k, False: 0]
  ------------------
  424|  4.88k|        {
  425|  4.88k|            ih264d_rep_mv_colz(ps_dec, &s_temp_mv_pred, ps_mv, u4_sub_mb_num, u1_colz, u1_mb_partw,
  426|  4.88k|                               u1_mb_partw);
  427|  4.88k|        }
  428|      0|        else
  429|      0|        {
  430|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  431|      0|        }
  432|       |
  433|  4.88k|        if(u1_wd_x == MB_SIZE) ps_dec->u1_currB_type = 0;
  ------------------
  |  |  554|  4.88k|#define MB_SIZE             16
  ------------------
  |  Branch (433:12): [True: 4.74k, False: 146]
  ------------------
  434|       |
  435|  4.88k|        return OK;
  ------------------
  |  |  114|  4.88k|#define OK        0
  ------------------
  436|  4.88k|    }
  437|       |
  438|       |    /***************************************************************************/
  439|       |    /* If present MB is 16x16 and the partition of colocated Mb is >= PRED_8x8 */
  440|       |    /* i.e 8x8 or less than 8x8 partitions then set up DMA for (0,0) and       */
  441|       |    /* spatially predicted motion vector and do the multiplexing after         */
  442|       |    /* motion compensation                                                     */
  443|       |    /***************************************************************************/
  444|       |
  445|  81.0k|    if((u1_wd_x == MB_SIZE) && (s_mvdirect.i1_num_partitions > 2))
  ------------------
  |  |  554|  81.0k|#define MB_SIZE             16
  ------------------
  |  Branch (445:8): [True: 76.2k, False: 4.76k]
  |  Branch (445:32): [True: 2.43k, False: 73.8k]
  ------------------
  446|  2.43k|    {
  447|  2.43k|        ps_cur_mb_info->u1_Mux = 1;
  448|  2.43k|        if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (448:12): [True: 2.15k, False: 283]
  ------------------
  449|  2.15k|        {
  450|  2.15k|            {
  451|  2.15k|                pred_info_pkd_t *ps_pred_pkd;
  452|  2.15k|                WORD8 i1_ref_idx = 0;
  453|       |
  454|  2.15k|                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  455|  2.15k|                ih264d_fill_pred_info(&(i2_spat_pred_mv[0]), 4, 4, 0, i1_pred, ps_pred_pkd,
  456|  2.15k|                                      ps_pic_buff0->u1_pic_buf_id, i1_ref_idx, pui32_weight_ofsts,
  457|  2.15k|                                      ps_pic_buff0->u1_pic_type);
  458|  2.15k|                ps_dec->u4_pred_info_pkd_idx++;
  459|  2.15k|                ps_cur_mb_info->u1_num_pred_parts++;
  460|  2.15k|            }
  461|       |
  462|       |            /******    (0,0) Motion vectors DMA     *****/
  463|  2.15k|            {
  464|  2.15k|                pred_info_pkd_t *ps_pred_pkd;
  465|  2.15k|                WORD16 i2_mv[2];
  466|  2.15k|                WORD8 i1_ref_idx = 0;
  467|       |
  468|  2.15k|                i2_mv[0] = 0;
  469|  2.15k|                i2_mv[1] = 0;
  470|       |
  471|  2.15k|                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  472|  2.15k|                ih264d_fill_pred_info(i2_mv, 4, 4, 0, i1_pred, ps_pred_pkd,
  473|  2.15k|                                      ps_pic_buff0->u1_pic_buf_id, i1_ref_idx, pui32_weight_ofsts,
  474|  2.15k|                                      ps_pic_buff0->u1_pic_type);
  475|  2.15k|                ps_dec->u4_pred_info_pkd_idx++;
  476|  2.15k|                ps_cur_mb_info->u1_num_pred_parts++;
  477|  2.15k|            }
  478|  2.15k|        }
  479|  2.43k|        if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (479:12): [True: 2.04k, False: 393]
  ------------------
  480|  2.04k|        {
  481|  2.04k|            {
  482|  2.04k|                pred_info_pkd_t *ps_pred_pkd;
  483|  2.04k|                WORD8 i1_ref_idx = 0;
  484|       |
  485|  2.04k|                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  486|  2.04k|                ih264d_fill_pred_info(&(i2_spat_pred_mv[2]), 4, 4, 0, i1_pred, ps_pred_pkd,
  487|  2.04k|                                      ps_pic_buff1->u1_pic_buf_id, i1_ref_idx, pui32_weight_ofsts,
  488|  2.04k|                                      ps_pic_buff1->u1_pic_type);
  489|  2.04k|                ps_dec->u4_pred_info_pkd_idx++;
  490|  2.04k|                ps_cur_mb_info->u1_num_pred_parts++;
  491|  2.04k|            }
  492|       |
  493|       |            /******    (0,0) Motion vectors DMA     *****/
  494|  2.04k|            {
  495|  2.04k|                pred_info_pkd_t *ps_pred_pkd;
  496|  2.04k|                WORD16 i2_mv[2];
  497|  2.04k|                WORD8 i1_ref_idx = 0;
  498|       |
  499|  2.04k|                i2_mv[0] = 0;
  500|  2.04k|                i2_mv[1] = 0;
  501|       |
  502|  2.04k|                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  503|  2.04k|                ih264d_fill_pred_info(i2_mv, 4, 4, 0, i1_pred, ps_pred_pkd,
  504|  2.04k|                                      ps_pic_buff1->u1_pic_buf_id, i1_ref_idx, pui32_weight_ofsts,
  505|  2.04k|                                      ps_pic_buff1->u1_pic_type);
  506|  2.04k|                ps_dec->u4_pred_info_pkd_idx++;
  507|  2.04k|                ps_cur_mb_info->u1_num_pred_parts++;
  508|  2.04k|            }
  509|  2.04k|        }
  510|  2.43k|    }
  511|       |
  512|   173k|    for(i = 0; i < s_mvdirect.i1_num_partitions; i++)
  ------------------
  |  Branch (512:16): [True: 92.5k, False: 81.0k]
  ------------------
  513|  92.5k|    {
  514|  92.5k|        partition_size = s_mvdirect.i1_partitionsize[i];
  515|  92.5k|        u4_sub_mb_num = s_mvdirect.i1_submb_num[i];
  516|       |
  517|  92.5k|        sub_partition = partition_size >> 2;
  518|  92.5k|        partition_size &= 0x3;
  519|  92.5k|        u1_mb_partw = pu1_mb_partw[partition_size];
  520|  92.5k|        u1_mb_parth = pu1_mb_parth[partition_size];
  521|  92.5k|        if(sub_partition != 0)
  ------------------
  |  Branch (521:12): [True: 14.1k, False: 78.4k]
  ------------------
  522|  14.1k|        {
  523|  14.1k|            u1_mb_partw >>= 1;
  524|  14.1k|            u1_mb_parth >>= 1;
  525|  14.1k|        }
  526|       |
  527|  92.5k|        u1_col_zero_flag = *(ps_col_pic->pu1_col_zero_flag + s_mvdirect.i4_mv_indices[i]);
  528|  92.5k|        u1_col_zero_flag = u1_col_zero_flag & 0x01;
  529|       |
  530|       |        /*if(u1_col != u1_col_zero_flag)
  531|       |         u1_init = 1;*/
  532|       |
  533|  92.5k|        pi2_final_mv0 = &i2_spat_pred_mv[0];
  534|  92.5k|        pi2_final_mv1 = &i2_spat_pred_mv[2];
  535|       |
  536|  92.5k|        if(ps_cur_mb_info->u1_Mux != 1)
  ------------------
  |  Branch (536:12): [True: 81.0k, False: 11.5k]
  ------------------
  537|  81.0k|        {
  538|  81.0k|            if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (538:16): [True: 76.6k, False: 4.37k]
  ------------------
  539|  76.6k|            {
  540|  76.6k|                {
  541|  76.6k|                    pred_info_pkd_t *ps_pred_pkd;
  542|  76.6k|                    WORD8 i1_ref_idx = 0;
  543|       |
  544|  76.6k|                    ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  545|  76.6k|                    ih264d_fill_pred_info(pi2_final_mv0, u1_mb_partw, u1_mb_parth, u4_sub_mb_num,
  546|  76.6k|                                          i1_pred, ps_pred_pkd, ps_pic_buff0->u1_pic_buf_id,
  547|  76.6k|                                          i1_ref_idx, pui32_weight_ofsts,
  548|  76.6k|                                          ps_pic_buff0->u1_pic_type);
  549|  76.6k|                    ps_dec->u4_pred_info_pkd_idx++;
  550|  76.6k|                    ps_cur_mb_info->u1_num_pred_parts++;
  551|  76.6k|                }
  552|  76.6k|            }
  553|       |
  554|  81.0k|            if(i1_ref_frame1 >= 0)
  ------------------
  |  Branch (554:16): [True: 72.2k, False: 8.80k]
  ------------------
  555|  72.2k|            {
  556|  72.2k|                pred_info_pkd_t *ps_pred_pkd;
  557|  72.2k|                WORD8 i1_ref_idx = 0;
  558|       |
  559|  72.2k|                ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  560|  72.2k|                ih264d_fill_pred_info(pi2_final_mv1, u1_mb_partw, u1_mb_parth, u4_sub_mb_num,
  561|  72.2k|                                      i1_pred, ps_pred_pkd, ps_pic_buff1->u1_pic_buf_id, i1_ref_idx,
  562|  72.2k|                                      pui32_weight_ofsts, ps_pic_buff1->u1_pic_type);
  563|  72.2k|                ps_dec->u4_pred_info_pkd_idx++;
  564|  72.2k|                ps_cur_mb_info->u1_num_pred_parts++;
  565|  72.2k|            }
  566|  81.0k|        }
  567|       |
  568|       |        /* Replication optimisation */
  569|  92.5k|        s_temp_mv_pred.i2_mv[0] = pi2_final_mv0[0];
  570|  92.5k|        s_temp_mv_pred.i2_mv[1] = pi2_final_mv0[1];
  571|  92.5k|        s_temp_mv_pred.i2_mv[2] = pi2_final_mv1[0];
  572|  92.5k|        s_temp_mv_pred.i2_mv[3] = pi2_final_mv1[1];
  573|       |
  574|       |        /* Calculating colocated zero information */
  575|  92.5k|        {
  576|  92.5k|            WORD16 i2_mv_x = 0, i2_mv_y = 0;
  577|       |            /*************************************/
  578|       |            /* If(bit2 and bit3 set)             */
  579|       |            /* then                              */
  580|       |            /*  (bit0 and bit1) => submmbmode    */
  581|       |            /*  (bit2 and bit3) => mbmode        */
  582|       |            /* else                              */
  583|       |            /*  (bit0 and bit1) => mbmode        */
  584|       |            /*************************************/
  585|  92.5k|            UWORD8 u1_packed_mb_sub_mb_mode = sub_partition
  ------------------
  |  Branch (585:47): [True: 14.1k, False: 78.4k]
  ------------------
  586|  92.5k|                                                  ? (s_mvdirect.i1_partitionsize[i])
  587|  92.5k|                                                  : ((s_mvdirect.i1_partitionsize[i]) << 2);
  588|       |
  589|  92.5k|            if(i1_ref_frame0 >= 0)
  ------------------
  |  Branch (589:16): [True: 87.0k, False: 5.54k]
  ------------------
  590|  87.0k|            {
  591|  87.0k|                i2_mv_x = pi2_final_mv0[0];
  592|  87.0k|                i2_mv_y = pi2_final_mv0[1];
  593|  87.0k|            }
  594|  5.54k|            else
  595|  5.54k|            {
  596|  5.54k|                i2_mv_x = pi2_final_mv1[0];
  597|  5.54k|                i2_mv_y = pi2_final_mv1[1];
  598|  5.54k|            }
  599|       |
  600|  92.5k|            u1_colz = (ps_cur_mb_info->u1_mb_field_decodingflag << 1) |
  601|  92.5k|                      ((u1_final_ref_idx == 0) && (ABS(i2_mv_x) <= 1) && (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|  91.3k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 7.94k, False: 83.4k]
  |  |  ------------------
  ------------------
                                    ((u1_final_ref_idx == 0) && (ABS(i2_mv_x) <= 1) && (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|  85.3k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 1.91k, False: 83.4k]
  |  |  ------------------
  ------------------
  |  Branch (601:24): [True: 91.3k, False: 1.18k]
  |  Branch (601:51): [True: 85.3k, False: 6.06k]
  |  Branch (601:74): [True: 81.8k, False: 3.44k]
  ------------------
  602|  92.5k|            u1_colz |= (u1_packed_mb_sub_mb_mode << 4);
  603|  92.5k|        }
  604|  92.5k|        ps_mv = ps_mv_nmb_start + u4_sub_mb_num;
  605|  92.5k|        if(ps_mv)
  ------------------
  |  Branch (605:12): [True: 92.5k, False: 0]
  ------------------
  606|  92.5k|        {
  607|  92.5k|            ih264d_rep_mv_colz(ps_dec, &s_temp_mv_pred, ps_mv, u4_sub_mb_num, u1_colz, u1_mb_parth,
  608|  92.5k|                               u1_mb_partw);
  609|  92.5k|        }
  610|      0|        else
  611|      0|        {
  612|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  613|      0|        }
  614|  92.5k|    }
  615|  81.0k|    i = 0;
  616|  81.0k|    if(i1_ref_frame0 >= 0) ps_cur_mb_info->u2_mask[i++] = ui2_mask_fwd;
  ------------------
  |  Branch (616:8): [True: 76.4k, False: 4.56k]
  ------------------
  617|  81.0k|    if(i1_ref_frame1 >= 0) ps_cur_mb_info->u2_mask[i] = ui2_mask_bwd;
  ------------------
  |  Branch (617:8): [True: 73.2k, False: 7.77k]
  ------------------
  618|       |
  619|  81.0k|    return OK;
  ------------------
  |  |  114|  81.0k|#define OK        0
  ------------------
  620|  81.0k|}

isvcd_retrive_infer_mode_mv:
   80|   277k|{
   81|   277k|    mode_motion_ctxt_t *ps_ctxt;
   82|   277k|    mv_pred_t *ps_motion_pred;
   83|   277k|    UWORD8 u1_tmp_lx = (u1_lx << 1);
   84|       |
   85|   277k|    ps_ctxt = (mode_motion_ctxt_t *) ps_svc_lyr_dec->pv_mode_mv_sample_ctxt;
   86|   277k|    ps_motion_pred = ps_ctxt->ps_motion_pred_struct;
   87|   277k|    ps_motion_pred += u1_sub_mb_num;
   88|   277k|    ps_mvpred->i2_mv[u1_tmp_lx] = ps_motion_pred->i2_mv[u1_tmp_lx];
   89|   277k|    ps_mvpred->i2_mv[u1_tmp_lx + 1] = ps_motion_pred->i2_mv[u1_tmp_lx + 1];
   90|       |
   91|   277k|    return;
   92|   277k|}
isvcd_interlyr_motion_mode_pred:
  109|  7.02M|{
  110|  7.02M|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  111|  7.02M|    WORD32 i4_inter_layer_pred_req_flag;
  112|  7.02M|    WORD32 i4_listx;
  113|  7.02M|    WORD32 i4_mb_mode = -1;
  114|  7.02M|    i4_inter_layer_pred_req_flag = SVCD_FALSE;
  ------------------
  |  |   45|  7.02M|#define SVCD_FALSE 0
  ------------------
  115|  7.02M|    i4_listx = (ps_dec->ps_cur_slice->u1_slice_type == B_SLICE) ? 2 : 1;
  ------------------
  |  |  369|  7.02M|#define B_SLICE  1
  ------------------
  |  Branch (115:16): [True: 141k, False: 6.88M]
  ------------------
  116|       |    /* check Base mode flag and motion predcition flags */
  117|  7.02M|    if(1 == ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (117:8): [True: 165k, False: 6.85M]
  ------------------
  118|   165k|    {
  119|   165k|        i4_inter_layer_pred_req_flag = SVCD_TRUE;
  ------------------
  |  |   46|   165k|#define SVCD_TRUE 1
  ------------------
  120|   165k|    }
  121|  6.85M|    else
  122|  6.85M|    {
  123|  6.85M|        UWORD8 u1_mot_pred_flag;
  124|       |
  125|       |        /* get the packed the motion pred flag of list 0 */
  126|  6.85M|        u1_mot_pred_flag = ps_svc_cur_mb_info->au1_motion_pred_flag[0];
  127|       |
  128|       |        /* extract the last 4 bits */
  129|  6.85M|        u1_mot_pred_flag &= 0x0F;
  130|       |
  131|  6.85M|        if(0 != u1_mot_pred_flag)
  ------------------
  |  Branch (131:12): [True: 24.7k, False: 6.83M]
  ------------------
  132|  24.7k|        {
  133|  24.7k|            i4_inter_layer_pred_req_flag = SVCD_TRUE;
  ------------------
  |  |   46|  24.7k|#define SVCD_TRUE 1
  ------------------
  134|  24.7k|        }
  135|       |
  136|       |        /* check for list 1 flags if required */
  137|  6.85M|        if((2 == i4_listx) && (SVCD_FALSE == i4_inter_layer_pred_req_flag))
  ------------------
  |  |   45|   108k|#define SVCD_FALSE 0
  ------------------
  |  Branch (137:12): [True: 108k, False: 6.75M]
  |  Branch (137:31): [True: 96.4k, False: 11.6k]
  ------------------
  138|  96.4k|        {
  139|       |            /* get the packed the motion pred flag of list 1 */
  140|  96.4k|            u1_mot_pred_flag = ps_svc_cur_mb_info->au1_motion_pred_flag[1];
  141|       |
  142|       |            /* extract the last 4 bits */
  143|  96.4k|            u1_mot_pred_flag &= 0x0F;
  144|       |
  145|  96.4k|            if(0 != u1_mot_pred_flag)
  ------------------
  |  Branch (145:16): [True: 5.61k, False: 90.8k]
  ------------------
  146|  5.61k|            {
  147|  5.61k|                i4_inter_layer_pred_req_flag = SVCD_TRUE;
  ------------------
  |  |   46|  5.61k|#define SVCD_TRUE 1
  ------------------
  148|  5.61k|            }
  149|  96.4k|        }
  150|  6.85M|    }
  151|       |
  152|  7.02M|    if(SVCD_TRUE == i4_inter_layer_pred_req_flag)
  ------------------
  |  |   46|  7.02M|#define SVCD_TRUE 1
  ------------------
  |  Branch (152:8): [True: 195k, False: 6.82M]
  ------------------
  153|   195k|    {
  154|   195k|        mode_motion_ctxt_t *ps_ctxt;
  155|   195k|        mode_motion_lyr_ctxt *ps_lyr_mem;
  156|       |
  157|   195k|        ps_ctxt = (mode_motion_ctxt_t *) ps_svc_lyr_dec->pv_mode_mv_sample_ctxt;
  158|       |        /* get the current layer ctxt */
  159|   195k|        ps_lyr_mem = &ps_ctxt->as_res_lyr_mem[ps_ctxt->i4_res_id];
  160|       |
  161|   195k|        {
  162|   195k|            ps_ctxt->i4_listx = i4_listx;
  163|       |
  164|   195k|            i4_mb_mode =
  165|   195k|                ps_lyr_mem->pf_inter_lyr_pred(ps_svc_lyr_dec->pv_mode_mv_sample_ctxt, ps_cur_mb_info,
  166|   195k|                                          ps_svc_cur_mb_info, ps_dec, ps_mb_part_info, ps_part);
  167|   195k|        }
  168|   195k|    }
  169|  7.02M|    return i4_mb_mode;
  170|  7.02M|}
isvcd_mv_pred_ref_tfr_nby2_epmb:
  182|  1.27M|{
  183|  1.27M|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) ps_dec;
  184|  1.27M|    parse_pmbarams_t *ps_mb_part_info;
  185|  1.27M|    parse_part_params_t *ps_part;
  186|  1.27M|    mv_pred_t *ps_mv_nmb, *ps_mv_nmb_start, *ps_mv_ntop, *ps_mv_ntop_start;
  187|  1.27M|    UWORD32 i, j;
  188|  1.27M|    const UWORD32 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  189|  1.27M|    dec_mb_info_t *ps_cur_mb_info;
  190|  1.27M|    dec_svc_mb_info_t *ps_svc_cur_mb_info;
  191|  1.27M|    WORD32 i2_mv_x, i2_mv_y;
  192|       |
  193|  1.27M|    ps_dec->i4_submb_ofst -= (u4_num_mbs - u4_mb_idx) << 4;
  194|  1.27M|    ps_mb_part_info = ps_dec->ps_parse_mb_data;
  195|  1.27M|    ps_part = ps_dec->ps_parse_part_params;
  196|       |
  197|       |    /* N/2 Mb MvPred and Transfer Setup Loop */
  198|  8.15M|    for(i = u4_mb_idx; i < u4_num_mbs; i++, ps_mb_part_info++)
  ------------------
  |  Branch (198:24): [True: 6.88M, False: 1.27M]
  ------------------
  199|  6.88M|    {
  200|  6.88M|        UWORD32 u1_colz;
  201|  6.88M|        UWORD32 u1_field;
  202|  6.88M|        mv_pred_t s_mvPred = {0};
  203|  6.88M|        mv_pred_t *ps_mv_pred = &s_mvPred;
  204|       |
  205|  6.88M|        *ps_mv_pred = ps_dec->s_default_mv_pred;
  206|       |
  207|  6.88M|        ps_dec->i4_submb_ofst += SUB_BLK_SIZE;
  ------------------
  |  |  562|  6.88M|#define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  6.88M|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  |  |               #define SUB_BLK_SIZE                  ((SUB_BLK_WIDTH) * (SUB_BLK_WIDTH))
  |  |  ------------------
  |  |  |  |  560|  6.88M|#define SUB_BLK_WIDTH                 4
  |  |  ------------------
  ------------------
  208|       |
  209|       |        /* Restore the slice scratch MbX and MbY context */
  210|  6.88M|        ps_cur_mb_info = ps_dec->ps_nmb_info + i;
  211|  6.88M|        ps_svc_cur_mb_info = ps_svc_lyr_dec->ps_svc_nmb_info + i;
  212|  6.88M|        u1_field = ps_cur_mb_info->u1_mb_field_decodingflag;
  213|       |
  214|  6.88M|        ps_mv_nmb_start = ps_dec->ps_mv_cur + (i << 4);
  215|  6.88M|        ps_dec->u2_mbx = ps_cur_mb_info->u2_mbx;
  216|  6.88M|        ps_dec->u2_mby = ps_cur_mb_info->u2_mby;
  217|  6.88M|        ps_dec->u2_mv_2mb[i & 0x1] = 0;
  218|       |
  219|       |        /* Look for MV Prediction and Reference Transfer in Non-I Mbs */
  220|  6.88M|        if(!ps_mb_part_info->u4_isI_mb)
  ------------------
  |  Branch (220:12): [True: 6.88M, False: 2.70k]
  ------------------
  221|  6.88M|        {
  222|  6.88M|            UWORD32 u1_blk_no;
  223|  6.88M|            WORD32 i1_ref_idx, i1_ref_idx1;
  224|  6.88M|            UWORD32 u1_sub_mb_x, u1_sub_mb_y, u1_sub_mb_num;
  225|  6.88M|            UWORD32 u1_num_part, u1_num_ref, u1_wd, u1_ht;
  226|  6.88M|            UWORD32 *pu4_wt_offst, **ppu4_wt_ofst;
  227|  6.88M|            UWORD32 u1_scale_ref, u4_bot_mb;
  228|  6.88M|            WORD8 *pi1_ref_idx = ps_mb_part_info->i1_ref_idx[0];
  229|  6.88M|            pic_buffer_t *ps_ref_frame, **pps_ref_frame;
  230|  6.88M|            deblk_mb_t *ps_cur_deblk_mb = ps_dec->ps_deblk_mbn + i;
  231|  6.88M|            WORD32 i4_mb_mode_svc;
  232|  6.88M|            UWORD8 u1_motion_pred_flag_l0 = ps_svc_cur_mb_info->au1_motion_pred_flag[0];
  233|       |
  234|       |            /* MB Level initialisations */
  235|  6.88M|            ps_dec->u4_num_pmbair = i >> u1_mbaff;
  236|  6.88M|            ps_dec->u4_mb_idx_mv = i;
  237|  6.88M|            ppu4_wt_ofst = ps_mb_part_info->pu4_wt_offst;
  238|  6.88M|            pps_ref_frame = ps_dec->ps_ref_pic_buf_lx[0];
  239|       |
  240|  6.88M|            i4_mb_mode_svc = isvcd_interlyr_motion_mode_pred(
  241|  6.88M|                ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info, ps_mb_part_info, ps_part);
  242|       |
  243|  6.88M|            if((-1 == i4_mb_mode_svc) || (SVC_INTER_MB == i4_mb_mode_svc))
  ------------------
  |  |  114|   132k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (243:16): [True: 6.75M, False: 132k]
  |  Branch (243:42): [True: 114k, False: 17.7k]
  ------------------
  244|  6.86M|            {
  245|  6.86M|                ps_mv_ntop_start =
  246|  6.86M|                    ps_mv_nmb_start - (ps_dec->u2_frm_wd_in_mbs << (4 + u1_mbaff)) + 12;
  247|       |
  248|  6.86M|                u1_num_part = ps_mb_part_info->u1_num_part;
  249|  6.86M|                ps_cur_deblk_mb->u1_mb_type |= (u1_num_part > 1) << 1;
  250|  6.86M|                ps_cur_mb_info->u4_pred_info_pkd_idx = ps_dec->u4_pred_info_pkd_idx;
  251|  6.86M|                ps_cur_mb_info->u1_num_pred_parts = 0;
  252|       |
  253|       |                /****************************************************/
  254|       |                /* weighted u4_ofst pointer calculations, this loop  */
  255|       |                /* runs maximum 4 times, even in direct cases       */
  256|       |                /****************************************************/
  257|  6.86M|                u1_scale_ref = u1_mbaff & u1_field;
  258|       |
  259|  6.86M|                u4_bot_mb = 1 - ps_cur_mb_info->u1_topmb;
  260|  6.86M|                if(ps_dec->ps_cur_pps->u1_wted_pred_flag)
  ------------------
  |  Branch (260:20): [True: 3.76M, False: 3.09M]
  ------------------
  261|  3.76M|                {
  262|  3.76M|                    u1_num_ref = MIN(u1_num_part, 4);
  ------------------
  |  |   61|  3.76M|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 3.76M, False: 3.45k]
  |  |  ------------------
  ------------------
  263|  7.54M|                    for(u1_blk_no = 0; u1_blk_no < u1_num_ref; u1_blk_no++)
  ------------------
  |  Branch (263:40): [True: 3.78M, False: 3.76M]
  ------------------
  264|  3.78M|                    {
  265|  3.78M|                        i1_ref_idx = pi1_ref_idx[u1_blk_no];
  266|  3.78M|                        if(u1_scale_ref) i1_ref_idx >>= 1;
  ------------------
  |  Branch (266:28): [True: 0, False: 3.78M]
  ------------------
  267|  3.78M|                        pu4_wt_offst = (UWORD32 *) &ps_dec->pu4_wt_ofsts[2 * X3(i1_ref_idx)];
  ------------------
  |  |   92|  3.78M|#define X3(a)   (((a) << 1) + (a))
  ------------------
  268|  3.78M|                        ppu4_wt_ofst[u1_blk_no] = pu4_wt_offst;
  269|  3.78M|                    }
  270|  3.76M|                }
  271|  3.09M|                else
  272|  3.09M|                {
  273|  3.09M|                    ppu4_wt_ofst[0] = NULL;
  274|  3.09M|                    ppu4_wt_ofst[1] = NULL;
  275|  3.09M|                    ppu4_wt_ofst[2] = NULL;
  276|  3.09M|                    ppu4_wt_ofst[3] = NULL;
  277|  3.09M|                }
  278|       |
  279|       |                /**************************************************/
  280|       |                /* Loop on Partitions                             */
  281|       |                /**************************************************/
  282|  13.8M|                for(j = 0; j < u1_num_part; j++, ps_part++)
  ------------------
  |  Branch (282:28): [True: 6.95M, False: 6.86M]
  ------------------
  283|  6.95M|                {
  284|  6.95M|                    u1_sub_mb_num = ps_part->u1_sub_mb_num;
  285|  6.95M|                    ps_dec->u1_sub_mb_num = u1_sub_mb_num;
  286|       |
  287|  6.95M|                    if(PART_NOT_DIRECT != ps_part->u1_is_direct)
  ------------------
  |  |  569|  6.95M|#define PART_NOT_DIRECT                0
  ------------------
  |  Branch (287:24): [True: 6.71M, False: 238k]
  ------------------
  288|  6.71M|                    {
  289|       |                        /* Mb Skip Mode */
  290|       |                        /* Setting the default and other members of MvPred Structure */
  291|  6.71M|                        s_mvPred.i2_mv[2] = -1;
  292|  6.71M|                        s_mvPred.i2_mv[3] = -1;
  293|  6.71M|                        s_mvPred.i1_ref_frame[0] = 0;
  294|  6.71M|                        i1_ref_idx = (u1_scale_ref && u4_bot_mb) ? MAX_REF_BUFS : 0;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (294:39): [True: 0, False: 6.71M]
  |  Branch (294:55): [True: 0, False: 0]
  ------------------
  295|  6.71M|                        ps_ref_frame = pps_ref_frame[i1_ref_idx];
  296|  6.71M|                        s_mvPred.u1_col_ref_pic_idx = ps_ref_frame->u1_mv_buf_id;
  297|  6.71M|                        s_mvPred.u1_pic_type = ps_ref_frame->u1_pic_type;
  298|  6.71M|                        pu4_wt_offst = (UWORD32 *) &ps_dec->pu4_wt_ofsts[0];
  299|       |
  300|  6.71M|                        ps_dec->pf_mvpred(ps_dec, ps_cur_mb_info, ps_mv_nmb_start, ps_mv_ntop_start,
  301|  6.71M|                                          &s_mvPred, 0, 4, 0, 1, MB_SKIP);
  ------------------
  |  |   59|  6.71M|#define MB_SKIP 255
  ------------------
  302|       |
  303|  6.71M|                        {
  304|  6.71M|                            pred_info_pkd_t *ps_pred_pkd;
  305|  6.71M|                            ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  306|  6.71M|                            ih264d_fill_pred_info(s_mvPred.i2_mv, 4, 4, 0, PRED_L0, ps_pred_pkd,
  ------------------
  |  |  483|  6.71M|#define PRED_L0   1
  ------------------
  307|  6.71M|                                                  ps_ref_frame->u1_pic_buf_id,
  308|  6.71M|                                                  (i1_ref_idx >> u1_scale_ref), pu4_wt_offst,
  309|  6.71M|                                                  ps_ref_frame->u1_pic_type);
  310|       |
  311|  6.71M|                            ps_dec->u4_pred_info_pkd_idx++;
  312|  6.71M|                            ps_cur_mb_info->u1_num_pred_parts++;
  313|  6.71M|                        }
  314|       |
  315|       |                        /* Storing colocated zero information */
  316|  6.71M|                        u1_colz = ((ABS(s_mvPred.i2_mv[0]) <= 1) && (ABS(s_mvPred.i2_mv[1]) <= 1)) +
  ------------------
  |  |  100|  6.71M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 1.00k, False: 6.71M]
  |  |  ------------------
  ------------------
                                      u1_colz = ((ABS(s_mvPred.i2_mv[0]) <= 1) && (ABS(s_mvPred.i2_mv[1]) <= 1)) +
  ------------------
  |  |  100|  6.71M|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 971, False: 6.71M]
  |  |  ------------------
  ------------------
  |  Branch (316:36): [True: 6.71M, False: 827]
  |  Branch (316:69): [True: 6.71M, False: 1.27k]
  ------------------
  317|  6.71M|                                  (u1_field << 1);
  318|       |
  319|  6.71M|                        if(ps_mv_nmb_start)
  ------------------
  |  Branch (319:28): [True: 6.71M, False: 0]
  ------------------
  320|  6.71M|                        {
  321|  6.71M|                            ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0, u1_colz, 4,
  322|  6.71M|                                               4);
  323|  6.71M|                        }
  324|      0|                        else
  325|      0|                        {
  326|      0|                            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  327|      0|                        }
  328|  6.71M|                    }
  329|   238k|                    else
  330|   238k|                    {
  331|   238k|                        u1_sub_mb_x = u1_sub_mb_num & 0x03;
  332|   238k|                        u1_sub_mb_y = u1_sub_mb_num >> 2;
  333|   238k|                        u1_blk_no = (u1_num_part < 4)
  ------------------
  |  Branch (333:37): [True: 148k, False: 89.3k]
  ------------------
  334|   238k|                                        ? j
  335|   238k|                                        : (((u1_sub_mb_y >> 1) << 1) + (u1_sub_mb_x >> 1));
  336|       |
  337|   238k|                        ps_mv_ntop = ps_mv_ntop_start + u1_sub_mb_x;
  338|   238k|                        ps_mv_nmb = ps_mv_nmb_start + u1_sub_mb_num;
  339|       |
  340|   238k|                        u1_wd = ps_part->u1_partwidth;
  341|   238k|                        u1_ht = ps_part->u1_partheight;
  342|       |
  343|       |                        /* Populate the colpic info and reference frames */
  344|   238k|                        i1_ref_idx = pi1_ref_idx[u1_blk_no];
  345|       |                        /********************************************************************/
  346|       |                        /* If reference index is inferred from the base layer and it is     */
  347|       |                        /* exceeding the number of active reference in the current layer.   */
  348|       |                        /* Then reference index is clipped to the max in the current layer  */
  349|       |                        /********************************************************************/
  350|   238k|                        if(ps_svc_cur_mb_info->u1_base_mode_flag == 1)
  ------------------
  |  Branch (350:28): [True: 171k, False: 67.1k]
  ------------------
  351|   171k|                        {
  352|   171k|                            if(i1_ref_idx > (ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0] - 1))
  ------------------
  |  Branch (352:32): [True: 4.94k, False: 166k]
  ------------------
  353|  4.94k|                            {
  354|  4.94k|                                i1_ref_idx = ps_dec->ps_cur_slice->u1_num_ref_idx_lx_active[0] - 1;
  355|  4.94k|                            }
  356|   171k|                        }
  357|   238k|                        s_mvPred.i1_ref_frame[0] = i1_ref_idx;
  358|       |
  359|   238k|                        if((1 != ps_svc_cur_mb_info->u1_base_mode_flag) &&
  ------------------
  |  Branch (359:28): [True: 67.1k, False: 171k]
  ------------------
  360|  67.1k|                           (0 == (u1_motion_pred_flag_l0 & (1 << u1_blk_no))))
  ------------------
  |  Branch (360:28): [True: 45.0k, False: 22.0k]
  ------------------
  361|  45.0k|                        {
  362|       |                            /********************************************************/
  363|       |                            /* Predict Mv                                           */
  364|       |                            /* Add Mv Residuals and store back                      */
  365|       |                            /********************************************************/
  366|  45.0k|                            ps_dec->pf_mvpred(ps_dec, ps_cur_mb_info, ps_mv_nmb, ps_mv_ntop,
  367|  45.0k|                                              &s_mvPred, u1_sub_mb_num, u1_wd, 0, 1,
  368|  45.0k|                                              ps_cur_mb_info->u1_mb_mc_mode);
  369|       |
  370|  45.0k|                            i2_mv_x = ps_mv_nmb->i2_mv[0];
  371|  45.0k|                            i2_mv_y = ps_mv_nmb->i2_mv[1];
  372|  45.0k|                            i2_mv_x += s_mvPred.i2_mv[0];
  373|  45.0k|                            i2_mv_y += s_mvPred.i2_mv[1];
  374|  45.0k|                            s_mvPred.i2_mv[0] = i2_mv_x;
  375|  45.0k|                            s_mvPred.i2_mv[1] = i2_mv_y;
  376|  45.0k|                        }
  377|   193k|                        else
  378|   193k|                        {
  379|   193k|                            isvcd_retrive_infer_mode_mv(ps_svc_lyr_dec, &s_mvPred, 0,
  380|   193k|                                                        u1_sub_mb_num);
  381|       |
  382|   193k|                            if(0 != (u1_motion_pred_flag_l0 & (1 << u1_blk_no)))
  ------------------
  |  Branch (382:32): [True: 22.0k, False: 171k]
  ------------------
  383|  22.0k|                            {
  384|  22.0k|                                i2_mv_x = ps_mv_nmb->i2_mv[0];
  385|  22.0k|                                i2_mv_y = ps_mv_nmb->i2_mv[1];
  386|  22.0k|                                i2_mv_x += s_mvPred.i2_mv[0];
  387|  22.0k|                                i2_mv_y += s_mvPred.i2_mv[1];
  388|  22.0k|                                s_mvPred.i2_mv[0] = i2_mv_x;
  389|  22.0k|                                s_mvPred.i2_mv[1] = i2_mv_y;
  390|  22.0k|                            }
  391|   193k|                            i2_mv_x = s_mvPred.i2_mv[0];
  392|   193k|                            i2_mv_y = s_mvPred.i2_mv[1];
  393|   193k|                        }
  394|       |                        /********************************************************/
  395|       |                        /* Transfer setup call                                  */
  396|       |                        /* convert RefIdx if it is MbAff                        */
  397|       |                        /* Pass Weight Offset and refFrame                      */
  398|       |                        /********************************************************/
  399|   238k|                        i1_ref_idx1 = i1_ref_idx >> u1_scale_ref;
  400|   238k|                        if(u1_scale_ref && ((i1_ref_idx & 0x01) != u4_bot_mb))
  ------------------
  |  Branch (400:28): [True: 0, False: 238k]
  |  Branch (400:44): [True: 0, False: 0]
  ------------------
  401|      0|                            i1_ref_idx1 += MAX_REF_BUFS;
  ------------------
  |  |   75|      0|#define MAX_REF_BUFS    32
  ------------------
  402|   238k|                        if(-1 == i1_ref_idx1) return NOT_OK;
  ------------------
  |  |  116|    153|#define NOT_OK    -1
  ------------------
  |  Branch (402:28): [True: 153, False: 238k]
  ------------------
  403|   238k|                        ps_ref_frame = pps_ref_frame[i1_ref_idx1];
  404|   238k|                        pu4_wt_offst = ppu4_wt_ofst[u1_blk_no];
  405|       |
  406|   238k|                        {
  407|   238k|                            pred_info_pkd_t *ps_pred_pkd;
  408|   238k|                            ps_pred_pkd = ps_dec->ps_pred_pkd + ps_dec->u4_pred_info_pkd_idx;
  409|   238k|                            ih264d_fill_pred_info(s_mvPred.i2_mv, u1_wd, u1_ht, u1_sub_mb_num,
  410|   238k|                                                  PRED_L0, ps_pred_pkd, ps_ref_frame->u1_pic_buf_id,
  ------------------
  |  |  483|   238k|#define PRED_L0   1
  ------------------
  411|   238k|                                                  (i1_ref_idx >> u1_scale_ref), pu4_wt_offst,
  412|   238k|                                                  ps_ref_frame->u1_pic_type);
  413|       |
  414|   238k|                            ps_dec->u4_pred_info_pkd_idx++;
  415|   238k|                            ps_cur_mb_info->u1_num_pred_parts++;
  416|   238k|                        }
  417|       |
  418|       |                        /* Fill colocated info in MvPred structure */
  419|   238k|                        s_mvPred.u1_col_ref_pic_idx = ps_ref_frame->u1_mv_buf_id;
  420|   238k|                        s_mvPred.u1_pic_type = ps_ref_frame->u1_pic_type;
  421|       |
  422|       |                        /* Calculating colocated zero information */
  423|   238k|                        u1_colz = (u1_field << 1) |
  424|   238k|                                  ((i1_ref_idx == 0) && (ABS(i2_mv_x) <= 1) && (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|   227k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 27.2k, False: 200k]
  |  |  ------------------
  ------------------
                                                ((i1_ref_idx == 0) && (ABS(i2_mv_x) <= 1) && (ABS(i2_mv_y) <= 1));
  ------------------
  |  |  100|   160k|#define ABS(x)          ((x) < 0 ? (-(x)) : (x))
  |  |  ------------------
  |  |  |  Branch (100:26): [True: 16.6k, False: 143k]
  |  |  ------------------
  ------------------
  |  Branch (424:36): [True: 227k, False: 10.7k]
  |  Branch (424:57): [True: 160k, False: 67.0k]
  |  Branch (424:80): [True: 144k, False: 15.7k]
  ------------------
  425|   238k|                        u1_colz |= ps_mb_part_info->u1_col_info[u1_blk_no];
  426|       |
  427|       |                        /* Replicate the motion vectors and colzero u4_flag  */
  428|       |                        /* for all sub-partitions                         */
  429|       |
  430|   238k|                        if(ps_mv_nmb)
  ------------------
  |  Branch (430:28): [True: 238k, False: 0]
  ------------------
  431|   238k|                        {
  432|   238k|                            ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb, u1_sub_mb_num, u1_colz,
  433|   238k|                                               u1_ht, u1_wd);
  434|   238k|                        }
  435|      0|                        else
  436|      0|                        {
  437|      0|                            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  438|      0|                        }
  439|   238k|                    }
  440|  6.95M|                }
  441|       |
  442|       |                /* to take care of 16 parttitions increment for base mode flag case*/
  443|  6.86M|                if(1 == ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (443:20): [True: 114k, False: 6.75M]
  ------------------
  444|   114k|                {
  445|   114k|                    ps_part += (MAX_NUM_MB_PART - u1_num_part);
  ------------------
  |  |   62|   114k|#define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   59|   114k|#define NUM_MB_PARTS 4
  |  |  ------------------
  |  |               #define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   60|   114k|#define NUM_SUB_MB_PARTS 4
  |  |  ------------------
  ------------------
  446|   114k|                }
  447|  6.86M|            }
  448|  17.7k|            else
  449|  17.7k|            {
  450|  17.7k|                ps_cur_deblk_mb->u1_mb_type |= D_INTRA_IBL;
  ------------------
  |  |   72|  17.7k|#define D_INTRA_IBL 16
  ------------------
  451|  17.7k|                if((ps_svc_lyr_dec->u1_layer_identifier != TARGET_LAYER) &&
  ------------------
  |  |  110|  17.7k|#define TARGET_LAYER 2
  ------------------
  |  Branch (451:20): [True: 0, False: 17.7k]
  ------------------
  452|      0|                   (DBLK_ENABLED == ps_dec->ps_cur_slice->u1_disable_dblk_filter_idc))
  ------------------
  |  |  549|      0|#define DBLK_ENABLED                  0
  ------------------
  |  Branch (452:20): [True: 0, False: 0]
  ------------------
  453|      0|                {
  454|      0|                    ps_cur_deblk_mb->u1_deblocking_mode = MB_ENABLE_FILTERING;
  ------------------
  |  |   69|      0|#define MB_ENABLE_FILTERING           0x00
  ------------------
  455|      0|                }
  456|       |                /* to take care of 16 parttitions increment for base mode flag case*/
  457|  17.7k|                if(1 != ps_svc_cur_mb_info->u1_base_mode_flag)
  ------------------
  |  Branch (457:20): [True: 0, False: 17.7k]
  ------------------
  458|      0|                {
  459|      0|                    return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  460|      0|                }
  461|  17.7k|                {
  462|  17.7k|                    ps_part += (MAX_NUM_MB_PART);
  ------------------
  |  |   62|  17.7k|#define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   59|  17.7k|#define NUM_MB_PARTS 4
  |  |  ------------------
  |  |               #define MAX_NUM_MB_PART NUM_MB_PARTS *NUM_SUB_MB_PARTS
  |  |  ------------------
  |  |  |  |   60|  17.7k|#define NUM_SUB_MB_PARTS 4
  |  |  ------------------
  ------------------
  463|  17.7k|                }
  464|       |                /* Storing colocated zero information */
  465|  17.7k|                if(ps_mv_nmb_start)
  ------------------
  |  Branch (465:20): [True: 17.7k, False: 0]
  ------------------
  466|  17.7k|                {
  467|  17.7k|                    ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0,
  468|  17.7k|                                       (UWORD8) (u1_field << 1), 4, 4);
  469|  17.7k|                }
  470|      0|                else
  471|      0|                {
  472|      0|                    return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  473|      0|                }
  474|  17.7k|            }
  475|  6.88M|        }
  476|  2.70k|        else
  477|  2.70k|        {
  478|       |            /* Storing colocated zero information */
  479|  2.70k|            if(ps_mv_nmb_start)
  ------------------
  |  Branch (479:16): [True: 2.70k, False: 0]
  ------------------
  480|  2.70k|            {
  481|  2.70k|                ih264d_rep_mv_colz(ps_dec, &s_mvPred, ps_mv_nmb_start, 0, (UWORD8) (u1_field << 1),
  482|  2.70k|                                   4, 4);
  483|  2.70k|            }
  484|      0|            else
  485|      0|            {
  486|      0|                return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  487|      0|            }
  488|  2.70k|        }
  489|  6.88M|    }
  490|       |
  491|  1.27M|    return OK;
  ------------------
  |  |  114|  1.27M|#define OK        0
  ------------------
  492|  1.27M|}
isvcd_update_intra_mb_inter_layer_info:
  507|  48.7k|{
  508|  48.7k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
  509|  48.7k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start + ps_cur_mb_info->u2_mbx +
  510|  48.7k|        (ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride * (ps_cur_mb_info->u2_mby));
  511|       |
  512|  48.7k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_mb_mode = SVC_INTRA_MB;
  ------------------
  |  |  115|  48.7k|#define SVC_INTRA_MB (1 << 1)       /*!< P or B MBs decoded or inferred*/
  ------------------
  513|  48.7k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_tx_size = ps_cur_mb_info->u1_tran_form8x8;
  514|  48.7k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u2_luma_nnz = 0;
  515|  48.7k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz = 0;
  516|  48.7k|}
isvcd_update_ipcm_mb_inter_layer_info:
  532|  1.09k|{
  533|  1.09k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_mb_mode = SVC_IPCM_MB;
  ------------------
  |  |  116|  1.09k|#define SVC_IPCM_MB (1 << 2)        /*!< IPCM_MB  decoder or inferred*/
  ------------------
  534|  1.09k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_tx_size = ps_cur_mb_info->u1_tran_form8x8;
  535|  1.09k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u2_luma_nnz = 0;
  536|  1.09k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz = 0;
  537|  1.09k|}
isvcd_update_ibl_mb_inter_layer_info:
  553|  82.5k|{
  554|  82.5k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_mb_mode = SVC_IBL_MB;
  ------------------
  |  |  117|  82.5k|#define SVC_IBL_MB (1 << 3)         /*!< I_BL MB always inferred */
  ------------------
  555|  82.5k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_tx_size = ps_cur_mb_info->u1_tran_form8x8;
  556|  82.5k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u2_luma_nnz = 0;
  557|  82.5k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz = 0;
  558|  82.5k|}
isvcd_update_inter_mb_inter_layer_info:
  573|   144k|{
  574|   144k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
  575|   144k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start + ps_cur_mb_info->u2_mbx +
  576|   144k|        (ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride * (ps_cur_mb_info->u2_mby));
  577|   144k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_mb_mode =
  578|   144k|        u1_inference_mode ? SVC_IBL_MB : SVC_INTER_MB;
  ------------------
  |  |  117|  82.5k|#define SVC_IBL_MB (1 << 3)         /*!< I_BL MB always inferred */
  ------------------
                      u1_inference_mode ? SVC_IBL_MB : SVC_INTER_MB;
  ------------------
  |  |  114|   206k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (578:9): [True: 82.5k, False: 62.0k]
  ------------------
  579|   144k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_tx_size = ps_cur_mb_info->u1_tran_form8x8;
  580|   144k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u2_luma_nnz = ps_cur_mb_info->u2_luma_csbp;
  581|   144k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz =
  582|   144k|        (UWORD8) ps_cur_mb_info->u2_chroma_csbp;
  583|   144k|    if(CHECKBIT(ps_cur_mb_info->u1_yuv_dc_block_flag, 1))
  ------------------
  |  |   54|   144k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 8.22k, False: 136k]
  |  |  ------------------
  ------------------
  584|  8.22k|    {
  585|       |        /* Four bits for Cb in DC only cbp */
  586|  8.22k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz |= 0x0F;
  587|  8.22k|    }
  588|   144k|    if(CHECKBIT(ps_cur_mb_info->u1_yuv_dc_block_flag, 2))
  ------------------
  |  |   54|   144k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 8.28k, False: 136k]
  |  |  ------------------
  ------------------
  589|  8.28k|    {
  590|       |        /* Four bits for Cr in DC only cbp */
  591|  8.28k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz |= 0xF0;
  592|  8.28k|    }
  593|   144k|}
isvcd_process_inter_mb_no_rsd_pred_non_target:
  609|  87.1k|{
  610|  87.1k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  611|  87.1k|    UWORD16 u2_luma_stride, u2_chroma_stride;
  612|  87.1k|    WORD16 *pi2_y_coeff, *pi2_luma_res_ptr, *pi2_chroma_res_ptr;
  613|  87.1k|    UWORD32 u4_luma_dc_only_csbp = 0;
  614|  87.1k|    UWORD32 u4_luma_dc_only_cbp = 0;
  615|       |
  616|  87.1k|    if(0 != ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (616:8): [True: 0, False: 87.1k]
  ------------------
  617|      0|    {
  618|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  619|      0|    }
  620|  87.1k|    u2_luma_stride = ps_svc_lyr_dec->u2_residual_resample_luma_stride;
  621|  87.1k|    pi2_luma_res_ptr = ps_svc_lyr_dec->pi2_il_residual_resample_mb_luma_frm_start +
  622|  87.1k|                       (ps_cur_mb_info->u2_mbx << 4) +
  623|  87.1k|                       ((ps_cur_mb_info->u2_mby << 4) * u2_luma_stride);
  624|       |
  625|  87.1k|    u2_chroma_stride = ps_svc_lyr_dec->u2_residual_resample_chroma_stride;
  626|  87.1k|    pi2_chroma_res_ptr = ps_svc_lyr_dec->pi2_il_residual_resample_mb_chroma_frm_start +
  627|  87.1k|                         (ps_cur_mb_info->u2_mbx << 4) +
  628|  87.1k|                         ((ps_cur_mb_info->u2_mby << 3) * u2_chroma_stride);
  629|       |
  630|  87.1k|    if(!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (630:8): [True: 79.1k, False: 8.09k]
  ------------------
  631|  79.1k|    {
  632|  79.1k|        u4_luma_dc_only_csbp = ih264d_unpack_luma_coeff4x4_mb(ps_dec, ps_cur_mb_info, 0);
  633|  79.1k|    }
  634|  8.09k|    else
  635|  8.09k|    {
  636|  8.09k|        if(!ps_dec->ps_cur_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (636:12): [True: 665, False: 7.42k]
  ------------------
  637|    665|        {
  638|    665|            u4_luma_dc_only_cbp = ih264d_unpack_luma_coeff4x4_mb(ps_dec, ps_cur_mb_info, 0);
  639|    665|        }
  640|  7.42k|        else
  641|  7.42k|        {
  642|  7.42k|            u4_luma_dc_only_cbp = ih264d_unpack_luma_coeff8x8_mb(ps_dec, ps_cur_mb_info);
  643|  7.42k|        }
  644|  8.09k|    }
  645|       |
  646|  87.1k|    pi2_y_coeff = ps_dec->pi2_coeff_data;
  647|       |    /* Inverse Transform and Reconstruction */
  648|  87.1k|    if(ps_cur_mb_info->u1_cbp & 0x0f)
  ------------------
  |  Branch (648:8): [True: 19.6k, False: 67.5k]
  ------------------
  649|  19.6k|    {
  650|  19.6k|        if(!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (650:12): [True: 11.5k, False: 8.09k]
  ------------------
  651|  11.5k|        {
  652|  11.5k|            UWORD32 i;
  653|  11.5k|            WORD16 ai2_tmp[16] = {0};
  654|   196k|            for(i = 0; i < 16; i++)
  ------------------
  |  Branch (654:24): [True: 185k, False: 11.5k]
  ------------------
  655|   185k|            {
  656|   185k|                if(CHECKBIT(ps_cur_mb_info->u2_luma_csbp, i))
  ------------------
  |  |   54|   185k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 70.1k, False: 115k]
  |  |  ------------------
  ------------------
  657|  70.1k|                {
  658|  70.1k|                    WORD16 *pi2_level = pi2_y_coeff + (i << 4);
  659|  70.1k|                    WORD16 *pi2_out = pi2_luma_res_ptr + ((i & 0x3) * BLK_SIZE) +
  ------------------
  |  |  556|  70.1k|#define BLK_SIZE             4
  ------------------
  660|  70.1k|                                      (i >> 2) * (u2_luma_stride << 2);
  661|  70.1k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  70.1k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
  662|  70.1k|                    {
  663|  70.1k|                        if(CHECKBIT(u4_luma_dc_only_csbp, i))
  ------------------
  |  |   54|  70.1k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 8.55k, False: 61.6k]
  |  |  ------------------
  ------------------
  664|  8.55k|                        {
  665|  8.55k|                            ps_svc_lyr_dec->pf_iquant_itrans_luma_4x4_dc(
  666|  8.55k|                                pi2_level, pi2_out, u2_luma_stride,
  667|  8.55k|                                gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qp_rem6],
  668|  8.55k|                                (UWORD16 *) ps_dec->s_high_profile.i2_scalinglist4x4[3],
  669|  8.55k|                                ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0, NULL);
  670|  8.55k|                        }
  671|  61.6k|                        else
  672|  61.6k|                        {
  673|  61.6k|                            ps_svc_lyr_dec->pf_iquant_itrans_luma_4x4(
  674|  61.6k|                                pi2_level, pi2_out, u2_luma_stride,
  675|  61.6k|                                gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qp_rem6],
  676|  61.6k|                                (UWORD16 *) ps_dec->s_high_profile.i2_scalinglist4x4[3],
  677|  61.6k|                                ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0, NULL);
  678|  61.6k|                        }
  679|  70.1k|                    }
  680|  70.1k|                }
  681|   185k|            }
  682|  11.5k|        }
  683|  8.09k|        else
  684|  8.09k|        {
  685|  8.09k|            WORD16 *pi2_scale_matrix_ptr;
  686|  8.09k|            WORD32 i;
  687|       |
  688|  8.09k|            pi2_scale_matrix_ptr = ps_dec->s_high_profile.i2_scalinglist8x8[1];
  689|       |
  690|  40.4k|            for(i = 0; i < 4; i++)
  ------------------
  |  Branch (690:24): [True: 32.3k, False: 8.09k]
  ------------------
  691|  32.3k|            {
  692|  32.3k|                WORD16 ai2_tmp[64] = {0};
  693|  32.3k|                WORD16 *pi16_levelBlock =
  694|  32.3k|                    pi2_y_coeff + (i << 6); /* move to the next 8x8 adding 64 */
  695|       |
  696|  32.3k|                WORD16 *pi2_out =
  697|  32.3k|                    pi2_luma_res_ptr + ((i & 0x1) * BLK8x8SIZE) + (i >> 1) * (u2_luma_stride << 3);
  ------------------
  |  |  555|  32.3k|#define BLK8x8SIZE          8
  ------------------
  698|  32.3k|                if(CHECKBIT(ps_cur_mb_info->u1_cbp, i))
  ------------------
  |  |   54|  32.3k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 20.4k, False: 11.9k]
  |  |  ------------------
  ------------------
  699|  20.4k|                {
  700|  20.4k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  20.4k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
  701|  20.4k|                    {
  702|  20.4k|                        if(CHECKBIT(u4_luma_dc_only_cbp, i))
  ------------------
  |  |   54|  20.4k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 6.30k, False: 14.1k]
  |  |  ------------------
  ------------------
  703|  6.30k|                        {
  704|  6.30k|                            ps_svc_lyr_dec->pf_iquant_itrans_luma_8x8_dc(
  705|  6.30k|                                pi16_levelBlock, pi2_out, u2_luma_stride,
  706|  6.30k|                                gau1_ih264d_dequant8x8_cavlc[ps_cur_mb_info->u1_qp_rem6],
  707|  6.30k|                                (UWORD16 *) pi2_scale_matrix_ptr, ps_cur_mb_info->u1_qp_div6,
  708|  6.30k|                                ai2_tmp, 0, NULL);
  709|  6.30k|                        }
  710|  14.1k|                        else
  711|  14.1k|                        {
  712|  14.1k|                            ps_svc_lyr_dec->pf_iquant_itrans_luma_8x8(
  713|  14.1k|                                pi16_levelBlock, pi2_out, u2_luma_stride,
  714|  14.1k|                                gau1_ih264d_dequant8x8_cavlc[ps_cur_mb_info->u1_qp_rem6],
  715|  14.1k|                                (UWORD16 *) pi2_scale_matrix_ptr, ps_cur_mb_info->u1_qp_div6,
  716|  14.1k|                                ai2_tmp, 0, NULL);
  717|  14.1k|                        }
  718|  20.4k|                    }
  719|  20.4k|                }
  720|  32.3k|            }
  721|  8.09k|        }
  722|  19.6k|    }
  723|       |
  724|       |    /* Decode Chroma Block */
  725|  87.1k|    ih264d_unpack_chroma_coeff4x4_mb(ps_dec, ps_cur_mb_info);
  726|       |    /*--------------------------------------------------------------------*/
  727|       |    /* Chroma Blocks decoding                                             */
  728|       |    /*--------------------------------------------------------------------*/
  729|  87.1k|    {
  730|  87.1k|        UWORD8 u1_chroma_cbp = (UWORD8) (ps_cur_mb_info->u1_cbp >> 4);
  731|       |
  732|  87.1k|        if(u1_chroma_cbp != CBPC_ALLZERO)
  ------------------
  |  |  507|  87.1k|#define CBPC_ALLZERO    0
  ------------------
  |  Branch (732:12): [True: 9.57k, False: 77.6k]
  ------------------
  733|  9.57k|        {
  734|  9.57k|            UWORD32 u4_scale_u = ps_cur_mb_info->u1_qpc_div6;
  735|  9.57k|            UWORD32 u4_scale_v = ps_cur_mb_info->u1_qpcr_div6;
  736|  9.57k|            UWORD16 u2_chroma_csbp = ps_cur_mb_info->u2_chroma_csbp;
  737|       |
  738|  9.57k|            pi2_y_coeff = ps_dec->pi2_coeff_data;
  739|       |
  740|  9.57k|            {
  741|  9.57k|                UWORD32 i;
  742|  9.57k|                WORD16 ai2_tmp[16] = {0};
  743|  47.8k|                for(i = 0; i < 4; i++)
  ------------------
  |  Branch (743:28): [True: 38.2k, False: 9.57k]
  ------------------
  744|  38.2k|                {
  745|  38.2k|                    WORD16 *pi2_level = pi2_y_coeff + (i << 4);
  746|  38.2k|                    WORD16 *pi2_out = pi2_chroma_res_ptr +
  747|  38.2k|                                      ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR) +
  ------------------
  |  |  556|  38.2k|#define BLK_SIZE             4
  ------------------
                                                    ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR) +
  ------------------
  |  |  119|  38.2k|#define YUV420SP_FACTOR 2
  ------------------
  748|  38.2k|                                      (i >> 1) * (u2_chroma_stride << 2);
  749|  38.2k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  38.2k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
  750|  38.2k|                    {
  751|  38.2k|                        if(CHECKBIT(u2_chroma_csbp, i))
  ------------------
  |  |   54|  38.2k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 6.09k, False: 32.2k]
  |  |  ------------------
  ------------------
  752|  6.09k|                        {
  753|  6.09k|                            ps_svc_lyr_dec->pf_iquant_itrans_chroma_4x4(
  754|  6.09k|                                pi2_level, pi2_out, u2_chroma_stride,
  755|  6.09k|                                gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpc_rem6],
  756|  6.09k|                                (UWORD16 *) ps_dec->s_high_profile.i2_scalinglist4x4[4], u4_scale_u,
  757|  6.09k|                                ai2_tmp, pi2_level);
  758|  6.09k|                        }
  759|  32.2k|                        else if(pi2_level[0] != 0)
  ------------------
  |  Branch (759:33): [True: 16.1k, False: 16.0k]
  ------------------
  760|  16.1k|                        {
  761|  16.1k|                            ps_svc_lyr_dec->pf_iquant_itrans_chroma_4x4_dc(
  762|  16.1k|                                pi2_level, pi2_out, u2_chroma_stride,
  763|  16.1k|                                gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpc_rem6],
  764|  16.1k|                                (UWORD16 *) ps_dec->s_high_profile.i2_scalinglist4x4[4], u4_scale_u,
  765|  16.1k|                                ai2_tmp, pi2_level);
  766|  16.1k|                        }
  767|  38.2k|                    }
  768|  38.2k|                }
  769|  9.57k|            }
  770|       |
  771|  9.57k|            pi2_y_coeff += MB_CHROM_SIZE;
  ------------------
  |  |  564|  9.57k|#define MB_CHROM_SIZE                 64
  ------------------
  772|  9.57k|            u2_chroma_csbp >>= 4;
  773|       |
  774|  9.57k|            {
  775|  9.57k|                UWORD32 i;
  776|  9.57k|                WORD16 ai2_tmp[16] = {0};
  777|  47.8k|                for(i = 0; i < 4; i++)
  ------------------
  |  Branch (777:28): [True: 38.2k, False: 9.57k]
  ------------------
  778|  38.2k|                {
  779|  38.2k|                    WORD16 *pi2_level = pi2_y_coeff + (i << 4);
  780|  38.2k|                    WORD16 *pi2_out = pi2_chroma_res_ptr + 1 +
  781|  38.2k|                                      ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR) +
  ------------------
  |  |  556|  38.2k|#define BLK_SIZE             4
  ------------------
                                                    ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR) +
  ------------------
  |  |  119|  38.2k|#define YUV420SP_FACTOR 2
  ------------------
  782|  38.2k|                                      (i >> 1) * (u2_chroma_stride << 2);
  783|  38.2k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  38.2k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
  784|  38.2k|                    {
  785|  38.2k|                        if(CHECKBIT(u2_chroma_csbp, i))
  ------------------
  |  |   54|  38.2k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 7.07k, False: 31.2k]
  |  |  ------------------
  ------------------
  786|  7.07k|                        {
  787|  7.07k|                            ps_svc_lyr_dec->pf_iquant_itrans_chroma_4x4(
  788|  7.07k|                                pi2_level, pi2_out, u2_chroma_stride,
  789|  7.07k|                                gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpcr_rem6],
  790|  7.07k|                                (UWORD16 *) ps_dec->s_high_profile.i2_scalinglist4x4[5], u4_scale_v,
  791|  7.07k|                                ai2_tmp, pi2_level);
  792|  7.07k|                        }
  793|  31.2k|                        else if(pi2_level[0] != 0)
  ------------------
  |  Branch (793:33): [True: 14.8k, False: 16.3k]
  ------------------
  794|  14.8k|                        {
  795|  14.8k|                            ps_svc_lyr_dec->pf_iquant_itrans_chroma_4x4_dc(
  796|  14.8k|                                pi2_level, pi2_out, u2_chroma_stride,
  797|  14.8k|                                gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpcr_rem6],
  798|  14.8k|                                (UWORD16 *) ps_dec->s_high_profile.i2_scalinglist4x4[5], u4_scale_v,
  799|  14.8k|                                ai2_tmp, pi2_level);
  800|  14.8k|                        }
  801|  38.2k|                    }
  802|  38.2k|                }
  803|  9.57k|            }
  804|  9.57k|        }
  805|  87.1k|    }
  806|       |
  807|  87.1k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
  808|  87.1k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start + ps_cur_mb_info->u2_mbx +
  809|  87.1k|        (ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride * (ps_cur_mb_info->u2_mby));
  810|  87.1k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_mb_mode =
  811|  87.1k|        u1_inference_mode ? SVC_IBL_MB : SVC_INTER_MB;
  ------------------
  |  |  117|      0|#define SVC_IBL_MB (1 << 3)         /*!< I_BL MB always inferred */
  ------------------
                      u1_inference_mode ? SVC_IBL_MB : SVC_INTER_MB;
  ------------------
  |  |  114|   174k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (811:9): [True: 0, False: 87.1k]
  ------------------
  812|  87.1k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_tx_size = ps_cur_mb_info->u1_tran_form8x8;
  813|  87.1k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u2_luma_nnz = ps_cur_mb_info->u2_luma_csbp;
  814|  87.1k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz =
  815|  87.1k|        (UWORD8) ps_cur_mb_info->u2_chroma_csbp;
  816|  87.1k|    if(CHECKBIT(ps_cur_mb_info->u1_yuv_dc_block_flag, 1))
  ------------------
  |  |   54|  87.1k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 5.48k, False: 81.7k]
  |  |  ------------------
  ------------------
  817|  5.48k|    {
  818|       |        /* Four bits for Cb in DC only cbp */
  819|  5.48k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz |= 0x0F;
  820|  5.48k|    }
  821|  87.1k|    if(CHECKBIT(ps_cur_mb_info->u1_yuv_dc_block_flag, 2))
  ------------------
  |  |   54|  87.1k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 5.50k, False: 81.6k]
  |  |  ------------------
  ------------------
  822|  5.50k|    {
  823|       |        /* Four bits for Cr in DC only cbp */
  824|  5.50k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz |= 0xF0;
  825|  5.50k|    }
  826|  87.1k|    return OK;
  ------------------
  |  |  114|  87.1k|#define OK        0
  ------------------
  827|  87.1k|}
isvcd_process_ii_mb:
 1120|   133k|{
 1121|   133k|    res_prms_t *ps_res_prms;
 1122|   133k|    WORD32 i4_status;
 1123|   133k|    UWORD8 u1_ii_mb_mode = 0;
 1124|   133k|    mb_coord_t s_mb_coord = {0};
 1125|   133k|    mem_element_t s_ref_mb_mode = {0};
 1126|   133k|    svc_dec_lyr_struct_t *ps_svc_dec_ref_layer;
 1127|       |
 1128|   133k|    ps_svc_dec_ref_layer = ps_svc_lyr_dec->ps_dec_svc_ref_layer;
 1129|   133k|    ps_res_prms = &ps_svc_lyr_dec->s_res_prms;
 1130|   133k|    s_mb_coord.u2_mb_x = ps_cur_mb_info->u2_mbx;
 1131|   133k|    s_mb_coord.u2_mb_y = ps_cur_mb_info->u2_mby;
 1132|       |
 1133|       |    /* Restricted resolution change has significance only */
 1134|       |    /* at resolution change layer                         */
 1135|   133k|    if(SVCD_FALSE == ps_res_prms->u1_rstrct_res_change_flag)
  ------------------
  |  |   45|   133k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1135:8): [True: 133k, False: 0]
  ------------------
 1136|   133k|    {
 1137|   133k|        s_ref_mb_mode.pv_buffer = ps_svc_dec_ref_layer->ps_inter_lyr_mb_prms_frm_start;
 1138|   133k|        s_ref_mb_mode.i4_element_size = sizeof(inter_lyr_mb_prms_t);
 1139|   133k|        s_ref_mb_mode.i4_num_element_stride = ps_svc_dec_ref_layer->u2_inter_lyr_mb_prms_stride;
 1140|       |
 1141|   133k|        i4_status = isvcd_ii_pred_compute_flags_mb(ps_svc_lyr_dec->pv_ii_pred_ctxt, &s_ref_mb_mode,
 1142|   133k|                                                   &s_mb_coord, ps_cur_mb_info, ps_svc_cur_mb_info,
 1143|   133k|                                                   &u1_ii_mb_mode);
 1144|       |
 1145|   133k|        if(OK != i4_status)
  ------------------
  |  |  114|   133k|#define OK        0
  ------------------
  |  Branch (1145:12): [True: 0, False: 133k]
  ------------------
 1146|      0|        {
 1147|      0|            return i4_status;
 1148|      0|        }
 1149|   133k|    }
 1150|       |
 1151|   133k|    if(SVC_INTRA_INTER_MB == u1_ii_mb_mode)
  ------------------
  |  |  118|   133k|#define SVC_INTRA_INTER_MB (1 << 4) /*!< Intra Inter MB */
  ------------------
  |  Branch (1151:8): [True: 15.1k, False: 117k]
  ------------------
 1152|  15.1k|    {
 1153|  15.1k|        i4_status = isvcd_process_ibl_mb(ps_svc_lyr_dec, ps_cur_mb_info, u1_mb_num, 1);
 1154|  15.1k|        if(OK != i4_status)
  ------------------
  |  |  114|  15.1k|#define OK        0
  ------------------
  |  Branch (1154:12): [True: 0, False: 15.1k]
  ------------------
 1155|      0|        {
 1156|      0|            return i4_status;
 1157|      0|        }
 1158|  15.1k|        isvcd_ii_pred_mb(ps_svc_lyr_dec, ps_cur_mb_info);
 1159|  15.1k|    }
 1160|   133k|    return OK;
  ------------------
  |  |  114|   133k|#define OK        0
  ------------------
 1161|   133k|}
isvcd_decode_recon_tfr_nmb_non_base_lyr:
 1177|  43.8k|{
 1178|  43.8k|    WORD32 i, j;
 1179|  43.8k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1180|  43.8k|    UWORD32 u1_end_of_row_next;
 1181|  43.8k|    dec_mb_info_t *ps_cur_mb_info;
 1182|  43.8k|    dec_svc_mb_info_t *ps_svc_cur_mb_info;
 1183|  43.8k|    UWORD16 *pu2_res_luma_csbp;
 1184|  43.8k|    const UWORD32 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 1185|  43.8k|    const UWORD32 u1_slice_type = ps_dec->ps_cur_slice->u1_slice_type;
 1186|  43.8k|    const WORD32 u1_skip_th =
 1187|  43.8k|        ((u1_slice_type != I_SLICE) ? (ps_dec->u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  370|  43.8k|#define I_SLICE  2
  ------------------
                      ((u1_slice_type != I_SLICE) ? (ps_dec->u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  480|  12.9k|#define B_8x8    22
  ------------------
                      ((u1_slice_type != I_SLICE) ? (ps_dec->u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  454|  21.6k|#define PRED_8x8R0  4
  ------------------
  |  Branch (1187:10): [True: 34.5k, False: 9.25k]
  |  Branch (1187:40): [True: 12.9k, False: 21.6k]
  ------------------
 1188|  43.8k|    const UWORD32 u1_ipcm_th = ((u1_slice_type != I_SLICE) ? (ps_dec->u1_B ? 23 : 5) : 0);
  ------------------
  |  |  370|  43.8k|#define I_SLICE  2
  ------------------
  |  Branch (1188:33): [True: 34.5k, False: 9.25k]
  |  Branch (1188:63): [True: 12.9k, False: 21.6k]
  ------------------
 1189|  43.8k|    WORD32 ret = OK;
  ------------------
  |  |  114|  43.8k|#define OK        0
  ------------------
 1190|       |
 1191|  43.8k|    if(!((0 == ps_svc_lyr_dec->u1_base_res_flag) ||
  ------------------
  |  Branch (1191:10): [True: 43.8k, False: 0]
  ------------------
 1192|      0|         ((1 == ps_svc_lyr_dec->u1_base_res_flag) &&
  ------------------
  |  Branch (1192:11): [True: 0, False: 0]
  ------------------
 1193|      0|          (1 == ps_svc_lyr_dec->ps_nal_svc_ext->u1_no_inter_layer_pred_flag))))
  ------------------
  |  Branch (1193:11): [True: 0, False: 0]
  ------------------
 1194|      0|    {
 1195|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1196|      0|    }
 1197|       |    /* N Mb MC Loop */
 1198|   195k|    for(i = u4_mb_idx; i < u4_num_mbs; i++)
  ------------------
  |  Branch (1198:24): [True: 151k, False: 43.8k]
  ------------------
 1199|   151k|    {
 1200|   151k|        ps_cur_mb_info = ps_dec->ps_nmb_info + i;
 1201|   151k|        ps_dec->u4_dma_buf_idx = 0;
 1202|   151k|        ps_dec->u4_pred_info_idx = 0;
 1203|       |
 1204|       |        /*Pointer assignment for Residual NNZ */
 1205|   151k|        pu2_res_luma_csbp = ps_svc_lyr_dec->pu2_frm_res_luma_csbp + ps_cur_mb_info->u2_mbx;
 1206|   151k|        pu2_res_luma_csbp += ps_cur_mb_info->u2_mby * ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride;
 1207|       |
 1208|   151k|        if(ps_cur_mb_info->u1_mb_type <= u1_skip_th)
  ------------------
  |  Branch (1208:12): [True: 66.2k, False: 85.4k]
  ------------------
 1209|  66.2k|        {
 1210|  66.2k|            {
 1211|  66.2k|                WORD32 pred_cnt = 0;
 1212|  66.2k|                pred_info_pkd_t *ps_pred_pkd;
 1213|  66.2k|                UWORD32 u4_pred_info_pkd_idx;
 1214|       |
 1215|  66.2k|                u4_pred_info_pkd_idx = ps_cur_mb_info->u4_pred_info_pkd_idx;
 1216|       |
 1217|   181k|                while(pred_cnt < ps_cur_mb_info->u1_num_pred_parts)
  ------------------
  |  Branch (1217:23): [True: 114k, False: 66.2k]
  ------------------
 1218|   114k|                {
 1219|   114k|                    ps_pred_pkd = ps_dec->ps_pred_pkd + u4_pred_info_pkd_idx;
 1220|       |
 1221|   114k|                    ps_dec->p_form_mb_part_info(ps_pred_pkd, ps_dec, ps_cur_mb_info->u2_mbx,
 1222|   114k|                                                ps_cur_mb_info->u2_mby, (i >> u1_mbaff),
 1223|   114k|                                                ps_cur_mb_info);
 1224|   114k|                    u4_pred_info_pkd_idx++;
 1225|   114k|                    pred_cnt++;
 1226|   114k|                }
 1227|  66.2k|            }
 1228|  66.2k|            if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|  66.2k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1228:16): [True: 66.2k, False: 0]
  ------------------
 1229|  66.2k|            {
 1230|  66.2k|                ps_dec->p_motion_compensate(ps_dec, ps_cur_mb_info);
 1231|  66.2k|            }
 1232|  66.2k|        }
 1233|  85.4k|        else if(ps_cur_mb_info->u1_mb_type == MB_SKIP)
  ------------------
  |  |   59|  85.4k|#define MB_SKIP 255
  ------------------
  |  Branch (1233:17): [True: 44.3k, False: 41.0k]
  ------------------
 1234|  44.3k|        {
 1235|  44.3k|            {
 1236|  44.3k|                WORD32 pred_cnt = 0;
 1237|  44.3k|                pred_info_pkd_t *ps_pred_pkd;
 1238|  44.3k|                UWORD32 u4_pred_info_pkd_idx;
 1239|       |
 1240|  44.3k|                u4_pred_info_pkd_idx = ps_cur_mb_info->u4_pred_info_pkd_idx;
 1241|       |
 1242|   109k|                while(pred_cnt < ps_cur_mb_info->u1_num_pred_parts)
  ------------------
  |  Branch (1242:23): [True: 65.3k, False: 44.3k]
  ------------------
 1243|  65.3k|                {
 1244|  65.3k|                    ps_pred_pkd = ps_dec->ps_pred_pkd + u4_pred_info_pkd_idx;
 1245|       |
 1246|  65.3k|                    ps_dec->p_form_mb_part_info(ps_pred_pkd, ps_dec, ps_cur_mb_info->u2_mbx,
 1247|  65.3k|                                                ps_cur_mb_info->u2_mby, (i >> u1_mbaff),
 1248|  65.3k|                                                ps_cur_mb_info);
 1249|       |
 1250|  65.3k|                    u4_pred_info_pkd_idx++;
 1251|  65.3k|                    pred_cnt++;
 1252|  65.3k|                }
 1253|  44.3k|            }
 1254|  44.3k|            if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|  44.3k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1254:16): [True: 44.3k, False: 0]
  ------------------
 1255|  44.3k|            {
 1256|       |                /* Decode MB skip */
 1257|  44.3k|                ps_dec->p_motion_compensate(ps_dec, ps_cur_mb_info);
 1258|  44.3k|            }
 1259|       |
 1260|  44.3k|            *pu2_res_luma_csbp = 0;
 1261|  44.3k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
 1262|  44.3k|                ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start + ps_cur_mb_info->u2_mbx +
 1263|  44.3k|                (ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride * (ps_cur_mb_info->u2_mby));
 1264|  44.3k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_mb_mode = SVC_INTER_MB;
  ------------------
  |  |  114|  44.3k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
 1265|  44.3k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_tx_size =
 1266|  44.3k|                ps_cur_mb_info->u1_tran_form8x8;
 1267|  44.3k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u2_luma_nnz = 0;
 1268|  44.3k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz = 0;
 1269|  44.3k|        }
 1270|   151k|    }
 1271|       |
 1272|       |    /* N Mb IQ IT RECON  Loop */
 1273|   195k|    for(j = u4_mb_idx; j < i; j++)
  ------------------
  |  Branch (1273:24): [True: 151k, False: 43.8k]
  ------------------
 1274|   151k|    {
 1275|   151k|        ps_cur_mb_info = ps_dec->ps_nmb_info + j;
 1276|   151k|        ps_svc_cur_mb_info = ps_svc_lyr_dec->ps_svc_nmb_info + j;
 1277|       |
 1278|   151k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
 1279|   151k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start + ps_cur_mb_info->u2_mbx +
 1280|   151k|            (ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride * (ps_cur_mb_info->u2_mby));
 1281|       |
 1282|   151k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_slice_id = (WORD8) ps_dec->u2_cur_slice_num;
 1283|       |
 1284|       |        /*Pointer assignment for Residual NNZ */
 1285|   151k|        pu2_res_luma_csbp = ps_svc_lyr_dec->pu2_frm_res_luma_csbp + ps_cur_mb_info->u2_mbx;
 1286|   151k|        pu2_res_luma_csbp += ps_cur_mb_info->u2_mby * ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride;
 1287|       |
 1288|   151k|        if(ps_cur_mb_info->u1_mb_type <= u1_skip_th)
  ------------------
  |  Branch (1288:12): [True: 66.2k, False: 85.4k]
  ------------------
 1289|  66.2k|        {
 1290|  66.2k|            if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|  66.2k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1290:16): [True: 66.2k, False: 0]
  ------------------
 1291|  66.2k|            {
 1292|       |                /* inter intra pred generation */
 1293|  66.2k|                if(SVCD_FALSE == ps_svc_lyr_dec->u1_dyadic_flag)
  ------------------
  |  |   45|  66.2k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1293:20): [True: 29.4k, False: 36.8k]
  ------------------
 1294|  29.4k|                {
 1295|  29.4k|                    ret =
 1296|  29.4k|                        isvcd_process_ii_mb(ps_svc_lyr_dec, ps_cur_mb_info, ps_svc_cur_mb_info, j);
 1297|  29.4k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  29.4k|#define OK        0
  ------------------
  |  Branch (1297:24): [True: 0, False: 29.4k]
  ------------------
 1298|  29.4k|                }
 1299|  66.2k|                if(0 == ps_svc_cur_mb_info->u1_residual_prediction_flag)
  ------------------
  |  Branch (1299:20): [True: 21.8k, False: 44.4k]
  ------------------
 1300|  21.8k|                {
 1301|       |                    // IT + Recon
 1302|  21.8k|                    ih264d_process_inter_mb(ps_dec, ps_cur_mb_info, j);
 1303|  21.8k|                    isvcd_update_inter_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info, 0);
 1304|  21.8k|                    *pu2_res_luma_csbp = ps_cur_mb_info->u2_luma_csbp;
 1305|  21.8k|                }
 1306|  44.4k|                else
 1307|  44.4k|                {
 1308|       |                    // IT + Residual + Recon
 1309|  44.4k|                    ret = isvcd_process_inter_mb_rsd_pred_target_lyr(ps_svc_lyr_dec, ps_cur_mb_info,
 1310|  44.4k|                                                                     j, 0, pu2_res_luma_csbp);
 1311|  44.4k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  44.4k|#define OK        0
  ------------------
  |  Branch (1311:24): [True: 0, False: 44.4k]
  ------------------
 1312|  44.4k|                }
 1313|  66.2k|            }
 1314|      0|            else if(ps_svc_lyr_dec->u1_layer_identifier == MEDIAL_ENHANCEMENT_LAYER)
  ------------------
  |  |  109|      0|#define MEDIAL_ENHANCEMENT_LAYER 1
  ------------------
  |  Branch (1314:21): [True: 0, False: 0]
  ------------------
 1315|      0|            {
 1316|      0|                if(0 == ps_svc_cur_mb_info->u1_residual_prediction_flag)
  ------------------
  |  Branch (1316:20): [True: 0, False: 0]
  ------------------
 1317|      0|                {
 1318|       |                    // IT : to be consumed by Target
 1319|      0|                    ret = isvcd_process_inter_mb_no_rsd_pred_non_target(ps_svc_lyr_dec,
 1320|      0|                                                                        ps_cur_mb_info, 0);
 1321|      0|                    *pu2_res_luma_csbp = ps_cur_mb_info->u2_luma_csbp;
 1322|      0|                    if(ret != OK) return ret;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (1322:24): [True: 0, False: 0]
  ------------------
 1323|      0|                }
 1324|      0|                else
 1325|      0|                {
 1326|       |                    // IT + Residual : to be consumed by target
 1327|      0|                    ret = isvcd_process_inter_mb_rsd_pred_non_target(ps_svc_lyr_dec, ps_cur_mb_info,
 1328|      0|                                                                     0, pu2_res_luma_csbp);
 1329|      0|                    if(ret != OK) return ret;
  ------------------
  |  |  114|      0|#define OK        0
  ------------------
  |  Branch (1329:24): [True: 0, False: 0]
  ------------------
 1330|      0|                }
 1331|      0|            }
 1332|      0|            else
 1333|      0|            {
 1334|      0|                return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1335|      0|            }
 1336|  66.2k|        }
 1337|  85.4k|        else if((ps_cur_mb_info->u1_mb_type != MB_SKIP) && (ps_cur_mb_info->u1_mb_type != MB_INFER))
  ------------------
  |  |   59|  85.4k|#define MB_SKIP 255
  ------------------
                      else if((ps_cur_mb_info->u1_mb_type != MB_SKIP) && (ps_cur_mb_info->u1_mb_type != MB_INFER))
  ------------------
  |  |  112|  41.0k|#define MB_INFER 250
  ------------------
  |  Branch (1337:17): [True: 41.0k, False: 44.3k]
  |  Branch (1337:60): [True: 11.4k, False: 29.6k]
  ------------------
 1338|  11.4k|        {
 1339|  11.4k|            if((u1_ipcm_th + 25) != ps_cur_mb_info->u1_mb_type)
  ------------------
  |  Branch (1339:16): [True: 11.2k, False: 138]
  ------------------
 1340|  11.2k|            {
 1341|  11.2k|                ps_cur_mb_info->u1_mb_type -= (u1_skip_th + 1);
 1342|  11.2k|                ih264d_process_intra_mb(ps_dec, ps_cur_mb_info, j);
 1343|  11.2k|                isvcd_update_intra_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info);
 1344|  11.2k|            }
 1345|    138|            else
 1346|    138|            {
 1347|    138|                isvcd_update_ipcm_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info);
 1348|    138|            }
 1349|  11.4k|            *pu2_res_luma_csbp = 0;
 1350|  11.4k|        }
 1351|  74.0k|        else if(ps_cur_mb_info->u1_mb_type == MB_INFER)
  ------------------
  |  |  112|  74.0k|#define MB_INFER 250
  ------------------
  |  Branch (1351:17): [True: 29.6k, False: 44.3k]
  ------------------
 1352|  29.6k|        {
 1353|       |            /* inter layer intra prediction : intra upsample, IQ, IT ,deblock */
 1354|       |            /* Intra resample for IBL mode */
 1355|  29.6k|            ret = isvcd_process_ibl_mb(ps_svc_lyr_dec, ps_cur_mb_info, j, 0);
 1356|  29.6k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  29.6k|#define OK        0
  ------------------
  |  Branch (1356:16): [True: 0, False: 29.6k]
  ------------------
 1357|  29.6k|            ih264d_process_inter_mb(ps_dec, ps_cur_mb_info, j);
 1358|  29.6k|            isvcd_update_inter_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info, 1);
 1359|  29.6k|            *pu2_res_luma_csbp = ps_cur_mb_info->u2_luma_csbp;
 1360|       |
 1361|  29.6k|            ps_dec->pi1_left_pred_mode[0] = DC;
  ------------------
  |  |  431|  29.6k|#define DC      2
  ------------------
 1362|  29.6k|            ps_dec->pi1_left_pred_mode[1] = DC;
  ------------------
  |  |  431|  29.6k|#define DC      2
  ------------------
 1363|  29.6k|            ps_dec->pi1_left_pred_mode[2] = DC;
  ------------------
  |  |  431|  29.6k|#define DC      2
  ------------------
 1364|  29.6k|            ps_dec->pi1_left_pred_mode[3] = DC;
  ------------------
  |  |  431|  29.6k|#define DC      2
  ------------------
 1365|       |
 1366|  29.6k|            ps_cur_mb_info->ps_curmb->pi1_intrapredmodes[0] = DC;
  ------------------
  |  |  431|  29.6k|#define DC      2
  ------------------
 1367|  29.6k|            ps_cur_mb_info->ps_curmb->pi1_intrapredmodes[1] = DC;
  ------------------
  |  |  431|  29.6k|#define DC      2
  ------------------
 1368|  29.6k|            ps_cur_mb_info->ps_curmb->pi1_intrapredmodes[2] = DC;
  ------------------
  |  |  431|  29.6k|#define DC      2
  ------------------
 1369|  29.6k|            ps_cur_mb_info->ps_curmb->pi1_intrapredmodes[3] = DC;
  ------------------
  |  |  431|  29.6k|#define DC      2
  ------------------
 1370|       |
 1371|  29.6k|            isvcd_update_ibl_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info);
 1372|  29.6k|        }
 1373|       |
 1374|   151k|        if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|   151k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1374:12): [True: 151k, False: 0]
  ------------------
 1375|   151k|        {
 1376|   151k|            if(ps_dec->u4_num_cores < 3)
  ------------------
  |  Branch (1376:16): [True: 151k, False: 0]
  ------------------
 1377|   151k|            {
 1378|   151k|                if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (1378:20): [True: 151k, False: 0]
  ------------------
 1379|   151k|                    ps_svc_lyr_dec->pf_svc_compute_bs(ps_svc_lyr_dec, ps_cur_mb_info,
 1380|   151k|                                                      (UWORD16) (j >> u1_mbaff));
 1381|   151k|            }
 1382|   151k|        }
 1383|      0|        else if(ps_svc_lyr_dec->u1_layer_identifier == MEDIAL_ENHANCEMENT_LAYER)
  ------------------
  |  |  109|      0|#define MEDIAL_ENHANCEMENT_LAYER 1
  ------------------
  |  Branch (1383:17): [True: 0, False: 0]
  ------------------
 1384|      0|        {
 1385|      0|            if(ps_dec->u4_num_cores < 3)
  ------------------
  |  Branch (1385:16): [True: 0, False: 0]
  ------------------
 1386|      0|            {
 1387|      0|                if(ps_dec->u4_app_disable_deblk_frm == 0)
  ------------------
  |  Branch (1387:20): [True: 0, False: 0]
  ------------------
 1388|      0|                    ps_svc_lyr_dec->pf_svc_compute_bs(ps_svc_lyr_dec, ps_cur_mb_info,
 1389|      0|                                                      (UWORD16) (j >> u1_mbaff));
 1390|      0|            }
 1391|      0|        }
 1392|       |
 1393|   151k|        if(ps_dec->u4_use_intrapred_line_copy)
  ------------------
  |  Branch (1393:12): [True: 151k, False: 0]
  ------------------
 1394|   151k|        {
 1395|   151k|            ih264d_copy_intra_pred_line(ps_dec, ps_cur_mb_info, j);
 1396|   151k|        }
 1397|   151k|    }
 1398|       |
 1399|       |    /*MB deblocking*/
 1400|  43.8k|    if(ps_dec->u4_nmb_deblk == 1)
  ------------------
  |  Branch (1400:8): [True: 43.8k, False: 0]
  ------------------
 1401|  43.8k|    {
 1402|  43.8k|        UWORD32 u4_wd_y, u4_wd_uv;
 1403|  43.8k|        tfr_ctxt_t *ps_tfr_cxt = &(ps_dec->s_tran_addrecon);
 1404|  43.8k|        UWORD8 u1_field_pic_flag = ps_dec->ps_cur_slice->u1_field_pic_flag;
 1405|  43.8k|        const WORD32 i4_cb_qp_idx_ofst = ps_dec->ps_cur_pps->i1_chroma_qp_index_offset;
 1406|  43.8k|        const WORD32 i4_cr_qp_idx_ofst = ps_dec->ps_cur_pps->i1_second_chroma_qp_index_offset;
 1407|       |
 1408|  43.8k|        u4_wd_y = ps_dec->u2_frm_wd_y << u1_field_pic_flag;
 1409|  43.8k|        u4_wd_uv = ps_dec->u2_frm_wd_uv << u1_field_pic_flag;
 1410|       |
 1411|  43.8k|        ps_cur_mb_info = ps_dec->ps_nmb_info + u4_mb_idx;
 1412|       |
 1413|  43.8k|        ps_dec->u4_deblk_mb_x = ps_cur_mb_info->u2_mbx;
 1414|  43.8k|        ps_dec->u4_deblk_mb_y = ps_cur_mb_info->u2_mby;
 1415|       |
 1416|   195k|        for(j = u4_mb_idx; j < i; j++)
  ------------------
  |  Branch (1416:28): [True: 151k, False: 43.8k]
  ------------------
 1417|   151k|        {
 1418|   151k|            if(ps_dec->u4_cur_deblk_mb_num > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (1418:16): [True: 0, False: 151k]
  ------------------
 1419|      0|            {
 1420|      0|                return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1421|      0|            }
 1422|   151k|            ih264d_deblock_mb_nonmbaff(ps_dec, ps_tfr_cxt, i4_cb_qp_idx_ofst, i4_cr_qp_idx_ofst,
 1423|   151k|                                       u4_wd_y, u4_wd_uv);
 1424|   151k|        }
 1425|  43.8k|    }
 1426|       |
 1427|  43.8k|    if(u4_tfr_n_mb)
  ------------------
  |  Branch (1427:8): [True: 43.8k, False: 0]
  ------------------
 1428|  43.8k|    {
 1429|       |        /****************************************************************/
 1430|       |        /* Check for End Of Row in Next iteration                       */
 1431|       |        /****************************************************************/
 1432|  43.8k|        u1_end_of_row_next =
 1433|  43.8k|            u4_num_mbs_next && (u4_num_mbs_next <= (ps_dec->u4_recon_mb_grp >> u1_mbaff));
  ------------------
  |  Branch (1433:13): [True: 1.73k, False: 42.1k]
  |  Branch (1433:32): [True: 1.73k, False: 0]
  ------------------
 1434|       |
 1435|       |        /****************************************************************/
 1436|       |        /* Transfer the Following things                                */
 1437|       |        /* N-Mb DeblkParams Data    ( To Ext DeblkParams Buffer )       */
 1438|       |        /* N-Mb Recon Data          ( To Ext Frame Buffer )             */
 1439|       |        /* N-Mb Intrapredline Data  ( Updated Internally)               */
 1440|       |        /* N-Mb MV Data             ( To Ext MV Buffer )                */
 1441|       |        /* N-Mb MVTop/TopRight Data ( To Int MV Top Scratch Buffers)    */
 1442|       |        /****************************************************************/
 1443|  43.8k|        ih264d_transfer_mb_group_data(ps_dec, u4_num_mbs, u4_end_of_row, u1_end_of_row_next);
 1444|  43.8k|        ps_dec->u4_num_mbs_prev_nmb = u4_num_mbs;
 1445|  43.8k|        ps_dec->u4_pred_info_idx = 0;
 1446|  43.8k|        ps_dec->u4_dma_buf_idx = 0;
 1447|  43.8k|    }
 1448|  43.8k|    return OK;
  ------------------
  |  |  114|  43.8k|#define OK        0
  ------------------
 1449|  43.8k|}
isvcd_decode_recon_tfr_nmb_base_lyr:
 1464|   276k|{
 1465|   276k|    WORD32 j;
 1466|   276k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1467|   276k|    UWORD32 u1_end_of_row_next;
 1468|   276k|    dec_mb_info_t *ps_cur_mb_info;
 1469|   276k|    const UWORD32 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 1470|   276k|    const UWORD32 u1_slice_type = ps_dec->ps_cur_slice->u1_slice_type;
 1471|   276k|    const WORD32 u1_skip_th =
 1472|   276k|        ((u1_slice_type != I_SLICE) ? (ps_dec->u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  370|   276k|#define I_SLICE  2
  ------------------
                      ((u1_slice_type != I_SLICE) ? (ps_dec->u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  480|  42.0k|#define B_8x8    22
  ------------------
                      ((u1_slice_type != I_SLICE) ? (ps_dec->u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  454|   231k|#define PRED_8x8R0  4
  ------------------
  |  Branch (1472:10): [True: 273k, False: 2.87k]
  |  Branch (1472:40): [True: 42.0k, False: 231k]
  ------------------
 1473|   276k|    const UWORD32 u1_ipcm_th = ((u1_slice_type != I_SLICE) ? (ps_dec->u1_B ? 23 : 5) : 0);
  ------------------
  |  |  370|   276k|#define I_SLICE  2
  ------------------
  |  Branch (1473:33): [True: 273k, False: 2.87k]
  |  Branch (1473:63): [True: 42.0k, False: 231k]
  ------------------
 1474|   276k|    WORD32 ret = OK;
  ------------------
  |  |  114|   276k|#define OK        0
  ------------------
 1475|       |
 1476|   276k|    if(1 != ps_svc_lyr_dec->u1_base_res_flag)
  ------------------
  |  Branch (1476:8): [True: 0, False: 276k]
  ------------------
 1477|      0|    {
 1478|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1479|      0|    }
 1480|   276k|    if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|   276k|#define TARGET_LAYER 2
  ------------------
  |  Branch (1480:8): [True: 0, False: 276k]
  ------------------
 1481|      0|    {
 1482|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1483|      0|    }
 1484|       |
 1485|       |    /* N Mb IQ IT + Residual Store for Inter / + Recon for Intra Loop */
 1486|  1.43M|    for(j = u1_mb_idx; j < u4_num_mbs; j++)
  ------------------
  |  Branch (1486:24): [True: 1.15M, False: 276k]
  ------------------
 1487|  1.15M|    {
 1488|  1.15M|        ps_dec->u4_dma_buf_idx = 0;
 1489|  1.15M|        ps_dec->u4_pred_info_idx = 0;
 1490|  1.15M|        ps_cur_mb_info = ps_dec->ps_nmb_info + j;
 1491|       |
 1492|  1.15M|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
 1493|  1.15M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start + ps_cur_mb_info->u2_mbx +
 1494|  1.15M|            (ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride * (ps_cur_mb_info->u2_mby));
 1495|       |
 1496|  1.15M|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_slice_id = (WORD8) ps_dec->u2_cur_slice_num;
 1497|       |
 1498|  1.15M|        if(ps_cur_mb_info->u1_mb_type == MB_SKIP)
  ------------------
  |  |   59|  1.15M|#define MB_SKIP 255
  ------------------
  |  Branch (1498:12): [True: 1.04M, False: 114k]
  ------------------
 1499|  1.04M|        {
 1500|  1.04M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_mb_mode = SVC_INTER_MB;
  ------------------
  |  |  114|  1.04M|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
 1501|  1.04M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_tx_size =
 1502|  1.04M|                ps_cur_mb_info->u1_tran_form8x8;
 1503|  1.04M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u2_luma_nnz = 0;
 1504|  1.04M|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz = 0;
 1505|  1.04M|        }
 1506|   114k|        else if(ps_cur_mb_info->u1_mb_type <= u1_skip_th)
  ------------------
  |  Branch (1506:17): [True: 87.1k, False: 27.5k]
  ------------------
 1507|  87.1k|        {
 1508|       |            /* Only IT : Store Residual (WORD16) for Higher Layers : Base layer*/
 1509|  87.1k|            ret = isvcd_process_inter_mb_no_rsd_pred_non_target(ps_svc_lyr_dec, ps_cur_mb_info, 0);
 1510|  87.1k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  87.1k|#define OK        0
  ------------------
  |  Branch (1510:16): [True: 0, False: 87.1k]
  ------------------
 1511|  87.1k|        }
 1512|  27.5k|        else if(ps_cur_mb_info->u1_mb_type != MB_SKIP)
  ------------------
  |  |   59|  27.5k|#define MB_SKIP 255
  ------------------
  |  Branch (1512:17): [True: 27.5k, False: 0]
  ------------------
 1513|  27.5k|        {
 1514|  27.5k|            if((u1_ipcm_th + 25) != ps_cur_mb_info->u1_mb_type)
  ------------------
  |  Branch (1514:16): [True: 26.6k, False: 861]
  ------------------
 1515|  26.6k|            {
 1516|  26.6k|                ps_cur_mb_info->u1_mb_type -= (u1_skip_th + 1);
 1517|  26.6k|                ih264d_process_intra_mb(ps_dec, ps_cur_mb_info, j);
 1518|  26.6k|                isvcd_update_intra_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info);
 1519|  26.6k|            }
 1520|    861|            else
 1521|    861|            {
 1522|    861|                isvcd_update_ipcm_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info);
 1523|    861|            }
 1524|  27.5k|        }
 1525|       |
 1526|  1.15M|        if(ps_dec->u4_use_intrapred_line_copy)
  ------------------
  |  Branch (1526:12): [True: 1.15M, False: 0]
  ------------------
 1527|  1.15M|        {
 1528|  1.15M|            ih264d_copy_intra_pred_line(ps_dec, ps_cur_mb_info, j);
 1529|  1.15M|        }
 1530|  1.15M|    }
 1531|       |
 1532|       |    /*MB deblocking*/
 1533|   276k|    if(ps_dec->u4_nmb_deblk == 1)
  ------------------
  |  Branch (1533:8): [True: 276k, False: 0]
  ------------------
 1534|   276k|    {
 1535|   276k|        UWORD32 u4_wd_y, u4_wd_uv;
 1536|   276k|        tfr_ctxt_t *ps_tfr_cxt = &(ps_dec->s_tran_addrecon);
 1537|   276k|        UWORD8 u1_field_pic_flag = ps_dec->ps_cur_slice->u1_field_pic_flag;
 1538|   276k|        const WORD32 i4_cb_qp_idx_ofst = ps_dec->ps_cur_pps->i1_chroma_qp_index_offset;
 1539|   276k|        const WORD32 i4_cr_qp_idx_ofst = ps_dec->ps_cur_pps->i1_second_chroma_qp_index_offset;
 1540|       |
 1541|   276k|        u4_wd_y = ps_dec->u2_frm_wd_y << u1_field_pic_flag;
 1542|   276k|        u4_wd_uv = ps_dec->u2_frm_wd_uv << u1_field_pic_flag;
 1543|       |
 1544|   276k|        ps_cur_mb_info = ps_dec->ps_nmb_info + u1_mb_idx;
 1545|       |
 1546|   276k|        ps_dec->u4_deblk_mb_x = ps_cur_mb_info->u2_mbx;
 1547|   276k|        ps_dec->u4_deblk_mb_y = ps_cur_mb_info->u2_mby;
 1548|       |
 1549|  1.43M|        for(j = u1_mb_idx; j < u4_num_mbs; j++)
  ------------------
  |  Branch (1549:28): [True: 1.15M, False: 276k]
  ------------------
 1550|  1.15M|        {
 1551|       |            /* IN SVC base layers only intra MB's Need to be deblocked*/
 1552|  1.15M|            deblk_mb_t *ps_top_mb, *ps_left_mb, *ps_cur_mb;
 1553|  1.15M|            ps_cur_mb = ps_dec->ps_cur_deblk_mb;
 1554|  1.15M|            if(!(ps_cur_mb->u1_deblocking_mode & MB_DISABLE_FILTERING))
  ------------------
  |  |   70|  1.15M|#define MB_DISABLE_FILTERING          0x01
  ------------------
  |  Branch (1554:16): [True: 27.5k, False: 1.12M]
  ------------------
 1555|  27.5k|            {
 1556|  27.5k|                if(ps_dec->u4_deblk_mb_x)
  ------------------
  |  Branch (1556:20): [True: 15.0k, False: 12.4k]
  ------------------
 1557|  15.0k|                {
 1558|  15.0k|                    ps_left_mb = ps_cur_mb - 1;
 1559|  15.0k|                }
 1560|  12.4k|                else
 1561|  12.4k|                {
 1562|  12.4k|                    ps_left_mb = NULL;
 1563|  12.4k|                }
 1564|  27.5k|                if(ps_dec->u4_deblk_mb_y != 0)
  ------------------
  |  Branch (1564:20): [True: 20.7k, False: 6.82k]
  ------------------
 1565|  20.7k|                {
 1566|  20.7k|                    ps_top_mb = ps_cur_mb - (ps_dec->u2_frm_wd_in_mbs);
 1567|  20.7k|                }
 1568|  6.82k|                else
 1569|  6.82k|                {
 1570|  6.82k|                    ps_top_mb = NULL;
 1571|  6.82k|                }
 1572|       |
 1573|  27.5k|                if(ps_cur_mb->u1_deblocking_mode & MB_DISABLE_LEFT_EDGE) ps_left_mb = NULL;
  ------------------
  |  |   72|  27.5k|#define MB_DISABLE_LEFT_EDGE          0x04
  ------------------
  |  Branch (1573:20): [True: 1.10k, False: 26.4k]
  ------------------
 1574|  27.5k|                if(ps_cur_mb->u1_deblocking_mode & MB_DISABLE_TOP_EDGE) ps_top_mb = NULL;
  ------------------
  |  |   71|  27.5k|#define MB_DISABLE_TOP_EDGE           0x02
  ------------------
  |  Branch (1574:20): [True: 883, False: 26.6k]
  ------------------
 1575|       |
 1576|       |                /* Top Horizontal Edge*/
 1577|  27.5k|                if(NULL != ps_top_mb)
  ------------------
  |  Branch (1577:20): [True: 20.7k, False: 6.82k]
  ------------------
 1578|  20.7k|                {
 1579|  20.7k|                    if(!(ps_top_mb->u1_mb_type & D_INTRA_MB))
  ------------------
  |  |  382|  20.7k|#define D_INTRA_MB        1
  ------------------
  |  Branch (1579:24): [True: 12.7k, False: 8.02k]
  ------------------
 1580|  12.7k|                    {
 1581|  12.7k|                        ps_cur_mb->u4_bs_table[0] = 0;
 1582|  12.7k|                    }
 1583|  20.7k|                }
 1584|  6.82k|                else
 1585|  6.82k|                {
 1586|  6.82k|                    ps_cur_mb->u4_bs_table[0] = 0;
 1587|  6.82k|                }
 1588|       |
 1589|       |                /* Left Vertical Edge*/
 1590|  27.5k|                if(NULL != ps_left_mb)
  ------------------
  |  Branch (1590:20): [True: 15.0k, False: 12.4k]
  ------------------
 1591|  15.0k|                {
 1592|  15.0k|                    if(!(ps_left_mb->u1_mb_type & D_INTRA_MB))
  ------------------
  |  |  382|  15.0k|#define D_INTRA_MB        1
  ------------------
  |  Branch (1592:24): [True: 8.68k, False: 6.37k]
  ------------------
 1593|  8.68k|                    {
 1594|  8.68k|                        ps_cur_mb->u4_bs_table[4] = 0;
 1595|  8.68k|                    }
 1596|  15.0k|                }
 1597|  12.4k|                else
 1598|  12.4k|                {
 1599|  12.4k|                    ps_cur_mb->u4_bs_table[4] = 0;
 1600|  12.4k|                }
 1601|  27.5k|            }
 1602|       |
 1603|  1.15M|            if(ps_dec->u4_cur_deblk_mb_num > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (1603:16): [True: 0, False: 1.15M]
  ------------------
 1604|      0|            {
 1605|      0|                return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1606|      0|            }
 1607|       |
 1608|  1.15M|            ih264d_deblock_mb_nonmbaff(ps_dec, ps_tfr_cxt, i4_cb_qp_idx_ofst, i4_cr_qp_idx_ofst,
 1609|  1.15M|                                       u4_wd_y, u4_wd_uv);
 1610|  1.15M|        }
 1611|   276k|    }
 1612|       |
 1613|   276k|    if(u4_tfr_n_mb)
  ------------------
  |  Branch (1613:8): [True: 276k, False: 0]
  ------------------
 1614|   276k|    {
 1615|       |        /****************************************************************/
 1616|       |        /* Check for End Of Row in Next iteration                       */
 1617|       |        /****************************************************************/
 1618|   276k|        u1_end_of_row_next =
 1619|   276k|            u4_num_mbs_next && (u4_num_mbs_next <= (ps_dec->u4_recon_mb_grp >> u1_mbaff));
  ------------------
  |  Branch (1619:13): [True: 15.9k, False: 260k]
  |  Branch (1619:32): [True: 15.9k, False: 0]
  ------------------
 1620|       |
 1621|       |        /****************************************************************/
 1622|       |        /* Transfer the Following things                                */
 1623|       |        /* N-Mb DeblkParams Data    ( To Ext DeblkParams Buffer )       */
 1624|       |        /* N-Mb Recon Data          ( To Ext Frame Buffer )             */
 1625|       |        /* N-Mb Intrapredline Data  ( Updated Internally)               */
 1626|       |        /* N-Mb MV Data             ( To Ext MV Buffer )                */
 1627|       |        /* N-Mb MVTop/TopRight Data ( To Int MV Top Scratch Buffers)    */
 1628|       |        /****************************************************************/
 1629|   276k|        ih264d_transfer_mb_group_data(ps_dec, u4_num_mbs, u4_end_of_row, u1_end_of_row_next);
 1630|   276k|        ps_dec->u4_num_mbs_prev_nmb = u4_num_mbs;
 1631|   276k|        ps_dec->u4_pred_info_idx = 0;
 1632|   276k|        ps_dec->u4_dma_buf_idx = 0;
 1633|   276k|    }
 1634|   276k|    return OK;
  ------------------
  |  |  114|   276k|#define OK        0
  ------------------
 1635|   276k|}
isvcd_process_ibl_mb:
 1650|  97.7k|{
 1651|  97.7k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1652|  97.7k|    intra_sampling_ctxt_t *ps_ctxt;
 1653|  97.7k|    svc_dec_lyr_struct_t *ps_svc_dec_ref_layer;
 1654|  97.7k|    pic_buffer_t *ps_frame_buf = ps_dec->ps_cur_pic;
 1655|  97.7k|    pic_buffer_t *ps_frame_buf_ref_layer;
 1656|  97.7k|    intra_samp_lyr_ctxt *ps_lyr_ctxt;
 1657|  97.7k|    mem_element_t s_ref_mb_mode = {0};
 1658|  97.7k|    mem_element_t s_inp_luma = {0};
 1659|  97.7k|    mem_element_t s_inp_chroma = {0};
 1660|  97.7k|    mem_element_t s_out_luma = {0};
 1661|  97.7k|    mem_element_t s_out_chroma = {0};
 1662|  97.7k|    WORD32 i4_ref_x_luma, i4_ref_y_luma, i4_luma_incr = 0;
 1663|  97.7k|    WORD32 i4_ref_x_chroma, i4_ref_y_chroma, i4_chroma_incr = 0;
 1664|  97.7k|    UWORD32 u4_cur_y_stride, u4_cur_uv_stride;
 1665|  97.7k|    UWORD32 u4_ref_y_stride, u4_ref_uv_stride;
 1666|  97.7k|    WORD32 i4_ref_luma_instra_sample_correction_offset = 0;
 1667|  97.7k|    WORD32 i4_ref_chroma_instra_sample_correction_offset = 0;
 1668|  97.7k|    ref_mb_map_t *ps_x_off_len_luma;
 1669|  97.7k|    ref_mb_map_t *ps_y_off_len_luma;
 1670|  97.7k|    ref_mb_map_t *ps_x_off_len_chroma;
 1671|  97.7k|    ref_mb_map_t *ps_y_off_len_chroma;
 1672|  97.7k|    mb_coord_t s_mb_coord = {0};
 1673|  97.7k|    WORD32 ret = OK;
  ------------------
  |  |  114|  97.7k|#define OK        0
  ------------------
 1674|  97.7k|    UNUSED(u4_mb_num);
  ------------------
  |  |   45|  97.7k|#define UNUSED(x) ((void)(x))
  ------------------
 1675|       |
 1676|  97.7k|    ps_ctxt = (intra_sampling_ctxt_t *) ps_svc_lyr_dec->pv_intra_sample_ctxt;
 1677|  97.7k|    ps_svc_dec_ref_layer = ps_svc_lyr_dec->ps_dec_svc_ref_layer;
 1678|       |
 1679|  97.7k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_ctxt->i4_res_lyr_id];
 1680|  97.7k|    u4_cur_y_stride = ps_dec->u2_frm_wd_y;
 1681|  97.7k|    u4_cur_uv_stride = ps_dec->u2_frm_wd_uv;
 1682|  97.7k|    u4_ref_y_stride = ps_svc_dec_ref_layer->s_dec.u2_frm_wd_y;
 1683|  97.7k|    u4_ref_uv_stride = ps_svc_dec_ref_layer->s_dec.u2_frm_wd_uv;
 1684|       |
 1685|  97.7k|    ps_frame_buf_ref_layer = ps_svc_dec_ref_layer->s_dec.ps_cur_pic;
 1686|  97.7k|    if(0 == u1_inter_intra_mode)
  ------------------
  |  Branch (1686:8): [True: 82.5k, False: 15.1k]
  ------------------
 1687|  82.5k|    {
 1688|  82.5k|        s_out_luma.pv_buffer = ps_frame_buf->pu1_buf1 + (ps_cur_mb_info->u2_mbx << 4) +
 1689|  82.5k|                               (u4_cur_y_stride * (ps_cur_mb_info->u2_mby << 4));
 1690|  82.5k|        s_out_luma.i4_element_size = 1;
 1691|  82.5k|        s_out_luma.i4_num_element_stride = u4_cur_y_stride;
 1692|       |
 1693|  82.5k|        s_out_chroma.pv_buffer = ps_frame_buf->pu1_buf2 +
 1694|  82.5k|                                 (ps_cur_mb_info->u2_mbx << 3) * YUV420SP_FACTOR +
  ------------------
  |  |  119|  82.5k|#define YUV420SP_FACTOR 2
  ------------------
 1695|  82.5k|                                 (u4_cur_uv_stride * (ps_cur_mb_info->u2_mby << 3));
 1696|  82.5k|        s_out_chroma.i4_element_size = 1;
 1697|  82.5k|        s_out_chroma.i4_num_element_stride = u4_cur_uv_stride;
 1698|  82.5k|    }
 1699|  15.1k|    else
 1700|  15.1k|    {
 1701|  15.1k|        if(SVCD_TRUE == ps_svc_lyr_dec->s_res_prms.u1_dyadic_flag)
  ------------------
  |  |   46|  15.1k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1701:12): [True: 0, False: 15.1k]
  ------------------
 1702|      0|        {
 1703|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1704|      0|        }
 1705|       |
 1706|  15.1k|        s_out_luma.pv_buffer = ps_svc_lyr_dec->pu1_ii_resamp_buffer_luma;
 1707|  15.1k|        s_out_luma.i4_element_size = 1;
 1708|  15.1k|        s_out_luma.i4_num_element_stride = MB_SIZE;
  ------------------
  |  |  554|  15.1k|#define MB_SIZE             16
  ------------------
 1709|       |
 1710|  15.1k|        s_out_chroma.pv_buffer = ps_svc_lyr_dec->pu1_ii_resamp_buffer_chroma;
 1711|  15.1k|        s_out_chroma.i4_element_size = 1;
 1712|  15.1k|        s_out_chroma.i4_num_element_stride = MB_SIZE;
  ------------------
  |  |  554|  15.1k|#define MB_SIZE             16
  ------------------
 1713|  15.1k|    }
 1714|       |
 1715|       |    /* get the projected locations buffer pointers */
 1716|  97.7k|    {
 1717|  97.7k|        intra_samp_map_ctxt_t *ps_luma_map, *ps_chroma_map;
 1718|       |
 1719|  97.7k|        ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1720|  97.7k|        ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1721|       |
 1722|  97.7k|        ps_x_off_len_luma = ps_luma_map->ps_x_offset_length;
 1723|  97.7k|        ps_y_off_len_luma = ps_luma_map->ps_y_offset_length;
 1724|  97.7k|        ps_x_off_len_chroma = ps_chroma_map->ps_x_offset_length;
 1725|  97.7k|        ps_y_off_len_chroma = ps_chroma_map->ps_y_offset_length;
 1726|  97.7k|    }
 1727|  97.7k|    i4_ref_x_luma = ps_svc_lyr_dec->ps_intsam_luma_map_horz[ps_cur_mb_info->u2_mbx].i2_offset;
 1728|  97.7k|    i4_ref_y_luma = ps_svc_lyr_dec->ps_intsam_luma_map_vert[ps_cur_mb_info->u2_mby].i2_offset;
 1729|       |
 1730|  97.7k|    i4_luma_incr = ps_x_off_len_luma[ps_cur_mb_info->u2_mbx].i2_offset - i4_ref_x_luma;
 1731|  97.7k|    i4_luma_incr +=
 1732|  97.7k|        (ps_y_off_len_luma[ps_cur_mb_info->u2_mby].i2_offset - i4_ref_y_luma) * u4_ref_y_stride;
 1733|       |
 1734|  97.7k|    i4_ref_x_chroma = ps_svc_lyr_dec->ps_intsam_chroma_map_horz[ps_cur_mb_info->u2_mbx].i2_offset;
 1735|  97.7k|    i4_ref_y_chroma = ps_svc_lyr_dec->ps_intsam_chroma_map_vert[ps_cur_mb_info->u2_mby].i2_offset;
 1736|       |
 1737|  97.7k|    i4_chroma_incr = ps_x_off_len_chroma[ps_cur_mb_info->u2_mbx].i2_offset - i4_ref_x_chroma;
 1738|  97.7k|    i4_chroma_incr <<= 1;
 1739|  97.7k|    i4_chroma_incr += (ps_y_off_len_chroma[ps_cur_mb_info->u2_mby].i2_offset - i4_ref_y_chroma) *
 1740|  97.7k|                      u4_ref_uv_stride;
 1741|  97.7k|    if(SVCD_FALSE == ps_svc_lyr_dec->s_res_prms.u1_dyadic_flag)
  ------------------
  |  |   45|  97.7k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1741:8): [True: 41.4k, False: 56.2k]
  ------------------
 1742|  41.4k|    {
 1743|  41.4k|        i4_ref_x_luma = CLIP3(0, (ps_svc_dec_ref_layer->s_dec.u2_frm_wd_y - 1), i4_ref_x_luma);
  ------------------
  |  |   77|  41.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 12.2k, False: 29.1k]
  |  |  |  Branch (77:54): [True: 0, False: 29.1k]
  |  |  ------------------
  ------------------
 1744|  41.4k|        i4_ref_y_luma = CLIP3(0, (ps_svc_dec_ref_layer->s_dec.u2_frm_ht_y - 1), i4_ref_y_luma);
  ------------------
  |  |   77|  41.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 5.15k, False: 36.3k]
  |  |  |  Branch (77:54): [True: 0, False: 36.3k]
  |  |  ------------------
  ------------------
 1745|  41.4k|    }
 1746|       |
 1747|  97.7k|    i4_ref_luma_instra_sample_correction_offset =
 1748|  97.7k|        i4_ref_x_luma + (i4_ref_y_luma) * (WORD32) u4_ref_y_stride;
 1749|       |
 1750|  97.7k|    s_inp_luma.pv_buffer = ps_frame_buf_ref_layer->pu1_buf1 + i4_luma_incr +
 1751|  97.7k|                           i4_ref_luma_instra_sample_correction_offset;
 1752|  97.7k|    s_inp_luma.i4_element_size = 1;
 1753|  97.7k|    s_inp_luma.i4_num_element_stride = u4_ref_y_stride;
 1754|       |
 1755|  97.7k|    if(SVCD_FALSE == ps_svc_lyr_dec->s_res_prms.u1_dyadic_flag)
  ------------------
  |  |   45|  97.7k|#define SVCD_FALSE 0
  ------------------
  |  Branch (1755:8): [True: 41.4k, False: 56.2k]
  ------------------
 1756|  41.4k|    {
 1757|  41.4k|        i4_ref_x_chroma = CLIP3(0, (ps_svc_dec_ref_layer->s_dec.u2_frm_wd_uv - 1), i4_ref_x_chroma);
  ------------------
  |  |   77|  41.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 28.5k, False: 12.9k]
  |  |  |  Branch (77:54): [True: 0, False: 12.9k]
  |  |  ------------------
  ------------------
 1758|  41.4k|        i4_ref_y_chroma = CLIP3(0, (ps_svc_dec_ref_layer->s_dec.u2_frm_ht_uv - 1), i4_ref_y_chroma);
  ------------------
  |  |   77|  41.4k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 11.2k, False: 30.2k]
  |  |  |  Branch (77:54): [True: 0, False: 30.2k]
  |  |  ------------------
  ------------------
 1759|  41.4k|    }
 1760|  97.7k|    i4_ref_chroma_instra_sample_correction_offset =
 1761|  97.7k|        (i4_ref_x_chroma << 1) + (i4_ref_y_chroma) * (WORD32) u4_ref_uv_stride;
 1762|       |
 1763|  97.7k|    s_inp_chroma.pv_buffer = ps_frame_buf_ref_layer->pu1_buf2 + i4_chroma_incr +
 1764|  97.7k|                             i4_ref_chroma_instra_sample_correction_offset;
 1765|  97.7k|    s_inp_chroma.i4_element_size = 1;
 1766|  97.7k|    s_inp_chroma.i4_num_element_stride = u4_ref_uv_stride;
 1767|       |
 1768|  97.7k|    s_ref_mb_mode.pv_buffer = ps_svc_dec_ref_layer->ps_inter_lyr_mb_prms_frm_start;
 1769|  97.7k|    s_ref_mb_mode.i4_element_size = sizeof(inter_lyr_mb_prms_t);
 1770|  97.7k|    s_ref_mb_mode.i4_num_element_stride = ps_svc_dec_ref_layer->u2_inter_lyr_mb_prms_stride;
 1771|       |
 1772|  97.7k|    s_mb_coord.u2_mb_x = ps_cur_mb_info->u2_mbx;
 1773|  97.7k|    s_mb_coord.u2_mb_y = ps_cur_mb_info->u2_mby;
 1774|       |
 1775|  97.7k|    if(SVCD_TRUE == ps_svc_lyr_dec->s_res_prms.u1_dyadic_flag)
  ------------------
  |  |   46|  97.7k|#define SVCD_TRUE 1
  ------------------
  |  Branch (1775:8): [True: 56.2k, False: 41.4k]
  ------------------
 1776|  56.2k|    {
 1777|  56.2k|        ret = isvcd_intra_resamp_mb_dyadic(ps_ctxt, &s_inp_luma, &s_inp_chroma, &s_ref_mb_mode,
 1778|  56.2k|                                           &s_out_luma, &s_out_chroma, &s_mb_coord, ps_svc_lyr_dec);
 1779|  56.2k|    }
 1780|  41.4k|    else
 1781|  41.4k|    {
 1782|  41.4k|        ret = isvcd_intra_resamp_mb(ps_ctxt, &s_inp_luma, &s_inp_chroma, &s_ref_mb_mode,
 1783|  41.4k|                                    &s_out_luma, &s_out_chroma, &s_mb_coord);
 1784|  41.4k|    }
 1785|  97.7k|    if(OK != ret) return ret;
  ------------------
  |  |  114|  97.7k|#define OK        0
  ------------------
  |  Branch (1785:8): [True: 0, False: 97.7k]
  ------------------
 1786|  97.7k|    return OK;
  ------------------
  |  |  114|  97.7k|#define OK        0
  ------------------
 1787|  97.7k|}
isvcd_process_residual_resample_mb:
 1802|   154k|{
 1803|   154k|    residual_sampling_ctxt_t *ps_ctxt;
 1804|   154k|    svc_dec_lyr_struct_t *ps_svc_dec_ref_layer;
 1805|   154k|    res_lyr_ctxt *ps_lyr_ctxt;
 1806|   154k|    mem_element_t s_ref_mb_mode = {0};
 1807|   154k|    mem_element_t s_inp_luma = {0};
 1808|   154k|    mem_element_t s_inp_chroma = {0};
 1809|   154k|    mem_element_t s_out_luma = {0};
 1810|   154k|    mem_element_t s_out_chroma = {0};
 1811|       |
 1812|       |    /* projected locations pointer */
 1813|   154k|    ref_mb_map_t *ps_x_off_len_luma;
 1814|   154k|    ref_mb_map_t *ps_y_off_len_luma;
 1815|   154k|    ref_mb_map_t *ps_x_off_len_chroma;
 1816|   154k|    ref_mb_map_t *ps_y_off_len_chroma;
 1817|   154k|    WORD32 i4_ref_x_luma, i4_ref_y_luma;
 1818|   154k|    WORD32 i4_ref_x_chroma, i4_ref_y_chroma;
 1819|   154k|    WORD32 i4_ref_luma_ressam_correction_offset = 0;
 1820|   154k|    WORD32 i4_ref_chroma_ressam_correction_offset = 0;
 1821|   154k|    WORD32 i4_inp_luma_stride, i4_inp_chroma_stride;
 1822|   154k|    WORD32 i4_out_luma_stride, i4_out_chroma_stride;
 1823|   154k|    WORD32 i4_inp_luma_offset = 0, i4_inp_chroma_offset = 0;
 1824|   154k|    WORD32 ret;
 1825|       |
 1826|   154k|    ps_svc_dec_ref_layer = ps_svc_lyr_dec->ps_dec_svc_ref_layer;
 1827|   154k|    ps_ctxt = (residual_sampling_ctxt_t *) ps_svc_lyr_dec->pv_residual_sample_ctxt;
 1828|   154k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_ctxt->i4_res_lyr_id];
 1829|       |
 1830|   154k|    i4_inp_luma_stride = ps_svc_dec_ref_layer->u2_residual_resample_luma_stride;
 1831|   154k|    i4_inp_chroma_stride = ps_svc_dec_ref_layer->u2_residual_resample_chroma_stride;
 1832|   154k|    i4_out_luma_stride = ps_svc_lyr_dec->u2_residual_resample_luma_stride;
 1833|   154k|    i4_out_chroma_stride = ps_svc_lyr_dec->u2_residual_resample_chroma_stride;
 1834|       |
 1835|   154k|    {
 1836|   154k|        residual_samp_map_ctxt_t *ps_luma_map, *ps_chroma_map;
 1837|       |
 1838|   154k|        ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1839|   154k|        ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1840|   154k|        ps_x_off_len_luma = ps_luma_map->ps_x_offset_length;
 1841|   154k|        ps_y_off_len_luma = ps_luma_map->ps_y_offset_length;
 1842|   154k|        ps_x_off_len_chroma = ps_chroma_map->ps_x_offset_length;
 1843|   154k|        ps_y_off_len_chroma = ps_chroma_map->ps_y_offset_length;
 1844|   154k|    }
 1845|   154k|    i4_ref_x_luma = ps_svc_lyr_dec->ps_ressam_luma_map_horz[ps_cur_mb_info->u2_mbx].i2_offset;
 1846|   154k|    i4_ref_y_luma = ps_svc_lyr_dec->ps_ressam_luma_map_vert[ps_cur_mb_info->u2_mby].i2_offset;
 1847|       |
 1848|   154k|    i4_ref_x_chroma = ps_svc_lyr_dec->ps_ressam_chroma_map_horz[ps_cur_mb_info->u2_mbx].i2_offset;
 1849|   154k|    i4_ref_y_chroma = ps_svc_lyr_dec->ps_ressam_chroma_map_vert[ps_cur_mb_info->u2_mby].i2_offset;
 1850|       |
 1851|   154k|    i4_ref_x_luma = CLIP3(0, (ps_lyr_ctxt->i4_ref_width - 1), i4_ref_x_luma);
  ------------------
  |  |   77|   154k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 47.5k, False: 106k]
  |  |  |  Branch (77:54): [True: 0, False: 106k]
  |  |  ------------------
  ------------------
 1852|   154k|    i4_ref_y_luma = CLIP3(0, (ps_lyr_ctxt->i4_ref_height - 1), i4_ref_y_luma);
  ------------------
  |  |   77|   154k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 22.1k, False: 132k]
  |  |  |  Branch (77:54): [True: 0, False: 132k]
  |  |  ------------------
  ------------------
 1853|   154k|    i4_ref_x_chroma = CLIP3(0, ((ps_lyr_ctxt->i4_ref_width >> 1) - 1), i4_ref_x_chroma);
  ------------------
  |  |   77|   154k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 47.5k, False: 106k]
  |  |  |  Branch (77:54): [True: 0, False: 106k]
  |  |  ------------------
  ------------------
 1854|   154k|    i4_ref_y_chroma = CLIP3(0, ((ps_lyr_ctxt->i4_ref_height >> 1) - 1), i4_ref_y_chroma);
  ------------------
  |  |   77|   154k|#define CLIP3(miny, maxy, y) (((y) < (miny))?(miny):(((y) > (maxy))?(maxy):(y)))
  |  |  ------------------
  |  |  |  Branch (77:31): [True: 22.1k, False: 132k]
  |  |  |  Branch (77:54): [True: 0, False: 132k]
  |  |  ------------------
  ------------------
 1855|       |
 1856|   154k|    {
 1857|   154k|        WORD32 i4_offset_x, i4_offset_y;
 1858|       |
 1859|   154k|        i4_offset_x = ps_x_off_len_luma[ps_cur_mb_info->u2_mbx].i2_offset;
 1860|   154k|        i4_offset_y = ps_y_off_len_luma[ps_cur_mb_info->u2_mby].i2_offset;
 1861|       |
 1862|       |        /* check for offsets inside frame dimensions */
 1863|   154k|        if(0 <= i4_offset_x)
  ------------------
  |  Branch (1863:12): [True: 106k, False: 47.5k]
  ------------------
 1864|   106k|        {
 1865|       |            /* validity of pointer passed */
 1866|   106k|            if(!(i4_offset_x >= i4_ref_x_luma))
  ------------------
  |  Branch (1866:16): [True: 0, False: 106k]
  ------------------
 1867|      0|            {
 1868|      0|                return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1869|      0|            }
 1870|   106k|            i4_inp_luma_offset += (i4_offset_x - i4_ref_x_luma);
 1871|   106k|        }
 1872|       |
 1873|   154k|        if(0 <= i4_offset_y)
  ------------------
  |  Branch (1873:12): [True: 132k, False: 22.1k]
  ------------------
 1874|   132k|        {
 1875|       |            /* validity of pointer passed */
 1876|   132k|            if(!(i4_offset_y >= i4_ref_y_luma))
  ------------------
  |  Branch (1876:16): [True: 0, False: 132k]
  ------------------
 1877|      0|            {
 1878|      0|                return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1879|      0|            }
 1880|   132k|            i4_inp_luma_offset += (i4_offset_y - i4_ref_y_luma) * i4_inp_luma_stride;
 1881|   132k|        }
 1882|       |
 1883|   154k|        i4_offset_x = ps_x_off_len_chroma[ps_cur_mb_info->u2_mbx].i2_offset;
 1884|   154k|        i4_offset_y = ps_y_off_len_chroma[ps_cur_mb_info->u2_mby].i2_offset;
 1885|       |
 1886|       |        /* check for offsets inside frame dimensions */
 1887|   154k|        if(0 <= i4_offset_x)
  ------------------
  |  Branch (1887:12): [True: 106k, False: 47.5k]
  ------------------
 1888|   106k|        {
 1889|       |            /* validity of pointer passed */
 1890|   106k|            if(!(i4_offset_x >= i4_ref_x_chroma))
  ------------------
  |  Branch (1890:16): [True: 0, False: 106k]
  ------------------
 1891|      0|            {
 1892|      0|                return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1893|      0|            }
 1894|   106k|            i4_inp_chroma_offset += (i4_offset_x - i4_ref_x_chroma) << 1;
 1895|   106k|        }
 1896|       |
 1897|   154k|        if(0 <= i4_offset_y)
  ------------------
  |  Branch (1897:12): [True: 132k, False: 22.1k]
  ------------------
 1898|   132k|        {
 1899|       |            /* validity of pointer passed */
 1900|   132k|            if(!(i4_offset_y >= i4_ref_y_chroma))
  ------------------
  |  Branch (1900:16): [True: 0, False: 132k]
  ------------------
 1901|      0|            {
 1902|      0|                return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1903|      0|            }
 1904|   132k|            i4_inp_chroma_offset += (i4_offset_y - i4_ref_y_chroma) * (i4_inp_chroma_stride << 1);
 1905|   132k|        }
 1906|   154k|    }
 1907|       |
 1908|   154k|    i4_ref_luma_ressam_correction_offset = i4_ref_x_luma + (i4_ref_y_luma) *i4_inp_luma_stride;
 1909|       |
 1910|   154k|    s_inp_luma.pv_buffer = ps_svc_dec_ref_layer->pi2_il_residual_resample_mb_luma_frm_start +
 1911|   154k|                           i4_inp_luma_offset + i4_ref_luma_ressam_correction_offset;
 1912|   154k|    s_inp_luma.i4_element_size = 1;
 1913|   154k|    s_inp_luma.i4_num_element_stride = i4_inp_luma_stride;
 1914|       |
 1915|   154k|    i4_ref_chroma_ressam_correction_offset =
 1916|   154k|        (i4_ref_x_chroma << 1) + (i4_ref_y_chroma) *i4_inp_chroma_stride;
 1917|       |
 1918|   154k|    s_inp_chroma.pv_buffer = ps_svc_dec_ref_layer->pi2_il_residual_resample_mb_chroma_frm_start +
 1919|   154k|                             i4_inp_chroma_offset + i4_ref_chroma_ressam_correction_offset;
 1920|   154k|    s_inp_chroma.i4_element_size = 1;
 1921|   154k|    s_inp_chroma.i4_num_element_stride = i4_inp_luma_stride;
 1922|       |
 1923|   154k|    s_ref_mb_mode.pv_buffer = ps_svc_dec_ref_layer->ps_inter_lyr_mb_prms_frm_start;
 1924|   154k|    s_ref_mb_mode.i4_element_size = sizeof(inter_lyr_mb_prms_t);
 1925|   154k|    s_ref_mb_mode.i4_num_element_stride = ps_svc_dec_ref_layer->u2_inter_lyr_mb_prms_stride;
 1926|       |
 1927|   154k|    s_out_luma.i4_element_size = 1;
 1928|   154k|    s_out_luma.pv_buffer =
 1929|   154k|        ps_svc_lyr_dec->pi2_il_residual_resample_mb_luma_frm_start +
 1930|   154k|        ((ps_cur_mb_info->u2_mbx << 4) +
 1931|   154k|         (i4_out_luma_stride * (ps_cur_mb_info->u2_mby << 4)) * s_out_luma.i4_element_size);
 1932|       |
 1933|   154k|    s_out_luma.i4_num_element_stride = i4_out_luma_stride;
 1934|       |
 1935|   154k|    s_out_chroma.i4_element_size = 1;
 1936|   154k|    s_out_chroma.pv_buffer =
 1937|   154k|        ps_svc_lyr_dec->pi2_il_residual_resample_mb_chroma_frm_start +
 1938|   154k|        ((ps_cur_mb_info->u2_mbx << 4) +
 1939|   154k|         (i4_out_chroma_stride * (ps_cur_mb_info->u2_mby << 3)) * s_out_chroma.i4_element_size);
 1940|   154k|    s_out_chroma.i4_num_element_stride = i4_out_chroma_stride;
 1941|       |
 1942|   154k|    ret = ps_lyr_ctxt->pf_residual_samp_mb(ps_ctxt, &s_inp_luma, &s_inp_chroma, &s_ref_mb_mode,
 1943|   154k|                                           &s_out_luma, &s_out_chroma, ps_cur_mb_info->u2_mbx,
 1944|   154k|                                           ps_cur_mb_info->u2_mby);
 1945|   154k|    if(ret != OK)
  ------------------
  |  |  114|   154k|#define OK        0
  ------------------
  |  Branch (1945:8): [True: 0, False: 154k]
  ------------------
 1946|      0|    {
 1947|      0|        return ret;
 1948|      0|    }
 1949|   154k|    return OK;
  ------------------
  |  |  114|   154k|#define OK        0
  ------------------
 1950|   154k|}
isvcd_process_inter_mb_rsd_pred_target_lyr:
 1968|   154k|{
 1969|   154k|    UWORD8 *pu1_rec_y, *pu1_rec_u;
 1970|   154k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 1971|   154k|    UWORD32 ui_rec_width, u4_recwidth_cr;
 1972|   154k|    UWORD16 u2_luma_stride, u2_chroma_stride;
 1973|   154k|    WORD16 *pi2_y_coeff, *pi2_luma_res_ptr, *pi2_chroma_res_ptr;
 1974|   154k|    UWORD32 u1_mb_field_decoding_flag;
 1975|   154k|    const UWORD8 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
 1976|   154k|    UWORD32 uc_botMb;
 1977|   154k|    UWORD32 u4_num_pmbair;
 1978|   154k|    tfr_ctxt_t *ps_frame_buf = ps_dec->ps_frame_buf_ip_recon;
 1979|   154k|    UWORD32 u4_luma_dc_only_csbp = 0;
 1980|   154k|    UWORD32 u4_luma_dc_only_cbp = 0;
 1981|   154k|    UWORD16 u2_res_luma_csbp = 0;
 1982|   154k|    WORD32 ret;
 1983|       |
 1984|   154k|    if(0 != ps_dec->ps_cur_slice->u1_mbaff_frame_flag)
  ------------------
  |  Branch (1984:8): [True: 0, False: 154k]
  ------------------
 1985|      0|    {
 1986|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1987|      0|    }
 1988|   154k|    uc_botMb = 1 - ps_cur_mb_info->u1_topmb;
 1989|   154k|    u4_num_pmbair = (u4_mb_num >> u1_mbaff);
 1990|   154k|    u1_mb_field_decoding_flag = ps_cur_mb_info->u1_mb_field_decodingflag;
 1991|       |
 1992|   154k|    pu1_rec_y = ps_frame_buf->pu1_dest_y + (u4_num_pmbair << 4);
 1993|   154k|    pu1_rec_u = ps_frame_buf->pu1_dest_u + (u4_num_pmbair << 3) * YUV420SP_FACTOR;
  ------------------
  |  |  119|   154k|#define YUV420SP_FACTOR 2
  ------------------
 1994|   154k|    ui_rec_width = ps_dec->u2_frm_wd_y << u1_mb_field_decoding_flag;
 1995|   154k|    u4_recwidth_cr = ps_dec->u2_frm_wd_uv << u1_mb_field_decoding_flag;
 1996|       |
 1997|   154k|    u2_luma_stride = ps_svc_lyr_dec->u2_residual_resample_luma_stride;
 1998|   154k|    pi2_luma_res_ptr = ps_svc_lyr_dec->pi2_il_residual_resample_mb_luma_frm_start +
 1999|   154k|                       (ps_cur_mb_info->u2_mbx << 4) +
 2000|   154k|                       ((ps_cur_mb_info->u2_mby << 4) * u2_luma_stride);
 2001|       |
 2002|   154k|    u2_chroma_stride = ps_svc_lyr_dec->u2_residual_resample_chroma_stride;
 2003|   154k|    pi2_chroma_res_ptr = ps_svc_lyr_dec->pi2_il_residual_resample_mb_chroma_frm_start +
 2004|   154k|                         (ps_cur_mb_info->u2_mbx << 4) +
 2005|   154k|                         ((ps_cur_mb_info->u2_mby << 3) * u2_chroma_stride);
 2006|       |
 2007|   154k|    ret = isvcd_process_residual_resample_mb(ps_svc_lyr_dec, ps_cur_mb_info);
 2008|   154k|    if(ret != OK)
  ------------------
  |  |  114|   154k|#define OK        0
  ------------------
  |  Branch (2008:8): [True: 0, False: 154k]
  ------------------
 2009|      0|    {
 2010|      0|        return ret;
 2011|      0|    }
 2012|   154k|    if(u1_mbaff)
  ------------------
  |  Branch (2012:8): [True: 0, False: 154k]
  ------------------
 2013|      0|    {
 2014|      0|        if(uc_botMb)
  ------------------
  |  Branch (2014:12): [True: 0, False: 0]
  ------------------
 2015|      0|        {
 2016|      0|            pu1_rec_y += (u1_mb_field_decoding_flag ? (ui_rec_width >> 1) : (ui_rec_width << 4));
  ------------------
  |  Branch (2016:27): [True: 0, False: 0]
  ------------------
 2017|      0|            pu1_rec_u +=
 2018|      0|                (u1_mb_field_decoding_flag ? (u4_recwidth_cr >> 1) : (u4_recwidth_cr << 3));
  ------------------
  |  Branch (2018:18): [True: 0, False: 0]
  ------------------
 2019|      0|        }
 2020|      0|    }
 2021|       |
 2022|   154k|    if(!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (2022:8): [True: 140k, False: 13.7k]
  ------------------
 2023|   140k|    {
 2024|   140k|        u4_luma_dc_only_csbp = ih264d_unpack_luma_coeff4x4_mb(ps_dec, ps_cur_mb_info, 0);
 2025|   140k|    }
 2026|  13.7k|    else
 2027|  13.7k|    {
 2028|  13.7k|        if(!ps_dec->ps_cur_pps->u1_entropy_coding_mode)
  ------------------
  |  Branch (2028:12): [True: 2.71k, False: 11.0k]
  ------------------
 2029|  2.71k|        {
 2030|  2.71k|            u4_luma_dc_only_cbp = ih264d_unpack_luma_coeff4x4_mb(ps_dec, ps_cur_mb_info, 0);
 2031|  2.71k|        }
 2032|  11.0k|        else
 2033|  11.0k|        {
 2034|  11.0k|            u4_luma_dc_only_cbp = ih264d_unpack_luma_coeff8x8_mb(ps_dec, ps_cur_mb_info);
 2035|  11.0k|        }
 2036|  13.7k|    }
 2037|       |
 2038|   154k|    *pu2_res_luma_csbp = 0;
 2039|   154k|    pi2_y_coeff = ps_dec->pi2_coeff_data;
 2040|       |
 2041|       |    /* Inverse Transform and Reconstruction */
 2042|   154k|    if(ps_cur_mb_info->u1_cbp & 0x0f)
  ------------------
  |  Branch (2042:8): [True: 26.8k, False: 127k]
  ------------------
 2043|  26.8k|    {
 2044|  26.8k|        if(!ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (2044:12): [True: 13.1k, False: 13.7k]
  ------------------
 2045|  13.1k|        {
 2046|  13.1k|            UWORD32 i;
 2047|  13.1k|            WORD16 ai2_tmp[16] = {0};
 2048|   222k|            for(i = 0; i < 16; i++)
  ------------------
  |  Branch (2048:24): [True: 209k, False: 13.1k]
  ------------------
 2049|   209k|            {
 2050|   209k|                if(CHECKBIT(ps_cur_mb_info->u2_luma_csbp, i))
  ------------------
  |  |   54|   209k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 50.2k, False: 159k]
  |  |  ------------------
  ------------------
 2051|  50.2k|                {
 2052|  50.2k|                    WORD16 *pi2_level = pi2_y_coeff + (i << 4);
 2053|  50.2k|                    UWORD8 *pu1_pred_sblk =
 2054|  50.2k|                        pu1_rec_y + ((i & 0x3) * BLK_SIZE) + (i >> 2) * (ui_rec_width << 2);
  ------------------
  |  |  556|  50.2k|#define BLK_SIZE             4
  ------------------
 2055|  50.2k|                    WORD16 *pi2_out = pi2_luma_res_ptr + ((i & 0x3) * BLK_SIZE) +
  ------------------
  |  |  556|  50.2k|#define BLK_SIZE             4
  ------------------
 2056|  50.2k|                                      (i >> 2) * (u2_luma_stride << 2);
 2057|  50.2k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  50.2k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
 2058|  50.2k|                    {
 2059|  50.2k|                        if(CHECKBIT(u4_luma_dc_only_csbp, i))
  ------------------
  |  |   54|  50.2k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 5.23k, False: 45.0k]
  |  |  ------------------
  ------------------
 2060|  5.23k|                        {
 2061|  5.23k|                            u2_res_luma_csbp =
 2062|  5.23k|                                ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_luma_4x4_dc(
 2063|  5.23k|                                    pi2_level, pu1_pred_sblk, pi2_out, pu1_pred_sblk, ui_rec_width,
 2064|  5.23k|                                    u2_luma_stride, ui_rec_width,
 2065|  5.23k|                                    gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qp_rem6],
 2066|  5.23k|                                    (UWORD16 *) ps_dec->s_high_profile.i2_scalinglist4x4[3],
 2067|  5.23k|                                    ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0, NULL);
 2068|  5.23k|                        }
 2069|  45.0k|                        else
 2070|  45.0k|                        {
 2071|  45.0k|                            u2_res_luma_csbp =
 2072|  45.0k|                                ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_luma_4x4(
 2073|  45.0k|                                    pi2_level, pu1_pred_sblk, pi2_out, pu1_pred_sblk, ui_rec_width,
 2074|  45.0k|                                    u2_luma_stride, ui_rec_width,
 2075|  45.0k|                                    gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qp_rem6],
 2076|  45.0k|                                    (UWORD16 *) ps_dec->s_high_profile.i2_scalinglist4x4[3],
 2077|  45.0k|                                    ps_cur_mb_info->u1_qp_div6, ai2_tmp, 0, NULL);
 2078|  45.0k|                        }
 2079|  50.2k|                    }
 2080|  50.2k|                }
 2081|   159k|                else
 2082|   159k|                {
 2083|   159k|                    UWORD8 *pu1_pred_sblk =
 2084|   159k|                        pu1_rec_y + ((i & 0x3) * BLK_SIZE) + (i >> 2) * (ui_rec_width << 2);
  ------------------
  |  |  556|   159k|#define BLK_SIZE             4
  ------------------
 2085|   159k|                    WORD16 *pi2_out = pi2_luma_res_ptr + ((i & 0x3) * BLK_SIZE) +
  ------------------
  |  |  556|   159k|#define BLK_SIZE             4
  ------------------
 2086|   159k|                                      (i >> 2) * (u2_luma_stride << 2);
 2087|       |
 2088|   159k|                    u2_res_luma_csbp = ps_svc_lyr_dec->pf_pred_residual_recon_luma_4x4(
 2089|   159k|                        pu1_pred_sblk, pi2_out, pu1_pred_sblk, ui_rec_width, u2_luma_stride,
 2090|   159k|                        ui_rec_width);
 2091|   159k|                }
 2092|   209k|                *pu2_res_luma_csbp |= (u2_res_luma_csbp << i);
 2093|   209k|            }
 2094|  13.1k|        }
 2095|  13.7k|        else
 2096|  13.7k|        {
 2097|  13.7k|            WORD16 *pi2_scale_matrix_ptr;
 2098|  13.7k|            WORD32 i;
 2099|       |
 2100|  13.7k|            pi2_scale_matrix_ptr = ps_dec->s_high_profile.i2_scalinglist8x8[1];
 2101|       |
 2102|  68.6k|            for(i = 0; i < 4; i++)
  ------------------
  |  Branch (2102:24): [True: 54.8k, False: 13.7k]
  ------------------
 2103|  54.8k|            {
 2104|  54.8k|                WORD16 ai2_tmp[64] = {0};
 2105|  54.8k|                WORD16 *pi16_levelBlock =
 2106|  54.8k|                    pi2_y_coeff + (i << 6); /* move to the next 8x8 adding 64 */
 2107|       |
 2108|  54.8k|                UWORD8 *pu1_pred_sblk =
 2109|  54.8k|                    pu1_rec_y + ((i & 0x1) * BLK8x8SIZE) + (i >> 1) * (ui_rec_width << 3);
  ------------------
  |  |  555|  54.8k|#define BLK8x8SIZE          8
  ------------------
 2110|  54.8k|                WORD16 *pi2_out =
 2111|  54.8k|                    pi2_luma_res_ptr + ((i & 0x1) * BLK8x8SIZE) + (i >> 1) * (u2_luma_stride << 3);
  ------------------
  |  |  555|  54.8k|#define BLK8x8SIZE          8
  ------------------
 2112|  54.8k|                if(CHECKBIT(ps_cur_mb_info->u1_cbp, i))
  ------------------
  |  |   54|  54.8k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 40.0k, False: 14.8k]
  |  |  ------------------
  ------------------
 2113|  40.0k|                {
 2114|  40.0k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  40.0k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
 2115|  40.0k|                    {
 2116|  40.0k|                        if(CHECKBIT(u4_luma_dc_only_cbp, i))
  ------------------
  |  |   54|  40.0k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 3.80k, False: 36.2k]
  |  |  ------------------
  ------------------
 2117|  3.80k|                        {
 2118|  3.80k|                            u2_res_luma_csbp =
 2119|  3.80k|                                ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_luma_8x8_dc(
 2120|  3.80k|                                    pi16_levelBlock, pu1_pred_sblk, pi2_out, pu1_pred_sblk,
 2121|  3.80k|                                    ui_rec_width, u2_luma_stride, ui_rec_width,
 2122|  3.80k|                                    gau1_ih264d_dequant8x8_cavlc[ps_cur_mb_info->u1_qp_rem6],
 2123|  3.80k|                                    (UWORD16 *) pi2_scale_matrix_ptr, ps_cur_mb_info->u1_qp_div6,
 2124|  3.80k|                                    ai2_tmp, 0, NULL);
 2125|  3.80k|                        }
 2126|  36.2k|                        else
 2127|  36.2k|                        {
 2128|  36.2k|                            u2_res_luma_csbp =
 2129|  36.2k|                                ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_luma_8x8(
 2130|  36.2k|                                    pi16_levelBlock, pu1_pred_sblk, pi2_out, pu1_pred_sblk,
 2131|  36.2k|                                    ui_rec_width, u2_luma_stride, ui_rec_width,
 2132|  36.2k|                                    gau1_ih264d_dequant8x8_cavlc[ps_cur_mb_info->u1_qp_rem6],
 2133|  36.2k|                                    (UWORD16 *) pi2_scale_matrix_ptr, ps_cur_mb_info->u1_qp_div6,
 2134|  36.2k|                                    ai2_tmp, 0, NULL);
 2135|  36.2k|                        }
 2136|  40.0k|                    }
 2137|  40.0k|                }
 2138|  14.8k|                else
 2139|  14.8k|                {
 2140|  14.8k|                    UWORD8 *pu1_pred_sblk =
 2141|  14.8k|                        pu1_rec_y + ((i & 0x1) * BLK8x8SIZE) + (i >> 1) * (ui_rec_width << 3);
  ------------------
  |  |  555|  14.8k|#define BLK8x8SIZE          8
  ------------------
 2142|  14.8k|                    WORD16 *pi2_out = pi2_luma_res_ptr + ((i & 0x1) * BLK8x8SIZE) +
  ------------------
  |  |  555|  14.8k|#define BLK8x8SIZE          8
  ------------------
 2143|  14.8k|                                      (i >> 1) * (u2_luma_stride << 3);
 2144|       |
 2145|  14.8k|                    u2_res_luma_csbp = ps_svc_lyr_dec->pf_pred_residual_recon_luma_8x8(
 2146|  14.8k|                        pu1_pred_sblk, pi2_out, pu1_pred_sblk, ui_rec_width, u2_luma_stride,
 2147|  14.8k|                        ui_rec_width);
 2148|  14.8k|                }
 2149|  54.8k|                *pu2_res_luma_csbp |= (u2_res_luma_csbp << (((i >> 1) << 3) + ((i & 0x01) << 1)));
 2150|  54.8k|            }
 2151|  13.7k|        }
 2152|  26.8k|    }
 2153|   127k|    else
 2154|   127k|    {
 2155|   127k|        UWORD8 *pu1_pred_sblk = pu1_rec_y;
 2156|   127k|        WORD16 *pi2_out = pi2_luma_res_ptr;
 2157|       |
 2158|   127k|        *pu2_res_luma_csbp = ps_svc_lyr_dec->pf_pred_residual_recon_luma_16x16(
 2159|   127k|            pu1_pred_sblk, pi2_out, pu1_pred_sblk, ui_rec_width, u2_luma_stride, ui_rec_width);
 2160|   127k|    }
 2161|       |
 2162|       |    /* Decode Chroma Block */
 2163|   154k|    ih264d_unpack_chroma_coeff4x4_mb(ps_dec, ps_cur_mb_info);
 2164|       |    /*--------------------------------------------------------------------*/
 2165|       |    /* Chroma Blocks decoding                                             */
 2166|       |    /*--------------------------------------------------------------------*/
 2167|   154k|    {
 2168|   154k|        UWORD8 u1_chroma_cbp = (UWORD8) (ps_cur_mb_info->u1_cbp >> 4);
 2169|       |
 2170|   154k|        if(u1_chroma_cbp != CBPC_ALLZERO)
  ------------------
  |  |  507|   154k|#define CBPC_ALLZERO    0
  ------------------
  |  Branch (2170:12): [True: 14.2k, False: 140k]
  ------------------
 2171|  14.2k|        {
 2172|  14.2k|            UWORD32 u4_scale_u = ps_cur_mb_info->u1_qpc_div6;
 2173|  14.2k|            UWORD32 u4_scale_v = ps_cur_mb_info->u1_qpcr_div6;
 2174|  14.2k|            UWORD16 u2_chroma_csbp = ps_cur_mb_info->u2_chroma_csbp;
 2175|       |
 2176|  14.2k|            pi2_y_coeff = ps_dec->pi2_coeff_data;
 2177|       |
 2178|  14.2k|            {
 2179|  14.2k|                UWORD32 i;
 2180|  14.2k|                WORD16 ai2_tmp[16] = {0};
 2181|  71.4k|                for(i = 0; i < 4; i++)
  ------------------
  |  Branch (2181:28): [True: 57.1k, False: 14.2k]
  ------------------
 2182|  57.1k|                {
 2183|  57.1k|                    WORD16 *pi2_level = pi2_y_coeff + (i << 4);
 2184|  57.1k|                    UWORD8 *pu1_pred_sblk = pu1_rec_u + ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR) +
  ------------------
  |  |  556|  57.1k|#define BLK_SIZE             4
  ------------------
                                  UWORD8 *pu1_pred_sblk = pu1_rec_u + ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR) +
  ------------------
  |  |  119|  57.1k|#define YUV420SP_FACTOR 2
  ------------------
 2185|  57.1k|                                            (i >> 1) * (u4_recwidth_cr << 2);
 2186|  57.1k|                    WORD16 *pi2_out = pi2_chroma_res_ptr +
 2187|  57.1k|                                      ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR) +
  ------------------
  |  |  556|  57.1k|#define BLK_SIZE             4
  ------------------
                                                    ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR) +
  ------------------
  |  |  119|  57.1k|#define YUV420SP_FACTOR 2
  ------------------
 2188|  57.1k|                                      (i >> 1) * (u2_chroma_stride << 2);
 2189|  57.1k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  57.1k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
 2190|  57.1k|                    {
 2191|  57.1k|                        if(CHECKBIT(u2_chroma_csbp, i))
  ------------------
  |  |   54|  57.1k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 6.07k, False: 51.0k]
  |  |  ------------------
  ------------------
 2192|  6.07k|                        {
 2193|  6.07k|                            ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_chroma_4x4(
 2194|  6.07k|                                pi2_level, pu1_pred_sblk, pi2_out, pu1_pred_sblk, u4_recwidth_cr,
 2195|  6.07k|                                u2_chroma_stride, u4_recwidth_cr,
 2196|  6.07k|                                gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpc_rem6],
 2197|  6.07k|                                (UWORD16 *) ps_dec->s_high_profile.i2_scalinglist4x4[4], u4_scale_u,
 2198|  6.07k|                                ai2_tmp, pi2_level);
 2199|  6.07k|                        }
 2200|  51.0k|                        else if(pi2_level[0] != 0)
  ------------------
  |  Branch (2200:33): [True: 39.0k, False: 12.0k]
  ------------------
 2201|  39.0k|                        {
 2202|  39.0k|                            ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_chroma_4x4_dc(
 2203|  39.0k|                                pi2_level, pu1_pred_sblk, pi2_out, pu1_pred_sblk, u4_recwidth_cr,
 2204|  39.0k|                                u2_chroma_stride, u4_recwidth_cr,
 2205|  39.0k|                                gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpc_rem6],
 2206|  39.0k|                                (UWORD16 *) ps_dec->s_high_profile.i2_scalinglist4x4[4], u4_scale_u,
 2207|  39.0k|                                ai2_tmp, pi2_level);
 2208|  39.0k|                        }
 2209|  12.0k|                        else
 2210|  12.0k|                        {
 2211|  12.0k|                            ps_svc_lyr_dec->pf_pred_residual_recon_chroma_4x4(
 2212|  12.0k|                                pu1_pred_sblk, pi2_out, pu1_pred_sblk, u4_recwidth_cr,
 2213|  12.0k|                                u2_chroma_stride, u4_recwidth_cr);
 2214|  12.0k|                        }
 2215|  57.1k|                    }
 2216|  57.1k|                }
 2217|  14.2k|            }
 2218|       |
 2219|  14.2k|            pi2_y_coeff += MB_CHROM_SIZE;
  ------------------
  |  |  564|  14.2k|#define MB_CHROM_SIZE                 64
  ------------------
 2220|  14.2k|            u2_chroma_csbp >>= 4;
 2221|       |
 2222|  14.2k|            {
 2223|  14.2k|                UWORD32 i;
 2224|  14.2k|                WORD16 ai2_tmp[16] = {0};
 2225|  71.4k|                for(i = 0; i < 4; i++)
  ------------------
  |  Branch (2225:28): [True: 57.1k, False: 14.2k]
  ------------------
 2226|  57.1k|                {
 2227|  57.1k|                    WORD16 *pi2_level = pi2_y_coeff + (i << 4);
 2228|  57.1k|                    UWORD8 *pu1_pred_sblk = pu1_rec_u + 1 +
 2229|  57.1k|                                            ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR) +
  ------------------
  |  |  556|  57.1k|#define BLK_SIZE             4
  ------------------
                                                          ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR) +
  ------------------
  |  |  119|  57.1k|#define YUV420SP_FACTOR 2
  ------------------
 2230|  57.1k|                                            (i >> 1) * (u4_recwidth_cr << 2);
 2231|  57.1k|                    WORD16 *pi2_out = pi2_chroma_res_ptr + 1 +
 2232|  57.1k|                                      ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR) +
  ------------------
  |  |  556|  57.1k|#define BLK_SIZE             4
  ------------------
                                                    ((i & 0x1) * BLK_SIZE * YUV420SP_FACTOR) +
  ------------------
  |  |  119|  57.1k|#define YUV420SP_FACTOR 2
  ------------------
 2233|  57.1k|                                      (i >> 1) * (u2_chroma_stride << 2);
 2234|  57.1k|                    PROFILE_DISABLE_IQ_IT_RECON()
  ------------------
  |  |   98|  57.1k|#define PROFILE_DISABLE_IQ_IT_RECON() ;
  ------------------
 2235|  57.1k|                    {
 2236|  57.1k|                        if(CHECKBIT(u2_chroma_csbp, i))
  ------------------
  |  |   54|  57.1k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 5.98k, False: 51.1k]
  |  |  ------------------
  ------------------
 2237|  5.98k|                        {
 2238|  5.98k|                            ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_chroma_4x4(
 2239|  5.98k|                                pi2_level, pu1_pred_sblk, pi2_out, pu1_pred_sblk, u4_recwidth_cr,
 2240|  5.98k|                                u2_chroma_stride, u4_recwidth_cr,
 2241|  5.98k|                                gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpcr_rem6],
 2242|  5.98k|                                (UWORD16 *) ps_dec->s_high_profile.i2_scalinglist4x4[5], u4_scale_v,
 2243|  5.98k|                                ai2_tmp, pi2_level);
 2244|  5.98k|                        }
 2245|  51.1k|                        else if(pi2_level[0] != 0)
  ------------------
  |  Branch (2245:33): [True: 37.2k, False: 13.9k]
  ------------------
 2246|  37.2k|                        {
 2247|  37.2k|                            ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_chroma_4x4_dc(
 2248|  37.2k|                                pi2_level, pu1_pred_sblk, pi2_out, pu1_pred_sblk, u4_recwidth_cr,
 2249|  37.2k|                                u2_chroma_stride, u4_recwidth_cr,
 2250|  37.2k|                                gau2_ih264_iquant_scale_4x4[ps_cur_mb_info->u1_qpcr_rem6],
 2251|  37.2k|                                (UWORD16 *) ps_dec->s_high_profile.i2_scalinglist4x4[5], u4_scale_v,
 2252|  37.2k|                                ai2_tmp, pi2_level);
 2253|  37.2k|                        }
 2254|  13.9k|                        else
 2255|  13.9k|                        {
 2256|  13.9k|                            ps_svc_lyr_dec->pf_pred_residual_recon_chroma_4x4(
 2257|  13.9k|                                pu1_pred_sblk, pi2_out, pu1_pred_sblk, u4_recwidth_cr,
 2258|  13.9k|                                u2_chroma_stride, u4_recwidth_cr);
 2259|  13.9k|                        }
 2260|  57.1k|                    }
 2261|  57.1k|                }
 2262|  14.2k|            }
 2263|  14.2k|        }
 2264|   140k|        else
 2265|   140k|        {
 2266|       |            /* Cr*/
 2267|   140k|            {
 2268|   140k|                UWORD8 *pu1_pred_sblk = pu1_rec_u;
 2269|   140k|                WORD16 *pi2_out = pi2_chroma_res_ptr;
 2270|       |
 2271|   140k|                ps_svc_lyr_dec->pf_pred_residual_recon_chroma_8x8(pu1_pred_sblk, pi2_out,
 2272|   140k|                                                                  pu1_pred_sblk, u4_recwidth_cr,
 2273|   140k|                                                                  u2_chroma_stride, u4_recwidth_cr);
 2274|   140k|            }
 2275|       |
 2276|       |            /* Cb*/
 2277|   140k|            {
 2278|   140k|                UWORD8 *pu1_pred_sblk = pu1_rec_u + 1;
 2279|   140k|                WORD16 *pi2_out = pi2_chroma_res_ptr + 1;
 2280|   140k|                ps_svc_lyr_dec->pf_pred_residual_recon_chroma_8x8(pu1_pred_sblk, pi2_out,
 2281|   140k|                                                                  pu1_pred_sblk, u4_recwidth_cr,
 2282|   140k|                                                                  u2_chroma_stride, u4_recwidth_cr);
 2283|   140k|            }
 2284|   140k|        }
 2285|   154k|    }
 2286|   154k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
 2287|   154k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start + ps_cur_mb_info->u2_mbx +
 2288|   154k|        (ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride * (ps_cur_mb_info->u2_mby));
 2289|   154k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_mb_mode =
 2290|   154k|        u1_inference_mode ? SVC_IBL_MB : SVC_INTER_MB;
  ------------------
  |  |  117|      0|#define SVC_IBL_MB (1 << 3)         /*!< I_BL MB always inferred */
  ------------------
                      u1_inference_mode ? SVC_IBL_MB : SVC_INTER_MB;
  ------------------
  |  |  114|   308k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (2290:9): [True: 0, False: 154k]
  ------------------
 2291|   154k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_tx_size = ps_cur_mb_info->u1_tran_form8x8;
 2292|   154k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u2_luma_nnz = ps_cur_mb_info->u2_luma_csbp;
 2293|   154k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz =
 2294|   154k|        (UWORD8) ps_cur_mb_info->u2_chroma_csbp;
 2295|   154k|    if(CHECKBIT(ps_cur_mb_info->u1_yuv_dc_block_flag, 1))
  ------------------
  |  |   54|   154k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 11.1k, False: 143k]
  |  |  ------------------
  ------------------
 2296|  11.1k|    {
 2297|       |        /* Four bits for Cb in DC only cbp */
 2298|  11.1k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz |= 0x0F;
 2299|  11.1k|    }
 2300|   154k|    if(CHECKBIT(ps_cur_mb_info->u1_yuv_dc_block_flag, 2))
  ------------------
  |  |   54|   154k|#define CHECKBIT(a,i) ((a) &  (1 << i))
  |  |  ------------------
  |  |  |  Branch (54:23): [True: 10.9k, False: 143k]
  |  |  ------------------
  ------------------
 2301|  10.9k|    {
 2302|       |        /* Four bits for Cr in DC only cbp */
 2303|  10.9k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz |= 0xF0;
 2304|  10.9k|    }
 2305|   154k|    return (0);
 2306|   154k|}

isvcd_residual_chroma_dyadic:
  407|  1.55k|{
  408|  1.55k|    residual_sampling_ctxt_t *ps_ctxt;
  409|  1.55k|    res_lyr_ctxt *ps_lyr_ctxt;
  410|  1.55k|    ps_ctxt = (residual_sampling_ctxt_t *) pv_residual_samp_ctxt;
  411|  1.55k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_ctxt->i4_res_lyr_id];
  412|       |    /* ----------------- Processing ------------------------------- */
  413|  1.55k|    {
  414|  1.55k|        WORD32 i4_i;
  415|  1.55k|        WORD16 *pi2_ref_data_byte;
  416|  1.55k|        WORD32 *pi4_ref_array;
  417|  1.55k|        ref_pixel_map_t *ps_pos_phase;
  418|  1.55k|        WORD32 i4_phase1, i4_phase2;
  419|       |
  420|  1.55k|        pi2_ref_data_byte = pi2_inp_data;
  421|  1.55k|        ps_pos_phase = ps_lyr_ctxt->s_chroma_map_ctxt.ps_x_pos_phase;
  422|       |
  423|       |        /* ----------- Horizontal Interpolation ---------------- */
  424|  1.55k|        pi4_ref_array = (WORD32 *) ps_ctxt->pi2_refarray_buffer;
  425|  1.55k|        i4_phase1 = ps_pos_phase[0].i2_phase;
  426|  1.55k|        i4_phase2 = (i4_phase1 + 8) & 0x0F;
  427|       |
  428|  7.79k|        for(i4_i = 0; i4_i < SUB_BLOCK_HEIGHT; i4_i++)
  ------------------
  |  |   62|  7.79k|#define SUB_BLOCK_HEIGHT 4
  ------------------
  |  Branch (428:23): [True: 6.23k, False: 1.55k]
  ------------------
  429|  6.23k|        {
  430|  6.23k|            WORD16 i2_coeff1, i2_coeff2;
  431|  6.23k|            i2_coeff1 = (WORD16) (pi2_ref_data_byte[0]);
  432|       |
  433|       |            /* populate the first inter sample */
  434|  6.23k|            *pi4_ref_array++ = i2_coeff1 << 4;
  435|       |
  436|       |            /* unroll count 1 */
  437|  6.23k|            i2_coeff2 = (WORD16) (pi2_ref_data_byte[2]);
  438|       |
  439|       |            /* populate 2 samples based on current coeffs */
  440|  6.23k|            *pi4_ref_array++ = ((16 - i4_phase2) * i2_coeff1 + i4_phase2 * i2_coeff2);
  441|       |
  442|       |            /* unroll count 2 */
  443|  6.23k|            *pi4_ref_array++ = ((16 - i4_phase1) * i2_coeff1 + i4_phase1 * i2_coeff2);
  444|       |
  445|       |            /* unroll count 3 */
  446|  6.23k|            i2_coeff1 = (WORD16) (pi2_ref_data_byte[4]);
  447|       |
  448|       |            /* populate 2 samples based on current coeffs */
  449|  6.23k|            *pi4_ref_array++ = ((16 - i4_phase2) * i2_coeff2 + i4_phase2 * i2_coeff1);
  450|       |
  451|       |            /* unroll count 4 */
  452|  6.23k|            *pi4_ref_array++ = ((16 - i4_phase1) * i2_coeff2 + i4_phase1 * i2_coeff1);
  453|       |
  454|       |            /* unroll count 5 */
  455|  6.23k|            i2_coeff2 = (WORD16) (pi2_ref_data_byte[6]);
  456|       |
  457|       |            /* populate 2 samples based on current coeffs */
  458|  6.23k|            *pi4_ref_array++ = ((16 - i4_phase2) * i2_coeff1 + i4_phase2 * i2_coeff2);
  459|       |
  460|       |            /* unroll count 6 */
  461|  6.23k|            *pi4_ref_array++ = ((16 - i4_phase1) * i2_coeff1 + i4_phase1 * i2_coeff2);
  462|       |
  463|       |            /* populate the last inter sample */
  464|  6.23k|            *pi4_ref_array++ = i2_coeff2 << 4;
  465|       |
  466|       |            /* vertical loop uopdates */
  467|  6.23k|            pi2_ref_data_byte = pi2_inp_data + ((i4_i + 1) * i4_inp_data_stride);
  468|  6.23k|        }
  469|       |
  470|       |        /* ----------- Vertical Interpolation ---------------- */
  471|  1.55k|        pi4_ref_array = (WORD32 *) ps_ctxt->pi2_refarray_buffer;
  472|  1.55k|        ps_pos_phase = ps_lyr_ctxt->s_chroma_map_ctxt.ps_y_pos_phase;
  473|  1.55k|        i4_phase1 = ps_pos_phase[0].i2_phase;
  474|  1.55k|        i4_phase2 = (i4_phase1 + 8) & 0x0F;
  475|       |
  476|  14.0k|        for(i4_i = 0; i4_i < BLOCK_WIDTH; i4_i++)
  ------------------
  |  |   64|  14.0k|#define BLOCK_WIDTH 8
  ------------------
  |  Branch (476:23): [True: 12.4k, False: 1.55k]
  ------------------
  477|  12.4k|        {
  478|  12.4k|            WORD16 *pi2_out;
  479|  12.4k|            WORD32 *pi4_ref_array_temp;
  480|  12.4k|            WORD32 i4_horz_samp_1, i4_horz_samp_2;
  481|  12.4k|            pi2_out = pi2_out_res;
  482|  12.4k|            pi4_ref_array_temp = pi4_ref_array;
  483|       |
  484|       |            /* populate the first inter sample */
  485|  12.4k|            i4_horz_samp_1 = *pi4_ref_array_temp;
  486|  12.4k|            pi4_ref_array_temp += BLOCK_WIDTH;
  ------------------
  |  |   64|  12.4k|#define BLOCK_WIDTH 8
  ------------------
  487|  12.4k|            *pi2_out = (i4_horz_samp_1 + 8) >> 4;
  488|  12.4k|            pi2_out += i4_out_res_stride;
  489|       |
  490|       |            /* unroll count 1 */
  491|  12.4k|            i4_horz_samp_2 = *pi4_ref_array_temp;
  492|  12.4k|            pi4_ref_array_temp += BLOCK_WIDTH;
  ------------------
  |  |   64|  12.4k|#define BLOCK_WIDTH 8
  ------------------
  493|       |
  494|       |            /* populate 2 samples based on current coeffs */
  495|  12.4k|            *pi2_out = ((16 - i4_phase2) * i4_horz_samp_1 + i4_phase2 * i4_horz_samp_2 + 128) >> 8;
  496|  12.4k|            pi2_out += i4_out_res_stride;
  497|       |
  498|       |            /* unroll count 2 */
  499|  12.4k|            *pi2_out = ((16 - i4_phase1) * i4_horz_samp_1 + i4_phase1 * i4_horz_samp_2 + 128) >> 8;
  500|  12.4k|            pi2_out += i4_out_res_stride;
  501|       |
  502|       |            /* unroll count 3 */
  503|  12.4k|            i4_horz_samp_1 = *pi4_ref_array_temp;
  504|  12.4k|            pi4_ref_array_temp += BLOCK_WIDTH;
  ------------------
  |  |   64|  12.4k|#define BLOCK_WIDTH 8
  ------------------
  505|       |
  506|       |            /* populate 2 samples based on current coeffs */
  507|  12.4k|            *pi2_out = ((16 - i4_phase2) * i4_horz_samp_2 + i4_phase2 * i4_horz_samp_1 + 128) >> 8;
  508|  12.4k|            pi2_out += i4_out_res_stride;
  509|       |
  510|       |            /* unroll count 4 */
  511|  12.4k|            *pi2_out = ((16 - i4_phase1) * i4_horz_samp_2 + i4_phase1 * i4_horz_samp_1 + 128) >> 8;
  512|  12.4k|            pi2_out += i4_out_res_stride;
  513|       |
  514|       |            /* unroll count 5 */
  515|  12.4k|            i4_horz_samp_2 = *pi4_ref_array_temp;
  516|       |
  517|       |            /* populate 2 samples based on current coeffs */
  518|  12.4k|            *pi2_out = ((16 - i4_phase2) * i4_horz_samp_1 + i4_phase2 * i4_horz_samp_2 + 128) >> 8;
  519|  12.4k|            pi2_out += i4_out_res_stride;
  520|       |
  521|       |            /* unroll count 6 */
  522|  12.4k|            *pi2_out = ((16 - i4_phase1) * i4_horz_samp_1 + i4_phase1 * i4_horz_samp_2 + 128) >> 8;
  523|  12.4k|            pi2_out += i4_out_res_stride;
  524|       |
  525|       |            /* populate the last inter sample */
  526|  12.4k|            *pi2_out = (i4_horz_samp_2 + 8) >> 4;
  527|       |
  528|       |            /* horizontal loop updates */
  529|  12.4k|            pi4_ref_array++;
  530|  12.4k|            pi2_out_res += 2;
  531|  12.4k|        }
  532|  1.55k|    }
  533|  1.55k|    return;
  534|  1.55k|}
isvcd_residual_luma_dyadic:
  572|  20.6k|{
  573|  20.6k|    WORD16 *pi2_refarray_buffer;
  574|  20.6k|    WORD32 i4_blk_ctr;
  575|  20.6k|    residual_sampling_ctxt_t *ps_ctxt;
  576|       |
  577|  20.6k|    UNUSED(ps_ref_mb_mode);
  ------------------
  |  |   45|  20.6k|#define UNUSED(x) ((void)(x))
  ------------------
  578|  20.6k|    UNUSED(u2_mb_x);
  ------------------
  |  |   45|  20.6k|#define UNUSED(x) ((void)(x))
  ------------------
  579|  20.6k|    UNUSED(u2_mb_y);
  ------------------
  |  |   45|  20.6k|#define UNUSED(x) ((void)(x))
  ------------------
  580|       |
  581|  20.6k|    ps_ctxt = (residual_sampling_ctxt_t *) pv_residual_samp_ctxt;
  582|  20.6k|    pi2_refarray_buffer = ps_ctxt->pi2_refarray_buffer;
  583|       |
  584|       |    /* based on transform size the counter and interpolation width and */
  585|       |    /* height are intialised as follows                                */
  586|  20.6k|    if((i4_ref_tx_size) && (0 != i4_ref_nnz))
  ------------------
  |  Branch (586:8): [True: 1.68k, False: 18.9k]
  |  Branch (586:28): [True: 1.43k, False: 251]
  ------------------
  587|  1.43k|    {
  588|  1.43k|        WORD16 *pi2_ref_data_byte;
  589|  1.43k|        WORD32 *pi4_ref_array;
  590|  1.43k|        WORD32 i4_i, i4_j;
  591|       |
  592|  1.43k|        pi2_ref_data_byte = pi2_inp_data;
  593|       |
  594|       |        /* ----------- Horizontal Interpolation ---------------- */
  595|  1.43k|        pi4_ref_array = (WORD32 *) pi2_refarray_buffer;
  596|  12.9k|        for(i4_i = 0; i4_i < BLOCK_HEIGHT; i4_i++)
  ------------------
  |  |   65|  12.9k|#define BLOCK_HEIGHT 8
  ------------------
  |  Branch (596:23): [True: 11.4k, False: 1.43k]
  ------------------
  597|  11.4k|        {
  598|  11.4k|            WORD16 i2_coeff1, i2_coeff2;
  599|  11.4k|            i2_coeff1 = (WORD16) (*pi2_ref_data_byte++);
  600|       |
  601|       |            /* populate the first inter sample */
  602|  11.4k|            *pi4_ref_array++ = i2_coeff1 << 2;
  603|       |
  604|  91.9k|            for(i4_j = 0; i4_j < 14; i4_j += 2)
  ------------------
  |  Branch (604:27): [True: 80.4k, False: 11.4k]
  ------------------
  605|  80.4k|            {
  606|  80.4k|                i2_coeff2 = (WORD16) (*pi2_ref_data_byte++);
  607|       |
  608|       |                /* populate 2 samples based on current coeffs */
  609|  80.4k|                *pi4_ref_array++ = ((i2_coeff1 << 1) + (i2_coeff1) + (i2_coeff2));
  610|  80.4k|                *pi4_ref_array++ = ((i2_coeff2 << 1) + (i2_coeff2) + (i2_coeff1));
  611|       |
  612|       |                /* store the coeff 2 to coeff 1 */
  613|       |                /* (used in next iteration)     */
  614|  80.4k|                i2_coeff1 = i2_coeff2;
  615|  80.4k|            }
  616|       |
  617|       |            /* populate the last inter sample */
  618|  11.4k|            *pi4_ref_array++ = i2_coeff1 << 2;
  619|       |
  620|       |            /* vertical loop uopdates */
  621|  11.4k|            pi2_ref_data_byte = pi2_inp_data + ((i4_i + 1) * i4_inp_data_stride);
  622|  11.4k|        }
  623|       |
  624|       |        /* ----------- Vertical Interpolation ---------------- */
  625|  1.43k|        pi4_ref_array = (WORD32 *) pi2_refarray_buffer;
  626|       |
  627|  24.4k|        for(i4_i = 0; i4_i < MB_WIDTH; i4_i++)
  ------------------
  |  |   67|  24.4k|#define MB_WIDTH 16
  ------------------
  |  Branch (627:23): [True: 22.9k, False: 1.43k]
  ------------------
  628|  22.9k|        {
  629|  22.9k|            WORD32 *pi4_ref_array_temp;
  630|  22.9k|            WORD16 *pi2_out;
  631|  22.9k|            WORD32 i4_horz_samp_1, i4_horz_samp_2;
  632|       |
  633|  22.9k|            pi4_ref_array_temp = pi4_ref_array;
  634|  22.9k|            pi2_out = pi2_out_res;
  635|  22.9k|            i4_horz_samp_1 = *pi4_ref_array_temp;
  636|       |
  637|       |            /* populate the first inter sample */
  638|  22.9k|            *pi2_out = (i4_horz_samp_1 + 2) >> 2;
  639|  22.9k|            pi2_out += i4_out_res_stride;
  640|       |
  641|   183k|            for(i4_j = 0; i4_j < 14; i4_j += 2)
  ------------------
  |  Branch (641:27): [True: 160k, False: 22.9k]
  ------------------
  642|   160k|            {
  643|   160k|                pi4_ref_array_temp += MB_WIDTH;
  ------------------
  |  |   67|   160k|#define MB_WIDTH 16
  ------------------
  644|   160k|                i4_horz_samp_2 = *pi4_ref_array_temp;
  645|       |
  646|       |                /* populate 2 samples based on current coeffs */
  647|   160k|                *pi2_out = ((i4_horz_samp_1 << 1) + (i4_horz_samp_1) + (i4_horz_samp_2) + 8) >> 4;
  648|   160k|                pi2_out += i4_out_res_stride;
  649|   160k|                *pi2_out = ((i4_horz_samp_2 << 1) + (i4_horz_samp_2) + (i4_horz_samp_1) + 8) >> 4;
  650|   160k|                pi2_out += i4_out_res_stride;
  651|       |
  652|       |                /* store the coeff 2 to coeff 1 */
  653|       |                /* (used in next iteration)     */
  654|   160k|                i4_horz_samp_1 = i4_horz_samp_2;
  655|   160k|            }
  656|       |
  657|       |            /* populate the first inter sample */
  658|  22.9k|            *pi2_out = (i4_horz_samp_1 + 2) >> 2;
  659|       |
  660|       |            /* horizontal loop updates */
  661|  22.9k|            pi4_ref_array++;
  662|  22.9k|            pi2_out_res++;
  663|  22.9k|        }
  664|  1.43k|    }
  665|  19.2k|    else
  666|  19.2k|    {
  667|       |        /* ----------------------------------------------------------------- */
  668|       |        /* LOOP over number of blocks                                        */
  669|       |        /* ----------------------------------------------------------------- */
  670|  96.0k|        for(i4_blk_ctr = 0; i4_blk_ctr < 4; i4_blk_ctr++)
  ------------------
  |  Branch (670:29): [True: 76.8k, False: 19.2k]
  ------------------
  671|  76.8k|        {
  672|  76.8k|            WORD16 *pi2_ref_data_byte;
  673|  76.8k|            WORD32 *pi4_ref_array;
  674|  76.8k|            WORD32 i4_i;
  675|       |
  676|       |            /* if reference layer is not coded then no processing */
  677|  76.8k|            if(0 != (i4_ref_nnz & 0x1))
  ------------------
  |  Branch (677:16): [True: 6.73k, False: 70.1k]
  ------------------
  678|  6.73k|            {
  679|  6.73k|                pi2_ref_data_byte = pi2_inp_data;
  680|       |
  681|       |                /* ----------- Horizontal Interpolation ---------------- */
  682|  6.73k|                pi4_ref_array = (WORD32 *) pi2_refarray_buffer;
  683|       |
  684|  33.6k|                for(i4_i = 0; i4_i < SUB_BLOCK_HEIGHT; i4_i++)
  ------------------
  |  |   62|  33.6k|#define SUB_BLOCK_HEIGHT 4
  ------------------
  |  Branch (684:31): [True: 26.9k, False: 6.73k]
  ------------------
  685|  26.9k|                {
  686|  26.9k|                    WORD16 i2_coeff1, i2_coeff2;
  687|  26.9k|                    i2_coeff1 = (WORD16) (*pi2_ref_data_byte++);
  688|       |
  689|       |                    /* populate the first inter sample */
  690|  26.9k|                    *pi4_ref_array++ = i2_coeff1 << 2;
  691|       |
  692|  26.9k|                    i2_coeff2 = (WORD16) (*pi2_ref_data_byte++);
  693|       |
  694|       |                    /* populate 2 samples based on current coeffs */
  695|  26.9k|                    *pi4_ref_array++ = ((i2_coeff1 << 1) + (i2_coeff1) + (i2_coeff2));
  696|  26.9k|                    *pi4_ref_array++ = ((i2_coeff2 << 1) + (i2_coeff2) + (i2_coeff1));
  697|       |
  698|  26.9k|                    i2_coeff1 = (WORD16) (*pi2_ref_data_byte++);
  699|       |
  700|       |                    /* populate 2 samples based on current coeffs */
  701|  26.9k|                    *pi4_ref_array++ = ((i2_coeff2 << 1) + (i2_coeff2) + (i2_coeff1));
  702|  26.9k|                    *pi4_ref_array++ = ((i2_coeff1 << 1) + (i2_coeff1) + (i2_coeff2));
  703|       |
  704|  26.9k|                    i2_coeff2 = (WORD16) (*pi2_ref_data_byte++);
  705|       |
  706|       |                    /* populate 2 samples based on current coeffs */
  707|  26.9k|                    *pi4_ref_array++ = ((i2_coeff1 << 1) + (i2_coeff1) + (i2_coeff2));
  708|  26.9k|                    *pi4_ref_array++ = ((i2_coeff2 << 1) + (i2_coeff2) + (i2_coeff1));
  709|       |
  710|       |                    /* populate the last inter sample */
  711|  26.9k|                    *pi4_ref_array++ = i2_coeff2 << 2;
  712|       |
  713|       |                    /* vertical loop uopdates */
  714|  26.9k|                    pi2_ref_data_byte = pi2_inp_data + ((i4_i + 1) * i4_inp_data_stride);
  715|  26.9k|                }
  716|       |
  717|       |                /* ----------- Vertical Interpolation ---------------- */
  718|  6.73k|                pi4_ref_array = (WORD32 *) pi2_refarray_buffer;
  719|       |
  720|  60.6k|                for(i4_i = 0; i4_i < BLOCK_WIDTH; i4_i++)
  ------------------
  |  |   64|  60.6k|#define BLOCK_WIDTH 8
  ------------------
  |  Branch (720:31): [True: 53.8k, False: 6.73k]
  ------------------
  721|  53.8k|                {
  722|  53.8k|                    WORD32 *pi4_ref_array_temp;
  723|  53.8k|                    WORD16 *pi2_out;
  724|  53.8k|                    WORD32 i4_horz_samp_1, i4_horz_samp_2;
  725|       |
  726|  53.8k|                    pi4_ref_array_temp = pi4_ref_array;
  727|  53.8k|                    pi2_out = pi2_out_res;
  728|  53.8k|                    i4_horz_samp_1 = *pi4_ref_array_temp;
  729|       |
  730|       |                    /* populate the first inter sample */
  731|  53.8k|                    *pi2_out = (i4_horz_samp_1 + 2) >> 2;
  732|  53.8k|                    pi2_out += i4_out_res_stride;
  733|       |
  734|       |                    /* unroll loop count 1 */
  735|  53.8k|                    pi4_ref_array_temp += BLOCK_WIDTH;
  ------------------
  |  |   64|  53.8k|#define BLOCK_WIDTH 8
  ------------------
  736|  53.8k|                    i4_horz_samp_2 = *pi4_ref_array_temp;
  737|       |
  738|       |                    /* populate 2 samples based on current coeffs */
  739|  53.8k|                    *pi2_out =
  740|  53.8k|                        ((i4_horz_samp_1 << 1) + (i4_horz_samp_1) + (i4_horz_samp_2) + 8) >> 4;
  741|  53.8k|                    pi2_out += i4_out_res_stride;
  742|  53.8k|                    *pi2_out =
  743|  53.8k|                        ((i4_horz_samp_2 << 1) + (i4_horz_samp_2) + (i4_horz_samp_1) + 8) >> 4;
  744|  53.8k|                    pi2_out += i4_out_res_stride;
  745|       |
  746|       |                    /* unroll loop count 2 */
  747|  53.8k|                    pi4_ref_array_temp += BLOCK_WIDTH;
  ------------------
  |  |   64|  53.8k|#define BLOCK_WIDTH 8
  ------------------
  748|  53.8k|                    i4_horz_samp_1 = *pi4_ref_array_temp;
  749|       |
  750|       |                    /* populate 2 samples based on current coeffs */
  751|  53.8k|                    *pi2_out =
  752|  53.8k|                        ((i4_horz_samp_2 << 1) + (i4_horz_samp_2) + (i4_horz_samp_1) + 8) >> 4;
  753|  53.8k|                    pi2_out += i4_out_res_stride;
  754|  53.8k|                    *pi2_out =
  755|  53.8k|                        ((i4_horz_samp_1 << 1) + (i4_horz_samp_1) + (i4_horz_samp_2) + 8) >> 4;
  756|  53.8k|                    pi2_out += i4_out_res_stride;
  757|       |
  758|       |                    /* unroll loop count 3 */
  759|  53.8k|                    pi4_ref_array_temp += BLOCK_WIDTH;
  ------------------
  |  |   64|  53.8k|#define BLOCK_WIDTH 8
  ------------------
  760|  53.8k|                    i4_horz_samp_2 = *pi4_ref_array_temp;
  761|       |
  762|       |                    /* populate 2 samples based on current coeffs */
  763|  53.8k|                    *pi2_out =
  764|  53.8k|                        ((i4_horz_samp_1 << 1) + (i4_horz_samp_1) + (i4_horz_samp_2) + 8) >> 4;
  765|  53.8k|                    pi2_out += i4_out_res_stride;
  766|  53.8k|                    *pi2_out =
  767|  53.8k|                        ((i4_horz_samp_2 << 1) + (i4_horz_samp_2) + (i4_horz_samp_1) + 8) >> 4;
  768|  53.8k|                    pi2_out += i4_out_res_stride;
  769|       |
  770|       |                    /* populate the last inter sample */
  771|  53.8k|                    *pi2_out = (i4_horz_samp_2 + 2) >> 2;
  772|       |
  773|       |                    /* horizontal loop updates */
  774|  53.8k|                    pi4_ref_array++;
  775|  53.8k|                    pi2_out_res++;
  776|  53.8k|                }
  777|  6.73k|            }
  778|  70.1k|            else
  779|  70.1k|            {
  780|  70.1k|                pi2_out_res += BLOCK_WIDTH;
  ------------------
  |  |   64|  70.1k|#define BLOCK_WIDTH 8
  ------------------
  781|  70.1k|            }
  782|       |
  783|       |            /* Block level loop updates */
  784|  76.8k|            if(1 == i4_blk_ctr)
  ------------------
  |  Branch (784:16): [True: 19.2k, False: 57.6k]
  ------------------
  785|  19.2k|            {
  786|  19.2k|                pi2_inp_data -= SUB_BLOCK_WIDTH;
  ------------------
  |  |   61|  19.2k|#define SUB_BLOCK_WIDTH 4
  ------------------
  787|  19.2k|                pi2_inp_data += (i4_inp_data_stride * SUB_BLOCK_HEIGHT);
  ------------------
  |  |   62|  19.2k|#define SUB_BLOCK_HEIGHT 4
  ------------------
  788|  19.2k|                pi2_out_res -= MB_WIDTH;
  ------------------
  |  |   67|  19.2k|#define MB_WIDTH 16
  ------------------
  789|  19.2k|                pi2_out_res += (i4_out_res_stride * BLOCK_HEIGHT);
  ------------------
  |  |   65|  19.2k|#define BLOCK_HEIGHT 8
  ------------------
  790|  19.2k|                i4_ref_nnz >>= 2;
  791|  19.2k|            }
  792|  57.6k|            else
  793|  57.6k|            {
  794|  57.6k|                pi2_inp_data += SUB_BLOCK_WIDTH;
  ------------------
  |  |   61|  57.6k|#define SUB_BLOCK_WIDTH 4
  ------------------
  795|  57.6k|            }
  796|       |
  797|  76.8k|            i4_ref_nnz >>= 1;
  798|       |
  799|  76.8k|        } /* end of loop over all the blocks */
  800|  19.2k|    }
  801|  20.6k|    return;
  802|  20.6k|}
isvcd_ref_layer_ptr_incr:
  839|   336k|{
  840|   336k|    WORD32 i4_x, i4_y;
  841|   336k|    WORD32 i4_x_idx, i4_y_idx;
  842|   336k|    WORD32 i4_prev_x, i4_prev_y;
  843|   336k|    WORD32 i4_const_val;
  844|   336k|    WORD32 i4_pos_x, i4_pos_y;
  845|   336k|    WORD32 i4_trans_size;
  846|   336k|    WORD32 i4_act_ary_wd, i4_act_ary_ht;
  847|   336k|    WORD32 i4_and_const;
  848|   336k|    UWORD8 *pu1_incr_x, *pu1_incr_y;
  849|   336k|    WORD32 i4_mb_sft;
  850|   336k|    WORD32 i4_mb_x, i4_mb_y;
  851|   336k|    WORD8 *pi1_ref_mb_modes_incr;
  852|   336k|    WORD8 *pi1_ref_mb_modes_incr_temp;
  853|   336k|    inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms;
  854|   336k|    WORD32 i4_mb_x_strt, i4_mb_y_strt;
  855|   336k|    WORD32 i4_mb_quard1_part_x, i4_mb_quard1_part_y;
  856|   336k|    WORD32 i4_x_ref, i4_y_ref;
  857|   336k|    WORD32 i4_tx_size, i4_tx_size_q0, i4_tx_size_q1, i4_tx_size_q2, i4_tx_size_q3;
  858|   336k|    WORD8 i1_mb_mode_q0, i1_mb_mode_q1, i1_mb_mode_q2, i1_mb_mode_q3;
  859|   336k|    WORD32 i4_mb_wd;
  860|   336k|    WORD32 i4_mb_ht;
  861|       |
  862|   336k|    i4_mb_wd = MB_WIDTH >> i4_chroma_flag;
  ------------------
  |  |   67|   336k|#define MB_WIDTH 16
  ------------------
  863|   336k|    i4_mb_ht = MB_HEIGHT >> i4_chroma_flag;
  ------------------
  |  |   68|   336k|#define MB_HEIGHT 16
  ------------------
  864|       |
  865|       |    /* Memset to 1 the increment buffers */
  866|   336k|    memset(pu1_ref_x_ptr_incr, 1, (i4_refary_wd * i4_refary_ht));
  867|   336k|    memset(pu1_ref_y_ptr_incr, 1, (i4_refary_wd * i4_refary_ht));
  868|       |
  869|       |    /* Initialise actual width and height */
  870|   336k|    i4_act_ary_wd = i4_refary_wd;
  871|   336k|    i4_act_ary_ht = i4_refary_ht;
  872|       |
  873|       |    /* Initialize x and y */
  874|   336k|    i4_x = 0;
  875|   336k|    i4_y = 0;
  876|   336k|    i4_prev_y = 0;
  877|   336k|    i4_mb_sft = (MB_WIDTH_SHIFT - i4_chroma_flag);
  ------------------
  |  |   70|   336k|#define MB_WIDTH_SHIFT 4
  ------------------
  878|       |
  879|       |    /* Loop over all MBs in the reference array */
  880|   336k|    if(0 == i4_chroma_flag)
  ------------------
  |  Branch (880:8): [True: 112k, False: 224k]
  ------------------
  881|   112k|    {
  882|   112k|        i4_x_ref = i4_x_offset + 0;
  883|   112k|        i4_y_ref = i4_y_offset + 0;
  884|   112k|        i4_mb_x_strt = i4_x_ref % i4_mb_wd;
  885|   112k|        i4_mb_y_strt = i4_y_ref % i4_mb_ht;
  886|   112k|        i4_mb_quard1_part_x = i4_mb_wd - i4_mb_x_strt;
  887|   112k|        i4_mb_quard1_part_y = i4_mb_ht - i4_mb_y_strt;
  888|       |
  889|   112k|        if(!(i4_mb_quard1_part_x >= 0))
  ------------------
  |  Branch (889:12): [True: 0, False: 112k]
  ------------------
  890|      0|        {
  891|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  892|      0|        }
  893|   112k|        if(!(i4_mb_quard1_part_y >= 0))
  ------------------
  |  Branch (893:12): [True: 0, False: 112k]
  ------------------
  894|      0|        {
  895|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  896|      0|        }
  897|       |
  898|       |        /* Take care of negative offsets */
  899|   112k|        if(i4_x_ref > 0)
  ------------------
  |  Branch (899:12): [True: 73.9k, False: 38.1k]
  ------------------
  900|  73.9k|        {
  901|  73.9k|            i4_mb_x = (i4_x_ref >> i4_mb_sft);
  902|  73.9k|        }
  903|  38.1k|        else
  904|  38.1k|        {
  905|  38.1k|            i4_mb_x = 0;
  906|  38.1k|        }
  907|   112k|        if(i4_y_ref > 0)
  ------------------
  |  Branch (907:12): [True: 94.6k, False: 17.4k]
  ------------------
  908|  94.6k|        {
  909|  94.6k|            i4_mb_y = (i4_y_ref >> i4_mb_sft);
  910|  94.6k|        }
  911|  17.4k|        else
  912|  17.4k|        {
  913|  17.4k|            i4_mb_y = 0;
  914|  17.4k|        }
  915|       |
  916|       |        /* get the location of the byte which has the current mb mode */
  917|   112k|        pi1_ref_mb_modes_incr = pi1_ref_mb_modes + (i4_mb_y * i4_ref_mode_stride * i4_element_size);
  918|   112k|        pi1_ref_mb_modes_incr += (i4_mb_x * i4_element_size);
  919|   112k|        ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) pi1_ref_mb_modes_incr;
  920|   112k|        i1_mb_mode_q0 = ps_inter_lyr_mb_prms->i1_mb_mode;
  921|   112k|        i4_tx_size_q0 =
  922|   112k|            (i1_mb_mode_q0 <= SVC_INTER_MB)
  ------------------
  |  |  114|   112k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (922:13): [True: 106k, False: 5.85k]
  ------------------
  923|   112k|                ? ((ps_inter_lyr_mb_prms->i1_tx_size < 0) ? 1 : ps_inter_lyr_mb_prms->i1_tx_size)
  ------------------
  |  Branch (923:20): [True: 0, False: 106k]
  ------------------
  924|   112k|                : 1;
  925|       |
  926|   112k|        pi1_ref_mb_modes_incr_temp = pi1_ref_mb_modes_incr;
  927|   112k|        if(i4_mb_quard1_part_x > 0)
  ------------------
  |  Branch (927:12): [True: 112k, False: 0]
  ------------------
  928|   112k|        {
  929|   112k|            pi1_ref_mb_modes_incr_temp = pi1_ref_mb_modes_incr + i4_element_size;
  930|   112k|            ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) pi1_ref_mb_modes_incr_temp;
  931|   112k|            i1_mb_mode_q1 = ps_inter_lyr_mb_prms->i1_mb_mode;
  932|   112k|            i4_tx_size_q1 =
  933|   112k|                (i1_mb_mode_q1 <= SVC_INTER_MB)
  ------------------
  |  |  114|   112k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (933:17): [True: 105k, False: 6.73k]
  ------------------
  934|   112k|                    ? ((ps_inter_lyr_mb_prms->i1_tx_size < 0) ? 1
  ------------------
  |  Branch (934:24): [True: 35.2k, False: 70.1k]
  ------------------
  935|   105k|                                                              : ps_inter_lyr_mb_prms->i1_tx_size)
  936|   112k|                    : 1;
  937|   112k|        }
  938|       |
  939|   112k|        if(i4_mb_quard1_part_y > 0)
  ------------------
  |  Branch (939:12): [True: 112k, False: 0]
  ------------------
  940|   112k|        {
  941|   112k|            pi1_ref_mb_modes_incr_temp =
  942|   112k|                pi1_ref_mb_modes_incr + (i4_ref_mode_stride * i4_element_size);
  943|   112k|            ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) pi1_ref_mb_modes_incr_temp;
  944|   112k|            i1_mb_mode_q2 = ps_inter_lyr_mb_prms->i1_mb_mode;
  945|   112k|            i4_tx_size_q2 =
  946|   112k|                (i1_mb_mode_q2 <= SVC_INTER_MB)
  ------------------
  |  |  114|   112k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (946:17): [True: 105k, False: 6.36k]
  ------------------
  947|   112k|                    ? ((ps_inter_lyr_mb_prms->i1_tx_size < 0) ? 1
  ------------------
  |  Branch (947:24): [True: 6.36k, False: 99.3k]
  ------------------
  948|   105k|                                                              : ps_inter_lyr_mb_prms->i1_tx_size)
  949|   112k|                    : 1;
  950|   112k|        }
  951|       |
  952|   112k|        if((i4_mb_quard1_part_x > 0) && (i4_mb_quard1_part_y > 0))
  ------------------
  |  Branch (952:12): [True: 112k, False: 0]
  |  Branch (952:41): [True: 112k, False: 0]
  ------------------
  953|   112k|        {
  954|   112k|            pi1_ref_mb_modes_incr_temp =
  955|   112k|                pi1_ref_mb_modes_incr + (i4_ref_mode_stride * i4_element_size) + i4_element_size;
  956|   112k|            ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) pi1_ref_mb_modes_incr_temp;
  957|   112k|            i1_mb_mode_q3 = ps_inter_lyr_mb_prms->i1_mb_mode;
  958|   112k|            i4_tx_size_q3 =
  959|   112k|                (i1_mb_mode_q3 <= SVC_INTER_MB)
  ------------------
  |  |  114|   112k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (959:17): [True: 106k, False: 5.79k]
  ------------------
  960|   112k|                    ? ((ps_inter_lyr_mb_prms->i1_tx_size < 0) ? 1
  ------------------
  |  Branch (960:24): [True: 40.1k, False: 66.1k]
  ------------------
  961|   106k|                                                              : ps_inter_lyr_mb_prms->i1_tx_size)
  962|   112k|                    : 1;
  963|   112k|        }
  964|       |
  965|   112k|        do
  966|   448k|        {
  967|   448k|            WORD32 i4_idx;
  968|   448k|            WORD32 i4_wd, i4_ht;
  969|   448k|            WORD32 i4_max_pos_x, i4_max_pos_y;
  970|       |
  971|   448k|            i4_prev_x = i4_x;
  972|   448k|            i4_x_ref = i4_x_offset + i4_x;
  973|   448k|            i4_y_ref = i4_y_offset + i4_y;
  974|   448k|            i4_tx_size = i4_tx_size_q0;
  975|   448k|            if(i4_x >= i4_mb_quard1_part_x)
  ------------------
  |  Branch (975:16): [True: 147k, False: 300k]
  ------------------
  976|   147k|            {
  977|   147k|                if(i4_y < i4_mb_quard1_part_y)
  ------------------
  |  Branch (977:20): [True: 85.7k, False: 62.1k]
  ------------------
  978|  85.7k|                {
  979|  85.7k|                    i4_tx_size = i4_tx_size_q1;
  980|  85.7k|                }
  981|  62.1k|                else if(i4_y >= i4_mb_quard1_part_y)
  ------------------
  |  Branch (981:25): [True: 62.1k, False: 0]
  ------------------
  982|  62.1k|                {
  983|  62.1k|                    i4_tx_size = i4_tx_size_q3;
  984|  62.1k|                }
  985|   147k|            }
  986|   300k|            else if(i4_x < i4_mb_quard1_part_x)
  ------------------
  |  Branch (986:21): [True: 300k, False: 0]
  ------------------
  987|   300k|            {
  988|   300k|                if(i4_y >= i4_mb_quard1_part_y)
  ------------------
  |  Branch (988:20): [True: 127k, False: 173k]
  ------------------
  989|   127k|                {
  990|   127k|                    i4_tx_size = i4_tx_size_q2;
  991|   127k|                }
  992|   300k|            }
  993|       |
  994|       |            /* Get the transform size as 4 or 8 */
  995|   448k|            i4_trans_size = ((i4_tx_size + 1) << 2);
  996|   448k|            i4_const_val = i4_trans_size - 1;
  997|   448k|            i4_and_const = i4_const_val;
  998|       |
  999|       |            /* Fill horizontal tx block edges of current reference mb with 0 */
 1000|   448k|            pu1_incr_x = pu1_ref_x_ptr_incr + i4_x;
 1001|   448k|            pu1_incr_x += (i4_y * i4_refary_wd);
 1002|   448k|            i4_ht = (16 - (i4_y_ref & 0xF));
 1003|   448k|            i4_ht = MIN((i4_act_ary_ht - i4_y), i4_ht);
  ------------------
  |  |   61|   448k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 224k, False: 224k]
  |  |  ------------------
  ------------------
 1004|       |
 1005|   448k|            i4_x_idx = i4_x;
 1006|   448k|            i4_pos_x = i4_x_ref & 0xF;
 1007|   448k|            i4_max_pos_x = 16;
 1008|   448k|            i4_x += (16 - i4_pos_x);
 1009|       |
 1010|       |            /* Get the transform block edge pos */
 1011|   448k|            i4_idx = (i4_const_val - (i4_pos_x & i4_and_const));
 1012|   448k|            i4_x_idx += i4_idx;
 1013|       |
 1014|  1.09M|            while((i4_pos_x < i4_max_pos_x) && (i4_x_idx < i4_act_ary_wd))
  ------------------
  |  Branch (1014:19): [True: 869k, False: 224k]
  |  Branch (1014:48): [True: 645k, False: 224k]
  ------------------
 1015|   645k|            {
 1016|   645k|                WORD32 i4_i;
 1017|   645k|                UWORD8 *pu1_incr;
 1018|       |
 1019|   645k|                pu1_incr = pu1_incr_x + i4_idx;
 1020|  4.57M|                for(i4_i = 0; i4_i < i4_ht; i4_i++)
  ------------------
  |  Branch (1020:31): [True: 3.93M, False: 645k]
  ------------------
 1021|  3.93M|                {
 1022|       |                    /* Fill the block edge with 0s */
 1023|  3.93M|                    *pu1_incr = 0;
 1024|  3.93M|                    pu1_incr += i4_refary_wd;
 1025|  3.93M|                }
 1026|       |
 1027|       |                /* Updates */
 1028|   645k|                i4_pos_x += i4_trans_size;
 1029|   645k|                pu1_incr_x += i4_trans_size;
 1030|   645k|                i4_x_idx += MIN(i4_trans_size, (i4_act_ary_wd - i4_x_idx));
  ------------------
  |  |   61|   645k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 422k, False: 222k]
  |  |  ------------------
  ------------------
 1031|   645k|            }
 1032|       |
 1033|       |            /* Fill vertical tx block edges of current reference mb with 0 */
 1034|   448k|            pu1_incr_y = pu1_ref_y_ptr_incr + i4_prev_x;
 1035|   448k|            pu1_incr_y += (i4_y * i4_refary_wd);
 1036|   448k|            i4_wd = (16 - (i4_x_ref & 0xF));
 1037|   448k|            i4_wd = MIN((i4_act_ary_wd - i4_prev_x), i4_wd);
  ------------------
  |  |   61|   448k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 224k, False: 224k]
  |  |  ------------------
  ------------------
 1038|   448k|            i4_y_idx = i4_y;
 1039|   448k|            i4_pos_y = i4_y_ref & 0xF;
 1040|   448k|            i4_max_pos_y = 16;
 1041|   448k|            i4_y += (16 - i4_pos_y);
 1042|       |
 1043|       |            /* Get the transform block edge pos */
 1044|   448k|            i4_idx = (i4_const_val - (i4_pos_y & i4_and_const));
 1045|   448k|            i4_y_idx += i4_idx;
 1046|       |
 1047|  1.06M|            while((i4_pos_y < i4_max_pos_y) && (i4_y_idx < i4_act_ary_ht))
  ------------------
  |  Branch (1047:19): [True: 836k, False: 224k]
  |  Branch (1047:48): [True: 612k, False: 224k]
  ------------------
 1048|   612k|            {
 1049|   612k|                WORD32 i4_i;
 1050|   612k|                UWORD8 *pu1_incr;
 1051|       |
 1052|   612k|                pu1_incr = pu1_incr_y + i4_idx * i4_refary_wd;
 1053|  4.50M|                for(i4_i = 0; i4_i < i4_wd; i4_i++)
  ------------------
  |  Branch (1053:31): [True: 3.89M, False: 612k]
  ------------------
 1054|  3.89M|                {
 1055|       |                    /* Fill the block edge with 0s */
 1056|  3.89M|                    *pu1_incr = 0;
 1057|  3.89M|                    pu1_incr++;
 1058|  3.89M|                }
 1059|       |
 1060|       |                /* Updates */
 1061|   612k|                i4_pos_y += i4_trans_size;
 1062|   612k|                pu1_incr_y += i4_trans_size * i4_refary_wd;
 1063|   612k|                i4_y_idx += MIN(i4_trans_size, (i4_act_ary_ht - i4_y_idx));
  ------------------
  |  |   61|   612k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 387k, False: 224k]
  |  |  ------------------
  ------------------
 1064|   612k|            }
 1065|       |
 1066|       |            /* Loop updates */
 1067|   448k|            if(i4_x < i4_act_ary_wd)
  ------------------
  |  Branch (1067:16): [True: 224k, False: 224k]
  ------------------
 1068|   224k|            {
 1069|   224k|                i4_y = i4_prev_y;
 1070|   224k|            }
 1071|   224k|            else if(i4_y < i4_act_ary_ht)
  ------------------
  |  Branch (1071:21): [True: 112k, False: 112k]
  ------------------
 1072|   112k|            {
 1073|   112k|                i4_prev_y = i4_y;
 1074|   112k|                i4_x = 0;
 1075|   112k|            }
 1076|       |
 1077|   448k|        } while((i4_y < i4_act_ary_ht) || (i4_x < i4_act_ary_wd));
  ------------------
  |  Branch (1077:17): [True: 336k, False: 112k]
  |  Branch (1077:43): [True: 0, False: 112k]
  ------------------
 1078|       |
 1079|   112k|    } /* End of if 0 == i4_chroma_flag */
 1080|   224k|    else
 1081|   224k|    {
 1082|       |        /* Set the transform size as 4 */
 1083|   224k|        i4_trans_size = 4;
 1084|   224k|        i4_const_val = 3;
 1085|       |
 1086|   224k|        do
 1087|   896k|        {
 1088|   896k|            WORD32 i4_x_ref, i4_y_ref;
 1089|   896k|            WORD32 i4_idx;
 1090|   896k|            WORD32 i4_wd, i4_ht;
 1091|   896k|            WORD32 i4_max_pos_x, i4_max_pos_y;
 1092|       |
 1093|   896k|            i4_prev_x = i4_x;
 1094|   896k|            i4_x_ref = i4_x_offset + i4_x;
 1095|   896k|            i4_y_ref = i4_y_offset + i4_y;
 1096|       |
 1097|       |            /* Fill horizontal tx block edges of current reference mb with 0 */
 1098|   896k|            pu1_incr_x = pu1_ref_x_ptr_incr + i4_x;
 1099|   896k|            pu1_incr_x += (i4_y * i4_refary_wd);
 1100|   896k|            i4_ht = (8 - (i4_y_ref & 0x7));
 1101|   896k|            i4_ht = MIN((i4_act_ary_ht - i4_y), i4_ht);
  ------------------
  |  |   61|   896k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 448k, False: 448k]
  |  |  ------------------
  ------------------
 1102|   896k|            i4_x_idx = i4_x;
 1103|   896k|            i4_pos_x = i4_x_ref & 0x7;
 1104|   896k|            i4_max_pos_x = 8;
 1105|   896k|            i4_x += (8 - i4_pos_x);
 1106|       |
 1107|       |            /* Get the transform block edge pos */
 1108|   896k|            i4_idx = (i4_const_val - (i4_pos_x & 0x3));
 1109|   896k|            i4_x_idx += i4_idx;
 1110|       |
 1111|  1.63M|            while((i4_pos_x < i4_max_pos_x) && (i4_x_idx < i4_act_ary_wd))
  ------------------
  |  Branch (1111:19): [True: 1.19M, False: 448k]
  |  Branch (1111:48): [True: 742k, False: 448k]
  ------------------
 1112|   742k|            {
 1113|   742k|                WORD32 i4_i;
 1114|   742k|                UWORD8 *pu1_incr;
 1115|       |
 1116|   742k|                pu1_incr = pu1_incr_x + i4_idx;
 1117|  3.21M|                for(i4_i = 0; i4_i < i4_ht; i4_i++)
  ------------------
  |  Branch (1117:31): [True: 2.47M, False: 742k]
  ------------------
 1118|  2.47M|                {
 1119|       |                    /* Fill the block edge with 0s */
 1120|  2.47M|                    *pu1_incr = 0;
 1121|  2.47M|                    pu1_incr += i4_refary_wd;
 1122|  2.47M|                }
 1123|       |
 1124|       |                /* Updates */
 1125|   742k|                i4_pos_x += i4_trans_size;
 1126|   742k|                pu1_incr_x += i4_trans_size;
 1127|   742k|                i4_x_idx += MIN(i4_trans_size, (i4_act_ary_wd - i4_x_idx));
  ------------------
  |  |   61|   742k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 293k, False: 448k]
  |  |  ------------------
  ------------------
 1128|   742k|            }
 1129|       |
 1130|       |            /* Fill vertical tx block edges of current reference mb with 0 */
 1131|   896k|            pu1_incr_y = pu1_ref_y_ptr_incr + i4_prev_x;
 1132|   896k|            pu1_incr_y += (i4_y * i4_refary_wd);
 1133|   896k|            i4_wd = (8 - (i4_x_ref & 0x7));
 1134|   896k|            i4_wd = MIN((i4_act_ary_wd - i4_prev_x), i4_wd);
  ------------------
  |  |   61|   896k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 448k, False: 448k]
  |  |  ------------------
  ------------------
 1135|   896k|            i4_y_idx = i4_y;
 1136|   896k|            i4_pos_y = i4_y_ref & 0x7;
 1137|   896k|            i4_max_pos_y = 8;
 1138|   896k|            i4_y += (8 - i4_pos_y);
 1139|       |
 1140|       |            /* Get the transform block edge pos */
 1141|   896k|            i4_idx = (i4_const_val - (i4_pos_y & 0x3));
 1142|   896k|            i4_y_idx += i4_idx;
 1143|       |
 1144|  1.64M|            while((i4_pos_y < i4_max_pos_y) && (i4_y_idx < i4_act_ary_ht))
  ------------------
  |  Branch (1144:19): [True: 1.19M, False: 448k]
  |  Branch (1144:48): [True: 746k, False: 448k]
  ------------------
 1145|   746k|            {
 1146|   746k|                WORD32 i4_i;
 1147|   746k|                UWORD8 *pu1_incr;
 1148|       |
 1149|   746k|                pu1_incr = pu1_incr_y + i4_idx * i4_refary_wd;
 1150|  3.22M|                for(i4_i = 0; i4_i < i4_wd; i4_i++)
  ------------------
  |  Branch (1150:31): [True: 2.48M, False: 746k]
  ------------------
 1151|  2.48M|                {
 1152|       |                    /* Fill the block edge with 0s */
 1153|  2.48M|                    *pu1_incr = 0;
 1154|  2.48M|                    pu1_incr++;
 1155|  2.48M|                }
 1156|       |
 1157|       |                /* Updates */
 1158|   746k|                i4_pos_y += i4_trans_size;
 1159|   746k|                pu1_incr_y += i4_trans_size * i4_refary_wd;
 1160|   746k|                i4_y_idx += MIN(i4_trans_size, (i4_act_ary_ht - i4_y_idx));
  ------------------
  |  |   61|   746k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 298k, False: 448k]
  |  |  ------------------
  ------------------
 1161|   746k|            }
 1162|       |
 1163|       |            /* Loop updates */
 1164|   896k|            if(i4_x < i4_act_ary_wd)
  ------------------
  |  Branch (1164:16): [True: 448k, False: 448k]
  ------------------
 1165|   448k|            {
 1166|   448k|                i4_y = i4_prev_y;
 1167|   448k|            }
 1168|   448k|            else if(i4_y < i4_act_ary_ht)
  ------------------
  |  Branch (1168:21): [True: 224k, False: 224k]
  ------------------
 1169|   224k|            {
 1170|   224k|                i4_prev_y = i4_y;
 1171|   224k|                i4_x = 0;
 1172|   224k|            }
 1173|       |
 1174|   896k|        } while((i4_y < i4_act_ary_ht) || (i4_x < i4_act_ary_wd));
  ------------------
  |  Branch (1174:17): [True: 672k, False: 224k]
  |  Branch (1174:43): [True: 0, False: 224k]
  ------------------
 1175|       |
 1176|   224k|    } /* End of chroma */
 1177|   336k|    return OK;
  ------------------
  |  |  114|   336k|#define OK        0
  ------------------
 1178|       |
 1179|   336k|} /* End of "isvcd_ref_layer_ptr_incr" */
isvcd_residual_reflayer_const_non_boundary_mb:
 1186|  50.9k|{
 1187|  50.9k|    WORD32 i4_x_ref, i4_y_ref;
 1188|  50.9k|    WORD32 i4_x, i4_y;
 1189|  50.9k|    WORD32 i4_ref_mb_type;
 1190|  50.9k|    WORD16 *pi2_ref_data_byte;
 1191|  50.9k|    WORD16 *pi2_ref_array_temp;
 1192|       |
 1193|   477k|    for(i4_y = 0; i4_y < i4_refarray_ht; i4_y++)
  ------------------
  |  Branch (1193:19): [True: 426k, False: 50.9k]
  ------------------
 1194|   426k|    {
 1195|  4.20M|        for(i4_x = 0; i4_x < i4_refarray_wd; i4_x++)
  ------------------
  |  Branch (1195:23): [True: 3.78M, False: 426k]
  ------------------
 1196|  3.78M|        {
 1197|  3.78M|            i4_y_ref = i4_y;
 1198|  3.78M|            i4_x_ref = i4_x;
 1199|       |
 1200|  3.78M|            i4_ref_mb_type = i4_ref_mb_type_q0;
 1201|  3.78M|            if(i4_x >= i4_mb_quard1_part_x)
  ------------------
  |  Branch (1201:16): [True: 1.89M, False: 1.89M]
  ------------------
 1202|  1.89M|            {
 1203|  1.89M|                if(i4_y < i4_mb_quard1_part_y)
  ------------------
  |  Branch (1203:20): [True: 965k, False: 924k]
  ------------------
 1204|   965k|                {
 1205|   965k|                    i4_ref_mb_type = i4_ref_mb_type_q1;
 1206|   965k|                }
 1207|   924k|                else if(i4_y >= i4_mb_quard1_part_y)
  ------------------
  |  Branch (1207:25): [True: 924k, False: 0]
  ------------------
 1208|   924k|                {
 1209|   924k|                    i4_ref_mb_type = i4_ref_mb_type_q3;
 1210|   924k|                }
 1211|  1.89M|            }
 1212|  1.89M|            else if(i4_x < i4_mb_quard1_part_x)
  ------------------
  |  Branch (1212:21): [True: 1.89M, False: 0]
  ------------------
 1213|  1.89M|            {
 1214|  1.89M|                if(i4_y >= i4_mb_quard1_part_y)
  ------------------
  |  Branch (1214:20): [True: 924k, False: 965k]
  ------------------
 1215|   924k|                {
 1216|   924k|                    i4_ref_mb_type = i4_ref_mb_type_q2;
 1217|   924k|                }
 1218|  1.89M|            }
 1219|       |
 1220|       |            /****************************************************************/
 1221|       |            /* Reference layer Residual Buffer is maintained as 8-bit data  */
 1222|       |            /* Buffer and 1-bit sign bit packed buffer. Sign Byte is read   */
 1223|       |            /* and sign of the data sample is extracted depending upon bit  */
 1224|       |            /* postition.                                                   */
 1225|       |            /****************************************************************/
 1226|       |
 1227|       |            /* update the buffer pointers to appropriate locations */
 1228|  3.78M|            pi2_ref_array_temp = pi2_ref_array + i4_x;
 1229|  3.78M|            pi2_ref_array_temp += i4_y * i4_refarray_wd;
 1230|       |
 1231|       |            /* extract the residual value and fill the buffer */
 1232|  3.78M|            if(SVC_INTER_MB == i4_ref_mb_type)
  ------------------
  |  |  114|  3.78M|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (1232:16): [True: 3.41M, False: 367k]
  ------------------
 1233|  3.41M|            {
 1234|       |                /* derive the reference data pointers */
 1235|  3.41M|                pi2_ref_data_byte = pi2_inp_data + (i4_x_ref << i4_chroma_flag);
 1236|  3.41M|                pi2_ref_data_byte += i4_y_ref * i4_inp_data_stride;
 1237|       |
 1238|       |                /* store the residual value */
 1239|  3.41M|                *pi2_ref_array_temp = (WORD16) (*pi2_ref_data_byte);
 1240|  3.41M|            }
 1241|   367k|            else
 1242|   367k|            {
 1243|       |                /* if non inter MB then store the 0 */
 1244|   367k|                *pi2_ref_array_temp = 0;
 1245|   367k|            }
 1246|  3.78M|        }
 1247|   426k|    }
 1248|  50.9k|}
isvcd_residual_reflayer_const_boundary_mb:
 1258|   245k|{
 1259|   245k|    WORD32 i4_x_ref, i4_y_ref;
 1260|   245k|    WORD32 i4_x, i4_y;
 1261|   245k|    WORD16 *pi2_ref_data_byte;
 1262|   245k|    WORD16 *pi2_ref_array_temp;
 1263|       |
 1264|       |    /*Quard 0*/
 1265|  1.68M|    for(i4_y = 0; i4_y < i4_mb_quard1_part_y; i4_y++)
  ------------------
  |  Branch (1265:19): [True: 1.43M, False: 245k]
  ------------------
 1266|  1.43M|    {
 1267|  14.7M|        for(i4_x = 0; i4_x < i4_mb_quard1_part_x; i4_x++)
  ------------------
  |  Branch (1267:23): [True: 13.2M, False: 1.43M]
  ------------------
 1268|  13.2M|        {
 1269|  13.2M|            i4_y_ref = MAX(0, MIN(i4_ref_ht - 1, i4_y + i4_y_offset));
  ------------------
  |  |   60|  26.5M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 385k, False: 12.9M]
  |  |  |  Branch (60:24): [True: 0, False: 13.2M]
  |  |  |  Branch (60:32): [True: 0, False: 12.9M]
  |  |  ------------------
  ------------------
 1270|  13.2M|            i4_x_ref = MAX(0, MIN(i4_ref_wd - 1, i4_x + i4_x_offset));
  ------------------
  |  |   60|  26.5M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 620k, False: 12.6M]
  |  |  |  Branch (60:24): [True: 0, False: 13.2M]
  |  |  |  Branch (60:32): [True: 0, False: 12.6M]
  |  |  ------------------
  ------------------
 1271|       |
 1272|       |            /****************************************************************/
 1273|       |            /* Reference layer Residual Buffer is maintained as 8-bit data  */
 1274|       |            /* Buffer and 1-bit sign bit packed buffer. Sign Byte is read   */
 1275|       |            /* and sign of the data sample is extracted depending upon bit  */
 1276|       |            /* postition.                                                   */
 1277|       |            /****************************************************************/
 1278|       |
 1279|       |            /* update the buffer pointers to appropriate locations */
 1280|  13.2M|            pi2_ref_array_temp = pi2_ref_array + i4_x;
 1281|  13.2M|            pi2_ref_array_temp += i4_y * i4_refarray_wd;
 1282|       |
 1283|       |            /* extract the residual value and fill the buffer */
 1284|  13.2M|            if(SVC_INTER_MB == i4_ref_mb_type_q0)
  ------------------
  |  |  114|  13.2M|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (1284:16): [True: 12.9M, False: 373k]
  ------------------
 1285|  12.9M|            {
 1286|       |                /* input pointer will be pointing to (xoffset,yoffset) */
 1287|       |                /* So subtract the correction to reference location    */
 1288|  12.9M|                if(0 <= i4_x_offset)
  ------------------
  |  Branch (1288:20): [True: 5.73M, False: 7.17M]
  ------------------
 1289|  5.73M|                {
 1290|       |                    /* if only inside frame dimension */
 1291|  5.73M|                    i4_x_ref = i4_x_ref - i4_x_offset;
 1292|  5.73M|                }
 1293|       |
 1294|  12.9M|                if(0 <= i4_y_offset)
  ------------------
  |  Branch (1294:20): [True: 8.38M, False: 4.53M]
  ------------------
 1295|  8.38M|                {
 1296|       |                    /* if only inside frame dimension */
 1297|  8.38M|                    i4_y_ref = i4_y_ref - i4_y_offset;
 1298|  8.38M|                }
 1299|       |                /* derive the reference data pointers */
 1300|       |
 1301|  12.9M|                pi2_ref_data_byte = pi2_inp_data + (i4_x_ref << i4_chroma_flag);
 1302|  12.9M|                pi2_ref_data_byte += i4_y_ref * i4_inp_data_stride;
 1303|       |
 1304|       |                /* store the residual value */
 1305|  12.9M|                *pi2_ref_array_temp = (WORD16) (*pi2_ref_data_byte);
 1306|  12.9M|            }
 1307|   373k|            else
 1308|   373k|            {
 1309|       |                /* if non inter MB then store the 0 */
 1310|   373k|                *pi2_ref_array_temp = 0;
 1311|   373k|            }
 1312|  13.2M|        }
 1313|  1.43M|    }
 1314|       |
 1315|       |    /*Quard 1*/
 1316|  1.68M|    for(i4_y = 0; i4_y < i4_mb_quard1_part_y; i4_y++)
  ------------------
  |  Branch (1316:19): [True: 1.43M, False: 245k]
  ------------------
 1317|  1.43M|    {
 1318|  3.11M|        for(i4_x = i4_mb_quard1_part_x; i4_x < i4_refarray_wd; i4_x++)
  ------------------
  |  Branch (1318:41): [True: 1.67M, False: 1.43M]
  ------------------
 1319|  1.67M|        {
 1320|  1.67M|            i4_y_ref = MAX(0, MIN(i4_ref_ht - 1, i4_y + i4_y_offset));
  ------------------
  |  |   60|  3.34M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 89.1k, False: 1.58M]
  |  |  |  Branch (60:24): [True: 0, False: 1.67M]
  |  |  |  Branch (60:32): [True: 0, False: 1.58M]
  |  |  ------------------
  ------------------
 1321|  1.67M|            i4_x_ref = MAX(0, MIN(i4_ref_wd - 1, i4_x + i4_x_offset));
  ------------------
  |  |   60|  3.34M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 1.67M]
  |  |  |  Branch (60:24): [True: 571k, False: 1.10M]
  |  |  |  Branch (60:32): [True: 571k, False: 1.10M]
  |  |  ------------------
  ------------------
 1322|       |
 1323|       |            /****************************************************************/
 1324|       |            /* Reference layer Residual Buffer is maintained as 8-bit data  */
 1325|       |            /* Buffer and 1-bit sign bit packed buffer. Sign Byte is read   */
 1326|       |            /* and sign of the data sample is extracted depending upon bit  */
 1327|       |            /* postition.                                                   */
 1328|       |            /****************************************************************/
 1329|       |
 1330|       |            /* update the buffer pointers to appropriate locations */
 1331|  1.67M|            pi2_ref_array_temp = pi2_ref_array + i4_x;
 1332|  1.67M|            pi2_ref_array_temp += i4_y * i4_refarray_wd;
 1333|       |
 1334|       |            /* extract the residual value and fill the buffer */
 1335|  1.67M|            if(SVC_INTER_MB == i4_ref_mb_type_q1)
  ------------------
  |  |  114|  1.67M|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (1335:16): [True: 1.58M, False: 88.3k]
  ------------------
 1336|  1.58M|            {
 1337|       |                /* input pointer will be pointing to (xoffset,yoffset) */
 1338|       |                /* So subtract the correction to reference location    */
 1339|  1.58M|                if(0 <= i4_x_offset)
  ------------------
  |  Branch (1339:20): [True: 1.58M, False: 0]
  ------------------
 1340|  1.58M|                {
 1341|       |                    /* if only inside frame dimension */
 1342|  1.58M|                    i4_x_ref = i4_x_ref - i4_x_offset;
 1343|  1.58M|                }
 1344|  1.58M|                if(0 <= i4_y_offset)
  ------------------
  |  Branch (1344:20): [True: 595k, False: 990k]
  ------------------
 1345|   595k|                {
 1346|       |                    /* if only inside frame dimension */
 1347|   595k|                    i4_y_ref = i4_y_ref - i4_y_offset;
 1348|   595k|                }
 1349|       |                /* derive the reference data pointers */
 1350|       |
 1351|  1.58M|                pi2_ref_data_byte = pi2_inp_data + (i4_x_ref << i4_chroma_flag);
 1352|  1.58M|                pi2_ref_data_byte += i4_y_ref * i4_inp_data_stride;
 1353|       |
 1354|       |                /* store the residual value */
 1355|  1.58M|                *pi2_ref_array_temp = (WORD16) (*pi2_ref_data_byte);
 1356|  1.58M|            }
 1357|  88.3k|            else
 1358|  88.3k|            {
 1359|       |                /* if non inter MB then store the 0 */
 1360|  88.3k|                *pi2_ref_array_temp = 0;
 1361|  88.3k|            }
 1362|  1.67M|        }
 1363|  1.43M|    }
 1364|       |
 1365|       |    /*Quard 2*/
 1366|   988k|    for(i4_y = i4_mb_quard1_part_y; i4_y < i4_refarray_ht; i4_y++)
  ------------------
  |  Branch (1366:37): [True: 743k, False: 245k]
  ------------------
 1367|   743k|    {
 1368|  8.23M|        for(i4_x = 0; i4_x < i4_mb_quard1_part_x; i4_x++)
  ------------------
  |  Branch (1368:23): [True: 7.49M, False: 743k]
  ------------------
 1369|  7.49M|        {
 1370|  7.49M|            i4_y_ref = MAX(0, MIN(i4_ref_ht - 1, i4_y + i4_y_offset));
  ------------------
  |  |   60|  14.9M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 7.49M]
  |  |  |  Branch (60:24): [True: 142k, False: 7.34M]
  |  |  |  Branch (60:32): [True: 142k, False: 7.34M]
  |  |  ------------------
  ------------------
 1371|  7.49M|            i4_x_ref = MAX(0, MIN(i4_ref_wd - 1, i4_x + i4_x_offset));
  ------------------
  |  |   60|  14.9M|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 379k, False: 7.11M]
  |  |  |  Branch (60:24): [True: 0, False: 7.49M]
  |  |  |  Branch (60:32): [True: 0, False: 7.11M]
  |  |  ------------------
  ------------------
 1372|       |
 1373|       |            /****************************************************************/
 1374|       |            /* Reference layer Residual Buffer is maintained as 8-bit data  */
 1375|       |            /* Buffer and 1-bit sign bit packed buffer. Sign Byte is read   */
 1376|       |            /* and sign of the data sample is extracted depending upon bit  */
 1377|       |            /* postition.                                                   */
 1378|       |            /****************************************************************/
 1379|       |
 1380|       |            /* update the buffer pointers to appropriate locations */
 1381|  7.49M|            pi2_ref_array_temp = pi2_ref_array + i4_x;
 1382|  7.49M|            pi2_ref_array_temp += i4_y * i4_refarray_wd;
 1383|       |
 1384|       |            /* extract the residual value and fill the buffer */
 1385|  7.49M|            if(SVC_INTER_MB == i4_ref_mb_type_q2)
  ------------------
  |  |  114|  7.49M|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (1385:16): [True: 7.22M, False: 262k]
  ------------------
 1386|  7.22M|            {
 1387|       |                /* input pointer will be pointing to (xoffset,yoffset) */
 1388|       |                /* So subtract the correction to reference location    */
 1389|  7.22M|                if(0 <= i4_x_offset)
  ------------------
  |  Branch (1389:20): [True: 2.86M, False: 4.36M]
  ------------------
 1390|  2.86M|                {
 1391|       |                    /* if only inside frame dimension */
 1392|  2.86M|                    i4_x_ref = i4_x_ref - i4_x_offset;
 1393|  2.86M|                }
 1394|  7.22M|                if(0 <= i4_y_offset)
  ------------------
  |  Branch (1394:20): [True: 7.22M, False: 0]
  ------------------
 1395|  7.22M|                {
 1396|       |                    /* if only inside frame dimension */
 1397|  7.22M|                    i4_y_ref = i4_y_ref - i4_y_offset;
 1398|  7.22M|                }
 1399|       |                /* derive the reference data pointers */
 1400|  7.22M|                pi2_ref_data_byte = pi2_inp_data + (i4_x_ref << i4_chroma_flag);
 1401|  7.22M|                pi2_ref_data_byte += i4_y_ref * i4_inp_data_stride;
 1402|       |
 1403|       |                /* store the residual value */
 1404|  7.22M|                *pi2_ref_array_temp = (WORD16) (*pi2_ref_data_byte);
 1405|  7.22M|            }
 1406|   262k|            else
 1407|   262k|            {
 1408|       |                /* if non inter MB then store the 0 */
 1409|   262k|                *pi2_ref_array_temp = 0;
 1410|   262k|            }
 1411|  7.49M|        }
 1412|   743k|    }
 1413|       |
 1414|       |    /*Quard 3*/
 1415|   988k|    for(i4_y = i4_mb_quard1_part_y; i4_y < i4_refarray_ht; i4_y++)
  ------------------
  |  Branch (1415:37): [True: 743k, False: 245k]
  ------------------
 1416|   743k|    {
 1417|  1.12M|        for(i4_x = i4_mb_quard1_part_x; i4_x < i4_refarray_wd; i4_x++)
  ------------------
  |  Branch (1417:41): [True: 385k, False: 743k]
  ------------------
 1418|   385k|        {
 1419|   385k|            i4_y_ref = MAX(0, MIN(i4_ref_ht - 1, i4_y + i4_y_offset));
  ------------------
  |  |   60|   771k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 385k]
  |  |  |  Branch (60:24): [True: 33.2k, False: 352k]
  |  |  |  Branch (60:32): [True: 33.2k, False: 352k]
  |  |  ------------------
  ------------------
 1420|   385k|            i4_x_ref = MAX(0, MIN(i4_ref_wd - 1, i4_x + i4_x_offset));
  ------------------
  |  |   60|   771k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 0, False: 385k]
  |  |  |  Branch (60:24): [True: 357k, False: 28.7k]
  |  |  |  Branch (60:32): [True: 357k, False: 28.7k]
  |  |  ------------------
  ------------------
 1421|       |
 1422|       |            /****************************************************************/
 1423|       |            /* Reference layer Residual Buffer is maintained as 8-bit data  */
 1424|       |            /* Buffer and 1-bit sign bit packed buffer. Sign Byte is read   */
 1425|       |            /* and sign of the data sample is extracted depending upon bit  */
 1426|       |            /* postition.                                                   */
 1427|       |            /****************************************************************/
 1428|       |
 1429|       |            /* update the buffer pointers to appropriate locations */
 1430|   385k|            pi2_ref_array_temp = pi2_ref_array + i4_x;
 1431|   385k|            pi2_ref_array_temp += i4_y * i4_refarray_wd;
 1432|       |
 1433|       |            /* extract the residual value and fill the buffer */
 1434|   385k|            if(SVC_INTER_MB == i4_ref_mb_type_q3)
  ------------------
  |  |  114|   385k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  |  Branch (1434:16): [True: 385k, False: 0]
  ------------------
 1435|   385k|            {
 1436|       |                /* input pointer will be pointing to (xoffset,yoffset) */
 1437|       |                /* So subtract the correction to reference location    */
 1438|   385k|                if(0 <= i4_x_offset)
  ------------------
  |  Branch (1438:20): [True: 385k, False: 0]
  ------------------
 1439|   385k|                {
 1440|       |                    /* if only inside frame dimension */
 1441|   385k|                    i4_x_ref = i4_x_ref - i4_x_offset;
 1442|   385k|                }
 1443|   385k|                if(0 <= i4_y_offset)
  ------------------
  |  Branch (1443:20): [True: 385k, False: 0]
  ------------------
 1444|   385k|                {
 1445|       |                    /* if only inside frame dimension */
 1446|   385k|                    i4_y_ref = i4_y_ref - i4_y_offset;
 1447|   385k|                }
 1448|       |                /* derive the reference data pointers */
 1449|   385k|                pi2_ref_data_byte = pi2_inp_data + (i4_x_ref << i4_chroma_flag);
 1450|   385k|                pi2_ref_data_byte += i4_y_ref * i4_inp_data_stride;
 1451|       |
 1452|       |                /* store the residual value */
 1453|   385k|                *pi2_ref_array_temp = (WORD16) (*pi2_ref_data_byte);
 1454|   385k|            }
 1455|      0|            else
 1456|      0|            {
 1457|       |                /* if non inter MB then store the 0 */
 1458|      0|                *pi2_ref_array_temp = 0;
 1459|      0|            }
 1460|   385k|        }
 1461|   743k|    }
 1462|   245k|}
isvcd_residual_reflayer_const:
 1502|   336k|{
 1503|   336k|    residual_sampling_ctxt_t *ps_ctxt;
 1504|   336k|    res_lyr_ctxt *ps_lyr_ctxt;
 1505|   336k|    WORD8 *pi1_ref_mb_modes;
 1506|   336k|    WORD32 i4_ref_mode_stride;
 1507|   336k|    WORD32 i4_element_size;
 1508|   336k|    WORD32 i4_ref_wd;
 1509|   336k|    WORD32 i4_ref_ht;
 1510|   336k|    WORD32 i4_x_offset;
 1511|   336k|    WORD32 i4_y_offset;
 1512|   336k|    WORD32 i4_refarray_wd;
 1513|   336k|    WORD32 i4_refarray_ht;
 1514|   336k|    WORD8 i1_edge_mb;
 1515|   336k|    WORD16 *pi2_ref_array;
 1516|   336k|    WORD32 i4_mb_sft;
 1517|   336k|    WORD32 i4_mb_x, i4_mb_y;
 1518|   336k|    WORD32 i4_mb_x_strt, i4_mb_y_strt;
 1519|   336k|    WORD32 i4_mb_quard1_part_x, i4_mb_quard1_part_y;
 1520|   336k|    WORD8 *pi1_ref_mb_modes_incr;
 1521|   336k|    WORD8 *pi1_ref_mb_modes_incr_temp;
 1522|   336k|    inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms;
 1523|       |
 1524|   336k|    WORD32 i4_mb_wd;
 1525|   336k|    WORD32 i4_mb_ht;
 1526|   336k|    WORD32 i4_x_ref, i4_y_ref;
 1527|   336k|    WORD32 i4_ref_mb_type_q0, i4_ref_mb_type_q1, i4_ref_mb_type_q2, i4_ref_mb_type_q3;
 1528|   336k|    WORD8 i1_mb_mode_q0, i1_mb_mode_q1, i1_mb_mode_q2, i1_mb_mode_q3;
 1529|   336k|    WORD32 ret;
 1530|       |
 1531|   336k|    ps_ctxt = (residual_sampling_ctxt_t *) pv_residual_samp_ctxt;
 1532|   336k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_ctxt->i4_res_lyr_id];
 1533|   336k|    pi2_ref_array = ps_ctxt->pi2_refarray_buffer;
 1534|       |
 1535|   336k|    pi1_ref_mb_modes = (WORD8 *) ps_ref_mb_mode->pv_buffer;
 1536|   336k|    i4_ref_mode_stride = ps_ref_mb_mode->i4_num_element_stride;
 1537|   336k|    i4_element_size = ps_ref_mb_mode->i4_element_size;
 1538|       |
 1539|   336k|    if(NULL == pi1_ref_mb_modes)
  ------------------
  |  Branch (1539:8): [True: 0, False: 336k]
  ------------------
 1540|      0|    {
 1541|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1542|      0|    }
 1543|       |
 1544|   336k|    i4_mb_wd = MB_WIDTH >> i4_chroma_flag;
  ------------------
  |  |   67|   336k|#define MB_WIDTH 16
  ------------------
 1545|   336k|    i4_mb_ht = MB_HEIGHT >> i4_chroma_flag;
  ------------------
  |  |   68|   336k|#define MB_HEIGHT 16
  ------------------
 1546|       |
 1547|       |    /* ----------------------------------------------------------------- */
 1548|       |    /* Deriving the parameters required for further processing           */
 1549|       |    /* ----------------------------------------------------------------- */
 1550|   336k|    {
 1551|   336k|        ref_mb_map_t *ps_x_off_len;
 1552|   336k|        ref_mb_map_t *ps_y_off_len;
 1553|   336k|        WORD32 i4_mbaddr_x;
 1554|   336k|        WORD32 i4_mbaddr_y;
 1555|   336k|        WORD32 i4_base_width;
 1556|   336k|        WORD32 i4_base_height;
 1557|   336k|        residual_samp_map_ctxt_t *ps_map_ctxt;
 1558|       |
 1559|   336k|        if(1 == i4_chroma_flag)
  ------------------
  |  Branch (1559:12): [True: 224k, False: 112k]
  ------------------
 1560|   224k|            ps_map_ctxt = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1561|   112k|        else
 1562|   112k|            ps_map_ctxt = &ps_lyr_ctxt->s_luma_map_ctxt;
 1563|       |
 1564|   336k|        i4_mbaddr_y = ps_coord->u2_mb_y;
 1565|   336k|        i4_mbaddr_x = ps_coord->u2_mb_x;
 1566|   336k|        i4_base_width = ps_lyr_ctxt->i4_ref_width;
 1567|   336k|        i4_base_height = ps_lyr_ctxt->i4_ref_height;
 1568|   336k|        i4_ref_wd = i4_base_width >> i4_chroma_flag;
 1569|   336k|        i4_ref_ht = i4_base_height >> i4_chroma_flag;
 1570|       |
 1571|       |        /* --------------------------------------------------------------------- */
 1572|       |        /* Extracting information from the mapping context                       */
 1573|       |        /* --------------------------------------------------------------------- */
 1574|   336k|        ps_x_off_len = ps_map_ctxt->ps_x_offset_length;
 1575|   336k|        ps_y_off_len = ps_map_ctxt->ps_y_offset_length;
 1576|   336k|        i4_x_offset = ps_x_off_len[i4_mbaddr_x].i2_offset;
 1577|   336k|        i4_y_offset = ps_y_off_len[i4_mbaddr_y].i2_offset;
 1578|   336k|        i4_refarray_wd = ps_x_off_len[i4_mbaddr_x].i2_length;
 1579|   336k|        i4_refarray_ht = ps_y_off_len[i4_mbaddr_y].i2_length;
 1580|   336k|    }
 1581|       |
 1582|       |    /* Call the module to fill the increments based on transform blocks */
 1583|   336k|    ret = isvcd_ref_layer_ptr_incr(pi1_ref_mb_modes, i4_ref_mode_stride, i4_element_size,
 1584|   336k|                                   i4_x_offset, i4_y_offset, i4_refarray_wd, i4_refarray_ht,
 1585|   336k|                                   ps_ctxt->pu1_ref_x_ptr_incr, ps_ctxt->pu1_ref_y_ptr_incr,
 1586|   336k|                                   i4_chroma_flag);
 1587|       |
 1588|   336k|    if(ret != OK)
  ------------------
  |  |  114|   336k|#define OK        0
  ------------------
  |  Branch (1588:8): [True: 0, False: 336k]
  ------------------
 1589|      0|    {
 1590|      0|        return ret;
 1591|      0|    }
 1592|   336k|    i4_mb_sft = (MB_WIDTH_SHIFT - i4_chroma_flag);
  ------------------
  |  |   70|   336k|#define MB_WIDTH_SHIFT 4
  ------------------
 1593|       |
 1594|       |    /* --------------------------------------------------------------------- */
 1595|       |    /* MB Level Resampling for the MB - Pointers sent for MB in both layers  */
 1596|       |    /* This has been written according to the dyadic case                    */
 1597|       |    /* --------------------------------------------------------------------- */
 1598|   336k|    i4_y_ref = MAX(0, MIN(i4_ref_ht - 1, 0 + i4_y_offset));
  ------------------
  |  |   60|   672k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 52.2k, False: 284k]
  |  |  |  Branch (60:24): [True: 0, False: 336k]
  |  |  |  Branch (60:32): [True: 0, False: 284k]
  |  |  ------------------
  ------------------
 1599|   336k|    i4_x_ref = MAX(0, MIN(i4_ref_wd - 1, 0 + i4_x_offset));
  ------------------
  |  |   60|   672k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 114k, False: 221k]
  |  |  |  Branch (60:24): [True: 0, False: 336k]
  |  |  |  Branch (60:32): [True: 0, False: 221k]
  |  |  ------------------
  ------------------
 1600|   336k|    i4_mb_x_strt = i4_x_ref % i4_mb_wd;
 1601|   336k|    i4_mb_y_strt = i4_y_ref % i4_mb_ht;
 1602|       |
 1603|   336k|    i4_mb_quard1_part_x = i4_mb_wd - i4_mb_x_strt;
 1604|   336k|    i4_mb_quard1_part_y = i4_mb_ht - i4_mb_y_strt;
 1605|   336k|    if(!(i4_mb_quard1_part_x >= 0))
  ------------------
  |  Branch (1605:8): [True: 0, False: 336k]
  ------------------
 1606|      0|    {
 1607|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1608|      0|    }
 1609|   336k|    if(!(i4_mb_quard1_part_y >= 0))
  ------------------
  |  Branch (1609:8): [True: 0, False: 336k]
  ------------------
 1610|      0|    {
 1611|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 1612|      0|    }
 1613|       |
 1614|   336k|    i4_mb_x = (i4_x_ref >> i4_mb_sft);
 1615|   336k|    i4_mb_y = (i4_y_ref >> i4_mb_sft);
 1616|       |
 1617|       |    /* get the location of the byte which has the current mb mode */
 1618|   336k|    pi1_ref_mb_modes_incr = pi1_ref_mb_modes + (i4_mb_y * i4_ref_mode_stride * i4_element_size);
 1619|   336k|    pi1_ref_mb_modes_incr += (i4_mb_x * i4_element_size);
 1620|   336k|    ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) pi1_ref_mb_modes_incr;
 1621|   336k|    i1_mb_mode_q0 = ps_inter_lyr_mb_prms->i1_mb_mode;
 1622|   336k|    i1_mb_mode_q1 = i1_mb_mode_q0;
 1623|   336k|    i1_mb_mode_q2 = i1_mb_mode_q0;
 1624|   336k|    i1_mb_mode_q3 = i1_mb_mode_q0;
 1625|       |
 1626|   336k|    pi1_ref_mb_modes_incr_temp = pi1_ref_mb_modes_incr;
 1627|   336k|    if(i4_mb_quard1_part_x > 0)
  ------------------
  |  Branch (1627:8): [True: 336k, False: 0]
  ------------------
 1628|   336k|    {
 1629|   336k|        pi1_ref_mb_modes_incr_temp = pi1_ref_mb_modes_incr + i4_element_size;
 1630|   336k|        ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) pi1_ref_mb_modes_incr_temp;
 1631|   336k|        i1_mb_mode_q1 = ps_inter_lyr_mb_prms->i1_mb_mode;
 1632|   336k|    }
 1633|       |
 1634|   336k|    if(i4_mb_quard1_part_y > 0)
  ------------------
  |  Branch (1634:8): [True: 336k, False: 0]
  ------------------
 1635|   336k|    {
 1636|   336k|        pi1_ref_mb_modes_incr_temp = pi1_ref_mb_modes_incr + (i4_ref_mode_stride * i4_element_size);
 1637|   336k|        ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) pi1_ref_mb_modes_incr_temp;
 1638|   336k|        i1_mb_mode_q2 = ps_inter_lyr_mb_prms->i1_mb_mode;
 1639|   336k|    }
 1640|       |
 1641|   336k|    if((i4_mb_quard1_part_x > 0) && (i4_mb_quard1_part_y > 0))
  ------------------
  |  Branch (1641:8): [True: 336k, False: 0]
  |  Branch (1641:37): [True: 336k, False: 0]
  ------------------
 1642|   336k|    {
 1643|   336k|        pi1_ref_mb_modes_incr_temp =
 1644|   336k|            pi1_ref_mb_modes_incr + (i4_ref_mode_stride * i4_element_size) + i4_element_size;
 1645|   336k|        ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) pi1_ref_mb_modes_incr_temp;
 1646|   336k|        i1_mb_mode_q3 = ps_inter_lyr_mb_prms->i1_mb_mode;
 1647|   336k|    }
 1648|       |
 1649|   336k|    i4_ref_mb_type_q0 = (i1_mb_mode_q0 <= SVC_INTER_MB) ? SVC_INTER_MB : SVC_INTRA_MB;
  ------------------
  |  |  114|   336k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
                  i4_ref_mb_type_q0 = (i1_mb_mode_q0 <= SVC_INTER_MB) ? SVC_INTER_MB : SVC_INTRA_MB;
  ------------------
  |  |  114|   318k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
                  i4_ref_mb_type_q0 = (i1_mb_mode_q0 <= SVC_INTER_MB) ? SVC_INTER_MB : SVC_INTRA_MB;
  ------------------
  |  |  115|   353k|#define SVC_INTRA_MB (1 << 1)       /*!< P or B MBs decoded or inferred*/
  ------------------
  |  Branch (1649:25): [True: 318k, False: 17.5k]
  ------------------
 1650|   336k|    i4_ref_mb_type_q1 = (i1_mb_mode_q1 <= SVC_INTER_MB) ? SVC_INTER_MB : SVC_INTRA_MB;
  ------------------
  |  |  114|   336k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
                  i4_ref_mb_type_q1 = (i1_mb_mode_q1 <= SVC_INTER_MB) ? SVC_INTER_MB : SVC_INTRA_MB;
  ------------------
  |  |  114|   316k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
                  i4_ref_mb_type_q1 = (i1_mb_mode_q1 <= SVC_INTER_MB) ? SVC_INTER_MB : SVC_INTRA_MB;
  ------------------
  |  |  115|   356k|#define SVC_INTRA_MB (1 << 1)       /*!< P or B MBs decoded or inferred*/
  ------------------
  |  Branch (1650:25): [True: 316k, False: 20.2k]
  ------------------
 1651|   336k|    i4_ref_mb_type_q2 = (i1_mb_mode_q2 <= SVC_INTER_MB) ? SVC_INTER_MB : SVC_INTRA_MB;
  ------------------
  |  |  114|   336k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
                  i4_ref_mb_type_q2 = (i1_mb_mode_q2 <= SVC_INTER_MB) ? SVC_INTER_MB : SVC_INTRA_MB;
  ------------------
  |  |  114|   317k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
                  i4_ref_mb_type_q2 = (i1_mb_mode_q2 <= SVC_INTER_MB) ? SVC_INTER_MB : SVC_INTRA_MB;
  ------------------
  |  |  115|   355k|#define SVC_INTRA_MB (1 << 1)       /*!< P or B MBs decoded or inferred*/
  ------------------
  |  Branch (1651:25): [True: 317k, False: 19.0k]
  ------------------
 1652|   336k|    i4_ref_mb_type_q3 = (i1_mb_mode_q3 <= SVC_INTER_MB) ? SVC_INTER_MB : SVC_INTRA_MB;
  ------------------
  |  |  114|   336k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
                  i4_ref_mb_type_q3 = (i1_mb_mode_q3 <= SVC_INTER_MB) ? SVC_INTER_MB : SVC_INTRA_MB;
  ------------------
  |  |  114|   318k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
                  i4_ref_mb_type_q3 = (i1_mb_mode_q3 <= SVC_INTER_MB) ? SVC_INTER_MB : SVC_INTRA_MB;
  ------------------
  |  |  115|   353k|#define SVC_INTRA_MB (1 << 1)       /*!< P or B MBs decoded or inferred*/
  ------------------
  |  Branch (1652:25): [True: 318k, False: 17.3k]
  ------------------
 1653|       |
 1654|   336k|    i1_edge_mb = (ps_coord->u2_mb_x == 0 || ps_coord->u2_mb_y == 0 ||
  ------------------
  |  Branch (1654:19): [True: 114k, False: 221k]
  |  Branch (1654:45): [True: 35.4k, False: 186k]
  ------------------
 1655|   186k|                  (ps_coord->u2_mb_x == ((ps_lyr_ctxt->i4_curr_width >> MB_WIDTH_SHIFT) - 1)) ||
  ------------------
  |  |   70|   186k|#define MB_WIDTH_SHIFT 4
  ------------------
  |  Branch (1655:19): [True: 88.1k, False: 98.1k]
  ------------------
 1656|  98.1k|                  (ps_coord->u2_mb_y == ((ps_lyr_ctxt->i4_curr_height >> MB_HEIGHT_SHIFT) - 1)));
  ------------------
  |  |   71|  98.1k|#define MB_HEIGHT_SHIFT 4
  ------------------
  |  Branch (1656:19): [True: 7.17k, False: 90.9k]
  ------------------
 1657|   336k|    if(i1_edge_mb)
  ------------------
  |  Branch (1657:8): [True: 245k, False: 90.9k]
  ------------------
 1658|   245k|    {
 1659|   245k|        ps_ctxt->pf_residual_reflayer_const_boundary_mb(
 1660|   245k|            pi2_inp_data, i4_inp_data_stride, pi2_ref_array, i4_refarray_wd, i4_refarray_ht,
 1661|   245k|            i4_ref_wd, i4_ref_ht, i4_x_offset, i4_y_offset, i4_ref_mb_type_q0, i4_ref_mb_type_q1,
 1662|   245k|            i4_ref_mb_type_q2, i4_ref_mb_type_q3, i4_mb_quard1_part_x, i4_mb_quard1_part_y,
 1663|   245k|            i4_chroma_flag);
 1664|   245k|    }
 1665|  90.9k|    else
 1666|  90.9k|    {
 1667|  90.9k|        ps_ctxt->pf_residual_reflayer_const_non_boundary_mb(
 1668|  90.9k|            pi2_inp_data, i4_inp_data_stride, pi2_ref_array, i4_refarray_wd, i4_refarray_ht,
 1669|  90.9k|            i4_ref_mb_type_q0, i4_ref_mb_type_q1, i4_ref_mb_type_q2, i4_ref_mb_type_q3,
 1670|  90.9k|            i4_mb_quard1_part_x, i4_mb_quard1_part_y, i4_chroma_flag);
 1671|  90.9k|    }
 1672|       |    /* store the values into the place holders */
 1673|   336k|    *pi4_refarr_wd = i4_refarray_wd;
 1674|       |
 1675|   336k|    return OK;
  ------------------
  |  |  114|   336k|#define OK        0
  ------------------
 1676|   336k|}
isvcd_interpolate_residual:
 1709|   187k|{
 1710|   187k|    residual_sampling_ctxt_t *ps_ctxt;
 1711|   187k|    residual_samp_map_ctxt_t *ps_map_ctxt;
 1712|   187k|    res_lyr_ctxt *ps_lyr_ctxt;
 1713|   187k|    ref_pixel_map_t *ps_x_pos_phase;
 1714|   187k|    ref_pixel_map_t *ps_y_pos_phase;
 1715|       |
 1716|   187k|    WORD32 i4_x, i4_y;
 1717|   187k|    WORD32 i4_frm_mb_x, i4_frm_mb_y;
 1718|   187k|    WORD32 i4_temp_array_ht;
 1719|   187k|    WORD32 i4_mb_wd;
 1720|   187k|    WORD32 i4_mb_ht;
 1721|   187k|    WORD16 *pi2_ref_array;
 1722|   187k|    UWORD8 *pu1_ref_x_ptr_incr, *pu1_ref_y_ptr_incr;
 1723|       |
 1724|   187k|    ps_ctxt = (residual_sampling_ctxt_t *) pv_residual_samp_ctxt;
 1725|   187k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_ctxt->i4_res_lyr_id];
 1726|   187k|    pi2_ref_array = ps_ctxt->pi2_refarray_buffer;
 1727|   187k|    pu1_ref_x_ptr_incr = ps_ctxt->pu1_ref_x_ptr_incr;
 1728|   187k|    pu1_ref_y_ptr_incr = ps_ctxt->pu1_ref_y_ptr_incr;
 1729|       |
 1730|       |    /* --------------------------------------------------------------------- */
 1731|       |    /* Extracting information from the mapping context                       */
 1732|       |    /* --------------------------------------------------------------------- */
 1733|   187k|    if(1 == i4_chroma_flag)
  ------------------
  |  Branch (1733:8): [True: 124k, False: 62.4k]
  ------------------
 1734|   124k|        ps_map_ctxt = &ps_lyr_ctxt->s_chroma_map_ctxt;
 1735|  62.4k|    else
 1736|  62.4k|        ps_map_ctxt = &ps_lyr_ctxt->s_luma_map_ctxt;
 1737|       |
 1738|   187k|    i4_mb_wd = MB_WIDTH >> i4_chroma_flag;
  ------------------
  |  |   67|   187k|#define MB_WIDTH 16
  ------------------
 1739|   187k|    i4_mb_ht = MB_HEIGHT >> i4_chroma_flag;
  ------------------
  |  |   68|   187k|#define MB_HEIGHT 16
  ------------------
 1740|       |
 1741|   187k|    ps_x_pos_phase = ps_map_ctxt->ps_x_pos_phase;
 1742|   187k|    ps_y_pos_phase = ps_map_ctxt->ps_y_pos_phase;
 1743|   187k|    i4_temp_array_ht = i4_mb_ht;
 1744|   187k|    i4_frm_mb_y = u2_mb_y * i4_mb_ht;
 1745|   187k|    i4_frm_mb_x = u2_mb_x * i4_mb_wd;
 1746|       |
 1747|       |    /* --------------------------------------------------------------------- */
 1748|       |    /* Loop for interpolation                                                */
 1749|       |    /* --------------------------------------------------------------------- */
 1750|  2.18M|    for(i4_y = 0; i4_y < (i4_temp_array_ht); i4_y++)
  ------------------
  |  Branch (1750:19): [True: 1.99M, False: 187k]
  ------------------
 1751|  1.99M|    {
 1752|  25.9M|        for(i4_x = 0; i4_x < (i4_mb_wd); i4_x++)
  ------------------
  |  Branch (1752:23): [True: 23.9M, False: 1.99M]
  ------------------
 1753|  23.9M|        {
 1754|  23.9M|            WORD32 i4_i;
 1755|  23.9M|            WORD32 i4_y_ref;
 1756|  23.9M|            WORD32 i4_y_phase;
 1757|  23.9M|            WORD32 i4_x_ref;
 1758|  23.9M|            WORD32 i4_x_phase;
 1759|  23.9M|            WORD32 i4_x_ref_round;
 1760|  23.9M|            WORD16 *pi2_out_curr;
 1761|  23.9M|            WORD32 ai4_temp_pred[2] = {0};
 1762|  23.9M|            UWORD8 *pu1_ref_y_ptr_incr_temp;
 1763|  23.9M|            WORD32 *pi4_temp_pred;
 1764|  23.9M|            UWORD8 u1_incr_y;
 1765|  23.9M|            WORD16 i2_res;
 1766|       |
 1767|       |            /* derive the current output pointer */
 1768|  23.9M|            pi2_out_curr = pi2_out + (i4_x << i4_chroma_flag) + (i4_y * i4_out_stride);
 1769|       |
 1770|       |            /* -------------------------------------------------------------- */
 1771|       |            /* Finding the offset                                             */
 1772|       |            /* -------------------------------------------------------------- */
 1773|  23.9M|            i4_y_ref = ps_y_pos_phase[i4_y + i4_frm_mb_y].i2_ref_pos;
 1774|  23.9M|            i4_y_phase = ps_y_pos_phase[i4_y + i4_frm_mb_y].i2_phase;
 1775|  23.9M|            i4_x_ref = ps_x_pos_phase[i4_x + i4_frm_mb_x].i2_ref_pos;
 1776|  23.9M|            i4_x_phase = ps_x_pos_phase[i4_x + i4_frm_mb_x].i2_phase;
 1777|       |
 1778|       |            /* horizontal processing*/
 1779|  71.8M|            for(i4_i = 0; i4_i < 2; i4_i++)
  ------------------
  |  Branch (1779:27): [True: 47.9M, False: 23.9M]
  ------------------
 1780|  47.9M|            {
 1781|  47.9M|                UWORD8 *pu1_ref_x_ptr_incr_temp;
 1782|  47.9M|                UWORD8 u1_incr;
 1783|  47.9M|                WORD16 *pi2_ref_array_1, *pi2_ref_array_2;
 1784|       |
 1785|       |                /* derive appropriate pointers */
 1786|  47.9M|                pu1_ref_x_ptr_incr_temp = pu1_ref_x_ptr_incr + i4_x_ref;
 1787|  47.9M|                pu1_ref_x_ptr_incr_temp += ((i4_y_ref + i4_i) * i4_refarray_wd);
 1788|  47.9M|                u1_incr = *pu1_ref_x_ptr_incr_temp;
 1789|  47.9M|                pi2_ref_array_1 = pi2_ref_array + i4_x_ref;
 1790|  47.9M|                pi2_ref_array_1 += ((i4_y_ref + i4_i) * i4_refarray_wd);
 1791|       |
 1792|  47.9M|                if(!u1_incr)
  ------------------
  |  Branch (1792:20): [True: 15.6M, False: 32.3M]
  ------------------
 1793|  15.6M|                {
 1794|  15.6M|                    pi2_ref_array_1 += (i4_x_phase >> 3);
 1795|  15.6M|                }
 1796|       |
 1797|  47.9M|                pi2_ref_array_2 = pi2_ref_array_1 + u1_incr;
 1798|  47.9M|                ai4_temp_pred[i4_i] =
 1799|  47.9M|                    (16 - i4_x_phase) * (*pi2_ref_array_1) + i4_x_phase * (*pi2_ref_array_2);
 1800|  47.9M|            }
 1801|       |
 1802|       |            /* vertical processing */
 1803|  23.9M|            i4_x_ref_round = (i4_x_ref + (i4_x_phase >> 3));
 1804|  23.9M|            pu1_ref_y_ptr_incr_temp =
 1805|  23.9M|                pu1_ref_y_ptr_incr + i4_x_ref_round + (i4_y_ref * i4_refarray_wd);
 1806|  23.9M|            u1_incr_y = *pu1_ref_y_ptr_incr_temp;
 1807|       |
 1808|  23.9M|            pi4_temp_pred = &ai4_temp_pred[0];
 1809|  23.9M|            if(!u1_incr_y)
  ------------------
  |  Branch (1809:16): [True: 7.80M, False: 16.1M]
  ------------------
 1810|  7.80M|            {
 1811|  7.80M|                pi4_temp_pred += (i4_y_phase >> 3);
 1812|  7.80M|            }
 1813|       |
 1814|  23.9M|            i2_res = (((16 - i4_y_phase) * pi4_temp_pred[0] +
 1815|  23.9M|                       i4_y_phase * pi4_temp_pred[u1_incr_y] + 128) >>
 1816|  23.9M|                      8);
 1817|       |
 1818|       |            /* store back the final residual */
 1819|  23.9M|            *pi2_out_curr = i2_res;
 1820|  23.9M|        } /* end of loop over width */
 1821|  1.99M|    }     /* end of loop over height */
 1822|       |
 1823|   187k|    return;
 1824|   187k|} /* End of Interpolation Function */
isvcd_residual_samp_mb:
 1859|   112k|{
 1860|       |    /* --------------------------------------------------------------------- */
 1861|       |    /* I/O buffer params                                                     */
 1862|       |    /* --------------------------------------------------------------------- */
 1863|   112k|    residual_sampling_ctxt_t *ps_ctxt = (residual_sampling_ctxt_t *) pv_residual_samp_ctxt;
 1864|   112k|    WORD16 *pi2_inp;
 1865|   112k|    WORD16 *pi2_out;
 1866|   112k|    WORD32 i4_inp_stride;
 1867|   112k|    WORD32 i4_out_stride;
 1868|   112k|    WORD32 i4_refarray_wd;
 1869|   112k|    mb_coord_t s_mb_coord = {0};
 1870|   112k|    WORD32 ret;
 1871|   112k|    s_mb_coord.u2_mb_x = u2_mb_x;
 1872|   112k|    s_mb_coord.u2_mb_y = u2_mb_y;
 1873|       |
 1874|       |    /* --------------------------------------------------------------------- */
 1875|       |    /* LUMA PROCESSING                                                        */
 1876|       |    /* --------------------------------------------------------------------- */
 1877|   112k|    pi2_inp = (WORD16 *) ps_ref_luma->pv_buffer;
 1878|   112k|    pi2_out = (WORD16 *) ps_out_luma->pv_buffer;
 1879|   112k|    i4_inp_stride = ps_ref_luma->i4_num_element_stride;
 1880|   112k|    i4_out_stride = ps_out_luma->i4_num_element_stride;
 1881|       |
 1882|       |    /* ------- Constructing refSampleArray ----------------------- */
 1883|   112k|    ret = isvcd_residual_reflayer_const(pv_residual_samp_ctxt, pi2_inp, i4_inp_stride,
 1884|   112k|                                        ps_ref_mb_mode, &i4_refarray_wd, &s_mb_coord, 0);
 1885|       |
 1886|   112k|    if(ret != OK) return ret;
  ------------------
  |  |  114|   112k|#define OK        0
  ------------------
  |  Branch (1886:8): [True: 0, False: 112k]
  ------------------
 1887|       |    /* ---- Interpolation process for Residual prediction     ------ */
 1888|   112k|    ps_ctxt->pf_interpolate_residual(pv_residual_samp_ctxt, pi2_out, i4_out_stride, i4_refarray_wd,
 1889|   112k|                                     s_mb_coord.u2_mb_x, s_mb_coord.u2_mb_y, 0);
 1890|       |
 1891|       |    /* --------------------------------------------------------------------- */
 1892|       |    /* CHROMA PROCESSING                                                       */
 1893|       |    /* --------------------------------------------------------------------- */
 1894|       |    /* CB */
 1895|   112k|    pi2_inp = (WORD16 *) ps_ref_chroma->pv_buffer;
 1896|   112k|    pi2_out = (WORD16 *) ps_out_chroma->pv_buffer;
 1897|   112k|    i4_inp_stride = ps_ref_chroma->i4_num_element_stride;
 1898|   112k|    i4_out_stride = ps_out_chroma->i4_num_element_stride;
 1899|       |
 1900|       |    /* ------- Constructing refSampleArray ----------------------- */
 1901|   112k|    ret = isvcd_residual_reflayer_const(pv_residual_samp_ctxt, pi2_inp, i4_inp_stride,
 1902|   112k|                                        ps_ref_mb_mode, &i4_refarray_wd, &s_mb_coord, 1);
 1903|       |
 1904|   112k|    if(ret != OK) return ret;
  ------------------
  |  |  114|   112k|#define OK        0
  ------------------
  |  Branch (1904:8): [True: 0, False: 112k]
  ------------------
 1905|       |    /* ---- Interpolation process for Residual prediction     ------ */
 1906|   112k|    ps_ctxt->pf_interpolate_residual(pv_residual_samp_ctxt, pi2_out, i4_out_stride, i4_refarray_wd,
 1907|   112k|                                     s_mb_coord.u2_mb_x, s_mb_coord.u2_mb_y, 1);
 1908|       |
 1909|       |    /* CR */
 1910|   112k|    pi2_inp += 1;
 1911|   112k|    pi2_out += 1;
 1912|       |
 1913|       |    /* ------- Constructing refSampleArray ----------------------- */
 1914|   112k|    ret = isvcd_residual_reflayer_const(pv_residual_samp_ctxt, pi2_inp, i4_inp_stride,
 1915|   112k|                                        ps_ref_mb_mode, &i4_refarray_wd, &s_mb_coord, 1);
 1916|       |
 1917|   112k|    if(ret != OK) return ret;
  ------------------
  |  |  114|   112k|#define OK        0
  ------------------
  |  Branch (1917:8): [True: 0, False: 112k]
  ------------------
 1918|       |    /* ---- Interpolation process for Residual prediction --------- */
 1919|   112k|    ps_ctxt->pf_interpolate_residual(pv_residual_samp_ctxt, pi2_out, i4_out_stride, i4_refarray_wd,
 1920|   112k|                                     s_mb_coord.u2_mb_x, s_mb_coord.u2_mb_y, 1);
 1921|   112k|    return OK;
  ------------------
  |  |  114|   112k|#define OK        0
  ------------------
 1922|   112k|}
isvcd_residual_samp_mb_dyadic:
 1957|  42.3k|{
 1958|  42.3k|    residual_sampling_ctxt_t *ps_ctxt;
 1959|  42.3k|    res_lyr_ctxt *ps_lyr_ctxt;
 1960|       |    /* --------------------------------------------------------------------- */
 1961|       |    /* I/O buffer params                                                     */
 1962|       |    /* --------------------------------------------------------------------- */
 1963|  42.3k|    WORD16 *pi2_inp;
 1964|  42.3k|    WORD16 *pi2_out;
 1965|  42.3k|    WORD32 i4_inp_stride;
 1966|  42.3k|    WORD32 i4_out_stride;
 1967|  42.3k|    WORD32 i4_luma_nnz;
 1968|  42.3k|    WORD32 i4_chroma_nnz;
 1969|  42.3k|    WORD32 i4_tx_size;
 1970|       |
 1971|  42.3k|    ps_ctxt = (residual_sampling_ctxt_t *) pv_residual_samp_ctxt;
 1972|  42.3k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_ctxt->i4_res_lyr_id];
 1973|       |
 1974|       |    /* --------------------------------------------------------------------- */
 1975|       |    /* LUMA PROCESSING                                                        */
 1976|       |    /* --------------------------------------------------------------------- */
 1977|  42.3k|    pi2_inp = (WORD16 *) ps_ref_luma->pv_buffer;
 1978|  42.3k|    pi2_out = (WORD16 *) ps_out_luma->pv_buffer;
 1979|  42.3k|    i4_inp_stride = ps_ref_luma->i4_num_element_stride;
 1980|  42.3k|    i4_out_stride = ps_out_luma->i4_num_element_stride;
 1981|       |
 1982|  42.3k|    {
 1983|  42.3k|        WORD32 i4_offset_x, i4_offset_y;
 1984|  42.3k|        residual_samp_map_ctxt_t *ps_luma_map;
 1985|  42.3k|        ref_mb_map_t *ps_x_off_len_luma;
 1986|  42.3k|        ref_mb_map_t *ps_y_off_len_luma;
 1987|       |
 1988|  42.3k|        ps_luma_map = &ps_lyr_ctxt->s_luma_map_ctxt;
 1989|  42.3k|        ps_x_off_len_luma = ps_luma_map->ps_x_offset_length;
 1990|  42.3k|        ps_y_off_len_luma = ps_luma_map->ps_y_offset_length;
 1991|       |
 1992|       |        /* get the actual offset for the buffers */
 1993|  42.3k|        i4_offset_x = ps_x_off_len_luma[u2_mb_x].i2_offset;
 1994|  42.3k|        i4_offset_y = ps_y_off_len_luma[u2_mb_y].i2_offset;
 1995|       |
 1996|  42.3k|        {
 1997|  42.3k|            inter_lyr_mb_prms_t *ps_inter_lyr_mb_prms;
 1998|  42.3k|            WORD32 i4_mb_x, i4_mb_y;
 1999|  42.3k|            UWORD16 u2_luma_mask = 0x0033;
 2000|  42.3k|            UWORD8 u1_chrm_mask = 0x11;
 2001|  42.3k|            WORD32 i4_luma_rt_sft_amt = 0;
 2002|  42.3k|            WORD32 i4_chrm_rt_sft_amt = 0;
 2003|       |
 2004|  42.3k|            i4_mb_x = ((i4_offset_x + 1) >> MB_WIDTH_SHIFT);
  ------------------
  |  |   70|  42.3k|#define MB_WIDTH_SHIFT 4
  ------------------
 2005|  42.3k|            i4_mb_y = ((i4_offset_y + 1) >> MB_HEIGHT_SHIFT);
  ------------------
  |  |   71|  42.3k|#define MB_HEIGHT_SHIFT 4
  ------------------
 2006|       |
 2007|       |            /* get the location of the byte which has the current mb mode */
 2008|  42.3k|            ps_inter_lyr_mb_prms = (inter_lyr_mb_prms_t *) ps_ref_mb_mode->pv_buffer;
 2009|  42.3k|            ps_inter_lyr_mb_prms += i4_mb_x;
 2010|  42.3k|            ps_inter_lyr_mb_prms += i4_mb_y * ps_ref_mb_mode->i4_num_element_stride;
 2011|       |
 2012|       |            /* get the approp block in base layer in horz direction */
 2013|  42.3k|            if(0 != ((i4_offset_x + 1) & 15))
  ------------------
  |  Branch (2013:16): [True: 21.9k, False: 20.4k]
  ------------------
 2014|  21.9k|            {
 2015|  21.9k|                u2_luma_mask <<= 2;
 2016|  21.9k|                i4_luma_rt_sft_amt += 2;
 2017|  21.9k|                u1_chrm_mask <<= 1;
 2018|  21.9k|                i4_chrm_rt_sft_amt += 1;
 2019|  21.9k|            }
 2020|       |            /* get the approp block in base layer in vert direction */
 2021|  42.3k|            if(0 != ((i4_offset_y + 1) & 15))
  ------------------
  |  Branch (2021:16): [True: 20.6k, False: 21.7k]
  ------------------
 2022|  20.6k|            {
 2023|  20.6k|                u2_luma_mask <<= 8;
 2024|  20.6k|                i4_luma_rt_sft_amt += 8;
 2025|       |
 2026|  20.6k|                u1_chrm_mask <<= 2;
 2027|  20.6k|                i4_chrm_rt_sft_amt += 2;
 2028|  20.6k|            }
 2029|       |
 2030|       |            /* extract the nnz and store it */
 2031|  42.3k|            i4_luma_nnz = (ps_inter_lyr_mb_prms->u2_luma_nnz & u2_luma_mask) >> i4_luma_rt_sft_amt;
 2032|  42.3k|            i4_chroma_nnz =
 2033|  42.3k|                (ps_inter_lyr_mb_prms->u1_chroma_nnz & u1_chrm_mask) >> i4_chrm_rt_sft_amt;
 2034|  42.3k|            i4_tx_size =
 2035|  42.3k|                (ps_inter_lyr_mb_prms->i1_tx_size < 0) ? 1 : ps_inter_lyr_mb_prms->i1_tx_size;
  ------------------
  |  Branch (2035:17): [True: 0, False: 42.3k]
  ------------------
 2036|  42.3k|        }
 2037|       |
 2038|       |        /* since in dyadic case the window width and height will be 10x10   */
 2039|       |        /* and the window start offsets will be always 1 column left and    */
 2040|       |        /* 1 row above the block boundary. so the pointer and the required  */
 2041|       |        /* positions are appropriately modified                             */
 2042|  42.3k|        if(i4_offset_x >= 0)
  ------------------
  |  Branch (2042:12): [True: 33.0k, False: 9.36k]
  ------------------
 2043|  33.0k|        {
 2044|  33.0k|            pi2_inp++;
 2045|  33.0k|        }
 2046|       |
 2047|  42.3k|        if(i4_offset_y >= 0)
  ------------------
  |  Branch (2047:12): [True: 37.6k, False: 4.72k]
  ------------------
 2048|  37.6k|        {
 2049|  37.6k|            pi2_inp += i4_inp_stride;
 2050|  37.6k|        }
 2051|       |
 2052|  42.3k|        ps_ctxt->pf_residual_luma_dyadic(pv_residual_samp_ctxt, pi2_inp, i4_inp_stride, pi2_out,
 2053|  42.3k|                                         i4_out_stride, ps_ref_mb_mode, u2_mb_x, u2_mb_y,
 2054|  42.3k|                                         i4_luma_nnz, i4_tx_size);
 2055|  42.3k|    }
 2056|       |
 2057|       |    /* --------------------------------------------------------------------- */
 2058|       |    /* CHROMA PROCESSING                                                       */
 2059|       |    /* --------------------------------------------------------------------- */
 2060|       |    /* CB */
 2061|  42.3k|    pi2_inp = (WORD16 *) ps_ref_chroma->pv_buffer;
 2062|  42.3k|    pi2_out = (WORD16 *) ps_out_chroma->pv_buffer;
 2063|  42.3k|    i4_inp_stride = ps_ref_chroma->i4_num_element_stride;
 2064|  42.3k|    i4_out_stride = ps_out_chroma->i4_num_element_stride;
 2065|       |
 2066|       |    /* choose the appropriate chroma processing routine */
 2067|  42.3k|    if(SVCD_FALSE == ps_lyr_ctxt->i4_chrm_alt_proc)
  ------------------
  |  |   45|  42.3k|#define SVCD_FALSE 0
  ------------------
  |  Branch (2067:8): [True: 42.3k, False: 0]
  ------------------
 2068|  42.3k|    {
 2069|  42.3k|        WORD32 i4_offset_x, i4_offset_y;
 2070|  42.3k|        residual_samp_map_ctxt_t *ps_chroma_map;
 2071|  42.3k|        ref_mb_map_t *ps_x_off_len_chroma;
 2072|  42.3k|        ref_mb_map_t *ps_y_off_len_chroma;
 2073|       |
 2074|  42.3k|        ps_chroma_map = &ps_lyr_ctxt->s_chroma_map_ctxt;
 2075|  42.3k|        ps_x_off_len_chroma = ps_chroma_map->ps_x_offset_length;
 2076|  42.3k|        ps_y_off_len_chroma = ps_chroma_map->ps_y_offset_length;
 2077|       |
 2078|       |        /* get the actual offset for the buffers */
 2079|  42.3k|        i4_offset_x = ps_x_off_len_chroma[u2_mb_x].i2_offset;
 2080|  42.3k|        i4_offset_y = ps_y_off_len_chroma[u2_mb_y].i2_offset;
 2081|       |
 2082|       |        /* since in dyadic case the window width and height will be 6x6     */
 2083|       |        /* and the window start offsets will be always 1 column left and    */
 2084|       |        /* 1 row above the block boundary. so the pointer and the required  */
 2085|       |        /* positions are appropriately modified                             */
 2086|  42.3k|        if(i4_offset_x >= 0)
  ------------------
  |  Branch (2086:12): [True: 33.0k, False: 9.36k]
  ------------------
 2087|  33.0k|        {
 2088|  33.0k|            pi2_inp += 2;
 2089|  33.0k|        }
 2090|       |
 2091|  42.3k|        if(i4_offset_y >= 0)
  ------------------
  |  Branch (2091:12): [True: 37.6k, False: 4.72k]
  ------------------
 2092|  37.6k|        {
 2093|  37.6k|            pi2_inp += i4_inp_stride;
 2094|  37.6k|        }
 2095|       |
 2096|  42.3k|        if(0 != (i4_chroma_nnz & 0x01))
  ------------------
  |  Branch (2096:12): [True: 714, False: 41.6k]
  ------------------
 2097|    714|        {
 2098|    714|            ps_ctxt->pf_residual_chroma_dyadic(pv_residual_samp_ctxt, pi2_inp, i4_inp_stride,
 2099|    714|                                               pi2_out, i4_out_stride);
 2100|    714|        }
 2101|  42.3k|    }
 2102|      0|    else
 2103|      0|    {
 2104|      0|        ps_ctxt->pf_residual_chroma_dyadic_alt(pv_residual_samp_ctxt, u2_mb_x, u2_mb_y,
 2105|      0|                                               ps_ref_mb_mode, pi2_inp, i4_inp_stride, pi2_out,
 2106|      0|                                               i4_out_stride, SVCD_FALSE);
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
 2107|      0|    }
 2108|       |
 2109|       |    /* CR */
 2110|  42.3k|    pi2_inp += 1;
 2111|  42.3k|    pi2_out += 1;
 2112|       |
 2113|  42.3k|    if(SVCD_FALSE == ps_lyr_ctxt->i4_chrm_alt_proc)
  ------------------
  |  |   45|  42.3k|#define SVCD_FALSE 0
  ------------------
  |  Branch (2113:8): [True: 42.3k, False: 0]
  ------------------
 2114|  42.3k|    {
 2115|  42.3k|        if(0 != (i4_chroma_nnz & 0x10))
  ------------------
  |  Branch (2115:12): [True: 844, False: 41.5k]
  ------------------
 2116|    844|        {
 2117|    844|            ps_ctxt->pf_residual_chroma_dyadic(pv_residual_samp_ctxt, pi2_inp, i4_inp_stride,
 2118|    844|                                               pi2_out, i4_out_stride);
 2119|    844|        }
 2120|  42.3k|    }
 2121|      0|    else
 2122|      0|    {
 2123|      0|        ps_ctxt->pf_residual_chroma_dyadic_alt(pv_residual_samp_ctxt, u2_mb_x, u2_mb_y,
 2124|      0|                                               ps_ref_mb_mode, pi2_inp, i4_inp_stride, pi2_out,
 2125|      0|                                               i4_out_stride, SVCD_TRUE);
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 2126|      0|    }
 2127|  42.3k|    return OK;
  ------------------
  |  |  114|  42.3k|#define OK        0
  ------------------
 2128|  42.3k|}
isvcd_residual_samp_populate_list:
 2157|  69.1k|{
 2158|       |    /* --------------------------------------------------------------------- */
 2159|       |    /* Local variables required for finding the mapping between the layers     */
 2160|       |    /* --------------------------------------------------------------------- */
 2161|  69.1k|    UWORD32 u4_shift_x;
 2162|  69.1k|    UWORD32 u4_shift_y;
 2163|  69.1k|    UWORD32 u4_scale_x;
 2164|  69.1k|    UWORD32 u4_scale_y;
 2165|  69.1k|    WORD32 i4_offset_x;
 2166|  69.1k|    WORD32 i4_offset_y;
 2167|  69.1k|    WORD32 i4_add_x;
 2168|  69.1k|    WORD32 i4_add_y;
 2169|  69.1k|    WORD32 i4_delta_x;
 2170|  69.1k|    WORD32 i4_delta_y;
 2171|  69.1k|    WORD32 i4_refphase_x;
 2172|  69.1k|    WORD32 i4_refphase_y;
 2173|  69.1k|    WORD32 i4_phase_x;
 2174|  69.1k|    WORD32 i4_phase_y;
 2175|  69.1k|    WORD32 i4_sub_wd;
 2176|  69.1k|    WORD32 i4_sub_ht;
 2177|  69.1k|    WORD32 i4_mb_wd;
 2178|  69.1k|    WORD32 i4_mb_ht;
 2179|       |    /* --------------------------------------------------------------------- */
 2180|       |    /* Local Pointer Declaration for arrays in Mapping context                 */
 2181|       |    /* --------------------------------------------------------------------- */
 2182|  69.1k|    ref_mb_map_t *ps_x_off_len;
 2183|  69.1k|    ref_mb_map_t *ps_y_off_len;
 2184|  69.1k|    UWORD32 i4_ref_wd;
 2185|  69.1k|    UWORD32 i4_ref_ht;
 2186|  69.1k|    UWORD32 i4_scaled_wd;
 2187|  69.1k|    UWORD32 i4_scaled_ht;
 2188|  69.1k|    WORD32 i4_curr_lyr_width;
 2189|  69.1k|    WORD32 i4_curr_lyr_height;
 2190|       |
 2191|       |    /* --------------------------------------------------------------------- */
 2192|       |    /* Local Flag Declaration                                                 */
 2193|       |    /* --------------------------------------------------------------------- */
 2194|  69.1k|    WORD32 i4_ref_layer_field_pic_flag;
 2195|  69.1k|    WORD32 i4_field_pic_flag;
 2196|  69.1k|    WORD32 i4_frame_mbs_only_flag;
 2197|  69.1k|    WORD32 i4_ref_layer_frame_Mbs_only_flag;
 2198|  69.1k|    WORD32 i4_field_Mb_flag;
 2199|  69.1k|    WORD32 i4_bot_field_flag;
 2200|       |
 2201|       |    /* --------------------------------------------------------------------- */
 2202|       |    /* Cropping Parameters Declaration                                         */
 2203|       |    /* --------------------------------------------------------------------- */
 2204|  69.1k|    WORD32 i4_scaled_ref_layer_left_offset;
 2205|  69.1k|    WORD32 i4_scaled_ref_layer_top_offset;
 2206|       |
 2207|       |    /* --------------------------------------------------------------------- */
 2208|       |    /* Hardcoding flag information    (assuming no field support) */
 2209|       |    /* --------------------------------------------------------------------- */
 2210|  69.1k|    i4_ref_layer_field_pic_flag = SVCD_FALSE;
  ------------------
  |  |   45|  69.1k|#define SVCD_FALSE 0
  ------------------
 2211|  69.1k|    i4_field_pic_flag = SVCD_FALSE;
  ------------------
  |  |   45|  69.1k|#define SVCD_FALSE 0
  ------------------
 2212|  69.1k|    i4_frame_mbs_only_flag = SVCD_TRUE;
  ------------------
  |  |   46|  69.1k|#define SVCD_TRUE 1
  ------------------
 2213|  69.1k|    i4_field_Mb_flag = SVCD_FALSE;
  ------------------
  |  |   45|  69.1k|#define SVCD_FALSE 0
  ------------------
 2214|  69.1k|    i4_bot_field_flag = SVCD_FALSE;
  ------------------
  |  |   45|  69.1k|#define SVCD_FALSE 0
  ------------------
 2215|  69.1k|    i4_ref_layer_frame_Mbs_only_flag = SVCD_TRUE;
  ------------------
  |  |   46|  69.1k|#define SVCD_TRUE 1
  ------------------
 2216|       |
 2217|       |    /* --------------------------------------------------------------------- */
 2218|       |    /* Pointer and Paramater are intialized    - Chroma and Luma */
 2219|       |    /* --------------------------------------------------------------------- */
 2220|  69.1k|    {
 2221|  69.1k|        WORD32 i4_base_width;
 2222|  69.1k|        WORD32 i4_base_height;
 2223|  69.1k|        WORD32 i4_ref_layer_chroma_phase_x_plus1_flag;
 2224|  69.1k|        WORD32 i4_ref_layer_chroma_phase_y_plus1;
 2225|  69.1k|        WORD32 i4_chroma_phase_x_plus1_flag;
 2226|  69.1k|        WORD32 i4_chroma_phase_y_plus1;
 2227|       |
 2228|       |        /* ------------------------------------------------------------- */
 2229|       |        /* HARD CODED FOR 420                                             */
 2230|       |        /* ------------------------------------------------------------- */
 2231|  69.1k|        WORD32 i4_sub_wd_chroma = 2;
 2232|  69.1k|        WORD32 i4_sub_ht_chroma = 2;
 2233|       |
 2234|  69.1k|        i4_base_width = ps_ref_res_prms->i4_res_width;
 2235|  69.1k|        i4_base_height = ps_ref_res_prms->i4_res_height;
 2236|       |
 2237|  69.1k|        i4_ref_layer_chroma_phase_x_plus1_flag =
 2238|  69.1k|            ps_curr_res_prms->i1_ref_lyr_chroma_phase_x_plus1_flag;
 2239|  69.1k|        i4_ref_layer_chroma_phase_y_plus1 = ps_curr_res_prms->i1_ref_lyr_chroma_phase_y_plus1;
 2240|  69.1k|        i4_chroma_phase_x_plus1_flag =
 2241|  69.1k|            ps_subset_sps->s_sps_svc_ext.u1_seq_ref_layer_chroma_phase_x_plus1_flag;
 2242|  69.1k|        i4_chroma_phase_y_plus1 =
 2243|  69.1k|            ps_subset_sps->s_sps_svc_ext.u1_seq_ref_layer_chroma_phase_y_plus1;
 2244|  69.1k|        i4_scaled_ref_layer_left_offset = ps_curr_res_prms->s_ref_lyr_scaled_offset.i2_left;
 2245|  69.1k|        i4_scaled_ref_layer_top_offset = ps_curr_res_prms->s_ref_lyr_scaled_offset.i2_top;
 2246|       |
 2247|       |        /* ----------------------------------------------------------------- */
 2248|       |        /* Computing Effective Frame Dimensions                                 */
 2249|       |        /* ------------------------------------------------------------------*/
 2250|  69.1k|        i4_ref_wd = (i4_base_width >> i4_chroma_flag);
 2251|  69.1k|        i4_ref_ht = (i4_base_height >> i4_chroma_flag) * (1 + i4_ref_layer_field_pic_flag);
 2252|  69.1k|        i4_scaled_wd = ps_curr_res_prms->u2_scaled_ref_width;
 2253|  69.1k|        i4_scaled_ht = ps_curr_res_prms->u2_scaled_ref_height;
 2254|  69.1k|        i4_scaled_wd = (i4_scaled_wd >> i4_chroma_flag);
 2255|  69.1k|        i4_scaled_ht = (i4_scaled_ht >> i4_chroma_flag) * (1 + i4_field_pic_flag);
 2256|       |
 2257|  69.1k|        if(1 == i4_chroma_flag)
  ------------------
  |  Branch (2257:12): [True: 34.5k, False: 34.5k]
  ------------------
 2258|  34.5k|        {
 2259|  34.5k|            i4_refphase_x = i4_ref_layer_chroma_phase_x_plus1_flag - 1;
 2260|  34.5k|            i4_refphase_y = i4_ref_layer_chroma_phase_y_plus1 - 1;
 2261|  34.5k|            i4_phase_x = i4_chroma_phase_x_plus1_flag - 1;
 2262|  34.5k|            i4_phase_y = i4_chroma_phase_y_plus1 - 1;
 2263|  34.5k|            i4_sub_wd = i4_sub_wd_chroma;
 2264|  34.5k|            i4_sub_ht = i4_sub_ht_chroma;
 2265|  34.5k|            i4_mb_wd = MB_WIDTH >> 1;
  ------------------
  |  |   67|  34.5k|#define MB_WIDTH 16
  ------------------
 2266|  34.5k|            i4_mb_ht = MB_HEIGHT >> 1;
  ------------------
  |  |   68|  34.5k|#define MB_HEIGHT 16
  ------------------
 2267|  34.5k|        }
 2268|  34.5k|        else
 2269|  34.5k|        {
 2270|  34.5k|            i4_refphase_x = 0;
 2271|  34.5k|            i4_refphase_y = 0;
 2272|  34.5k|            i4_phase_x = 0;
 2273|  34.5k|            i4_phase_y = 0;
 2274|  34.5k|            i4_sub_wd = 1;
 2275|  34.5k|            i4_sub_ht = 1;
 2276|  34.5k|            i4_mb_wd = MB_WIDTH;
  ------------------
  |  |   67|  34.5k|#define MB_WIDTH 16
  ------------------
 2277|  34.5k|            i4_mb_ht = MB_HEIGHT;
  ------------------
  |  |   68|  34.5k|#define MB_HEIGHT 16
  ------------------
 2278|  34.5k|        }
 2279|  69.1k|    }
 2280|       |
 2281|       |    /* --------------------------------------------------------------------- */
 2282|       |    /* Derive shift x and y based on level idd                               */
 2283|       |    /* --------------------------------------------------------------------- */
 2284|  69.1k|    if(ps_sps->u1_level_idc <= 30)
  ------------------
  |  Branch (2284:8): [True: 63.9k, False: 5.23k]
  ------------------
 2285|  63.9k|    {
 2286|  63.9k|        u4_shift_x = 16;
 2287|  63.9k|        u4_shift_y = 16;
 2288|  63.9k|    }
 2289|  5.23k|    else
 2290|  5.23k|    {
 2291|  5.23k|        u4_shift_x = 31 - isvcd_get_ceil_log2(i4_ref_wd);
 2292|  5.23k|        u4_shift_y = 31 - isvcd_get_ceil_log2(i4_ref_ht);
 2293|  5.23k|    }
 2294|       |
 2295|       |    /* --------------------------------------------------------------------- */
 2296|       |    /* The following condition is not true in our case for time being         */
 2297|       |    /* --------------------------------------------------------------------- */
 2298|  69.1k|    if((SVCD_FALSE == i4_frame_mbs_only_flag) || (SVCD_FALSE == i4_ref_layer_frame_Mbs_only_flag))
  ------------------
  |  |   45|  69.1k|#define SVCD_FALSE 0
  ------------------
                  if((SVCD_FALSE == i4_frame_mbs_only_flag) || (SVCD_FALSE == i4_ref_layer_frame_Mbs_only_flag))
  ------------------
  |  |   45|  69.1k|#define SVCD_FALSE 0
  ------------------
  |  Branch (2298:8): [True: 0, False: 69.1k]
  |  Branch (2298:50): [True: 0, False: 69.1k]
  ------------------
 2299|      0|    {
 2300|      0|        i4_phase_y = i4_phase_y + 4 * i4_bot_field_flag;
 2301|       |
 2302|      0|        if(1 == i4_ref_layer_frame_Mbs_only_flag)
  ------------------
  |  Branch (2302:12): [True: 0, False: 0]
  ------------------
 2303|      0|            i4_refphase_y = (2 * i4_refphase_y) + 2;
 2304|      0|        else
 2305|      0|            i4_refphase_y = i4_refphase_y + (4 * i4_bot_field_flag);
 2306|      0|    }
 2307|       |
 2308|       |    /* --------------------------------------------------------------------- */
 2309|       |    /* Dx and Dy Computation - Ratio of the base and enhance layer width     */
 2310|       |    /* --------------------------------------------------------------------- */
 2311|  69.1k|    u4_scale_x = ((i4_ref_wd << u4_shift_x) + (i4_scaled_wd >> 1)) / (i4_scaled_wd);
 2312|       |
 2313|  69.1k|    u4_scale_y = ((i4_ref_ht << u4_shift_y) + (i4_scaled_ht >> 1)) / (i4_scaled_ht);
 2314|       |
 2315|  69.1k|    i4_offset_x = i4_scaled_ref_layer_left_offset / i4_sub_wd;
 2316|  69.1k|    i4_add_x = (((i4_ref_wd * (2 + i4_phase_x)) << (u4_shift_x - 2)) + (i4_scaled_wd >> 1)) /
 2317|  69.1k|                   i4_scaled_wd +
 2318|  69.1k|               (1 << (u4_shift_x - 5));
 2319|  69.1k|    i4_delta_x = 4 * (2 + i4_refphase_x);
 2320|       |
 2321|  69.1k|    if((SVCD_TRUE == i4_frame_mbs_only_flag) && (SVCD_TRUE == i4_ref_layer_frame_Mbs_only_flag))
  ------------------
  |  |   46|  69.1k|#define SVCD_TRUE 1
  ------------------
                  if((SVCD_TRUE == i4_frame_mbs_only_flag) && (SVCD_TRUE == i4_ref_layer_frame_Mbs_only_flag))
  ------------------
  |  |   46|  69.1k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2321:8): [True: 69.1k, False: 0]
  |  Branch (2321:49): [True: 69.1k, False: 0]
  ------------------
 2322|  69.1k|    {
 2323|  69.1k|        i4_offset_y = i4_scaled_ref_layer_top_offset / i4_sub_ht;
 2324|  69.1k|        i4_add_y = (((i4_ref_ht * (2 + i4_phase_y)) << (u4_shift_y - 2)) + (i4_scaled_ht >> 1)) /
 2325|  69.1k|                       i4_scaled_ht +
 2326|  69.1k|                   (1 << (u4_shift_y - 5));
 2327|  69.1k|        i4_delta_y = 4 * (2 + i4_refphase_y);
 2328|  69.1k|    }
 2329|      0|    else
 2330|      0|    {
 2331|      0|        i4_offset_y = i4_scaled_ref_layer_top_offset / (2 * i4_sub_ht);
 2332|      0|        i4_add_y = (((i4_ref_ht * (2 + i4_phase_y)) << (u4_shift_y - 3)) + (i4_scaled_ht >> 1)) /
 2333|      0|                       i4_scaled_ht +
 2334|      0|                   (1 << (u4_shift_y - 5));
 2335|      0|        i4_delta_y = 2 * (2 + i4_refphase_y);
 2336|      0|    }
 2337|       |
 2338|       |    /* --------------------------------------------------------------------- */
 2339|       |    /* Intializing Local Pointers    - Chroma and Luma                       */
 2340|       |    /* --------------------------------------------------------------------- */
 2341|  69.1k|    ps_x_off_len = ps_map_ctxt->ps_x_offset_length;
 2342|  69.1k|    ps_y_off_len = ps_map_ctxt->ps_y_offset_length;
 2343|  69.1k|    i4_curr_lyr_width = ps_curr_res_prms->i4_res_width >> i4_chroma_flag;
 2344|  69.1k|    i4_curr_lyr_height = ps_curr_res_prms->i4_res_height >> i4_chroma_flag;
 2345|       |
 2346|  69.1k|    {
 2347|  69.1k|        WORD32 i4_i, i4_j;
 2348|       |
 2349|       |        /* ----------------------------------------------------------------- */
 2350|       |        /* Computation of offsetX refArrayW Xmin and Xmax Lists               */
 2351|       |        /* ----------------------------------------------------------------- */
 2352|   312k|        for(i4_i = 0; i4_i < i4_curr_lyr_width; i4_i = i4_i + i4_mb_wd)
  ------------------
  |  Branch (2352:23): [True: 243k, False: 69.1k]
  ------------------
 2353|   243k|        {
 2354|   243k|            WORD32 i4_x_refmin16;
 2355|   243k|            WORD32 i4_x_refmax16;
 2356|   243k|            WORD32 i4_x_offset;
 2357|       |
 2358|   243k|            i4_x_refmin16 = (WORD64) (((WORD64) ((i4_i - i4_offset_x) * u4_scale_x) + i4_add_x) >>
 2359|   243k|                                      ((WORD32) (u4_shift_x - 4))) -
 2360|   243k|                            i4_delta_x;
 2361|       |
 2362|   243k|            i4_x_refmax16 =
 2363|   243k|                (WORD64) (((WORD64) (i4_i + i4_mb_wd - 1 - i4_offset_x) * u4_scale_x + i4_add_x) >>
 2364|   243k|                          ((WORD32) (u4_shift_x - 4))) -
 2365|   243k|                i4_delta_x;
 2366|       |
 2367|       |            /* AC205 */
 2368|   243k|            i4_x_offset = i4_x_refmin16 >> 4;
 2369|   243k|            ps_x_off_len->i2_offset = i4_x_offset;
 2370|   243k|            ps_x_off_len->i2_length = (i4_x_refmax16 >> 4) - i4_x_offset + 2;
 2371|       |
 2372|       |            /* increment the pointer */
 2373|   243k|            ps_x_off_len++;
 2374|       |
 2375|   243k|        } /* end of loop over current layer width */
 2376|       |
 2377|       |        /* ----------------------------------------------------------------- */
 2378|       |        /* Computation of offsetY refArrayH Ymin and Ymax Lists              */
 2379|       |        /* ----------------------------------------------------------------- */
 2380|   709k|        for(i4_j = 0; i4_j < i4_curr_lyr_height; i4_j = i4_j + i4_mb_ht)
  ------------------
  |  Branch (2380:23): [True: 640k, False: 69.1k]
  ------------------
 2381|   640k|        {
 2382|   640k|            WORD32 i4_y_refmin16;
 2383|   640k|            WORD32 i4_y_refmax16;
 2384|   640k|            WORD32 i4_y_offset;
 2385|       |
 2386|   640k|            i4_y_refmin16 = (WORD64) (((WORD64) (i4_j - i4_offset_y) * u4_scale_y + i4_add_y) >>
 2387|   640k|                                      ((WORD32) (u4_shift_y - 4))) -
 2388|   640k|                            i4_delta_y;
 2389|       |
 2390|   640k|            i4_y_refmax16 =
 2391|   640k|                (WORD64) (((WORD64) (i4_j + i4_mb_ht - 1 - i4_offset_y) * u4_scale_y + i4_add_y) >>
 2392|   640k|                          ((WORD32) (u4_shift_y - 4))) -
 2393|   640k|                i4_delta_y;
 2394|       |
 2395|       |            /* AC205 */
 2396|   640k|            i4_y_offset = i4_y_refmin16 >> 4;
 2397|   640k|            ps_y_off_len->i2_offset = i4_y_offset;
 2398|   640k|            ps_y_off_len->i2_length = (i4_y_refmax16 >> 4) - i4_y_offset + 2;
 2399|       |
 2400|       |            /* increment the pointer */
 2401|   640k|            ps_y_off_len++;
 2402|       |
 2403|   640k|        } /* end of loop over current layer height */
 2404|  69.1k|    }
 2405|       |
 2406|       |    /* --------------------------------------------------------------------- */
 2407|       |    /* Computation of Xref and Xphase List as per standard                     */
 2408|       |    /* --------------------------------------------------------------------- */
 2409|  69.1k|    ps_x_off_len = ps_map_ctxt->ps_x_offset_length;
 2410|  69.1k|    ps_y_off_len = ps_map_ctxt->ps_y_offset_length;
 2411|       |
 2412|  69.1k|    {
 2413|  69.1k|        WORD32 i4_xc;
 2414|  69.1k|        WORD32 i4_offset_x_index;
 2415|  69.1k|        ref_pixel_map_t *ps_x_pos_phase;
 2416|       |
 2417|  69.1k|        ps_x_pos_phase = ps_map_ctxt->ps_x_pos_phase;
 2418|       |
 2419|  2.99M|        for(i4_xc = 0; i4_xc < i4_curr_lyr_width; i4_xc++)
  ------------------
  |  Branch (2419:24): [True: 2.92M, False: 69.1k]
  ------------------
 2420|  2.92M|        {
 2421|  2.92M|            WORD32 i4_x_offset;
 2422|  2.92M|            WORD32 i4_x_ref16;
 2423|       |
 2424|  2.92M|            i4_offset_x_index = i4_xc / i4_mb_wd;
 2425|  2.92M|            i4_x_offset = ps_x_off_len[i4_offset_x_index].i2_offset;
 2426|  2.92M|            i4_x_ref16 = (WORD64) (((WORD64) (i4_xc - i4_offset_x) * u4_scale_x + i4_add_x) >>
 2427|  2.92M|                                   ((WORD32) (u4_shift_x - 4))) -
 2428|  2.92M|                         i4_delta_x;
 2429|       |
 2430|       |            /* store the values */
 2431|  2.92M|            ps_x_pos_phase->i2_ref_pos = (i4_x_ref16 >> 4) - i4_x_offset;
 2432|  2.92M|            ps_x_pos_phase->i2_phase = (i4_x_ref16 - (16 * i4_x_offset)) & 15;
 2433|       |
 2434|       |            /* increment the pointer */
 2435|  2.92M|            ps_x_pos_phase++;
 2436|  2.92M|        } /* end of loop over scaled width */
 2437|  69.1k|    }
 2438|       |
 2439|       |    /* --------------------------------------------------------------------- */
 2440|       |    /* Computation of Yref and Yphase List as per standard                     */
 2441|       |    /* --------------------------------------------------------------------- */
 2442|  69.1k|    {
 2443|  69.1k|        WORD32 i4_yc;
 2444|  69.1k|        WORD32 i4_offset_y_index;
 2445|  69.1k|        ref_pixel_map_t *ps_y_pos_phase;
 2446|       |
 2447|  69.1k|        ps_y_pos_phase = ps_map_ctxt->ps_y_pos_phase;
 2448|       |
 2449|  7.75M|        for(i4_yc = 0; i4_yc < i4_curr_lyr_height; i4_yc++)
  ------------------
  |  Branch (2449:24): [True: 7.68M, False: 69.1k]
  ------------------
 2450|  7.68M|        {
 2451|  7.68M|            WORD32 i4_y_offset;
 2452|  7.68M|            WORD32 i4_y_ref16;
 2453|       |
 2454|  7.68M|            i4_offset_y_index = i4_yc / i4_mb_ht;
 2455|  7.68M|            i4_y_offset = ps_y_off_len[i4_offset_y_index].i2_offset;
 2456|       |
 2457|  7.68M|            if((SVCD_FALSE == i4_frame_mbs_only_flag) ||
  ------------------
  |  |   45|  7.68M|#define SVCD_FALSE 0
  ------------------
  |  Branch (2457:16): [True: 0, False: 7.68M]
  ------------------
 2458|  7.68M|               (SVCD_FALSE == i4_ref_layer_frame_Mbs_only_flag))
  ------------------
  |  |   45|  7.68M|#define SVCD_FALSE 0
  ------------------
  |  Branch (2458:16): [True: 0, False: 7.68M]
  ------------------
 2459|      0|            {
 2460|      0|                i4_yc = i4_yc >> (1 - i4_field_Mb_flag);
 2461|      0|            }
 2462|       |
 2463|  7.68M|            i4_y_ref16 = (WORD64) ((((WORD64) (i4_yc - i4_offset_y) * u4_scale_y + i4_add_y) >>
 2464|  7.68M|                                    ((WORD32) (u4_shift_y - 4))) -
 2465|  7.68M|                                   i4_delta_y);
 2466|  7.68M|            ps_y_pos_phase->i2_ref_pos = (i4_y_ref16 >> 4) - i4_y_offset;
 2467|  7.68M|            ps_y_pos_phase->i2_phase = (i4_y_ref16 - (16 * i4_y_offset)) & 15;
 2468|       |
 2469|       |            /* increment the pointer */
 2470|  7.68M|            ps_y_pos_phase++;
 2471|  7.68M|        } /* end of loop over scaled height */
 2472|  69.1k|    }
 2473|  69.1k|    return;
 2474|  69.1k|}
isvcd_residual_samp_res_init:
 2501|   137k|{
 2502|   137k|    residual_sampling_ctxt_t *ps_ctxt;
 2503|   137k|    res_lyr_ctxt *ps_lyr_ctxt;
 2504|   137k|    dec_seq_params_t *ps_sps;
 2505|   137k|    dec_svc_seq_params_t *ps_subset_sps;
 2506|   137k|    svc_dec_lyr_struct_t *ps_svc_lyr_dec = (svc_dec_lyr_struct_t *) pv_svc_dec;
 2507|   137k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
 2508|       |
 2509|   137k|    void *pv_residual_samp_ctxt = ps_svc_lyr_dec->pv_residual_sample_ctxt;
 2510|   137k|    res_prms_t *ps_curr_lyr_res_prms = &ps_svc_lyr_dec->s_res_prms;
 2511|   137k|    ref_mb_map_t **pps_luma_map_horz = &ps_svc_lyr_dec->ps_ressam_luma_map_horz;
 2512|   137k|    ref_mb_map_t **pps_chroma_map_horz = &ps_svc_lyr_dec->ps_ressam_chroma_map_horz;
 2513|   137k|    ref_mb_map_t **pps_luma_map_vert = &ps_svc_lyr_dec->ps_ressam_luma_map_vert;
 2514|   137k|    ref_mb_map_t **pps_chroma_map_vert = &ps_svc_lyr_dec->ps_ressam_chroma_map_vert;
 2515|       |
 2516|   137k|    if((NULL == pv_residual_samp_ctxt) || (NULL == ps_curr_lyr_res_prms) ||
  ------------------
  |  Branch (2516:8): [True: 0, False: 137k]
  |  Branch (2516:43): [True: 0, False: 137k]
  ------------------
 2517|   137k|       (NULL == pps_luma_map_horz) || (NULL == pps_chroma_map_horz) ||
  ------------------
  |  Branch (2517:8): [True: 0, False: 137k]
  |  Branch (2517:39): [True: 0, False: 137k]
  ------------------
 2518|   137k|       (NULL == pps_luma_map_vert) || (NULL == pps_chroma_map_vert))
  ------------------
  |  Branch (2518:8): [True: 0, False: 137k]
  |  Branch (2518:39): [True: 0, False: 137k]
  ------------------
 2519|      0|    {
 2520|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 2521|      0|    }
 2522|       |
 2523|   137k|    ps_ctxt = (residual_sampling_ctxt_t *) pv_residual_samp_ctxt;
 2524|       |
 2525|       |    /* if called for base resolution store deafult values */
 2526|   137k|    if(SVCD_TRUE == ps_svc_lyr_dec->u1_base_res_flag)
  ------------------
  |  |   46|   137k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2526:8): [True: 102k, False: 34.5k]
  ------------------
 2527|   102k|    {
 2528|   102k|        *pps_luma_map_horz = NULL;
 2529|   102k|        *pps_chroma_map_horz = NULL;
 2530|   102k|        *pps_luma_map_vert = NULL;
 2531|   102k|        *pps_chroma_map_vert = NULL;
 2532|   102k|        ps_ctxt->i4_res_lyr_id = -1;
 2533|   102k|        ps_ctxt->i4_ref_width = ps_curr_lyr_res_prms->i4_res_width;
 2534|   102k|        ps_ctxt->i4_ref_height = ps_curr_lyr_res_prms->i4_res_height;
 2535|   102k|        return OK;
  ------------------
  |  |  114|   102k|#define OK        0
  ------------------
 2536|   102k|    }
 2537|       |
 2538|       |    /* derive the current sps */
 2539|  34.5k|    ps_sps = ps_dec->ps_cur_sps;
 2540|  34.5k|    ps_subset_sps = ps_svc_lyr_dec->ps_cur_subset_sps;
 2541|       |
 2542|       |    /* store the res id appropriately */
 2543|  34.5k|    ps_ctxt->i4_res_lyr_id = ps_svc_lyr_dec->u1_layer_id - 1;
 2544|       |
 2545|       |    /* get the current layer ctxt */
 2546|  34.5k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_svc_lyr_dec->u1_layer_id - 1];
 2547|       |
 2548|       |    /* get the width and heights */
 2549|  34.5k|    ps_lyr_ctxt->i4_curr_width = ps_curr_lyr_res_prms->i4_res_width;
 2550|  34.5k|    ps_lyr_ctxt->i4_curr_height = ps_curr_lyr_res_prms->i4_res_height;
 2551|  34.5k|    ps_lyr_ctxt->i4_ref_width = ps_ctxt->i4_ref_width;
 2552|  34.5k|    ps_lyr_ctxt->i4_ref_height = ps_ctxt->i4_ref_height;
 2553|       |
 2554|       |    /* store the strcuture pointer containing projected locations */
 2555|  34.5k|    *pps_luma_map_horz = ps_lyr_ctxt->s_luma_map_ctxt.ps_x_offset_length;
 2556|  34.5k|    *pps_chroma_map_horz = ps_lyr_ctxt->s_chroma_map_ctxt.ps_x_offset_length;
 2557|  34.5k|    *pps_luma_map_vert = ps_lyr_ctxt->s_luma_map_ctxt.ps_y_offset_length;
 2558|  34.5k|    *pps_chroma_map_vert = ps_lyr_ctxt->s_chroma_map_ctxt.ps_y_offset_length;
 2559|       |
 2560|       |    /* check for recomputation of mapping required */
 2561|  34.5k|    if(SVCD_TRUE == ps_curr_lyr_res_prms->u1_remap_req_flag)
  ------------------
  |  |   46|  34.5k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2561:8): [True: 34.5k, False: 0]
  ------------------
 2562|  34.5k|    {
 2563|  34.5k|        res_prms_t s_ref_res_prms = {0};
 2564|       |
 2565|       |        /* store the reference layer resolution width and height */
 2566|  34.5k|        s_ref_res_prms.i4_res_width = ps_ctxt->i4_ref_width;
 2567|  34.5k|        s_ref_res_prms.i4_res_height = ps_ctxt->i4_ref_height;
 2568|       |
 2569|       |        /* call the frame level projections calculation function */
 2570|  34.5k|        isvcd_residual_samp_populate_list(&ps_lyr_ctxt->s_luma_map_ctxt, ps_sps, ps_subset_sps,
 2571|  34.5k|                                          ps_curr_lyr_res_prms, &s_ref_res_prms, 0);
 2572|  34.5k|        isvcd_residual_samp_populate_list(&ps_lyr_ctxt->s_chroma_map_ctxt, ps_sps, ps_subset_sps,
 2573|  34.5k|                                          ps_curr_lyr_res_prms, &s_ref_res_prms, 1);
 2574|       |
 2575|       |        /* default values for flags */
 2576|  34.5k|        ps_lyr_ctxt->pf_residual_samp_mb = &isvcd_residual_samp_mb;
 2577|  34.5k|        ps_lyr_ctxt->i4_chrm_horz_int_mode = 0;
 2578|  34.5k|        ps_lyr_ctxt->i4_chrm_vert_int_mode = 0;
 2579|  34.5k|        ps_lyr_ctxt->i4_chrm_alt_proc = SVCD_FALSE;
  ------------------
  |  |   45|  34.5k|#define SVCD_FALSE 0
  ------------------
 2580|       |
 2581|       |        /* Store the Dyadic flag */
 2582|  34.5k|        ps_lyr_ctxt->i4_dyadic_flag = ps_curr_lyr_res_prms->u1_dyadic_flag;
 2583|       |
 2584|       |        /* set the appropriate chroma processing routine based on */
 2585|       |        /* phase values */
 2586|  34.5k|        if(SVCD_TRUE == ps_curr_lyr_res_prms->u1_dyadic_flag)
  ------------------
  |  |   46|  34.5k|#define SVCD_TRUE 1
  ------------------
  |  Branch (2586:12): [True: 18.0k, False: 16.5k]
  ------------------
 2587|  18.0k|        {
 2588|  18.0k|            WORD32 i4_ref_layer_chroma_phase_x_plus1_flag;
 2589|  18.0k|            WORD32 i4_ref_layer_chroma_phase_y_plus1;
 2590|  18.0k|            WORD32 i4_chroma_phase_x_plus1_flag;
 2591|  18.0k|            WORD32 i4_chroma_phase_y_plus1;
 2592|       |
 2593|  18.0k|            ps_lyr_ctxt->pf_residual_samp_mb = &isvcd_residual_samp_mb_dyadic;
 2594|  18.0k|            i4_ref_layer_chroma_phase_x_plus1_flag =
 2595|  18.0k|                ps_curr_lyr_res_prms->i1_ref_lyr_chroma_phase_x_plus1_flag;
 2596|  18.0k|            i4_ref_layer_chroma_phase_y_plus1 =
 2597|  18.0k|                ps_curr_lyr_res_prms->i1_ref_lyr_chroma_phase_y_plus1;
 2598|  18.0k|            i4_chroma_phase_x_plus1_flag =
 2599|  18.0k|                ps_subset_sps->s_sps_svc_ext.u1_seq_ref_layer_chroma_phase_x_plus1_flag;
 2600|  18.0k|            i4_chroma_phase_y_plus1 =
 2601|  18.0k|                ps_subset_sps->s_sps_svc_ext.u1_seq_ref_layer_chroma_phase_y_plus1;
 2602|  18.0k|            if((0 == i4_ref_layer_chroma_phase_x_plus1_flag) && (1 == i4_chroma_phase_x_plus1_flag))
  ------------------
  |  Branch (2602:16): [True: 5.30k, False: 12.6k]
  |  Branch (2602:65): [True: 0, False: 5.30k]
  ------------------
 2603|      0|            {
 2604|      0|                ps_lyr_ctxt->i4_chrm_horz_int_mode = 1;
 2605|      0|                ps_lyr_ctxt->i4_chrm_alt_proc = SVCD_TRUE;
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 2606|      0|            }
 2607|       |
 2608|  18.0k|            if((0 == i4_ref_layer_chroma_phase_y_plus1) && (1 == i4_chroma_phase_y_plus1))
  ------------------
  |  Branch (2608:16): [True: 1.87k, False: 16.1k]
  |  Branch (2608:60): [True: 0, False: 1.87k]
  ------------------
 2609|      0|            {
 2610|      0|                ps_lyr_ctxt->i4_chrm_vert_int_mode = 1;
 2611|      0|                ps_lyr_ctxt->i4_chrm_alt_proc = SVCD_TRUE;
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 2612|      0|            }
 2613|       |
 2614|  18.0k|            if((0 == i4_ref_layer_chroma_phase_y_plus1) && (2 == i4_chroma_phase_y_plus1))
  ------------------
  |  Branch (2614:16): [True: 1.87k, False: 16.1k]
  |  Branch (2614:60): [True: 0, False: 1.87k]
  ------------------
 2615|      0|            {
 2616|      0|                ps_lyr_ctxt->i4_chrm_vert_int_mode = 1;
 2617|      0|                ps_lyr_ctxt->i4_chrm_alt_proc = SVCD_TRUE;
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 2618|      0|            }
 2619|       |
 2620|  18.0k|            if((2 == i4_ref_layer_chroma_phase_y_plus1) && (0 == i4_chroma_phase_y_plus1))
  ------------------
  |  Branch (2620:16): [True: 3.34k, False: 14.6k]
  |  Branch (2620:60): [True: 0, False: 3.34k]
  ------------------
 2621|      0|            {
 2622|      0|                ps_lyr_ctxt->i4_chrm_vert_int_mode = 2;
 2623|      0|                ps_lyr_ctxt->i4_chrm_alt_proc = SVCD_TRUE;
  ------------------
  |  |   46|      0|#define SVCD_TRUE 1
  ------------------
 2624|      0|            }
 2625|  18.0k|        }
 2626|  34.5k|    }
 2627|      0|    else
 2628|      0|    {
 2629|       |        /* should take false value */
 2630|      0|        if(SVCD_FALSE != ps_curr_lyr_res_prms->u1_remap_req_flag)
  ------------------
  |  |   45|      0|#define SVCD_FALSE 0
  ------------------
  |  Branch (2630:12): [True: 0, False: 0]
  ------------------
 2631|      0|        {
 2632|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 2633|      0|        }
 2634|      0|    }
 2635|       |
 2636|       |    /* store the current layer width and height to context */
 2637|  34.5k|    ps_ctxt->i4_ref_width = ps_curr_lyr_res_prms->i4_res_width;
 2638|  34.5k|    ps_ctxt->i4_ref_height = ps_curr_lyr_res_prms->i4_res_height;
 2639|       |
 2640|       |    /* assert on max ranges of width and shift values */
 2641|  34.5k|    if((ps_lyr_ctxt->i4_curr_width > H264_MAX_FRAME_WIDTH) ||
  ------------------
  |  |   39|  34.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (2641:8): [True: 0, False: 34.5k]
  ------------------
 2642|  34.5k|       (ps_lyr_ctxt->i4_ref_width > H264_MAX_FRAME_WIDTH) ||
  ------------------
  |  |   39|  34.5k|#define H264_MAX_FRAME_WIDTH                4096
  ------------------
  |  Branch (2642:8): [True: 0, False: 34.5k]
  ------------------
 2643|  34.5k|       (ps_lyr_ctxt->i4_curr_height > H264_MAX_FRAME_HEIGHT) ||
  ------------------
  |  |   40|  34.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (2643:8): [True: 0, False: 34.5k]
  ------------------
 2644|  34.5k|       (ps_lyr_ctxt->i4_ref_height > H264_MAX_FRAME_HEIGHT))
  ------------------
  |  |   40|  34.5k|#define H264_MAX_FRAME_HEIGHT               4096
  ------------------
  |  Branch (2644:8): [True: 0, False: 34.5k]
  ------------------
 2645|      0|    {
 2646|      0|        return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
 2647|      0|    }
 2648|  34.5k|    return OK;
  ------------------
  |  |  114|  34.5k|#define OK        0
  ------------------
 2649|  34.5k|}

isvcd_compute_bs_non_mbaff_thread:
   91|  1.02M|{
   92|  1.02M|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
   93|       |    /* Mvpred and Nnz for top and Courrent */
   94|  1.02M|    mv_pred_t *ps_cur_mv_pred, *ps_top_mv_pred = NULL, *ps_left_mv_pred;
   95|       |    /* deblk_mb_t Params */
   96|  1.02M|    deblk_mb_t *ps_cur_mb_params; /*< Parameters of current MacroBlock */
   97|  1.02M|    deblkmb_neighbour_t *ps_deblk_top_mb;
   98|       |
   99|       |    /* Reference Index to POC mapping*/
  100|  1.02M|    void **apv_map_ref_idx_to_poc;
  101|  1.02M|    UWORD32 u4_leftmbtype;
  102|       |
  103|  1.02M|    UWORD16 u2_left_csbp, u2_top_csbp, u2_cur_csbp;
  104|       |
  105|       |    /* Set of flags */
  106|  1.02M|    UWORD32 u4_cur_mb_intra, u1_top_mb_typ, u4_cur_mb_fld;
  107|  1.02M|    UWORD32 u4_cur_mb_ibl;
  108|  1.02M|    UWORD32 u1_cur_mb_type;
  109|  1.02M|    UWORD32 *pu4_bs_table;
  110|       |
  111|  1.02M|    UWORD16 *pu2_curr_res_luma_csbp;
  112|  1.02M|    UWORD16 *pu2_left_res_luma_csbp;
  113|  1.02M|    UWORD16 *pu2_top_res_luma_csbp;
  114|       |
  115|       |    /* Neighbour availability */
  116|       |    /* Initialization */
  117|  1.02M|    const UWORD32 u2_mbx = ps_cur_mb_info->u2_mbx;
  118|  1.02M|    const UWORD32 u2_mby = ps_cur_mb_info->u2_mby;
  119|  1.02M|    const UWORD32 u1_pingpong = u2_mbx & 0x01;
  120|       |
  121|  1.02M|    PROFILE_DISABLE_BOUNDARY_STRENGTH()
  ------------------
  |  |  125|  1.02M|#define PROFILE_DISABLE_BOUNDARY_STRENGTH() ;
  ------------------
  122|  1.02M|    ps_deblk_top_mb = ps_dec->ps_deblk_top_mb + u2_mbx;
  123|       |
  124|       |    /* Pointer assignment for Current DeblkMB, Current Mv Pred  */
  125|  1.02M|    ps_cur_mb_params = ps_dec->ps_deblk_pic + u4_mb_num;
  126|  1.02M|    ps_cur_mv_pred = ps_dec->s_cur_pic.ps_mv + (u4_mb_num << 4);
  127|       |
  128|       |    /*Pointer assignment for Residual NNZ */
  129|  1.02M|    pu2_curr_res_luma_csbp = ps_svc_lyr_dec->pu2_frm_res_luma_csbp + ps_cur_mb_info->u2_mbx;
  130|  1.02M|    pu2_curr_res_luma_csbp += ps_cur_mb_info->u2_mby * ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride;
  131|       |
  132|  1.02M|    pu2_left_res_luma_csbp = pu2_curr_res_luma_csbp - (ps_cur_mb_info->u2_mbx != 0);
  133|  1.02M|    pu2_top_res_luma_csbp = pu2_curr_res_luma_csbp - ((ps_cur_mb_info->u2_mby != 0) *
  134|  1.02M|                                                      ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride);
  135|       |
  136|  1.02M|    apv_map_ref_idx_to_poc = (void **) ps_dec->ps_computebs_cur_slice->ppv_map_ref_idx_to_poc + 1;
  137|  1.02M|    u1_cur_mb_type = ps_cur_mb_params->u1_mb_type;
  138|  1.02M|    u1_top_mb_typ = ps_deblk_top_mb->u1_mb_type;
  139|  1.02M|    ps_deblk_top_mb->u1_mb_type = u1_cur_mb_type;
  140|       |
  141|  1.02M|    ps_cur_mb_params->u1_topmb_qp = ps_deblk_top_mb->u1_mb_qp;
  142|  1.02M|    ps_deblk_top_mb->u1_mb_qp = ps_cur_mb_params->u1_mb_qp;
  143|  1.02M|    ps_cur_mb_params->u1_left_mb_qp = ps_dec->deblk_left_mb[1].u1_mb_qp;
  144|  1.02M|    ps_dec->deblk_left_mb[1].u1_mb_qp = ps_cur_mb_params->u1_mb_qp;
  145|       |
  146|       |    /* if no deblocking required for current Mb then continue */
  147|       |    /* Check next Mbs   in Mb group                           */
  148|  1.02M|    if(ps_cur_mb_params->u1_deblocking_mode & MB_DISABLE_FILTERING)
  ------------------
  |  |   70|  1.02M|#define MB_DISABLE_FILTERING          0x01
  ------------------
  |  Branch (148:8): [True: 7.56k, False: 1.02M]
  ------------------
  149|  7.56k|    {
  150|  7.56k|        void **pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  7.56k|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  7.56k|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  151|  7.56k|        {
  152|       |            /* Store Parameter for Top MvPred refernce frame Address */
  153|  7.56k|            void **ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
  154|  7.56k|            WORD8 *p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
  155|  7.56k|            WORD8 *p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
  156|       |
  157|       |            /* Store Left addresses for Next Mb   */
  158|  7.56k|            void **ppv_left_mv_pred_addr = ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
  159|  7.56k|            WORD8 *p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
  160|       |
  161|  7.56k|            ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
  162|  7.56k|            ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
  163|       |
  164|  7.56k|            ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  165|  7.56k|            ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  166|  7.56k|            ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  167|  7.56k|            ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  168|       |
  169|  7.56k|            ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
  170|  7.56k|            ppv_left_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refleft0[1]];
  171|       |
  172|       |            /* Storing the leftMbtype for next Mb */
  173|  7.56k|            ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
  174|  7.56k|        }
  175|       |
  176|  7.56k|        return;
  177|  7.56k|    }
  178|       |
  179|       |    /* Flag for extra left Edge */
  180|  1.02M|    ps_cur_mb_params->u1_single_call = 1;
  181|       |
  182|       |    /* Update the Left deblk_mb_t and Left MvPred Parameters */
  183|  1.02M|    if(!u2_mbx)
  ------------------
  |  Branch (183:8): [True: 88.3k, False: 933k]
  ------------------
  184|  88.3k|    {
  185|  88.3k|        u4_leftmbtype = 0;
  186|       |
  187|       |        /* Initialize the ps_left_mv_pred with Junk but Valid Location */
  188|       |        /* to avoid invalid memory access                           */
  189|       |        /* this is read only pointer                                */
  190|  88.3k|        ps_left_mv_pred = ps_cur_mv_pred + 3;
  191|  88.3k|    }
  192|   933k|    else
  193|   933k|    {
  194|   933k|        u4_leftmbtype = ps_dec->deblk_left_mb[1].u1_mb_type;
  195|       |
  196|       |        /* Come to Left Most Edge of the MB */
  197|   933k|        ps_left_mv_pred = ps_cur_mv_pred - (1 << 4) + 3;
  198|   933k|    }
  199|       |
  200|  1.02M|    if(!u2_mby) u1_top_mb_typ = 0;
  ------------------
  |  Branch (200:8): [True: 59.3k, False: 962k]
  ------------------
  201|       |
  202|       |    /* MvPred Pointer Calculation */
  203|  1.02M|    ps_top_mv_pred = ps_cur_mv_pred - (ps_dec->u2_frm_wd_in_mbs << 4) + 12;
  204|  1.02M|    u4_cur_mb_intra = u1_cur_mb_type & D_INTRA_MB;
  ------------------
  |  |  382|  1.02M|#define D_INTRA_MB        1
  ------------------
  205|  1.02M|    u4_cur_mb_ibl = u1_cur_mb_type & D_INTRA_IBL;
  ------------------
  |  |   72|  1.02M|#define D_INTRA_IBL 16
  ------------------
  206|  1.02M|    u4_cur_mb_fld = !!(u1_cur_mb_type & D_FLD_MB);
  ------------------
  |  |  386|  1.02M|#define D_FLD_MB          0x80
  ------------------
  207|       |    /* Compute BS function */
  208|  1.02M|    pu4_bs_table = ps_cur_mb_params->u4_bs_table;
  209|       |
  210|  1.02M|    u2_cur_csbp = ps_cur_mb_info->ps_curmb->u2_luma_csbp;
  211|  1.02M|    u2_left_csbp = ps_cur_mb_info->ps_left_mb->u2_luma_csbp;
  212|  1.02M|    u2_top_csbp = ps_cur_mb_info->ps_top_mb->u2_luma_csbp;
  213|       |
  214|       |    /* Compute BS function */
  215|  1.02M|    if((ps_dec->ps_cur_sps->u1_profile_idc == HIGH_PROFILE_IDC) ||
  ------------------
  |  |  278|  1.02M|#define HIGH_PROFILE_IDC   100
  ------------------
  |  Branch (215:8): [True: 429k, False: 593k]
  ------------------
  216|   593k|       (ps_dec->ps_cur_sps->u1_profile_idc == HIGH_PROFILE_IDC) ||
  ------------------
  |  |  278|   593k|#define HIGH_PROFILE_IDC   100
  ------------------
  |  Branch (216:8): [True: 0, False: 593k]
  ------------------
  217|   593k|       (ps_dec->ps_cur_sps->u1_profile_idc == SCALABLE_HIGH_PROFILE_IDC) ||
  ------------------
  |  |   60|   593k|#define SCALABLE_HIGH_PROFILE_IDC 86
  ------------------
  |  Branch (217:8): [True: 13.5k, False: 579k]
  ------------------
  218|   579k|       (ps_dec->ps_cur_sps->u1_profile_idc == SCALABLE_BASELINE_PROFILE_IDC))
  ------------------
  |  |   59|   579k|#define SCALABLE_BASELINE_PROFILE_IDC 83
  ------------------
  |  Branch (218:8): [True: 17.0k, False: 562k]
  ------------------
  219|   459k|    {
  220|   459k|        if(ps_cur_mb_info->u1_tran_form8x8 == 1)
  ------------------
  |  Branch (220:12): [True: 7.48k, False: 452k]
  ------------------
  221|  7.48k|        {
  222|  7.48k|            u2_cur_csbp = ih264d_update_csbp_8x8(ps_cur_mb_info->ps_curmb->u2_luma_csbp);
  223|  7.48k|            ps_cur_mb_info->ps_curmb->u2_luma_csbp = u2_cur_csbp;
  224|  7.48k|        }
  225|   459k|    }
  226|  1.02M|    u2_cur_csbp |= *pu2_curr_res_luma_csbp;
  227|  1.02M|    u2_left_csbp |= *pu2_left_res_luma_csbp;
  228|  1.02M|    u2_top_csbp |= *pu2_top_res_luma_csbp;
  229|       |
  230|  1.02M|    if(u4_cur_mb_intra)
  ------------------
  |  Branch (230:8): [True: 14.2k, False: 1.00M]
  ------------------
  231|  14.2k|    {
  232|  14.2k|        pu4_bs_table[4] = 0x04040404;
  233|  14.2k|        pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  Branch (233:27): [True: 0, False: 14.2k]
  ------------------
  234|  14.2k|        pu4_bs_table[1] = 0x03030303;
  235|  14.2k|        pu4_bs_table[2] = 0x03030303;
  236|  14.2k|        pu4_bs_table[3] = 0x03030303;
  237|  14.2k|        pu4_bs_table[5] = 0x03030303;
  238|  14.2k|        pu4_bs_table[6] = 0x03030303;
  239|  14.2k|        pu4_bs_table[7] = 0x03030303;
  240|  14.2k|    }
  241|  1.00M|    else
  242|  1.00M|    {
  243|  1.00M|        isvcd_fill_bs_ibl(ps_cur_mb_params, u1_top_mb_typ, u4_leftmbtype, ps_cur_mb_info,
  244|  1.00M|                          pu2_curr_res_luma_csbp, pu2_left_res_luma_csbp, pu2_top_res_luma_csbp);
  245|       |
  246|  1.00M|        if(!u4_cur_mb_ibl)
  ------------------
  |  Branch (246:12): [True: 989k, False: 18.3k]
  ------------------
  247|   989k|        {
  248|   989k|            UWORD32 u4_is_non16x16 = !!(u1_cur_mb_type & D_PRED_NON_16x16);
  ------------------
  |  |  383|   989k|#define D_PRED_NON_16x16  2
  ------------------
  249|   989k|            UWORD32 u4_is_b = (ps_dec->ps_computebs_cur_slice->slice_type == B_SLICE);
  ------------------
  |  |  369|   989k|#define B_SLICE  1
  ------------------
  250|   989k|            UWORD32 u4_bs_0, u4_bs_4;
  251|       |
  252|   989k|            u4_bs_0 = pu4_bs_table[0];
  253|   989k|            u4_bs_4 = pu4_bs_table[4];
  254|       |
  255|   989k|            ih264d_fill_bs2_horz_vert(pu4_bs_table, u2_left_csbp, u2_top_csbp, u2_cur_csbp,
  256|   989k|                                      gau4_ih264d_packed_bs2, gau2_ih264d_4x4_v2h_reorder);
  257|       |
  258|   989k|            if(u4_leftmbtype & D_INTRA_MB)
  ------------------
  |  |  382|   989k|#define D_INTRA_MB        1
  ------------------
  |  Branch (258:16): [True: 928, False: 988k]
  ------------------
  259|    928|            {
  260|    928|                pu4_bs_table[4] = 0x04040404;
  261|    928|            }
  262|   988k|            else if(u4_leftmbtype & D_INTRA_IBL)
  ------------------
  |  |   72|   988k|#define D_INTRA_IBL 16
  ------------------
  |  Branch (262:21): [True: 2.58k, False: 985k]
  ------------------
  263|  2.58k|            {
  264|  2.58k|                pu4_bs_table[4] = u4_bs_4;
  265|  2.58k|            }
  266|       |
  267|   989k|            if(u1_top_mb_typ & D_INTRA_MB)
  ------------------
  |  |  382|   989k|#define D_INTRA_MB        1
  ------------------
  |  Branch (267:16): [True: 1.06k, False: 988k]
  ------------------
  268|  1.06k|            {
  269|  1.06k|                pu4_bs_table[0] = u4_cur_mb_fld ? 0x03030303 : 0x04040404;
  ------------------
  |  Branch (269:35): [True: 0, False: 1.06k]
  ------------------
  270|  1.06k|            }
  271|   988k|            else if(u1_top_mb_typ & D_INTRA_IBL)
  ------------------
  |  |   72|   988k|#define D_INTRA_IBL 16
  ------------------
  |  Branch (271:21): [True: 5.31k, False: 983k]
  ------------------
  272|  5.31k|            {
  273|  5.31k|                pu4_bs_table[0] = u4_bs_0;
  274|  5.31k|            }
  275|       |
  276|   989k|            ps_dec->pf_fill_bs1[u4_is_b][u4_is_non16x16](
  277|   989k|                ps_cur_mv_pred, ps_top_mv_pred, apv_map_ref_idx_to_poc, pu4_bs_table,
  278|   989k|                ps_left_mv_pred, &(ps_dec->ps_left_mvpred_addr[u1_pingpong][1]),
  279|   989k|                ps_cur_mb_info->ps_top_mb->u4_pic_addrress, (4 >> u4_cur_mb_fld));
  280|   989k|        }
  281|  1.00M|    }
  282|       |
  283|  1.02M|    {
  284|  1.02M|        void **pu4_map_ref_idx_to_poc_l1 = apv_map_ref_idx_to_poc + POC_LIST_L0_TO_L1_DIFF;
  ------------------
  |  |   86|  1.02M|#define POC_LIST_L0_TO_L1_DIFF  (( 2*MAX_FRAMES) + 1)
  |  |  ------------------
  |  |  |  |  600|  1.02M|#define MAX_FRAMES              16
  |  |  ------------------
  ------------------
  285|  1.02M|        {
  286|       |            /* Store Parameter for Top MvPred refernce frame Address */
  287|  1.02M|            void **ppv_top_mv_pred_addr = ps_cur_mb_info->ps_curmb->u4_pic_addrress;
  288|  1.02M|            WORD8 *p1_refTop0 = (ps_cur_mv_pred + 12)->i1_ref_frame;
  289|  1.02M|            WORD8 *p1_refTop1 = (ps_cur_mv_pred + 14)->i1_ref_frame;
  290|       |
  291|       |            /* Store Left addresses for Next Mb   */
  292|  1.02M|            void **ppv_left_mv_pred_addr = ps_dec->ps_left_mvpred_addr[!u1_pingpong][1].u4_add;
  293|  1.02M|            WORD8 *p1_refleft0 = (ps_cur_mv_pred + 3)->i1_ref_frame;
  294|       |
  295|  1.02M|            ppv_top_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refTop0[0]];
  296|  1.02M|            ppv_top_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refTop0[1]];
  297|       |
  298|  1.02M|            ppv_left_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  299|  1.02M|            ppv_top_mv_pred_addr[2] = apv_map_ref_idx_to_poc[p1_refTop1[0]];
  300|  1.02M|            ppv_left_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  301|  1.02M|            ppv_top_mv_pred_addr[3] = pu4_map_ref_idx_to_poc_l1[p1_refTop1[1]];
  302|       |
  303|  1.02M|            ppv_left_mv_pred_addr[0] = apv_map_ref_idx_to_poc[p1_refleft0[0]];
  304|  1.02M|            ppv_left_mv_pred_addr[1] = pu4_map_ref_idx_to_poc_l1[p1_refleft0[1]];
  305|       |
  306|       |            /* Storing the leftMbtype for next Mb */
  307|  1.02M|            ps_dec->deblk_left_mb[1].u1_mb_type = ps_cur_mb_params->u1_mb_type;
  308|  1.02M|        }
  309|  1.02M|    }
  310|       |
  311|       |    /* For transform 8x8 disable deblocking of the intrernal edges of a 8x8 block */
  312|  1.02M|    if(ps_cur_mb_info->u1_tran_form8x8)
  ------------------
  |  Branch (312:8): [True: 9.95k, False: 1.01M]
  ------------------
  313|  9.95k|    {
  314|  9.95k|        pu4_bs_table[1] = 0;
  315|  9.95k|        pu4_bs_table[3] = 0;
  316|  9.95k|        pu4_bs_table[5] = 0;
  317|  9.95k|        pu4_bs_table[7] = 0;
  318|  9.95k|    }
  319|  1.02M|}

isvcd_decode_recon_tfr_nmb_thread:
   76|   192k|{
   77|   192k|    WORD32 i, j;
   78|   192k|    dec_mb_info_t *ps_cur_mb_info;
   79|   192k|    dec_svc_mb_info_t *ps_svc_cur_mb_info;
   80|   192k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
   81|   192k|    const UWORD32 u1_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
   82|   192k|    UWORD32 u1_slice_type, u1_B;
   83|   192k|    WORD32 u1_skip_th;
   84|   192k|    UWORD32 u1_ipcm_th;
   85|   192k|    UWORD32 u4_cond;
   86|   192k|    UWORD16 u2_slice_num, u2_cur_dec_mb_num;
   87|   192k|    UWORD32 u4_mb_num;
   88|   192k|    WORD32 nop_cnt = 8 * 128;
   89|   192k|    UWORD16 *pu2_res_luma_csbp;
   90|   192k|    WORD32 ret;
   91|   192k|    u1_slice_type = ps_dec->ps_decode_cur_slice->slice_type;
   92|       |
   93|   192k|    u1_B = (u1_slice_type == B_SLICE);
  ------------------
  |  |  369|   192k|#define B_SLICE  1
  ------------------
   94|   192k|    u1_skip_th = ((u1_slice_type != I_SLICE) ? (u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  370|   192k|#define I_SLICE  2
  ------------------
                  u1_skip_th = ((u1_slice_type != I_SLICE) ? (u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  480|  29.0k|#define B_8x8    22
  ------------------
                  u1_skip_th = ((u1_slice_type != I_SLICE) ? (u1_B ? B_8x8 : PRED_8x8R0) : -1);
  ------------------
  |  |  454|   149k|#define PRED_8x8R0  4
  ------------------
  |  Branch (94:19): [True: 178k, False: 14.3k]
  |  Branch (94:49): [True: 29.0k, False: 149k]
  ------------------
   95|   192k|    u1_ipcm_th = ((u1_slice_type != I_SLICE) ? (u1_B ? 23 : 5) : 0);
  ------------------
  |  |  370|   192k|#define I_SLICE  2
  ------------------
  |  Branch (95:19): [True: 178k, False: 14.3k]
  |  Branch (95:49): [True: 29.0k, False: 149k]
  ------------------
   96|   192k|    u2_cur_dec_mb_num = ps_dec->cur_dec_mb_num;
   97|       |
   98|   291k|    while(1)
  ------------------
  |  Branch (98:11): [True: 291k, Folded]
  ------------------
   99|   291k|    {
  100|   291k|        UWORD32 u4_max_mb =
  101|   291k|            (UWORD32) (ps_dec->i2_dec_thread_mb_y + (1 << u1_mbaff)) * ps_dec->u2_frm_wd_in_mbs - 1;
  102|   291k|        u4_mb_num = u2_cur_dec_mb_num;
  103|       |        /*introducing 1 MB delay*/
  104|   291k|        u4_mb_num = MIN(u4_mb_num + u4_num_mbs + 1, u4_max_mb);
  ------------------
  |  |   61|   291k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 0, False: 291k]
  |  |  ------------------
  ------------------
  105|       |
  106|   291k|        CHECK_MB_MAP_BYTE(u4_mb_num, ps_dec->pu1_dec_mb_map, u4_cond);
  ------------------
  |  |   80|   291k|#define CHECK_MB_MAP_BYTE(u4_mb_num, mb_map, u4_cond)                                               \
  |  |   81|   291k|{                                                                                                   \
  |  |   82|   291k|        volatile UWORD8 *pu1_mb_flag;                                                               \
  |  |   83|   291k|                                                                                                    \
  |  |   84|   291k|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_num );                                           \
  |  |   85|   291k|                                                                                                    \
  |  |   86|   291k|        u4_cond = (*pu1_mb_flag);                                                                   \
  |  |   87|   291k|}
  ------------------
  107|   291k|        if(u4_cond)
  ------------------
  |  Branch (107:12): [True: 191k, False: 99.9k]
  ------------------
  108|   191k|        {
  109|   191k|            break;
  110|   191k|        }
  111|  99.9k|        else
  112|  99.9k|        {
  113|  99.9k|            if(nop_cnt > 0)
  ------------------
  |  Branch (113:16): [True: 86.5k, False: 13.4k]
  ------------------
  114|  86.5k|            {
  115|  86.5k|                nop_cnt -= 128;
  116|  86.5k|                NOP(128);
  ------------------
  |  |   87|  11.1M|#define NOP(nop_cnt) {UWORD32 nop_i; for (nop_i = 0; nop_i < nop_cnt; nop_i++) asm("nop");}
  |  |  ------------------
  |  |  |  Branch (87:54): [True: 11.0M, False: 86.5k]
  |  |  ------------------
  ------------------
  117|  86.5k|            }
  118|  13.4k|            else
  119|  13.4k|            {
  120|  13.4k|                if(ps_dec->u4_output_present && (2 == ps_dec->u4_num_cores) &&
  ------------------
  |  Branch (120:20): [True: 12.4k, False: 920]
  |  Branch (120:49): [True: 12.4k, False: 0]
  ------------------
  121|  12.4k|                   (ps_dec->u4_fmt_conv_cur_row < ps_dec->s_disp_frame_info.u4_y_ht))
  ------------------
  |  Branch (121:20): [True: 4.81k, False: 7.68k]
  ------------------
  122|  4.81k|                {
  123|  4.81k|                    ps_dec->u4_fmt_conv_num_rows =
  124|  4.81k|                        MIN(FMT_CONV_NUM_ROWS,
  ------------------
  |  |   61|  4.81k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 4.41k, False: 392]
  |  |  ------------------
  ------------------
  125|  4.81k|                            (ps_dec->s_disp_frame_info.u4_y_ht - ps_dec->u4_fmt_conv_cur_row));
  126|  4.81k|                    ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op), ps_dec->u4_fmt_conv_cur_row,
  127|  4.81k|                                          ps_dec->u4_fmt_conv_num_rows);
  128|  4.81k|                    ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
  129|  4.81k|                }
  130|  8.60k|                else
  131|  8.60k|                {
  132|  8.60k|                    nop_cnt = 8 * 128;
  133|  8.60k|                    ithread_yield();
  134|  8.60k|                }
  135|  13.4k|                if(1 == ps_svc_lyr_dec->u1_error_in_cur_frame)
  ------------------
  |  Branch (135:20): [True: 927, False: 12.4k]
  ------------------
  136|    927|                {
  137|    927|                    return NOT_OK;
  ------------------
  |  |  116|    927|#define NOT_OK    -1
  ------------------
  138|    927|                }
  139|  13.4k|            }
  140|  99.9k|        }
  141|   291k|    }
  142|       |
  143|       |    /* N Mb MC Loop */
  144|   821k|    for(i = 0; i < u4_num_mbs; i++)
  ------------------
  |  Branch (144:16): [True: 637k, False: 184k]
  ------------------
  145|   637k|    {
  146|   637k|        u4_mb_num = u2_cur_dec_mb_num;
  147|   637k|        GET_SLICE_NUM_MAP(ps_dec->pu2_slice_num_map, u2_cur_dec_mb_num, u2_slice_num);
  ------------------
  |  |  156|   637k|#define GET_SLICE_NUM_MAP(slice_map, mb_number,u2_slice_num)                                                  \
  |  |  157|   637k|{                                                                                                   \
  |  |  158|   637k|        volatile UWORD16 *pu2_slice_map;                                                               \
  |  |  159|   637k|                                                                                                    \
  |  |  160|   637k|        pu2_slice_map    = (UWORD16 *)slice_map + (mb_number);                                         \
  |  |  161|   637k|        u2_slice_num = (*pu2_slice_map) ;                                                               \
  |  |  162|   637k|}
  ------------------
  148|       |
  149|   637k|        if(u2_slice_num != ps_dec->u2_cur_slice_num_dec_thread)
  ------------------
  |  Branch (149:12): [True: 7.02k, False: 630k]
  ------------------
  150|  7.02k|        {
  151|  7.02k|            ps_dec->u4_cur_slice_decode_done = 1;
  152|  7.02k|            break;
  153|  7.02k|        }
  154|       |
  155|   630k|        ps_cur_mb_info = &ps_dec->ps_frm_mb_info[u2_cur_dec_mb_num];
  156|       |
  157|   630k|        ps_dec->u4_dma_buf_idx = 0;
  158|   630k|        ps_dec->u4_pred_info_idx = 0;
  159|       |
  160|       |        /*Pointer assignment for Residual NNZ */
  161|   630k|        pu2_res_luma_csbp = ps_svc_lyr_dec->pu2_frm_res_luma_csbp + ps_cur_mb_info->u2_mbx;
  162|   630k|        pu2_res_luma_csbp += ps_cur_mb_info->u2_mby * ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride;
  163|       |
  164|   630k|        if(ps_cur_mb_info->u1_mb_type <= u1_skip_th)
  ------------------
  |  Branch (164:12): [True: 150k, False: 479k]
  ------------------
  165|   150k|        {
  166|   150k|            WORD32 pred_cnt = 0;
  167|   150k|            pred_info_pkd_t *ps_pred_pkd;
  168|   150k|            UWORD32 u4_pred_info_pkd_idx;
  169|       |
  170|   150k|            u4_pred_info_pkd_idx = ps_cur_mb_info->u4_pred_info_pkd_idx;
  171|       |
  172|   427k|            while(pred_cnt < ps_cur_mb_info->u1_num_pred_parts)
  ------------------
  |  Branch (172:19): [True: 276k, False: 150k]
  ------------------
  173|   276k|            {
  174|   276k|                ps_pred_pkd = ps_dec->ps_pred_pkd + u4_pred_info_pkd_idx;
  175|       |
  176|   276k|                ps_dec->p_form_mb_part_info_thread(ps_pred_pkd, ps_dec, ps_cur_mb_info->u2_mbx,
  177|   276k|                                                   ps_cur_mb_info->u2_mby, (i >> u1_mbaff),
  178|   276k|                                                   ps_cur_mb_info);
  179|       |
  180|   276k|                u4_pred_info_pkd_idx++;
  181|   276k|                pred_cnt++;
  182|   276k|            }
  183|   150k|            ps_dec->p_mc_dec_thread(ps_dec, ps_cur_mb_info);
  184|   150k|        }
  185|   479k|        else if(ps_cur_mb_info->u1_mb_type == MB_SKIP)
  ------------------
  |  |  456|   479k|#define MB_SKIP     255
  ------------------
  |  Branch (185:17): [True: 416k, False: 63.7k]
  ------------------
  186|   416k|        {
  187|   416k|            WORD32 pred_cnt = 0;
  188|   416k|            pred_info_pkd_t *ps_pred_pkd;
  189|   416k|            UWORD32 u4_pred_info_pkd_idx;
  190|       |
  191|   416k|            u4_pred_info_pkd_idx = ps_cur_mb_info->u4_pred_info_pkd_idx;
  192|       |
  193|   875k|            while(pred_cnt < ps_cur_mb_info->u1_num_pred_parts)
  ------------------
  |  Branch (193:19): [True: 459k, False: 416k]
  ------------------
  194|   459k|            {
  195|   459k|                ps_pred_pkd = ps_dec->ps_pred_pkd + u4_pred_info_pkd_idx;
  196|       |
  197|   459k|                ps_dec->p_form_mb_part_info_thread(ps_pred_pkd, ps_dec, ps_cur_mb_info->u2_mbx,
  198|   459k|                                                   ps_cur_mb_info->u2_mby, (i >> u1_mbaff),
  199|   459k|                                                   ps_cur_mb_info);
  200|       |
  201|   459k|                u4_pred_info_pkd_idx++;
  202|   459k|                pred_cnt++;
  203|   459k|            }
  204|       |            /* Decode MB skip */
  205|   416k|            ps_dec->p_mc_dec_thread(ps_dec, ps_cur_mb_info);
  206|       |
  207|   416k|            *pu2_res_luma_csbp = 0;
  208|   416k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
  209|   416k|                ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start + ps_cur_mb_info->u2_mbx +
  210|   416k|                (ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride * (ps_cur_mb_info->u2_mby));
  211|   416k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_mb_mode = SVC_INTER_MB;
  ------------------
  |  |  114|   416k|#define SVC_INTER_MB (1 << 0)       /*!< Intra MBs other than IPCM and I_BL */
  ------------------
  212|   416k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_tx_size =
  213|   416k|                ps_cur_mb_info->u1_tran_form8x8;
  214|   416k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u2_luma_nnz = 0;
  215|   416k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->u1_chroma_nnz = 0;
  216|   416k|        }
  217|       |
  218|   630k|        u2_cur_dec_mb_num++;
  219|   630k|    }
  220|       |
  221|       |    /* N Mb IQ IT RECON  Loop */
  222|   821k|    for(j = 0; j < i; j++)
  ------------------
  |  Branch (222:16): [True: 630k, False: 191k]
  ------------------
  223|   630k|    {
  224|   630k|        ps_cur_mb_info = &ps_dec->ps_frm_mb_info[ps_dec->cur_dec_mb_num];
  225|   630k|        ps_svc_cur_mb_info = &ps_svc_lyr_dec->ps_svc_frm_mb_info[ps_dec->cur_dec_mb_num];
  226|       |
  227|   630k|        if(NULL == ps_cur_mb_info->ps_curmb)
  ------------------
  |  Branch (227:12): [True: 0, False: 630k]
  ------------------
  228|      0|        {
  229|      0|            return NOT_OK;
  ------------------
  |  |  116|      0|#define NOT_OK    -1
  ------------------
  230|      0|        }
  231|       |
  232|       |        /*Pointer assignment for Residual NNZ */
  233|   630k|        pu2_res_luma_csbp = ps_svc_lyr_dec->pu2_frm_res_luma_csbp + ps_cur_mb_info->u2_mbx;
  234|   630k|        pu2_res_luma_csbp += ps_cur_mb_info->u2_mby * ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride;
  235|       |
  236|   630k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb =
  237|   630k|            ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start + ps_cur_mb_info->u2_mbx +
  238|   630k|            (ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride * (ps_cur_mb_info->u2_mby));
  239|       |
  240|   630k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_cur_mb->i1_slice_id = (WORD8) ps_dec->u2_cur_slice_num;
  241|       |
  242|   630k|        if((ps_dec->u4_num_cores == 2) || !ps_dec->i1_recon_in_thread3_flag)
  ------------------
  |  Branch (242:12): [True: 630k, False: 0]
  |  Branch (242:43): [True: 0, False: 0]
  ------------------
  243|   630k|        {
  244|   630k|            if(ps_cur_mb_info->u1_mb_type <= u1_skip_th)
  ------------------
  |  Branch (244:16): [True: 150k, False: 479k]
  ------------------
  245|   150k|            {
  246|   150k|                {
  247|       |                    /* inter intra pred generation */
  248|   150k|                    if(SVCD_FALSE == ps_svc_lyr_dec->u1_dyadic_flag)
  ------------------
  |  |   45|   150k|#define SVCD_FALSE 0
  ------------------
  |  Branch (248:24): [True: 103k, False: 46.6k]
  ------------------
  249|   103k|                    {
  250|   103k|                        ret = isvcd_process_ii_mb(ps_svc_lyr_dec, ps_cur_mb_info,
  251|   103k|                                                  ps_svc_cur_mb_info, j);
  252|   103k|                        if(ret != OK) return ret;
  ------------------
  |  |  114|   103k|#define OK        0
  ------------------
  |  Branch (252:28): [True: 0, False: 103k]
  ------------------
  253|   103k|                    }
  254|   150k|                    if(0 == ps_svc_cur_mb_info->u1_residual_prediction_flag)
  ------------------
  |  Branch (254:24): [True: 40.1k, False: 110k]
  ------------------
  255|  40.1k|                    {
  256|       |                        /* IT + Recon */
  257|  40.1k|                        ih264d_process_inter_mb(ps_dec, ps_cur_mb_info, j);
  258|  40.1k|                        isvcd_update_inter_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info, 0);
  259|  40.1k|                        *pu2_res_luma_csbp = ps_cur_mb_info->u2_luma_csbp;
  260|  40.1k|                    }
  261|   110k|                    else
  262|   110k|                    {
  263|       |                        /* IT + Residual + Recon */
  264|   110k|                        ret = isvcd_process_inter_mb_rsd_pred_target_lyr(
  265|   110k|                            ps_svc_lyr_dec, ps_cur_mb_info, j, 0, pu2_res_luma_csbp);
  266|   110k|                        if(ret != OK) return ret;
  ------------------
  |  |  114|   110k|#define OK        0
  ------------------
  |  Branch (266:28): [True: 0, False: 110k]
  ------------------
  267|   110k|                    }
  268|   150k|                }
  269|   150k|            }
  270|       |
  271|   479k|            else if((ps_cur_mb_info->u1_mb_type != MB_SKIP) &&
  ------------------
  |  |  456|   479k|#define MB_SKIP     255
  ------------------
  |  Branch (271:21): [True: 63.7k, False: 416k]
  ------------------
  272|  63.7k|                    (ps_cur_mb_info->u1_mb_type != MB_INFER))
  ------------------
  |  |  112|  63.7k|#define MB_INFER 250
  ------------------
  |  Branch (272:21): [True: 10.8k, False: 52.9k]
  ------------------
  273|  10.8k|            {
  274|  10.8k|                if((u1_ipcm_th + 25) != ps_cur_mb_info->u1_mb_type)
  ------------------
  |  Branch (274:20): [True: 10.7k, False: 98]
  ------------------
  275|  10.7k|                {
  276|  10.7k|                    ps_cur_mb_info->u1_mb_type -= (u1_skip_th + 1);
  277|  10.7k|                    ih264d_process_intra_mb(ps_dec, ps_cur_mb_info, j);
  278|  10.7k|                    isvcd_update_intra_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info);
  279|  10.7k|                }
  280|     98|                else
  281|     98|                {
  282|     98|                    isvcd_update_ipcm_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info);
  283|     98|                }
  284|  10.8k|                *pu2_res_luma_csbp = 0;
  285|  10.8k|            }
  286|   468k|            else if(ps_cur_mb_info->u1_mb_type == MB_INFER)
  ------------------
  |  |  112|   468k|#define MB_INFER 250
  ------------------
  |  Branch (286:21): [True: 52.9k, False: 416k]
  ------------------
  287|  52.9k|            {
  288|       |                /* inter layer intra prediction : intra upsample, IQ, IT ,deblock */
  289|  52.9k|                {
  290|       |                    /* Intra resample for IBL mode */
  291|  52.9k|                    ret = isvcd_process_ibl_mb(ps_svc_lyr_dec, ps_cur_mb_info, j, 0);
  292|  52.9k|                    if(ret != OK) return ret;
  ------------------
  |  |  114|  52.9k|#define OK        0
  ------------------
  |  Branch (292:24): [True: 0, False: 52.9k]
  ------------------
  293|       |                    /* Pass intra resample as pred to Recon generation */
  294|  52.9k|                    ih264d_process_inter_mb(ps_dec, ps_cur_mb_info, j);
  295|  52.9k|                    isvcd_update_inter_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info, 1);
  296|  52.9k|                    *pu2_res_luma_csbp = ps_cur_mb_info->u2_luma_csbp;
  297|  52.9k|                }
  298|  52.9k|                ps_dec->pi1_left_pred_mode[0] = DC;
  ------------------
  |  |  431|  52.9k|#define DC      2
  ------------------
  299|  52.9k|                ps_dec->pi1_left_pred_mode[1] = DC;
  ------------------
  |  |  431|  52.9k|#define DC      2
  ------------------
  300|  52.9k|                ps_dec->pi1_left_pred_mode[2] = DC;
  ------------------
  |  |  431|  52.9k|#define DC      2
  ------------------
  301|  52.9k|                ps_dec->pi1_left_pred_mode[3] = DC;
  ------------------
  |  |  431|  52.9k|#define DC      2
  ------------------
  302|       |
  303|  52.9k|                ps_cur_mb_info->ps_curmb->pi1_intrapredmodes[0] = DC;
  ------------------
  |  |  431|  52.9k|#define DC      2
  ------------------
  304|  52.9k|                ps_cur_mb_info->ps_curmb->pi1_intrapredmodes[1] = DC;
  ------------------
  |  |  431|  52.9k|#define DC      2
  ------------------
  305|  52.9k|                ps_cur_mb_info->ps_curmb->pi1_intrapredmodes[2] = DC;
  ------------------
  |  |  431|  52.9k|#define DC      2
  ------------------
  306|  52.9k|                ps_cur_mb_info->ps_curmb->pi1_intrapredmodes[3] = DC;
  ------------------
  |  |  431|  52.9k|#define DC      2
  ------------------
  307|       |
  308|  52.9k|                isvcd_update_ibl_mb_inter_layer_info(ps_svc_lyr_dec, ps_cur_mb_info);
  309|  52.9k|            }
  310|       |
  311|   630k|            if(ps_dec->u4_use_intrapred_line_copy == 1)
  ------------------
  |  Branch (311:16): [True: 630k, False: 0]
  ------------------
  312|   630k|                ih264d_copy_intra_pred_line(ps_dec, ps_cur_mb_info, j);
  313|   630k|        }
  314|       |
  315|   630k|        DATA_SYNC();
  ------------------
  |  |  116|   630k|#define DATA_SYNC()  __sync_synchronize()
  ------------------
  316|       |
  317|   630k|        u4_mb_num = ps_cur_mb_info->u2_mbx + ps_dec->u2_frm_wd_in_mbs * ps_cur_mb_info->u2_mby;
  318|   630k|        UPDATE_MB_MAP_MBNUM_BYTE(ps_dec->pu1_recon_mb_map, u4_mb_num);
  ------------------
  |  |  136|   630k|#define UPDATE_MB_MAP_MBNUM_BYTE(mb_map, u4_mb_number)                                                  \
  |  |  137|   630k|{                                                                                                   \
  |  |  138|   630k|        volatile UWORD8 *pu1_mb_flag;                                                                       \
  |  |  139|   630k|                                                                                                    \
  |  |  140|   630k|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_number);                                                     \
  |  |  141|   630k|        /*                                                                                          \
  |  |  142|   630k|         * In case of MbAff, update the mb_map only if the entire MB is done. We can check that     \
  |  |  143|   630k|         * by checking if Y is odd, implying that this is the second row in the MbAff MB            \
  |  |  144|   630k|         */                                                                                         \
  |  |  145|   630k|        (*pu1_mb_flag) = 1;                                                             \
  |  |  146|   630k|}
  ------------------
  319|   630k|        ps_dec->cur_dec_mb_num++;
  320|   630k|    }
  321|       |
  322|       |    /*N MB deblocking*/
  323|   191k|    if(ps_dec->u4_nmb_deblk == 1)
  ------------------
  |  Branch (323:8): [True: 0, False: 191k]
  ------------------
  324|      0|    {
  325|      0|        UWORD32 u4_wd_y, u4_wd_uv;
  326|      0|        tfr_ctxt_t *ps_tfr_cxt = &(ps_dec->s_tran_addrecon);
  327|      0|        UWORD8 u1_field_pic_flag = ps_dec->ps_cur_slice->u1_field_pic_flag;
  328|      0|        const WORD32 i4_cb_qp_idx_ofst = ps_dec->ps_cur_pps->i1_chroma_qp_index_offset;
  329|      0|        const WORD32 i4_cr_qp_idx_ofst = ps_dec->ps_cur_pps->i1_second_chroma_qp_index_offset;
  330|       |
  331|      0|        u4_wd_y = ps_dec->u2_frm_wd_y << u1_field_pic_flag;
  332|      0|        u4_wd_uv = ps_dec->u2_frm_wd_uv << u1_field_pic_flag;
  333|       |
  334|      0|        ps_cur_mb_info = &ps_dec->ps_frm_mb_info[ps_dec->u4_cur_deblk_mb_num];
  335|       |
  336|      0|        ps_dec->u4_deblk_mb_x = ps_cur_mb_info->u2_mbx;
  337|      0|        ps_dec->u4_deblk_mb_y = ps_cur_mb_info->u2_mby;
  338|       |
  339|      0|        for(j = 0; j < i; j++)
  ------------------
  |  Branch (339:20): [True: 0, False: 0]
  ------------------
  340|      0|        {
  341|      0|            ih264d_deblock_mb_nonmbaff(ps_dec, ps_tfr_cxt, i4_cb_qp_idx_ofst, i4_cr_qp_idx_ofst,
  342|      0|                                       u4_wd_y, u4_wd_uv);
  343|      0|        }
  344|      0|    }
  345|       |
  346|       |    /*handle the last mb in picture case*/
  347|   191k|    if(ps_dec->cur_dec_mb_num > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (347:8): [True: 19.7k, False: 171k]
  ------------------
  348|  19.7k|        ps_dec->u4_cur_slice_decode_done = 1;
  349|       |
  350|   191k|    if(i != u4_num_mbs)
  ------------------
  |  Branch (350:8): [True: 7.02k, False: 184k]
  ------------------
  351|  7.02k|    {
  352|  7.02k|        u4_end_of_row = 0;
  353|       |        /*Number of MB's left in row*/
  354|  7.02k|        u4_num_mbs_next = u4_num_mbs_next + ((u4_num_mbs - i) >> u1_mbaff);
  355|  7.02k|    }
  356|       |
  357|   191k|    ih264d_decode_tfr_nmb(ps_dec, (i), u4_num_mbs_next, u4_end_of_row);
  358|       |
  359|   191k|    return OK;
  ------------------
  |  |  114|   191k|#define OK        0
  ------------------
  360|   191k|}
isvcd_decode_slice_thread:
  381|  28.4k|{
  382|  28.4k|    UWORD32 u4_num_mbs_next, u4_num_mbsleft, u4_end_of_row = 0;
  383|  28.4k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  384|  28.4k|    const UWORD32 i2_pic_wdin_mbs = ps_dec->u2_frm_wd_in_mbs;
  385|  28.4k|    UWORD32 u4_mbaff, u4_num_mbs;
  386|       |
  387|  28.4k|    UWORD16 u2_first_mb_in_slice;
  388|  28.4k|    UWORD16 i16_mb_x, i16_mb_y;
  389|  28.4k|    UWORD8 u1_field_pic;
  390|  28.4k|    UWORD32 u4_frame_stride, x_offset, y_offset;
  391|  28.4k|    WORD32 ret;
  392|  28.4k|    tfr_ctxt_t *ps_trns_addr;
  393|       |
  394|       |    /*check for mb map of first mb in slice to ensure slice header is parsed*/
  395|   148k|    while(1)
  ------------------
  |  Branch (395:11): [True: 148k, Folded]
  ------------------
  396|   148k|    {
  397|   148k|        UWORD32 u4_mb_num = ps_dec->cur_dec_mb_num;
  398|   148k|        UWORD32 u4_cond = 0;
  399|   148k|        WORD32 nop_cnt = 8 * 128;
  400|   148k|        CHECK_MB_MAP_BYTE(u4_mb_num, ps_dec->pu1_dec_mb_map, u4_cond);
  ------------------
  |  |   80|   148k|#define CHECK_MB_MAP_BYTE(u4_mb_num, mb_map, u4_cond)                                               \
  |  |   81|   148k|{                                                                                                   \
  |  |   82|   148k|        volatile UWORD8 *pu1_mb_flag;                                                               \
  |  |   83|   148k|                                                                                                    \
  |  |   84|   148k|        pu1_mb_flag    = (UWORD8 *)mb_map + (u4_mb_num );                                           \
  |  |   85|   148k|                                                                                                    \
  |  |   86|   148k|        u4_cond = (*pu1_mb_flag);                                                                   \
  |  |   87|   148k|}
  ------------------
  401|   148k|        if(u4_cond)
  ------------------
  |  Branch (401:12): [True: 27.6k, False: 120k]
  ------------------
  402|  27.6k|        {
  403|  27.6k|            break;
  404|  27.6k|        }
  405|   120k|        else
  406|   120k|        {
  407|   120k|            if(nop_cnt > 0)
  ------------------
  |  Branch (407:16): [True: 120k, False: 0]
  ------------------
  408|   120k|            {
  409|   120k|                nop_cnt -= 128;
  410|   120k|                NOP(128);
  ------------------
  |  |   87|  15.5M|#define NOP(nop_cnt) {UWORD32 nop_i; for (nop_i = 0; nop_i < nop_cnt; nop_i++) asm("nop");}
  |  |  ------------------
  |  |  |  Branch (87:54): [True: 15.4M, False: 120k]
  |  |  ------------------
  ------------------
  411|   120k|            }
  412|      0|            else if(ps_dec->u4_output_present && (2 == ps_dec->u4_num_cores) &&
  ------------------
  |  Branch (412:21): [True: 0, False: 0]
  |  Branch (412:50): [True: 0, False: 0]
  ------------------
  413|      0|                    (ps_dec->u4_fmt_conv_cur_row < ps_dec->s_disp_frame_info.u4_y_ht))
  ------------------
  |  Branch (413:21): [True: 0, False: 0]
  ------------------
  414|      0|            {
  415|      0|                ps_dec->u4_fmt_conv_num_rows =
  416|      0|                    MIN(FMT_CONV_NUM_ROWS,
  ------------------
  |  |   61|      0|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  417|      0|                        (ps_dec->s_disp_frame_info.u4_y_ht - ps_dec->u4_fmt_conv_cur_row));
  418|      0|                ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op), ps_dec->u4_fmt_conv_cur_row,
  419|      0|                                      ps_dec->u4_fmt_conv_num_rows);
  420|      0|                ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
  421|      0|            }
  422|      0|            else
  423|      0|            {
  424|      0|                nop_cnt = 8 * 128;
  425|      0|                ithread_yield();
  426|      0|            }
  427|   120k|            if(1 == ps_svc_lyr_dec->u1_error_in_cur_frame)
  ------------------
  |  Branch (427:16): [True: 734, False: 119k]
  ------------------
  428|    734|            {
  429|    734|                return NOT_OK;
  ------------------
  |  |  116|    734|#define NOT_OK    -1
  ------------------
  430|    734|            }
  431|   119k|            DEBUG_THREADS_PRINTF(
  432|   119k|                "waiting for mb mapcur_dec_mb_num = %d,ps_dec->u2_cur_mb_addr  = "
  433|   119k|                "%d\n",
  434|   119k|                u2_cur_dec_mb_num, ps_dec->u2_cur_mb_addr);
  435|   119k|        }
  436|   148k|    }
  437|       |
  438|  27.6k|    u4_mbaff = ps_dec->ps_cur_slice->u1_mbaff_frame_flag;
  439|  27.6k|    u2_first_mb_in_slice = ps_dec->ps_decode_cur_slice->u4_first_mb_in_slice;
  440|  27.6k|    i16_mb_x = MOD(u2_first_mb_in_slice, i2_pic_wdin_mbs);
  ------------------
  |  |   64|  27.6k|#define MOD(x,y) ((x)%(y))
  ------------------
  441|  27.6k|    i16_mb_y = DIV(u2_first_mb_in_slice, i2_pic_wdin_mbs);
  ------------------
  |  |   65|  27.6k|#define DIV(x,y) ((x)/(y))
  ------------------
  442|  27.6k|    i16_mb_y <<= u4_mbaff;
  443|  27.6k|    ps_dec->i2_dec_thread_mb_y = i16_mb_y;
  444|  27.6k|    ps_dec->cur_dec_mb_num = u2_first_mb_in_slice << u4_mbaff;
  445|       |
  446|  27.6k|    if((ps_dec->u4_num_cores == 2) || !ps_dec->i1_recon_in_thread3_flag)
  ------------------
  |  Branch (446:8): [True: 27.6k, False: 0]
  |  Branch (446:39): [True: 0, False: 0]
  ------------------
  447|  27.6k|    {
  448|  27.6k|        ps_dec->pv_proc_tu_coeff_data =
  449|  27.6k|            (void *) ps_dec->ps_decode_cur_slice->pv_tu_coeff_data_start;
  450|  27.6k|    }
  451|       |
  452|       |    // recalculate recon pointers
  453|  27.6k|    u1_field_pic = ps_dec->ps_cur_slice->u1_field_pic_flag;
  454|  27.6k|    u4_frame_stride = ps_dec->u2_frm_wd_y << u1_field_pic;
  455|  27.6k|    x_offset = i16_mb_x << 4;
  456|  27.6k|    y_offset = (i16_mb_y * u4_frame_stride) << 4;
  457|       |
  458|  27.6k|    ps_trns_addr = &(ps_dec->s_tran_addrecon);
  459|       |
  460|  27.6k|    ps_trns_addr->pu1_dest_y = ps_dec->s_cur_pic.pu1_buf1 + x_offset + y_offset;
  461|       |
  462|  27.6k|    u4_frame_stride = ps_dec->u2_frm_wd_uv << u1_field_pic;
  463|  27.6k|    x_offset >>= 1;
  464|  27.6k|    y_offset = (i16_mb_y * u4_frame_stride) << 3;
  465|  27.6k|    x_offset *= YUV420SP_FACTOR;
  ------------------
  |  |  119|  27.6k|#define YUV420SP_FACTOR 2
  ------------------
  466|       |
  467|  27.6k|    ps_trns_addr->pu1_dest_u = ps_dec->s_cur_pic.pu1_buf2 + x_offset + y_offset;
  468|  27.6k|    ps_trns_addr->pu1_dest_v = ps_dec->s_cur_pic.pu1_buf3 + x_offset + y_offset;
  469|       |
  470|  27.6k|    ps_trns_addr->pu1_mb_y = ps_trns_addr->pu1_dest_y;
  471|  27.6k|    ps_trns_addr->pu1_mb_u = ps_trns_addr->pu1_dest_u;
  472|  27.6k|    ps_trns_addr->pu1_mb_v = ps_trns_addr->pu1_dest_v;
  473|       |
  474|       |    /* Initialise MC and formMbPartInfo fn ptrs one time based on profile_idc */
  475|  27.6k|    {
  476|  27.6k|        ps_dec->p_mc_dec_thread = ih264d_motion_compensate_bp;
  477|  27.6k|        ps_dec->p_form_mb_part_info_thread = ih264d_form_mb_part_info_bp;
  478|  27.6k|    }
  479|  27.6k|    {
  480|  27.6k|        UWORD8 uc_nofield_nombaff;
  481|  27.6k|        uc_nofield_nombaff = ((ps_dec->ps_cur_slice->u1_field_pic_flag == 0) &&
  ------------------
  |  Branch (481:31): [True: 27.6k, False: 0]
  ------------------
  482|  27.6k|                              (ps_dec->ps_cur_slice->u1_mbaff_frame_flag == 0) &&
  ------------------
  |  Branch (482:31): [True: 27.6k, False: 0]
  ------------------
  483|  27.6k|                              (ps_dec->ps_decode_cur_slice->slice_type != B_SLICE) &&
  ------------------
  |  |  369|  27.6k|#define B_SLICE  1
  ------------------
  |  Branch (483:31): [True: 23.7k, False: 3.92k]
  ------------------
  484|  23.7k|                              (ps_dec->ps_cur_pps->u1_wted_pred_flag == 0));
  ------------------
  |  Branch (484:31): [True: 20.7k, False: 3.02k]
  ------------------
  485|       |
  486|  27.6k|        if(uc_nofield_nombaff == 0)
  ------------------
  |  Branch (486:12): [True: 6.95k, False: 20.7k]
  ------------------
  487|  6.95k|        {
  488|  6.95k|            ps_dec->p_mc_dec_thread = ih264d_motion_compensate_mp;
  489|  6.95k|            ps_dec->p_form_mb_part_info_thread = ih264d_form_mb_part_info_mp;
  490|  6.95k|        }
  491|  27.6k|    }
  492|       |
  493|  27.6k|    ps_dec->u4_cur_slice_decode_done = 0;
  494|       |
  495|   219k|    while(ps_dec->u4_cur_slice_decode_done != 1)
  ------------------
  |  Branch (495:11): [True: 192k, False: 26.7k]
  ------------------
  496|   192k|    {
  497|   192k|        u4_num_mbsleft = ((i2_pic_wdin_mbs - i16_mb_x) << u4_mbaff);
  498|       |
  499|   192k|        if(u4_num_mbsleft <= ps_dec->u4_recon_mb_grp)
  ------------------
  |  Branch (499:12): [True: 192k, False: 0]
  ------------------
  500|   192k|        {
  501|   192k|            u4_num_mbs = u4_num_mbsleft;
  502|       |
  503|       |            /*Indicate number of mb's left in a row*/
  504|   192k|            u4_num_mbs_next = 0;
  505|   192k|            u4_end_of_row = 1;
  506|   192k|            i16_mb_x = 0;
  507|   192k|        }
  508|      0|        else
  509|      0|        {
  510|      0|            u4_num_mbs = ps_dec->u4_recon_mb_grp;
  511|       |
  512|       |            /*Indicate number of mb's left in a row*/
  513|      0|            u4_num_mbs_next = i2_pic_wdin_mbs - i16_mb_x - (ps_dec->u4_recon_mb_grp >> u4_mbaff);
  514|      0|            i16_mb_x += (u4_num_mbs >> u4_mbaff);
  515|      0|            u4_end_of_row = 0;
  516|      0|        }
  517|   192k|        if(ps_svc_lyr_dec->u1_layer_identifier == TARGET_LAYER)
  ------------------
  |  |  110|   192k|#define TARGET_LAYER 2
  ------------------
  |  Branch (517:12): [True: 192k, False: 0]
  ------------------
  518|   192k|        {
  519|   192k|            ret = isvcd_decode_recon_tfr_nmb_thread(ps_svc_lyr_dec, u4_num_mbs, u4_num_mbs_next,
  520|   192k|                                                    u4_end_of_row);
  521|   192k|        }
  522|   192k|        if(ret != OK) return ret;
  ------------------
  |  |  114|   192k|#define OK        0
  ------------------
  |  Branch (522:12): [True: 927, False: 191k]
  ------------------
  523|   192k|    }
  524|  26.7k|    return OK;
  ------------------
  |  |  114|  26.7k|#define OK        0
  ------------------
  525|  27.6k|}
isvcd_decode_picture_thread:
  546|  21.3k|{
  547|  21.3k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  548|  21.3k|    WORD32 ret;
  549|  21.3k|    ithread_set_name("isvcd_decode_picture_thread");
  550|  21.3k|    while(1)
  ------------------
  |  Branch (550:11): [True: 21.3k, Folded]
  ------------------
  551|  21.3k|    {
  552|       |#ifdef KEEP_THREADS_ACTIVE
  553|       |        ret = ithread_mutex_lock(ps_dec->apv_proc_start_mutex[0]);
  554|       |        if(OK != ret) break;
  555|       |
  556|       |        while(ps_dec->ai4_process_start[0] != PROC_START)
  557|       |        {
  558|       |            ithread_cond_wait(ps_dec->apv_proc_start_condition[0], ps_dec->apv_proc_start_mutex[0]);
  559|       |        }
  560|       |        ps_dec->ai4_process_start[0] = PROC_IN_PROGRESS;
  561|       |
  562|       |        ret = ithread_mutex_unlock(ps_dec->apv_proc_start_mutex[0]);
  563|       |        if(OK != ret || ps_dec->i4_break_threads == 1) break;
  564|       |#endif
  565|  28.4k|        while(1)
  ------------------
  |  Branch (565:15): [True: 28.4k, Folded]
  ------------------
  566|  28.4k|        {
  567|       |            /*Complete all writes before processing next slice*/
  568|       |
  569|  28.4k|            DEBUG_THREADS_PRINTF(" Entering decode slice svc ext\n");
  570|       |
  571|  28.4k|            ret = isvcd_decode_slice_thread(ps_svc_lyr_dec);
  572|  28.4k|            if(OK != ret) break;
  ------------------
  |  |  114|  28.4k|#define OK        0
  ------------------
  |  Branch (572:16): [True: 1.66k, False: 26.7k]
  ------------------
  573|  26.7k|            DEBUG_THREADS_PRINTF(" Exit  isvcd_decode_slice_thread\n");
  574|       |
  575|  26.7k|            if(ps_dec->cur_dec_mb_num > ps_dec->ps_cur_sps->u4_max_mb_addr)
  ------------------
  |  Branch (575:16): [True: 19.7k, False: 7.02k]
  ------------------
  576|  19.7k|            {
  577|       |                /*Last slice in frame*/
  578|  19.7k|                break;
  579|  19.7k|            }
  580|  7.02k|            else
  581|  7.02k|            {
  582|  7.02k|                ps_dec->ps_decode_cur_slice++;
  583|  7.02k|                ps_dec->u2_cur_slice_num_dec_thread++;
  584|  7.02k|            }
  585|  26.7k|        }
  586|  21.3k|        if(ps_dec->u4_output_present && (2 == ps_dec->u4_num_cores) &&
  ------------------
  |  Branch (586:12): [True: 8.73k, False: 12.6k]
  |  Branch (586:41): [True: 8.73k, False: 0]
  ------------------
  587|  8.73k|           (ps_dec->u4_fmt_conv_cur_row < ps_dec->s_disp_frame_info.u4_y_ht))
  ------------------
  |  Branch (587:12): [True: 8.34k, False: 393]
  ------------------
  588|  8.34k|        {
  589|  8.34k|            ps_dec->u4_fmt_conv_num_rows =
  590|  8.34k|                (ps_dec->s_disp_frame_info.u4_y_ht - ps_dec->u4_fmt_conv_cur_row);
  591|  8.34k|            ih264d_format_convert(ps_dec, &(ps_dec->s_disp_op), ps_dec->u4_fmt_conv_cur_row,
  592|  8.34k|                                  ps_dec->u4_fmt_conv_num_rows);
  593|  8.34k|            ps_dec->u4_fmt_conv_cur_row += ps_dec->u4_fmt_conv_num_rows;
  594|  8.34k|        }
  595|       |#ifdef KEEP_THREADS_ACTIVE
  596|       |        ret = ithread_mutex_lock(ps_dec->apv_proc_done_mutex[0]);
  597|       |        if(OK != ret) break;
  598|       |
  599|       |        ps_dec->ai4_process_done[0] = PROC_DONE;
  600|       |        ithread_cond_signal(ps_dec->apv_proc_done_condition[0]);
  601|       |
  602|       |        ret = ithread_mutex_unlock(ps_dec->apv_proc_done_mutex[0]);
  603|       |        if(OK != ret) break;
  604|       |#else
  605|  21.3k|        break;
  606|  21.3k|#endif
  607|  21.3k|    }
  608|  21.3k|}

isvcd_free_dynamic_bufs:
   84|   144k|{
   85|   144k|    WORD32 i;
   86|   144k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
   87|       |    /* Free any avc dynamic buffers that are allocated */
   88|   144k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_dec->pu1_bits_buf_dynamic);
  ------------------
  |  |   43|   144k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   144k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 0, False: 144k]
  |  |  ------------------
  ------------------
   89|   144k|    ih264d_free_dynamic_bufs(ps_dec);
   90|   144k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->pu1_crop_wnd_flag);
  ------------------
  |  |   43|   144k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   144k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 120k]
  |  |  ------------------
  ------------------
   91|   144k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->ps_inter_lyr_mb_prms_base);
  ------------------
  |  |   43|   144k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   144k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 120k]
  |  |  ------------------
  ------------------
   92|   144k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_base);
  ------------------
  |  |   43|   144k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   144k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 120k]
  |  |  ------------------
  ------------------
   93|   144k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->pi2_il_residual_resample_luma_base);
  ------------------
  |  |   43|   144k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   144k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 120k]
  |  |  ------------------
  ------------------
   94|   144k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->pi2_il_residual_resample_chroma_base);
  ------------------
  |  |   43|   144k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   144k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 120k]
  |  |  ------------------
  ------------------
   95|   144k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->ps_svc_frm_mb_info);
  ------------------
  |  |   43|   144k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   144k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 120k]
  |  |  ------------------
  ------------------
   96|   144k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->pu2_frm_res_luma_csbp);
  ------------------
  |  |   43|   144k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   144k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 120k]
  |  |  ------------------
  ------------------
   97|   144k|    PS_DEC_ALIGNED_FREE(ps_dec, ps_svc_lyr_dec->pu1_svc_base_mode_flag);
  ------------------
  |  |   43|   144k|#define PS_DEC_ALIGNED_FREE(ps_dec, y) \
  |  |   44|   144k|if(y) {ps_dec->pf_aligned_free(ps_dec->pv_mem_ctxt, ((void *)y)); (y) = NULL;}
  |  |  ------------------
  |  |  |  Branch (44:4): [True: 23.6k, False: 120k]
  |  |  ------------------
  ------------------
   98|       |
   99|   144k|    memset(ps_dec->ps_pic_buf_base, 0, sizeof(struct pic_buffer_t) * (H264_MAX_REF_PICS * 2));
  ------------------
  |  |  534|   144k|#define H264_MAX_REF_PICS         16
  ------------------
  100|  9.40M|    for(i = 0; i < MAX_DISP_BUFS_NEW; i++)
  ------------------
  |  |   76|  9.40M|#define MAX_DISP_BUFS_NEW 64
  ------------------
  |  Branch (100:16): [True: 9.25M, False: 144k]
  ------------------
  101|  9.25M|    {
  102|       |        ps_dec->apv_buf_id_pic_buf_map[i] = NULL;
  103|  9.25M|    }
  104|   144k|    return 0;
  105|   144k|}
isvcd_allocate_dynamic_bufs:
  123|  23.6k|{
  124|  23.6k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  125|  23.6k|    WORD16 i16_status = 0;
  126|  23.6k|    UWORD8 uc_frmOrFld = (1 - ps_dec->ps_cur_sps->u1_frame_mbs_only_flag);
  127|  23.6k|    dec_seq_params_t *ps_sps = ps_dec->ps_cur_sps;
  128|  23.6k|    UWORD32 u4_total_mbs = ps_sps->u4_total_num_of_mbs << uc_frmOrFld;
  129|  23.6k|    WORD32 size;
  130|  23.6k|    void *pv_buf;
  131|  23.6k|    void *pv_mem_ctxt = ps_dec->pv_mem_ctxt;
  132|  23.6k|    size = u4_total_mbs;
  133|       |
  134|  23.6k|    i16_status = ih264d_allocate_dynamic_bufs(ps_dec);
  135|       |
  136|  23.6k|    if(i16_status != OK)
  ------------------
  |  |  114|  23.6k|#define OK        0
  ------------------
  |  Branch (136:8): [True: 0, False: 23.6k]
  ------------------
  137|      0|    {
  138|       |        /* Free any dynamic buffers that are allocated */
  139|      0|        ih264d_free_dynamic_bufs(ps_dec);
  140|      0|        ps_dec->i4_error_code = IVD_MEM_ALLOC_FAILED;
  141|      0|        return IVD_MEM_ALLOC_FAILED;
  142|      0|    }
  143|  23.6k|    if(u4_total_mbs == 0)
  ------------------
  |  Branch (143:8): [True: 0, False: 23.6k]
  ------------------
  144|      0|    {
  145|      0|        return IVD_MEM_ALLOC_FAILED;
  146|      0|    }
  147|       |
  148|       |    /* Allocate frame level mb info */
  149|  23.6k|    size = sizeof(dec_svc_mb_info_t) * u4_total_mbs;
  150|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
  151|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
  152|  23.6k|    ps_svc_lyr_dec->ps_svc_frm_mb_info = pv_buf;
  153|  23.6k|    memset(ps_svc_lyr_dec->ps_svc_frm_mb_info, 0, size);
  154|       |
  155|       |    /* Allocate frame level residual luma csbp info */
  156|  23.6k|    size = sizeof(UWORD16) * u4_total_mbs;
  157|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
  158|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
  159|  23.6k|    ps_svc_lyr_dec->pu2_frm_res_luma_csbp = pv_buf;
  160|  23.6k|    memset(ps_svc_lyr_dec->pu2_frm_res_luma_csbp, 0, size);
  161|  23.6k|    ps_svc_lyr_dec->i4_frm_res_luma_csbp_stride = ps_dec->u2_frm_wd_in_mbs;
  162|       |
  163|       |    /* Allocate frame level residual luma csbp info */
  164|  23.6k|    size = sizeof(UWORD8) * u4_total_mbs;
  165|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
  166|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
  167|  23.6k|    ps_svc_lyr_dec->pu1_svc_base_mode_flag = pv_buf;
  168|  23.6k|    memset(ps_svc_lyr_dec->pu1_svc_base_mode_flag, 0, size);
  169|  23.6k|    ps_svc_lyr_dec->i4_frm_svc_base_mode_cabac_stride = ps_dec->u2_frm_wd_in_mbs;
  170|  23.6k|    ps_svc_lyr_dec->i4_frm_svc_base_mode_cabac_size = u4_total_mbs;
  171|       |
  172|       |    /* Allocate frame level crop windows flags */
  173|  23.6k|    size = sizeof(UWORD8) * u4_total_mbs;
  174|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
  175|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
  176|  23.6k|    ps_svc_lyr_dec->pu1_crop_wnd_flag = pv_buf;
  177|  23.6k|    memset(ps_svc_lyr_dec->pu1_crop_wnd_flag, 0, size);
  178|       |
  179|       |    /**********************************/
  180|       |    /*Creation of Inter layer buffers */
  181|       |    /**********************************/
  182|       |
  183|       |    /* MB type buffer : one element per MB */
  184|  23.6k|    size = (ps_dec->u2_frm_wd_in_mbs + 2) * (ps_dec->u2_frm_ht_in_mbs + 2) *
  185|  23.6k|           sizeof(inter_lyr_mb_prms_t);
  186|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
  187|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
  188|  23.6k|    memset(pv_buf, -1, size);
  189|  23.6k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_base = pv_buf;
  190|  23.6k|    ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride = ps_dec->u2_frm_wd_in_mbs + 2;
  191|  23.6k|    ps_svc_lyr_dec->ps_inter_lyr_mb_prms_frm_start =
  192|  23.6k|        ps_svc_lyr_dec->ps_inter_lyr_mb_prms_base + 1 + ps_svc_lyr_dec->u2_inter_lyr_mb_prms_stride;
  193|       |
  194|  23.6k|    ps_svc_lyr_dec->u4_inter_lyr_mb_prms_size = (ps_dec->u2_frm_wd_in_mbs + 2) *
  195|  23.6k|                                                (ps_dec->u2_frm_ht_in_mbs + 2) *
  196|  23.6k|                                                sizeof(inter_lyr_mb_prms_t);
  197|       |
  198|       |    /* Luma Residual data at each layer : dafault 0*/
  199|  23.6k|    size = ((ps_dec->u2_pic_wd + 4) * (ps_dec->u2_pic_ht + 4)) * sizeof(WORD16);
  200|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
  201|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
  202|  23.6k|    memset(pv_buf, 0, size);
  203|  23.6k|    ps_svc_lyr_dec->pi2_il_residual_resample_luma_base = pv_buf;
  204|  23.6k|    ps_svc_lyr_dec->u2_residual_resample_luma_stride = (ps_dec->u2_pic_wd + 4);
  205|  23.6k|    ps_svc_lyr_dec->pi2_il_residual_resample_mb_luma_frm_start =
  206|  23.6k|        ps_svc_lyr_dec->pi2_il_residual_resample_luma_base + 2 +
  207|  23.6k|        (2 * ps_svc_lyr_dec->u2_residual_resample_luma_stride);
  208|  23.6k|    ps_svc_lyr_dec->u4_residual_resample_luma_size =
  209|  23.6k|        ((ps_dec->u2_pic_wd + 4) * (ps_dec->u2_pic_ht + 4)) * sizeof(WORD16);
  210|       |
  211|       |    /* Chroma Residual data at each layer : dafault 0*/
  212|  23.6k|    size = (((4 + ps_dec->u2_pic_wd) * ((4 + ps_dec->u2_pic_ht) >> 1)) * sizeof(WORD16));
  213|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
  214|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
  215|  23.6k|    memset(pv_buf, 0, size);
  216|  23.6k|    ps_svc_lyr_dec->pi2_il_residual_resample_chroma_base = pv_buf;
  217|  23.6k|    ps_svc_lyr_dec->u2_residual_resample_chroma_stride = (ps_dec->u2_pic_wd + 4);
  218|  23.6k|    ps_svc_lyr_dec->pi2_il_residual_resample_mb_chroma_frm_start =
  219|  23.6k|        ps_svc_lyr_dec->pi2_il_residual_resample_chroma_base + 2 +
  220|  23.6k|        ps_svc_lyr_dec->u2_residual_resample_chroma_stride;
  221|  23.6k|    ps_svc_lyr_dec->u4_residual_resample_chroma_size =
  222|  23.6k|        (((4 + ps_dec->u2_pic_wd) * ((4 + ps_dec->u2_pic_ht) >> 1)) * sizeof(WORD16));
  223|       |
  224|       |    /* mv bank buffer : 16 elements per MB: each at 4x4 block level */
  225|  23.6k|    size = ((ps_dec->u2_pic_wd) * (ps_dec->u2_pic_ht >> 4)) * sizeof(mv_pred_t);
  226|  23.6k|    pv_buf = ps_dec->pf_aligned_alloc(pv_mem_ctxt, 128, size);
  227|  23.6k|    RETURN_IF((NULL == pv_buf), IV_FAIL);
  ------------------
  |  |   44|  23.6k|#define RETURN_IF(cond, retval) if(cond) {return (retval);}
  |  |  ------------------
  |  |  |  Branch (44:36): [True: 0, False: 23.6k]
  |  |  ------------------
  ------------------
  228|  23.6k|    memset(pv_buf, 0, size);
  229|  23.6k|    ps_svc_lyr_dec->ps_il_pred_mv_bank_buf_base = pv_buf;
  230|       |
  231|       |    /*syntax for SVC related bin ctxt tables*/
  232|  23.6k|    {
  233|  23.6k|        bin_ctxt_model_t *const p_cabac_ctxt_table_t = ps_dec->p_cabac_ctxt_table_t;
  234|       |
  235|  23.6k|        ps_svc_lyr_dec->ps_base_mode_flag = p_cabac_ctxt_table_t + CABAC_BASE_MODE_FLAG;
  236|  23.6k|        ps_svc_lyr_dec->ps_motion_prediction_flag_l0 = p_cabac_ctxt_table_t + CABAC_MOT_PRED_FLAG0;
  237|  23.6k|        ps_svc_lyr_dec->ps_motion_prediction_flag_l1 = p_cabac_ctxt_table_t + CABAC_MOT_PRED_FLAG1;
  238|  23.6k|        ps_svc_lyr_dec->ps_residual_prediction_flag = p_cabac_ctxt_table_t + CABAC_RES_PRED_FLAG;
  239|  23.6k|    }
  240|  23.6k|    return (i16_status);
  241|  23.6k|}
isvcd_decode_pic_order_cnt:
  261|   140k|{
  262|   140k|    WORD64 i8_pic_msb;
  263|   140k|    WORD32 i4_top_field_order_cnt = 0, i4_bottom_field_order_cnt = 0;
  264|   140k|    dec_seq_params_t *ps_seq = ps_dec->ps_cur_sps;
  265|   140k|    WORD32 i4_prev_frame_num_ofst;
  266|       |
  267|   140k|    switch(ps_seq->u1_pic_order_cnt_type)
  268|   140k|    {
  269|   112k|        case 0:
  ------------------
  |  Branch (269:9): [True: 112k, False: 28.3k]
  ------------------
  270|       |            /* POC TYPE 0 */
  271|   112k|            if(u1_is_idr_slice)
  ------------------
  |  Branch (271:16): [True: 101k, False: 11.1k]
  ------------------
  272|   101k|            {
  273|   101k|                ps_prev_poc->i4_pic_order_cnt_msb = 0;
  274|   101k|                ps_prev_poc->i4_pic_order_cnt_lsb = 0;
  275|   101k|            }
  276|   112k|            if(ps_prev_poc->u1_mmco_equalto5)
  ------------------
  |  Branch (276:16): [True: 929, False: 111k]
  ------------------
  277|    929|            {
  278|    929|                if(ps_prev_poc->u1_bot_field != 1)
  ------------------
  |  Branch (278:20): [True: 929, False: 0]
  ------------------
  279|    929|                {
  280|    929|                    ps_prev_poc->i4_pic_order_cnt_msb = 0;
  281|    929|                    ps_prev_poc->i4_pic_order_cnt_lsb = ps_prev_poc->i4_top_field_order_count;
  282|    929|                }
  283|      0|                else
  284|      0|                {
  285|      0|                    ps_prev_poc->i4_pic_order_cnt_msb = 0;
  286|      0|                    ps_prev_poc->i4_pic_order_cnt_lsb = 0;
  287|      0|                }
  288|    929|            }
  289|       |
  290|   112k|            if((ps_cur_poc->i4_pic_order_cnt_lsb < ps_prev_poc->i4_pic_order_cnt_lsb) &&
  ------------------
  |  Branch (290:16): [True: 3.97k, False: 108k]
  ------------------
  291|  3.97k|               ((ps_prev_poc->i4_pic_order_cnt_lsb - ps_cur_poc->i4_pic_order_cnt_lsb) >=
  ------------------
  |  Branch (291:16): [True: 2.80k, False: 1.17k]
  ------------------
  292|  3.97k|                (ps_seq->i4_max_pic_order_cntLsb >> 1)))
  293|  2.80k|            {
  294|  2.80k|                i8_pic_msb =
  295|  2.80k|                    (WORD64) ps_prev_poc->i4_pic_order_cnt_msb + ps_seq->i4_max_pic_order_cntLsb;
  296|  2.80k|            }
  297|   109k|            else if((ps_cur_poc->i4_pic_order_cnt_lsb > ps_prev_poc->i4_pic_order_cnt_lsb) &&
  ------------------
  |  Branch (297:21): [True: 80.8k, False: 28.8k]
  ------------------
  298|  80.8k|                    ((ps_cur_poc->i4_pic_order_cnt_lsb - ps_prev_poc->i4_pic_order_cnt_lsb) >=
  ------------------
  |  Branch (298:21): [True: 46.7k, False: 34.0k]
  ------------------
  299|  80.8k|                     (ps_seq->i4_max_pic_order_cntLsb >> 1)))
  300|  46.7k|            {
  301|  46.7k|                i8_pic_msb =
  302|  46.7k|                    (WORD64) ps_prev_poc->i4_pic_order_cnt_msb - ps_seq->i4_max_pic_order_cntLsb;
  303|  46.7k|            }
  304|  62.9k|            else
  305|  62.9k|            {
  306|  62.9k|                i8_pic_msb = ps_prev_poc->i4_pic_order_cnt_msb;
  307|  62.9k|            }
  308|       |
  309|   112k|            if(!u1_field_pic_flag || !u1_bottom_field_flag)
  ------------------
  |  Branch (309:16): [True: 112k, False: 0]
  |  Branch (309:38): [True: 0, False: 0]
  ------------------
  310|   112k|            {
  311|   112k|                WORD64 i8_result = i8_pic_msb + ps_cur_poc->i4_pic_order_cnt_lsb;
  312|   112k|                if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|   112k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 112k]
  |  |  |  Branch (58:54): [True: 0, False: 112k]
  |  |  ------------------
  ------------------
  313|      0|                {
  314|      0|                    return ERROR_INV_POC;
  315|      0|                }
  316|   112k|                i4_top_field_order_cnt = (WORD32) i8_result;
  317|   112k|            }
  318|       |
  319|   112k|            if(!u1_field_pic_flag)
  ------------------
  |  Branch (319:16): [True: 112k, False: 0]
  ------------------
  320|   112k|            {
  321|   112k|                WORD64 i8_result =
  322|   112k|                    (WORD64) i4_top_field_order_cnt + ps_cur_poc->i4_delta_pic_order_cnt_bottom;
  323|   112k|                if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|   112k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 69, False: 112k]
  |  |  |  Branch (58:54): [True: 67, False: 112k]
  |  |  ------------------
  ------------------
  324|    136|                {
  325|    136|                    return ERROR_INV_POC;
  326|    136|                }
  327|   112k|                i4_bottom_field_order_cnt = (WORD32) i8_result;
  328|   112k|            }
  329|      0|            else if(u1_bottom_field_flag)
  ------------------
  |  Branch (329:21): [True: 0, False: 0]
  ------------------
  330|      0|            {
  331|      0|                WORD64 i8_result = i8_pic_msb + ps_cur_poc->i4_pic_order_cnt_lsb;
  332|      0|                if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|      0|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 0]
  |  |  |  Branch (58:54): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  333|      0|                {
  334|      0|                    return ERROR_INV_POC;
  335|      0|                }
  336|      0|                i4_bottom_field_order_cnt = (WORD32) i8_result;
  337|      0|            }
  338|       |
  339|   112k|            if(IS_OUT_OF_RANGE_S32(i8_pic_msb))
  ------------------
  |  |   58|   112k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 112k]
  |  |  |  Branch (58:54): [True: 0, False: 112k]
  |  |  ------------------
  ------------------
  340|      0|            {
  341|      0|                return ERROR_INV_POC;
  342|      0|            }
  343|   112k|            ps_cur_poc->i4_pic_order_cnt_msb = (WORD32) i8_pic_msb;
  344|   112k|            break;
  345|       |
  346|  25.0k|        case 1:
  ------------------
  |  Branch (346:9): [True: 25.0k, False: 115k]
  ------------------
  347|  25.0k|        {
  348|       |            /* POC TYPE 1 */
  349|  25.0k|            UWORD8 i;
  350|  25.0k|            WORD32 prev_frame_num;
  351|  25.0k|            WORD32 frame_num_ofst;
  352|  25.0k|            WORD32 abs_frm_num;
  353|  25.0k|            WORD32 poc_cycle_cnt, frame_num_in_poc_cycle;
  354|  25.0k|            WORD64 i8_expected_delta_poc_cycle;
  355|  25.0k|            WORD32 expected_poc;
  356|  25.0k|            WORD64 i8_result;
  357|       |
  358|  25.0k|            prev_frame_num = (WORD32) ps_cur_slice->u2_frame_num;
  359|  25.0k|            if(!u1_is_idr_slice)
  ------------------
  |  Branch (359:16): [True: 11.7k, False: 13.2k]
  ------------------
  360|  11.7k|            {
  361|  11.7k|                if(ps_cur_slice->u1_mmco_equalto5)
  ------------------
  |  Branch (361:20): [True: 888, False: 10.8k]
  ------------------
  362|    888|                {
  363|    888|                    prev_frame_num = 0;
  364|    888|                    i4_prev_frame_num_ofst = 0;
  365|    888|                }
  366|  10.8k|                else
  367|  10.8k|                {
  368|  10.8k|                    i4_prev_frame_num_ofst = ps_prev_poc->i4_prev_frame_num_ofst;
  369|  10.8k|                }
  370|  11.7k|            }
  371|  13.2k|            else
  372|  13.2k|                i4_prev_frame_num_ofst = 0;
  373|       |
  374|       |            /* 1. Derivation for FrameNumOffset */
  375|  25.0k|            if(u1_is_idr_slice)
  ------------------
  |  Branch (375:16): [True: 13.2k, False: 11.7k]
  ------------------
  376|  13.2k|            {
  377|  13.2k|                frame_num_ofst = 0;
  378|  13.2k|                ps_cur_poc->i4_delta_pic_order_cnt[0] = 0;
  379|  13.2k|                ps_cur_poc->i4_delta_pic_order_cnt[1] = 0;
  380|  13.2k|            }
  381|  11.7k|            else if(prev_frame_num > ((WORD32) u2_frame_num))
  ------------------
  |  Branch (381:21): [True: 4.99k, False: 6.77k]
  ------------------
  382|  4.99k|            {
  383|  4.99k|                WORD64 i8_result =
  384|  4.99k|                    i4_prev_frame_num_ofst + (WORD64) ps_seq->u2_u4_max_pic_num_minus1 + 1;
  385|  4.99k|                if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|  4.99k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 4.99k]
  |  |  |  Branch (58:54): [True: 98, False: 4.90k]
  |  |  ------------------
  ------------------
  386|     98|                {
  387|     98|                    return ERROR_INV_FRAME_NUM;
  388|     98|                }
  389|  4.90k|                frame_num_ofst = (WORD32) i8_result;
  390|  4.90k|            }
  391|  6.77k|            else
  392|  6.77k|                frame_num_ofst = i4_prev_frame_num_ofst;
  393|       |
  394|       |            /* 2. Derivation for absFrameNum */
  395|  24.9k|            if(0 != ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle)
  ------------------
  |  Branch (395:16): [True: 16.7k, False: 8.21k]
  ------------------
  396|  16.7k|            {
  397|  16.7k|                WORD64 i8_result = frame_num_ofst + (WORD64) u2_frame_num;
  398|  16.7k|                if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|  16.7k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 16.7k]
  |  |  |  Branch (58:54): [True: 0, False: 16.7k]
  |  |  ------------------
  ------------------
  399|      0|                {
  400|      0|                    return ERROR_INV_FRAME_NUM;
  401|      0|                }
  402|  16.7k|                abs_frm_num = (WORD32) i8_result;
  403|  16.7k|            }
  404|  8.21k|            else
  405|  8.21k|                abs_frm_num = 0;
  406|  24.9k|            if((u1_nal_ref_idc == 0) && (abs_frm_num > 0)) abs_frm_num = abs_frm_num - 1;
  ------------------
  |  Branch (406:16): [True: 3.31k, False: 21.6k]
  |  Branch (406:41): [True: 1.39k, False: 1.92k]
  ------------------
  407|       |
  408|       |            /* 4. expectedDeltaPerPicOrderCntCycle is derived as */
  409|  24.9k|            i8_expected_delta_poc_cycle = 0;
  410|   154k|            for(i = 0; i < ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle; i++)
  ------------------
  |  Branch (410:24): [True: 129k, False: 24.9k]
  ------------------
  411|   129k|            {
  412|   129k|                i8_expected_delta_poc_cycle += ps_seq->i4_ofst_for_ref_frame[i];
  413|   129k|            }
  414|       |
  415|       |            /* 3. When absFrameNum > 0, picOrderCntCycleCnt and
  416|       |            frame_num_in_poc_cycle are derived as : */
  417|       |            /* 5. expectedPicOrderCnt is derived as : */
  418|  24.9k|            if(abs_frm_num > 0)
  ------------------
  |  Branch (418:16): [True: 16.7k, False: 8.22k]
  ------------------
  419|  16.7k|            {
  420|  16.7k|                poc_cycle_cnt =
  421|  16.7k|                    DIV((abs_frm_num - 1), ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle);
  ------------------
  |  |   65|  16.7k|#define DIV(x,y) ((x)/(y))
  ------------------
  422|  16.7k|                frame_num_in_poc_cycle =
  423|  16.7k|                    MOD((abs_frm_num - 1), ps_seq->u1_num_ref_frames_in_pic_order_cnt_cycle);
  ------------------
  |  |   64|  16.7k|#define MOD(x,y) ((x)%(y))
  ------------------
  424|       |
  425|  16.7k|                i8_result = poc_cycle_cnt * i8_expected_delta_poc_cycle;
  426|       |
  427|  86.3k|                for(i = 0; i <= frame_num_in_poc_cycle; i++)
  ------------------
  |  Branch (427:28): [True: 69.6k, False: 16.7k]
  ------------------
  428|  69.6k|                {
  429|  69.6k|                    i8_result = i8_result + ps_seq->i4_ofst_for_ref_frame[i];
  430|  69.6k|                }
  431|       |
  432|  16.7k|                if(IS_OUT_OF_RANGE_S32(i8_result)) return ERROR_INV_POC;
  ------------------
  |  |   58|  16.7k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 133, False: 16.5k]
  |  |  |  Branch (58:54): [True: 195, False: 16.3k]
  |  |  ------------------
  ------------------
  433|       |
  434|  16.3k|                expected_poc = (WORD32) i8_result;
  435|  16.3k|            }
  436|  8.22k|            else
  437|  8.22k|                expected_poc = 0;
  438|       |
  439|  24.6k|            if(u1_nal_ref_idc == 0)
  ------------------
  |  Branch (439:16): [True: 3.28k, False: 21.3k]
  ------------------
  440|  3.28k|            {
  441|  3.28k|                i8_result = (WORD64) expected_poc + ps_seq->i4_ofst_for_non_ref_pic;
  442|       |
  443|  3.28k|                if(IS_OUT_OF_RANGE_S32(i8_result)) return ERROR_INV_POC;
  ------------------
  |  |   58|  3.28k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 67, False: 3.21k]
  |  |  |  Branch (58:54): [True: 72, False: 3.14k]
  |  |  ------------------
  ------------------
  444|       |
  445|  3.14k|                expected_poc = (WORD32) i8_result;
  446|  3.14k|            }
  447|       |
  448|       |            /* 6. TopFieldOrderCnt or BottomFieldOrderCnt are derived as */
  449|  24.4k|            if(!u1_field_pic_flag)
  ------------------
  |  Branch (449:16): [True: 24.4k, False: 0]
  ------------------
  450|  24.4k|            {
  451|  24.4k|                i8_result = (WORD64) expected_poc + ps_cur_poc->i4_delta_pic_order_cnt[0];
  452|       |
  453|  24.4k|                if(IS_OUT_OF_RANGE_S32(i8_result)) return ERROR_INV_POC;
  ------------------
  |  |   58|  24.4k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 37, False: 24.4k]
  |  |  |  Branch (58:54): [True: 82, False: 24.3k]
  |  |  ------------------
  ------------------
  454|  24.3k|                i4_top_field_order_cnt = (WORD32) i8_result;
  455|       |
  456|  24.3k|                i8_result = (WORD64) i4_top_field_order_cnt +
  457|  24.3k|                            ps_seq->i4_ofst_for_top_to_bottom_field +
  458|  24.3k|                            ps_cur_poc->i4_delta_pic_order_cnt[1];
  459|       |
  460|  24.3k|                if(IS_OUT_OF_RANGE_S32(i8_result)) return ERROR_INV_POC;
  ------------------
  |  |   58|  24.3k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 156, False: 24.1k]
  |  |  |  Branch (58:54): [True: 86, False: 24.1k]
  |  |  ------------------
  ------------------
  461|  24.1k|                i4_bottom_field_order_cnt = (WORD32) i8_result;
  462|  24.1k|            }
  463|      0|            else if(!u1_bottom_field_flag)
  ------------------
  |  Branch (463:21): [True: 0, False: 0]
  ------------------
  464|      0|            {
  465|      0|                i8_result = (WORD64) expected_poc + ps_cur_poc->i4_delta_pic_order_cnt[0];
  466|       |
  467|      0|                if(IS_OUT_OF_RANGE_S32(i8_result)) return ERROR_INV_POC;
  ------------------
  |  |   58|      0|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 0]
  |  |  |  Branch (58:54): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  468|      0|                i4_top_field_order_cnt = (WORD32) i8_result;
  469|      0|            }
  470|      0|            else
  471|      0|            {
  472|      0|                i8_result = (WORD64) expected_poc + ps_seq->i4_ofst_for_top_to_bottom_field +
  473|      0|                            ps_cur_poc->i4_delta_pic_order_cnt[0];
  474|       |
  475|      0|                if(IS_OUT_OF_RANGE_S32(i8_result)) return ERROR_INV_POC;
  ------------------
  |  |   58|      0|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 0]
  |  |  |  Branch (58:54): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  476|      0|                i4_bottom_field_order_cnt = (WORD32) i8_result;
  477|      0|            }
  478|       |            /* Copy the current POC info into Previous POC structure */
  479|  24.1k|            ps_cur_poc->i4_prev_frame_num_ofst = frame_num_ofst;
  480|  24.1k|        }
  481|       |
  482|      0|        break;
  483|  3.34k|        case 2:
  ------------------
  |  Branch (483:9): [True: 3.34k, False: 137k]
  ------------------
  484|  3.34k|        {
  485|       |            /* POC TYPE 2 */
  486|  3.34k|            WORD32 prev_frame_num;
  487|  3.34k|            WORD32 frame_num_ofst;
  488|  3.34k|            WORD32 tmp_poc;
  489|       |
  490|  3.34k|            prev_frame_num = (WORD32) ps_cur_slice->u2_frame_num;
  491|  3.34k|            if(!u1_is_idr_slice)
  ------------------
  |  Branch (491:16): [True: 1.53k, False: 1.80k]
  ------------------
  492|  1.53k|            {
  493|  1.53k|                if(ps_cur_slice->u1_mmco_equalto5)
  ------------------
  |  Branch (493:20): [True: 325, False: 1.21k]
  ------------------
  494|    325|                {
  495|    325|                    prev_frame_num = 0;
  496|    325|                    i4_prev_frame_num_ofst = 0;
  497|    325|                }
  498|  1.21k|                else
  499|  1.21k|                    i4_prev_frame_num_ofst = ps_prev_poc->i4_prev_frame_num_ofst;
  500|  1.53k|            }
  501|  1.80k|            else
  502|  1.80k|                i4_prev_frame_num_ofst = 0;
  503|       |
  504|       |            /* 1. Derivation for FrameNumOffset */
  505|  3.34k|            if(u1_is_idr_slice)
  ------------------
  |  Branch (505:16): [True: 1.80k, False: 1.53k]
  ------------------
  506|  1.80k|            {
  507|  1.80k|                frame_num_ofst = 0;
  508|  1.80k|                ps_cur_poc->i4_delta_pic_order_cnt[0] = 0;
  509|  1.80k|                ps_cur_poc->i4_delta_pic_order_cnt[1] = 0;
  510|  1.80k|            }
  511|  1.53k|            else if(prev_frame_num > ((WORD32) u2_frame_num))
  ------------------
  |  Branch (511:21): [True: 512, False: 1.02k]
  ------------------
  512|    512|            {
  513|    512|                WORD64 i8_result =
  514|    512|                    i4_prev_frame_num_ofst + (WORD64) ps_seq->u2_u4_max_pic_num_minus1 + 1;
  515|    512|                if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|    512|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 512]
  |  |  |  Branch (58:54): [True: 67, False: 445]
  |  |  ------------------
  ------------------
  516|     67|                {
  517|     67|                    return ERROR_INV_FRAME_NUM;
  518|     67|                }
  519|    445|                frame_num_ofst = (WORD32) i8_result;
  520|    445|            }
  521|  1.02k|            else
  522|  1.02k|                frame_num_ofst = i4_prev_frame_num_ofst;
  523|       |
  524|       |            /* 2. Derivation for tempPicOrderCnt */
  525|  3.27k|            if(u1_is_idr_slice)
  ------------------
  |  Branch (525:16): [True: 1.80k, False: 1.46k]
  ------------------
  526|  1.80k|                tmp_poc = 0;
  527|  1.46k|            else if(u1_nal_ref_idc == 0)
  ------------------
  |  Branch (527:21): [True: 403, False: 1.06k]
  ------------------
  528|    403|            {
  529|    403|                WORD64 i8_result = ((frame_num_ofst + (WORD64) u2_frame_num) << 1) - 1;
  530|    403|                if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|    403|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 403]
  |  |  |  Branch (58:54): [True: 0, False: 403]
  |  |  ------------------
  ------------------
  531|      0|                {
  532|      0|                    return ERROR_INV_POC;
  533|      0|                }
  534|    403|                tmp_poc = (WORD32) i8_result;
  535|    403|            }
  536|  1.06k|            else
  537|  1.06k|            {
  538|  1.06k|                WORD64 i8_result = (frame_num_ofst + (WORD64) u2_frame_num) << 1;
  539|  1.06k|                if(IS_OUT_OF_RANGE_S32(i8_result))
  ------------------
  |  |   58|  1.06k|#define IS_OUT_OF_RANGE_S32(a) (((a) < INT32_MIN) || ((a) > INT32_MAX))
  |  |  ------------------
  |  |  |  Branch (58:33): [True: 0, False: 1.06k]
  |  |  |  Branch (58:54): [True: 0, False: 1.06k]
  |  |  ------------------
  ------------------
  540|      0|                {
  541|      0|                    return ERROR_INV_POC;
  542|      0|                }
  543|  1.06k|                tmp_poc = (WORD32) i8_result;
  544|  1.06k|            }
  545|       |
  546|       |            /* 6. TopFieldOrderCnt or BottomFieldOrderCnt are derived as */
  547|  3.27k|            if(!u1_field_pic_flag)
  ------------------
  |  Branch (547:16): [True: 3.27k, False: 0]
  ------------------
  548|  3.27k|            {
  549|  3.27k|                i4_top_field_order_cnt = tmp_poc;
  550|  3.27k|                i4_bottom_field_order_cnt = tmp_poc;
  551|  3.27k|            }
  552|      0|            else if(!u1_bottom_field_flag)
  ------------------
  |  Branch (552:21): [True: 0, False: 0]
  ------------------
  553|      0|                i4_top_field_order_cnt = tmp_poc;
  554|      0|            else
  555|      0|                i4_bottom_field_order_cnt = tmp_poc;
  556|       |
  557|       |            /* Copy the current POC info into Previous POC structure */
  558|  3.27k|            ps_prev_poc->i4_prev_frame_num_ofst = frame_num_ofst;
  559|  3.27k|            ps_cur_poc->i4_prev_frame_num_ofst = frame_num_ofst;
  560|  3.27k|        }
  561|      0|        break;
  562|      0|        default:
  ------------------
  |  Branch (562:9): [True: 0, False: 140k]
  ------------------
  563|      0|            return ERROR_INV_POC_TYPE_T;
  564|      0|            break;
  565|   140k|    }
  566|       |
  567|   139k|    if(!u1_field_pic_flag)  // or a complementary field pair
  ------------------
  |  Branch (567:8): [True: 139k, False: 0]
  ------------------
  568|   139k|    {
  569|   139k|        *pi4_poc = MIN(i4_top_field_order_cnt, i4_bottom_field_order_cnt);
  ------------------
  |  |   61|   139k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 27.0k, False: 112k]
  |  |  ------------------
  ------------------
  570|   139k|        ps_pps->i4_top_field_order_cnt = i4_top_field_order_cnt;
  571|   139k|        ps_pps->i4_bottom_field_order_cnt = i4_bottom_field_order_cnt;
  572|   139k|    }
  573|      0|    else if(!u1_bottom_field_flag)
  ------------------
  |  Branch (573:13): [True: 0, False: 0]
  ------------------
  574|      0|    {
  575|      0|        *pi4_poc = i4_top_field_order_cnt;
  576|      0|        ps_pps->i4_top_field_order_cnt = i4_top_field_order_cnt;
  577|      0|    }
  578|      0|    else
  579|      0|    {
  580|      0|        *pi4_poc = i4_bottom_field_order_cnt;
  581|      0|        ps_pps->i4_bottom_field_order_cnt = i4_bottom_field_order_cnt;
  582|      0|    }
  583|       |
  584|   139k|    ps_pps->i4_avg_poc = *pi4_poc;
  585|       |
  586|   139k|    return OK;
  ------------------
  |  |  114|   139k|#define OK        0
  ------------------
  587|   140k|}
isvcd_init_dpb_ref_bufs:
  762|   103k|{
  763|   103k|    UWORD8 i;
  764|   103k|    struct pic_buffer_t *ps_init_dpb;
  765|   103k|    ps_init_dpb = ps_dec->ps_dpb_mgr->ps_init_dpb[0][0];
  766|  6.73M|    for(i = 0; i < 2 * MAX_REF_BUFS; i++)
  ------------------
  |  |   75|  6.73M|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (766:16): [True: 6.63M, False: 103k]
  ------------------
  767|  6.63M|    {
  768|  6.63M|        memset(ps_init_dpb, 0, sizeof(struct pic_buffer_t));
  769|  6.63M|        ps_init_dpb->pu1_buf1 = NULL;
  770|  6.63M|        ps_init_dpb->u1_long_term_frm_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  6.63M|#define MAX_REF_BUFS    32
  ------------------
  771|  6.63M|        ps_dec->ps_dpb_mgr->ps_init_dpb[0][i] = ps_init_dpb;
  772|  6.63M|        ps_dec->ps_dpb_mgr->ps_mod_dpb[0][i] = ps_init_dpb;
  773|  6.63M|        ps_init_dpb++;
  774|  6.63M|    }
  775|       |
  776|   103k|    ps_init_dpb = ps_dec->ps_dpb_mgr->ps_init_dpb[1][0];
  777|  6.73M|    for(i = 0; i < 2 * MAX_REF_BUFS; i++)
  ------------------
  |  |   75|  6.73M|#define MAX_REF_BUFS    32
  ------------------
  |  Branch (777:16): [True: 6.63M, False: 103k]
  ------------------
  778|  6.63M|    {
  779|  6.63M|        memset(ps_init_dpb, 0, sizeof(struct pic_buffer_t));
  780|  6.63M|        ps_init_dpb->pu1_buf1 = NULL;
  781|  6.63M|        ps_init_dpb->u1_long_term_frm_idx = MAX_REF_BUFS + 1;
  ------------------
  |  |   75|  6.63M|#define MAX_REF_BUFS    32
  ------------------
  782|  6.63M|        ps_dec->ps_dpb_mgr->ps_init_dpb[1][i] = ps_init_dpb;
  783|  6.63M|        ps_dec->ps_dpb_mgr->ps_mod_dpb[1][i] = ps_init_dpb;
  784|  6.63M|        ps_init_dpb++;
  785|  6.63M|    }
  786|   103k|}
isvcd_init_pic:
  805|   138k|{
  806|   138k|    dec_struct_t *ps_dec = &ps_svc_lyr_dec->s_dec;
  807|   138k|    dec_seq_params_t *ps_seq = ps_dec->ps_cur_sps;
  808|   138k|    prev_seq_params_t *ps_prev_seq_params = &ps_dec->s_prev_seq_params;
  809|   138k|    WORD32 ret;
  810|       |
  811|   138k|    ps_dec->ps_cur_slice->u2_frame_num = u2_frame_num;
  812|   138k|    ps_dec->ps_cur_slice->i4_poc = i4_poc;
  813|   138k|    ps_dec->ps_cur_pps = ps_pps;
  814|   138k|    ps_dec->ps_cur_pps->pv_codec_handle = ps_dec;
  815|       |
  816|   138k|    ps_dec->ps_dpb_mgr->i4_max_frm_num = ps_seq->u2_u4_max_pic_num_minus1 + 1;
  817|       |
  818|   138k|    ps_dec->ps_dpb_mgr->u2_pic_ht = ps_dec->u2_pic_ht;
  819|   138k|    ps_dec->ps_dpb_mgr->u2_pic_wd = ps_dec->u2_pic_wd;
  820|   138k|    ps_dec->i4_pic_type = NA_SLICE;
  ------------------
  |  |  367|   138k|#define NA_SLICE -1
  ------------------
  821|   138k|    ps_dec->i4_frametype = IV_NA_FRAME;
  822|   138k|    ps_dec->i4_content_type = IV_CONTENTTYPE_NA;
  823|       |
  824|       |    /*--------------------------------------------------------------------*/
  825|       |    /* Get the value of MaxMbAddress and frmheight in Mbs                 */
  826|       |    /*--------------------------------------------------------------------*/
  827|   138k|    ps_seq->u4_max_mb_addr =
  828|   138k|        ((UWORD32)ps_seq->u2_frm_wd_in_mbs *
  829|   138k|         ((UWORD32)ps_dec->u2_pic_ht >> (4 + ps_dec->ps_cur_slice->u1_field_pic_flag))) -
  830|   138k|        1;
  831|   138k|    ps_dec->u2_frm_ht_in_mbs = (ps_dec->u2_pic_ht >> (4 + ps_dec->ps_cur_slice->u1_field_pic_flag));
  832|       |
  833|       |    /***************************************************************************/
  834|       |    /* If change in Level or the required PicBuffers i4_size is more than the  */
  835|       |    /* current one FREE the current PicBuffers and allocate affresh            */
  836|       |    /***************************************************************************/
  837|   138k|    if(!ps_dec->u1_init_dec_flag)
  ------------------
  |  Branch (837:8): [True: 23.6k, False: 114k]
  ------------------
  838|  23.6k|    {
  839|  23.6k|        ps_dec->u1_max_dec_frame_buffering = ih264d_get_dpb_size(ps_seq);
  840|       |
  841|  23.6k|        ps_dec->i4_display_delay = ps_dec->u1_max_dec_frame_buffering;
  842|  23.6k|        if((1 == ps_seq->u1_vui_parameters_present_flag) &&
  ------------------
  |  Branch (842:12): [True: 1.95k, False: 21.6k]
  ------------------
  843|  1.95k|           (1 == ps_seq->s_vui.u1_bitstream_restriction_flag))
  ------------------
  |  Branch (843:12): [True: 156, False: 1.79k]
  ------------------
  844|    156|        {
  845|    156|            if(ps_seq->u1_frame_mbs_only_flag == 1)
  ------------------
  |  Branch (845:16): [True: 156, False: 0]
  ------------------
  846|    156|                ps_dec->i4_display_delay = ps_seq->s_vui.u4_num_reorder_frames + 1;
  847|      0|            else
  848|      0|                ps_dec->i4_display_delay = ps_seq->s_vui.u4_num_reorder_frames * 2 + 2;
  849|    156|        }
  850|       |
  851|  23.6k|        if(IVD_DECODE_FRAME_OUT == ps_dec->e_frm_out_mode) ps_dec->i4_display_delay = 0;
  ------------------
  |  Branch (851:12): [True: 0, False: 23.6k]
  ------------------
  852|       |
  853|  23.6k|        if(ps_dec->u4_share_disp_buf == 0)
  ------------------
  |  Branch (853:12): [True: 23.6k, False: 0]
  ------------------
  854|  23.6k|        {
  855|  23.6k|            if(ps_seq->u1_frame_mbs_only_flag == 1)
  ------------------
  |  Branch (855:16): [True: 23.6k, False: 0]
  ------------------
  856|  23.6k|                ps_dec->u1_pic_bufs = ps_dec->i4_display_delay + ps_seq->u1_num_ref_frames + 1;
  857|      0|            else
  858|      0|                ps_dec->u1_pic_bufs = ps_dec->i4_display_delay + ps_seq->u1_num_ref_frames * 2 + 2;
  859|  23.6k|        }
  860|      0|        else
  861|      0|        {
  862|      0|            ps_dec->u1_pic_bufs = (WORD32) ps_dec->u4_num_disp_bufs;
  863|      0|        }
  864|       |
  865|       |        /* Ensure at least two buffers are allocated */
  866|  23.6k|        ps_dec->u1_pic_bufs = MAX(ps_dec->u1_pic_bufs, 2);
  ------------------
  |  |   60|  23.6k|#define MAX(a,b) ((a > b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (60:19): [True: 23.5k, False: 107]
  |  |  ------------------
  ------------------
  867|       |
  868|  23.6k|        if(ps_dec->u4_share_disp_buf == 0)
  ------------------
  |  Branch (868:12): [True: 23.6k, False: 0]
  ------------------
  869|  23.6k|            ps_dec->u1_pic_bufs = MIN(ps_dec->u1_pic_bufs, (H264_MAX_REF_PICS * 2));
  ------------------
  |  |   61|  23.6k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 23.1k, False: 463]
  |  |  ------------------
  ------------------
  870|       |
  871|  23.6k|        ps_dec->u1_max_dec_frame_buffering =
  872|  23.6k|            MIN(ps_dec->u1_max_dec_frame_buffering, ps_dec->u1_pic_bufs);
  ------------------
  |  |   61|  23.6k|#define MIN(a,b) ((a < b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (61:19): [True: 23.4k, False: 156]
  |  |  ------------------
  ------------------
  873|       |
  874|       |        /* Temporary hack to run Tractor Cav/Cab/MbAff Profiler streams  also for
  875|       |         * CAFI1_SVA_C.264 in conformance*/
  876|  23.6k|        if(ps_dec->u1_init_dec_flag)
  ------------------
  |  Branch (876:12): [True: 0, False: 23.6k]
  ------------------
  877|      0|        {
  878|      0|            ih264d_release_pics_in_dpb((void *) ps_dec, ps_dec->u1_pic_bufs);
  879|      0|            ih264d_release_display_bufs(ps_dec);
  880|      0|            ih264d_reset_ref_bufs(ps_dec->ps_dpb_mgr);
  881|      0|        }
  882|       |
  883|       |        /*********************************************************************/
  884|       |        /* Configuring decoder parameters based on level and then            */
  885|       |        /* fresh pointer initialisation in decoder scratch and state buffers */
  886|       |        /*********************************************************************/
  887|  23.6k|        if(!ps_dec->u1_init_dec_flag || ((ps_seq->u1_level_idc < H264_LEVEL_3_0) ^
  ------------------
  |  |  298|      0|#define H264_LEVEL_3_0     30
  ------------------
  |  Branch (887:12): [True: 23.6k, False: 0]
  |  Branch (887:41): [True: 0, False: 0]
  ------------------
  888|      0|                                         (ps_prev_seq_params->u1_level_idc < H264_LEVEL_3_0)))
  ------------------
  |  |  298|      0|#define H264_LEVEL_3_0     30
  ------------------
  889|  23.6k|        {
  890|  23.6k|            ret = ih264d_init_dec_mb_grp(ps_dec);
  891|  23.6k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  23.6k|#define OK        0
  ------------------
  |  Branch (891:16): [True: 0, False: 23.6k]
  ------------------
  892|  23.6k|        }
  893|       |
  894|  23.6k|        ret = isvcd_allocate_dynamic_bufs(ps_svc_lyr_dec);
  895|       |
  896|  23.6k|        if(ret != OK)
  ------------------
  |  |  114|  23.6k|#define OK        0
  ------------------
  |  Branch (896:12): [True: 0, False: 23.6k]
  ------------------
  897|      0|        {
  898|       |            /* Free any dynamic buffers that are allocated */
  899|      0|            isvcd_free_dynamic_bufs(ps_svc_lyr_dec);
  900|      0|            ps_dec->i4_error_code = IVD_MEM_ALLOC_FAILED;
  901|      0|            return IVD_MEM_ALLOC_FAILED;
  902|      0|        }
  903|       |
  904|  23.6k|        ih264d_init_ref_bufs((dpb_manager_t *)ps_dec->ps_dpb_mgr);
  905|  23.6k|        isvcd_init_dpb_ref_bufs(ps_dec);
  906|       |
  907|  23.6k|        ret = ih264d_create_pic_buffers(ps_dec->u1_pic_bufs, ps_dec);
  908|  23.6k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  23.6k|#define OK        0
  ------------------
  |  Branch (908:12): [True: 0, False: 23.6k]
  ------------------
  909|       |
  910|  23.6k|        ret = ih264d_create_mv_bank(ps_dec, ps_dec->u2_pic_wd, ps_dec->u2_pic_ht);
  911|  23.6k|        if(ret != OK) return ret;
  ------------------
  |  |  114|  23.6k|#define OK        0
  ------------------
  |  Branch (911:12): [True: 0, False: 23.6k]
  ------------------
  912|       |
  913|       |        /* In shared mode, set all of them as used by display */
  914|  23.6k|        if(ps_dec->u4_share_disp_buf == 1)
  ------------------
  |  Branch (914:12): [True: 0, False: 23.6k]
  ------------------
  915|      0|        {
  916|      0|            WORD32 i;
  917|       |
  918|      0|            for(i = 0; i < ps_dec->u1_pic_bufs; i++)
  ------------------
  |  Branch (918:24): [True: 0, False: 0]
  ------------------
  919|      0|            {
  920|      0|                ih264_buf_mgr_set_status((buf_mgr_t *) ps_dec->pv_pic_buf_mgr, i, BUF_MGR_IO);
  ------------------
  |  |   53|      0|#define BUF_MGR_IO           (1 << 3)
  ------------------
  921|      0|            }
  922|      0|        }
  923|       |
  924|  23.6k|        ps_dec->u1_init_dec_flag = 1;
  925|  23.6k|        ps_prev_seq_params->u2_frm_wd_in_mbs = ps_seq->u2_frm_wd_in_mbs;
  926|  23.6k|        ps_prev_seq_params->u1_level_idc = ps_seq->u1_level_idc;
  927|  23.6k|        ps_prev_seq_params->u1_profile_idc = ps_seq->u1_profile_idc;
  928|  23.6k|        ps_prev_seq_params->u2_frm_ht_in_mbs = ps_seq->u2_frm_ht_in_mbs;
  929|  23.6k|        ps_prev_seq_params->u1_frame_mbs_only_flag = ps_seq->u1_frame_mbs_only_flag;
  930|  23.6k|        ps_prev_seq_params->u1_direct_8x8_inference_flag = ps_seq->u1_direct_8x8_inference_flag;
  931|       |
  932|  23.6k|        ps_dec->i4_cur_display_seq = 0;
  933|  23.6k|        ps_dec->i4_prev_max_display_seq = 0;
  934|  23.6k|        ps_dec->i4_max_poc = 0;
  935|       |
  936|  23.6k|        {
  937|       |            /* 0th entry of CtxtIncMbMap will be always be containing default values
  938|       |            for CABAC context representing MB not available */
  939|  23.6k|            ctxt_inc_mb_info_t *p_DefCtxt = ps_dec->p_ctxt_inc_mb_map - 1;
  940|  23.6k|            UWORD8 *pu1_temp;
  941|  23.6k|            WORD8 i;
  942|  23.6k|            p_DefCtxt->u1_mb_type = CAB_SKIP;
  ------------------
  |  |  402|  23.6k|#define CAB_SKIP          0x10 /* 0001 0000 */
  ------------------
  943|       |
  944|  23.6k|            p_DefCtxt->u1_cbp = 0x0f;
  945|  23.6k|            p_DefCtxt->u1_intra_chroma_pred_mode = 0;
  946|       |
  947|  23.6k|            p_DefCtxt->u1_yuv_dc_csbp = 0x7;
  948|       |
  949|  23.6k|            p_DefCtxt->u1_transform8x8_ctxt = 0;
  950|       |
  951|  23.6k|            pu1_temp = (UWORD8 *) p_DefCtxt->i1_ref_idx;
  952|   118k|            for(i = 0; i < 4; i++, pu1_temp++) (*pu1_temp) = 0;
  ------------------
  |  Branch (952:24): [True: 94.5k, False: 23.6k]
  ------------------
  953|  23.6k|            pu1_temp = (UWORD8 *) p_DefCtxt->u1_mv;
  954|   402k|            for(i = 0; i < 16; i++, pu1_temp++) (*pu1_temp) = 0;
  ------------------
  |  Branch (954:24): [True: 378k, False: 23.6k]
  ------------------
  955|  23.6k|            ps_dec->ps_def_ctxt_mb_info = p_DefCtxt;
  956|  23.6k|        }
  957|  23.6k|    }
  958|       |    /* reset DBP commands read u4_flag */
  959|   138k|    ps_dec->ps_dpb_cmds->u1_dpb_commands_read = 0;
  960|       |
  961|   138k|    return OK;
  ------------------
  |  |  114|   138k|#define OK        0
  ------------------
  962|   138k|}

isvcd_parse_vui_ext_parametres:
   68|  1.25k|{
   69|  1.25k|    UWORD32 *pu4_bitstrm_ofst = &ps_bitstrm->u4_ofst;
   70|  1.25k|    UWORD32 *pu4_bitstrm_buf = ps_bitstrm->pu4_buffer;
   71|  1.25k|    WORD32 ret;
   72|  1.25k|    UWORD32 u4_i;
   73|       |
   74|  1.25k|    ps_svc_vui_ext->u4_vui_ext_num_entries_minus1 = ih264d_uev(pu4_bitstrm_ofst, pu4_bitstrm_buf);
   75|  1.25k|    if(ps_svc_vui_ext->u4_vui_ext_num_entries_minus1 > 1023)
  ------------------
  |  Branch (75:8): [True: 172, False: 1.08k]
  ------------------
   76|    172|    {
   77|    172|        return ERROR_INV_SPS_PPS_T;
   78|    172|    }
   79|       |
   80|  23.8k|    for(u4_i = 0; u4_i <= ps_svc_vui_ext->u4_vui_ext_num_entries_minus1; u4_i++)
  ------------------
  |  Branch (80:19): [True: 22.9k, False: 941]
  ------------------
   81|  22.9k|    {
   82|  22.9k|        ps_svc_vui_ext->u1_vui_ext_dependency_id[u4_i] = ih264d_get_bits_h264(ps_bitstrm, 3);
   83|  22.9k|        ps_svc_vui_ext->u1_vui_ext_quality_id[u4_i] = ih264d_get_bits_h264(ps_bitstrm, 4);
   84|  22.9k|        ps_svc_vui_ext->u1_vui_ext_temporal_id[u4_i] = ih264d_get_bits_h264(ps_bitstrm, 3);
   85|  22.9k|        ps_svc_vui_ext->u1_vui_ext_timing_info_present_flag[u4_i] = ih264d_get_bit_h264(ps_bitstrm);
   86|       |
   87|  22.9k|        if(1 == ps_svc_vui_ext->u1_vui_ext_timing_info_present_flag[u4_i])
  ------------------
  |  Branch (87:12): [True: 1.48k, False: 21.4k]
  ------------------
   88|  1.48k|        {
   89|  1.48k|            ps_svc_vui_ext->u4_vui_ext_num_units_in_tick[u4_i] =
   90|  1.48k|                ih264d_get_bits_h264(ps_bitstrm, 32);
   91|  1.48k|            ps_svc_vui_ext->u4_vui_ext_time_scale[u4_i] = ih264d_get_bits_h264(ps_bitstrm, 32);
   92|  1.48k|            ps_svc_vui_ext->u1_vui_ext_fixed_frame_rate_flag[u4_i] =
   93|  1.48k|                ih264d_get_bit_h264(ps_bitstrm);
   94|  1.48k|        }
   95|       |
   96|  22.9k|        ps_svc_vui_ext->u1_vui_ext_nal_hrd_params_present_flag[u4_i] =
   97|  22.9k|            ih264d_get_bit_h264(ps_bitstrm);
   98|  22.9k|        if(ps_svc_vui_ext->u1_vui_ext_nal_hrd_params_present_flag[u4_i])
  ------------------
  |  Branch (98:12): [True: 1.46k, False: 21.4k]
  ------------------
   99|  1.46k|        {
  100|  1.46k|            ret = ih264d_parse_hrd_parametres(&ps_svc_vui_ext->s_nal_hrd[u4_i], ps_bitstrm);
  101|  1.46k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  1.46k|#define OK        0
  ------------------
  |  Branch (101:16): [True: 66, False: 1.39k]
  ------------------
  102|  1.46k|        }
  103|  22.8k|        ps_svc_vui_ext->u1_vui_ext_vcl_hrd_params_present_flag[u4_i] =
  104|  22.8k|            ih264d_get_bit_h264(ps_bitstrm);
  105|  22.8k|        if(ps_svc_vui_ext->u1_vui_ext_vcl_hrd_params_present_flag[u4_i])
  ------------------
  |  Branch (105:12): [True: 1.48k, False: 21.3k]
  ------------------
  106|  1.48k|        {
  107|  1.48k|            ret = ih264d_parse_hrd_parametres(&ps_svc_vui_ext->s_vcl_hrd[u4_i], ps_bitstrm);
  108|  1.48k|            if(ret != OK) return ret;
  ------------------
  |  |  114|  1.48k|#define OK        0
  ------------------
  |  Branch (108:16): [True: 76, False: 1.41k]
  ------------------
  109|  1.48k|        }
  110|  22.7k|        if(ps_svc_vui_ext->u1_vui_ext_nal_hrd_params_present_flag[u4_i] ||
  ------------------
  |  Branch (110:12): [True: 1.33k, False: 21.4k]
  ------------------
  111|  21.4k|           ps_svc_vui_ext->u1_vui_ext_vcl_hrd_params_present_flag[u4_i])
  ------------------
  |  Branch (111:12): [True: 697, False: 20.7k]
  ------------------
  112|  2.03k|        {
  113|  2.03k|            ps_svc_vui_ext->u1_vui_ext_low_delay_hrd_flag[u4_i] = ih264d_get_bit_h264(ps_bitstrm);
  114|  2.03k|        }
  115|  22.7k|        ps_svc_vui_ext->u1_vui_ext_pic_struct_present_flag[u4_i] = ih264d_get_bit_h264(ps_bitstrm);
  116|  22.7k|    }
  117|    941|    return OK;
  ------------------
  |  |  114|    941|#define OK        0
  ------------------
  118|  1.08k|}

ih264d_init_arch:
   85|  79.9k|{
   86|  79.9k|#ifdef DEFAULT_ARCH
   87|  79.9k|#if DEFAULT_ARCH == D_ARCH_X86_SSE42
   88|  79.9k|    ps_codec->e_processor_arch = ARCH_X86_SSE42;
   89|       |#elif DEFAULT_ARCH == D_ARCH_X86_SSSE3
   90|       |    ps_codec->e_processor_arch = ARCH_X86_SSSE3;
   91|       |#elif DEFAULT_ARCH == D_ARCH_X86_AVX2
   92|       |    ps_codec->e_processor_arch = ARCH_X86_AVX2;
   93|       |#else
   94|       |    ps_codec->e_processor_arch = ARCH_X86_GENERIC;
   95|       |#endif
   96|       |#else
   97|       |    ps_codec->e_processor_arch = ARCH_X86_SSE42;
   98|       |#endif
   99|       |
  100|  79.9k|}

ih264d_init_function_ptr_sse42:
   83|   113k|{
   84|   113k|    ps_codec->pf_default_weighted_pred_luma = ih264_default_weighted_pred_luma_sse42;
   85|   113k|    ps_codec->pf_default_weighted_pred_chroma = ih264_default_weighted_pred_chroma_sse42;
   86|   113k|    ps_codec->pf_weighted_pred_luma = ih264_weighted_pred_luma_sse42;
   87|   113k|    ps_codec->pf_weighted_pred_chroma = ih264_weighted_pred_chroma_sse42;
   88|   113k|    ps_codec->pf_weighted_bi_pred_luma = ih264_weighted_bi_pred_luma_sse42;
   89|   113k|    ps_codec->pf_weighted_bi_pred_chroma = ih264_weighted_bi_pred_chroma_sse42;
   90|       |
   91|   113k|    ps_codec->pf_iquant_itrans_recon_luma_4x4 = ih264_iquant_itrans_recon_4x4_sse42;
   92|   113k|    ps_codec->pf_iquant_itrans_recon_chroma_4x4 = ih264_iquant_itrans_recon_chroma_4x4_sse42;
   93|   113k|    ps_codec->pf_ihadamard_scaling_4x4 = ih264_ihadamard_scaling_4x4_sse42;
   94|   113k|    return;
   95|   113k|}

ih264d_init_function_ptr_ssse3:
   83|   120k|{
   84|       |
   85|       |
   86|       |
   87|       |    /* Init function pointers for intra pred leaf level functions luma
   88|       |     * Intra 16x16 */
   89|   120k|    ps_codec->apf_intra_pred_luma_16x16[0] = ih264_intra_pred_luma_16x16_mode_vert_ssse3;
   90|   120k|    ps_codec->apf_intra_pred_luma_16x16[1] = ih264_intra_pred_luma_16x16_mode_horz_ssse3;
   91|   120k|    ps_codec->apf_intra_pred_luma_16x16[2] = ih264_intra_pred_luma_16x16_mode_dc_ssse3;
   92|   120k|    ps_codec->apf_intra_pred_luma_16x16[3] = ih264_intra_pred_luma_16x16_mode_plane_ssse3;
   93|       |
   94|       |    /* Init function pointers for intra pred leaf level functions luma
   95|       |     * Intra 4x4 */
   96|   120k|    ps_codec->apf_intra_pred_luma_4x4[0] = ih264_intra_pred_luma_4x4_mode_vert_ssse3;
   97|   120k|    ps_codec->apf_intra_pred_luma_4x4[1] = ih264_intra_pred_luma_4x4_mode_horz_ssse3;
   98|   120k|    ps_codec->apf_intra_pred_luma_4x4[2] = ih264_intra_pred_luma_4x4_mode_dc_ssse3;
   99|   120k|    ps_codec->apf_intra_pred_luma_4x4[3] = ih264_intra_pred_luma_4x4_mode_diag_dl_ssse3;
  100|   120k|    ps_codec->apf_intra_pred_luma_4x4[4] = ih264_intra_pred_luma_4x4_mode_diag_dr_ssse3;
  101|   120k|    ps_codec->apf_intra_pred_luma_4x4[5] = ih264_intra_pred_luma_4x4_mode_vert_r_ssse3;
  102|   120k|    ps_codec->apf_intra_pred_luma_4x4[6] = ih264_intra_pred_luma_4x4_mode_horz_d_ssse3;
  103|   120k|    ps_codec->apf_intra_pred_luma_4x4[7] = ih264_intra_pred_luma_4x4_mode_vert_l_ssse3;
  104|   120k|    ps_codec->apf_intra_pred_luma_4x4[8] = ih264_intra_pred_luma_4x4_mode_horz_u_ssse3;
  105|       |
  106|       |    /* Init function pointers for intra pred leaf level functions luma
  107|       |     * Intra 8x8 */
  108|   120k|    ps_codec->apf_intra_pred_luma_8x8[0] = ih264_intra_pred_luma_8x8_mode_vert_ssse3;
  109|   120k|    ps_codec->apf_intra_pred_luma_8x8[1] = ih264_intra_pred_luma_8x8_mode_horz_ssse3;
  110|   120k|    ps_codec->apf_intra_pred_luma_8x8[2] = ih264_intra_pred_luma_8x8_mode_dc_ssse3;
  111|   120k|    ps_codec->apf_intra_pred_luma_8x8[3] = ih264_intra_pred_luma_8x8_mode_diag_dl_ssse3;
  112|   120k|    ps_codec->apf_intra_pred_luma_8x8[4] = ih264_intra_pred_luma_8x8_mode_diag_dr_ssse3;
  113|   120k|    ps_codec->apf_intra_pred_luma_8x8[5] = ih264_intra_pred_luma_8x8_mode_vert_r_ssse3;
  114|   120k|    ps_codec->apf_intra_pred_luma_8x8[6] = ih264_intra_pred_luma_8x8_mode_horz_d_ssse3;
  115|   120k|    ps_codec->apf_intra_pred_luma_8x8[7] = ih264_intra_pred_luma_8x8_mode_vert_l_ssse3;
  116|   120k|    ps_codec->apf_intra_pred_luma_8x8[8] = ih264_intra_pred_luma_8x8_mode_horz_u_ssse3;
  117|       |
  118|   120k|    ps_codec->pf_intra_pred_ref_filtering = ih264_intra_pred_luma_8x8_mode_ref_filtering;
  119|       |
  120|       |    /* Init function pointers for intra pred leaf level functions chroma
  121|       |     * Intra 8x8 */
  122|   120k|    ps_codec->apf_intra_pred_chroma[0] = ih264_intra_pred_chroma_8x8_mode_vert_ssse3;
  123|   120k|    ps_codec->apf_intra_pred_chroma[1] = ih264_intra_pred_chroma_8x8_mode_horz_ssse3;
  124|   120k|    ps_codec->apf_intra_pred_chroma[2] = ih264_intra_pred_chroma_8x8_mode_dc;
  125|   120k|    ps_codec->apf_intra_pred_chroma[3] = ih264_intra_pred_chroma_8x8_mode_plane_ssse3;
  126|       |
  127|       |
  128|   120k|    ps_codec->pf_pad_left_luma = ih264_pad_left_luma_ssse3;
  129|   120k|    ps_codec->pf_pad_left_chroma = ih264_pad_left_chroma_ssse3;
  130|   120k|    ps_codec->pf_pad_right_luma = ih264_pad_right_luma_ssse3;
  131|   120k|    ps_codec->pf_pad_right_chroma = ih264_pad_right_chroma_ssse3;
  132|       |
  133|       |
  134|   120k|    ps_codec->pf_iquant_itrans_recon_luma_4x4 = ih264_iquant_itrans_recon_4x4_ssse3;
  135|   120k|    ps_codec->pf_iquant_itrans_recon_luma_4x4_dc = ih264_iquant_itrans_recon_4x4_dc_ssse3;
  136|   120k|    ps_codec->pf_iquant_itrans_recon_luma_8x8 = ih264_iquant_itrans_recon_8x8_ssse3;
  137|   120k|    ps_codec->pf_iquant_itrans_recon_luma_8x8_dc = ih264_iquant_itrans_recon_8x8_dc_ssse3;
  138|       |
  139|   120k|    ps_codec->pf_iquant_itrans_recon_chroma_4x4_dc = ih264_iquant_itrans_recon_chroma_4x4_dc_ssse3;
  140|       |
  141|       |    /* Init fn ptr luma deblocking */
  142|   120k|    ps_codec->pf_deblk_luma_vert_bs4 = ih264_deblk_luma_vert_bs4_ssse3;
  143|   120k|    ps_codec->pf_deblk_luma_vert_bslt4 = ih264_deblk_luma_vert_bslt4_ssse3;
  144|   120k|    ps_codec->pf_deblk_luma_vert_bs4_mbaff = ih264_deblk_luma_vert_bs4_mbaff_ssse3;
  145|   120k|    ps_codec->pf_deblk_luma_vert_bslt4_mbaff = ih264_deblk_luma_vert_bslt4_mbaff_ssse3;
  146|       |
  147|   120k|    ps_codec->pf_deblk_luma_horz_bs4 = ih264_deblk_luma_horz_bs4_ssse3;
  148|   120k|    ps_codec->pf_deblk_luma_horz_bslt4 = ih264_deblk_luma_horz_bslt4_ssse3;
  149|       |
  150|       |    /* Init fn ptr chroma deblocking */
  151|   120k|    ps_codec->pf_deblk_chroma_vert_bs4 = ih264_deblk_chroma_vert_bs4_ssse3;
  152|   120k|    ps_codec->pf_deblk_chroma_horz_bs4 = ih264_deblk_chroma_horz_bs4_ssse3;
  153|   120k|    ps_codec->pf_deblk_chroma_vert_bs4_mbaff = ih264_deblk_chroma_vert_bs4_mbaff_ssse3;
  154|   120k|    ps_codec->pf_deblk_chroma_vert_bslt4 = ih264_deblk_chroma_vert_bslt4_ssse3;
  155|   120k|    ps_codec->pf_deblk_chroma_horz_bslt4 = ih264_deblk_chroma_horz_bslt4_ssse3;
  156|   120k|    ps_codec->pf_deblk_chroma_vert_bslt4_mbaff = ih264_deblk_chroma_vert_bslt4_mbaff_ssse3;
  157|       |
  158|       |    /* Inter pred leaf level functions */
  159|       |
  160|   120k|    ps_codec->apf_inter_pred_luma[0] = ih264_inter_pred_luma_copy_ssse3;
  161|   120k|    ps_codec->apf_inter_pred_luma[1] = ih264_inter_pred_luma_horz_qpel_ssse3;
  162|   120k|    ps_codec->apf_inter_pred_luma[2] = ih264_inter_pred_luma_horz_ssse3;
  163|   120k|    ps_codec->apf_inter_pred_luma[3] = ih264_inter_pred_luma_horz_qpel_ssse3;
  164|   120k|    ps_codec->apf_inter_pred_luma[4] = ih264_inter_pred_luma_vert_qpel_ssse3;
  165|   120k|    ps_codec->apf_inter_pred_luma[5] = ih264_inter_pred_luma_horz_qpel_vert_qpel_ssse3;
  166|   120k|    ps_codec->apf_inter_pred_luma[6] = ih264_inter_pred_luma_horz_hpel_vert_qpel_ssse3;
  167|   120k|    ps_codec->apf_inter_pred_luma[7] = ih264_inter_pred_luma_horz_qpel_vert_qpel_ssse3;
  168|   120k|    ps_codec->apf_inter_pred_luma[8] = ih264_inter_pred_luma_vert_ssse3;
  169|   120k|    ps_codec->apf_inter_pred_luma[9] = ih264_inter_pred_luma_horz_qpel_vert_hpel_ssse3;
  170|   120k|    ps_codec->apf_inter_pred_luma[10] = ih264_inter_pred_luma_horz_hpel_vert_hpel_ssse3;
  171|   120k|    ps_codec->apf_inter_pred_luma[11] = ih264_inter_pred_luma_horz_qpel_vert_hpel_ssse3;
  172|   120k|    ps_codec->apf_inter_pred_luma[12] = ih264_inter_pred_luma_vert_qpel_ssse3;
  173|   120k|    ps_codec->apf_inter_pred_luma[13] = ih264_inter_pred_luma_horz_qpel_vert_qpel_ssse3;
  174|   120k|    ps_codec->apf_inter_pred_luma[14] = ih264_inter_pred_luma_horz_hpel_vert_qpel_ssse3;
  175|   120k|    ps_codec->apf_inter_pred_luma[15] = ih264_inter_pred_luma_horz_qpel_vert_qpel_ssse3;
  176|       |
  177|   120k|    ps_codec->pf_inter_pred_chroma = ih264_inter_pred_chroma_ssse3;
  178|       |
  179|       |
  180|   120k|    return;
  181|   120k|}

isvcd_init_function_ptr:
   69|   144k|{
   70|   144k|    isvcd_init_function_ptr_generic(ps_svc_lyr_dec);
   71|   144k|    switch(ps_svc_lyr_dec->s_dec.e_processor_arch)
   72|   144k|    {
   73|  24.1k|        case ARCH_X86_GENERIC:
  ------------------
  |  Branch (73:9): [True: 24.1k, False: 120k]
  ------------------
   74|  24.1k|            isvcd_init_function_ptr_generic(ps_svc_lyr_dec);
   75|  24.1k|            break;
   76|  6.67k|        case ARCH_X86_SSSE3:
  ------------------
  |  Branch (76:9): [True: 6.67k, False: 137k]
  ------------------
   77|  6.67k|            ih264d_init_function_ptr_ssse3(&ps_svc_lyr_dec->s_dec);
   78|  6.67k|            break;
   79|  86.1k|        case ARCH_X86_SSE42:
  ------------------
  |  Branch (79:9): [True: 86.1k, False: 58.4k]
  ------------------
   80|   113k|        default:
  ------------------
  |  Branch (80:9): [True: 27.6k, False: 116k]
  ------------------
   81|   113k|            ih264d_init_function_ptr_ssse3(&ps_svc_lyr_dec->s_dec);
   82|   113k|            isvcd_init_function_ptr_sse42(ps_svc_lyr_dec);
   83|   113k|            break;
   84|   144k|    }
   85|   144k|}

isvcd_init_function_ptr_sse42:
   73|   113k|{
   74|   113k|    dec_struct_t *ps_codec = &ps_svc_lyr_dec->s_dec;
   75|   113k|    residual_sampling_ctxt_t *ps_resd_samp_ctx;
   76|   113k|    intra_sampling_ctxt_t *ps_intra_samp_ctxt;
   77|       |    /* call default init func prt sse42 */
   78|   113k|    ih264d_init_function_ptr_sse42(ps_codec);
   79|       |
   80|   113k|    ps_resd_samp_ctx = (residual_sampling_ctxt_t *) ps_svc_lyr_dec->pv_residual_sample_ctxt;
   81|   113k|    ps_intra_samp_ctxt = (intra_sampling_ctxt_t *) ps_svc_lyr_dec->pv_intra_sample_ctxt;
   82|       |
   83|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_luma_4x4 =
   84|   113k|        isvcd_iquant_itrans_residual_recon_4x4_sse42;
   85|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_luma_4x4_dc =
   86|   113k|        isvcd_iquant_itrans_residual_recon_4x4_dc_sse42;
   87|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_luma_8x8 =
   88|   113k|        isvcd_iquant_itrans_residual_recon_8x8_sse42;
   89|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_luma_8x8_dc =
   90|   113k|        isvcd_iquant_itrans_residual_recon_8x8_dc_sse42;
   91|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_chroma_4x4 =
   92|   113k|        isvcd_iquant_itrans_residual_recon_chroma_4x4_sse42;
   93|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_recon_chroma_4x4_dc =
   94|   113k|        isvcd_iquant_itrans_residual_recon_chroma_4x4_dc_sse42;
   95|       |
   96|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_luma_4x4 = isvcd_iquant_itrans_residual_4x4_sse42;
   97|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_luma_4x4_dc =
   98|   113k|        isvcd_iquant_itrans_residual_4x4_dc_sse42;
   99|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_luma_8x8 = isvcd_iquant_itrans_residual_8x8_sse42;
  100|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_luma_8x8_dc =
  101|   113k|        isvcd_iquant_itrans_residual_8x8_dc_sse42;
  102|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_chroma_4x4 =
  103|   113k|        isvcd_iquant_itrans_residual_chroma_4x4_sse42;
  104|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_residual_chroma_4x4_dc =
  105|   113k|        isvcd_iquant_itrans_residual_chroma_4x4_dc_sse42;
  106|       |
  107|   113k|    ps_svc_lyr_dec->pf_pred_residual_recon_luma_4x4 = isvcd_pred_residual_recon_4x4_sse42;
  108|   113k|    ps_svc_lyr_dec->pf_pred_residual_recon_luma_8x8 = isvcd_pred_residual_recon_8x8_sse42;
  109|   113k|    ps_svc_lyr_dec->pf_pred_residual_recon_luma_16x16 = isvcd_pred_residual_recon_16x16_sse42;
  110|   113k|    ps_svc_lyr_dec->pf_pred_residual_recon_chroma_4x4 = isvcd_pred_residual_recon_chroma_4x4_sse42;
  111|   113k|    ps_svc_lyr_dec->pf_pred_residual_recon_chroma_8x8 = isvcd_pred_residual_recon_chroma_8x8_sse42;
  112|       |
  113|   113k|    ps_svc_lyr_dec->pf_residual_luma_4x4 = isvcd_residual_luma_4x4_sse42;
  114|   113k|    ps_svc_lyr_dec->pf_residual_luma_8x8 = isvcd_residual_luma_8x8_sse42;
  115|   113k|    ps_svc_lyr_dec->pf_residual_luma_16x16 = isvcd_residual_luma_16x16_sse42;
  116|   113k|    ps_svc_lyr_dec->pf_residual_chroma_cb_cr_8x8 = isvcd_residual_chroma_cb_cr_8x8_sse42;
  117|       |
  118|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_luma_4x4 = isvcd_iquant_itrans_4x4_sse42;
  119|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_luma_4x4_dc = isvcd_iquant_itrans_4x4_dc_sse42;
  120|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_luma_8x8 = isvcd_iquant_itrans_8x8_sse42;
  121|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_luma_8x8_dc = isvcd_iquant_itrans_8x8_dc_sse42;
  122|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_chroma_4x4 = isvcd_iquant_itrans_chroma_4x4_sse42;
  123|   113k|    ps_svc_lyr_dec->pf_iquant_itrans_chroma_4x4_dc = isvcd_iquant_itrans_chroma_4x4_dc_sse42;
  124|       |
  125|   113k|    ps_intra_samp_ctxt->pf_interpolate_base_luma_dyadic = isvcd_interpolate_base_luma_dyadic_sse42;
  126|   113k|    ps_intra_samp_ctxt->pf_interpolate_intra_base = isvcd_interpolate_intra_base_sse42;
  127|       |
  128|   113k|    ps_intra_samp_ctxt->pf_vert_chroma_interpol[0] = isvcd_vert_interpol_chroma_dyadic_1_sse42;
  129|   113k|    ps_intra_samp_ctxt->pf_vert_chroma_interpol[1] = isvcd_vert_interpol_chroma_dyadic_2_sse42;
  130|   113k|    ps_intra_samp_ctxt->pf_vert_chroma_interpol[2] = isvcd_vert_interpol_chroma_dyadic_3_sse42;
  131|       |
  132|   113k|    ps_intra_samp_ctxt->pf_horz_chroma_interpol[0] = isvcd_horz_interpol_chroma_dyadic_1_sse42;
  133|   113k|    ps_intra_samp_ctxt->pf_horz_chroma_interpol[1] = isvcd_horz_interpol_chroma_dyadic_2_sse42;
  134|       |
  135|   113k|    ps_resd_samp_ctx->pf_residual_luma_dyadic = isvcd_residual_luma_dyadic_sse42;
  136|   113k|    ps_resd_samp_ctx->pf_interpolate_residual = isvcd_interpolate_residual_sse42;
  137|   113k|    ps_resd_samp_ctx->pf_residual_reflayer_const_non_boundary_mb =
  138|   113k|        isvcd_residual_reflayer_const_non_boundary_mb_sse42;
  139|       |
  140|   113k|    return;
  141|   113k|}

isvcd_interpolate_base_luma_dyadic_sse42:
   79|  20.7k|{
   80|  20.7k|    WORD32 i4_x, i4_y;
   81|  20.7k|    WORD32 i4_filt_stride, i4_src_stride;
   82|  20.7k|    UWORD8 *pu1_inp, *pu1_out;
   83|  20.7k|    WORD16 *pi2_tmp;
   84|       |
   85|  20.7k|    __m128i i4_samp_16x8b_0, i4_samp_16x8b_1, i4_samp_16x8b_2, i4_samp_16x8b_3;
   86|  20.7k|    __m128i i4_samp_8x16b_0, i4_samp_8x16b_1, i4_samp_8x16b_2, i4_samp_8x16b_3;
   87|  20.7k|    __m128i i4_res_8x16b_r1_1, i4_res_8x16b_r1_2, i4_res_8x16b_r1_3;
   88|  20.7k|    __m128i i4_res_8x16b_r2_1, i4_res_8x16b_r2_2, i4_res_8x16b_r2_3;
   89|       |
   90|       |    /* Filter coefficient values for phase 4 */
   91|  20.7k|    __m128i i4_coeff_8x16b_0 = _mm_set1_epi16(-3);
   92|  20.7k|    __m128i i4_coeff_8x16b_1 = _mm_set1_epi16(28);
   93|  20.7k|    i4_filt_stride = 12;
   94|  20.7k|    i4_src_stride = DYADIC_REF_W_Y;
  ------------------
  |  |   56|  20.7k|#define DYADIC_REF_W_Y 20
  ------------------
   95|       |
   96|  20.7k|    pu1_inp = pu1_inp_buf;
   97|  20.7k|    pi2_tmp = pi2_tmp_filt_buf;
   98|  20.7k|    pu1_out = pu1_out_buf;
   99|       |
  100|       |    /* Vertical interpolation */
  101|       |    /*First 64 bit */
  102|  41.4k|    for(i4_x = 0; i4_x < 1; i4_x++)
  ------------------
  |  Branch (102:19): [True: 20.7k, False: 20.7k]
  ------------------
  103|  20.7k|    {
  104|       |        /* y = 0, y_phase = 12 */
  105|  20.7k|        i4_samp_16x8b_0 = _mm_loadl_epi64((__m128i *) (pu1_inp));
  106|  20.7k|        i4_samp_16x8b_1 = _mm_loadl_epi64((__m128i *) (pu1_inp + i4_src_stride));
  107|  20.7k|        i4_samp_16x8b_2 = _mm_loadl_epi64((__m128i *) (pu1_inp + (i4_src_stride << 1)));
  108|  20.7k|        i4_samp_16x8b_3 =
  109|  20.7k|            _mm_loadl_epi64((__m128i *) (pu1_inp + (i4_src_stride << 1) + i4_src_stride));
  110|  20.7k|        pu1_inp += (i4_src_stride << 2);
  111|  20.7k|        i4_samp_8x16b_0 = _mm_cvtepu8_epi16(i4_samp_16x8b_0);
  112|  20.7k|        i4_samp_8x16b_1 = _mm_cvtepu8_epi16(i4_samp_16x8b_1);
  113|  20.7k|        i4_samp_8x16b_2 = _mm_cvtepu8_epi16(i4_samp_16x8b_2);
  114|  20.7k|        i4_samp_8x16b_3 = _mm_cvtepu8_epi16(i4_samp_16x8b_3);
  115|       |
  116|       |        /* since y_phase 12 for y = 0 */
  117|       |        /*Multiply by 8 =>  left shift by 3*/
  118|  20.7k|        i4_res_8x16b_r1_1 = _mm_slli_epi16(i4_samp_8x16b_1, 3);
  119|  20.7k|        i4_res_8x16b_r1_2 = _mm_mullo_epi16(i4_samp_8x16b_2, i4_coeff_8x16b_1);
  120|  20.7k|        i4_res_8x16b_r1_3 = _mm_mullo_epi16(i4_samp_8x16b_3, i4_coeff_8x16b_0);
  121|       |
  122|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_2);
  123|  20.7k|        i4_res_8x16b_r1_3 = _mm_subs_epi16(i4_res_8x16b_r1_3, i4_samp_8x16b_0);
  124|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_3);
  125|       |
  126|  20.7k|        _mm_storeu_si128((__m128i *) pi2_tmp, i4_res_8x16b_r1_1);
  127|  20.7k|        pi2_tmp += i4_filt_stride;
  128|       |
  129|  20.7k|        i4_samp_8x16b_0 = i4_samp_8x16b_1;
  130|  20.7k|        i4_samp_8x16b_1 = i4_samp_8x16b_2;
  131|  20.7k|        i4_samp_8x16b_2 = i4_samp_8x16b_3;
  132|  20.7k|        i4_samp_8x16b_3 = _mm_cvtepu8_epi16(_mm_loadl_epi64((__m128i *) (pu1_inp)));
  133|       |
  134|       |        /* y_phase is 4 for odd values of y */
  135|       |        /* and 12 for even values of y        */
  136|       |        /*Multiply by 8 =>  left shift by 3*/
  137|       |
  138|  20.7k|        i4_res_8x16b_r1_1 = _mm_mullo_epi16(i4_samp_8x16b_0, i4_coeff_8x16b_0);
  139|  20.7k|        i4_res_8x16b_r1_2 = _mm_mullo_epi16(i4_samp_8x16b_1, i4_coeff_8x16b_1);
  140|  20.7k|        i4_res_8x16b_r1_3 = _mm_slli_epi16(i4_samp_8x16b_2, 3);
  141|       |
  142|  20.7k|        i4_res_8x16b_r2_1 = _mm_slli_epi16(i4_samp_8x16b_1, 3);
  143|  20.7k|        i4_res_8x16b_r2_2 = _mm_mullo_epi16(i4_samp_8x16b_2, i4_coeff_8x16b_1);
  144|  20.7k|        i4_res_8x16b_r2_3 = _mm_mullo_epi16(i4_samp_8x16b_3, i4_coeff_8x16b_0);
  145|       |
  146|  20.7k|        i4_res_8x16b_r1_3 = _mm_subs_epi16(i4_res_8x16b_r1_3, i4_samp_8x16b_3);
  147|  20.7k|        i4_res_8x16b_r2_3 = _mm_subs_epi16(i4_res_8x16b_r2_3, i4_samp_8x16b_0);
  148|       |
  149|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_2);
  150|  20.7k|        i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_2);
  151|       |
  152|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_3);
  153|  20.7k|        i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_3);
  154|       |
  155|       |        /* Storing the results */
  156|  20.7k|        _mm_storeu_si128((__m128i *) pi2_tmp, i4_res_8x16b_r1_1);
  157|  20.7k|        _mm_storeu_si128((__m128i *) (pi2_tmp + i4_filt_stride), i4_res_8x16b_r2_1);
  158|  20.7k|        pi2_tmp += (i4_filt_stride << 1);
  159|  20.7k|        pu1_inp += i4_src_stride;
  160|       |
  161|  20.7k|        i4_samp_8x16b_0 = i4_samp_8x16b_1;
  162|  20.7k|        i4_samp_8x16b_1 = i4_samp_8x16b_2;
  163|  20.7k|        i4_samp_8x16b_2 = i4_samp_8x16b_3;
  164|  20.7k|        i4_samp_8x16b_3 = _mm_cvtepu8_epi16(_mm_loadl_epi64((__m128i *) (pu1_inp)));
  165|       |
  166|       |        /* y_phase is 4 for odd values of y */
  167|       |        /* and 12 for even values of y        */
  168|       |        /*Multiply by 8 =>  left shift by 3*/
  169|       |
  170|  20.7k|        i4_res_8x16b_r1_1 = _mm_mullo_epi16(i4_samp_8x16b_0, i4_coeff_8x16b_0);
  171|  20.7k|        i4_res_8x16b_r1_2 = _mm_mullo_epi16(i4_samp_8x16b_1, i4_coeff_8x16b_1);
  172|  20.7k|        i4_res_8x16b_r1_3 = _mm_slli_epi16(i4_samp_8x16b_2, 3);
  173|       |
  174|  20.7k|        i4_res_8x16b_r2_1 = _mm_slli_epi16(i4_samp_8x16b_1, 3);
  175|  20.7k|        i4_res_8x16b_r2_2 = _mm_mullo_epi16(i4_samp_8x16b_2, i4_coeff_8x16b_1);
  176|  20.7k|        i4_res_8x16b_r2_3 = _mm_mullo_epi16(i4_samp_8x16b_3, i4_coeff_8x16b_0);
  177|       |
  178|  20.7k|        i4_res_8x16b_r1_3 = _mm_subs_epi16(i4_res_8x16b_r1_3, i4_samp_8x16b_3);
  179|  20.7k|        i4_res_8x16b_r2_3 = _mm_subs_epi16(i4_res_8x16b_r2_3, i4_samp_8x16b_0);
  180|       |
  181|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_2);
  182|  20.7k|        i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_2);
  183|       |
  184|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_3);
  185|  20.7k|        i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_3);
  186|       |
  187|       |        /* Storing the results */
  188|  20.7k|        _mm_storeu_si128((__m128i *) pi2_tmp, i4_res_8x16b_r1_1);
  189|  20.7k|        _mm_storeu_si128((__m128i *) (pi2_tmp + i4_filt_stride), i4_res_8x16b_r2_1);
  190|  20.7k|        pi2_tmp += (i4_filt_stride << 1);
  191|  20.7k|        pu1_inp += i4_src_stride;
  192|       |
  193|  20.7k|        i4_samp_8x16b_0 = i4_samp_8x16b_1;
  194|  20.7k|        i4_samp_8x16b_1 = i4_samp_8x16b_2;
  195|  20.7k|        i4_samp_8x16b_2 = i4_samp_8x16b_3;
  196|  20.7k|        i4_samp_8x16b_3 = _mm_cvtepu8_epi16(_mm_loadl_epi64((__m128i *) (pu1_inp)));
  197|       |
  198|       |        /* y_phase is 4 for odd values of y */
  199|       |        /* and 12 for even values of y        */
  200|       |        /*Multiply by 8 =>  left shift by 3*/
  201|       |
  202|  20.7k|        i4_res_8x16b_r1_1 = _mm_mullo_epi16(i4_samp_8x16b_0, i4_coeff_8x16b_0);
  203|  20.7k|        i4_res_8x16b_r1_2 = _mm_mullo_epi16(i4_samp_8x16b_1, i4_coeff_8x16b_1);
  204|  20.7k|        i4_res_8x16b_r1_3 = _mm_slli_epi16(i4_samp_8x16b_2, 3);
  205|       |
  206|  20.7k|        i4_res_8x16b_r2_1 = _mm_slli_epi16(i4_samp_8x16b_1, 3);
  207|  20.7k|        i4_res_8x16b_r2_2 = _mm_mullo_epi16(i4_samp_8x16b_2, i4_coeff_8x16b_1);
  208|  20.7k|        i4_res_8x16b_r2_3 = _mm_mullo_epi16(i4_samp_8x16b_3, i4_coeff_8x16b_0);
  209|       |
  210|  20.7k|        i4_res_8x16b_r1_3 = _mm_subs_epi16(i4_res_8x16b_r1_3, i4_samp_8x16b_3);
  211|  20.7k|        i4_res_8x16b_r2_3 = _mm_subs_epi16(i4_res_8x16b_r2_3, i4_samp_8x16b_0);
  212|       |
  213|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_2);
  214|  20.7k|        i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_2);
  215|       |
  216|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_3);
  217|  20.7k|        i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_3);
  218|       |
  219|       |        /* Storing the results */
  220|  20.7k|        _mm_storeu_si128((__m128i *) pi2_tmp, i4_res_8x16b_r1_1);
  221|  20.7k|        _mm_storeu_si128((__m128i *) (pi2_tmp + i4_filt_stride), i4_res_8x16b_r2_1);
  222|  20.7k|        pi2_tmp += (i4_filt_stride << 1);
  223|  20.7k|        pu1_inp += i4_src_stride;
  224|       |
  225|  20.7k|        i4_samp_8x16b_0 = i4_samp_8x16b_1;
  226|  20.7k|        i4_samp_8x16b_1 = i4_samp_8x16b_2;
  227|  20.7k|        i4_samp_8x16b_2 = i4_samp_8x16b_3;
  228|  20.7k|        i4_samp_8x16b_3 = _mm_cvtepu8_epi16(_mm_loadl_epi64((__m128i *) (pu1_inp)));
  229|       |
  230|       |        /* y_phase is 4 for odd values of y */
  231|       |        /* and 12 for even values of y        */
  232|       |        /*Multiply by 8 =>  left shift by 3*/
  233|  20.7k|        i4_res_8x16b_r1_1 = _mm_mullo_epi16(i4_samp_8x16b_0, i4_coeff_8x16b_0);
  234|  20.7k|        i4_res_8x16b_r1_2 = _mm_mullo_epi16(i4_samp_8x16b_1, i4_coeff_8x16b_1);
  235|  20.7k|        i4_res_8x16b_r1_3 = _mm_slli_epi16(i4_samp_8x16b_2, 3);
  236|       |
  237|  20.7k|        i4_res_8x16b_r2_1 = _mm_slli_epi16(i4_samp_8x16b_1, 3);
  238|  20.7k|        i4_res_8x16b_r2_2 = _mm_mullo_epi16(i4_samp_8x16b_2, i4_coeff_8x16b_1);
  239|  20.7k|        i4_res_8x16b_r2_3 = _mm_mullo_epi16(i4_samp_8x16b_3, i4_coeff_8x16b_0);
  240|       |
  241|  20.7k|        i4_res_8x16b_r1_3 = _mm_subs_epi16(i4_res_8x16b_r1_3, i4_samp_8x16b_3);
  242|  20.7k|        i4_res_8x16b_r2_3 = _mm_subs_epi16(i4_res_8x16b_r2_3, i4_samp_8x16b_0);
  243|       |
  244|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_2);
  245|  20.7k|        i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_2);
  246|       |
  247|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_3);
  248|  20.7k|        i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_3);
  249|       |
  250|       |        /* Storing the results */
  251|  20.7k|        _mm_storeu_si128((__m128i *) pi2_tmp, i4_res_8x16b_r1_1);
  252|  20.7k|        _mm_storeu_si128((__m128i *) (pi2_tmp + i4_filt_stride), i4_res_8x16b_r2_1);
  253|  20.7k|        pi2_tmp += (i4_filt_stride << 1);
  254|  20.7k|        pu1_inp += i4_src_stride;
  255|       |
  256|  20.7k|        i4_samp_8x16b_0 = i4_samp_8x16b_1;
  257|  20.7k|        i4_samp_8x16b_1 = i4_samp_8x16b_2;
  258|  20.7k|        i4_samp_8x16b_2 = i4_samp_8x16b_3;
  259|  20.7k|        i4_samp_8x16b_3 = _mm_cvtepu8_epi16(_mm_loadl_epi64((__m128i *) (pu1_inp)));
  260|       |        /* y_phase is 4 for odd values of y */
  261|       |        /* and 12 for even values of y        */
  262|       |        /*Multiply by 8 =>  left shift by 3*/
  263|  20.7k|        i4_res_8x16b_r1_1 = _mm_mullo_epi16(i4_samp_8x16b_0, i4_coeff_8x16b_0);
  264|  20.7k|        i4_res_8x16b_r1_2 = _mm_mullo_epi16(i4_samp_8x16b_1, i4_coeff_8x16b_1);
  265|  20.7k|        i4_res_8x16b_r1_3 = _mm_slli_epi16(i4_samp_8x16b_2, 3);
  266|       |
  267|  20.7k|        i4_res_8x16b_r2_1 = _mm_slli_epi16(i4_samp_8x16b_1, 3);
  268|  20.7k|        i4_res_8x16b_r2_2 = _mm_mullo_epi16(i4_samp_8x16b_2, i4_coeff_8x16b_1);
  269|  20.7k|        i4_res_8x16b_r2_3 = _mm_mullo_epi16(i4_samp_8x16b_3, i4_coeff_8x16b_0);
  270|       |
  271|  20.7k|        i4_res_8x16b_r1_3 = _mm_subs_epi16(i4_res_8x16b_r1_3, i4_samp_8x16b_3);
  272|  20.7k|        i4_res_8x16b_r2_3 = _mm_subs_epi16(i4_res_8x16b_r2_3, i4_samp_8x16b_0);
  273|       |
  274|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_2);
  275|  20.7k|        i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_2);
  276|       |
  277|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_3);
  278|  20.7k|        i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_3);
  279|       |
  280|       |        /* Storing the results */
  281|  20.7k|        _mm_storeu_si128((__m128i *) pi2_tmp, i4_res_8x16b_r1_1);
  282|  20.7k|        _mm_storeu_si128((__m128i *) (pi2_tmp + i4_filt_stride), i4_res_8x16b_r2_1);
  283|  20.7k|        pi2_tmp += (i4_filt_stride << 1);
  284|  20.7k|        pu1_inp += i4_src_stride;
  285|       |
  286|  20.7k|        i4_samp_8x16b_0 = i4_samp_8x16b_1;
  287|  20.7k|        i4_samp_8x16b_1 = i4_samp_8x16b_2;
  288|  20.7k|        i4_samp_8x16b_2 = i4_samp_8x16b_3;
  289|  20.7k|        i4_samp_8x16b_3 = _mm_cvtepu8_epi16(_mm_loadl_epi64((__m128i *) (pu1_inp)));
  290|       |        /* y_phase is 4 for odd values of y */
  291|       |        /* and 12 for even values of y        */
  292|       |        /*Multiply by 8 =>  left shift by 3*/
  293|       |
  294|  20.7k|        i4_res_8x16b_r1_1 = _mm_mullo_epi16(i4_samp_8x16b_0, i4_coeff_8x16b_0);
  295|  20.7k|        i4_res_8x16b_r1_2 = _mm_mullo_epi16(i4_samp_8x16b_1, i4_coeff_8x16b_1);
  296|  20.7k|        i4_res_8x16b_r1_3 = _mm_slli_epi16(i4_samp_8x16b_2, 3);
  297|       |
  298|  20.7k|        i4_res_8x16b_r2_1 = _mm_slli_epi16(i4_samp_8x16b_1, 3);
  299|  20.7k|        i4_res_8x16b_r2_2 = _mm_mullo_epi16(i4_samp_8x16b_2, i4_coeff_8x16b_1);
  300|  20.7k|        i4_res_8x16b_r2_3 = _mm_mullo_epi16(i4_samp_8x16b_3, i4_coeff_8x16b_0);
  301|       |
  302|  20.7k|        i4_res_8x16b_r1_3 = _mm_subs_epi16(i4_res_8x16b_r1_3, i4_samp_8x16b_3);
  303|  20.7k|        i4_res_8x16b_r2_3 = _mm_subs_epi16(i4_res_8x16b_r2_3, i4_samp_8x16b_0);
  304|       |
  305|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_2);
  306|  20.7k|        i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_2);
  307|       |
  308|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_3);
  309|  20.7k|        i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_3);
  310|       |
  311|       |        /* Storing the results */
  312|  20.7k|        _mm_storeu_si128((__m128i *) pi2_tmp, i4_res_8x16b_r1_1);
  313|  20.7k|        _mm_storeu_si128((__m128i *) (pi2_tmp + i4_filt_stride), i4_res_8x16b_r2_1);
  314|  20.7k|        pi2_tmp += (i4_filt_stride << 1);
  315|  20.7k|        pu1_inp += i4_src_stride;
  316|       |
  317|  20.7k|        i4_samp_8x16b_0 = i4_samp_8x16b_1;
  318|  20.7k|        i4_samp_8x16b_1 = i4_samp_8x16b_2;
  319|  20.7k|        i4_samp_8x16b_2 = i4_samp_8x16b_3;
  320|  20.7k|        i4_samp_8x16b_3 = _mm_cvtepu8_epi16(_mm_loadl_epi64((__m128i *) (pu1_inp)));
  321|       |        /* y_phase is 4 for odd values of y */
  322|       |        /* and 12 for even values of y        */
  323|       |        /*Multiply by 8 =>  left shift by 3*/
  324|       |
  325|  20.7k|        i4_res_8x16b_r1_1 = _mm_mullo_epi16(i4_samp_8x16b_0, i4_coeff_8x16b_0);
  326|  20.7k|        i4_res_8x16b_r1_2 = _mm_mullo_epi16(i4_samp_8x16b_1, i4_coeff_8x16b_1);
  327|  20.7k|        i4_res_8x16b_r1_3 = _mm_slli_epi16(i4_samp_8x16b_2, 3);
  328|       |
  329|  20.7k|        i4_res_8x16b_r2_1 = _mm_slli_epi16(i4_samp_8x16b_1, 3);
  330|  20.7k|        i4_res_8x16b_r2_2 = _mm_mullo_epi16(i4_samp_8x16b_2, i4_coeff_8x16b_1);
  331|  20.7k|        i4_res_8x16b_r2_3 = _mm_mullo_epi16(i4_samp_8x16b_3, i4_coeff_8x16b_0);
  332|       |
  333|  20.7k|        i4_res_8x16b_r1_3 = _mm_subs_epi16(i4_res_8x16b_r1_3, i4_samp_8x16b_3);
  334|  20.7k|        i4_res_8x16b_r2_3 = _mm_subs_epi16(i4_res_8x16b_r2_3, i4_samp_8x16b_0);
  335|       |
  336|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_2);
  337|  20.7k|        i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_2);
  338|       |
  339|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_3);
  340|  20.7k|        i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_3);
  341|       |
  342|       |        /* Storing the results */
  343|  20.7k|        _mm_storeu_si128((__m128i *) pi2_tmp, i4_res_8x16b_r1_1);
  344|  20.7k|        _mm_storeu_si128((__m128i *) (pi2_tmp + i4_filt_stride), i4_res_8x16b_r2_1);
  345|  20.7k|        pi2_tmp += (i4_filt_stride << 1);
  346|  20.7k|        pu1_inp += i4_src_stride;
  347|       |
  348|       |        /* y = 15, y_phase = 4 */
  349|  20.7k|        i4_samp_8x16b_0 = i4_samp_8x16b_1;
  350|  20.7k|        i4_samp_8x16b_1 = i4_samp_8x16b_2;
  351|  20.7k|        i4_samp_8x16b_2 = i4_samp_8x16b_3;
  352|  20.7k|        i4_samp_8x16b_3 = _mm_cvtepu8_epi16(_mm_loadl_epi64((__m128i *) (pu1_inp)));
  353|       |
  354|  20.7k|        i4_res_8x16b_r1_1 = _mm_mullo_epi16(i4_samp_8x16b_0, i4_coeff_8x16b_0);
  355|  20.7k|        i4_res_8x16b_r1_2 = _mm_mullo_epi16(i4_samp_8x16b_1, i4_coeff_8x16b_1);
  356|  20.7k|        i4_res_8x16b_r1_3 = _mm_slli_epi16(i4_samp_8x16b_2, 3);
  357|  20.7k|        i4_res_8x16b_r1_3 = _mm_subs_epi16(i4_res_8x16b_r1_3, i4_samp_8x16b_3);
  358|       |
  359|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_2);
  360|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_3);
  361|       |
  362|       |        /* Store the output */
  363|  20.7k|        _mm_storeu_si128((__m128i *) pi2_tmp, i4_res_8x16b_r1_1);
  364|       |
  365|       |        /* Reinitializing the ptrs */
  366|  20.7k|        pu1_inp = pu1_inp_buf;
  367|  20.7k|        pi2_tmp = pi2_tmp_filt_buf;
  368|  20.7k|    } /* End of loop over x */
  369|       |
  370|       |    /*Remaining 32 bit */
  371|  20.7k|    pu1_inp += 8;
  372|  20.7k|    pi2_tmp += 8;
  373|  41.4k|    for(i4_x = 0; i4_x < 1; i4_x++)
  ------------------
  |  Branch (373:19): [True: 20.7k, False: 20.7k]
  ------------------
  374|  20.7k|    {
  375|       |        /* y = 0, y_phase = 12 */
  376|  20.7k|        i4_samp_16x8b_0 = _mm_loadl_epi64((__m128i *) (pu1_inp));
  377|  20.7k|        i4_samp_16x8b_1 = _mm_loadl_epi64((__m128i *) (pu1_inp + i4_src_stride));
  378|  20.7k|        i4_samp_16x8b_2 = _mm_loadl_epi64((__m128i *) (pu1_inp + (i4_src_stride << 1)));
  379|  20.7k|        i4_samp_16x8b_3 =
  380|  20.7k|            _mm_loadl_epi64((__m128i *) (pu1_inp + (i4_src_stride << 1) + i4_src_stride));
  381|  20.7k|        pu1_inp += (i4_src_stride << 2);
  382|  20.7k|        i4_samp_8x16b_0 = _mm_cvtepu8_epi16(i4_samp_16x8b_0);
  383|  20.7k|        i4_samp_8x16b_1 = _mm_cvtepu8_epi16(i4_samp_16x8b_1);
  384|  20.7k|        i4_samp_8x16b_2 = _mm_cvtepu8_epi16(i4_samp_16x8b_2);
  385|  20.7k|        i4_samp_8x16b_3 = _mm_cvtepu8_epi16(i4_samp_16x8b_3);
  386|       |
  387|       |        /* since y_phase 12 for y = 0 */
  388|       |        /*Multiply by 8 =>  left shift by 3*/
  389|  20.7k|        i4_res_8x16b_r1_1 = _mm_slli_epi16(i4_samp_8x16b_1, 3);
  390|  20.7k|        i4_res_8x16b_r1_2 = _mm_mullo_epi16(i4_samp_8x16b_2, i4_coeff_8x16b_1);
  391|  20.7k|        i4_res_8x16b_r1_3 = _mm_mullo_epi16(i4_samp_8x16b_3, i4_coeff_8x16b_0);
  392|       |
  393|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_2);
  394|  20.7k|        i4_res_8x16b_r1_3 = _mm_subs_epi16(i4_res_8x16b_r1_3, i4_samp_8x16b_0);
  395|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_3);
  396|       |
  397|  20.7k|        _mm_storel_epi64((__m128i *) pi2_tmp, i4_res_8x16b_r1_1);
  398|  20.7k|        pi2_tmp += i4_filt_stride;
  399|       |
  400|   165k|        for(i4_y = 1; i4_y < 15; i4_y += 2)
  ------------------
  |  Branch (400:23): [True: 145k, False: 20.7k]
  ------------------
  401|   145k|        {
  402|   145k|            i4_samp_8x16b_0 = i4_samp_8x16b_1;
  403|   145k|            i4_samp_8x16b_1 = i4_samp_8x16b_2;
  404|   145k|            i4_samp_8x16b_2 = i4_samp_8x16b_3;
  405|   145k|            i4_samp_8x16b_3 = _mm_cvtepu8_epi16(_mm_loadl_epi64((__m128i *) (pu1_inp)));
  406|       |            /* y_phase is 4 for odd values of y */
  407|       |            /* and 12 for even values of y        */
  408|       |            /*Multiply by 8 =>  left shift by 3*/
  409|       |
  410|   145k|            i4_res_8x16b_r1_1 = _mm_mullo_epi16(i4_samp_8x16b_0, i4_coeff_8x16b_0);
  411|   145k|            i4_res_8x16b_r1_2 = _mm_mullo_epi16(i4_samp_8x16b_1, i4_coeff_8x16b_1);
  412|   145k|            i4_res_8x16b_r1_3 = _mm_slli_epi16(i4_samp_8x16b_2, 3);
  413|       |
  414|   145k|            i4_res_8x16b_r2_1 = _mm_slli_epi16(i4_samp_8x16b_1, 3);
  415|   145k|            i4_res_8x16b_r2_2 = _mm_mullo_epi16(i4_samp_8x16b_2, i4_coeff_8x16b_1);
  416|   145k|            i4_res_8x16b_r2_3 = _mm_mullo_epi16(i4_samp_8x16b_3, i4_coeff_8x16b_0);
  417|       |
  418|   145k|            i4_res_8x16b_r1_3 = _mm_subs_epi16(i4_res_8x16b_r1_3, i4_samp_8x16b_3);
  419|   145k|            i4_res_8x16b_r2_3 = _mm_subs_epi16(i4_res_8x16b_r2_3, i4_samp_8x16b_0);
  420|       |
  421|   145k|            i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_2);
  422|   145k|            i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_2);
  423|       |
  424|   145k|            i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_3);
  425|   145k|            i4_res_8x16b_r2_1 = _mm_adds_epi16(i4_res_8x16b_r2_1, i4_res_8x16b_r2_3);
  426|       |
  427|       |            /* Storing the results */
  428|   145k|            _mm_storel_epi64((__m128i *) pi2_tmp, i4_res_8x16b_r1_1);
  429|   145k|            _mm_storel_epi64((__m128i *) (pi2_tmp + i4_filt_stride), i4_res_8x16b_r2_1);
  430|   145k|            pi2_tmp += (i4_filt_stride << 1);
  431|   145k|            pu1_inp += i4_src_stride;
  432|   145k|        } /* End of loop over y */
  433|       |
  434|       |        /* y = 15, y_phase = 4 */
  435|  20.7k|        i4_samp_8x16b_0 = i4_samp_8x16b_1;
  436|  20.7k|        i4_samp_8x16b_1 = i4_samp_8x16b_2;
  437|  20.7k|        i4_samp_8x16b_2 = i4_samp_8x16b_3;
  438|  20.7k|        i4_samp_8x16b_3 = _mm_cvtepu8_epi16(_mm_loadl_epi64((__m128i *) (pu1_inp)));
  439|       |
  440|  20.7k|        i4_res_8x16b_r1_1 = _mm_mullo_epi16(i4_samp_8x16b_0, i4_coeff_8x16b_0);
  441|  20.7k|        i4_res_8x16b_r1_2 = _mm_mullo_epi16(i4_samp_8x16b_1, i4_coeff_8x16b_1);
  442|  20.7k|        i4_res_8x16b_r1_3 = _mm_slli_epi16(i4_samp_8x16b_2, 3);
  443|  20.7k|        i4_res_8x16b_r1_3 = _mm_subs_epi16(i4_res_8x16b_r1_3, i4_samp_8x16b_3);
  444|       |
  445|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_2);
  446|  20.7k|        i4_res_8x16b_r1_1 = _mm_adds_epi16(i4_res_8x16b_r1_1, i4_res_8x16b_r1_3);
  447|       |
  448|       |        /* Store the output */
  449|  20.7k|        _mm_storel_epi64((__m128i *) pi2_tmp, i4_res_8x16b_r1_1);
  450|       |
  451|       |        /* Reinitializing the ptrs */
  452|  20.7k|        pu1_inp = pu1_inp_buf;
  453|  20.7k|        pi2_tmp = pi2_tmp_filt_buf;
  454|  20.7k|    }
  455|       |
  456|  20.7k|    {
  457|  20.7k|        __m128i coeff_c0_c1_8x16b = _mm_set_epi16(28, -3, 28, -3, 28, -3, 28, -3);
  458|  20.7k|        __m128i coeff_c2_c3_8x16b = _mm_set_epi16(-1, 8, -1, 8, -1, 8, -1, 8);
  459|  20.7k|        __m128i coeff_c3_c2_8x16b = _mm_set_epi16(8, -1, 8, -1, 8, -1, 8, -1);
  460|  20.7k|        __m128i coeff_c1_c0_8x16b = _mm_set_epi16(-3, 28, -3, 28, -3, 28, -3, 28);
  461|       |
  462|  20.7k|        __m128i i4_samp_8x16b_rpart1_0, i4_samp_8x16b_rpart2_0;
  463|  20.7k|        __m128i i4_samp_8x16b_rpart1_1, i4_samp_8x16b_rpart2_1;
  464|  20.7k|        __m128i i4_samp_8x16b_rpart1_2, i4_samp_8x16b_rpart2_2;
  465|  20.7k|        __m128i i4_samp_8x16b_rpart1_3, i4_samp_8x16b_rpart2_3;
  466|  20.7k|        __m128i i4_samp_8x16b_rpart1_4, i4_samp_8x16b_rpart2_4;
  467|       |
  468|  20.7k|        __m128i i4_res_4x32b_rpart1_0, i4_res_4x32b_rpart2_0;
  469|  20.7k|        __m128i i4_res_4x32b_rpart1_1, i4_res_4x32b_rpart2_1;
  470|  20.7k|        __m128i i4_res_4x32b_rpart1_2, i4_res_4x32b_rpart2_2;
  471|  20.7k|        __m128i i4_res_4x32b_rpart1_3, i4_res_4x32b_rpart2_3;
  472|       |
  473|  20.7k|        __m128i res_512 = _mm_set1_epi32(512);
  474|       |        /* Horizontal interpolation */
  475|   352k|        for(i4_y = 0; i4_y < 16; i4_y++)
  ------------------
  |  Branch (475:23): [True: 331k, False: 20.7k]
  ------------------
  476|   331k|        {
  477|       |            // a0 a1 a2 a3 a4 a5 a6 a7
  478|   331k|            i4_samp_8x16b_rpart1_0 = _mm_loadu_si128((__m128i *) pi2_tmp);
  479|       |            // a4 a5 a6 a7 a8 a9 a10 a11
  480|   331k|            i4_samp_8x16b_rpart2_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 4));
  481|       |            // a1 a2 a3 a4 a5 a6 a7 0
  482|   331k|            i4_samp_8x16b_rpart1_1 = _mm_srli_si128(i4_samp_8x16b_rpart1_0, 2);
  483|       |            // a2 a3 a4 a5 a6 a7 0 0
  484|   331k|            i4_samp_8x16b_rpart1_2 = _mm_srli_si128(i4_samp_8x16b_rpart1_0, 4);
  485|       |            // a3 a4 a5 a6 a7 0 0 0
  486|   331k|            i4_samp_8x16b_rpart1_3 = _mm_srli_si128(i4_samp_8x16b_rpart1_0, 6);
  487|       |            // a4 a5 a6 a7 0 0 0 0
  488|   331k|            i4_samp_8x16b_rpart1_4 = _mm_srli_si128(i4_samp_8x16b_rpart1_0, 8);
  489|       |
  490|       |            // a5 a6 a7 a8 a9 a10 a11 0
  491|   331k|            i4_samp_8x16b_rpart2_1 = _mm_srli_si128(i4_samp_8x16b_rpart2_0, 2);
  492|       |            // a6 a7 a8 a9 a10 a11 0 0
  493|   331k|            i4_samp_8x16b_rpart2_2 = _mm_srli_si128(i4_samp_8x16b_rpart2_0, 4);
  494|       |            // a7 a8 a9 a10 a11 0 0 0
  495|   331k|            i4_samp_8x16b_rpart2_3 = _mm_srli_si128(i4_samp_8x16b_rpart2_0, 6);
  496|       |            // a8 a9 a10 a11 0 0 0 0
  497|   331k|            i4_samp_8x16b_rpart2_4 = _mm_srli_si128(i4_samp_8x16b_rpart2_0, 8);
  498|       |            // a0 a1  a1 a2  a2 a3  a3 a4
  499|   331k|            i4_samp_8x16b_rpart1_0 =
  500|   331k|                _mm_unpacklo_epi16(i4_samp_8x16b_rpart1_0, i4_samp_8x16b_rpart1_1);
  501|       |            // a1 a2  a2 a3  a3 a4  a4 a5
  502|   331k|            i4_samp_8x16b_rpart1_1 =
  503|   331k|                _mm_unpacklo_epi16(i4_samp_8x16b_rpart1_1, i4_samp_8x16b_rpart1_2);
  504|       |            // a2 a3  a3 a4  a4 a5  a5 a6
  505|   331k|            i4_samp_8x16b_rpart1_2 =
  506|   331k|                _mm_unpacklo_epi16(i4_samp_8x16b_rpart1_2, i4_samp_8x16b_rpart1_3);
  507|       |            // a3 a4  a4 a5  a5 a6  a6 a7
  508|   331k|            i4_samp_8x16b_rpart1_3 =
  509|   331k|                _mm_unpacklo_epi16(i4_samp_8x16b_rpart1_3, i4_samp_8x16b_rpart1_4);
  510|       |            // a4 a5  a5 a6  a6 a7  a7 a8
  511|   331k|            i4_samp_8x16b_rpart2_0 =
  512|   331k|                _mm_unpacklo_epi16(i4_samp_8x16b_rpart2_0, i4_samp_8x16b_rpart2_1);
  513|       |            // a5 a6  a6 a7  a7 a8  a8 a9
  514|   331k|            i4_samp_8x16b_rpart2_1 =
  515|   331k|                _mm_unpacklo_epi16(i4_samp_8x16b_rpart2_1, i4_samp_8x16b_rpart2_2);
  516|       |            // a6 a7  a7 a8  a8 a9  a9 a10
  517|   331k|            i4_samp_8x16b_rpart2_2 =
  518|   331k|                _mm_unpacklo_epi16(i4_samp_8x16b_rpart2_2, i4_samp_8x16b_rpart2_3);
  519|       |            // a7 a8  a8 a9  a9 a10 a10 a11
  520|   331k|            i4_samp_8x16b_rpart2_3 =
  521|   331k|                _mm_unpacklo_epi16(i4_samp_8x16b_rpart2_3, i4_samp_8x16b_rpart2_4);
  522|       |            // a0c3+a1c2  a1c3+a2c2  a2c3+a3c2  a3c3+a4c2
  523|   331k|            i4_res_4x32b_rpart1_0 = _mm_madd_epi16(i4_samp_8x16b_rpart1_0, coeff_c3_c2_8x16b);
  524|       |            // a2c1+a3c0  a3c1+a4c0  a4c1+a5c0  a5c1+a6c0
  525|   331k|            i4_res_4x32b_rpart1_2 = _mm_madd_epi16(i4_samp_8x16b_rpart1_2, coeff_c1_c0_8x16b);
  526|       |            // a1c0+a2c1  a2c0+a3c1  a3c0+a4c1  a4c0+a5c1
  527|   331k|            i4_res_4x32b_rpart1_1 = _mm_madd_epi16(i4_samp_8x16b_rpart1_1, coeff_c0_c1_8x16b);
  528|       |            // a3c2+a4c3  a5c2+a5c3  a5c2+a6c3  a6c2+a7c3
  529|   331k|            i4_res_4x32b_rpart1_3 = _mm_madd_epi16(i4_samp_8x16b_rpart1_3, coeff_c2_c3_8x16b);
  530|       |            // a4c3+a5c2  a5a3+a6c2  a6c3+a7c2  a7c3+a8c2
  531|   331k|            i4_res_4x32b_rpart2_0 = _mm_madd_epi16(i4_samp_8x16b_rpart2_0, coeff_c3_c2_8x16b);
  532|       |            // a6c1+a7c0  a7c1+a8c0  a8c1+a9c0  a9c1+a10c0
  533|   331k|            i4_res_4x32b_rpart2_2 = _mm_madd_epi16(i4_samp_8x16b_rpart2_2, coeff_c1_c0_8x16b);
  534|       |            // a5c0+a6c1  a6c0+a7c1  a7c0+a8c1  a8c0+a9c1
  535|   331k|            i4_res_4x32b_rpart2_1 = _mm_madd_epi16(i4_samp_8x16b_rpart2_1, coeff_c0_c1_8x16b);
  536|       |            // a7c2+a8c3  a8c2+a9c3  a9c2+a10c3  a10c2+a11c3
  537|   331k|            i4_res_4x32b_rpart2_3 = _mm_madd_epi16(i4_samp_8x16b_rpart2_3, coeff_c2_c3_8x16b);
  538|       |            // a0c3+a1c2 + a2c1+a3c0  a1c3+a2c2 + a3c1+a4c0 a2c3+a3c2 + a4c1+a5c0
  539|       |            // a3c3+a4c2 +a5c1+a6c0
  540|   331k|            i4_res_4x32b_rpart1_0 = _mm_add_epi32(i4_res_4x32b_rpart1_0, i4_res_4x32b_rpart1_2);
  541|       |            // a1c0+a2c1 + a3c2+a4c3  a2c0+a3c1 + a5c2+a5c3 a3c0+a4c1 + a5c2+a6c3
  542|       |            // a4c0+a5c1 + a6c2+a7c3
  543|   331k|            i4_res_4x32b_rpart1_1 = _mm_add_epi32(i4_res_4x32b_rpart1_1, i4_res_4x32b_rpart1_3);
  544|       |            // a4c3+a5c2 + a6c1+a7c0  a5a3+a6c2 + a7c1+a8c0 a6c3+a7c2 + a8c1+a9c0
  545|       |            // a7c3+a8c2+ a9c1+a10c0
  546|   331k|            i4_res_4x32b_rpart2_0 = _mm_add_epi32(i4_res_4x32b_rpart2_0, i4_res_4x32b_rpart2_2);
  547|       |            // a5c0+a6c1 + a7c2+a8c3  a6c0+a7c1 + a8c2+a9c3 a7c0+a8c1 + a9c2+a10c3
  548|       |            // a8c0+a9c1 + a10c2+a11c3
  549|   331k|            i4_res_4x32b_rpart2_1 = _mm_add_epi32(i4_res_4x32b_rpart2_1, i4_res_4x32b_rpart2_3);
  550|       |
  551|   331k|            i4_res_4x32b_rpart1_2 =
  552|   331k|                _mm_unpacklo_epi32(i4_res_4x32b_rpart1_0, i4_res_4x32b_rpart1_1);
  553|   331k|            i4_res_4x32b_rpart1_3 =
  554|   331k|                _mm_unpackhi_epi32(i4_res_4x32b_rpart1_0, i4_res_4x32b_rpart1_1);
  555|       |
  556|   331k|            i4_res_4x32b_rpart2_2 =
  557|   331k|                _mm_unpacklo_epi32(i4_res_4x32b_rpart2_0, i4_res_4x32b_rpart2_1);
  558|   331k|            i4_res_4x32b_rpart2_3 =
  559|   331k|                _mm_unpackhi_epi32(i4_res_4x32b_rpart2_0, i4_res_4x32b_rpart2_1);
  560|       |
  561|   331k|            i4_res_4x32b_rpart1_0 = _mm_add_epi32(i4_res_4x32b_rpart1_2, res_512);
  562|   331k|            i4_res_4x32b_rpart1_1 = _mm_add_epi32(i4_res_4x32b_rpart1_3, res_512);
  563|       |
  564|   331k|            i4_res_4x32b_rpart1_0 = _mm_srai_epi32(i4_res_4x32b_rpart1_0, 10);
  565|   331k|            i4_res_4x32b_rpart1_1 = _mm_srai_epi32(i4_res_4x32b_rpart1_1, 10);
  566|       |
  567|   331k|            i4_res_4x32b_rpart2_0 = _mm_add_epi32(i4_res_4x32b_rpart2_2, res_512);
  568|   331k|            i4_res_4x32b_rpart2_1 = _mm_add_epi32(i4_res_4x32b_rpart2_3, res_512);
  569|       |
  570|   331k|            i4_res_4x32b_rpart2_0 = _mm_srai_epi32(i4_res_4x32b_rpart2_0, 10);
  571|   331k|            i4_res_4x32b_rpart2_1 = _mm_srai_epi32(i4_res_4x32b_rpart2_1, 10);
  572|       |
  573|   331k|            _mm_storeu_si128(
  574|   331k|                (__m128i *) pu1_out,
  575|   331k|                _mm_packus_epi16(_mm_packus_epi32(i4_res_4x32b_rpart1_0, i4_res_4x32b_rpart1_1),
  576|   331k|                                 _mm_packus_epi32(i4_res_4x32b_rpart2_0, i4_res_4x32b_rpart2_1)));
  577|       |
  578|   331k|            pi2_tmp += i4_filt_stride;
  579|   331k|            pu1_out += i4_out_stride;
  580|   331k|        } /* End of loop over y */
  581|  20.7k|    }
  582|  20.7k|} /* isvcd_interpolate_base_luma_dyadic */
isvcd_interpolate_intra_base_sse42:
  616|  50.0k|{
  617|       |    /* --------------------------------------------------------------------- */
  618|       |    /* Index Parameters                                                         */
  619|       |    /* --------------------------------------------------------------------- */
  620|  50.0k|    intra_sampling_ctxt_t *ps_ctxt;
  621|  50.0k|    intra_samp_map_ctxt_t *ps_map_ctxt;
  622|  50.0k|    intra_samp_lyr_ctxt *ps_lyr_ctxt;
  623|  50.0k|    WORD32 i4_x, i4_y;
  624|  50.0k|    WORD32 i4_frm_mb_x, i4_frm_mb_y;
  625|  50.0k|    UWORD8 *pu1_refarray = NULL;
  626|  50.0k|    ref_pixel_map_t *ps_x_pos_phase;
  627|  50.0k|    ref_pixel_map_t *ps_y_pos_phase;
  628|  50.0k|    WORD32 i4_temp_array_ht;
  629|  50.0k|    WORD32 *pi4_interp_buff;
  630|  50.0k|    WORD32 i4_mb_wd;
  631|  50.0k|    WORD32 i4_mb_ht;
  632|       |
  633|  50.0k|    WORD32 i4_x_min;
  634|  50.0k|    ref_min_max_map_t *ps_x_min_max;
  635|  50.0k|    WORD8 arr_y_ref_pos_luma[16] = {0};
  636|  50.0k|    WORD8 arr_x_ref_pos_luma[16] = {0};
  637|  50.0k|    WORD8 arr_x_ref_pos_luma_low[16] = {0};
  638|  50.0k|    WORD8 arr_x_ref_pos_luma_high[16] = {0};
  639|  50.0k|    WORD8 arr_phase_luma[32] = {0};
  640|  50.0k|    WORD8 *pi4_y_ref_pos_luma;
  641|  50.0k|    WORD8 *pi4_x_ref_pos_luma_low;
  642|  50.0k|    WORD8 *pi4_x_ref_pos_luma_high;
  643|  50.0k|    WORD8 *pi4_phase_luma;
  644|  50.0k|    UWORD8 *pu1_refarray_temp;
  645|       |
  646|       |    /* --------------------------------------------------------------------- */
  647|       |    /* Extracting pointers from the  context                                  */
  648|       |    /* --------------------------------------------------------------------- */
  649|  50.0k|    ps_ctxt = (intra_sampling_ctxt_t *) pv_intra_samp_ctxt;
  650|  50.0k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_ctxt->i4_res_lyr_id];
  651|       |
  652|  50.0k|    if(0 == i4_refarray_flag)
  ------------------
  |  Branch (652:8): [True: 33.3k, False: 16.6k]
  ------------------
  653|  33.3k|    {
  654|  33.3k|        pu1_refarray = ps_ctxt->pu1_refarray_buffer;
  655|  33.3k|    }
  656|  16.6k|    else if(1 == i4_refarray_flag)
  ------------------
  |  Branch (656:13): [True: 16.6k, False: 0]
  ------------------
  657|  16.6k|    {
  658|  16.6k|        pu1_refarray = ps_ctxt->pu1_refarray_cb;
  659|  16.6k|    }
  660|       |
  661|       |    /* --------------------------------------------------------------------- */
  662|       |    /* LUMA    or CHROMA */
  663|       |    /* --------------------------------------------------------------------- */
  664|       |
  665|  50.0k|    if(1 == i4_chroma_flag)
  ------------------
  |  Branch (665:8): [True: 33.3k, False: 16.6k]
  ------------------
  666|  33.3k|        ps_map_ctxt = &(ps_lyr_ctxt->s_chroma_map_ctxt);
  667|  16.6k|    else
  668|  16.6k|        ps_map_ctxt = &(ps_lyr_ctxt->s_luma_map_ctxt);
  669|       |
  670|  50.0k|    i4_mb_wd = MB_WIDTH >> i4_chroma_flag;
  ------------------
  |  |   67|  50.0k|#define MB_WIDTH 16
  ------------------
  671|  50.0k|    i4_mb_ht = MB_HEIGHT >> i4_chroma_flag;
  ------------------
  |  |   68|  50.0k|#define MB_HEIGHT 16
  ------------------
  672|       |
  673|  50.0k|    ps_x_min_max = ps_map_ctxt->ps_x_min_max;
  674|       |
  675|  50.0k|    i4_frm_mb_y = i4_mb_y * i4_mb_ht;
  676|  50.0k|    i4_frm_mb_x = i4_mb_x * i4_mb_wd;
  677|       |    /* get the min position */
  678|  50.0k|    i4_x_min = ps_x_min_max[i4_mb_x].i2_min_pos;
  679|       |
  680|       |    /* --------------------------------------------------------------------- */
  681|       |    /* Projected frame level pointers                                        */
  682|       |    /* --------------------------------------------------------------------- */
  683|  50.0k|    ps_x_pos_phase = ps_map_ctxt->ps_x_pos_phase;
  684|  50.0k|    ps_y_pos_phase = ps_map_ctxt->ps_y_pos_phase;
  685|       |
  686|       |    /* --------------------------------------------------------------------- */
  687|       |    /* Pointers and Dimenstion of the temporary buffer                         */
  688|       |    /* --------------------------------------------------------------------- */
  689|  50.0k|    i4_temp_array_ht = i4_mb_ht;
  690|  50.0k|    pi4_interp_buff = ps_ctxt->pi4_temp_interpolation_buffer;
  691|       |
  692|  50.0k|    if(i4_chroma_flag == 0)
  ------------------
  |  Branch (692:8): [True: 16.6k, False: 33.3k]
  ------------------
  693|  16.6k|    {
  694|       |        /* --------------------------------------------------------------------- */
  695|       |        /* Loop for interpolation in vertical direction */
  696|       |        /* --------------------------------------------------------------------- */
  697|  16.6k|        WORD16 *pi2_interp_buff_temp;
  698|  16.6k|        pi2_interp_buff_temp = (WORD16 *) pi4_interp_buff;
  699|  16.6k|        {
  700|  16.6k|            __m128i out_res_8x16b_0, out_res_8x16b_1;
  701|       |
  702|  16.6k|            __m128i inp_8x16b_r0, inp_8x16b_r01_0, phs_mask_16x8b_r0, phs_mask_16x8b_r01_0,
  703|  16.6k|                out_res_8x16b_r01_0;
  704|  16.6k|            __m128i inp_8x16b_r1, inp_8x16b_r23_0, phs_mask_16x8b_r1, phs_mask_16x8b_r23_0,
  705|  16.6k|                out_res_8x16b_r01_1;
  706|  16.6k|            __m128i inp_8x16b_r2, inp_8x16b_r01_1, phs_mask_16x8b_r2, phs_mask_16x8b_r01_1,
  707|  16.6k|                out_res_8x16b_r23_0;
  708|  16.6k|            __m128i inp_8x16b_r3, inp_8x16b_r23_1, phs_mask_16x8b_r3, phs_mask_16x8b_r23_1,
  709|  16.6k|                out_res_8x16b_r23_1;
  710|       |
  711|   283k|            for(i4_y = 0; i4_y < (i4_temp_array_ht); i4_y++)
  ------------------
  |  Branch (711:27): [True: 266k, False: 16.6k]
  ------------------
  712|   266k|            {
  713|   266k|                arr_phase_luma[i4_y] = (WORD8) ps_y_pos_phase[i4_y + i4_frm_mb_y].i2_phase;
  714|   266k|                arr_y_ref_pos_luma[i4_y] = (WORD8) (ps_y_pos_phase[i4_y + i4_frm_mb_y].i2_ref_pos);
  715|   266k|            }
  716|  16.6k|            pi4_y_ref_pos_luma = arr_y_ref_pos_luma;
  717|  16.6k|            pi4_phase_luma = arr_phase_luma;
  718|       |
  719|   283k|            for(i4_y = 0; i4_y < (i4_temp_array_ht); i4_y++)
  ------------------
  |  Branch (719:27): [True: 266k, False: 16.6k]
  ------------------
  720|   266k|            {
  721|   266k|                pu1_refarray_temp =
  722|   266k|                    pu1_refarray + (pi4_y_ref_pos_luma[i4_y] * i4_refarray_wd) + (i4_x_min - 1);
  723|   266k|                inp_8x16b_r0 = _mm_loadu_si128((__m128i *) (pu1_refarray_temp - i4_refarray_wd));
  724|   266k|                inp_8x16b_r1 = _mm_loadu_si128((__m128i *) (pu1_refarray_temp));
  725|   266k|                inp_8x16b_r2 = _mm_loadu_si128((__m128i *) (pu1_refarray_temp + i4_refarray_wd));
  726|   266k|                inp_8x16b_r3 =
  727|   266k|                    _mm_loadu_si128((__m128i *) (pu1_refarray_temp + 2 * i4_refarray_wd));
  728|       |
  729|   266k|                inp_8x16b_r01_0 = _mm_unpacklo_epi8(inp_8x16b_r0, inp_8x16b_r1);
  730|   266k|                inp_8x16b_r23_0 = _mm_unpacklo_epi8(inp_8x16b_r2, inp_8x16b_r3);
  731|   266k|                inp_8x16b_r01_1 = _mm_unpackhi_epi8(inp_8x16b_r0, inp_8x16b_r1);
  732|   266k|                inp_8x16b_r23_1 = _mm_unpackhi_epi8(inp_8x16b_r2, inp_8x16b_r3);
  733|       |
  734|   266k|                phs_mask_16x8b_r0 = _mm_set1_epi8(g_ai1_interp_filter_luma[pi4_phase_luma[i4_y]]);
  735|   266k|                phs_mask_16x8b_r1 =
  736|   266k|                    _mm_set1_epi8(g_ai1_interp_filter_luma[pi4_phase_luma[i4_y] + 16]);
  737|   266k|                phs_mask_16x8b_r2 =
  738|   266k|                    _mm_set1_epi8(g_ai1_interp_filter_luma[pi4_phase_luma[i4_y] + 32]);
  739|   266k|                phs_mask_16x8b_r3 =
  740|   266k|                    _mm_set1_epi8(g_ai1_interp_filter_luma[pi4_phase_luma[i4_y] + 48]);
  741|       |
  742|   266k|                phs_mask_16x8b_r01_0 = _mm_unpacklo_epi8(phs_mask_16x8b_r0, phs_mask_16x8b_r1);
  743|   266k|                phs_mask_16x8b_r23_0 = _mm_unpacklo_epi8(phs_mask_16x8b_r2, phs_mask_16x8b_r3);
  744|   266k|                phs_mask_16x8b_r01_1 = _mm_unpackhi_epi8(phs_mask_16x8b_r0, phs_mask_16x8b_r1);
  745|   266k|                phs_mask_16x8b_r23_1 = _mm_unpackhi_epi8(phs_mask_16x8b_r2, phs_mask_16x8b_r3);
  746|       |
  747|   266k|                out_res_8x16b_r01_0 = _mm_maddubs_epi16(inp_8x16b_r01_0, phs_mask_16x8b_r01_0);
  748|   266k|                out_res_8x16b_r01_1 = _mm_maddubs_epi16(inp_8x16b_r01_1, phs_mask_16x8b_r01_1);
  749|   266k|                out_res_8x16b_r23_0 = _mm_maddubs_epi16(inp_8x16b_r23_0, phs_mask_16x8b_r23_0);
  750|   266k|                out_res_8x16b_r23_1 = _mm_maddubs_epi16(inp_8x16b_r23_1, phs_mask_16x8b_r23_1);
  751|       |
  752|   266k|                out_res_8x16b_0 = _mm_add_epi16(out_res_8x16b_r01_0, out_res_8x16b_r23_0);
  753|   266k|                out_res_8x16b_1 = _mm_add_epi16(out_res_8x16b_r01_1, out_res_8x16b_r23_1);
  754|       |
  755|   266k|                _mm_storeu_si128(
  756|   266k|                    (__m128i *) (pi2_interp_buff_temp + (i4_y * i4_refarray_wd) + (i4_x_min - 1)),
  757|   266k|                    out_res_8x16b_0);
  758|   266k|                _mm_storeu_si128((__m128i *) (pi2_interp_buff_temp + (i4_y * i4_refarray_wd) +
  759|   266k|                                              (i4_x_min - 1) + 8),
  760|   266k|                                 out_res_8x16b_1);
  761|   266k|            }
  762|  16.6k|        }
  763|       |        /* --------------------------------------------------------------------- */
  764|       |        /* Loop for interpolation in horizontal direction                         */
  765|       |        /* --------------------------------------------------------------------- */
  766|  16.6k|        {
  767|  16.6k|            WORD32 strt_indx = 10, strt_indx_h = 0;
  768|       |
  769|  16.6k|            __m128i inp_8x16b_0;
  770|  16.6k|            __m128i inp_8x16b_1;
  771|       |
  772|  16.6k|            __m128i phs_mask_16x8b_0;
  773|  16.6k|            __m128i phs_mask_16x8b_1;
  774|  16.6k|            __m128i x_ref_pos_luma_mask_r0_0, x_ref_pos_luma_mask_r0_1, x_ref_pos_luma_mask_r1_0,
  775|  16.6k|                x_ref_pos_luma_mask_r1_1, x_ref_pos_luma_mask_r2_0, x_ref_pos_luma_mask_r2_1,
  776|  16.6k|                x_ref_pos_luma_mask_r3_0, x_ref_pos_luma_mask_r3_1;
  777|       |
  778|  16.6k|            __m128i inp_8x16b_2, inp_8x16b_3;
  779|       |
  780|  16.6k|            WORD32 i4_x2 = 0;
  781|  16.6k|            WORD32 i4_mb_wd_hlf = (i4_mb_wd >> 1);
  782|  16.6k|            __m128i twos = _mm_set1_epi8(2);
  783|       |
  784|  16.6k|            strt_indx = ps_x_pos_phase[0 + i4_frm_mb_x].i2_ref_pos - 1;
  785|  16.6k|            strt_indx_h = (ps_x_pos_phase[8 + i4_frm_mb_x].i2_ref_pos - strt_indx - 1);
  786|   283k|            for(i4_x = 0; i4_x < i4_mb_wd; i4_x++)
  ------------------
  |  Branch (786:27): [True: 266k, False: 16.6k]
  ------------------
  787|   266k|            {
  788|   266k|                arr_x_ref_pos_luma[i4_x] = (WORD8) ps_x_pos_phase[i4_x + i4_frm_mb_x].i2_ref_pos;
  789|   266k|                arr_phase_luma[i4_x] = (WORD8) ps_x_pos_phase[i4_x + i4_frm_mb_x].i2_phase;
  790|   266k|                arr_x_ref_pos_luma[i4_x] = arr_x_ref_pos_luma[i4_x] - strt_indx - 1;
  791|   266k|            }
  792|       |
  793|   150k|            for(i4_x = 0; i4_x < i4_mb_wd_hlf; i4_x++)
  ------------------
  |  Branch (793:27): [True: 133k, False: 16.6k]
  ------------------
  794|   133k|            {
  795|   133k|                i4_x2 = i4_x << 1;
  796|   133k|                arr_x_ref_pos_luma_low[i4_x2] = (arr_x_ref_pos_luma[i4_x]) << 1;
  797|   133k|                arr_x_ref_pos_luma_low[i4_x2 + 1] = arr_x_ref_pos_luma_low[i4_x2] + 1;
  798|   133k|            }
  799|   150k|            for(i4_x = i4_mb_wd_hlf; i4_x < i4_mb_wd; i4_x++)
  ------------------
  |  Branch (799:38): [True: 133k, False: 16.6k]
  ------------------
  800|   133k|            {
  801|   133k|                i4_x2 = (i4_x - i4_mb_wd_hlf) << 1;
  802|   133k|                arr_x_ref_pos_luma_high[i4_x2] = ((arr_x_ref_pos_luma[i4_x] - strt_indx_h) << 1);
  803|   133k|                arr_x_ref_pos_luma_high[i4_x2 + 1] = arr_x_ref_pos_luma_high[i4_x2] + 1;
  804|   133k|            }
  805|  16.6k|            pi4_x_ref_pos_luma_low = arr_x_ref_pos_luma_low;
  806|  16.6k|            pi4_x_ref_pos_luma_high = arr_x_ref_pos_luma_high;
  807|  16.6k|            pi4_phase_luma = arr_phase_luma;
  808|       |
  809|  16.6k|            phs_mask_16x8b_0 = _mm_loadu_si128((__m128i *) (pi4_phase_luma));
  810|  16.6k|            phs_mask_16x8b_1 = _mm_loadu_si128((__m128i *) (pi4_phase_luma + 8));
  811|       |
  812|  16.6k|            x_ref_pos_luma_mask_r0_0 = _mm_loadu_si128((__m128i *) (pi4_x_ref_pos_luma_low));
  813|  16.6k|            x_ref_pos_luma_mask_r0_1 = _mm_loadu_si128((__m128i *) (pi4_x_ref_pos_luma_high));
  814|  16.6k|            x_ref_pos_luma_mask_r1_0 = _mm_add_epi8(x_ref_pos_luma_mask_r0_0, twos);
  815|  16.6k|            x_ref_pos_luma_mask_r1_1 = _mm_add_epi8(x_ref_pos_luma_mask_r0_1, twos);
  816|  16.6k|            x_ref_pos_luma_mask_r2_0 = _mm_add_epi8(x_ref_pos_luma_mask_r1_0, twos);
  817|  16.6k|            x_ref_pos_luma_mask_r2_1 = _mm_add_epi8(x_ref_pos_luma_mask_r1_1, twos);
  818|  16.6k|            x_ref_pos_luma_mask_r3_0 = x_ref_pos_luma_mask_r0_0;
  819|  16.6k|            x_ref_pos_luma_mask_r3_1 = x_ref_pos_luma_mask_r0_1;
  820|       |
  821|  16.6k|            {
  822|  16.6k|                __m128i ip_filt_16x8b_r0, ip_filt_8x16b_r0_0, ip_filt_8x16b_r0_1,
  823|  16.6k|                    ip_filt_8x16b_r01_l_0, ip_filt_8x16b_r01_h_0;
  824|  16.6k|                __m128i ip_filt_16x8b_r1, ip_filt_8x16b_r1_0, ip_filt_8x16b_r1_1,
  825|  16.6k|                    ip_filt_8x16b_r23_l_0, ip_filt_8x16b_r23_h_0;
  826|  16.6k|                __m128i ip_filt_16x8b_r2, ip_filt_8x16b_r2_0, ip_filt_8x16b_r2_1,
  827|  16.6k|                    ip_filt_8x16b_r01_l_1, ip_filt_8x16b_r01_h_1;
  828|  16.6k|                __m128i ip_filt_16x8b_r3, ip_filt_8x16b_r3_0, ip_filt_8x16b_r3_1,
  829|  16.6k|                    ip_filt_8x16b_r23_l_1, ip_filt_8x16b_r23_h_1;
  830|       |
  831|  16.6k|                __m128i inp_8x16b_r0_0, inp_8x16b_r2_0, inp_8x16b_r01_l_0, inp_8x16b_r01_h_0,
  832|  16.6k|                    out_res_4x32b_r01_l_0, out_res_4x32b_r01_h_0;
  833|  16.6k|                __m128i inp_8x16b_r0_1, inp_8x16b_r2_1, inp_8x16b_r23_l_0, inp_8x16b_r23_h_0,
  834|  16.6k|                    out_res_4x32b_r01_l_1, out_res_4x32b_r01_h_1;
  835|  16.6k|                __m128i inp_8x16b_r1_0, inp_8x16b_r3_0, inp_8x16b_r01_l_1, inp_8x16b_r01_h_1,
  836|  16.6k|                    out_res_4x32b_r23_l_0, out_res_4x32b_r23_h_0;
  837|  16.6k|                __m128i inp_8x16b_r1_1, inp_8x16b_r3_1, inp_8x16b_r23_l_1, inp_8x16b_r23_h_1,
  838|  16.6k|                    out_res_4x32b_r23_l_1, out_res_4x32b_r23_h_1;
  839|       |
  840|  16.6k|                __m128i out_res_4x32b_l_0;
  841|  16.6k|                __m128i out_res_4x32b_l_1;
  842|  16.6k|                __m128i out_res_4x32b_h_0;
  843|  16.6k|                __m128i out_res_4x32b_h_1;
  844|       |
  845|  16.6k|                __m128i out_res_8x16b_l;
  846|  16.6k|                __m128i out_res_8x16b_h;
  847|       |
  848|  16.6k|                __m128i out_res_16x8b;
  849|  16.6k|                __m128i const_512 = _mm_set1_epi32(512);
  850|       |
  851|  16.6k|                ip_filt_16x8b_r0 = _mm_loadu_si128((__m128i *) (g_ai1_interp_filter_luma));
  852|  16.6k|                ip_filt_16x8b_r1 = _mm_loadu_si128((__m128i *) (g_ai1_interp_filter_luma + 16));
  853|  16.6k|                ip_filt_16x8b_r2 = _mm_loadu_si128((__m128i *) (g_ai1_interp_filter_luma + 32));
  854|  16.6k|                ip_filt_16x8b_r3 = _mm_loadu_si128((__m128i *) (g_ai1_interp_filter_luma + 48));
  855|       |
  856|  16.6k|                ip_filt_8x16b_r0_0 =
  857|  16.6k|                    _mm_cvtepi8_epi16(_mm_shuffle_epi8(ip_filt_16x8b_r0, phs_mask_16x8b_0));
  858|  16.6k|                ip_filt_8x16b_r1_0 =
  859|  16.6k|                    _mm_cvtepi8_epi16(_mm_shuffle_epi8(ip_filt_16x8b_r1, phs_mask_16x8b_0));
  860|  16.6k|                ip_filt_8x16b_r2_0 =
  861|  16.6k|                    _mm_cvtepi8_epi16(_mm_shuffle_epi8(ip_filt_16x8b_r2, phs_mask_16x8b_0));
  862|  16.6k|                ip_filt_8x16b_r3_0 =
  863|  16.6k|                    _mm_cvtepi8_epi16(_mm_shuffle_epi8(ip_filt_16x8b_r3, phs_mask_16x8b_0));
  864|       |
  865|  16.6k|                ip_filt_8x16b_r0_1 =
  866|  16.6k|                    _mm_cvtepi8_epi16(_mm_shuffle_epi8(ip_filt_16x8b_r0, phs_mask_16x8b_1));
  867|  16.6k|                ip_filt_8x16b_r1_1 =
  868|  16.6k|                    _mm_cvtepi8_epi16(_mm_shuffle_epi8(ip_filt_16x8b_r1, phs_mask_16x8b_1));
  869|  16.6k|                ip_filt_8x16b_r2_1 =
  870|  16.6k|                    _mm_cvtepi8_epi16(_mm_shuffle_epi8(ip_filt_16x8b_r2, phs_mask_16x8b_1));
  871|  16.6k|                ip_filt_8x16b_r3_1 =
  872|  16.6k|                    _mm_cvtepi8_epi16(_mm_shuffle_epi8(ip_filt_16x8b_r3, phs_mask_16x8b_1));
  873|       |
  874|  16.6k|                ip_filt_8x16b_r01_l_0 = _mm_unpacklo_epi16(ip_filt_8x16b_r0_0, ip_filt_8x16b_r1_0);
  875|  16.6k|                ip_filt_8x16b_r23_l_0 = _mm_unpacklo_epi16(ip_filt_8x16b_r2_0, ip_filt_8x16b_r3_0);
  876|  16.6k|                ip_filt_8x16b_r01_l_1 = _mm_unpackhi_epi16(ip_filt_8x16b_r0_0, ip_filt_8x16b_r1_0);
  877|  16.6k|                ip_filt_8x16b_r23_l_1 = _mm_unpackhi_epi16(ip_filt_8x16b_r2_0, ip_filt_8x16b_r3_0);
  878|       |
  879|  16.6k|                ip_filt_8x16b_r01_h_0 = _mm_unpacklo_epi16(ip_filt_8x16b_r0_1, ip_filt_8x16b_r1_1);
  880|  16.6k|                ip_filt_8x16b_r23_h_0 = _mm_unpacklo_epi16(ip_filt_8x16b_r2_1, ip_filt_8x16b_r3_1);
  881|  16.6k|                ip_filt_8x16b_r01_h_1 = _mm_unpackhi_epi16(ip_filt_8x16b_r0_1, ip_filt_8x16b_r1_1);
  882|  16.6k|                ip_filt_8x16b_r23_h_1 = _mm_unpackhi_epi16(ip_filt_8x16b_r2_1, ip_filt_8x16b_r3_1);
  883|       |
  884|   283k|                for(i4_y = 0; i4_y < i4_temp_array_ht; i4_y++)
  ------------------
  |  Branch (884:31): [True: 266k, False: 16.6k]
  ------------------
  885|   266k|                {
  886|   266k|                    inp_8x16b_0 = _mm_loadu_si128((__m128i *) (pi2_interp_buff_temp + strt_indx));
  887|   266k|                    inp_8x16b_1 = _mm_loadu_si128(
  888|   266k|                        (__m128i *) (pi2_interp_buff_temp + strt_indx + strt_indx_h));
  889|   266k|                    inp_8x16b_2 =
  890|   266k|                        _mm_loadu_si128((__m128i *) (pi2_interp_buff_temp + strt_indx + 3));
  891|   266k|                    inp_8x16b_3 = _mm_loadu_si128(
  892|   266k|                        (__m128i *) (pi2_interp_buff_temp + strt_indx + strt_indx_h + 3));
  893|   266k|                    pi2_interp_buff_temp += i4_refarray_wd;
  894|       |
  895|   266k|                    inp_8x16b_r0_0 = _mm_shuffle_epi8(inp_8x16b_0, x_ref_pos_luma_mask_r0_0);
  896|   266k|                    inp_8x16b_r0_1 = _mm_shuffle_epi8(inp_8x16b_1, x_ref_pos_luma_mask_r0_1);
  897|   266k|                    inp_8x16b_r1_0 = _mm_shuffle_epi8(inp_8x16b_0, x_ref_pos_luma_mask_r1_0);
  898|   266k|                    inp_8x16b_r1_1 = _mm_shuffle_epi8(inp_8x16b_1, x_ref_pos_luma_mask_r1_1);
  899|       |
  900|   266k|                    inp_8x16b_r2_0 = _mm_shuffle_epi8(inp_8x16b_0, x_ref_pos_luma_mask_r2_0);
  901|   266k|                    inp_8x16b_r2_1 = _mm_shuffle_epi8(inp_8x16b_1, x_ref_pos_luma_mask_r2_1);
  902|   266k|                    inp_8x16b_r3_0 = _mm_shuffle_epi8(inp_8x16b_2, x_ref_pos_luma_mask_r3_0);
  903|   266k|                    inp_8x16b_r3_1 = _mm_shuffle_epi8(inp_8x16b_3, x_ref_pos_luma_mask_r3_1);
  904|       |
  905|   266k|                    inp_8x16b_r01_l_0 = _mm_unpacklo_epi16(inp_8x16b_r0_0, inp_8x16b_r1_0);
  906|   266k|                    inp_8x16b_r23_l_0 = _mm_unpacklo_epi16(inp_8x16b_r2_0, inp_8x16b_r3_0);
  907|   266k|                    inp_8x16b_r01_l_1 = _mm_unpackhi_epi16(inp_8x16b_r0_0, inp_8x16b_r1_0);
  908|   266k|                    inp_8x16b_r23_l_1 = _mm_unpackhi_epi16(inp_8x16b_r2_0, inp_8x16b_r3_0);
  909|       |
  910|   266k|                    inp_8x16b_r01_h_0 = _mm_unpacklo_epi16(inp_8x16b_r0_1, inp_8x16b_r1_1);
  911|   266k|                    inp_8x16b_r23_h_0 = _mm_unpacklo_epi16(inp_8x16b_r2_1, inp_8x16b_r3_1);
  912|   266k|                    inp_8x16b_r01_h_1 = _mm_unpackhi_epi16(inp_8x16b_r0_1, inp_8x16b_r1_1);
  913|   266k|                    inp_8x16b_r23_h_1 = _mm_unpackhi_epi16(inp_8x16b_r2_1, inp_8x16b_r3_1);
  914|       |
  915|   266k|                    out_res_4x32b_r01_l_0 =
  916|   266k|                        _mm_madd_epi16(inp_8x16b_r01_l_0, ip_filt_8x16b_r01_l_0);
  917|   266k|                    out_res_4x32b_r01_l_1 =
  918|   266k|                        _mm_madd_epi16(inp_8x16b_r01_l_1, ip_filt_8x16b_r01_l_1);
  919|   266k|                    out_res_4x32b_r23_l_0 =
  920|   266k|                        _mm_madd_epi16(inp_8x16b_r23_l_0, ip_filt_8x16b_r23_l_0);
  921|   266k|                    out_res_4x32b_r23_l_1 =
  922|   266k|                        _mm_madd_epi16(inp_8x16b_r23_l_1, ip_filt_8x16b_r23_l_1);
  923|       |
  924|   266k|                    out_res_4x32b_r01_h_0 =
  925|   266k|                        _mm_madd_epi16(inp_8x16b_r01_h_0, ip_filt_8x16b_r01_h_0);
  926|   266k|                    out_res_4x32b_r01_h_1 =
  927|   266k|                        _mm_madd_epi16(inp_8x16b_r01_h_1, ip_filt_8x16b_r01_h_1);
  928|   266k|                    out_res_4x32b_r23_h_0 =
  929|   266k|                        _mm_madd_epi16(inp_8x16b_r23_h_0, ip_filt_8x16b_r23_h_0);
  930|   266k|                    out_res_4x32b_r23_h_1 =
  931|   266k|                        _mm_madd_epi16(inp_8x16b_r23_h_1, ip_filt_8x16b_r23_h_1);
  932|       |
  933|   266k|                    out_res_4x32b_l_0 = _mm_add_epi32(out_res_4x32b_r01_l_0, out_res_4x32b_r23_l_0);
  934|   266k|                    out_res_4x32b_l_1 = _mm_add_epi32(out_res_4x32b_r01_l_1, out_res_4x32b_r23_l_1);
  935|   266k|                    out_res_4x32b_h_0 = _mm_add_epi32(out_res_4x32b_r01_h_0, out_res_4x32b_r23_h_0);
  936|   266k|                    out_res_4x32b_h_1 = _mm_add_epi32(out_res_4x32b_r01_h_1, out_res_4x32b_r23_h_1);
  937|       |
  938|   266k|                    out_res_4x32b_l_0 =
  939|   266k|                        _mm_srai_epi32(_mm_add_epi32(out_res_4x32b_l_0, const_512), 10);
  940|   266k|                    out_res_4x32b_l_1 =
  941|   266k|                        _mm_srai_epi32(_mm_add_epi32(out_res_4x32b_l_1, const_512), 10);
  942|   266k|                    out_res_4x32b_h_0 =
  943|   266k|                        _mm_srai_epi32(_mm_add_epi32(out_res_4x32b_h_0, const_512), 10);
  944|   266k|                    out_res_4x32b_h_1 =
  945|   266k|                        _mm_srai_epi32(_mm_add_epi32(out_res_4x32b_h_1, const_512), 10);
  946|       |
  947|   266k|                    out_res_8x16b_l = _mm_packs_epi32(out_res_4x32b_l_0, out_res_4x32b_l_1);
  948|   266k|                    out_res_8x16b_h = _mm_packs_epi32(out_res_4x32b_h_0, out_res_4x32b_h_1);
  949|       |
  950|   266k|                    out_res_16x8b = _mm_packus_epi16(out_res_8x16b_l, out_res_8x16b_h);
  951|   266k|                    _mm_storeu_si128((__m128i *) (pu1_out + (i4_y * i4_out_stride)), out_res_16x8b);
  952|   266k|                }
  953|  16.6k|            }
  954|  16.6k|        }
  955|  16.6k|    }
  956|  33.3k|    else
  957|  33.3k|    {
  958|  33.3k|        WORD16 *pi2_interp_buff_temp;
  959|  33.3k|        pi2_interp_buff_temp = (WORD16 *) pi4_interp_buff;
  960|       |
  961|  33.3k|        {
  962|  33.3k|            __m128i inp_8x16b_r0, inp_8x16b_r01_0, phs_mask_16x8b_r0, phs_mask_16x8b_r01_0,
  963|  33.3k|                out_res_8x16b_r01_0;
  964|  33.3k|            __m128i inp_8x16b_r1, phs_mask_16x8b_r1, out_res_8x16b_r01_1;
  965|  33.3k|            __m128i inp_8x16b_r01_1, phs_mask_16x8b_r01_1;
  966|       |
  967|   300k|            for(i4_y = 0; i4_y < (i4_temp_array_ht); i4_y++)
  ------------------
  |  Branch (967:27): [True: 266k, False: 33.3k]
  ------------------
  968|   266k|            {
  969|   266k|                arr_y_ref_pos_luma[i4_y] = (WORD8) ps_y_pos_phase[i4_y + i4_frm_mb_y].i2_ref_pos;
  970|   266k|                arr_phase_luma[i4_y] = (WORD8) ps_y_pos_phase[i4_y + i4_frm_mb_y].i2_phase;
  971|   266k|            }
  972|  33.3k|            pi4_y_ref_pos_luma = arr_y_ref_pos_luma;
  973|  33.3k|            pi4_phase_luma = arr_phase_luma;
  974|       |
  975|   300k|            for(i4_y = 0; i4_y < (i4_temp_array_ht); i4_y++)
  ------------------
  |  Branch (975:27): [True: 266k, False: 33.3k]
  ------------------
  976|   266k|            {
  977|   266k|                pu1_refarray_temp =
  978|   266k|                    pu1_refarray + (pi4_y_ref_pos_luma[i4_y] * i4_refarray_wd) + (i4_x_min - 1);
  979|   266k|                inp_8x16b_r0 = _mm_loadu_si128((__m128i *) (pu1_refarray_temp));
  980|   266k|                inp_8x16b_r1 = _mm_loadu_si128((__m128i *) (pu1_refarray_temp + i4_refarray_wd));
  981|       |
  982|   266k|                inp_8x16b_r01_0 = _mm_unpacklo_epi8(inp_8x16b_r0, inp_8x16b_r1);
  983|   266k|                inp_8x16b_r01_1 = _mm_unpackhi_epi8(inp_8x16b_r0, inp_8x16b_r1);
  984|       |
  985|   266k|                phs_mask_16x8b_r0 = _mm_set1_epi8(g_au1_interp_filter_chroma[pi4_phase_luma[i4_y]]);
  986|   266k|                phs_mask_16x8b_r1 =
  987|   266k|                    _mm_set1_epi8(g_au1_interp_filter_chroma[pi4_phase_luma[i4_y] + 16]);
  988|       |
  989|   266k|                phs_mask_16x8b_r01_0 = _mm_unpacklo_epi8(phs_mask_16x8b_r0, phs_mask_16x8b_r1);
  990|   266k|                phs_mask_16x8b_r01_1 = _mm_unpackhi_epi8(phs_mask_16x8b_r0, phs_mask_16x8b_r1);
  991|       |
  992|   266k|                out_res_8x16b_r01_0 = _mm_maddubs_epi16(inp_8x16b_r01_0, phs_mask_16x8b_r01_0);
  993|   266k|                out_res_8x16b_r01_1 = _mm_maddubs_epi16(inp_8x16b_r01_1, phs_mask_16x8b_r01_1);
  994|       |
  995|   266k|                _mm_storeu_si128(
  996|   266k|                    (__m128i *) (pi2_interp_buff_temp + (i4_y * i4_refarray_wd) + (i4_x_min - 1)),
  997|   266k|                    out_res_8x16b_r01_0);
  998|   266k|                _mm_storeu_si128((__m128i *) (pi2_interp_buff_temp + (i4_y * i4_refarray_wd) +
  999|   266k|                                              (i4_x_min - 1) + 8),
 1000|   266k|                                 out_res_8x16b_r01_1);
 1001|   266k|            }
 1002|  33.3k|        }
 1003|       |
 1004|  33.3k|        {
 1005|  33.3k|            WORD32 strt_indx = 10;
 1006|  33.3k|            __m128i inp_8x16b_0, inp_8x16b_r0_0;
 1007|  33.3k|            __m128i phs_mask_16x8b_0;
 1008|  33.3k|            __m128i x_ref_pos_luma_mask_r0_0, x_ref_pos_luma_mask_r1_0;
 1009|  33.3k|            __m128i ip_filt_16x8b_r0, ip_filt_8x16b_r0_0, ip_filt_8x16b_r01_l_0;
 1010|  33.3k|            __m128i ip_filt_16x8b_r1, ip_filt_8x16b_r1_0, ip_filt_8x16b_r01_l_1;
 1011|  33.3k|            __m128i inp_8x16b_r1_0, inp_8x16b_r01_l_0, out_res_4x32b_r01_l_0;
 1012|  33.3k|            __m128i inp_8x16b_r01_l_1, out_res_4x32b_r01_l_1;
 1013|       |
 1014|  33.3k|            __m128i out_res_4x32b_l_0;
 1015|  33.3k|            __m128i out_res_4x32b_l_1;
 1016|  33.3k|            __m128i out_res_8x16b_l;
 1017|  33.3k|            __m128i out_16x8b_r1;
 1018|  33.3k|            __m128i chroma_mask;
 1019|  33.3k|            __m128i const_512 = _mm_set1_epi32(512);
 1020|       |
 1021|  33.3k|            WORD32 i4_x2 = 0;
 1022|  33.3k|            __m128i twos = _mm_set1_epi8(2);
 1023|  33.3k|            strt_indx = ps_x_pos_phase[0 + i4_frm_mb_x].i2_ref_pos;
 1024|   300k|            for(i4_x = 0; i4_x < i4_mb_wd; i4_x++)
  ------------------
  |  Branch (1024:27): [True: 266k, False: 33.3k]
  ------------------
 1025|   266k|            {
 1026|   266k|                arr_x_ref_pos_luma[i4_x] = (WORD8) ps_x_pos_phase[i4_x + i4_frm_mb_x].i2_ref_pos;
 1027|   266k|                arr_phase_luma[i4_x] = (WORD8) ps_x_pos_phase[i4_x + i4_frm_mb_x].i2_phase;
 1028|   266k|                arr_x_ref_pos_luma[i4_x] = arr_x_ref_pos_luma[i4_x] - strt_indx;
 1029|   266k|                i4_x2 = i4_x << 1;
 1030|   266k|                arr_x_ref_pos_luma_low[i4_x2] = (arr_x_ref_pos_luma[i4_x]) << 1;
 1031|   266k|                arr_x_ref_pos_luma_low[i4_x2 + 1] = arr_x_ref_pos_luma_low[i4_x2] + 1;
 1032|   266k|            }
 1033|       |
 1034|  33.3k|            pi4_x_ref_pos_luma_low = arr_x_ref_pos_luma_low;
 1035|  33.3k|            pi4_phase_luma = arr_phase_luma;
 1036|  33.3k|            phs_mask_16x8b_0 = _mm_loadu_si128((__m128i *) (pi4_phase_luma));
 1037|  33.3k|            x_ref_pos_luma_mask_r0_0 = _mm_loadu_si128((__m128i *) (pi4_x_ref_pos_luma_low));
 1038|  33.3k|            x_ref_pos_luma_mask_r1_0 = _mm_add_epi8(x_ref_pos_luma_mask_r0_0, twos);
 1039|       |
 1040|  33.3k|            ip_filt_16x8b_r0 = _mm_loadu_si128((__m128i *) (g_au1_interp_filter_chroma));
 1041|  33.3k|            ip_filt_16x8b_r1 = _mm_loadu_si128((__m128i *) (g_au1_interp_filter_chroma + 16));
 1042|       |
 1043|  33.3k|            ip_filt_8x16b_r0_0 =
 1044|  33.3k|                _mm_cvtepi8_epi16(_mm_shuffle_epi8(ip_filt_16x8b_r0, phs_mask_16x8b_0));
 1045|  33.3k|            ip_filt_8x16b_r1_0 =
 1046|  33.3k|                _mm_cvtepi8_epi16(_mm_shuffle_epi8(ip_filt_16x8b_r1, phs_mask_16x8b_0));
 1047|       |
 1048|  33.3k|            ip_filt_8x16b_r01_l_0 = _mm_unpacklo_epi16(ip_filt_8x16b_r0_0, ip_filt_8x16b_r1_0);
 1049|  33.3k|            ip_filt_8x16b_r01_l_1 = _mm_unpackhi_epi16(ip_filt_8x16b_r0_0, ip_filt_8x16b_r1_0);
 1050|       |
 1051|   300k|            for(i4_y = 0; i4_y < i4_temp_array_ht; i4_y++)
  ------------------
  |  Branch (1051:27): [True: 266k, False: 33.3k]
  ------------------
 1052|   266k|            {
 1053|   266k|                inp_8x16b_0 = _mm_loadu_si128((__m128i *) (pi2_interp_buff_temp + strt_indx));
 1054|   266k|                pi2_interp_buff_temp += i4_refarray_wd;
 1055|       |
 1056|   266k|                inp_8x16b_r0_0 = _mm_shuffle_epi8(inp_8x16b_0, x_ref_pos_luma_mask_r0_0);
 1057|   266k|                inp_8x16b_r1_0 = _mm_shuffle_epi8(inp_8x16b_0, x_ref_pos_luma_mask_r1_0);
 1058|       |
 1059|   266k|                inp_8x16b_r01_l_0 = _mm_unpacklo_epi16(inp_8x16b_r0_0, inp_8x16b_r1_0);
 1060|   266k|                inp_8x16b_r01_l_1 = _mm_unpackhi_epi16(inp_8x16b_r0_0, inp_8x16b_r1_0);
 1061|       |
 1062|   266k|                out_res_4x32b_r01_l_0 = _mm_madd_epi16(inp_8x16b_r01_l_0, ip_filt_8x16b_r01_l_0);
 1063|   266k|                out_res_4x32b_r01_l_1 = _mm_madd_epi16(inp_8x16b_r01_l_1, ip_filt_8x16b_r01_l_1);
 1064|       |
 1065|   266k|                out_res_4x32b_l_0 =
 1066|   266k|                    _mm_srai_epi32(_mm_add_epi32(out_res_4x32b_r01_l_0, const_512), 10);
 1067|   266k|                out_res_4x32b_l_1 =
 1068|   266k|                    _mm_srai_epi32(_mm_add_epi32(out_res_4x32b_r01_l_1, const_512), 10);
 1069|       |
 1070|   266k|                out_res_8x16b_l = _mm_packs_epi32(out_res_4x32b_l_0, out_res_4x32b_l_1);
 1071|       |
 1072|   266k|                chroma_mask = _mm_set1_epi16(0xFF00);
 1073|   266k|                out_16x8b_r1 = _mm_loadu_si128((__m128i *) (pu1_out + (i4_y * i4_out_stride)));
 1074|   266k|                out_16x8b_r1 = _mm_and_si128(out_16x8b_r1, chroma_mask);
 1075|   266k|                out_16x8b_r1 = _mm_add_epi8(out_res_8x16b_l, out_16x8b_r1);
 1076|   266k|                _mm_storeu_si128((__m128i *) (pu1_out + (i4_y * i4_out_stride)), out_16x8b_r1);
 1077|   266k|            }
 1078|  33.3k|        }
 1079|  33.3k|    }
 1080|  50.0k|    return;
 1081|  50.0k|} /* End of Interpolation Function */
isvcd_vert_interpol_chroma_dyadic_1_sse42:
 1112|  39.0k|{
 1113|  39.0k|    WORD8 i4_coeff_0, i4_coeff_1, i4_coeff_2, i4_coeff_3;
 1114|  39.0k|    WORD32 i4_filt_stride, i4_src_stride;
 1115|  39.0k|    UWORD8 *pu1_inp;
 1116|  39.0k|    WORD16 *pi2_tmp;
 1117|  39.0k|    __m128i i4_samp_16x8b_0, i4_samp_16x8b_1, i4_samp_16x8b_2, i4_samp_16x8b_3, i4_samp_16x8b_4,
 1118|  39.0k|        i4_samp_16x8b_5;
 1119|  39.0k|    __m128i i4_res_8x16b_r0, i4_res_8x16b_r1, i4_res_8x16b_r2, i4_res_8x16b_r3, i4_res_8x16b_r4,
 1120|  39.0k|        i4_res_8x16b_r5, i4_res_8x16b_r6, i4_res_8x16b_r7;
 1121|  39.0k|    __m128i i4_res_8x16b_r7_temp;
 1122|  39.0k|    __m128i i4_c0_c1_16x8b, i4_c2_c3_16x8b;
 1123|       |
 1124|  39.0k|    i4_coeff_0 = (WORD8) (8 - i4_phase_0);
 1125|  39.0k|    i4_coeff_1 = (WORD8) (i4_phase_0);
 1126|  39.0k|    i4_coeff_2 = (WORD8) (8 - i4_phase_1);
 1127|  39.0k|    i4_coeff_3 = (WORD8) (i4_phase_1);
 1128|       |
 1129|  39.0k|    i4_c0_c1_16x8b =
 1130|  39.0k|        _mm_set_epi8(i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0,
 1131|  39.0k|                     i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0,
 1132|  39.0k|                     i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0);
 1133|  39.0k|    i4_c2_c3_16x8b =
 1134|  39.0k|        _mm_set_epi8(i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2,
 1135|  39.0k|                     i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2,
 1136|  39.0k|                     i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2);
 1137|       |
 1138|  39.0k|    pu1_inp = pu1_inp_buf;
 1139|  39.0k|    pi2_tmp = pi2_tmp_filt_buf;
 1140|  39.0k|    i4_filt_stride = 6;
 1141|  39.0k|    i4_src_stride = DYADIC_REF_W_C;
  ------------------
  |  |   58|  39.0k|#define DYADIC_REF_W_C 10
  ------------------
 1142|       |
 1143|  39.0k|    i4_samp_16x8b_0 = _mm_loadl_epi64((__m128i *) (pu1_inp));
 1144|  39.0k|    i4_samp_16x8b_1 = _mm_loadl_epi64((__m128i *) (pu1_inp + i4_src_stride));
 1145|  39.0k|    i4_samp_16x8b_2 = _mm_loadl_epi64((__m128i *) (pu1_inp + (i4_src_stride << 1)));
 1146|  39.0k|    i4_samp_16x8b_3 = _mm_loadl_epi64((__m128i *) (pu1_inp + (i4_src_stride << 1) + i4_src_stride));
 1147|  39.0k|    i4_samp_16x8b_4 = _mm_loadl_epi64((__m128i *) (pu1_inp + (i4_src_stride << 2)));
 1148|  39.0k|    i4_samp_16x8b_5 = _mm_loadl_epi64((__m128i *) (pu1_inp + (i4_src_stride << 2) + i4_src_stride));
 1149|       |
 1150|  39.0k|    i4_samp_16x8b_0 = _mm_unpacklo_epi8(i4_samp_16x8b_0, i4_samp_16x8b_1);
 1151|  39.0k|    i4_res_8x16b_r0 = _mm_maddubs_epi16(i4_samp_16x8b_0, i4_c0_c1_16x8b);
 1152|  39.0k|    _mm_storeu_si128((__m128i *) (pi2_tmp), i4_res_8x16b_r0);
 1153|       |
 1154|  39.0k|    i4_samp_16x8b_1 = _mm_unpacklo_epi8(i4_samp_16x8b_1, i4_samp_16x8b_2);
 1155|  39.0k|    i4_res_8x16b_r1 = _mm_maddubs_epi16(i4_samp_16x8b_1, i4_c2_c3_16x8b);
 1156|  39.0k|    _mm_storeu_si128((__m128i *) (pi2_tmp + i4_filt_stride), i4_res_8x16b_r1);
 1157|       |
 1158|  39.0k|    i4_res_8x16b_r2 = _mm_maddubs_epi16(i4_samp_16x8b_1, i4_c0_c1_16x8b);
 1159|  39.0k|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 1)), i4_res_8x16b_r2);
 1160|       |
 1161|  39.0k|    i4_samp_16x8b_2 = _mm_unpacklo_epi8(i4_samp_16x8b_2, i4_samp_16x8b_3);
 1162|  39.0k|    i4_res_8x16b_r3 = _mm_maddubs_epi16(i4_samp_16x8b_2, i4_c2_c3_16x8b);
 1163|  39.0k|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 1) + i4_filt_stride),
 1164|  39.0k|                     i4_res_8x16b_r3);
 1165|       |
 1166|  39.0k|    i4_res_8x16b_r4 = _mm_maddubs_epi16(i4_samp_16x8b_2, i4_c0_c1_16x8b);
 1167|  39.0k|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 2)), i4_res_8x16b_r4);
 1168|       |
 1169|  39.0k|    i4_samp_16x8b_3 = _mm_unpacklo_epi8(i4_samp_16x8b_3, i4_samp_16x8b_4);
 1170|  39.0k|    i4_res_8x16b_r5 = _mm_maddubs_epi16(i4_samp_16x8b_3, i4_c2_c3_16x8b);
 1171|  39.0k|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 2) + i4_filt_stride),
 1172|  39.0k|                     i4_res_8x16b_r5);
 1173|       |
 1174|  39.0k|    i4_res_8x16b_r6 = _mm_maddubs_epi16(i4_samp_16x8b_3, i4_c0_c1_16x8b);
 1175|  39.0k|    _mm_storel_epi64((__m128i *) (pi2_tmp + (i4_filt_stride << 2) + (i4_filt_stride << 1)),
 1176|  39.0k|                     i4_res_8x16b_r6);
 1177|       |
 1178|  39.0k|    i4_res_8x16b_r6 = _mm_shuffle_epi32(i4_res_8x16b_r6, 78);
 1179|       |
 1180|  39.0k|    i4_samp_16x8b_4 = _mm_unpacklo_epi8(i4_samp_16x8b_4, i4_samp_16x8b_5);
 1181|       |
 1182|  39.0k|    i4_res_8x16b_r7 = _mm_maddubs_epi16(i4_samp_16x8b_4, i4_c2_c3_16x8b);
 1183|       |
 1184|  39.0k|    i4_res_8x16b_r7 = _mm_shuffle_epi32(i4_res_8x16b_r7, 147);
 1185|       |
 1186|  39.0k|    i4_res_8x16b_r7_temp = _mm_blend_epi16(i4_res_8x16b_r6, i4_res_8x16b_r7, 252);
 1187|       |
 1188|  39.0k|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 2) + (i4_filt_stride << 1) + 4),
 1189|  39.0k|                     i4_res_8x16b_r7_temp);
 1190|  39.0k|}
isvcd_vert_interpol_chroma_dyadic_2_sse42:
 1223|    848|{
 1224|    848|    WORD8 i4_coeff_0, i4_coeff_1, i4_coeff_2, i4_coeff_3;
 1225|    848|    WORD32 i4_filt_stride, i4_src_stride;
 1226|    848|    UWORD8 *pu1_inp;
 1227|    848|    WORD16 *pi2_tmp;
 1228|    848|    __m128i i4_samp_16x8b_0, i4_samp_16x8b_1, i4_samp_16x8b_2, i4_samp_16x8b_3, i4_samp_16x8b_4;
 1229|    848|    __m128i i4_res_8x16b_r0, i4_res_8x16b_r1, i4_res_8x16b_r2, i4_res_8x16b_r3, i4_res_8x16b_r4,
 1230|    848|        i4_res_8x16b_r5, i4_res_8x16b_r6, i4_res_8x16b_r7;
 1231|    848|    __m128i i4_res_8x16b_r7_temp, i4_c0_c1_16x8b, i4_c2_c3_16x8b;
 1232|    848|    i4_coeff_0 = (WORD8) (8 - i4_phase_0);
 1233|    848|    i4_coeff_1 = (WORD8) (i4_phase_0);
 1234|    848|    i4_coeff_2 = (WORD8) (8 - i4_phase_1);
 1235|    848|    i4_coeff_3 = (WORD8) (i4_phase_1);
 1236|       |
 1237|    848|    i4_c0_c1_16x8b =
 1238|    848|        _mm_set_epi8(i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0,
 1239|    848|                     i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0,
 1240|    848|                     i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0);
 1241|    848|    i4_c2_c3_16x8b =
 1242|    848|        _mm_set_epi8(i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2,
 1243|    848|                     i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2,
 1244|    848|                     i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2);
 1245|       |
 1246|    848|    pi2_tmp = pi2_tmp_filt_buf;
 1247|    848|    i4_filt_stride = 6;
 1248|    848|    i4_src_stride = DYADIC_REF_W_C;
  ------------------
  |  |   58|    848|#define DYADIC_REF_W_C 10
  ------------------
 1249|    848|    pu1_inp = pu1_inp_buf + i4_src_stride;
 1250|       |
 1251|    848|    i4_samp_16x8b_0 = _mm_loadu_si128((__m128i *) (pu1_inp));
 1252|    848|    i4_samp_16x8b_1 = _mm_loadu_si128((__m128i *) (pu1_inp + i4_src_stride));
 1253|    848|    i4_samp_16x8b_2 = _mm_loadu_si128((__m128i *) (pu1_inp + (i4_src_stride << 1)));
 1254|    848|    i4_samp_16x8b_3 = _mm_loadu_si128((__m128i *) (pu1_inp + (i4_src_stride << 1) + i4_src_stride));
 1255|    848|    i4_samp_16x8b_4 = _mm_loadu_si128((__m128i *) (pu1_inp + (i4_src_stride << 2)));
 1256|       |
 1257|    848|    i4_samp_16x8b_0 = _mm_unpacklo_epi8(i4_samp_16x8b_0, i4_samp_16x8b_1);
 1258|    848|    i4_res_8x16b_r0 = _mm_maddubs_epi16(i4_samp_16x8b_0, i4_c0_c1_16x8b);
 1259|    848|    _mm_storeu_si128((__m128i *) (pi2_tmp), i4_res_8x16b_r0);
 1260|       |
 1261|    848|    i4_res_8x16b_r1 = _mm_maddubs_epi16(i4_samp_16x8b_0, i4_c2_c3_16x8b);
 1262|    848|    _mm_storeu_si128((__m128i *) (pi2_tmp + i4_filt_stride), i4_res_8x16b_r1);
 1263|       |
 1264|    848|    i4_samp_16x8b_1 = _mm_unpacklo_epi8(i4_samp_16x8b_1, i4_samp_16x8b_2);
 1265|    848|    i4_res_8x16b_r2 = _mm_maddubs_epi16(i4_samp_16x8b_1, i4_c0_c1_16x8b);
 1266|    848|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 1)), i4_res_8x16b_r2);
 1267|       |
 1268|    848|    i4_res_8x16b_r3 = _mm_maddubs_epi16(i4_samp_16x8b_1, i4_c2_c3_16x8b);
 1269|    848|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 1) + i4_filt_stride),
 1270|    848|                     i4_res_8x16b_r3);
 1271|       |
 1272|    848|    i4_samp_16x8b_2 = _mm_unpacklo_epi8(i4_samp_16x8b_2, i4_samp_16x8b_3);
 1273|    848|    i4_res_8x16b_r4 = _mm_maddubs_epi16(i4_samp_16x8b_2, i4_c0_c1_16x8b);
 1274|    848|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 2)), i4_res_8x16b_r4);
 1275|       |
 1276|    848|    i4_res_8x16b_r5 = _mm_maddubs_epi16(i4_samp_16x8b_2, i4_c2_c3_16x8b);
 1277|    848|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 2) + i4_filt_stride),
 1278|    848|                     i4_res_8x16b_r5);
 1279|       |
 1280|    848|    i4_samp_16x8b_3 = _mm_unpacklo_epi8(i4_samp_16x8b_3, i4_samp_16x8b_4);
 1281|    848|    i4_res_8x16b_r6 = _mm_maddubs_epi16(i4_samp_16x8b_3, i4_c0_c1_16x8b);
 1282|    848|    _mm_storel_epi64((__m128i *) (pi2_tmp + (i4_filt_stride << 2) + (i4_filt_stride << 1)),
 1283|    848|                     i4_res_8x16b_r6);
 1284|       |
 1285|    848|    i4_res_8x16b_r7 = _mm_maddubs_epi16(i4_samp_16x8b_3, i4_c2_c3_16x8b);
 1286|    848|    i4_res_8x16b_r6 = _mm_shuffle_epi32(i4_res_8x16b_r6, 78);
 1287|    848|    i4_res_8x16b_r7 = _mm_shuffle_epi32(i4_res_8x16b_r7, 147);
 1288|    848|    i4_res_8x16b_r7_temp = _mm_blend_epi16(i4_res_8x16b_r6, i4_res_8x16b_r7, 252);
 1289|       |
 1290|    848|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 2) + (i4_filt_stride << 1) + 4),
 1291|    848|                     i4_res_8x16b_r7_temp);
 1292|    848|}
isvcd_vert_interpol_chroma_dyadic_3_sse42:
 1324|  1.56k|{
 1325|  1.56k|    WORD8 i4_coeff_0, i4_coeff_1, i4_coeff_2, i4_coeff_3;
 1326|  1.56k|    WORD32 i4_filt_stride, i4_src_stride;
 1327|  1.56k|    UWORD8 *pu1_inp;
 1328|  1.56k|    WORD16 *pi2_tmp;
 1329|  1.56k|    __m128i i4_samp_16x8b_0, i4_samp_16x8b_1, i4_samp_16x8b_2, i4_samp_16x8b_3, i4_samp_16x8b_4;
 1330|  1.56k|    __m128i i4_res_8x16b_r0, i4_res_8x16b_r1, i4_res_8x16b_r2, i4_res_8x16b_r3, i4_res_8x16b_r4,
 1331|  1.56k|        i4_res_8x16b_r5, i4_res_8x16b_r6, i4_res_8x16b_r7;
 1332|  1.56k|    __m128i i4_res_8x16b_r7_temp, i4_c0_c1_16x8b, i4_c2_c3_16x8b;
 1333|  1.56k|    i4_coeff_0 = (WORD8) (8 - i4_phase_0);
 1334|  1.56k|    i4_coeff_1 = (WORD8) (i4_phase_0);
 1335|  1.56k|    i4_coeff_2 = (WORD8) (8 - i4_phase_1);
 1336|  1.56k|    i4_coeff_3 = (WORD8) (i4_phase_1);
 1337|       |
 1338|  1.56k|    i4_c0_c1_16x8b =
 1339|  1.56k|        _mm_set_epi8(i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0,
 1340|  1.56k|                     i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0,
 1341|  1.56k|                     i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0);
 1342|  1.56k|    i4_c2_c3_16x8b =
 1343|  1.56k|        _mm_set_epi8(i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2,
 1344|  1.56k|                     i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2,
 1345|  1.56k|                     i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2);
 1346|       |
 1347|  1.56k|    pi2_tmp = pi2_tmp_filt_buf;
 1348|  1.56k|    i4_filt_stride = 6;
 1349|  1.56k|    i4_src_stride = DYADIC_REF_W_C;
  ------------------
  |  |   58|  1.56k|#define DYADIC_REF_W_C 10
  ------------------
 1350|  1.56k|    pu1_inp = pu1_inp_buf;
 1351|       |
 1352|  1.56k|    i4_samp_16x8b_0 = _mm_loadu_si128((__m128i *) (pu1_inp));
 1353|  1.56k|    i4_samp_16x8b_1 = _mm_loadu_si128((__m128i *) (pu1_inp + i4_src_stride));
 1354|  1.56k|    i4_samp_16x8b_2 = _mm_loadu_si128((__m128i *) (pu1_inp + (i4_src_stride << 1)));
 1355|  1.56k|    i4_samp_16x8b_3 = _mm_loadu_si128((__m128i *) (pu1_inp + (i4_src_stride << 1) + i4_src_stride));
 1356|  1.56k|    i4_samp_16x8b_4 = _mm_loadu_si128((__m128i *) (pu1_inp + (i4_src_stride << 2)));
 1357|       |
 1358|  1.56k|    i4_samp_16x8b_0 = _mm_unpacklo_epi8(i4_samp_16x8b_0, i4_samp_16x8b_1);
 1359|  1.56k|    i4_res_8x16b_r0 = _mm_maddubs_epi16(i4_samp_16x8b_0, i4_c0_c1_16x8b);
 1360|  1.56k|    _mm_storeu_si128((__m128i *) (pi2_tmp), i4_res_8x16b_r0);
 1361|       |
 1362|  1.56k|    i4_res_8x16b_r1 = _mm_maddubs_epi16(i4_samp_16x8b_0, i4_c2_c3_16x8b);
 1363|  1.56k|    _mm_storeu_si128((__m128i *) (pi2_tmp + i4_filt_stride), i4_res_8x16b_r1);
 1364|       |
 1365|  1.56k|    i4_samp_16x8b_1 = _mm_unpacklo_epi8(i4_samp_16x8b_1, i4_samp_16x8b_2);
 1366|  1.56k|    i4_res_8x16b_r2 = _mm_maddubs_epi16(i4_samp_16x8b_1, i4_c0_c1_16x8b);
 1367|  1.56k|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 1)), i4_res_8x16b_r2);
 1368|       |
 1369|  1.56k|    i4_res_8x16b_r3 = _mm_maddubs_epi16(i4_samp_16x8b_1, i4_c2_c3_16x8b);
 1370|  1.56k|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 1) + i4_filt_stride),
 1371|  1.56k|                     i4_res_8x16b_r3);
 1372|       |
 1373|  1.56k|    i4_samp_16x8b_2 = _mm_unpacklo_epi8(i4_samp_16x8b_2, i4_samp_16x8b_3);
 1374|  1.56k|    i4_res_8x16b_r4 = _mm_maddubs_epi16(i4_samp_16x8b_2, i4_c0_c1_16x8b);
 1375|  1.56k|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 2)), i4_res_8x16b_r4);
 1376|       |
 1377|  1.56k|    i4_res_8x16b_r5 = _mm_maddubs_epi16(i4_samp_16x8b_2, i4_c2_c3_16x8b);
 1378|  1.56k|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 2) + i4_filt_stride),
 1379|  1.56k|                     i4_res_8x16b_r5);
 1380|       |
 1381|  1.56k|    i4_samp_16x8b_3 = _mm_unpacklo_epi8(i4_samp_16x8b_3, i4_samp_16x8b_4);
 1382|  1.56k|    i4_res_8x16b_r6 = _mm_maddubs_epi16(i4_samp_16x8b_3, i4_c0_c1_16x8b);
 1383|  1.56k|    _mm_storel_epi64((__m128i *) (pi2_tmp + (i4_filt_stride << 2) + (i4_filt_stride << 1)),
 1384|  1.56k|                     i4_res_8x16b_r6);
 1385|       |
 1386|  1.56k|    i4_res_8x16b_r7 = _mm_maddubs_epi16(i4_samp_16x8b_3, i4_c2_c3_16x8b);
 1387|  1.56k|    i4_res_8x16b_r6 = _mm_shuffle_epi32(i4_res_8x16b_r6, 78);
 1388|  1.56k|    i4_res_8x16b_r7 = _mm_shuffle_epi32(i4_res_8x16b_r7, 147);
 1389|       |    i4_res_8x16b_r7_temp = _mm_blend_epi16(i4_res_8x16b_r6, i4_res_8x16b_r7, 252);
 1390|  1.56k|    _mm_storeu_si128((__m128i *) (pi2_tmp + (i4_filt_stride << 2) + (i4_filt_stride << 1) + 4),
 1391|  1.56k|                     i4_res_8x16b_r7_temp);
 1392|  1.56k|}
isvcd_horz_interpol_chroma_dyadic_1_sse42:
 1425|  26.0k|{
 1426|  26.0k|    WORD32 i4_coeff_0, i4_coeff_1, i4_coeff_2, i4_coeff_3;
 1427|  26.0k|    WORD32 i4_dst_stride, i4_dst_stride2, i4_dst_stride4;
 1428|  26.0k|    UWORD8 *pu1_out;
 1429|  26.0k|    WORD16 *pi2_tmp;
 1430|       |
 1431|  26.0k|    __m128i i4_samp_8x16b_r1_0, i4_samp_8x16b_r1_1, i4_samp_8x16b_r1_2;
 1432|  26.0k|    __m128i i4_samp_8x16b_r2_0, i4_samp_8x16b_r2_1, i4_samp_8x16b_r2_2;
 1433|  26.0k|    __m128i i4_samp_8x16b_r3_0, i4_samp_8x16b_r3_1, i4_samp_8x16b_r3_2;
 1434|  26.0k|    __m128i i4_samp_8x16b_r4_0, i4_samp_8x16b_r4_1, i4_samp_8x16b_r4_2;
 1435|  26.0k|    __m128i i4_samp_8x16b_r5_0, i4_samp_8x16b_r5_1, i4_samp_8x16b_r5_2;
 1436|  26.0k|    __m128i i4_samp_8x16b_r6_0, i4_samp_8x16b_r6_1, i4_samp_8x16b_r6_2;
 1437|  26.0k|    __m128i i4_samp_8x16b_r7_0, i4_samp_8x16b_r7_1, i4_samp_8x16b_r7_2;
 1438|  26.0k|    __m128i i4_samp_8x16b_r8_0, i4_samp_8x16b_r8_1, i4_samp_8x16b_r8_2;
 1439|       |
 1440|  26.0k|    __m128i i4_res_4x32b_r1_0, i4_res_4x32b_r1_1;
 1441|  26.0k|    __m128i i4_res_4x32b_r2_0, i4_res_4x32b_r2_1;
 1442|  26.0k|    __m128i i4_res_4x32b_r3_0, i4_res_4x32b_r3_1;
 1443|  26.0k|    __m128i i4_res_4x32b_r4_0, i4_res_4x32b_r4_1;
 1444|  26.0k|    __m128i i4_res_4x32b_r5_0, i4_res_4x32b_r5_1;
 1445|  26.0k|    __m128i i4_res_4x32b_r6_0, i4_res_4x32b_r6_1;
 1446|  26.0k|    __m128i i4_res_4x32b_r7_0, i4_res_4x32b_r7_1;
 1447|  26.0k|    __m128i i4_res_4x32b_r8_0, i4_res_4x32b_r8_1;
 1448|       |
 1449|  26.0k|    __m128i i4_res_final_8x16b_r1;
 1450|  26.0k|    __m128i i4_res_final_8x16b_r2;
 1451|  26.0k|    __m128i i4_res_final_8x16b_r3;
 1452|  26.0k|    __m128i i4_res_final_8x16b_r4;
 1453|  26.0k|    __m128i i4_res_final_8x16b_r5;
 1454|  26.0k|    __m128i i4_res_final_8x16b_r6;
 1455|  26.0k|    __m128i i4_res_final_8x16b_r7;
 1456|  26.0k|    __m128i i4_res_final_8x16b_r8;
 1457|       |
 1458|  26.0k|    __m128i out_16x8b_r1;
 1459|  26.0k|    __m128i out_16x8b_r2;
 1460|  26.0k|    __m128i out_16x8b_r3;
 1461|  26.0k|    __m128i out_16x8b_r4;
 1462|  26.0k|    __m128i out_16x8b_r5;
 1463|  26.0k|    __m128i out_16x8b_r6;
 1464|  26.0k|    __m128i out_16x8b_r7;
 1465|  26.0k|    __m128i out_16x8b_r8;
 1466|  26.0k|    __m128i i4_res_final_8x16b_r12_0, i4_res_final_8x16b_r12_1;
 1467|  26.0k|    __m128i i4_res_final_8x16b_r34_0, i4_res_final_8x16b_r34_1;
 1468|  26.0k|    __m128i i4_res_final_8x16b_r56_0, i4_res_final_8x16b_r56_1;
 1469|  26.0k|    __m128i i4_res_final_8x16b_r67_0, i4_res_final_8x16b_r67_1;
 1470|  26.0k|    __m128i chroma_mask, chroma_mask2;
 1471|  26.0k|    __m128i coeff_c0_c1_8x16b, coeff_c2_c3_8x16b, res_32;
 1472|       |
 1473|  26.0k|    i4_coeff_0 = 8 - i4_phase_0;
 1474|  26.0k|    i4_coeff_1 = i4_phase_0;
 1475|  26.0k|    i4_coeff_2 = 8 - i4_phase_1;
 1476|  26.0k|    i4_coeff_3 = i4_phase_1;
 1477|  26.0k|    coeff_c0_c1_8x16b = _mm_set_epi16(i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0, i4_coeff_1,
 1478|  26.0k|                                      i4_coeff_0, i4_coeff_1, i4_coeff_0);
 1479|  26.0k|    coeff_c2_c3_8x16b = _mm_set_epi16(i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2, i4_coeff_3,
 1480|  26.0k|                                      i4_coeff_2, i4_coeff_3, i4_coeff_2);
 1481|  26.0k|    res_32 = _mm_set1_epi32(32);
 1482|  26.0k|    pu1_out = pu1_out_buf;
 1483|  26.0k|    pi2_tmp = pi2_tmp_filt_buf;
 1484|  26.0k|    i4_dst_stride = i4_out_stride;
 1485|       |
 1486|  26.0k|    i4_dst_stride2 = i4_dst_stride << 1;
 1487|  26.0k|    i4_dst_stride4 = i4_dst_stride << 2;
 1488|       |
 1489|       |    /* Horizontal interpolation */
 1490|       |    /* x = 0, x_phase = phase_0 */
 1491|  26.0k|    i4_samp_8x16b_r1_0 = _mm_loadu_si128((__m128i *) pi2_tmp);         // a0 a1 a2 a3 a4 a5 a6 a7
 1492|  26.0k|    i4_samp_8x16b_r2_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 6));   // b0 b1 b2 b3 b4 b5 b6 b7
 1493|  26.0k|    i4_samp_8x16b_r3_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 12));  // b0 b1 b2 b3 b4 b5 b6 b7
 1494|  26.0k|    i4_samp_8x16b_r4_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 18));  // b0 b1 b2 b3 b4 b5 b6 b7
 1495|  26.0k|    i4_samp_8x16b_r5_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 24));  // b0 b1 b2 b3 b4 b5 b6 b7
 1496|  26.0k|    i4_samp_8x16b_r6_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 30));  // b0 b1 b2 b3 b4 b5 b6 b7
 1497|  26.0k|    i4_samp_8x16b_r7_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 36));  // b0 b1 b2 b3 b4 b5 b6 b7
 1498|  26.0k|    i4_samp_8x16b_r8_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 42));  // b0 b1 b2 b3 b4 b5 b6 b7
 1499|       |
 1500|  26.0k|    i4_samp_8x16b_r1_1 = _mm_srli_si128(i4_samp_8x16b_r1_0, 2);        // a1 a2 a3 a4 a5 a6 a7 0
 1501|  26.0k|    i4_samp_8x16b_r1_2 = _mm_srli_si128(i4_samp_8x16b_r1_0, 4);        // a2 a3 a4 a5 a6 a7 0 0
 1502|       |
 1503|  26.0k|    i4_samp_8x16b_r2_1 = _mm_srli_si128(i4_samp_8x16b_r2_0, 2);        // b1 b2 b3 b4 b5 b6 b7 0
 1504|  26.0k|    i4_samp_8x16b_r2_2 = _mm_srli_si128(i4_samp_8x16b_r2_0, 4);        // b2 b3 b4 b5 b6 b7 0 0
 1505|       |
 1506|  26.0k|    i4_samp_8x16b_r3_1 = _mm_srli_si128(i4_samp_8x16b_r3_0, 2);        // b1 b2 b3 b4 b5 b6 b7 0
 1507|  26.0k|    i4_samp_8x16b_r3_2 = _mm_srli_si128(i4_samp_8x16b_r3_0, 4);        // b2 b3 b4 b5 b6 b7 0 0
 1508|       |
 1509|  26.0k|    i4_samp_8x16b_r4_1 = _mm_srli_si128(i4_samp_8x16b_r4_0, 2);        // b1 b2 b3 b4 b5 b6 b7 0
 1510|  26.0k|    i4_samp_8x16b_r4_2 = _mm_srli_si128(i4_samp_8x16b_r4_0, 4);        // b2 b3 b4 b5 b6 b7 0 0
 1511|       |
 1512|  26.0k|    i4_samp_8x16b_r5_1 = _mm_srli_si128(i4_samp_8x16b_r5_0, 2);        // b1 b2 b3 b4 b5 b6 b7 0
 1513|  26.0k|    i4_samp_8x16b_r5_2 = _mm_srli_si128(i4_samp_8x16b_r5_0, 4);        // b2 b3 b4 b5 b6 b7 0 0
 1514|       |
 1515|  26.0k|    i4_samp_8x16b_r6_1 = _mm_srli_si128(i4_samp_8x16b_r6_0, 2);        // b1 b2 b3 b4 b5 b6 b7 0
 1516|  26.0k|    i4_samp_8x16b_r6_2 = _mm_srli_si128(i4_samp_8x16b_r6_0, 4);        // b2 b3 b4 b5 b6 b7 0 0
 1517|       |
 1518|  26.0k|    i4_samp_8x16b_r7_1 = _mm_srli_si128(i4_samp_8x16b_r7_0, 2);        // b1 b2 b3 b4 b5 b6 b7 0
 1519|  26.0k|    i4_samp_8x16b_r7_2 = _mm_srli_si128(i4_samp_8x16b_r7_0, 4);        // b2 b3 b4 b5 b6 b7 0 0
 1520|       |
 1521|  26.0k|    i4_samp_8x16b_r8_1 = _mm_srli_si128(i4_samp_8x16b_r8_0, 2);        // b1 b2 b3 b4 b5 b6 b7 0
 1522|  26.0k|    i4_samp_8x16b_r8_2 = _mm_srli_si128(i4_samp_8x16b_r8_0, 4);        // b2 b3 b4 b5 b6 b7 0 0
 1523|       |
 1524|  26.0k|    i4_samp_8x16b_r1_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r1_0,
 1525|  26.0k|                                            i4_samp_8x16b_r1_1);  // a0 a1  a1 a2  a2 a3  a3 a4
 1526|  26.0k|    i4_samp_8x16b_r2_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r2_0,
 1527|  26.0k|                                            i4_samp_8x16b_r2_1);  // b0 b1  b1 b2  b2 b3  b3 b4
 1528|  26.0k|    i4_samp_8x16b_r3_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r3_0, i4_samp_8x16b_r3_1);
 1529|  26.0k|    i4_samp_8x16b_r4_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r4_0, i4_samp_8x16b_r4_1);
 1530|  26.0k|    i4_samp_8x16b_r5_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r5_0, i4_samp_8x16b_r5_1);
 1531|  26.0k|    i4_samp_8x16b_r6_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r6_0, i4_samp_8x16b_r6_1);
 1532|  26.0k|    i4_samp_8x16b_r7_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r7_0, i4_samp_8x16b_r7_1);
 1533|  26.0k|    i4_samp_8x16b_r8_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r8_0, i4_samp_8x16b_r8_1);
 1534|       |
 1535|  26.0k|    i4_samp_8x16b_r1_1 = _mm_unpacklo_epi16(i4_samp_8x16b_r1_1,
 1536|  26.0k|                                            i4_samp_8x16b_r1_2);  // a1 a2  a2 a3  a3 a4  a4 a5
 1537|  26.0k|    i4_samp_8x16b_r2_1 = _mm_unpacklo_epi16(i4_samp_8x16b_r2_1,
 1538|  26.0k|                                            i4_samp_8x16b_r2_2);  // b1 b2  b2 b3  b3 b4  b4 b5
 1539|  26.0k|    i4_samp_8x16b_r3_1 = _mm_unpacklo_epi16(i4_samp_8x16b_r3_1, i4_samp_8x16b_r3_2);
 1540|  26.0k|    i4_samp_8x16b_r4_1 = _mm_unpacklo_epi16(i4_samp_8x16b_r4_1, i4_samp_8x16b_r4_2);
 1541|  26.0k|    i4_samp_8x16b_r5_1 = _mm_unpacklo_epi16(i4_samp_8x16b_r5_1, i4_samp_8x16b_r5_2);
 1542|  26.0k|    i4_samp_8x16b_r6_1 = _mm_unpacklo_epi16(i4_samp_8x16b_r6_1, i4_samp_8x16b_r6_2);
 1543|  26.0k|    i4_samp_8x16b_r7_1 = _mm_unpacklo_epi16(i4_samp_8x16b_r7_1, i4_samp_8x16b_r7_2);
 1544|  26.0k|    i4_samp_8x16b_r8_1 = _mm_unpacklo_epi16(i4_samp_8x16b_r8_1, i4_samp_8x16b_r8_2);
 1545|       |
 1546|       |    // a0c0+a1c1  a1c0+a2c1  a2c0+a3c1  a3c0+a4c1
 1547|  26.0k|    i4_res_4x32b_r1_0 = _mm_madd_epi16(i4_samp_8x16b_r1_0, coeff_c0_c1_8x16b);
 1548|       |    // b0c0+b1c1  b1c0+b2c1  b2c0+b3c1  b3c0+b4c1
 1549|  26.0k|    i4_res_4x32b_r2_0 = _mm_madd_epi16(i4_samp_8x16b_r2_0, coeff_c0_c1_8x16b);
 1550|  26.0k|    i4_res_4x32b_r3_0 = _mm_madd_epi16(i4_samp_8x16b_r3_0, coeff_c0_c1_8x16b);
 1551|  26.0k|    i4_res_4x32b_r4_0 = _mm_madd_epi16(i4_samp_8x16b_r4_0, coeff_c0_c1_8x16b);
 1552|  26.0k|    i4_res_4x32b_r5_0 = _mm_madd_epi16(i4_samp_8x16b_r5_0, coeff_c0_c1_8x16b);
 1553|  26.0k|    i4_res_4x32b_r6_0 = _mm_madd_epi16(i4_samp_8x16b_r6_0, coeff_c0_c1_8x16b);
 1554|  26.0k|    i4_res_4x32b_r7_0 = _mm_madd_epi16(i4_samp_8x16b_r7_0, coeff_c0_c1_8x16b);
 1555|  26.0k|    i4_res_4x32b_r8_0 = _mm_madd_epi16(i4_samp_8x16b_r8_0, coeff_c0_c1_8x16b);
 1556|       |
 1557|       |    // a1c2+a2c3  a2c2+a3c3  a3c2+a4c3  a4c2+a5c3
 1558|  26.0k|    i4_res_4x32b_r1_1 = _mm_madd_epi16(i4_samp_8x16b_r1_1, coeff_c2_c3_8x16b);
 1559|       |    // b1c2+b2c3  b2c2+b3c3  b3c2+b4c3  b4c2+b5c3
 1560|  26.0k|    i4_res_4x32b_r2_1 = _mm_madd_epi16(i4_samp_8x16b_r2_1, coeff_c2_c3_8x16b);
 1561|  26.0k|    i4_res_4x32b_r3_1 = _mm_madd_epi16(i4_samp_8x16b_r3_1, coeff_c2_c3_8x16b);
 1562|  26.0k|    i4_res_4x32b_r4_1 = _mm_madd_epi16(i4_samp_8x16b_r4_1, coeff_c2_c3_8x16b);
 1563|  26.0k|    i4_res_4x32b_r5_1 = _mm_madd_epi16(i4_samp_8x16b_r5_1, coeff_c2_c3_8x16b);
 1564|  26.0k|    i4_res_4x32b_r6_1 = _mm_madd_epi16(i4_samp_8x16b_r6_1, coeff_c2_c3_8x16b);
 1565|  26.0k|    i4_res_4x32b_r7_1 = _mm_madd_epi16(i4_samp_8x16b_r7_1, coeff_c2_c3_8x16b);
 1566|  26.0k|    i4_res_4x32b_r8_1 = _mm_madd_epi16(i4_samp_8x16b_r8_1, coeff_c2_c3_8x16b);
 1567|       |
 1568|  26.0k|    i4_res_4x32b_r1_0 = _mm_add_epi32(i4_res_4x32b_r1_0, res_32);
 1569|  26.0k|    i4_res_4x32b_r2_0 = _mm_add_epi32(i4_res_4x32b_r2_0, res_32);
 1570|  26.0k|    i4_res_4x32b_r3_0 = _mm_add_epi32(i4_res_4x32b_r3_0, res_32);
 1571|  26.0k|    i4_res_4x32b_r4_0 = _mm_add_epi32(i4_res_4x32b_r4_0, res_32);
 1572|  26.0k|    i4_res_4x32b_r5_0 = _mm_add_epi32(i4_res_4x32b_r5_0, res_32);
 1573|  26.0k|    i4_res_4x32b_r6_0 = _mm_add_epi32(i4_res_4x32b_r6_0, res_32);
 1574|  26.0k|    i4_res_4x32b_r7_0 = _mm_add_epi32(i4_res_4x32b_r7_0, res_32);
 1575|  26.0k|    i4_res_4x32b_r8_0 = _mm_add_epi32(i4_res_4x32b_r8_0, res_32);
 1576|       |
 1577|  26.0k|    i4_res_4x32b_r1_1 = _mm_add_epi32(i4_res_4x32b_r1_1, res_32);
 1578|  26.0k|    i4_res_4x32b_r2_1 = _mm_add_epi32(i4_res_4x32b_r2_1, res_32);
 1579|  26.0k|    i4_res_4x32b_r3_1 = _mm_add_epi32(i4_res_4x32b_r3_1, res_32);
 1580|  26.0k|    i4_res_4x32b_r4_1 = _mm_add_epi32(i4_res_4x32b_r4_1, res_32);
 1581|  26.0k|    i4_res_4x32b_r5_1 = _mm_add_epi32(i4_res_4x32b_r5_1, res_32);
 1582|  26.0k|    i4_res_4x32b_r6_1 = _mm_add_epi32(i4_res_4x32b_r6_1, res_32);
 1583|  26.0k|    i4_res_4x32b_r7_1 = _mm_add_epi32(i4_res_4x32b_r7_1, res_32);
 1584|  26.0k|    i4_res_4x32b_r8_1 = _mm_add_epi32(i4_res_4x32b_r8_1, res_32);
 1585|       |
 1586|  26.0k|    i4_res_4x32b_r1_0 = _mm_srai_epi32(i4_res_4x32b_r1_0, 6);
 1587|  26.0k|    i4_res_4x32b_r2_0 = _mm_srai_epi32(i4_res_4x32b_r2_0, 6);
 1588|  26.0k|    i4_res_4x32b_r3_0 = _mm_srai_epi32(i4_res_4x32b_r3_0, 6);
 1589|  26.0k|    i4_res_4x32b_r4_0 = _mm_srai_epi32(i4_res_4x32b_r4_0, 6);
 1590|  26.0k|    i4_res_4x32b_r5_0 = _mm_srai_epi32(i4_res_4x32b_r5_0, 6);
 1591|  26.0k|    i4_res_4x32b_r6_0 = _mm_srai_epi32(i4_res_4x32b_r6_0, 6);
 1592|  26.0k|    i4_res_4x32b_r7_0 = _mm_srai_epi32(i4_res_4x32b_r7_0, 6);
 1593|  26.0k|    i4_res_4x32b_r8_0 = _mm_srai_epi32(i4_res_4x32b_r8_0, 6);
 1594|       |
 1595|  26.0k|    i4_res_4x32b_r1_1 = _mm_srai_epi32(i4_res_4x32b_r1_1, 6);
 1596|  26.0k|    i4_res_4x32b_r2_1 = _mm_srai_epi32(i4_res_4x32b_r2_1, 6);
 1597|  26.0k|    i4_res_4x32b_r3_1 = _mm_srai_epi32(i4_res_4x32b_r3_1, 6);
 1598|  26.0k|    i4_res_4x32b_r4_1 = _mm_srai_epi32(i4_res_4x32b_r4_1, 6);
 1599|  26.0k|    i4_res_4x32b_r5_1 = _mm_srai_epi32(i4_res_4x32b_r5_1, 6);
 1600|  26.0k|    i4_res_4x32b_r6_1 = _mm_srai_epi32(i4_res_4x32b_r6_1, 6);
 1601|  26.0k|    i4_res_4x32b_r7_1 = _mm_srai_epi32(i4_res_4x32b_r7_1, 6);
 1602|  26.0k|    i4_res_4x32b_r8_1 = _mm_srai_epi32(i4_res_4x32b_r8_1, 6);
 1603|       |
 1604|  26.0k|    i4_res_final_8x16b_r12_0 = _mm_packs_epi32(i4_res_4x32b_r1_0, i4_res_4x32b_r2_0);
 1605|  26.0k|    i4_res_final_8x16b_r34_0 = _mm_packs_epi32(i4_res_4x32b_r3_0, i4_res_4x32b_r4_0);
 1606|  26.0k|    i4_res_final_8x16b_r56_0 = _mm_packs_epi32(i4_res_4x32b_r5_0, i4_res_4x32b_r6_0);
 1607|  26.0k|    i4_res_final_8x16b_r67_0 = _mm_packs_epi32(i4_res_4x32b_r7_0, i4_res_4x32b_r8_0);
 1608|       |
 1609|  26.0k|    i4_res_final_8x16b_r12_1 = _mm_packs_epi32(i4_res_4x32b_r1_1, i4_res_4x32b_r2_1);
 1610|  26.0k|    i4_res_final_8x16b_r34_1 = _mm_packs_epi32(i4_res_4x32b_r3_1, i4_res_4x32b_r4_1);
 1611|  26.0k|    i4_res_final_8x16b_r56_1 = _mm_packs_epi32(i4_res_4x32b_r5_1, i4_res_4x32b_r6_1);
 1612|  26.0k|    i4_res_final_8x16b_r67_1 = _mm_packs_epi32(i4_res_4x32b_r7_1, i4_res_4x32b_r8_1);
 1613|       |
 1614|  26.0k|    i4_res_final_8x16b_r1 = _mm_unpacklo_epi16(i4_res_final_8x16b_r12_0, i4_res_final_8x16b_r12_1);
 1615|  26.0k|    i4_res_final_8x16b_r2 = _mm_unpackhi_epi16(i4_res_final_8x16b_r12_0, i4_res_final_8x16b_r12_1);
 1616|  26.0k|    i4_res_final_8x16b_r3 = _mm_unpacklo_epi16(i4_res_final_8x16b_r34_0, i4_res_final_8x16b_r34_1);
 1617|  26.0k|    i4_res_final_8x16b_r4 = _mm_unpackhi_epi16(i4_res_final_8x16b_r34_0, i4_res_final_8x16b_r34_1);
 1618|  26.0k|    i4_res_final_8x16b_r5 = _mm_unpacklo_epi16(i4_res_final_8x16b_r56_0, i4_res_final_8x16b_r56_1);
 1619|  26.0k|    i4_res_final_8x16b_r6 = _mm_unpackhi_epi16(i4_res_final_8x16b_r56_0, i4_res_final_8x16b_r56_1);
 1620|  26.0k|    i4_res_final_8x16b_r7 = _mm_unpacklo_epi16(i4_res_final_8x16b_r67_0, i4_res_final_8x16b_r67_1);
 1621|  26.0k|    i4_res_final_8x16b_r8 = _mm_unpackhi_epi16(i4_res_final_8x16b_r67_0, i4_res_final_8x16b_r67_1);
 1622|       |
 1623|  26.0k|    chroma_mask = _mm_set1_epi16(0xFF00);
 1624|  26.0k|    chroma_mask2 = _mm_set1_epi16(0x00FF);
 1625|  26.0k|    out_16x8b_r1 = _mm_loadu_si128((__m128i *) (&pu1_out[0]));
 1626|  26.0k|    out_16x8b_r2 = _mm_loadu_si128((__m128i *) (&pu1_out[i4_dst_stride]));
 1627|  26.0k|    out_16x8b_r3 = _mm_loadu_si128((__m128i *) (&pu1_out[i4_dst_stride2]));
 1628|  26.0k|    out_16x8b_r4 = _mm_loadu_si128((__m128i *) (&pu1_out[i4_dst_stride2 + i4_dst_stride]));
 1629|  26.0k|    out_16x8b_r5 = _mm_loadu_si128((__m128i *) (&pu1_out[i4_dst_stride4]));
 1630|  26.0k|    out_16x8b_r6 = _mm_loadu_si128((__m128i *) (&pu1_out[i4_dst_stride4 + i4_dst_stride]));
 1631|  26.0k|    out_16x8b_r7 = _mm_loadu_si128((__m128i *) (&pu1_out[i4_dst_stride4 + i4_dst_stride2]));
 1632|  26.0k|    out_16x8b_r8 =
 1633|  26.0k|        _mm_loadu_si128((__m128i *) (&pu1_out[i4_dst_stride4 + i4_dst_stride2 + i4_dst_stride]));
 1634|       |
 1635|  26.0k|    out_16x8b_r1 = _mm_and_si128(out_16x8b_r1, chroma_mask);
 1636|  26.0k|    out_16x8b_r2 = _mm_and_si128(out_16x8b_r2, chroma_mask);
 1637|  26.0k|    out_16x8b_r3 = _mm_and_si128(out_16x8b_r3, chroma_mask);
 1638|  26.0k|    out_16x8b_r4 = _mm_and_si128(out_16x8b_r4, chroma_mask);
 1639|  26.0k|    out_16x8b_r5 = _mm_and_si128(out_16x8b_r5, chroma_mask);
 1640|  26.0k|    out_16x8b_r6 = _mm_and_si128(out_16x8b_r6, chroma_mask);
 1641|  26.0k|    out_16x8b_r7 = _mm_and_si128(out_16x8b_r7, chroma_mask);
 1642|  26.0k|    out_16x8b_r8 = _mm_and_si128(out_16x8b_r8, chroma_mask);
 1643|       |
 1644|  26.0k|    i4_res_final_8x16b_r1 = _mm_and_si128(i4_res_final_8x16b_r1, chroma_mask2);
 1645|  26.0k|    i4_res_final_8x16b_r2 = _mm_and_si128(i4_res_final_8x16b_r2, chroma_mask2);
 1646|  26.0k|    i4_res_final_8x16b_r3 = _mm_and_si128(i4_res_final_8x16b_r3, chroma_mask2);
 1647|  26.0k|    i4_res_final_8x16b_r4 = _mm_and_si128(i4_res_final_8x16b_r4, chroma_mask2);
 1648|  26.0k|    i4_res_final_8x16b_r5 = _mm_and_si128(i4_res_final_8x16b_r5, chroma_mask2);
 1649|  26.0k|    i4_res_final_8x16b_r6 = _mm_and_si128(i4_res_final_8x16b_r6, chroma_mask2);
 1650|  26.0k|    i4_res_final_8x16b_r7 = _mm_and_si128(i4_res_final_8x16b_r7, chroma_mask2);
 1651|  26.0k|    i4_res_final_8x16b_r8 = _mm_and_si128(i4_res_final_8x16b_r8, chroma_mask2);
 1652|       |
 1653|  26.0k|    out_16x8b_r1 = _mm_add_epi8(i4_res_final_8x16b_r1, out_16x8b_r1);
 1654|  26.0k|    out_16x8b_r2 = _mm_add_epi8(i4_res_final_8x16b_r2, out_16x8b_r2);
 1655|  26.0k|    out_16x8b_r3 = _mm_add_epi8(i4_res_final_8x16b_r3, out_16x8b_r3);
 1656|  26.0k|    out_16x8b_r4 = _mm_add_epi8(i4_res_final_8x16b_r4, out_16x8b_r4);
 1657|  26.0k|    out_16x8b_r5 = _mm_add_epi8(i4_res_final_8x16b_r5, out_16x8b_r5);
 1658|  26.0k|    out_16x8b_r6 = _mm_add_epi8(i4_res_final_8x16b_r6, out_16x8b_r6);
 1659|  26.0k|    out_16x8b_r7 = _mm_add_epi8(i4_res_final_8x16b_r7, out_16x8b_r7);
 1660|  26.0k|    out_16x8b_r8 = _mm_add_epi8(i4_res_final_8x16b_r8, out_16x8b_r8);
 1661|       |
 1662|  26.0k|    _mm_storeu_si128((__m128i *) pu1_out, out_16x8b_r1);
 1663|  26.0k|    _mm_storeu_si128((__m128i *) (pu1_out + i4_dst_stride), out_16x8b_r2);
 1664|  26.0k|    _mm_storeu_si128((__m128i *) (pu1_out + (i4_dst_stride << 1)), out_16x8b_r3);
 1665|  26.0k|    _mm_storeu_si128((__m128i *) (pu1_out + (i4_dst_stride * 3)), out_16x8b_r4);
 1666|  26.0k|    _mm_storeu_si128((__m128i *) (pu1_out + (i4_dst_stride << 2)), out_16x8b_r5);
 1667|  26.0k|    _mm_storeu_si128((__m128i *) (pu1_out + (i4_dst_stride * 5)), out_16x8b_r6);
 1668|  26.0k|    _mm_storeu_si128((__m128i *) (pu1_out + (i4_dst_stride * 6)), out_16x8b_r7);
 1669|  26.0k|    _mm_storeu_si128((__m128i *) (pu1_out + (i4_dst_stride * 7)), out_16x8b_r8);
 1670|       |    /* End of loop over x */
 1671|  26.0k|} /* isvcd_horz_interpol_chroma_dyadic_1_sse42 */
isvcd_horz_interpol_chroma_dyadic_2_sse42:
 1704|  15.4k|{
 1705|  15.4k|    WORD32 i4_coeff_0, i4_coeff_1, i4_coeff_2, i4_coeff_3;
 1706|  15.4k|    WORD32 i4_dst_stride, i4_dst_stride2, i4_dst_stride4;
 1707|  15.4k|    UWORD8 *pu1_out;
 1708|  15.4k|    WORD16 *pi2_tmp;
 1709|       |
 1710|  15.4k|    __m128i i4_samp_8x16b_r1_0, i4_samp_8x16b_r1_1;
 1711|  15.4k|    __m128i i4_samp_8x16b_r2_0, i4_samp_8x16b_r2_1;
 1712|  15.4k|    __m128i i4_samp_8x16b_r3_0, i4_samp_8x16b_r3_1;
 1713|  15.4k|    __m128i i4_samp_8x16b_r4_0, i4_samp_8x16b_r4_1;
 1714|  15.4k|    __m128i i4_samp_8x16b_r5_0, i4_samp_8x16b_r5_1;
 1715|  15.4k|    __m128i i4_samp_8x16b_r6_0, i4_samp_8x16b_r6_1;
 1716|  15.4k|    __m128i i4_samp_8x16b_r7_0, i4_samp_8x16b_r7_1;
 1717|  15.4k|    __m128i i4_samp_8x16b_r8_0, i4_samp_8x16b_r8_1;
 1718|       |
 1719|  15.4k|    __m128i i4_res_4x32b_r1_0, i4_res_4x32b_r1_1;
 1720|  15.4k|    __m128i i4_res_4x32b_r2_0, i4_res_4x32b_r2_1;
 1721|  15.4k|    __m128i i4_res_4x32b_r3_0, i4_res_4x32b_r3_1;
 1722|  15.4k|    __m128i i4_res_4x32b_r4_0, i4_res_4x32b_r4_1;
 1723|  15.4k|    __m128i i4_res_4x32b_r5_0, i4_res_4x32b_r5_1;
 1724|  15.4k|    __m128i i4_res_4x32b_r6_0, i4_res_4x32b_r6_1;
 1725|  15.4k|    __m128i i4_res_4x32b_r7_0, i4_res_4x32b_r7_1;
 1726|  15.4k|    __m128i i4_res_4x32b_r8_0, i4_res_4x32b_r8_1;
 1727|       |
 1728|  15.4k|    __m128i i4_res_final_8x16b_r1;
 1729|  15.4k|    __m128i i4_res_final_8x16b_r2;
 1730|  15.4k|    __m128i i4_res_final_8x16b_r3;
 1731|  15.4k|    __m128i i4_res_final_8x16b_r4;
 1732|  15.4k|    __m128i i4_res_final_8x16b_r5;
 1733|  15.4k|    __m128i i4_res_final_8x16b_r6;
 1734|  15.4k|    __m128i i4_res_final_8x16b_r7;
 1735|  15.4k|    __m128i i4_res_final_8x16b_r8;
 1736|       |
 1737|  15.4k|    __m128i out_16x8b_r1;
 1738|  15.4k|    __m128i out_16x8b_r2;
 1739|  15.4k|    __m128i out_16x8b_r3;
 1740|  15.4k|    __m128i out_16x8b_r4;
 1741|  15.4k|    __m128i out_16x8b_r5;
 1742|  15.4k|    __m128i out_16x8b_r6;
 1743|  15.4k|    __m128i out_16x8b_r7;
 1744|  15.4k|    __m128i out_16x8b_r8;
 1745|  15.4k|    __m128i i4_res_final_8x16b_r12_0, i4_res_final_8x16b_r12_1;
 1746|  15.4k|    __m128i i4_res_final_8x16b_r34_0, i4_res_final_8x16b_r34_1;
 1747|  15.4k|    __m128i i4_res_final_8x16b_r56_0, i4_res_final_8x16b_r56_1;
 1748|  15.4k|    __m128i i4_res_final_8x16b_r67_0, i4_res_final_8x16b_r67_1;
 1749|  15.4k|    __m128i chroma_mask, chroma_mask2;
 1750|  15.4k|    __m128i coeff_c0_c1_8x16b, coeff_c2_c3_8x16b, res_32;
 1751|       |
 1752|  15.4k|    i4_coeff_0 = 8 - i4_phase_0;
 1753|  15.4k|    i4_coeff_1 = i4_phase_0;
 1754|  15.4k|    i4_coeff_2 = 8 - i4_phase_1;
 1755|  15.4k|    i4_coeff_3 = i4_phase_1;
 1756|  15.4k|    coeff_c0_c1_8x16b = _mm_set_epi16(i4_coeff_1, i4_coeff_0, i4_coeff_1, i4_coeff_0, i4_coeff_1,
 1757|  15.4k|                                      i4_coeff_0, i4_coeff_1, i4_coeff_0);
 1758|  15.4k|    coeff_c2_c3_8x16b = _mm_set_epi16(i4_coeff_3, i4_coeff_2, i4_coeff_3, i4_coeff_2, i4_coeff_3,
 1759|  15.4k|                                      i4_coeff_2, i4_coeff_3, i4_coeff_2);
 1760|  15.4k|    res_32 = _mm_set1_epi32(32);
 1761|  15.4k|    pu1_out = pu1_out_buf;
 1762|  15.4k|    pi2_tmp = pi2_tmp_filt_buf + 1;
 1763|  15.4k|    i4_dst_stride = i4_out_stride;
 1764|       |
 1765|  15.4k|    i4_dst_stride2 = i4_dst_stride << 1;
 1766|  15.4k|    i4_dst_stride4 = i4_dst_stride << 2;
 1767|       |
 1768|       |    /* Horizontal interpolation */
 1769|       |    /* x = 0, x_phase = phase_0 */
 1770|  15.4k|    i4_samp_8x16b_r1_0 = _mm_loadu_si128((__m128i *) pi2_tmp);         // a0 a1 a2 a3 a4 a5 a6 a7
 1771|  15.4k|    i4_samp_8x16b_r2_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 6));   // b0 b1 b2 b3 b4 b5 b6 b7
 1772|  15.4k|    i4_samp_8x16b_r3_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 12));  // b0 b1 b2 b3 b4 b5 b6 b7
 1773|  15.4k|    i4_samp_8x16b_r4_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 18));  // b0 b1 b2 b3 b4 b5 b6 b7
 1774|  15.4k|    i4_samp_8x16b_r5_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 24));  // b0 b1 b2 b3 b4 b5 b6 b7
 1775|  15.4k|    i4_samp_8x16b_r6_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 30));  // b0 b1 b2 b3 b4 b5 b6 b7
 1776|  15.4k|    i4_samp_8x16b_r7_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 36));  // b0 b1 b2 b3 b4 b5 b6 b7
 1777|  15.4k|    i4_samp_8x16b_r8_0 = _mm_loadu_si128((__m128i *) (pi2_tmp + 42));  // b0 b1 b2 b3 b4 b5 b6 b7
 1778|       |
 1779|  15.4k|    i4_samp_8x16b_r1_1 = _mm_srli_si128(i4_samp_8x16b_r1_0, 2);        // a1 a2 a3 a4 a5 a6 a7 0
 1780|  15.4k|    i4_samp_8x16b_r2_1 = _mm_srli_si128(i4_samp_8x16b_r2_0, 2);        // b1 b2 b3 b4 b5 b6 b7 0
 1781|  15.4k|    i4_samp_8x16b_r3_1 = _mm_srli_si128(i4_samp_8x16b_r3_0, 2);        // b1 b2 b3 b4 b5 b6 b7 0
 1782|  15.4k|    i4_samp_8x16b_r4_1 = _mm_srli_si128(i4_samp_8x16b_r4_0, 2);        // b1 b2 b3 b4 b5 b6 b7 0
 1783|  15.4k|    i4_samp_8x16b_r5_1 = _mm_srli_si128(i4_samp_8x16b_r5_0, 2);        // b1 b2 b3 b4 b5 b6 b7 0
 1784|  15.4k|    i4_samp_8x16b_r6_1 = _mm_srli_si128(i4_samp_8x16b_r6_0, 2);        // b1 b2 b3 b4 b5 b6 b7 0
 1785|  15.4k|    i4_samp_8x16b_r7_1 = _mm_srli_si128(i4_samp_8x16b_r7_0, 2);        // b1 b2 b3 b4 b5 b6 b7 0
 1786|  15.4k|    i4_samp_8x16b_r8_1 = _mm_srli_si128(i4_samp_8x16b_r8_0, 2);        // b1 b2 b3 b4 b5 b6 b7 0
 1787|       |
 1788|  15.4k|    i4_samp_8x16b_r1_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r1_0,
 1789|  15.4k|                                            i4_samp_8x16b_r1_1);  // a0 a1  a1 a2  a2 a3  a3 a4
 1790|  15.4k|    i4_samp_8x16b_r2_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r2_0,
 1791|  15.4k|                                            i4_samp_8x16b_r2_1);  // b0 b1  b1 b2  b2 b3  b3 b4
 1792|  15.4k|    i4_samp_8x16b_r3_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r3_0, i4_samp_8x16b_r3_1);
 1793|  15.4k|    i4_samp_8x16b_r4_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r4_0, i4_samp_8x16b_r4_1);
 1794|  15.4k|    i4_samp_8x16b_r5_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r5_0, i4_samp_8x16b_r5_1);
 1795|  15.4k|    i4_samp_8x16b_r6_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r6_0, i4_samp_8x16b_r6_1);
 1796|  15.4k|    i4_samp_8x16b_r7_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r7_0, i4_samp_8x16b_r7_1);
 1797|  15.4k|    i4_samp_8x16b_r8_0 = _mm_unpacklo_epi16(i4_samp_8x16b_r8_0, i4_samp_8x16b_r8_1);
 1798|       |
 1799|       |    // a0c0+a1c1  a1c0+a2c1  a2c0+a3c1  a3c0+a4c1
 1800|  15.4k|    i4_res_4x32b_r1_0 = _mm_madd_epi16(i4_samp_8x16b_r1_0, coeff_c0_c1_8x16b);
 1801|       |    // b0c0+b1c1  b1c0+b2c1  b2c0+b3c1  b3c0+b4c1
 1802|  15.4k|    i4_res_4x32b_r2_0 = _mm_madd_epi16(i4_samp_8x16b_r2_0, coeff_c0_c1_8x16b);
 1803|  15.4k|    i4_res_4x32b_r3_0 = _mm_madd_epi16(i4_samp_8x16b_r3_0, coeff_c0_c1_8x16b);
 1804|  15.4k|    i4_res_4x32b_r4_0 = _mm_madd_epi16(i4_samp_8x16b_r4_0, coeff_c0_c1_8x16b);
 1805|  15.4k|    i4_res_4x32b_r5_0 = _mm_madd_epi16(i4_samp_8x16b_r5_0, coeff_c0_c1_8x16b);
 1806|  15.4k|    i4_res_4x32b_r6_0 = _mm_madd_epi16(i4_samp_8x16b_r6_0, coeff_c0_c1_8x16b);
 1807|  15.4k|    i4_res_4x32b_r7_0 = _mm_madd_epi16(i4_samp_8x16b_r7_0, coeff_c0_c1_8x16b);
 1808|  15.4k|    i4_res_4x32b_r8_0 = _mm_madd_epi16(i4_samp_8x16b_r8_0, coeff_c0_c1_8x16b);
 1809|       |
 1810|       |    // a1c2+a2c3  a2c2+a3c3  a3c2+a4c3  a4c2+a5c3
 1811|  15.4k|    i4_res_4x32b_r1_1 = _mm_madd_epi16(i4_samp_8x16b_r1_0, coeff_c2_c3_8x16b);
 1812|       |    // b1c2+b2c3  b2c2+b3c3  b3c2+b4c3  b4c2+b5c3
 1813|  15.4k|    i4_res_4x32b_r2_1 = _mm_madd_epi16(i4_samp_8x16b_r2_0, coeff_c2_c3_8x16b);
 1814|  15.4k|    i4_res_4x32b_r3_1 = _mm_madd_epi16(i4_samp_8x16b_r3_0, coeff_c2_c3_8x16b);
 1815|  15.4k|    i4_res_4x32b_r4_1 = _mm_madd_epi16(i4_samp_8x16b_r4_0, coeff_c2_c3_8x16b);
 1816|  15.4k|    i4_res_4x32b_r5_1 = _mm_madd_epi16(i4_samp_8x16b_r5_0, coeff_c2_c3_8x16b);
 1817|  15.4k|    i4_res_4x32b_r6_1 = _mm_madd_epi16(i4_samp_8x16b_r6_0, coeff_c2_c3_8x16b);
 1818|  15.4k|    i4_res_4x32b_r7_1 = _mm_madd_epi16(i4_samp_8x16b_r7_0, coeff_c2_c3_8x16b);
 1819|  15.4k|    i4_res_4x32b_r8_1 = _mm_madd_epi16(i4_samp_8x16b_r8_0, coeff_c2_c3_8x16b);
 1820|       |
 1821|  15.4k|    i4_res_4x32b_r1_0 = _mm_add_epi32(i4_res_4x32b_r1_0, res_32);
 1822|  15.4k|    i4_res_4x32b_r2_0 = _mm_add_epi32(i4_res_4x32b_r2_0, res_32);
 1823|  15.4k|    i4_res_4x32b_r3_0 = _mm_add_epi32(i4_res_4x32b_r3_0, res_32);
 1824|  15.4k|    i4_res_4x32b_r4_0 = _mm_add_epi32(i4_res_4x32b_r4_0, res_32);
 1825|  15.4k|    i4_res_4x32b_r5_0 = _mm_add_epi32(i4_res_4x32b_r5_0, res_32);
 1826|  15.4k|    i4_res_4x32b_r6_0 = _mm_add_epi32(i4_res_4x32b_r6_0, res_32);
 1827|  15.4k|    i4_res_4x32b_r7_0 = _mm_add_epi32(i4_res_4x32b_r7_0, res_32);
 1828|  15.4k|    i4_res_4x32b_r8_0 = _mm_add_epi32(i4_res_4x32b_r8_0, res_32);
 1829|       |
 1830|  15.4k|    i4_res_4x32b_r1_1 = _mm_add_epi32(i4_res_4x32b_r1_1, res_32);
 1831|  15.4k|    i4_res_4x32b_r2_1 = _mm_add_epi32(i4_res_4x32b_r2_1, res_32);
 1832|  15.4k|    i4_res_4x32b_r3_1 = _mm_add_epi32(i4_res_4x32b_r3_1, res_32);
 1833|  15.4k|    i4_res_4x32b_r4_1 = _mm_add_epi32(i4_res_4x32b_r4_1, res_32);
 1834|  15.4k|    i4_res_4x32b_r5_1 = _mm_add_epi32(i4_res_4x32b_r5_1, res_32);
 1835|  15.4k|    i4_res_4x32b_r6_1 = _mm_add_epi32(i4_res_4x32b_r6_1, res_32);
 1836|  15.4k|    i4_res_4x32b_r7_1 = _mm_add_epi32(i4_res_4x32b_r7_1, res_32);
 1837|  15.4k|    i4_res_4x32b_r8_1 = _mm_add_epi32(i4_res_4x32b_r8_1, res_32);
 1838|       |
 1839|  15.4k|    i4_res_4x32b_r1_0 = _mm_srai_epi32(i4_res_4x32b_r1_0, 6);
 1840|  15.4k|    i4_res_4x32b_r2_0 = _mm_srai_epi32(i4_res_4x32b_r2_0, 6);
 1841|  15.4k|    i4_res_4x32b_r3_0 = _mm_srai_epi32(i4_res_4x32b_r3_0, 6);
 1842|  15.4k|    i4_res_4x32b_r4_0 = _mm_srai_epi32(i4_res_4x32b_r4_0, 6);
 1843|  15.4k|    i4_res_4x32b_r5_0 = _mm_srai_epi32(i4_res_4x32b_r5_0, 6);
 1844|  15.4k|    i4_res_4x32b_r6_0 = _mm_srai_epi32(i4_res_4x32b_r6_0, 6);
 1845|  15.4k|    i4_res_4x32b_r7_0 = _mm_srai_epi32(i4_res_4x32b_r7_0, 6);
 1846|  15.4k|    i4_res_4x32b_r8_0 = _mm_srai_epi32(i4_res_4x32b_r8_0, 6);
 1847|       |
 1848|  15.4k|    i4_res_4x32b_r1_1 = _mm_srai_epi32(i4_res_4x32b_r1_1, 6);
 1849|  15.4k|    i4_res_4x32b_r2_1 = _mm_srai_epi32(i4_res_4x32b_r2_1, 6);
 1850|  15.4k|    i4_res_4x32b_r3_1 = _mm_srai_epi32(i4_res_4x32b_r3_1, 6);
 1851|  15.4k|    i4_res_4x32b_r4_1 = _mm_srai_epi32(i4_res_4x32b_r4_1, 6);
 1852|  15.4k|    i4_res_4x32b_r5_1 = _mm_srai_epi32(i4_res_4x32b_r5_1, 6);
 1853|  15.4k|    i4_res_4x32b_r6_1 = _mm_srai_epi32(i4_res_4x32b_r6_1, 6);
 1854|  15.4k|    i4_res_4x32b_r7_1 = _mm_srai_epi32(i4_res_4x32b_r7_1, 6);
 1855|  15.4k|    i4_res_4x32b_r8_1 = _mm_srai_epi32(i4_res_4x32b_r8_1, 6);
 1856|       |
 1857|  15.4k|    i4_res_final_8x16b_r12_0 = _mm_packs_epi32(i4_res_4x32b_r1_0, i4_res_4x32b_r2_0);
 1858|  15.4k|    i4_res_final_8x16b_r34_0 = _mm_packs_epi32(i4_res_4x32b_r3_0, i4_res_4x32b_r4_0);
 1859|  15.4k|    i4_res_final_8x16b_r56_0 = _mm_packs_epi32(i4_res_4x32b_r5_0, i4_res_4x32b_r6_0);
 1860|  15.4k|    i4_res_final_8x16b_r67_0 = _mm_packs_epi32(i4_res_4x32b_r7_0, i4_res_4x32b_r8_0);
 1861|       |
 1862|  15.4k|    i4_res_final_8x16b_r12_1 = _mm_packs_epi32(i4_res_4x32b_r1_1, i4_res_4x32b_r2_1);
 1863|  15.4k|    i4_res_final_8x16b_r34_1 = _mm_packs_epi32(i4_res_4x32b_r3_1, i4_res_4x32b_r4_1);
 1864|  15.4k|    i4_res_final_8x16b_r56_1 = _mm_packs_epi32(i4_res_4x32b_r5_1, i4_res_4x32b_r6_1);
 1865|  15.4k|    i4_res_final_8x16b_r67_1 = _mm_packs_epi32(i4_res_4x32b_r7_1, i4_res_4x32b_r8_1);
 1866|       |
 1867|  15.4k|    i4_res_final_8x16b_r1 = _mm_unpacklo_epi16(i4_res_final_8x16b_r12_0, i4_res_final_8x16b_r12_1);
 1868|  15.4k|    i4_res_final_8x16b_r2 = _mm_unpackhi_epi16(i4_res_final_8x16b_r12_0, i4_res_final_8x16b_r12_1);
 1869|  15.4k|    i4_res_final_8x16b_r3 = _mm_unpacklo_epi16(i4_res_final_8x16b_r34_0, i4_res_final_8x16b_r34_1);
 1870|  15.4k|    i4_res_final_8x16b_r4 = _mm_unpackhi_epi16(i4_res_final_8x16b_r34_0, i4_res_final_8x16b_r34_1);
 1871|  15.4k|    i4_res_final_8x16b_r5 = _mm_unpacklo_epi16(i4_res_final_8x16b_r56_0, i4_res_final_8x16b_r56_1);
 1872|  15.4k|    i4_res_final_8x16b_r6 = _mm_unpackhi_epi16(i4_res_final_8x16b_r56_0, i4_res_final_8x16b_r56_1);
 1873|  15.4k|    i4_res_final_8x16b_r7 = _mm_unpacklo_epi16(i4_res_final_8x16b_r67_0, i4_res_final_8x16b_r67_1);
 1874|  15.4k|    i4_res_final_8x16b_r8 = _mm_unpackhi_epi16(i4_res_final_8x16b_r67_0, i4_res_final_8x16b_r67_1);
 1875|       |
 1876|  15.4k|    chroma_mask = _mm_set1_epi16(0xFF00);
 1877|  15.4k|    chroma_mask2 = _mm_set1_epi16(0x00FF);
 1878|  15.4k|    out_16x8b_r1 = _mm_loadu_si128((__m128i *) (&pu1_out[0]));
 1879|  15.4k|    out_16x8b_r2 = _mm_loadu_si128((__m128i *) (&pu1_out[i4_dst_stride]));
 1880|  15.4k|    out_16x8b_r3 = _mm_loadu_si128((__m128i *) (&pu1_out[i4_dst_stride2]));
 1881|  15.4k|    out_16x8b_r4 = _mm_loadu_si128((__m128i *) (&pu1_out[i4_dst_stride2 + i4_dst_stride]));
 1882|  15.4k|    out_16x8b_r5 = _mm_loadu_si128((__m128i *) (&pu1_out[i4_dst_stride4]));
 1883|  15.4k|    out_16x8b_r6 = _mm_loadu_si128((__m128i *) (&pu1_out[i4_dst_stride4 + i4_dst_stride]));
 1884|  15.4k|    out_16x8b_r7 = _mm_loadu_si128((__m128i *) (&pu1_out[i4_dst_stride4 + i4_dst_stride2]));
 1885|  15.4k|    out_16x8b_r8 =
 1886|  15.4k|        _mm_loadu_si128((__m128i *) (&pu1_out[i4_dst_stride4 + i4_dst_stride2 + i4_dst_stride]));
 1887|       |
 1888|  15.4k|    out_16x8b_r1 = _mm_and_si128(out_16x8b_r1, chroma_mask);
 1889|  15.4k|    out_16x8b_r2 = _mm_and_si128(out_16x8b_r2, chroma_mask);
 1890|  15.4k|    out_16x8b_r3 = _mm_and_si128(out_16x8b_r3, chroma_mask);
 1891|  15.4k|    out_16x8b_r4 = _mm_and_si128(out_16x8b_r4, chroma_mask);
 1892|  15.4k|    out_16x8b_r5 = _mm_and_si128(out_16x8b_r5, chroma_mask);
 1893|  15.4k|    out_16x8b_r6 = _mm_and_si128(out_16x8b_r6, chroma_mask);
 1894|  15.4k|    out_16x8b_r7 = _mm_and_si128(out_16x8b_r7, chroma_mask);
 1895|  15.4k|    out_16x8b_r8 = _mm_and_si128(out_16x8b_r8, chroma_mask);
 1896|       |
 1897|  15.4k|    i4_res_final_8x16b_r1 = _mm_and_si128(i4_res_final_8x16b_r1, chroma_mask2);
 1898|  15.4k|    i4_res_final_8x16b_r2 = _mm_and_si128(i4_res_final_8x16b_r2, chroma_mask2);
 1899|  15.4k|    i4_res_final_8x16b_r3 = _mm_and_si128(i4_res_final_8x16b_r3, chroma_mask2);
 1900|  15.4k|    i4_res_final_8x16b_r4 = _mm_and_si128(i4_res_final_8x16b_r4, chroma_mask2);
 1901|  15.4k|    i4_res_final_8x16b_r5 = _mm_and_si128(i4_res_final_8x16b_r5, chroma_mask2);
 1902|  15.4k|    i4_res_final_8x16b_r6 = _mm_and_si128(i4_res_final_8x16b_r6, chroma_mask2);
 1903|  15.4k|    i4_res_final_8x16b_r7 = _mm_and_si128(i4_res_final_8x16b_r7, chroma_mask2);
 1904|  15.4k|    i4_res_final_8x16b_r8 = _mm_and_si128(i4_res_final_8x16b_r8, chroma_mask2);
 1905|       |
 1906|  15.4k|    out_16x8b_r1 = _mm_add_epi8(i4_res_final_8x16b_r1, out_16x8b_r1);
 1907|  15.4k|    out_16x8b_r2 = _mm_add_epi8(i4_res_final_8x16b_r2, out_16x8b_r2);
 1908|  15.4k|    out_16x8b_r3 = _mm_add_epi8(i4_res_final_8x16b_r3, out_16x8b_r3);
 1909|  15.4k|    out_16x8b_r4 = _mm_add_epi8(i4_res_final_8x16b_r4, out_16x8b_r4);
 1910|  15.4k|    out_16x8b_r5 = _mm_add_epi8(i4_res_final_8x16b_r5, out_16x8b_r5);
 1911|  15.4k|    out_16x8b_r6 = _mm_add_epi8(i4_res_final_8x16b_r6, out_16x8b_r6);
 1912|  15.4k|    out_16x8b_r7 = _mm_add_epi8(i4_res_final_8x16b_r7, out_16x8b_r7);
 1913|  15.4k|    out_16x8b_r8 = _mm_add_epi8(i4_res_final_8x16b_r8, out_16x8b_r8);
 1914|       |
 1915|  15.4k|    _mm_storeu_si128((__m128i *) pu1_out, out_16x8b_r1);
 1916|  15.4k|    _mm_storeu_si128((__m128i *) (pu1_out + i4_dst_stride), out_16x8b_r2);
 1917|  15.4k|    _mm_storeu_si128((__m128i *) (pu1_out + (i4_dst_stride << 1)), out_16x8b_r3);
 1918|  15.4k|    _mm_storeu_si128((__m128i *) (pu1_out + (i4_dst_stride * 3)), out_16x8b_r4);
 1919|  15.4k|    _mm_storeu_si128((__m128i *) (pu1_out + (i4_dst_stride << 2)), out_16x8b_r5);
 1920|  15.4k|    _mm_storeu_si128((__m128i *) (pu1_out + (i4_dst_stride * 5)), out_16x8b_r6);
 1921|  15.4k|    _mm_storeu_si128((__m128i *) (pu1_out + (i4_dst_stride * 6)), out_16x8b_r7);
 1922|  15.4k|    _mm_storeu_si128((__m128i *) (pu1_out + (i4_dst_stride * 7)), out_16x8b_r8);
 1923|       |
 1924|       |    /* End of loop over x */
 1925|  15.4k|}

isvcd_iquant_itrans_residual_recon_4x4_sse42:
   82|  29.4k|{
   83|  29.4k|    WORD32 i4_nnz = 0;
   84|  29.4k|    WORD32 row_0, row_1, row_2, row_3;
   85|  29.4k|    UWORD32 *pu4_out = (UWORD32 *) pu1_out;
   86|  29.4k|    __m128i src_r0_r1, src_r2_r3;
   87|  29.4k|    __m128i src_r0, src_r1, src_r2, src_r3;
   88|  29.4k|    __m128i scalemat_r0_r1, scalemat_r2_r3;
   89|  29.4k|    __m128i pred_r0, pred_r1, pred_r2, pred_r3;
   90|  29.4k|    __m128i rsd_r0, rsd_r1, rsd_r2, rsd_r3;
   91|  29.4k|    __m128i sign_reg, dequant_r0_r1, dequant_r2_r3;
   92|  29.4k|    __m128i zero_8x16b = _mm_setzero_si128();  // all bits reset to zero
   93|  29.4k|    __m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
   94|  29.4k|    __m128i resq_r0, resq_r1, resq_r2, resq_r3;
   95|  29.4k|    __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
  ------------------
  |  Branch (95:41): [True: 19.6k, False: 9.81k]
  ------------------
   96|  29.4k|    __m128i value_32 = _mm_set1_epi32(32);
   97|  29.4k|    __m128i dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  29.4k|#define RSD_MAX 255
  ------------------
   98|  29.4k|    __m128i dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  29.4k|#define RSD_MIN -255
  ------------------
   99|       |
  100|  29.4k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  29.4k|#define UNUSED(x) ((void)(x))
  ------------------
  101|       |
  102|       |    /*************************************************************/
  103|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
  104|       |    /* operations on platform                                    */
  105|       |    /*************************************************************/
  106|       |    // a00 a01 a02 a03 a10 a11 a12 a13 -- the source matrix 0th,1st row
  107|  29.4k|    src_r0_r1 = _mm_loadu_si128((__m128i *) (pi2_src));
  108|       |    // a20 a21 a22 a23 a30 a31 a32 a33 --the source matrix 2nd,3rd row
  109|  29.4k|    src_r2_r3 = _mm_loadu_si128((__m128i *) (pi2_src + 8));
  110|       |    // b00 b01 b02 b03 b10 b11 b12 b13 -- the scaling matrix 0th,1st row
  111|  29.4k|    scalemat_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat));
  112|       |    // b20 b21 b22 b23 b30 b31 b32 b33 -- the scaling matrix 2nd,3rd row
  113|  29.4k|    scalemat_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat + 8));
  114|       |    // q00 q01 q02 q03 q10 q11 q12 q13 -- all 16 bits
  115|  29.4k|    dequant_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat));
  116|       |    // q20 q21 q22 q23 q30 q31 q32 q33 -- all 16 bits
  117|  29.4k|    dequant_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat + 8));
  118|       |    // b00*q00 b01*q01 b02*q02 b03*q03 b10*q10 b11*q11 b12*q12 b13*q13 -- 16 bit result
  119|  29.4k|    temp0 = _mm_mullo_epi16(scalemat_r0_r1, dequant_r0_r1);
  120|       |    // b00*q00 b01*q01 b02*q02 b03*q03 b10*q10 b11*q11 b12*q12 b13*q13 -- 16 bit result
  121|  29.4k|    temp1 = _mm_mullo_epi16(scalemat_r2_r3, dequant_r2_r3);
  122|       |    // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
  123|  29.4k|    temp4 = _mm_unpacklo_epi16(temp0, zero_8x16b);
  124|       |    // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  125|  29.4k|    temp5 = _mm_unpackhi_epi16(temp0, zero_8x16b);
  126|       |    // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
  127|  29.4k|    temp6 = _mm_unpacklo_epi16(temp1, zero_8x16b);
  128|       |    // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  129|  29.4k|    temp7 = _mm_unpackhi_epi16(temp1, zero_8x16b);
  130|  29.4k|    src_r0 = _mm_unpacklo_epi16(src_r0_r1, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  131|  29.4k|    src_r1 = _mm_unpackhi_epi16(src_r0_r1, zero_8x16b);  // a10 0 a11 0 a12 0 a13 0 -- 16 bit long
  132|  29.4k|    src_r2 = _mm_unpacklo_epi16(src_r2_r3, zero_8x16b);  // a20 0 a21 0 a22 0 a23 0 -- 16 bit long
  133|  29.4k|    src_r3 = _mm_unpackhi_epi16(src_r2_r3, zero_8x16b);  // a30 0 a31 0 a32 0 a33 0 -- 16 bit long
  134|       |    // a00*b00*q00 a10*b10*q10 a20*b20*q20 a30*b30 q30 -- 32 bits long
  135|  29.4k|    temp4 = _mm_madd_epi16(src_r0, temp4);
  136|  29.4k|    temp5 = _mm_madd_epi16(src_r1, temp5);
  137|  29.4k|    temp6 = _mm_madd_epi16(src_r2, temp6);
  138|  29.4k|    temp7 = _mm_madd_epi16(src_r3, temp7);
  139|       |
  140|  29.4k|    if(u4_qp_div_6 >= 4)
  ------------------
  |  Branch (140:8): [True: 9.81k, False: 19.6k]
  ------------------
  141|  9.81k|    {
  142|  9.81k|        resq_r0 = _mm_slli_epi32(temp4, u4_qp_div_6 - 4);
  143|  9.81k|        resq_r1 = _mm_slli_epi32(temp5, u4_qp_div_6 - 4);
  144|  9.81k|        resq_r2 = _mm_slli_epi32(temp6, u4_qp_div_6 - 4);
  145|  9.81k|        resq_r3 = _mm_slli_epi32(temp7, u4_qp_div_6 - 4);
  146|  9.81k|    }
  147|  19.6k|    else
  148|  19.6k|    {
  149|  19.6k|        temp4 = _mm_add_epi32(temp4, add_rshift);
  150|  19.6k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  151|  19.6k|        temp6 = _mm_add_epi32(temp6, add_rshift);
  152|  19.6k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  153|  19.6k|        resq_r0 = _mm_srai_epi32(temp4, 4 - u4_qp_div_6);
  154|  19.6k|        resq_r1 = _mm_srai_epi32(temp5, 4 - u4_qp_div_6);
  155|  19.6k|        resq_r2 = _mm_srai_epi32(temp6, 4 - u4_qp_div_6);
  156|  19.6k|        resq_r3 = _mm_srai_epi32(temp7, 4 - u4_qp_div_6);
  157|  19.6k|    }
  158|       |
  159|  29.4k|    if(iq_start_idx == 1) resq_r0 = _mm_insert_epi32(resq_r0, (WORD32) pi2_dc_ld_addr[0], 0);
  ------------------
  |  Branch (159:8): [True: 0, False: 29.4k]
  ------------------
  160|       |    /* Perform Inverse transform */
  161|       |    /*-------------------------------------------------------------*/
  162|       |    /* IDCT [ Horizontal transformation ]                          */
  163|       |    /*-------------------------------------------------------------*/
  164|       |    // Matrix transpose
  165|       |    /*
  166|       |     *  a0 a1 a2 a3
  167|       |     *  b0 b1 b2 b3
  168|       |     *  c0 c1 c2 c3
  169|       |     *  d0 d1 d2 d3
  170|       |     */
  171|  29.4k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 b0 a1 b1
  172|  29.4k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // c0 d0 c1 d1
  173|  29.4k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // a2 b2 a3 b3
  174|  29.4k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 d2 c3 d3
  175|  29.4k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 b0 c0 d0
  176|  29.4k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // a1 b1 c1 d1
  177|  29.4k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // a2 b2 c2 d2
  178|  29.4k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);    // a3 b3 c3 d3
  179|       |    // Transform starts -- horizontal transform
  180|       |    /*------------------------------------------------------------------*/
  181|       |    /* z0 = w0 + w2                                             */
  182|  29.4k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  183|       |    /* z1 = w0 - w2                                             */
  184|  29.4k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  185|       |    /* z2 = (w1 >> 1) - w3                                      */
  186|  29.4k|    temp2 = _mm_srai_epi32(resq_r1, 1);     //(w1>>1)
  187|  29.4k|    temp2 = _mm_sub_epi32(temp2, resq_r3);  //(w1>>1) - w3
  188|       |    /* z3 = w1 + (w3 >> 1)                                      */
  189|  29.4k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(w3>>1) + w1
  190|  29.4k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  191|       |    /*----------------------------------------------------------*/
  192|       |    /* x0 = z0 + z3                                             */
  193|  29.4k|    resq_r0 = _mm_add_epi32(temp0, temp3);
  194|       |    /* x1 = z1 + z2                                             */
  195|  29.4k|    resq_r1 = _mm_add_epi32(temp1, temp2);
  196|       |    /* x2 = z1 - z2                                             */
  197|  29.4k|    resq_r2 = _mm_sub_epi32(temp1, temp2);
  198|       |    /* x3 = z0 - z3                                             */
  199|  29.4k|    resq_r3 = _mm_sub_epi32(temp0, temp3);
  200|       |    // Matrix transpose
  201|       |    /*
  202|       |     *  a0 b0 c0 d0
  203|       |     *  a1 b1 c1 d1
  204|       |     *  a2 b2 c2 d2
  205|       |     *  a3 b3 c3 d3
  206|       |     */
  207|  29.4k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 a1 b0 b1
  208|  29.4k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // a2 a3 b2 b3
  209|  29.4k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // c0 c1 d0 d1
  210|  29.4k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 c3 d2 d3
  211|  29.4k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 a1 a2 a3
  212|  29.4k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // b0 b1 b2 b3
  213|  29.4k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // c0 c1 c2 c3
  214|  29.4k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);    // d0 d1 d2 d3
  215|       |    // Transform ends -- horizontal transform
  216|       |
  217|       |    // Load pred buffer
  218|       |    // p00 p01 p02 p03 0 0 0 0 0 0 0 0 -- all 8 bits
  219|  29.4k|    pred_r0 = _mm_loadl_epi64((__m128i *) (&pu1_pred[0]));
  220|       |    // p10 p11 p12 p13 0 0 0 0 0 0 0 0 -- all 8 bits
  221|  29.4k|    pred_r1 = _mm_loadl_epi64((__m128i *) (&pu1_pred[pred_strd]));
  222|       |    // p20 p21 p22 p23 0 0 0 0 0 0 0 0 -- all 8 bits
  223|  29.4k|    pred_r2 = _mm_loadl_epi64((__m128i *) (&pu1_pred[2 * pred_strd]));
  224|       |    // p30 p31 p32 p33 0 0 0 0 0 0 0 0 -- all 8 bits
  225|  29.4k|    pred_r3 = _mm_loadl_epi64((__m128i *) (&pu1_pred[3 * pred_strd]));
  226|       |
  227|  29.4k|    pred_r0 = _mm_cvtepu8_epi32(pred_r0);  // p00 p01 p02 p03 -- all 32 bits
  228|  29.4k|    pred_r1 = _mm_cvtepu8_epi32(pred_r1);  // p10 p11 p12 p13 -- all 32 bits
  229|  29.4k|    pred_r2 = _mm_cvtepu8_epi32(pred_r2);  // p20 p21 p22 p23 -- all 32 bits
  230|  29.4k|    pred_r3 = _mm_cvtepu8_epi32(pred_r3);  // p30 p31 p32 p33 -- all 32 bits
  231|       |
  232|       |    // Load resd buffer
  233|  29.4k|    rsd_r0 = _mm_loadl_epi64((__m128i *) (&pi2_rsd[0]));
  234|  29.4k|    rsd_r1 = _mm_loadl_epi64((__m128i *) (&pi2_rsd[rsd_strd]));
  235|  29.4k|    rsd_r2 = _mm_loadl_epi64((__m128i *) (&pi2_rsd[2 * rsd_strd]));
  236|  29.4k|    rsd_r3 = _mm_loadl_epi64((__m128i *) (&pi2_rsd[3 * rsd_strd]));
  237|       |
  238|  29.4k|    rsd_r0 = _mm_cvtepi16_epi32(rsd_r0);
  239|  29.4k|    rsd_r1 = _mm_cvtepi16_epi32(rsd_r1);
  240|  29.4k|    rsd_r2 = _mm_cvtepi16_epi32(rsd_r2);
  241|  29.4k|    rsd_r3 = _mm_cvtepi16_epi32(rsd_r3);
  242|       |
  243|       |    /*--------------------------------------------------------------*/
  244|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6      */
  245|       |    /*                                                              */
  246|       |    /* Add the prediction and store it back to same buffer          */
  247|       |    /*--------------------------------------------------------------*/
  248|       |    /* z0j = y0j + y2j                                                        */
  249|  29.4k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  250|       |    /* z1j = y0j - y2j                                                        */
  251|  29.4k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  252|       |    /* z2j = (y1j>>1) - y3j */
  253|  29.4k|    temp2 = _mm_srai_epi32(resq_r1, 1);  //(y1j>>1)
  254|  29.4k|    temp2 = _mm_sub_epi32(temp2, resq_r3);
  255|       |    /* z3j = y1j + (y3j>>1) */
  256|  29.4k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(y3j>>1)
  257|  29.4k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  258|       |
  259|       |    /* x0j = z0j + z3j                                                        */
  260|  29.4k|    temp4 = _mm_add_epi32(temp0, temp3);
  261|  29.4k|    temp4 = _mm_add_epi32(temp4, value_32);
  262|  29.4k|    temp4 = _mm_srai_epi32(temp4, 6);
  263|       |
  264|  29.4k|    row_0 = _mm_test_all_ones(_mm_cmpeq_epi32(temp4, zero_8x16b));  // return 1 if all zeros, else 0
  265|  29.4k|    temp4 = _mm_add_epi32(temp4, rsd_r0);
  266|  29.4k|    temp4 = _mm_min_epi16(dupmax_8x16b, temp4);
  267|  29.4k|    temp4 = _mm_max_epi16(dupmin_8x16b, temp4);
  268|  29.4k|    temp4 = _mm_add_epi32(temp4, pred_r0);
  269|       |    /* x1j = z1j + z2j                                                        */
  270|  29.4k|    temp5 = _mm_add_epi32(temp1, temp2);
  271|  29.4k|    temp5 = _mm_add_epi32(temp5, value_32);
  272|  29.4k|    temp5 = _mm_srai_epi32(temp5, 6);
  273|       |
  274|  29.4k|    row_1 = _mm_test_all_ones(_mm_cmpeq_epi32(temp5, zero_8x16b));  // return 1 if all zeros, else 0
  275|  29.4k|    temp5 = _mm_add_epi32(temp5, rsd_r1);
  276|  29.4k|    temp5 = _mm_min_epi16(dupmax_8x16b, temp5);
  277|  29.4k|    temp5 = _mm_max_epi16(dupmin_8x16b, temp5);
  278|  29.4k|    temp5 = _mm_add_epi32(temp5, pred_r1);
  279|       |    /* x2j = z1j - z2j                                                        */
  280|  29.4k|    temp6 = _mm_sub_epi32(temp1, temp2);
  281|  29.4k|    temp6 = _mm_add_epi32(temp6, value_32);
  282|  29.4k|    temp6 = _mm_srai_epi32(temp6, 6);
  283|       |
  284|  29.4k|    row_2 = _mm_test_all_ones(_mm_cmpeq_epi32(temp6, zero_8x16b));  // return 1 if all zeros, else 0
  285|  29.4k|    temp6 = _mm_add_epi32(temp6, rsd_r2);
  286|  29.4k|    temp6 = _mm_min_epi16(dupmax_8x16b, temp6);
  287|  29.4k|    temp6 = _mm_max_epi16(dupmin_8x16b, temp6);
  288|  29.4k|    temp6 = _mm_add_epi32(temp6, pred_r2);
  289|       |    /* x3j = z0j - z3j                                                        */
  290|  29.4k|    temp7 = _mm_sub_epi32(temp0, temp3);
  291|  29.4k|    temp7 = _mm_add_epi32(temp7, value_32);
  292|  29.4k|    temp7 = _mm_srai_epi32(temp7, 6);
  293|       |
  294|  29.4k|    row_3 = _mm_test_all_ones(_mm_cmpeq_epi32(temp7, zero_8x16b));  // return 1 if all zeros, else 0
  295|  29.4k|    temp7 = _mm_add_epi32(temp7, rsd_r3);
  296|  29.4k|    temp7 = _mm_min_epi16(dupmax_8x16b, temp7);
  297|  29.4k|    temp7 = _mm_max_epi16(dupmin_8x16b, temp7);
  298|  29.4k|    temp7 = _mm_add_epi32(temp7, pred_r3);
  299|       |
  300|       |    // 32-bit to 16-bit conversion
  301|  29.4k|    temp0 = _mm_packs_epi32(temp4, temp5);
  302|  29.4k|    temp1 = _mm_packs_epi32(temp6, temp7);
  303|       |    /*------------------------------------------------------------------*/
  304|       |    // Clipping the results to 8 bits
  305|  29.4k|    sign_reg = _mm_cmpgt_epi16(temp0, zero_8x16b);  // sign check
  306|  29.4k|    temp0 = _mm_and_si128(temp0, sign_reg);
  307|  29.4k|    sign_reg = _mm_cmpgt_epi16(temp1, zero_8x16b);
  308|  29.4k|    temp1 = _mm_and_si128(temp1, sign_reg);
  309|       |
  310|  29.4k|    resq_r0 = _mm_packus_epi16(temp0, temp1);
  311|  29.4k|    resq_r1 = _mm_srli_si128(resq_r0, 4);
  312|  29.4k|    resq_r2 = _mm_srli_si128(resq_r1, 4);
  313|  29.4k|    resq_r3 = _mm_srli_si128(resq_r2, 4);
  314|       |
  315|  29.4k|    *pu4_out = _mm_cvtsi128_si32(resq_r0);
  316|  29.4k|    pu1_out += out_strd;
  317|  29.4k|    pu4_out = (UWORD32 *) (pu1_out);
  318|  29.4k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r1);
  319|  29.4k|    pu1_out += out_strd;
  320|  29.4k|    pu4_out = (UWORD32 *) (pu1_out);
  321|  29.4k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r2);
  322|  29.4k|    pu1_out += out_strd;
  323|  29.4k|    pu4_out = (UWORD32 *) (pu1_out);
  324|  29.4k|    *(pu4_out) = _mm_cvtsi128_si32(resq_r3);
  325|       |
  326|  29.4k|    i4_nnz = !(row_0 && row_1 && row_2 && row_3);
  ------------------
  |  Branch (326:16): [True: 2.23k, False: 27.2k]
  |  Branch (326:25): [True: 1.31k, False: 926]
  |  Branch (326:34): [True: 912, False: 399]
  |  Branch (326:43): [True: 887, False: 25]
  ------------------
  327|  29.4k|    return i4_nnz;
  328|  29.4k|}
isvcd_iquant_itrans_residual_recon_8x8_sse42:
  357|  19.0k|{
  358|  19.0k|    __m128i rsd_r01_b0, rsd_r23_b0, rsd_r45_b2, rsd_r67_b2;
  359|  19.0k|    __m128i rsd_r01_b1, rsd_r23_b1, rsd_r45_b3, rsd_r67_b3;
  360|       |
  361|  19.0k|    WORD32 row_01_b0, row_23_b0, row_45_b2, row_67_b2;
  362|  19.0k|    WORD32 row_01_b1, row_23_b1, row_45_b3, row_67_b3;
  363|  19.0k|    WORD32 i4_nnz, i4_nnz_b0, i4_nnz_b1, i4_nnz_b2, i4_nnz_b3;
  364|  19.0k|    __m128i src_r0;
  365|  19.0k|    __m128i scalemat_r0;
  366|  19.0k|    __m128i zero_8x16b = _mm_setzero_si128();  // all bits reset to zero
  367|  19.0k|    __m128i value_32 = _mm_set1_epi32(32);
  368|  19.0k|    __m128i add_rshift = _mm_set1_epi32((qp_div < 6) ? (1 << (5 - qp_div)) : 0);
  ------------------
  |  Branch (368:41): [True: 13.7k, False: 5.33k]
  ------------------
  369|  19.0k|    __m128i dequant_r0;
  370|  19.0k|    __m128i predload_r;
  371|  19.0k|    __m128i pred_r0_1, pred_r1_1, pred_r2_1, pred_r3_1, pred_r4_1, pred_r5_1, pred_r6_1, pred_r7_1;
  372|       |
  373|  19.0k|    __m128i rsd_r0, rsd_r1, rsd_r2, rsd_r3, rsd_r4, rsd_r5, rsd_r6, rsd_r7;
  374|  19.0k|    __m128i sign_reg;
  375|  19.0k|    __m128i src_r0_1, src_r0_2;
  376|  19.0k|    __m128i scalemat_r0_1, scalemat_r0_2;
  377|  19.0k|    __m128i temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8;
  378|  19.0k|    __m128i temp10, temp11, temp12, temp13, temp14, temp15, temp16, temp17, temp18, temp19, temp20;
  379|       |    // To store dequantization results
  380|  19.0k|    __m128i resq_r0_1, resq_r0_2, resq_r1_1, resq_r1_2, resq_r2_1, resq_r2_2, resq_r3_1, resq_r3_2,
  381|  19.0k|        resq_r4_1, resq_r4_2, resq_r5_1, resq_r5_2, resq_r6_1, resq_r6_2, resq_r7_1, resq_r7_2;
  382|  19.0k|    __m128i dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  19.0k|#define RSD_MAX 255
  ------------------
  383|  19.0k|    __m128i dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  19.0k|#define RSD_MIN -255
  ------------------
  384|       |
  385|  19.0k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  19.0k|#define UNUSED(x) ((void)(x))
  ------------------
  386|  19.0k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  19.0k|#define UNUSED(x) ((void)(x))
  ------------------
  387|  19.0k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  19.0k|#define UNUSED(x) ((void)(x))
  ------------------
  388|       |
  389|       |    /*************************************************************/
  390|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
  391|       |    /* operations on platform. Note : DC coeff is not scaled     */
  392|       |    /*************************************************************/
  393|       |
  394|       |    // Row 0 processing
  395|       |    // a00 a01 a02 a03 a04 a05 a06 a07 -- the source matrix 0th row
  396|  19.0k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src));
  397|       |    // b00 b01 b02 b03 b04 b05 b06 b07 -- the scaling matrix 0th row
  398|  19.0k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat));
  399|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  400|  19.0k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[0]));
  401|  19.0k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  402|  19.0k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);  // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  403|       |    // b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  404|  19.0k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  405|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  406|  19.0k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  407|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  408|  19.0k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  409|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  410|  19.0k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  411|       |    // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  412|  19.0k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  413|       |
  414|  19.0k|    if(qp_div >= 6)
  ------------------
  |  Branch (414:8): [True: 5.33k, False: 13.7k]
  ------------------
  415|  5.33k|    {
  416|  5.33k|        resq_r0_1 = _mm_slli_epi32(temp5, qp_div - 6);
  417|  5.33k|        resq_r0_2 = _mm_slli_epi32(temp7, qp_div - 6);
  418|  5.33k|    }
  419|  13.7k|    else
  420|  13.7k|    {
  421|  13.7k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  422|  13.7k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  423|  13.7k|        resq_r0_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  424|  13.7k|        resq_r0_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  425|  13.7k|    }
  426|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 16
  427|       |    // bit long
  428|  19.0k|    resq_r0_1 = _mm_packs_epi32(resq_r0_1, resq_r0_2);
  429|       |    // Row 1 processing
  430|       |    // a00 a01 a02 a03 a04 a05 a06 a07 a08 --the source matrix 1st row
  431|  19.0k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 8));
  432|       |    // b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 1st row
  433|  19.0k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 8));
  434|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  435|  19.0k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[8]));
  436|       |    // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  437|  19.0k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);
  438|       |    // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  439|  19.0k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);
  440|       |    // b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  441|  19.0k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  442|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  443|  19.0k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  444|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  445|  19.0k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  446|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  447|  19.0k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  448|       |    // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  449|  19.0k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  450|  19.0k|    if(qp_div >= 6)
  ------------------
  |  Branch (450:8): [True: 5.33k, False: 13.7k]
  ------------------
  451|  5.33k|    {
  452|  5.33k|        resq_r1_1 = _mm_slli_epi32(temp5, qp_div - 6);
  453|  5.33k|        resq_r1_2 = _mm_slli_epi32(temp7, qp_div - 6);
  454|  5.33k|    }
  455|  13.7k|    else
  456|  13.7k|    {
  457|  13.7k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  458|  13.7k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  459|  13.7k|        resq_r1_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  460|  13.7k|        resq_r1_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  461|  13.7k|    }
  462|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 16
  463|       |    // bit long
  464|  19.0k|    resq_r1_1 = _mm_packs_epi32(resq_r1_1, resq_r1_2);
  465|       |    // Row 2 processing
  466|       |    // a00 a01 a02 a03 a04 a05 a06 a07 a08 --the source matrix 2nd row
  467|  19.0k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 16));
  468|       |    // b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 2nd row
  469|  19.0k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 16));
  470|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  471|  19.0k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[16]));
  472|  19.0k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  473|  19.0k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);  // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  474|       |    // b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  475|  19.0k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  476|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  477|  19.0k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  478|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  479|  19.0k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  480|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  481|  19.0k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  482|       |    // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  483|  19.0k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  484|  19.0k|    if(qp_div >= 6)
  ------------------
  |  Branch (484:8): [True: 5.33k, False: 13.7k]
  ------------------
  485|  5.33k|    {
  486|  5.33k|        resq_r2_1 = _mm_slli_epi32(temp5, qp_div - 6);
  487|  5.33k|        resq_r2_2 = _mm_slli_epi32(temp7, qp_div - 6);
  488|  5.33k|    }
  489|  13.7k|    else
  490|  13.7k|    {
  491|  13.7k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  492|  13.7k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  493|  13.7k|        resq_r2_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  494|  13.7k|        resq_r2_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  495|  13.7k|    }
  496|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 -- 16 bit long
  497|  19.0k|    resq_r2_1 = _mm_packs_epi32(resq_r2_1, resq_r2_2);
  498|       |    // Row 3 processing
  499|       |    // a00 a01 a02 a03 a04 a05 a06 a07 a08 --the source matrix 3rd row
  500|  19.0k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 24));
  501|       |    // b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 3rd row
  502|  19.0k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 24));
  503|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  504|  19.0k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[24]));
  505|  19.0k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  506|  19.0k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);  // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  507|       |    // b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  508|  19.0k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  509|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  510|  19.0k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  511|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  512|  19.0k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  513|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 - 32 bits long
  514|  19.0k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  515|       |    // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  516|  19.0k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  517|  19.0k|    if(qp_div >= 6)
  ------------------
  |  Branch (517:8): [True: 5.33k, False: 13.7k]
  ------------------
  518|  5.33k|    {
  519|  5.33k|        resq_r3_1 = _mm_slli_epi32(temp5, qp_div - 6);
  520|  5.33k|        resq_r3_2 = _mm_slli_epi32(temp7, qp_div - 6);
  521|  5.33k|    }
  522|  13.7k|    else
  523|  13.7k|    {
  524|  13.7k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  525|  13.7k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  526|  13.7k|        resq_r3_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  527|  13.7k|        resq_r3_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  528|  13.7k|    }
  529|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 .... -- 16 bit long
  530|  19.0k|    resq_r3_1 = _mm_packs_epi32(resq_r3_1, resq_r3_2);
  531|       |    // Row 4 processing
  532|       |    // a00 a01 a02 a03 a04 a05 a06 a07 a08 --the source matrix 4th row
  533|  19.0k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 32));
  534|       |    // b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 4th row
  535|  19.0k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 32));
  536|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  537|  19.0k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[32]));
  538|  19.0k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  539|  19.0k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);  // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  540|       |    // b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  541|  19.0k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  542|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  543|  19.0k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  544|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  545|  19.0k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  546|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  547|  19.0k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  548|       |    // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  549|  19.0k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  550|  19.0k|    if(qp_div >= 6)
  ------------------
  |  Branch (550:8): [True: 5.33k, False: 13.7k]
  ------------------
  551|  5.33k|    {
  552|  5.33k|        resq_r4_1 = _mm_slli_epi32(temp5, qp_div - 6);
  553|  5.33k|        resq_r4_2 = _mm_slli_epi32(temp7, qp_div - 6);
  554|  5.33k|    }
  555|  13.7k|    else
  556|  13.7k|    {
  557|  13.7k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  558|  13.7k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  559|  13.7k|        resq_r4_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  560|  13.7k|        resq_r4_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  561|  13.7k|    }
  562|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5  -- 16 bit long
  563|  19.0k|    resq_r4_1 = _mm_packs_epi32(resq_r4_1, resq_r4_2);
  564|       |    // Row 5 processing
  565|       |    // a00 a01 a02 a03 a04 a05 a06 a07 a08 --the source matrix 5th row
  566|  19.0k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 40));
  567|       |    //
  568|       |    // b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 5th row
  569|  19.0k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 40));
  570|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  571|  19.0k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[40]));
  572|  19.0k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  573|  19.0k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);  // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  574|       |    // b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  575|  19.0k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  576|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  577|  19.0k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  578|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  579|  19.0k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  580|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  581|  19.0k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  582|       |    // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  583|  19.0k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  584|  19.0k|    if(qp_div >= 6)
  ------------------
  |  Branch (584:8): [True: 5.33k, False: 13.7k]
  ------------------
  585|  5.33k|    {
  586|  5.33k|        resq_r5_1 = _mm_slli_epi32(temp5, qp_div - 6);
  587|  5.33k|        resq_r5_2 = _mm_slli_epi32(temp7, qp_div - 6);
  588|  5.33k|    }
  589|  13.7k|    else
  590|  13.7k|    {
  591|  13.7k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  592|  13.7k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  593|  13.7k|        resq_r5_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  594|  13.7k|        resq_r5_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  595|  13.7k|    }
  596|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 -- 16 bit long
  597|  19.0k|    resq_r5_1 = _mm_packs_epi32(resq_r5_1, resq_r5_2);
  598|       |    // Row 6 processing
  599|       |    // a00 a01 a02 a03 a04 a05 a06 a07 a08 --the source matrix 6th row
  600|  19.0k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 48));
  601|       |    // b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 6th row
  602|  19.0k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 48));
  603|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  604|  19.0k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[48]));
  605|  19.0k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  606|  19.0k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);  // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  607|       |    // b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  608|  19.0k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  609|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  610|  19.0k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  611|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  612|  19.0k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  613|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  614|  19.0k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  615|       |    // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  616|  19.0k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  617|  19.0k|    if(qp_div >= 6)
  ------------------
  |  Branch (617:8): [True: 5.33k, False: 13.7k]
  ------------------
  618|  5.33k|    {
  619|  5.33k|        resq_r6_1 = _mm_slli_epi32(temp5, qp_div - 6);
  620|  5.33k|        resq_r6_2 = _mm_slli_epi32(temp7, qp_div - 6);
  621|  5.33k|    }
  622|  13.7k|    else
  623|  13.7k|    {
  624|  13.7k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  625|  13.7k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  626|  13.7k|        resq_r6_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  627|  13.7k|        resq_r6_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  628|  13.7k|    }
  629|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 -- 16 bit long
  630|  19.0k|    resq_r6_1 = _mm_packs_epi32(resq_r6_1, resq_r6_2);
  631|       |    // Row 7 processing
  632|       |    // a00 a01 a02 a03 a04 a05 a06 a07 a08 --the source matrix 7th row
  633|  19.0k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 56));
  634|       |    // b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 7th row
  635|  19.0k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 56));
  636|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  637|  19.0k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[56]));
  638|  19.0k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  639|  19.0k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);  // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  640|       |    // b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  641|  19.0k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  642|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  643|  19.0k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  644|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  645|  19.0k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  646|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  647|  19.0k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  648|       |    // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  649|  19.0k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  650|  19.0k|    if(qp_div >= 6)
  ------------------
  |  Branch (650:8): [True: 5.33k, False: 13.7k]
  ------------------
  651|  5.33k|    {
  652|  5.33k|        resq_r7_1 = _mm_slli_epi32(temp5, qp_div - 6);
  653|  5.33k|        resq_r7_2 = _mm_slli_epi32(temp7, qp_div - 6);
  654|  5.33k|    }
  655|  13.7k|    else
  656|  13.7k|    {
  657|  13.7k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  658|  13.7k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  659|  13.7k|        resq_r7_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  660|  13.7k|        resq_r7_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  661|  13.7k|    }
  662|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 -- 16 bit long
  663|  19.0k|    resq_r7_1 = _mm_packs_epi32(resq_r7_1, resq_r7_2);
  664|       |
  665|       |    /* Perform Inverse transform */
  666|       |    /*--------------------------------------------------------------------*/
  667|       |    /* IDCT [ Horizontal transformation ]                                 */
  668|       |    /*--------------------------------------------------------------------*/
  669|       |    // Matrix transpose
  670|       |    /*
  671|       |     *  a0 a1 a2 a3 a4 a5 a6 a7
  672|       |     *  b0 b1 b2 b3 b4 b5 b6 b7
  673|       |     *  c0 c1 c2 c3 c4 c5 c6 c7
  674|       |     *  d0 d1 d2 d3 d4 d5 d6 d7
  675|       |     */
  676|  19.0k|    temp1 = _mm_unpacklo_epi16(resq_r0_1, resq_r1_1);  // a0 b0 a1 b1 a2 b2 a3 b3
  677|  19.0k|    temp3 = _mm_unpacklo_epi16(resq_r2_1, resq_r3_1);  // c0 d0 c1 d1 c2 d2 c3 d3
  678|  19.0k|    temp2 = _mm_unpackhi_epi16(resq_r0_1, resq_r1_1);  // a4 b4 a5 b5 a6 b6 a7 b7
  679|  19.0k|    temp4 = _mm_unpackhi_epi16(resq_r2_1, resq_r3_1);  // c4 d4 c5 d5 c6 d6 c7 d7
  680|  19.0k|    resq_r0_1 = _mm_unpacklo_epi32(temp1, temp3);      // a0 b0 c0 d0 a1 b1 c1 d1
  681|  19.0k|    resq_r1_1 = _mm_unpackhi_epi32(temp1, temp3);      // a2 b2 c2 d2 a3 b3 c3 d3
  682|  19.0k|    resq_r2_1 = _mm_unpacklo_epi32(temp2, temp4);      // a4 b4 c4 d4 a5 b5 c5 d5
  683|  19.0k|    resq_r3_1 = _mm_unpackhi_epi32(temp2, temp4);      // a6 b6 c6 d6 a7 b7 c7 d7
  684|       |    /*
  685|       |     * e0 e1 e2 e3 e4 e5 e6 e7
  686|       |     * f0 f1 f2 f3 f4 f5 f6 f7
  687|       |     * g0 g1 g2 g3 g4 g5 g6 g7
  688|       |     * h0 h1 h2 h3 h4 h5 h6 h7
  689|       |     */
  690|  19.0k|    temp1 = _mm_unpacklo_epi16(resq_r4_1, resq_r5_1);  // e0 f0 e1 f1 e2 f2 e2 f3
  691|  19.0k|    temp3 = _mm_unpacklo_epi16(resq_r6_1, resq_r7_1);  // g0 h0 g1 h1 g2 h2 g3 h3
  692|  19.0k|    temp2 = _mm_unpackhi_epi16(resq_r4_1, resq_r5_1);  // e4 f4 e5 f5 e6 f6 e7 f7
  693|  19.0k|    temp4 = _mm_unpackhi_epi16(resq_r6_1, resq_r7_1);  // g4 h4 g5 h5 g6 h6 g7 h7
  694|  19.0k|    resq_r4_1 = _mm_unpacklo_epi32(temp1, temp3);      // e0 f0 g0 h0 e1 f1 g1 h1
  695|  19.0k|    resq_r5_1 = _mm_unpackhi_epi32(temp1, temp3);      // e2 f2 g2 h2 e3 f3 g3 h3
  696|  19.0k|    resq_r6_1 = _mm_unpacklo_epi32(temp2, temp4);      // e4 f4 g4 h4 e5 f5 g5 h5
  697|  19.0k|    resq_r7_1 = _mm_unpackhi_epi32(temp2, temp4);      // e6 f6 g6 h6 e7 f7 g7 h7
  698|       |    /*
  699|       |     * a0 b0 c0 d0 a1 b1 c1 d1
  700|       |     * a2 b2 c2 d2 a3 b3 c3 d3
  701|       |     * a4 b4 c4 d4 a5 b5 c5 d5
  702|       |     * a6 b6 c6 d6 a7 b7 c7 d7
  703|       |     * e0 f0 g0 h0 e1 f1 g1 h1
  704|       |     * e2 f2 g2 h2 e3 f3 g3 h3
  705|       |     * e4 f4 g4 h4 e5 f5 g5 h5
  706|       |     * e6 f6 g6 h6 e7 f7 g7 h7
  707|       |     */
  708|  19.0k|    resq_r0_2 = _mm_unpacklo_epi64(resq_r0_1, resq_r4_1);  // a0 b0 c0 d0 e0 f0 g0 h0
  709|  19.0k|    resq_r1_2 = _mm_unpackhi_epi64(resq_r0_1, resq_r4_1);  // a1 b1 c1 d1 e1 f1 g1 h1
  710|  19.0k|    resq_r2_2 = _mm_unpacklo_epi64(resq_r1_1, resq_r5_1);  // a2 b2 c2 d2 e2 f2 g2 h2
  711|  19.0k|    resq_r3_2 = _mm_unpackhi_epi64(resq_r1_1, resq_r5_1);  // a3 b3 c3 d3 e3 f3 g3 h3
  712|  19.0k|    resq_r4_2 = _mm_unpacklo_epi64(resq_r2_1, resq_r6_1);  // a4 b4 c4 d4 e4 f4 g4 h4
  713|  19.0k|    resq_r5_2 = _mm_unpackhi_epi64(resq_r2_1, resq_r6_1);  // a5 b5 c5 d5 e5 f5 g5 h5
  714|  19.0k|    resq_r6_2 = _mm_unpacklo_epi64(resq_r3_1, resq_r7_1);  // a6 b6 c6 d6 e6 f6 g6 h6
  715|  19.0k|    resq_r7_2 = _mm_unpackhi_epi64(resq_r3_1, resq_r7_1);  // a7 b7 c7 d7 e7 f7 g7 h7
  716|       |
  717|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r1_2);
  718|  19.0k|    resq_r1_1 = _mm_unpacklo_epi16(resq_r1_2, sign_reg);  // a1 b1 c1 d1 -- 32 bit
  719|  19.0k|    resq_r1_2 = _mm_unpackhi_epi16(resq_r1_2, sign_reg);  // e1 f1 g1 h1 -- 32 bit
  720|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r3_2);
  721|  19.0k|    resq_r3_1 = _mm_unpacklo_epi16(resq_r3_2, sign_reg);  // a3 b3 c3 d3 -- 32 bit
  722|  19.0k|    resq_r3_2 = _mm_unpackhi_epi16(resq_r3_2, sign_reg);  // e3 f3 g3 h3 -- 32 bit
  723|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r5_2);
  724|  19.0k|    resq_r5_1 = _mm_unpacklo_epi16(resq_r5_2, sign_reg);  // a5 b5 c5 d5 -- 32 bit
  725|  19.0k|    resq_r5_2 = _mm_unpackhi_epi16(resq_r5_2, sign_reg);  // e5 f5 g5 h5 -- 32 bit
  726|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r7_2);
  727|  19.0k|    resq_r7_1 = _mm_unpacklo_epi16(resq_r7_2, sign_reg);  // a7 b7 c7 d7 -- 32 bit
  728|  19.0k|    resq_r7_2 = _mm_unpackhi_epi16(resq_r7_2, sign_reg);  // e7 f7 g7 h7 -- 32 bit
  729|       |    // Transform starts -- horizontal transform
  730|       |    /*------------------------------------------------------------------*/
  731|       |    /* y0 = w0 + w4                                                     */
  732|  19.0k|    temp1 = _mm_add_epi16(resq_r0_2, resq_r4_2);
  733|       |    /* y2 = w0 - w4                                                      */
  734|  19.0k|    temp3 = _mm_sub_epi16(resq_r0_2, resq_r4_2);
  735|       |    /* y1 = -w3 + w5 - w7 - (w7 >> 1)                                   */
  736|  19.0k|    temp2 = _mm_sub_epi32(resq_r5_1, resq_r3_1);  //-w3+w5
  737|  19.0k|    temp10 = _mm_sub_epi32(resq_r5_2, resq_r3_2);
  738|  19.0k|    temp4 = _mm_sub_epi32(temp2, resq_r7_1);      //-w3+w5-w7
  739|  19.0k|    temp12 = _mm_sub_epi32(temp10, resq_r7_2);
  740|  19.0k|    temp5 = _mm_srai_epi32(resq_r7_1, 1);         // w7>>1
  741|  19.0k|    temp13 = _mm_srai_epi32(resq_r7_2, 1);
  742|  19.0k|    temp2 = _mm_sub_epi32(temp4, temp5);          //-w3+w5-w7 -(w7>>1)
  743|  19.0k|    temp10 = _mm_sub_epi32(temp12, temp13);
  744|  19.0k|    temp2 = _mm_packs_epi32(temp2, temp10);
  745|       |    /* y3 = w1 + w7 - w3 - (w3 >> 1)                                    */
  746|  19.0k|    temp4 = _mm_add_epi32(resq_r1_1, resq_r7_1);  // w1+w7
  747|  19.0k|    temp12 = _mm_add_epi32(resq_r1_2, resq_r7_2);
  748|  19.0k|    temp4 = _mm_sub_epi32(temp4, resq_r3_1);      // w1+w7-w3
  749|  19.0k|    temp12 = _mm_sub_epi32(temp12, resq_r3_2);
  750|  19.0k|    temp5 = _mm_srai_epi32(resq_r3_1, 1);         // w3>>1
  751|  19.0k|    temp13 = _mm_srai_epi32(resq_r3_2, 1);
  752|  19.0k|    temp4 = _mm_sub_epi32(temp4, temp5);          // w1+w7-w3-(w3>>1)
  753|  19.0k|    temp12 = _mm_sub_epi32(temp12, temp13);
  754|  19.0k|    temp4 = _mm_packs_epi32(temp4, temp12);
  755|       |    /* y4 = (w2 >> 1) - w6                                              */
  756|  19.0k|    temp5 = _mm_srai_epi16(resq_r2_2, 1);     // w2>>1
  757|  19.0k|    temp5 = _mm_sub_epi16(temp5, resq_r6_2);  //(w2>>1)-w6
  758|       |    /* y5 = -w1 + w7 + w5 + (w5 >> 1)                                   */
  759|  19.0k|    temp6 = _mm_sub_epi32(resq_r7_1, resq_r1_1);  // w7-w1
  760|  19.0k|    temp14 = _mm_sub_epi32(resq_r7_2, resq_r1_2);
  761|  19.0k|    temp6 = _mm_add_epi32(temp6, resq_r5_1);      // w7-w1+w5
  762|  19.0k|    temp14 = _mm_add_epi32(temp14, resq_r5_2);
  763|  19.0k|    temp7 = _mm_srai_epi32(resq_r5_1, 1);         // w5>>1
  764|  19.0k|    temp15 = _mm_srai_epi32(resq_r5_2, 1);
  765|  19.0k|    temp6 = _mm_add_epi32(temp6, temp7);          // w7-w1_w5+(w5>>1)
  766|  19.0k|    temp14 = _mm_add_epi32(temp14, temp15);
  767|  19.0k|    temp6 = _mm_packs_epi32(temp6, temp14);
  768|       |    /* y6 = w2 + (w6 >> 1)                                              */
  769|  19.0k|    temp7 = _mm_srai_epi16(resq_r6_2, 1);     // w6>>1
  770|  19.0k|    temp7 = _mm_add_epi16(temp7, resq_r2_2);  //(w6>>1)+w2
  771|       |    /* y7 = w3 + w5 + w1 + (w1 >> 1)                                    */
  772|  19.0k|    temp8 = _mm_add_epi32(resq_r3_1, resq_r5_1);  // w3+w5
  773|  19.0k|    temp16 = _mm_add_epi32(resq_r3_2, resq_r5_2);
  774|  19.0k|    temp8 = _mm_add_epi32(temp8, resq_r1_1);      // w3+w5+w1
  775|  19.0k|    temp16 = _mm_add_epi32(temp16, resq_r1_2);
  776|  19.0k|    temp17 = _mm_srai_epi32(resq_r1_1, 1);        // w1>>1
  777|  19.0k|    temp18 = _mm_srai_epi32(resq_r1_2, 1);
  778|  19.0k|    temp8 = _mm_add_epi32(temp8, temp17);         // w3+w5+w1+(w1>>1)
  779|  19.0k|    temp16 = _mm_add_epi32(temp16, temp18);
  780|  19.0k|    temp8 = _mm_packs_epi32(temp8, temp16);
  781|       |    /*------------------------------------------------------------------*/
  782|       |    /*------------------------------------------------------------------*/
  783|       |    /* z0 = y0 + y6                                                        */
  784|  19.0k|    resq_r0_1 = _mm_add_epi16(temp1, temp7);
  785|       |    /* z1 = y1 + (y7 >> 2)                                                */
  786|  19.0k|    resq_r1_1 = _mm_srai_epi16(temp8, 2);
  787|  19.0k|    resq_r1_1 = _mm_add_epi16(resq_r1_1, temp2);
  788|       |    /* z2 = y2 + y4                                                        */
  789|  19.0k|    resq_r2_1 = _mm_add_epi16(temp3, temp5);
  790|       |    /* z3 = y3 + (y5 >> 2)                                                */
  791|  19.0k|    resq_r3_1 = _mm_srai_epi16(temp6, 2);
  792|  19.0k|    resq_r3_1 = _mm_add_epi16(resq_r3_1, temp4);
  793|       |    /* z4 = y2 - y4                                                        */
  794|  19.0k|    resq_r4_1 = _mm_sub_epi16(temp3, temp5);
  795|       |    /* z5 = (y3 >> 2) - y5                                                 */
  796|  19.0k|    resq_r5_1 = _mm_srai_epi16(temp4, 2);
  797|  19.0k|    resq_r5_1 = _mm_sub_epi16(resq_r5_1, temp6);
  798|       |    /* z6 = y0 - y6                                                     */
  799|  19.0k|    resq_r6_1 = _mm_sub_epi16(temp1, temp7);
  800|       |    /* z7 = y7 - (y1 >> 2)                                                 */
  801|  19.0k|    resq_r7_1 = _mm_srai_epi16(temp2, 2);
  802|  19.0k|    resq_r7_1 = _mm_sub_epi16(temp8, resq_r7_1);
  803|       |    /*------------------------------------------------------------------*/
  804|       |    /*------------------------------------------------------------------*/
  805|       |    /* x0 = z0 + z7                                                        */
  806|  19.0k|    temp1 = _mm_add_epi16(resq_r0_1, resq_r7_1);
  807|       |    /* x1 = z2 + z5                                                        */
  808|  19.0k|    temp2 = _mm_add_epi16(resq_r2_1, resq_r5_1);
  809|       |    /* x2 = z4 + z3                                                        */
  810|  19.0k|    temp3 = _mm_add_epi16(resq_r4_1, resq_r3_1);
  811|       |    /* x3 = z6 + z1                                                        */
  812|  19.0k|    temp4 = _mm_add_epi16(resq_r6_1, resq_r1_1);
  813|       |    /* x4 = z6 - z1                                                        */
  814|  19.0k|    temp5 = _mm_sub_epi16(resq_r6_1, resq_r1_1);
  815|       |    /* x5 = z4 - z3                                                        */
  816|  19.0k|    temp6 = _mm_sub_epi16(resq_r4_1, resq_r3_1);
  817|       |    /* x6 = z2 - z5                                                        */
  818|  19.0k|    temp7 = _mm_sub_epi16(resq_r2_1, resq_r5_1);
  819|       |    /* x7 = z0 - z7                                                        */
  820|  19.0k|    temp8 = _mm_sub_epi16(resq_r0_1, resq_r7_1);
  821|       |    /*------------------------------------------------------------------*/
  822|       |    // Matrix transpose
  823|       |    /*
  824|       |     *  a0 b0 c0 d0 e0 f0 g0 h0
  825|       |     *  a1 b1 c1 d1 e1 f1 g1 h1
  826|       |     *  a2 b2 c2 d2 e2 f2 g2 h2
  827|       |     *  a3 b3 c3 d3 e3 f3 g3 h3
  828|       |     */
  829|  19.0k|    temp17 = _mm_unpacklo_epi16(temp1, temp2);       // a0 a1 b0 b1 c0 c1 d0 d1
  830|  19.0k|    temp19 = _mm_unpacklo_epi16(temp3, temp4);       // a2 a3 b2 b3 c2 c3 d2 d3
  831|  19.0k|    temp18 = _mm_unpackhi_epi16(temp1, temp2);       // e0 e1 f0 f1 g0 g1 h0 h1
  832|  19.0k|    temp20 = _mm_unpackhi_epi16(temp3, temp4);       // e2 e3 f2 f3 g2 g3 h2 h3
  833|       |
  834|  19.0k|    resq_r0_1 = _mm_unpacklo_epi32(temp17, temp19);  // a0 a1 a2 a3 b0 b1 b2 b3
  835|  19.0k|    resq_r1_1 = _mm_unpackhi_epi32(temp17, temp19);  // c0 c1 c2 c3 d0 d1 d2 d3
  836|  19.0k|    resq_r2_1 = _mm_unpacklo_epi32(temp18, temp20);  // e0 e1 e2 e3 f0 f1 f2 f3
  837|  19.0k|    resq_r3_1 = _mm_unpackhi_epi32(temp18, temp20);  // g0 g2 g2 g3 h0 h1 h2 h3
  838|       |    /*
  839|       |     *  a4 b4 c4 d4 e4 f4 g4 h4
  840|       |     *  a5 b5 c5 d5 e5 f5 g5 h5
  841|       |     *  a6 b6 c6 d6 e6 f6 g6 h6
  842|       |     *  a7 b7 c7 d7 e7 f7 g7 h7
  843|       |     */
  844|  19.0k|    temp17 = _mm_unpacklo_epi16(temp5, temp6);       // a4 a5 b4 b5 c4 c5 d4 d5
  845|  19.0k|    temp19 = _mm_unpacklo_epi16(temp7, temp8);       // a6 a7 b6 b7 c6 c7 d6 d7
  846|  19.0k|    temp18 = _mm_unpackhi_epi16(temp5, temp6);       // e4 e5 f4 f5 g4 g5 h4 h5
  847|  19.0k|    temp20 = _mm_unpackhi_epi16(temp7, temp8);       // e6 e7 f6 f7 g6 g7 h6 h7
  848|       |
  849|  19.0k|    resq_r4_1 = _mm_unpacklo_epi32(temp17, temp19);  // a4 a5 a6 a7 b4 b5 b6 b7
  850|  19.0k|    resq_r5_1 = _mm_unpackhi_epi32(temp17, temp19);  // c4 c5 c6 c7 d4 d5 d6 d7
  851|  19.0k|    resq_r6_1 = _mm_unpacklo_epi32(temp18, temp20);  // e4 e5 e6 e7 f4 f5 f6 f7
  852|  19.0k|    resq_r7_1 = _mm_unpackhi_epi32(temp18, temp20);  // g4 g5 g6 g7 h4 h5 h6 h7
  853|       |    /*  a0 a1 a2 a3 b0 b1 b2 b3
  854|       |     *  c0 c1 c2 c3 d0 d1 d2 d3
  855|       |     *  e0 e1 e2 e3 f0 f1 f2 f3
  856|       |     *  g0 g2 g2 g3 h0 h1 h2 h3
  857|       |     *  a4 a5 a6 a7 b4 b5 b6 b7
  858|       |     *  c4 c5 c6 c7 d4 d5 d6 d7
  859|       |     *  e4 e5 e6 e7 f4 f5 f6 f7
  860|       |     *  g4 g5 g6 g7 h4 h5 h6 h7
  861|       |     */
  862|  19.0k|    resq_r0_2 = _mm_unpacklo_epi64(resq_r0_1, resq_r4_1);  // a0 a1 a2 a3 a4 a5 a6 a7
  863|  19.0k|    resq_r1_2 = _mm_unpackhi_epi64(resq_r0_1, resq_r4_1);  // b0 b1 b2 b3 b4 b5 b6 b7
  864|  19.0k|    resq_r2_2 = _mm_unpacklo_epi64(resq_r1_1, resq_r5_1);  // c0 c1 c2 c3 c4 c5 c6 c7
  865|  19.0k|    resq_r3_2 = _mm_unpackhi_epi64(resq_r1_1, resq_r5_1);  // d0 d1 d2 d3 d4 d5 d6 d7
  866|  19.0k|    resq_r4_2 = _mm_unpacklo_epi64(resq_r2_1, resq_r6_1);  // e0 e1 e2 e3 e4 e5 e6 e7
  867|  19.0k|    resq_r5_2 = _mm_unpackhi_epi64(resq_r2_1, resq_r6_1);  // f0 f1 f2 f3 f4 f5 f6 f7
  868|  19.0k|    resq_r6_2 = _mm_unpacklo_epi64(resq_r3_1, resq_r7_1);  // g0 g1 g2 g3 g4 g5 g6 g7
  869|  19.0k|    resq_r7_2 = _mm_unpackhi_epi64(resq_r3_1, resq_r7_1);  // h0 h1 h2 h3 h4 h5 h6 h7
  870|       |
  871|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r1_2);
  872|  19.0k|    resq_r1_1 = _mm_unpacklo_epi16(resq_r1_2, sign_reg);  // a1 b1 c1 d1 -- 32 bit
  873|  19.0k|    resq_r1_2 = _mm_unpackhi_epi16(resq_r1_2, sign_reg);  // e1 f1 g1 h1 -- 32 bit
  874|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r3_2);
  875|  19.0k|    resq_r3_1 = _mm_unpacklo_epi16(resq_r3_2, sign_reg);  // a3 b3 c3 d3 -- 32 bit
  876|  19.0k|    resq_r3_2 = _mm_unpackhi_epi16(resq_r3_2, sign_reg);  // e3 f3 g3 h3 -- 32 bit
  877|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r5_2);
  878|  19.0k|    resq_r5_1 = _mm_unpacklo_epi16(resq_r5_2, sign_reg);  // a5 b5 c5 d5 -- 32 bit
  879|  19.0k|    resq_r5_2 = _mm_unpackhi_epi16(resq_r5_2, sign_reg);  // e5 f5 g5 h5 -- 32 bit
  880|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r7_2);
  881|  19.0k|    resq_r7_1 = _mm_unpacklo_epi16(resq_r7_2, sign_reg);  // a7 b7 c7 d7 -- 32 bit
  882|  19.0k|    resq_r7_2 = _mm_unpackhi_epi16(resq_r7_2, sign_reg);  // e7 f7 g7 h7 -- 32 bit
  883|       |
  884|  19.0k|    zero_8x16b = _mm_setzero_si128();                     // all bits reset to zero
  885|       |    // Load pred buffer row 0
  886|       |    // p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  887|  19.0k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[0]));
  888|       |    // p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  889|  19.0k|    pred_r0_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b);
  890|       |    // Load pred buffer row 1
  891|       |    // p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  892|  19.0k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[pred_strd]));
  893|       |    // p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  894|  19.0k|    pred_r1_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b);
  895|       |    // Load pred buffer row 2
  896|       |    // p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  897|  19.0k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[2 * pred_strd]));
  898|       |    // p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  899|  19.0k|    pred_r2_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b);
  900|       |    // Load pred buffer row 3
  901|       |    // p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  902|  19.0k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[3 * pred_strd]));
  903|       |    // p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  904|  19.0k|    pred_r3_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b);
  905|       |    // Load pred buffer row 4
  906|       |    // p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  907|  19.0k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[4 * pred_strd]));
  908|       |    // p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  909|  19.0k|    pred_r4_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b);
  910|       |    // Load pred buffer row 5
  911|       |    // p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bit
  912|  19.0k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[5 * pred_strd]));
  913|       |    // p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  914|  19.0k|    pred_r5_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b);
  915|       |    // Load pred buffer row 6
  916|       |    // p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  917|  19.0k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[6 * pred_strd]));
  918|       |    // p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  919|  19.0k|    pred_r6_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b);
  920|       |    // Load pred buffer row 7
  921|       |    // p0 p1 p2 p3 p4 p5 p6 p7 0 0 0 0 0 0 0 0 -- all 8 bits
  922|  19.0k|    predload_r = _mm_loadl_epi64((__m128i *) (&pu1_pred[7 * pred_strd]));
  923|       |    // p0 p1 p2 p3 p4 p5 p6 p7 -- all 16 bits
  924|  19.0k|    pred_r7_1 = _mm_unpacklo_epi8(predload_r, zero_8x16b);
  925|       |
  926|  19.0k|    rsd_r0 = _mm_loadu_si128((__m128i *) (&pi2_rsd[0]));
  927|  19.0k|    rsd_r1 = _mm_loadu_si128((__m128i *) (&pi2_rsd[1 * rsd_strd]));
  928|  19.0k|    rsd_r2 = _mm_loadu_si128((__m128i *) (&pi2_rsd[2 * rsd_strd]));
  929|  19.0k|    rsd_r3 = _mm_loadu_si128((__m128i *) (&pi2_rsd[3 * rsd_strd]));
  930|  19.0k|    rsd_r4 = _mm_loadu_si128((__m128i *) (&pi2_rsd[4 * rsd_strd]));
  931|  19.0k|    rsd_r5 = _mm_loadu_si128((__m128i *) (&pi2_rsd[5 * rsd_strd]));
  932|  19.0k|    rsd_r6 = _mm_loadu_si128((__m128i *) (&pi2_rsd[6 * rsd_strd]));
  933|  19.0k|    rsd_r7 = _mm_loadu_si128((__m128i *) (&pi2_rsd[7 * rsd_strd]));
  934|       |
  935|       |    /*--------------------------------------------------------------------*/
  936|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6            */
  937|       |    /*                                                                    */
  938|       |    /* Add the prediction and store it back to reconstructed frame buffer */
  939|       |    /* [Prediction buffer itself in this case]                            */
  940|       |    /*--------------------------------------------------------------------*/
  941|       |
  942|       |    /* y0j = w0j + w4j                                                     */
  943|  19.0k|    temp1 = _mm_add_epi16(resq_r0_2, resq_r4_2);
  944|       |    /* y2j = w0j - w4j                                                      */
  945|  19.0k|    temp3 = _mm_sub_epi16(resq_r0_2, resq_r4_2);
  946|       |    /* y1j = -w3j + w5j - w7j - (w7j >> 1)                                   */
  947|  19.0k|    temp2 = _mm_sub_epi32(resq_r5_1, resq_r3_1);  //-w3+w5
  948|  19.0k|    temp10 = _mm_sub_epi32(resq_r5_2, resq_r3_2);
  949|  19.0k|    temp4 = _mm_sub_epi32(temp2, resq_r7_1);      //-w3+w5-w7
  950|  19.0k|    temp12 = _mm_sub_epi32(temp10, resq_r7_2);
  951|  19.0k|    temp5 = _mm_srai_epi32(resq_r7_1, 1);         // w7>>1
  952|  19.0k|    temp13 = _mm_srai_epi32(resq_r7_2, 1);
  953|  19.0k|    temp2 = _mm_sub_epi32(temp4, temp5);          //-w3+w5-w7 -(w7>>1)
  954|  19.0k|    temp10 = _mm_sub_epi32(temp12, temp13);
  955|  19.0k|    temp2 = _mm_packs_epi32(temp2, temp10);
  956|       |    /* y3j = w1j + w7j - w3j - (w3j >> 1)                                    */
  957|  19.0k|    temp4 = _mm_add_epi32(resq_r1_1, resq_r7_1);  // w1+w7
  958|  19.0k|    temp12 = _mm_add_epi32(resq_r1_2, resq_r7_2);
  959|  19.0k|    temp4 = _mm_sub_epi32(temp4, resq_r3_1);      // w1+w7-w3
  960|  19.0k|    temp12 = _mm_sub_epi32(temp12, resq_r3_2);
  961|  19.0k|    temp5 = _mm_srai_epi32(resq_r3_1, 1);         // w3>>1
  962|  19.0k|    temp13 = _mm_srai_epi32(resq_r3_2, 1);
  963|  19.0k|    temp4 = _mm_sub_epi32(temp4, temp5);          // w1+w7-w3-(w3>>1)
  964|  19.0k|    temp12 = _mm_sub_epi32(temp12, temp13);
  965|  19.0k|    temp4 = _mm_packs_epi32(temp4, temp12);
  966|       |    /* y4j = (w2j >> 1) - w6j                                              */
  967|  19.0k|    temp5 = _mm_srai_epi16(resq_r2_2, 1);     // w2>>1
  968|  19.0k|    temp5 = _mm_sub_epi16(temp5, resq_r6_2);  //(w2>>1)-w6
  969|       |    /* y5j = -w1j + w7j + w5j + (w5j >> 1)                                   */
  970|  19.0k|    temp6 = _mm_sub_epi32(resq_r7_1, resq_r1_1);  // w7-w1
  971|  19.0k|    temp14 = _mm_sub_epi32(resq_r7_2, resq_r1_2);
  972|  19.0k|    temp6 = _mm_add_epi32(temp6, resq_r5_1);      // w7-w1+w5
  973|  19.0k|    temp14 = _mm_add_epi32(temp14, resq_r5_2);
  974|  19.0k|    temp7 = _mm_srai_epi32(resq_r5_1, 1);         // w5>>1
  975|  19.0k|    temp15 = _mm_srai_epi32(resq_r5_2, 1);
  976|  19.0k|    temp6 = _mm_add_epi32(temp6, temp7);          // w7-w1_w5+(w5>>1)
  977|  19.0k|    temp14 = _mm_add_epi32(temp14, temp15);
  978|  19.0k|    temp6 = _mm_packs_epi32(temp6, temp14);
  979|       |    /* y6j = w2j + (w6j >> 1)                                              */
  980|  19.0k|    temp7 = _mm_srai_epi16(resq_r6_2, 1);     // w6>>1
  981|  19.0k|    temp7 = _mm_add_epi16(temp7, resq_r2_2);  //(w6>>1)+w2
  982|       |    /* y7j = w3j + w5j + w1j + (w1j >> 1)                                    */
  983|  19.0k|    temp8 = _mm_add_epi32(resq_r3_1, resq_r5_1);  // w3+w5
  984|  19.0k|    temp16 = _mm_add_epi32(resq_r3_2, resq_r5_2);
  985|  19.0k|    temp8 = _mm_add_epi32(temp8, resq_r1_1);      // w3+w5+w1
  986|  19.0k|    temp16 = _mm_add_epi32(temp16, resq_r1_2);
  987|  19.0k|    temp17 = _mm_srai_epi32(resq_r1_1, 1);        // w1>>1
  988|  19.0k|    temp18 = _mm_srai_epi32(resq_r1_2, 1);
  989|  19.0k|    temp8 = _mm_add_epi32(temp8, temp17);         // w3+w5+w1+(w1>>1)
  990|  19.0k|    temp16 = _mm_add_epi32(temp16, temp18);
  991|  19.0k|    temp8 = _mm_packs_epi32(temp8, temp16);
  992|       |    /*------------------------------------------------------------------*/
  993|       |    /*------------------------------------------------------------------*/
  994|       |    /* z0j = y0j + y6j                                                        */
  995|  19.0k|    resq_r0_1 = _mm_add_epi16(temp1, temp7);
  996|       |    /* z1j = y1j + (y7j >> 2)                                                */
  997|  19.0k|    resq_r1_1 = _mm_srai_epi16(temp8, 2);
  998|  19.0k|    resq_r1_1 = _mm_add_epi16(resq_r1_1, temp2);
  999|       |    /* z2j = y2j + y4j                                                        */
 1000|  19.0k|    resq_r2_1 = _mm_add_epi16(temp3, temp5);
 1001|       |    /* z3j = y3j + (y5j >> 2)                                                */
 1002|  19.0k|    resq_r3_1 = _mm_srai_epi16(temp6, 2);
 1003|  19.0k|    resq_r3_1 = _mm_add_epi16(resq_r3_1, temp4);
 1004|       |    /* z4j = y2j - y4j                                                        */
 1005|  19.0k|    resq_r4_1 = _mm_sub_epi16(temp3, temp5);
 1006|       |    /* z5j = (y3j >> 2) - y5j                                                 */
 1007|  19.0k|    resq_r5_1 = _mm_srai_epi16(temp4, 2);
 1008|  19.0k|    resq_r5_1 = _mm_sub_epi16(resq_r5_1, temp6);
 1009|       |    /* z6j = y0j - y6j                                                     */
 1010|  19.0k|    resq_r6_1 = _mm_sub_epi16(temp1, temp7);
 1011|       |    /* z7j = y7j - (y1j >> 2)                                                 */
 1012|  19.0k|    resq_r7_1 = _mm_srai_epi16(temp2, 2);
 1013|  19.0k|    resq_r7_1 = _mm_sub_epi16(temp8, resq_r7_1);
 1014|       |    /*------------------------------------------------------------------*/
 1015|       |
 1016|       |    /*------------------------------------------------------------------*/
 1017|       |    /* x0j = z0j + z7j                                                        */
 1018|  19.0k|    temp1 = _mm_add_epi16(resq_r0_1, resq_r7_1);
 1019|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp1);
 1020|  19.0k|    temp10 = _mm_unpacklo_epi16(temp1, sign_reg);
 1021|  19.0k|    temp11 = _mm_unpackhi_epi16(temp1, sign_reg);
 1022|  19.0k|    temp10 = _mm_add_epi32(temp10, value_32);
 1023|  19.0k|    temp11 = _mm_add_epi32(temp11, value_32);
 1024|  19.0k|    temp10 = _mm_srai_epi32(temp10, 6);
 1025|  19.0k|    temp11 = _mm_srai_epi32(temp11, 6);
 1026|  19.0k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1027|  19.0k|    rsd_r0 = _mm_add_epi16(temp10, rsd_r0);
 1028|  19.0k|    rsd_r0 = _mm_min_epi16(dupmax_8x16b, rsd_r0);
 1029|  19.0k|    rsd_r0 = _mm_max_epi16(dupmin_8x16b, rsd_r0);
 1030|  19.0k|    temp1 = _mm_add_epi16(rsd_r0, pred_r0_1);
 1031|       |    /* x1j = z2j + z5j                                                        */
 1032|  19.0k|    temp2 = _mm_add_epi16(resq_r2_1, resq_r5_1);
 1033|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp2);
 1034|  19.0k|    temp10 = _mm_unpacklo_epi16(temp2, sign_reg);
 1035|  19.0k|    temp11 = _mm_unpackhi_epi16(temp2, sign_reg);
 1036|  19.0k|    temp10 = _mm_add_epi32(temp10, value_32);
 1037|  19.0k|    temp11 = _mm_add_epi32(temp11, value_32);
 1038|  19.0k|    temp10 = _mm_srai_epi32(temp10, 6);
 1039|  19.0k|    temp11 = _mm_srai_epi32(temp11, 6);
 1040|  19.0k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1041|  19.0k|    rsd_r1 = _mm_add_epi16(temp10, rsd_r1);
 1042|  19.0k|    rsd_r1 = _mm_min_epi16(dupmax_8x16b, rsd_r1);
 1043|  19.0k|    rsd_r1 = _mm_max_epi16(dupmin_8x16b, rsd_r1);
 1044|  19.0k|    temp2 = _mm_add_epi16(rsd_r1, pred_r1_1);
 1045|       |    /* x2j = z4j + z3j                                                        */
 1046|  19.0k|    temp3 = _mm_add_epi16(resq_r4_1, resq_r3_1);
 1047|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp3);
 1048|  19.0k|    temp10 = _mm_unpacklo_epi16(temp3, sign_reg);
 1049|  19.0k|    temp11 = _mm_unpackhi_epi16(temp3, sign_reg);
 1050|  19.0k|    temp10 = _mm_add_epi32(temp10, value_32);
 1051|  19.0k|    temp11 = _mm_add_epi32(temp11, value_32);
 1052|  19.0k|    temp10 = _mm_srai_epi32(temp10, 6);
 1053|  19.0k|    temp11 = _mm_srai_epi32(temp11, 6);
 1054|  19.0k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1055|  19.0k|    rsd_r2 = _mm_add_epi16(temp10, rsd_r2);
 1056|  19.0k|    rsd_r2 = _mm_min_epi16(dupmax_8x16b, rsd_r2);
 1057|  19.0k|    rsd_r2 = _mm_max_epi16(dupmin_8x16b, rsd_r2);
 1058|  19.0k|    temp3 = _mm_add_epi16(rsd_r2, pred_r2_1);
 1059|       |    /* x3j = z6j + z1j                                                        */
 1060|  19.0k|    temp4 = _mm_add_epi16(resq_r6_1, resq_r1_1);
 1061|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp4);
 1062|  19.0k|    temp10 = _mm_unpacklo_epi16(temp4, sign_reg);
 1063|  19.0k|    temp11 = _mm_unpackhi_epi16(temp4, sign_reg);
 1064|  19.0k|    temp10 = _mm_add_epi32(temp10, value_32);
 1065|  19.0k|    temp11 = _mm_add_epi32(temp11, value_32);
 1066|  19.0k|    temp10 = _mm_srai_epi32(temp10, 6);
 1067|  19.0k|    temp11 = _mm_srai_epi32(temp11, 6);
 1068|  19.0k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1069|  19.0k|    rsd_r3 = _mm_add_epi16(temp10, rsd_r3);
 1070|  19.0k|    rsd_r3 = _mm_min_epi16(dupmax_8x16b, rsd_r3);
 1071|  19.0k|    rsd_r3 = _mm_max_epi16(dupmin_8x16b, rsd_r3);
 1072|  19.0k|    temp4 = _mm_add_epi16(rsd_r3, pred_r3_1);
 1073|       |    /* x4j = z6j - z1j                                                        */
 1074|  19.0k|    temp5 = _mm_sub_epi16(resq_r6_1, resq_r1_1);
 1075|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp5);
 1076|  19.0k|    temp10 = _mm_unpacklo_epi16(temp5, sign_reg);
 1077|  19.0k|    temp11 = _mm_unpackhi_epi16(temp5, sign_reg);
 1078|  19.0k|    temp10 = _mm_add_epi32(temp10, value_32);
 1079|  19.0k|    temp11 = _mm_add_epi32(temp11, value_32);
 1080|  19.0k|    temp10 = _mm_srai_epi32(temp10, 6);
 1081|  19.0k|    temp11 = _mm_srai_epi32(temp11, 6);
 1082|  19.0k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1083|  19.0k|    rsd_r4 = _mm_add_epi16(temp10, rsd_r4);
 1084|  19.0k|    rsd_r4 = _mm_min_epi16(dupmax_8x16b, rsd_r4);
 1085|  19.0k|    rsd_r4 = _mm_max_epi16(dupmin_8x16b, rsd_r4);
 1086|  19.0k|    temp5 = _mm_add_epi16(rsd_r4, pred_r4_1);
 1087|       |    /* x5j = z4j - z3j                                                        */
 1088|  19.0k|    temp6 = _mm_sub_epi16(resq_r4_1, resq_r3_1);
 1089|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp6);
 1090|  19.0k|    temp10 = _mm_unpacklo_epi16(temp6, sign_reg);
 1091|  19.0k|    temp11 = _mm_unpackhi_epi16(temp6, sign_reg);
 1092|  19.0k|    temp10 = _mm_add_epi32(temp10, value_32);
 1093|  19.0k|    temp11 = _mm_add_epi32(temp11, value_32);
 1094|  19.0k|    temp10 = _mm_srai_epi32(temp10, 6);
 1095|  19.0k|    temp11 = _mm_srai_epi32(temp11, 6);
 1096|  19.0k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1097|  19.0k|    rsd_r5 = _mm_add_epi16(temp10, rsd_r5);
 1098|  19.0k|    rsd_r5 = _mm_min_epi16(dupmax_8x16b, rsd_r5);
 1099|  19.0k|    rsd_r5 = _mm_max_epi16(dupmin_8x16b, rsd_r5);
 1100|  19.0k|    temp6 = _mm_add_epi16(rsd_r5, pred_r5_1);
 1101|       |    /* x6j = z2j - z5j                                                        */
 1102|  19.0k|    temp7 = _mm_sub_epi16(resq_r2_1, resq_r5_1);
 1103|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp7);
 1104|  19.0k|    temp10 = _mm_unpacklo_epi16(temp7, sign_reg);
 1105|  19.0k|    temp11 = _mm_unpackhi_epi16(temp7, sign_reg);
 1106|  19.0k|    temp10 = _mm_add_epi32(temp10, value_32);
 1107|  19.0k|    temp11 = _mm_add_epi32(temp11, value_32);
 1108|  19.0k|    temp10 = _mm_srai_epi32(temp10, 6);
 1109|  19.0k|    temp11 = _mm_srai_epi32(temp11, 6);
 1110|  19.0k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1111|  19.0k|    rsd_r6 = _mm_add_epi16(temp10, rsd_r6);
 1112|  19.0k|    rsd_r6 = _mm_min_epi16(dupmax_8x16b, rsd_r6);
 1113|  19.0k|    rsd_r6 = _mm_max_epi16(dupmin_8x16b, rsd_r6);
 1114|  19.0k|    temp7 = _mm_add_epi16(rsd_r6, pred_r6_1);
 1115|       |    /* x7j = z0j - z7j                                                        */
 1116|  19.0k|    temp8 = _mm_sub_epi16(resq_r0_1, resq_r7_1);
 1117|  19.0k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp8);
 1118|  19.0k|    temp10 = _mm_unpacklo_epi16(temp8, sign_reg);
 1119|  19.0k|    temp11 = _mm_unpackhi_epi16(temp8, sign_reg);
 1120|  19.0k|    temp10 = _mm_add_epi32(temp10, value_32);
 1121|  19.0k|    temp11 = _mm_add_epi32(temp11, value_32);
 1122|  19.0k|    temp10 = _mm_srai_epi32(temp10, 6);
 1123|  19.0k|    temp11 = _mm_srai_epi32(temp11, 6);
 1124|  19.0k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1125|  19.0k|    rsd_r7 = _mm_add_epi16(temp10, rsd_r7);
 1126|  19.0k|    rsd_r7 = _mm_min_epi16(dupmax_8x16b, rsd_r7);
 1127|  19.0k|    rsd_r7 = _mm_max_epi16(dupmin_8x16b, rsd_r7);
 1128|  19.0k|    temp8 = _mm_add_epi16(rsd_r7, pred_r7_1);
 1129|       |
 1130|  19.0k|    rsd_r01_b0 = _mm_unpacklo_epi64(rsd_r0, rsd_r1);
 1131|  19.0k|    rsd_r23_b0 = _mm_unpacklo_epi64(rsd_r2, rsd_r3);
 1132|  19.0k|    rsd_r45_b2 = _mm_unpacklo_epi64(rsd_r4, rsd_r5);
 1133|  19.0k|    rsd_r67_b2 = _mm_unpacklo_epi64(rsd_r6, rsd_r7);
 1134|       |
 1135|  19.0k|    rsd_r01_b1 = _mm_unpackhi_epi64(rsd_r0, rsd_r1);
 1136|  19.0k|    rsd_r23_b1 = _mm_unpackhi_epi64(rsd_r2, rsd_r3);
 1137|  19.0k|    rsd_r45_b3 = _mm_unpackhi_epi64(rsd_r4, rsd_r5);
 1138|  19.0k|    rsd_r67_b3 = _mm_unpackhi_epi64(rsd_r6, rsd_r7);
 1139|       |
 1140|  19.0k|    row_01_b0 = _mm_test_all_ones(
 1141|  19.0k|        _mm_cmpeq_epi16(rsd_r01_b0, zero_8x16b));  // return 1 if all zeros, else 0
 1142|  19.0k|    row_23_b0 = _mm_test_all_ones(
 1143|  19.0k|        _mm_cmpeq_epi16(rsd_r23_b0, zero_8x16b));  // return 1 if all zeros, else 0
 1144|  19.0k|    row_45_b2 = _mm_test_all_ones(
 1145|  19.0k|        _mm_cmpeq_epi16(rsd_r45_b2, zero_8x16b));  // return 1 if all zeros, else 0
 1146|  19.0k|    row_67_b2 = _mm_test_all_ones(
 1147|  19.0k|        _mm_cmpeq_epi16(rsd_r67_b2, zero_8x16b));  // return 1 if all zeros, else 0
 1148|       |
 1149|  19.0k|    row_01_b1 = _mm_test_all_ones(
 1150|  19.0k|        _mm_cmpeq_epi16(rsd_r01_b1, zero_8x16b));  // return 1 if all zeros, else 0
 1151|  19.0k|    row_23_b1 = _mm_test_all_ones(
 1152|  19.0k|        _mm_cmpeq_epi16(rsd_r23_b1, zero_8x16b));  // return 1 if all zeros, else 0
 1153|  19.0k|    row_45_b3 = _mm_test_all_ones(
 1154|  19.0k|        _mm_cmpeq_epi16(rsd_r45_b3, zero_8x16b));  // return 1 if all zeros, else 0
 1155|  19.0k|    row_67_b3 = _mm_test_all_ones(
 1156|  19.0k|        _mm_cmpeq_epi16(rsd_r67_b3, zero_8x16b));  // return 1 if all zeros, else 0
 1157|       |
 1158|       |    /*------------------------------------------------------------------*/
 1159|       |    // Clipping the results to 8 bits
 1160|  19.0k|    sign_reg = _mm_cmpgt_epi16(temp1, zero_8x16b);  // sign check
 1161|  19.0k|    temp1 = _mm_and_si128(temp1, sign_reg);
 1162|  19.0k|    sign_reg = _mm_cmpgt_epi16(temp2, zero_8x16b);  // sign check
 1163|  19.0k|    temp2 = _mm_and_si128(temp2, sign_reg);
 1164|  19.0k|    sign_reg = _mm_cmpgt_epi16(temp3, zero_8x16b);  // sign check
 1165|  19.0k|    temp3 = _mm_and_si128(temp3, sign_reg);
 1166|  19.0k|    sign_reg = _mm_cmpgt_epi16(temp4, zero_8x16b);  // sign check
 1167|  19.0k|    temp4 = _mm_and_si128(temp4, sign_reg);
 1168|  19.0k|    sign_reg = _mm_cmpgt_epi16(temp5, zero_8x16b);  // sign check
 1169|  19.0k|    temp5 = _mm_and_si128(temp5, sign_reg);
 1170|  19.0k|    sign_reg = _mm_cmpgt_epi16(temp6, zero_8x16b);  // sign check
 1171|  19.0k|    temp6 = _mm_and_si128(temp6, sign_reg);
 1172|  19.0k|    sign_reg = _mm_cmpgt_epi16(temp7, zero_8x16b);  // sign check
 1173|  19.0k|    temp7 = _mm_and_si128(temp7, sign_reg);
 1174|  19.0k|    sign_reg = _mm_cmpgt_epi16(temp8, zero_8x16b);  // sign check
 1175|  19.0k|    temp8 = _mm_and_si128(temp8, sign_reg);
 1176|       |
 1177|  19.0k|    resq_r0_2 = _mm_packus_epi16(temp1, zero_8x16b);
 1178|  19.0k|    resq_r1_2 = _mm_packus_epi16(temp2, zero_8x16b);
 1179|  19.0k|    resq_r2_2 = _mm_packus_epi16(temp3, zero_8x16b);
 1180|  19.0k|    resq_r3_2 = _mm_packus_epi16(temp4, zero_8x16b);
 1181|  19.0k|    resq_r4_2 = _mm_packus_epi16(temp5, zero_8x16b);
 1182|  19.0k|    resq_r5_2 = _mm_packus_epi16(temp6, zero_8x16b);
 1183|  19.0k|    resq_r6_2 = _mm_packus_epi16(temp7, zero_8x16b);
 1184|  19.0k|    resq_r7_2 = _mm_packus_epi16(temp8, zero_8x16b);
 1185|       |
 1186|  19.0k|    _mm_storel_epi64((__m128i *) (&pu1_out[0]), resq_r0_2);
 1187|  19.0k|    _mm_storel_epi64((__m128i *) (&pu1_out[out_strd]), resq_r1_2);
 1188|  19.0k|    _mm_storel_epi64((__m128i *) (&pu1_out[2 * out_strd]), resq_r2_2);
 1189|  19.0k|    _mm_storel_epi64((__m128i *) (&pu1_out[3 * out_strd]), resq_r3_2);
 1190|  19.0k|    _mm_storel_epi64((__m128i *) (&pu1_out[4 * out_strd]), resq_r4_2);
 1191|  19.0k|    _mm_storel_epi64((__m128i *) (&pu1_out[5 * out_strd]), resq_r5_2);
 1192|  19.0k|    _mm_storel_epi64((__m128i *) (&pu1_out[6 * out_strd]), resq_r6_2);
 1193|  19.0k|    _mm_storel_epi64((__m128i *) (&pu1_out[7 * out_strd]), resq_r7_2);
 1194|       |
 1195|  19.0k|    i4_nnz_b0 = (!(row_01_b0 && row_23_b0));
  ------------------
  |  Branch (1195:20): [True: 3.39k, False: 15.6k]
  |  Branch (1195:33): [True: 1.52k, False: 1.87k]
  ------------------
 1196|  19.0k|    i4_nnz_b1 = (!(row_01_b1 && row_23_b1)) << 1;
  ------------------
  |  Branch (1196:20): [True: 3.29k, False: 15.7k]
  |  Branch (1196:33): [True: 1.53k, False: 1.76k]
  ------------------
 1197|  19.0k|    i4_nnz_b2 = (!(row_45_b2 && row_67_b2)) << 4;
  ------------------
  |  Branch (1197:20): [True: 1.52k, False: 17.5k]
  |  Branch (1197:33): [True: 1.41k, False: 113]
  ------------------
 1198|  19.0k|    i4_nnz_b3 = (!(row_45_b3 && row_67_b3)) << 5;
  ------------------
  |  Branch (1198:20): [True: 1.57k, False: 17.4k]
  |  Branch (1198:33): [True: 1.49k, False: 75]
  ------------------
 1199|       |
 1200|  19.0k|    i4_nnz = (i4_nnz_b0 | i4_nnz_b1 | i4_nnz_b2 | i4_nnz_b3);
 1201|  19.0k|    return i4_nnz;
 1202|  19.0k|}
isvcd_iquant_itrans_residual_recon_4x4_dc_sse42:
 1231|  2.01k|{
 1232|  2.01k|    __m128i pred_16x8b_0, pred_8x16b_0, rsd_8x16b_0, out_8x16b_0, out_16x8b_0;
 1233|  2.01k|    __m128i pred_16x8b_1, pred_8x16b_1, rsd_8x16b_1, out_8x16b_1, out_16x8b_1;
 1234|  2.01k|    __m128i pred_16x8b_2, pred_8x16b_2, rsd_8x16b_2, out_8x16b_2, out_16x8b_2;
 1235|  2.01k|    __m128i pred_16x8b_3, pred_8x16b_3, rsd_8x16b_3, out_8x16b_3, out_16x8b_3;
 1236|  2.01k|    __m128i rsd_8x16b_01, rsd_8x16b_23;
 1237|       |
 1238|  2.01k|    __m128i i_macro_8x16b, dupmax_8x16b, dupmin_8x16b;
 1239|  2.01k|    __m128i zero_8x16b = _mm_setzero_si128();
 1240|  2.01k|    WORD32 i4_nnz, row_01, row_23;
 1241|  2.01k|    WORD32 q0;
 1242|  2.01k|    WORD16 i_macro;
 1243|  2.01k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (1243:23): [True: 670, False: 1.34k]
  ------------------
 1244|  2.01k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  2.01k|#define UNUSED(x) ((void)(x))
  ------------------
 1245|       |
 1246|  2.01k|    if(iq_start_idx == 0)
  ------------------
  |  Branch (1246:8): [True: 2.01k, False: 0]
  ------------------
 1247|  2.01k|    {
 1248|  2.01k|        q0 = pi2_src[0];
 1249|  2.01k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  2.01k|                {\
  |  |  104|  2.01k|                    i4_value *= quant_scale;\
  |  |  105|  2.01k|                    i4_value *= weight_scale;\
  |  |  106|  2.01k|                    i4_value += rndfactor;\
  |  |  107|  2.01k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  2.01k|                    i4_value >>= qbits;\
  |  |  109|  2.01k|                }
  ------------------
 1250|  2.01k|    }
 1251|      0|    else
 1252|      0|    {
 1253|      0|        q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case3
 1254|      0|    }
 1255|  2.01k|    i_macro = ((q0 + 32) >> 6);
 1256|       |
 1257|  2.01k|    i_macro_8x16b = _mm_set1_epi16(i_macro);
 1258|  2.01k|    dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  2.01k|#define RSD_MAX 255
  ------------------
 1259|  2.01k|    dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  2.01k|#define RSD_MIN -255
  ------------------
 1260|       |
 1261|  2.01k|    pred_16x8b_0 = _mm_loadu_si128((__m128i *) (pu1_pred));
 1262|  2.01k|    pred_16x8b_1 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd));
 1263|  2.01k|    pred_16x8b_2 = _mm_loadu_si128((__m128i *) (pu1_pred + (pred_strd << 1)));
 1264|  2.01k|    pred_16x8b_3 = _mm_loadu_si128((__m128i *) (pu1_pred + (pred_strd << 1) + pred_strd));
 1265|       |
 1266|  2.01k|    pred_8x16b_0 = _mm_cvtepu8_epi16(pred_16x8b_0);
 1267|  2.01k|    pred_8x16b_1 = _mm_cvtepu8_epi16(pred_16x8b_1);
 1268|  2.01k|    pred_8x16b_2 = _mm_cvtepu8_epi16(pred_16x8b_2);
 1269|  2.01k|    pred_8x16b_3 = _mm_cvtepu8_epi16(pred_16x8b_3);
 1270|       |
 1271|  2.01k|    rsd_8x16b_0 = _mm_loadu_si128((__m128i *) (pi2_rsd));
 1272|  2.01k|    rsd_8x16b_1 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd));
 1273|  2.01k|    rsd_8x16b_2 = _mm_loadu_si128((__m128i *) (pi2_rsd + (rsd_strd << 1)));
 1274|  2.01k|    rsd_8x16b_3 = _mm_loadu_si128((__m128i *) (pi2_rsd + (rsd_strd << 1) + rsd_strd));
 1275|       |
 1276|  2.01k|    rsd_8x16b_0 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_0);
 1277|  2.01k|    rsd_8x16b_1 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_1);
 1278|  2.01k|    rsd_8x16b_2 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_2);
 1279|  2.01k|    rsd_8x16b_3 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_3);
 1280|       |
 1281|  2.01k|    rsd_8x16b_0 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_0);
 1282|  2.01k|    rsd_8x16b_0 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_0);
 1283|  2.01k|    rsd_8x16b_1 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_1);
 1284|  2.01k|    rsd_8x16b_1 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_1);
 1285|  2.01k|    rsd_8x16b_2 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_2);
 1286|  2.01k|    rsd_8x16b_2 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_2);
 1287|  2.01k|    rsd_8x16b_3 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_3);
 1288|  2.01k|    rsd_8x16b_3 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_3);
 1289|       |
 1290|  2.01k|    rsd_8x16b_01 = _mm_unpacklo_epi64(rsd_8x16b_0, rsd_8x16b_1);
 1291|  2.01k|    rsd_8x16b_23 = _mm_unpacklo_epi64(rsd_8x16b_2, rsd_8x16b_3);
 1292|       |
 1293|  2.01k|    row_01 = _mm_test_all_ones(
 1294|  2.01k|        _mm_cmpeq_epi16(rsd_8x16b_01, zero_8x16b));  // return 1 if all zeros, else 0
 1295|  2.01k|    row_23 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_23, zero_8x16b));
 1296|       |
 1297|  2.01k|    out_8x16b_0 = _mm_add_epi16(pred_8x16b_0, rsd_8x16b_0);
 1298|  2.01k|    out_8x16b_1 = _mm_add_epi16(pred_8x16b_1, rsd_8x16b_1);
 1299|  2.01k|    out_8x16b_2 = _mm_add_epi16(pred_8x16b_2, rsd_8x16b_2);
 1300|  2.01k|    out_8x16b_3 = _mm_add_epi16(pred_8x16b_3, rsd_8x16b_3);
 1301|       |
 1302|  2.01k|    out_16x8b_0 = _mm_packus_epi16(out_8x16b_0, zero_8x16b);
 1303|  2.01k|    out_16x8b_1 = _mm_packus_epi16(out_8x16b_1, zero_8x16b);
 1304|  2.01k|    out_16x8b_2 = _mm_packus_epi16(out_8x16b_2, zero_8x16b);
 1305|  2.01k|    out_16x8b_3 = _mm_packus_epi16(out_8x16b_3, zero_8x16b);
 1306|       |
 1307|  2.01k|    *((WORD32 *) (pu1_out)) = _mm_cvtsi128_si32(out_16x8b_0);
 1308|  2.01k|    *((WORD32 *) (pu1_out + out_strd)) = _mm_cvtsi128_si32(out_16x8b_1);
 1309|  2.01k|    *((WORD32 *) (pu1_out + (out_strd << 1))) = _mm_cvtsi128_si32(out_16x8b_2);
 1310|  2.01k|    *((WORD32 *) (pu1_out + (out_strd * 3))) = _mm_cvtsi128_si32(out_16x8b_3);
 1311|       |
 1312|  2.01k|    i4_nnz = !(row_01 && row_23);
  ------------------
  |  Branch (1312:16): [True: 286, False: 1.72k]
  |  Branch (1312:26): [True: 286, False: 0]
  ------------------
 1313|  2.01k|    return i4_nnz;
 1314|  2.01k|}
isvcd_iquant_itrans_residual_recon_8x8_dc_sse42:
 1343|  2.18k|{
 1344|  2.18k|    __m128i pred_16x8b_0, pred_8x16b_0, rsd_8x16b_0, out_8x16b_0, out_16x8b_0;
 1345|  2.18k|    __m128i pred_16x8b_1, pred_8x16b_1, rsd_8x16b_1, out_8x16b_1, out_16x8b_1;
 1346|  2.18k|    __m128i pred_16x8b_2, pred_8x16b_2, rsd_8x16b_2, out_8x16b_2, out_16x8b_2;
 1347|  2.18k|    __m128i pred_16x8b_3, pred_8x16b_3, rsd_8x16b_3, out_8x16b_3, out_16x8b_3;
 1348|  2.18k|    __m128i pred_16x8b_4, pred_8x16b_4, rsd_8x16b_4, out_8x16b_4, out_16x8b_4;
 1349|  2.18k|    __m128i pred_16x8b_5, pred_8x16b_5, rsd_8x16b_5, out_8x16b_5, out_16x8b_5;
 1350|  2.18k|    __m128i pred_16x8b_6, pred_8x16b_6, rsd_8x16b_6, out_8x16b_6, out_16x8b_6;
 1351|  2.18k|    __m128i pred_16x8b_7, pred_8x16b_7, rsd_8x16b_7, out_8x16b_7, out_16x8b_7;
 1352|  2.18k|    __m128i rsd_8x16b_01_b0, rsd_8x16b_23_b0, rsd_8x16b_45_b2, rsd_8x16b_67_b2;
 1353|  2.18k|    __m128i rsd_8x16b_01_b1, rsd_8x16b_23_b1, rsd_8x16b_45_b3, rsd_8x16b_67_b3;
 1354|       |
 1355|  2.18k|    WORD32 row_01_b0, row_23_b0, row_45_b2, row_67_b2;
 1356|  2.18k|    WORD32 row_01_b1, row_23_b1, row_45_b3, row_67_b3;
 1357|  2.18k|    WORD32 i4_nnz, i4_nnz_b0, i4_nnz_b1, i4_nnz_b2, i4_nnz_b3;
 1358|       |
 1359|  2.18k|    __m128i zero_8x16b = _mm_setzero_si128();
 1360|       |
 1361|  2.18k|    WORD32 pred_strd2 = (pred_strd << 1);
 1362|  2.18k|    WORD32 pred_strd4 = (pred_strd << 2);
 1363|  2.18k|    WORD32 rsd_strd2 = (rsd_strd << 1);
 1364|  2.18k|    WORD32 rsd_strd4 = (rsd_strd << 2);
 1365|  2.18k|    WORD32 out_strd2 = (out_strd << 1);
 1366|  2.18k|    WORD32 out_strd4 = (out_strd << 2);
 1367|       |
 1368|  2.18k|    __m128i i_macro_8x16b, dupmax_8x16b, dupmin_8x16b;
 1369|  2.18k|    WORD32 q;
 1370|  2.18k|    WORD16 i_macro;
 1371|  2.18k|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (1371:23): [True: 1.27k, False: 902]
  ------------------
 1372|  2.18k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  2.18k|#define UNUSED(x) ((void)(x))
  ------------------
 1373|  2.18k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  2.18k|#define UNUSED(x) ((void)(x))
  ------------------
 1374|  2.18k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  2.18k|#define UNUSED(x) ((void)(x))
  ------------------
 1375|       |    /*************************************************************/
 1376|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
 1377|       |    /* operations on platform. Note : DC coeff is not scaled     */
 1378|       |    /*************************************************************/
 1379|  2.18k|    q = pi2_src[0];
 1380|  2.18k|    INV_QUANT(q, pu2_iscale_mat[0], pu2_weigh_mat[0], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|  2.18k|                {\
  |  |  104|  2.18k|                    i4_value *= quant_scale;\
  |  |  105|  2.18k|                    i4_value *= weight_scale;\
  |  |  106|  2.18k|                    i4_value += rndfactor;\
  |  |  107|  2.18k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  2.18k|                    i4_value >>= qbits;\
  |  |  109|  2.18k|                }
  ------------------
 1381|  2.18k|    i_macro = (q + 32) >> 6;
 1382|       |
 1383|  2.18k|    i_macro_8x16b = _mm_set1_epi16(i_macro);
 1384|  2.18k|    dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  2.18k|#define RSD_MAX 255
  ------------------
 1385|  2.18k|    dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  2.18k|#define RSD_MIN -255
  ------------------
 1386|       |
 1387|  2.18k|    pred_16x8b_0 = _mm_loadu_si128((__m128i *) (pu1_pred));
 1388|  2.18k|    pred_16x8b_1 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd));
 1389|  2.18k|    pred_16x8b_2 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd2));
 1390|  2.18k|    pred_16x8b_3 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd2 + pred_strd));
 1391|  2.18k|    pred_16x8b_4 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4));
 1392|  2.18k|    pred_16x8b_5 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd));
 1393|  2.18k|    pred_16x8b_6 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd2));
 1394|  2.18k|    pred_16x8b_7 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd2 + pred_strd));
 1395|       |
 1396|  2.18k|    pred_8x16b_0 = _mm_cvtepu8_epi16(pred_16x8b_0);
 1397|  2.18k|    pred_8x16b_1 = _mm_cvtepu8_epi16(pred_16x8b_1);
 1398|  2.18k|    pred_8x16b_2 = _mm_cvtepu8_epi16(pred_16x8b_2);
 1399|  2.18k|    pred_8x16b_3 = _mm_cvtepu8_epi16(pred_16x8b_3);
 1400|  2.18k|    pred_8x16b_4 = _mm_cvtepu8_epi16(pred_16x8b_4);
 1401|  2.18k|    pred_8x16b_5 = _mm_cvtepu8_epi16(pred_16x8b_5);
 1402|  2.18k|    pred_8x16b_6 = _mm_cvtepu8_epi16(pred_16x8b_6);
 1403|  2.18k|    pred_8x16b_7 = _mm_cvtepu8_epi16(pred_16x8b_7);
 1404|       |
 1405|  2.18k|    rsd_8x16b_0 = _mm_loadu_si128((__m128i *) (pi2_rsd));
 1406|  2.18k|    rsd_8x16b_1 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd));
 1407|  2.18k|    rsd_8x16b_2 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd2));
 1408|  2.18k|    rsd_8x16b_3 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd2 + rsd_strd));
 1409|  2.18k|    rsd_8x16b_4 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4));
 1410|  2.18k|    rsd_8x16b_5 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd));
 1411|  2.18k|    rsd_8x16b_6 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd2));
 1412|  2.18k|    rsd_8x16b_7 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd2 + rsd_strd));
 1413|       |
 1414|  2.18k|    rsd_8x16b_0 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_0);
 1415|  2.18k|    rsd_8x16b_1 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_1);
 1416|  2.18k|    rsd_8x16b_2 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_2);
 1417|  2.18k|    rsd_8x16b_3 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_3);
 1418|  2.18k|    rsd_8x16b_4 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_4);
 1419|  2.18k|    rsd_8x16b_5 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_5);
 1420|  2.18k|    rsd_8x16b_6 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_6);
 1421|  2.18k|    rsd_8x16b_7 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_7);
 1422|       |
 1423|  2.18k|    rsd_8x16b_0 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_0);
 1424|  2.18k|    rsd_8x16b_0 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_0);
 1425|  2.18k|    rsd_8x16b_1 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_1);
 1426|  2.18k|    rsd_8x16b_1 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_1);
 1427|  2.18k|    rsd_8x16b_2 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_2);
 1428|  2.18k|    rsd_8x16b_2 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_2);
 1429|  2.18k|    rsd_8x16b_3 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_3);
 1430|  2.18k|    rsd_8x16b_3 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_3);
 1431|  2.18k|    rsd_8x16b_4 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_4);
 1432|  2.18k|    rsd_8x16b_4 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_4);
 1433|  2.18k|    rsd_8x16b_5 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_5);
 1434|  2.18k|    rsd_8x16b_5 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_5);
 1435|  2.18k|    rsd_8x16b_6 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_6);
 1436|  2.18k|    rsd_8x16b_6 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_6);
 1437|  2.18k|    rsd_8x16b_7 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_7);
 1438|  2.18k|    rsd_8x16b_7 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_7);
 1439|       |
 1440|  2.18k|    rsd_8x16b_01_b0 = _mm_unpacklo_epi64(rsd_8x16b_0, rsd_8x16b_1);
 1441|  2.18k|    rsd_8x16b_23_b0 = _mm_unpacklo_epi64(rsd_8x16b_2, rsd_8x16b_3);
 1442|  2.18k|    rsd_8x16b_01_b1 = _mm_unpackhi_epi64(rsd_8x16b_0, rsd_8x16b_1);
 1443|  2.18k|    rsd_8x16b_23_b1 = _mm_unpackhi_epi64(rsd_8x16b_2, rsd_8x16b_3);
 1444|       |
 1445|  2.18k|    rsd_8x16b_45_b2 = _mm_unpacklo_epi64(rsd_8x16b_4, rsd_8x16b_5);
 1446|  2.18k|    rsd_8x16b_67_b2 = _mm_unpacklo_epi64(rsd_8x16b_6, rsd_8x16b_7);
 1447|  2.18k|    rsd_8x16b_45_b3 = _mm_unpackhi_epi64(rsd_8x16b_4, rsd_8x16b_5);
 1448|  2.18k|    rsd_8x16b_67_b3 = _mm_unpackhi_epi64(rsd_8x16b_6, rsd_8x16b_7);
 1449|       |
 1450|  2.18k|    row_01_b0 = _mm_test_all_ones(rsd_8x16b_01_b0);  // return 1 if all zeros, else 0
 1451|  2.18k|    row_23_b0 = _mm_test_all_ones(rsd_8x16b_23_b0);
 1452|  2.18k|    row_01_b1 = _mm_test_all_ones(rsd_8x16b_01_b1);
 1453|  2.18k|    row_23_b1 = _mm_test_all_ones(rsd_8x16b_23_b1);
 1454|       |
 1455|  2.18k|    row_45_b2 = _mm_test_all_ones(rsd_8x16b_45_b2);
 1456|  2.18k|    row_67_b2 = _mm_test_all_ones(rsd_8x16b_67_b2);
 1457|  2.18k|    row_45_b3 = _mm_test_all_ones(rsd_8x16b_45_b3);
 1458|  2.18k|    row_67_b3 = _mm_test_all_ones(rsd_8x16b_67_b3);
 1459|       |
 1460|  2.18k|    out_8x16b_0 = _mm_add_epi16(pred_8x16b_0, rsd_8x16b_0);
 1461|  2.18k|    out_8x16b_1 = _mm_add_epi16(pred_8x16b_1, rsd_8x16b_1);
 1462|  2.18k|    out_8x16b_2 = _mm_add_epi16(pred_8x16b_2, rsd_8x16b_2);
 1463|  2.18k|    out_8x16b_3 = _mm_add_epi16(pred_8x16b_3, rsd_8x16b_3);
 1464|  2.18k|    out_8x16b_4 = _mm_add_epi16(pred_8x16b_4, rsd_8x16b_4);
 1465|  2.18k|    out_8x16b_5 = _mm_add_epi16(pred_8x16b_5, rsd_8x16b_5);
 1466|  2.18k|    out_8x16b_6 = _mm_add_epi16(pred_8x16b_6, rsd_8x16b_6);
 1467|  2.18k|    out_8x16b_7 = _mm_add_epi16(pred_8x16b_7, rsd_8x16b_7);
 1468|       |
 1469|  2.18k|    out_16x8b_0 = _mm_packus_epi16(out_8x16b_0, zero_8x16b);
 1470|  2.18k|    out_16x8b_1 = _mm_packus_epi16(out_8x16b_1, zero_8x16b);
 1471|  2.18k|    out_16x8b_2 = _mm_packus_epi16(out_8x16b_2, zero_8x16b);
 1472|  2.18k|    out_16x8b_3 = _mm_packus_epi16(out_8x16b_3, zero_8x16b);
 1473|  2.18k|    out_16x8b_4 = _mm_packus_epi16(out_8x16b_4, zero_8x16b);
 1474|  2.18k|    out_16x8b_5 = _mm_packus_epi16(out_8x16b_5, zero_8x16b);
 1475|  2.18k|    out_16x8b_6 = _mm_packus_epi16(out_8x16b_6, zero_8x16b);
 1476|  2.18k|    out_16x8b_7 = _mm_packus_epi16(out_8x16b_7, zero_8x16b);
 1477|       |
 1478|  2.18k|    _mm_storel_epi64((__m128i *) (pu1_out), out_16x8b_0);
 1479|  2.18k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd), out_16x8b_1);
 1480|  2.18k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd2), out_16x8b_2);
 1481|  2.18k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd2 + out_strd), out_16x8b_3);
 1482|  2.18k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4), out_16x8b_4);
 1483|  2.18k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd), out_16x8b_5);
 1484|  2.18k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd2), out_16x8b_6);
 1485|  2.18k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd2 + out_strd), out_16x8b_7);
 1486|       |
 1487|  2.18k|    i4_nnz_b0 = (!(row_01_b0 && row_23_b0));
  ------------------
  |  Branch (1487:20): [True: 444, False: 1.73k]
  |  Branch (1487:33): [True: 444, False: 0]
  ------------------
 1488|  2.18k|    i4_nnz_b1 = (!(row_01_b1 && row_23_b1)) << 1;
  ------------------
  |  Branch (1488:20): [True: 444, False: 1.73k]
  |  Branch (1488:33): [True: 444, False: 0]
  ------------------
 1489|  2.18k|    i4_nnz_b2 = (!(row_45_b2 && row_67_b2)) << 4;
  ------------------
  |  Branch (1489:20): [True: 444, False: 1.73k]
  |  Branch (1489:33): [True: 444, False: 0]
  ------------------
 1490|  2.18k|    i4_nnz_b3 = (!(row_45_b3 && row_67_b3)) << 5;
  ------------------
  |  Branch (1490:20): [True: 444, False: 1.73k]
  |  Branch (1490:33): [True: 444, False: 0]
  ------------------
 1491|       |
 1492|  2.18k|    i4_nnz = (i4_nnz_b0 | i4_nnz_b1 | i4_nnz_b2 | i4_nnz_b3);
 1493|  2.18k|    return i4_nnz;
 1494|  2.18k|}
isvcd_iquant_itrans_residual_recon_chroma_4x4_dc_sse42:
 1523|  41.3k|{
 1524|  41.3k|    __m128i pred_16x8b_0, pred_8x16b_0, rsd_8x16b_0, rsd_16x8b_0, out_16x8b_0;
 1525|  41.3k|    __m128i pred_16x8b_1, pred_8x16b_1, rsd_8x16b_1, rsd_16x8b_1, out_16x8b_1;
 1526|  41.3k|    __m128i pred_16x8b_2, pred_8x16b_2, rsd_8x16b_2, rsd_16x8b_2, out_16x8b_2;
 1527|  41.3k|    __m128i pred_16x8b_3, pred_8x16b_3, rsd_8x16b_3, rsd_16x8b_3, out_16x8b_3;
 1528|       |
 1529|  41.3k|    __m128i i_macro_8x16b, dupmax_8x16b, dupmin_8x16b;
 1530|  41.3k|    __m128i chroma_mask, chroma_mask2;
 1531|  41.3k|    __m128i zero_8x16b = _mm_setzero_si128();
 1532|  41.3k|    WORD32 q0;
 1533|  41.3k|    WORD16 i_macro;
 1534|  41.3k|    UNUSED(pi2_src);
  ------------------
  |  |   45|  41.3k|#define UNUSED(x) ((void)(x))
  ------------------
 1535|  41.3k|    UNUSED(pu2_iscal_mat);
  ------------------
  |  |   45|  41.3k|#define UNUSED(x) ((void)(x))
  ------------------
 1536|  41.3k|    UNUSED(pu2_weigh_mat);
  ------------------
  |  |   45|  41.3k|#define UNUSED(x) ((void)(x))
  ------------------
 1537|  41.3k|    UNUSED(u4_qp_div_6);
  ------------------
  |  |   45|  41.3k|#define UNUSED(x) ((void)(x))
  ------------------
 1538|  41.3k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  41.3k|#define UNUSED(x) ((void)(x))
  ------------------
 1539|       |
 1540|  41.3k|    q0 = pi2_dc_src[0];  // Restoring dc value for intra case3
 1541|  41.3k|    i_macro = ((q0 + 32) >> 6);
 1542|       |
 1543|  41.3k|    i_macro_8x16b = _mm_set1_epi16(i_macro);
 1544|  41.3k|    dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  41.3k|#define RSD_MAX 255
  ------------------
 1545|  41.3k|    dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  41.3k|#define RSD_MIN -255
  ------------------
 1546|       |
 1547|  41.3k|    pred_16x8b_0 = _mm_loadu_si128((__m128i *) (pu1_pred));
 1548|  41.3k|    pred_16x8b_1 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd));
 1549|  41.3k|    pred_16x8b_2 = _mm_loadu_si128((__m128i *) (pu1_pred + (pred_strd << 1)));
 1550|  41.3k|    pred_16x8b_3 = _mm_loadu_si128((__m128i *) (pu1_pred + (pred_strd << 1) + pred_strd));
 1551|       |
 1552|  41.3k|    pred_8x16b_0 = _mm_cvtepu8_epi16(pred_16x8b_0);
 1553|  41.3k|    pred_8x16b_1 = _mm_cvtepu8_epi16(pred_16x8b_1);
 1554|  41.3k|    pred_8x16b_2 = _mm_cvtepu8_epi16(pred_16x8b_2);
 1555|  41.3k|    pred_8x16b_3 = _mm_cvtepu8_epi16(pred_16x8b_3);
 1556|       |
 1557|  41.3k|    rsd_8x16b_0 = _mm_loadu_si128((__m128i *) (pi2_rsd));
 1558|  41.3k|    rsd_8x16b_1 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd));
 1559|  41.3k|    rsd_8x16b_2 = _mm_loadu_si128((__m128i *) (pi2_rsd + (rsd_strd << 1)));
 1560|  41.3k|    rsd_8x16b_3 = _mm_loadu_si128((__m128i *) (pi2_rsd + (rsd_strd << 1) + rsd_strd));
 1561|       |
 1562|  41.3k|    rsd_8x16b_0 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_0);
 1563|  41.3k|    rsd_8x16b_1 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_1);
 1564|  41.3k|    rsd_8x16b_2 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_2);
 1565|  41.3k|    rsd_8x16b_3 = _mm_add_epi16(i_macro_8x16b, rsd_8x16b_3);
 1566|       |
 1567|  41.3k|    rsd_8x16b_0 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_0);
 1568|  41.3k|    rsd_8x16b_0 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_0);
 1569|  41.3k|    rsd_8x16b_1 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_1);
 1570|  41.3k|    rsd_8x16b_1 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_1);
 1571|  41.3k|    rsd_8x16b_2 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_2);
 1572|  41.3k|    rsd_8x16b_2 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_2);
 1573|  41.3k|    rsd_8x16b_3 = _mm_min_epi16(dupmax_8x16b, rsd_8x16b_3);
 1574|  41.3k|    rsd_8x16b_3 = _mm_max_epi16(dupmin_8x16b, rsd_8x16b_3);
 1575|       |
 1576|  41.3k|    rsd_8x16b_0 = _mm_add_epi16(pred_8x16b_0, rsd_8x16b_0);
 1577|  41.3k|    rsd_8x16b_1 = _mm_add_epi16(pred_8x16b_1, rsd_8x16b_1);
 1578|  41.3k|    rsd_8x16b_2 = _mm_add_epi16(pred_8x16b_2, rsd_8x16b_2);
 1579|  41.3k|    rsd_8x16b_3 = _mm_add_epi16(pred_8x16b_3, rsd_8x16b_3);
 1580|       |
 1581|  41.3k|    chroma_mask = _mm_set1_epi16(0xFF00);
 1582|  41.3k|    chroma_mask2 = _mm_set1_epi16(0x00FF);
 1583|  41.3k|    out_16x8b_0 = _mm_loadu_si128((__m128i *) (&pu1_out[0]));
 1584|  41.3k|    out_16x8b_1 = _mm_loadu_si128((__m128i *) (&pu1_out[out_strd]));
 1585|  41.3k|    out_16x8b_2 = _mm_loadu_si128((__m128i *) (&pu1_out[(out_strd << 1)]));
 1586|  41.3k|    out_16x8b_3 = _mm_loadu_si128((__m128i *) (&pu1_out[(out_strd << 1) + out_strd]));
 1587|       |
 1588|  41.3k|    out_16x8b_0 = _mm_and_si128(out_16x8b_0, chroma_mask);
 1589|  41.3k|    out_16x8b_1 = _mm_and_si128(out_16x8b_1, chroma_mask);
 1590|  41.3k|    out_16x8b_2 = _mm_and_si128(out_16x8b_2, chroma_mask);
 1591|  41.3k|    out_16x8b_3 = _mm_and_si128(out_16x8b_3, chroma_mask);
 1592|       |
 1593|  41.3k|    rsd_16x8b_0 = _mm_packus_epi16(rsd_8x16b_0, zero_8x16b);
 1594|  41.3k|    rsd_16x8b_1 = _mm_packus_epi16(rsd_8x16b_1, zero_8x16b);
 1595|  41.3k|    rsd_16x8b_2 = _mm_packus_epi16(rsd_8x16b_2, zero_8x16b);
 1596|  41.3k|    rsd_16x8b_3 = _mm_packus_epi16(rsd_8x16b_3, zero_8x16b);
 1597|       |
 1598|  41.3k|    rsd_8x16b_0 = _mm_and_si128(rsd_16x8b_0, chroma_mask2);
 1599|  41.3k|    rsd_8x16b_1 = _mm_and_si128(rsd_16x8b_1, chroma_mask2);
 1600|  41.3k|    rsd_8x16b_2 = _mm_and_si128(rsd_16x8b_2, chroma_mask2);
 1601|  41.3k|    rsd_8x16b_3 = _mm_and_si128(rsd_16x8b_3, chroma_mask2);
 1602|       |
 1603|  41.3k|    out_16x8b_0 = _mm_add_epi8(rsd_8x16b_0, out_16x8b_0);
 1604|  41.3k|    out_16x8b_1 = _mm_add_epi8(rsd_8x16b_1, out_16x8b_1);
 1605|  41.3k|    out_16x8b_2 = _mm_add_epi8(rsd_8x16b_2, out_16x8b_2);
 1606|  41.3k|    out_16x8b_3 = _mm_add_epi8(rsd_8x16b_3, out_16x8b_3);
 1607|       |
 1608|  41.3k|    _mm_storel_epi64((__m128i *) (pu1_out), out_16x8b_0);
 1609|  41.3k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd), out_16x8b_1);
 1610|  41.3k|    _mm_storel_epi64((__m128i *) (pu1_out + (out_strd << 1)), out_16x8b_2);
 1611|  41.3k|    _mm_storel_epi64((__m128i *) (pu1_out + (out_strd * 3)), out_16x8b_3);
 1612|  41.3k|}
isvcd_iquant_itrans_residual_recon_chroma_4x4_sse42:
 1641|  4.17k|{
 1642|  4.17k|    __m128i src_r0_r1, src_r2_r3;
 1643|  4.17k|    __m128i src_r0, src_r1, src_r2, src_r3;
 1644|  4.17k|    __m128i scalemat_r0_r1, scalemat_r2_r3;
 1645|  4.17k|    __m128i pred_r0, pred_r1, pred_r2, pred_r3;
 1646|  4.17k|    __m128i rsd_r0, rsd_r1, rsd_r2, rsd_r3;
 1647|  4.17k|    __m128i dequant_r0_r1, dequant_r2_r3;
 1648|  4.17k|    __m128i zero_8x16b = _mm_setzero_si128();  // all bits reset to zero
 1649|  4.17k|    __m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
 1650|  4.17k|    __m128i resq_r0, resq_r1, resq_r2, resq_r3;
 1651|  4.17k|    __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
  ------------------
  |  Branch (1651:41): [True: 2.63k, False: 1.54k]
  ------------------
 1652|  4.17k|    __m128i value_32 = _mm_set1_epi32(32);
 1653|  4.17k|    __m128i chroma_mask = _mm_set1_epi16(0xFF00);
 1654|  4.17k|    __m128i chroma_mask2 = _mm_set1_epi16(0x00FF);
 1655|  4.17k|    __m128i dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  4.17k|#define RSD_MAX 255
  ------------------
 1656|  4.17k|    __m128i dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  4.17k|#define RSD_MIN -255
  ------------------
 1657|       |
 1658|  4.17k|    __m128i out_16x8b_0, out_16x8b_1, out_16x8b_2, out_16x8b_3;
 1659|       |
 1660|  4.17k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  4.17k|#define UNUSED(x) ((void)(x))
  ------------------
 1661|       |
 1662|       |    /*************************************************************/
 1663|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
 1664|       |    /* operations on platform                                    */
 1665|       |    /*************************************************************/
 1666|       |    // a00 a01 a02 a03 a10 a11 a12 a13  -- the source matrix 0th,1st row
 1667|  4.17k|    src_r0_r1 = _mm_loadu_si128((__m128i *) (pi2_src));
 1668|       |    // a20 a21 a22 a23 a30 a31 a32 a33 --  the source matrix 2nd,3rd row
 1669|  4.17k|    src_r2_r3 = _mm_loadu_si128((__m128i *) (pi2_src + 8));
 1670|       |    // b00 b01 b02 b03 b10 b11 b12 b13 -- the  scaling matrix 0th,1st row
 1671|  4.17k|    scalemat_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat));
 1672|       |    // b20 b21 b22 b23 b30 b31 b32 b33 -- the  scaling matrix 2nd,3rd row
 1673|  4.17k|    scalemat_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat + 8));
 1674|       |    // q00 q01 q02 q03 q10 q11  q12 q13 -- all 16 bits
 1675|  4.17k|    dequant_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat));
 1676|       |    // q20 q21 q22 q23 q30 q31 q32 q33 -- all 16 bits
 1677|  4.17k|    dequant_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat + 8));
 1678|       |
 1679|       |    // b00*q00 b01*q01 b02*q02 b03*q03 b10*q10  b11*q11 b12*q12 b13*q13 -- 16 bit result
 1680|  4.17k|    temp0 = _mm_mullo_epi16(scalemat_r0_r1, dequant_r0_r1);
 1681|       |    // b00*q00 b01*q01 b02*q02 b03*q03 b10*q10 b11*q11 b12*q12 b13*q13 -- 16 bit result
 1682|  4.17k|    temp1 = _mm_mullo_epi16(scalemat_r2_r3, dequant_r2_r3);
 1683|       |    // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
 1684|  4.17k|    temp4 = _mm_unpacklo_epi16(temp0, zero_8x16b);
 1685|       |    // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
 1686|  4.17k|    temp5 = _mm_unpackhi_epi16(temp0, zero_8x16b);
 1687|       |    // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
 1688|  4.17k|    temp6 = _mm_unpacklo_epi16(temp1, zero_8x16b);
 1689|       |    // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
 1690|  4.17k|    temp7 = _mm_unpackhi_epi16(temp1, zero_8x16b);
 1691|       |
 1692|  4.17k|    src_r0 = _mm_unpacklo_epi16(src_r0_r1, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
 1693|  4.17k|    src_r1 = _mm_unpackhi_epi16(src_r0_r1, zero_8x16b);  // a10 0 a11 0 a12 0 a13 0 -- 16 bit long
 1694|  4.17k|    src_r2 = _mm_unpacklo_epi16(src_r2_r3, zero_8x16b);  // a20 0 a21 0 a22 0 a23 0 -- 16 bit long
 1695|  4.17k|    src_r3 = _mm_unpackhi_epi16(src_r2_r3, zero_8x16b);  // a30 0 a31 0 a32 0 a33 0 -- 16 bit long
 1696|       |
 1697|       |    // a00*b00*q00 a10*b10*q10 a20*b20*q20 a30*b30 q30 -- 32 bits long
 1698|  4.17k|    temp4 = _mm_madd_epi16(src_r0, temp4);
 1699|  4.17k|    temp5 = _mm_madd_epi16(src_r1, temp5);
 1700|  4.17k|    temp6 = _mm_madd_epi16(src_r2, temp6);
 1701|  4.17k|    temp7 = _mm_madd_epi16(src_r3, temp7);
 1702|       |
 1703|  4.17k|    if(u4_qp_div_6 >= 4)
  ------------------
  |  Branch (1703:8): [True: 1.54k, False: 2.63k]
  ------------------
 1704|  1.54k|    {
 1705|  1.54k|        resq_r0 = _mm_slli_epi32(temp4, u4_qp_div_6 - 4);
 1706|  1.54k|        resq_r1 = _mm_slli_epi32(temp5, u4_qp_div_6 - 4);
 1707|  1.54k|        resq_r2 = _mm_slli_epi32(temp6, u4_qp_div_6 - 4);
 1708|  1.54k|        resq_r3 = _mm_slli_epi32(temp7, u4_qp_div_6 - 4);
 1709|  1.54k|    }
 1710|  2.63k|    else
 1711|  2.63k|    {
 1712|  2.63k|        temp4 = _mm_add_epi32(temp4, add_rshift);
 1713|  2.63k|        temp5 = _mm_add_epi32(temp5, add_rshift);
 1714|  2.63k|        temp6 = _mm_add_epi32(temp6, add_rshift);
 1715|  2.63k|        temp7 = _mm_add_epi32(temp7, add_rshift);
 1716|  2.63k|        resq_r0 = _mm_srai_epi32(temp4, 4 - u4_qp_div_6);
 1717|  2.63k|        resq_r1 = _mm_srai_epi32(temp5, 4 - u4_qp_div_6);
 1718|  2.63k|        resq_r2 = _mm_srai_epi32(temp6, 4 - u4_qp_div_6);
 1719|  2.63k|        resq_r3 = _mm_srai_epi32(temp7, 4 - u4_qp_div_6);
 1720|  2.63k|    }
 1721|       |
 1722|  4.17k|    resq_r0 = _mm_insert_epi32(resq_r0, (WORD32) pi2_dc_src[0], 0);
 1723|       |    /* Perform Inverse transform */
 1724|       |    /*-------------------------------------------------------------*/
 1725|       |    /* IDCT [ Horizontal transformation ]                          */
 1726|       |    /*-------------------------------------------------------------*/
 1727|       |    // Matrix transpose
 1728|       |    /*
 1729|       |     *  a0 a1 a2 a3
 1730|       |     *  b0 b1 b2 b3
 1731|       |     *  c0 c1 c2 c3
 1732|       |     *  d0 d1 d2 d3
 1733|       |     */
 1734|  4.17k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 b0 a1 b1
 1735|  4.17k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // c0 d0 c1 d1
 1736|  4.17k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // a2 b2 a3 b3
 1737|  4.17k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 d2 c3 d3
 1738|  4.17k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 b0 c0 d0
 1739|  4.17k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // a1 b1 c1 d1
 1740|  4.17k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // a2 b2 c2 d2
 1741|  4.17k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);    // a3 b3 c3 d3
 1742|       |    // Transform starts -- horizontal transform
 1743|       |    /*------------------------------------------------------------------*/
 1744|       |    /* z0 = w0 + w2                                             */
 1745|  4.17k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
 1746|       |    /* z1 = w0 - w2                                             */
 1747|  4.17k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
 1748|       |    /* z2 = (w1 >> 1) - w3                                      */
 1749|  4.17k|    temp2 = _mm_srai_epi32(resq_r1, 1);     //(w1>>1)
 1750|  4.17k|    temp2 = _mm_sub_epi32(temp2, resq_r3);  //(w1>>1) - w3
 1751|       |    /* z3 = w1 + (w3 >> 1)                                      */
 1752|  4.17k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(w3>>1) + w1
 1753|  4.17k|    temp3 = _mm_add_epi32(temp3, resq_r1);
 1754|       |    /*----------------------------------------------------------*/
 1755|       |    /* x0 = z0 + z3                                             */
 1756|  4.17k|    resq_r0 = _mm_add_epi32(temp0, temp3);
 1757|       |    /* x1 = z1 + z2                                             */
 1758|  4.17k|    resq_r1 = _mm_add_epi32(temp1, temp2);
 1759|       |    /* x2 = z1 - z2                                             */
 1760|  4.17k|    resq_r2 = _mm_sub_epi32(temp1, temp2);
 1761|       |    /* x3 = z0 - z3                                             */
 1762|  4.17k|    resq_r3 = _mm_sub_epi32(temp0, temp3);
 1763|       |    // Matrix transpose
 1764|       |    /*
 1765|       |     *  a0 b0 c0 d0
 1766|       |     *  a1 b1 c1 d1
 1767|       |     *  a2 b2 c2 d2
 1768|       |     *  a3 b3 c3 d3
 1769|       |     */
 1770|  4.17k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 a1 b0 b1
 1771|  4.17k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // a2 a3 b2 b3
 1772|  4.17k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // c0 c1 d0 d1
 1773|  4.17k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 c3 d2 d3
 1774|  4.17k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 a1 a2 a3
 1775|  4.17k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // b0 b1 b2 b3
 1776|  4.17k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // c0 c1 c2 c3
 1777|  4.17k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);    // d0 d1 d2 d3
 1778|       |    // Transform ends -- horizontal transform
 1779|       |
 1780|       |    // Load pred buffer
 1781|       |    // p00 p01 p02 p03 0 0 0 0 0 0 0 0 -- all 8 bits
 1782|  4.17k|    pred_r0 = _mm_loadl_epi64((__m128i *) (&pu1_pred[0]));
 1783|       |    // p10 p11 p12 p13 0 0 0 0 0 0 0 0 -- all 8 bits
 1784|  4.17k|    pred_r1 = _mm_loadl_epi64((__m128i *) (&pu1_pred[pred_strd]));
 1785|       |    // p20 p21 p22 p23 0 0 0 0 0 0 0 0 -- all 8 bits
 1786|  4.17k|    pred_r2 = _mm_loadl_epi64((__m128i *) (&pu1_pred[2 * pred_strd]));
 1787|       |    // p30 p31 p32 p33 0 0 0 0 0 0 0 0 -- all 8 bits
 1788|  4.17k|    pred_r3 = _mm_loadl_epi64((__m128i *) (&pu1_pred[3 * pred_strd]));
 1789|       |
 1790|  4.17k|    pred_r0 = _mm_cvtepu8_epi16(pred_r0);  // p00 p01 p02 p03 -- all 16 bits
 1791|  4.17k|    pred_r1 = _mm_cvtepu8_epi16(pred_r1);  // p10 p11 p12 p13 -- all 16 bits
 1792|  4.17k|    pred_r2 = _mm_cvtepu8_epi16(pred_r2);  // p20 p21 p22 p23 -- all 16 bits
 1793|  4.17k|    pred_r3 = _mm_cvtepu8_epi16(pred_r3);  // p30 p31 p32 p33 -- all 16 bits
 1794|       |
 1795|       |    // Load resd buffer
 1796|  4.17k|    rsd_r0 = _mm_loadu_si128((__m128i *) (&pi2_rsd[0]));
 1797|  4.17k|    rsd_r1 = _mm_loadu_si128((__m128i *) (&pi2_rsd[rsd_strd]));
 1798|  4.17k|    rsd_r2 = _mm_loadu_si128((__m128i *) (&pi2_rsd[2 * rsd_strd]));
 1799|  4.17k|    rsd_r3 = _mm_loadu_si128((__m128i *) (&pi2_rsd[3 * rsd_strd]));
 1800|       |
 1801|       |    /*--------------------------------------------------------------*/
 1802|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6      */
 1803|       |    /*                                                              */
 1804|       |    /* Add the prediction and store it back to same buffer          */
 1805|       |    /*--------------------------------------------------------------*/
 1806|       |    /* z0j = y0j + y2j                                                        */
 1807|  4.17k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
 1808|       |    /* z1j = y0j - y2j                                                        */
 1809|  4.17k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
 1810|       |    /* z2j = (y1j>>1) - y3j */
 1811|  4.17k|    temp2 = _mm_srai_epi32(resq_r1, 1);  //(y1j>>1)
 1812|  4.17k|    temp2 = _mm_sub_epi32(temp2, resq_r3);
 1813|       |    /* z3j = y1j + (y3j>>1) */
 1814|  4.17k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(y3j>>1)
 1815|  4.17k|    temp3 = _mm_add_epi32(temp3, resq_r1);
 1816|       |
 1817|       |    /* x0j = z0j + z3j                                                        */
 1818|  4.17k|    temp4 = _mm_add_epi32(temp0, temp3);
 1819|  4.17k|    temp4 = _mm_add_epi32(temp4, value_32);
 1820|  4.17k|    temp4 = _mm_srai_epi32(temp4, 6);
 1821|  4.17k|    temp4 = _mm_add_epi16(temp4, rsd_r0);
 1822|  4.17k|    temp4 = _mm_min_epi16(dupmax_8x16b, temp4);
 1823|  4.17k|    temp4 = _mm_max_epi16(dupmin_8x16b, temp4);
 1824|  4.17k|    temp4 = _mm_add_epi16(temp4, pred_r0);
 1825|       |    /* x1j = z1j + z2j                                                        */
 1826|  4.17k|    temp5 = _mm_add_epi32(temp1, temp2);
 1827|  4.17k|    temp5 = _mm_add_epi32(temp5, value_32);
 1828|  4.17k|    temp5 = _mm_srai_epi32(temp5, 6);
 1829|  4.17k|    temp5 = _mm_add_epi16(temp5, rsd_r1);
 1830|  4.17k|    temp5 = _mm_min_epi16(dupmax_8x16b, temp5);
 1831|  4.17k|    temp5 = _mm_max_epi16(dupmin_8x16b, temp5);
 1832|  4.17k|    temp5 = _mm_add_epi16(temp5, pred_r1);
 1833|       |    /* x2j = z1j - z2j                                                        */
 1834|  4.17k|    temp6 = _mm_sub_epi32(temp1, temp2);
 1835|  4.17k|    temp6 = _mm_add_epi32(temp6, value_32);
 1836|  4.17k|    temp6 = _mm_srai_epi32(temp6, 6);
 1837|  4.17k|    temp6 = _mm_add_epi16(temp6, rsd_r2);
 1838|  4.17k|    temp6 = _mm_min_epi16(dupmax_8x16b, temp6);
 1839|  4.17k|    temp6 = _mm_max_epi16(dupmin_8x16b, temp6);
 1840|  4.17k|    temp6 = _mm_add_epi16(temp6, pred_r2);
 1841|       |    /* x3j = z0j - z3j                                                        */
 1842|  4.17k|    temp7 = _mm_sub_epi32(temp0, temp3);
 1843|  4.17k|    temp7 = _mm_add_epi32(temp7, value_32);
 1844|  4.17k|    temp7 = _mm_srai_epi32(temp7, 6);
 1845|  4.17k|    temp7 = _mm_add_epi16(temp7, rsd_r3);
 1846|  4.17k|    temp7 = _mm_min_epi16(dupmax_8x16b, temp7);
 1847|  4.17k|    temp7 = _mm_max_epi16(dupmin_8x16b, temp7);
 1848|  4.17k|    temp7 = _mm_add_epi16(temp7, pred_r3);
 1849|       |
 1850|  4.17k|    out_16x8b_0 = _mm_loadu_si128((__m128i *) (&pu1_out[0]));
 1851|  4.17k|    out_16x8b_1 = _mm_loadu_si128((__m128i *) (&pu1_out[out_strd]));
 1852|  4.17k|    out_16x8b_2 = _mm_loadu_si128((__m128i *) (&pu1_out[(out_strd << 1)]));
 1853|  4.17k|    out_16x8b_3 = _mm_loadu_si128((__m128i *) (&pu1_out[(out_strd << 1) + out_strd]));
 1854|       |
 1855|  4.17k|    out_16x8b_0 = _mm_and_si128(out_16x8b_0, chroma_mask);
 1856|  4.17k|    out_16x8b_1 = _mm_and_si128(out_16x8b_1, chroma_mask);
 1857|  4.17k|    out_16x8b_2 = _mm_and_si128(out_16x8b_2, chroma_mask);
 1858|  4.17k|    out_16x8b_3 = _mm_and_si128(out_16x8b_3, chroma_mask);
 1859|       |
 1860|  4.17k|    temp4 = _mm_packus_epi16(temp4, zero_8x16b);
 1861|  4.17k|    temp5 = _mm_packus_epi16(temp5, zero_8x16b);
 1862|  4.17k|    temp6 = _mm_packus_epi16(temp6, zero_8x16b);
 1863|  4.17k|    temp7 = _mm_packus_epi16(temp7, zero_8x16b);
 1864|       |
 1865|  4.17k|    temp4 = _mm_and_si128(temp4, chroma_mask2);
 1866|  4.17k|    temp5 = _mm_and_si128(temp5, chroma_mask2);
 1867|  4.17k|    temp6 = _mm_and_si128(temp6, chroma_mask2);
 1868|  4.17k|    temp7 = _mm_and_si128(temp7, chroma_mask2);
 1869|       |
 1870|  4.17k|    out_16x8b_0 = _mm_add_epi8(temp4, out_16x8b_0);
 1871|  4.17k|    out_16x8b_1 = _mm_add_epi8(temp5, out_16x8b_1);
 1872|  4.17k|    out_16x8b_2 = _mm_add_epi8(temp6, out_16x8b_2);
 1873|  4.17k|    out_16x8b_3 = _mm_add_epi8(temp7, out_16x8b_3);
 1874|       |
 1875|  4.17k|    _mm_storel_epi64((__m128i *) (pu1_out), out_16x8b_0);
 1876|  4.17k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd), out_16x8b_1);
 1877|  4.17k|    _mm_storel_epi64((__m128i *) (pu1_out + (out_strd << 1)), out_16x8b_2);
 1878|  4.17k|    _mm_storel_epi64((__m128i *) (pu1_out + (out_strd * 3)), out_16x8b_3);
 1879|  4.17k|}

isvcd_iquant_itrans_4x4_dc_sse42:
   84|  1.90k|{
   85|  1.90k|    WORD32 q0;
   86|  1.90k|    WORD16 rnd_fact = (u4_qp_div_6 < 4) ? 1 << (3 - u4_qp_div_6) : 0;
  ------------------
  |  Branch (86:23): [True: 468, False: 1.43k]
  ------------------
   87|  1.90k|    __m128i dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  1.90k|#define RSD_MAX 255
  ------------------
   88|  1.90k|    __m128i dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  1.90k|#define RSD_MIN -255
  ------------------
   89|  1.90k|    __m128i i_macro;
   90|  1.90k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  1.90k|#define UNUSED(x) ((void)(x))
  ------------------
   91|       |
   92|  1.90k|    if(iq_start_idx == 0)
  ------------------
  |  Branch (92:8): [True: 1.90k, False: 0]
  ------------------
   93|  1.90k|    {
   94|  1.90k|        q0 = pi2_src[0];
   95|  1.90k|        INV_QUANT(q0, pu2_iscal_mat[0], pu2_weigh_mat[0], u4_qp_div_6, rnd_fact, 4);
  ------------------
  |  |  103|  1.90k|                {\
  |  |  104|  1.90k|                    i4_value *= quant_scale;\
  |  |  105|  1.90k|                    i4_value *= weight_scale;\
  |  |  106|  1.90k|                    i4_value += rndfactor;\
  |  |  107|  1.90k|                    i4_value <<= u4_qp_div_6;\
  |  |  108|  1.90k|                    i4_value >>= qbits;\
  |  |  109|  1.90k|                }
  ------------------
   96|  1.90k|    }
   97|      0|    else
   98|      0|    {
   99|      0|        q0 = pi2_dc_ld_addr[0];  // Restoring dc value for intra case3
  100|      0|    }
  101|       |
  102|  1.90k|    i_macro = _mm_set1_epi16((q0 + 32) >> 6);
  103|  1.90k|    i_macro = _mm_min_epi16(dupmax_8x16b, i_macro);
  104|  1.90k|    i_macro = _mm_max_epi16(dupmin_8x16b, i_macro);
  105|       |
  106|  1.90k|    _mm_storel_epi64((__m128i *) pi2_out, i_macro);
  107|  1.90k|    pi2_out += out_strd;
  108|  1.90k|    _mm_storel_epi64((__m128i *) pi2_out, i_macro);
  109|  1.90k|    pi2_out += out_strd;
  110|  1.90k|    _mm_storel_epi64((__m128i *) pi2_out, i_macro);
  111|  1.90k|    pi2_out += out_strd;
  112|  1.90k|    _mm_storel_epi64((__m128i *) pi2_out, i_macro);
  113|  1.90k|}
isvcd_iquant_itrans_8x8_dc_sse42:
  142|    927|{
  143|    927|    WORD32 q;
  144|    927|    WORD32 rnd_fact = (qp_div < 6) ? (1 << (5 - qp_div)) : 0;
  ------------------
  |  Branch (144:23): [True: 471, False: 456]
  ------------------
  145|    927|    __m128i dupmin_8x16b, dupmax_8x16b, i_macro;
  146|       |
  147|    927|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|    927|#define UNUSED(x) ((void)(x))
  ------------------
  148|    927|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|    927|#define UNUSED(x) ((void)(x))
  ------------------
  149|    927|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|    927|#define UNUSED(x) ((void)(x))
  ------------------
  150|       |
  151|    927|    q = pi2_src[0];
  152|    927|    INV_QUANT(q, pu2_iscale_mat[0], pu2_weigh_mat[0], qp_div, rnd_fact, 6);
  ------------------
  |  |  103|    927|                {\
  |  |  104|    927|                    i4_value *= quant_scale;\
  |  |  105|    927|                    i4_value *= weight_scale;\
  |  |  106|    927|                    i4_value += rndfactor;\
  |  |  107|    927|                    i4_value <<= u4_qp_div_6;\
  |  |  108|    927|                    i4_value >>= qbits;\
  |  |  109|    927|                }
  ------------------
  153|       |
  154|    927|    i_macro = _mm_set1_epi16((q + 32) >> 6);
  155|    927|    dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|    927|#define RSD_MAX 255
  ------------------
  156|    927|    dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|    927|#define RSD_MIN -255
  ------------------
  157|       |
  158|    927|    i_macro = _mm_min_epi16(dupmax_8x16b, i_macro);
  159|    927|    i_macro = _mm_max_epi16(dupmin_8x16b, i_macro);
  160|       |
  161|    927|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  162|    927|    pi2_out += out_strd;
  163|    927|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  164|    927|    pi2_out += out_strd;
  165|    927|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  166|    927|    pi2_out += out_strd;
  167|    927|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  168|    927|    pi2_out += out_strd;
  169|    927|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  170|    927|    pi2_out += out_strd;
  171|    927|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  172|    927|    pi2_out += out_strd;
  173|    927|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  174|    927|    pi2_out += out_strd;
  175|    927|    _mm_storeu_si128((__m128i *) pi2_out, i_macro);
  176|    927|}
isvcd_iquant_itrans_chroma_4x4_dc_sse42:
  204|  6.15k|{
  205|  6.15k|    __m128i src_r0, src_r1, src_r2, src_r3;
  206|  6.15k|    __m128i i_macro = _mm_set1_epi16((pi2_dc_src[0] + 32) >> 6);
  207|  6.15k|    __m128i chroma_mask_even, chroma_mask_odd;
  208|  6.15k|    __m128i dupmax_8x16b = _mm_set1_epi16(RSD_MAX);
  ------------------
  |  |  772|  6.15k|#define RSD_MAX 255
  ------------------
  209|  6.15k|    __m128i dupmin_8x16b = _mm_set1_epi16(RSD_MIN);
  ------------------
  |  |  773|  6.15k|#define RSD_MIN -255
  ------------------
  210|       |
  211|  6.15k|    UNUSED(pi2_src);
  ------------------
  |  |   45|  6.15k|#define UNUSED(x) ((void)(x))
  ------------------
  212|  6.15k|    UNUSED(pu2_iscal_mat);
  ------------------
  |  |   45|  6.15k|#define UNUSED(x) ((void)(x))
  ------------------
  213|  6.15k|    UNUSED(pu2_weigh_mat);
  ------------------
  |  |   45|  6.15k|#define UNUSED(x) ((void)(x))
  ------------------
  214|  6.15k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  6.15k|#define UNUSED(x) ((void)(x))
  ------------------
  215|  6.15k|    UNUSED(u4_qp_div_6);
  ------------------
  |  |   45|  6.15k|#define UNUSED(x) ((void)(x))
  ------------------
  216|       |
  217|  6.15k|    i_macro = _mm_min_epi16(dupmax_8x16b, i_macro);
  218|  6.15k|    i_macro = _mm_max_epi16(dupmin_8x16b, i_macro);
  219|       |
  220|       |    // a00 a01 a02 a03 a10 a11 a12 a13 -- the source matrix 0th,1st row
  221|  6.15k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_out));
  222|       |    // a20 a21 a22 a23 a30 a31 a32 a33  -- the source matrix 2nd,3rd row
  223|  6.15k|    src_r1 = _mm_loadu_si128((__m128i *) (pi2_out + (1 * out_strd)));
  224|  6.15k|    src_r2 = _mm_loadu_si128((__m128i *) (pi2_out + (2 * out_strd)));
  225|  6.15k|    src_r3 = _mm_loadu_si128((__m128i *) (pi2_out + (3 * out_strd)));
  226|       |
  227|  6.15k|    chroma_mask_even =
  228|  6.15k|        _mm_set_epi16(0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff);
  229|  6.15k|    chroma_mask_odd = _mm_set_epi16(0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000);
  230|       |
  231|  6.15k|    src_r0 = _mm_and_si128(src_r0, chroma_mask_odd);  // 0 src1 0 src2 0 ...
  232|  6.15k|    src_r1 = _mm_and_si128(src_r1, chroma_mask_odd);
  233|  6.15k|    src_r2 = _mm_and_si128(src_r2, chroma_mask_odd);
  234|  6.15k|    src_r3 = _mm_and_si128(src_r3, chroma_mask_odd);
  235|       |
  236|  6.15k|    i_macro = _mm_and_si128(i_macro, chroma_mask_even);  // macro 0 macro 0 ..
  237|       |
  238|  6.15k|    src_r0 = _mm_add_epi16(src_r0, i_macro);             // macro  src1 macro src2 macro ...
  239|  6.15k|    src_r1 = _mm_add_epi16(src_r1, i_macro);
  240|  6.15k|    src_r2 = _mm_add_epi16(src_r2, i_macro);
  241|  6.15k|    src_r3 = _mm_add_epi16(src_r3, i_macro);
  242|       |
  243|  6.15k|    _mm_storeu_si128((__m128i *) (&pi2_out[0]), src_r0);
  244|  6.15k|    _mm_storeu_si128((__m128i *) (&pi2_out[out_strd]), src_r1);
  245|  6.15k|    _mm_storeu_si128((__m128i *) (&pi2_out[2 * out_strd]), src_r2);
  246|  6.15k|    _mm_storeu_si128((__m128i *) (&pi2_out[3 * out_strd]), src_r3);
  247|  6.15k|}
isvcd_iquant_itrans_4x4_sse42:
  275|  19.7k|{
  276|  19.7k|    __m128i src_r0_r1, src_r2_r3;
  277|  19.7k|    __m128i src_r0, src_r1, src_r2, src_r3;
  278|  19.7k|    __m128i scalemat_r0_r1, scalemat_r2_r3;
  279|  19.7k|    __m128i dequant_r0_r1, dequant_r2_r3;
  280|  19.7k|    __m128i zero_8x16b = _mm_setzero_si128();  // all bits reset to zero
  281|  19.7k|    __m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
  282|  19.7k|    __m128i resq_r0, resq_r1, resq_r2, resq_r3;
  283|  19.7k|    __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
  ------------------
  |  Branch (283:41): [True: 16.1k, False: 3.62k]
  ------------------
  284|  19.7k|    __m128i value_32 = _mm_set1_epi32(32);
  285|  19.7k|    __m128i dupmax_4x32b = _mm_set1_epi32(RSD_MAX);
  ------------------
  |  |  772|  19.7k|#define RSD_MAX 255
  ------------------
  286|  19.7k|    __m128i dupmin_4x32b = _mm_set1_epi32(RSD_MIN);
  ------------------
  |  |  773|  19.7k|#define RSD_MIN -255
  ------------------
  287|  19.7k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  19.7k|#define UNUSED(x) ((void)(x))
  ------------------
  288|       |
  289|       |    /*************************************************************/
  290|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
  291|       |    /* operations on platform                                    */
  292|       |    /*************************************************************/
  293|       |    // a00 a01 a02 a03 a10 a11 a12 a13 -- the source matrix 0th,1st row
  294|  19.7k|    src_r0_r1 = _mm_loadu_si128((__m128i *) (pi2_src));
  295|       |    // a20 a21 a22 a23 a30 a31 a32 a33 -- the source matrix 2nd,3rd row
  296|  19.7k|    src_r2_r3 = _mm_loadu_si128((__m128i *) (pi2_src + 8));
  297|       |    // b00 b01 b02 b03 b10 b11 b12 b13 -- the scaling matrix 0th,1st row
  298|  19.7k|    scalemat_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat));
  299|       |    // b20 b21 b22 b23 b30 b31 b32 b33 -- the scaling matrix 2nd,3rd row
  300|  19.7k|    scalemat_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat + 8));
  301|       |    // q00 q01 q02 q03 q10 q11 q12 q13 -- all 16 bits
  302|  19.7k|    dequant_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat));
  303|       |    // q20 q21 q22 q23 q30 q31 q32 q33 -- all 16 bits
  304|  19.7k|    dequant_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat + 8));
  305|       |
  306|       |    // b00*q00 b01*q01 b02*q02 b03*q03 b10*q10 b11*q11 b12*q12 b13*q13 -- 16 bit result
  307|  19.7k|    temp0 = _mm_mullo_epi16(scalemat_r0_r1, dequant_r0_r1);
  308|       |    // b00*q00 b01*q01 b02*q02 b03*q03 b10*q10 b11*q11 b12*q12 b13*q13 -- 16 bit result
  309|  19.7k|    temp1 = _mm_mullo_epi16(scalemat_r2_r3, dequant_r2_r3);
  310|       |
  311|       |    // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
  312|  19.7k|    temp4 = _mm_unpacklo_epi16(temp0, zero_8x16b);
  313|       |    // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  314|  19.7k|    temp5 = _mm_unpackhi_epi16(temp0, zero_8x16b);
  315|       |    // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
  316|  19.7k|    temp6 = _mm_unpacklo_epi16(temp1, zero_8x16b);
  317|       |    // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
  318|  19.7k|    temp7 = _mm_unpackhi_epi16(temp1, zero_8x16b);
  319|       |
  320|  19.7k|    src_r0 = _mm_unpacklo_epi16(src_r0_r1, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  321|  19.7k|    src_r1 = _mm_unpackhi_epi16(src_r0_r1, zero_8x16b);  // a10 0 a11 0 a12 0 a13 0 -- 16 bit long
  322|  19.7k|    src_r2 = _mm_unpacklo_epi16(src_r2_r3, zero_8x16b);  // a20 0 a21 0 a22 0 a23 0 -- 16 bit long
  323|  19.7k|    src_r3 = _mm_unpackhi_epi16(src_r2_r3, zero_8x16b);  // a30 0 a31 0 a32 0 a33 0 -- 16 bit long
  324|       |
  325|       |    // a00*b00*q00 a10*b10*q10 a20*b20*q20 a30*b30 q30 -- 32 bits long
  326|  19.7k|    temp4 = _mm_madd_epi16(src_r0, temp4);
  327|  19.7k|    temp5 = _mm_madd_epi16(src_r1, temp5);
  328|  19.7k|    temp6 = _mm_madd_epi16(src_r2, temp6);
  329|  19.7k|    temp7 = _mm_madd_epi16(src_r3, temp7);
  330|       |
  331|  19.7k|    if(u4_qp_div_6 >= 4)
  ------------------
  |  Branch (331:8): [True: 3.62k, False: 16.1k]
  ------------------
  332|  3.62k|    {
  333|  3.62k|        resq_r0 = _mm_slli_epi32(temp4, u4_qp_div_6 - 4);
  334|  3.62k|        resq_r1 = _mm_slli_epi32(temp5, u4_qp_div_6 - 4);
  335|  3.62k|        resq_r2 = _mm_slli_epi32(temp6, u4_qp_div_6 - 4);
  336|  3.62k|        resq_r3 = _mm_slli_epi32(temp7, u4_qp_div_6 - 4);
  337|  3.62k|    }
  338|  16.1k|    else
  339|  16.1k|    {
  340|  16.1k|        temp4 = _mm_add_epi32(temp4, add_rshift);
  341|  16.1k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  342|  16.1k|        temp6 = _mm_add_epi32(temp6, add_rshift);
  343|  16.1k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  344|  16.1k|        resq_r0 = _mm_srai_epi32(temp4, 4 - u4_qp_div_6);
  345|  16.1k|        resq_r1 = _mm_srai_epi32(temp5, 4 - u4_qp_div_6);
  346|  16.1k|        resq_r2 = _mm_srai_epi32(temp6, 4 - u4_qp_div_6);
  347|  16.1k|        resq_r3 = _mm_srai_epi32(temp7, 4 - u4_qp_div_6);
  348|  16.1k|    }
  349|       |
  350|  19.7k|    if(iq_start_idx == 1) resq_r0 = _mm_insert_epi32(resq_r0, (WORD32) pi2_dc_ld_addr[0], 0);
  ------------------
  |  Branch (350:8): [True: 0, False: 19.7k]
  ------------------
  351|       |    /* Perform Inverse transform */
  352|       |    /*-------------------------------------------------------------*/
  353|       |    /* IDCT [ Horizontal transformation ]                          */
  354|       |    /*-------------------------------------------------------------*/
  355|       |    // Matrix transpose
  356|       |    /*
  357|       |     *  a0 a1 a2 a3
  358|       |     *  b0 b1 b2 b3
  359|       |     *  c0 c1 c2 c3
  360|       |     *  d0 d1 d2 d3
  361|       |     */
  362|  19.7k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 b0 a1 b1
  363|  19.7k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // c0 d0 c1 d1
  364|  19.7k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // a2 b2 a3 b3
  365|  19.7k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 d2 c3 d3
  366|  19.7k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 b0 c0 d0
  367|  19.7k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // a1 b1 c1 d1
  368|  19.7k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // a2 b2 c2 d2
  369|  19.7k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);    // a3 b3 c3 d3
  370|       |    // Transform starts -- horizontal transform
  371|       |    /*------------------------------------------------------------------*/
  372|       |    /* z0 = w0 + w2                                             */
  373|  19.7k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  374|       |    /* z1 = w0 - w2                                             */
  375|  19.7k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  376|       |    /* z2 = (w1 >> 1) - w3                                      */
  377|  19.7k|    temp2 = _mm_srai_epi32(resq_r1, 1);     //(w1>>1)
  378|  19.7k|    temp2 = _mm_sub_epi32(temp2, resq_r3);  //(w1>>1) - w3
  379|       |    /* z3 = w1 + (w3 >> 1)                                      */
  380|  19.7k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(w3>>1) + w1
  381|  19.7k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  382|       |    /*----------------------------------------------------------*/
  383|       |    /* x0 = z0 + z3                                             */
  384|  19.7k|    resq_r0 = _mm_add_epi32(temp0, temp3);
  385|       |    /* x1 = z1 + z2                                             */
  386|  19.7k|    resq_r1 = _mm_add_epi32(temp1, temp2);
  387|       |    /* x2 = z1 - z2                                             */
  388|  19.7k|    resq_r2 = _mm_sub_epi32(temp1, temp2);
  389|       |    /* x3 = z0 - z3                                             */
  390|  19.7k|    resq_r3 = _mm_sub_epi32(temp0, temp3);
  391|       |    // Matrix transpose
  392|       |    /*
  393|       |     *  a0 b0 c0 d0
  394|       |     *  a1 b1 c1 d1
  395|       |     *  a2 b2 c2 d2
  396|       |     *  a3 b3 c3 d3
  397|       |     */
  398|  19.7k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 a1 b0 b1
  399|  19.7k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // a2 a3 b2 b3
  400|  19.7k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // c0 c1 d0 d1
  401|  19.7k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 c3 d2 d3
  402|  19.7k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 a1 a2 a3
  403|  19.7k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // b0 b1 b2 b3
  404|  19.7k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // c0 c1 c2 c3
  405|  19.7k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);    // d0 d1 d2 d3
  406|       |    // Transform ends -- horizontal transform
  407|       |
  408|       |    /*--------------------------------------------------------------*/
  409|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6      */
  410|       |    /*                                                              */
  411|       |    /* Add the prediction and store it back to same buffer          */
  412|       |    /*--------------------------------------------------------------*/
  413|       |    /* z0j = y0j + y2j                                                        */
  414|  19.7k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
  415|       |    /* z1j = y0j - y2j                                                        */
  416|  19.7k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
  417|       |    /* z2j = (y1j>>1) - y3j */
  418|  19.7k|    temp2 = _mm_srai_epi32(resq_r1, 1);  //(y1j>>1)
  419|  19.7k|    temp2 = _mm_sub_epi32(temp2, resq_r3);
  420|       |    /* z3j = y1j + (y3j>>1) */
  421|  19.7k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(y3j>>1)
  422|  19.7k|    temp3 = _mm_add_epi32(temp3, resq_r1);
  423|       |
  424|       |    /* x0j = z0j + z3j                                                        */
  425|  19.7k|    temp4 = _mm_add_epi32(temp0, temp3);
  426|  19.7k|    temp4 = _mm_add_epi32(temp4, value_32);
  427|  19.7k|    temp4 = _mm_srai_epi32(temp4, 6);
  428|  19.7k|    temp4 = _mm_min_epi32(dupmax_4x32b, temp4);
  429|  19.7k|    temp4 = _mm_max_epi32(dupmin_4x32b, temp4);
  430|       |
  431|       |    /* x1j = z1j + z2j                                                        */
  432|  19.7k|    temp5 = _mm_add_epi32(temp1, temp2);
  433|  19.7k|    temp5 = _mm_add_epi32(temp5, value_32);
  434|  19.7k|    temp5 = _mm_srai_epi32(temp5, 6);
  435|  19.7k|    temp5 = _mm_min_epi32(dupmax_4x32b, temp5);
  436|  19.7k|    temp5 = _mm_max_epi32(dupmin_4x32b, temp5);
  437|       |
  438|       |    /* x2j = z1j - z2j                                                        */
  439|  19.7k|    temp6 = _mm_sub_epi32(temp1, temp2);
  440|  19.7k|    temp6 = _mm_add_epi32(temp6, value_32);
  441|  19.7k|    temp6 = _mm_srai_epi32(temp6, 6);
  442|  19.7k|    temp6 = _mm_min_epi32(dupmax_4x32b, temp6);
  443|  19.7k|    temp6 = _mm_max_epi32(dupmin_4x32b, temp6);
  444|       |
  445|       |    /* x3j = z0j - z3j                                                        */
  446|  19.7k|    temp7 = _mm_sub_epi32(temp0, temp3);
  447|  19.7k|    temp7 = _mm_add_epi32(temp7, value_32);
  448|  19.7k|    temp7 = _mm_srai_epi32(temp7, 6);
  449|  19.7k|    temp7 = _mm_min_epi32(dupmax_4x32b, temp7);
  450|  19.7k|    temp7 = _mm_max_epi32(dupmin_4x32b, temp7);
  451|       |
  452|       |    // 32-bit to 16-bit conversion
  453|  19.7k|    temp0 = _mm_packs_epi32(temp4, temp5);
  454|  19.7k|    temp1 = _mm_packs_epi32(temp6, temp7);
  455|       |
  456|  19.7k|    resq_r0 = temp0;
  457|  19.7k|    resq_r1 = _mm_srli_si128(temp0, 8);
  458|  19.7k|    resq_r2 = temp1;
  459|  19.7k|    resq_r3 = _mm_srli_si128(temp1, 8);
  460|       |
  461|  19.7k|    _mm_storel_epi64((__m128i *) pi2_out, resq_r0);
  462|  19.7k|    pi2_out += out_strd;
  463|  19.7k|    _mm_storel_epi64((__m128i *) pi2_out, resq_r1);
  464|  19.7k|    pi2_out += out_strd;
  465|  19.7k|    _mm_storel_epi64((__m128i *) pi2_out, resq_r2);
  466|  19.7k|    pi2_out += out_strd;
  467|  19.7k|    _mm_storel_epi64((__m128i *) pi2_out, resq_r3);
  468|  19.7k|}
isvcd_iquant_itrans_8x8_sse42:
  497|  2.57k|{
  498|  2.57k|    __m128i src_r0;
  499|  2.57k|    __m128i scalemat_r0;
  500|  2.57k|    __m128i zero_8x16b = _mm_setzero_si128();  // all bits reset to zero
  501|  2.57k|    __m128i value_32 = _mm_set1_epi32(32);
  502|  2.57k|    __m128i add_rshift = _mm_set1_epi32((qp_div < 6) ? (1 << (5 - qp_div)) : 0);
  ------------------
  |  Branch (502:41): [True: 1.74k, False: 834]
  ------------------
  503|  2.57k|    __m128i dequant_r0;
  504|  2.57k|    __m128i sign_reg;
  505|  2.57k|    __m128i src_r0_1, src_r0_2;
  506|  2.57k|    __m128i scalemat_r0_1, scalemat_r0_2;
  507|  2.57k|    __m128i temp1, temp2, temp3, temp4, temp5, temp6, temp7, temp8;
  508|  2.57k|    __m128i temp10, temp11, temp12, temp13, temp14, temp15, temp16, temp17, temp18, temp19, temp20;
  509|       |    // To store dequantization results
  510|  2.57k|    __m128i resq_r0_1, resq_r0_2, resq_r1_1, resq_r1_2, resq_r2_1, resq_r2_2, resq_r3_1, resq_r3_2,
  511|  2.57k|        resq_r4_1, resq_r4_2, resq_r5_1, resq_r5_2, resq_r6_1, resq_r6_2, resq_r7_1, resq_r7_2;
  512|  2.57k|    __m128i dupmax_4x32b = _mm_set1_epi32(RSD_MAX);
  ------------------
  |  |  772|  2.57k|#define RSD_MAX 255
  ------------------
  513|  2.57k|    __m128i dupmin_4x32b = _mm_set1_epi32(RSD_MIN);
  ------------------
  |  |  773|  2.57k|#define RSD_MIN -255
  ------------------
  514|       |
  515|  2.57k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  2.57k|#define UNUSED(x) ((void)(x))
  ------------------
  516|  2.57k|    UNUSED(iq_start_idx);
  ------------------
  |  |   45|  2.57k|#define UNUSED(x) ((void)(x))
  ------------------
  517|  2.57k|    UNUSED(pi2_dc_ld_addr);
  ------------------
  |  |   45|  2.57k|#define UNUSED(x) ((void)(x))
  ------------------
  518|       |
  519|       |    /*************************************************************/
  520|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
  521|       |    /* operations on platform. Note : DC coeff is not scaled     */
  522|       |    /*************************************************************/
  523|       |
  524|       |    // Row 0 processing
  525|       |    // a00 a01 a02 a03 a04 a05 a06 a07 -- the source matrix 0th row
  526|  2.57k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src));
  527|       |    // b00 b01 b02 b03 b04 b05 b06 b07 -- the scaling matrix 0th row
  528|  2.57k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat));
  529|  2.57k|    dequant_r0 =
  530|  2.57k|        _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[0]));  // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  531|  2.57k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);     // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  532|  2.57k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);     // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  533|       |    // b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  534|  2.57k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  535|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  536|  2.57k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  537|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  538|  2.57k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  539|       |
  540|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  541|  2.57k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  542|       |    // a04*b04*q4 a05*b05*q5 a06*b06*q6  a07*b07*q7 -- 32 bits long
  543|  2.57k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  544|       |
  545|  2.57k|    if(qp_div >= 6)
  ------------------
  |  Branch (545:8): [True: 834, False: 1.74k]
  ------------------
  546|    834|    {
  547|    834|        resq_r0_1 = _mm_slli_epi32(temp5, qp_div - 6);
  548|    834|        resq_r0_2 = _mm_slli_epi32(temp7, qp_div - 6);
  549|    834|    }
  550|  1.74k|    else
  551|  1.74k|    {
  552|  1.74k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  553|  1.74k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  554|  1.74k|        resq_r0_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  555|  1.74k|        resq_r0_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  556|  1.74k|    }
  557|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 16
  558|       |    // bit long
  559|  2.57k|    resq_r0_1 = _mm_packs_epi32(resq_r0_1, resq_r0_2);
  560|       |    // Row 1 processing
  561|       |    // a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 1st row
  562|  2.57k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 8));
  563|       |    // b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 1st row
  564|  2.57k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 8));
  565|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  566|  2.57k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[8]));
  567|  2.57k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  568|  2.57k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);  // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  569|       |    // b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  570|  2.57k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  571|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  572|  2.57k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  573|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  574|  2.57k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  575|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  576|  2.57k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  577|       |    // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  578|  2.57k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  579|  2.57k|    if(qp_div >= 6)
  ------------------
  |  Branch (579:8): [True: 834, False: 1.74k]
  ------------------
  580|    834|    {
  581|    834|        resq_r1_1 = _mm_slli_epi32(temp5, qp_div - 6);
  582|    834|        resq_r1_2 = _mm_slli_epi32(temp7, qp_div - 6);
  583|    834|    }
  584|  1.74k|    else
  585|  1.74k|    {
  586|  1.74k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  587|  1.74k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  588|  1.74k|        resq_r1_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  589|  1.74k|        resq_r1_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  590|  1.74k|    }
  591|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7
  592|  2.57k|    resq_r1_1 = _mm_packs_epi32(resq_r1_1, resq_r1_2);
  593|       |    // Row 2 processing
  594|       |    // a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 2nd row
  595|  2.57k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 16));
  596|       |    // b00 b01 b02 b03 b04 b05 b06 b07 b08-- the scaling matrix 2nd row
  597|  2.57k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 16));
  598|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  599|  2.57k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[16]));
  600|  2.57k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  601|  2.57k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);  // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  602|       |    // b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  603|  2.57k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  604|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  605|  2.57k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  606|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  607|  2.57k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  608|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  609|  2.57k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  610|       |    // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  611|  2.57k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  612|  2.57k|    if(qp_div >= 6)
  ------------------
  |  Branch (612:8): [True: 834, False: 1.74k]
  ------------------
  613|    834|    {
  614|    834|        resq_r2_1 = _mm_slli_epi32(temp5, qp_div - 6);
  615|    834|        resq_r2_2 = _mm_slli_epi32(temp7, qp_div - 6);
  616|    834|    }
  617|  1.74k|    else
  618|  1.74k|    {
  619|  1.74k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  620|  1.74k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  621|  1.74k|        resq_r2_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  622|  1.74k|        resq_r2_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  623|  1.74k|    }
  624|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7
  625|  2.57k|    resq_r2_1 = _mm_packs_epi32(resq_r2_1, resq_r2_2);
  626|       |    // Row 3 processing
  627|       |    // a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 3rd row
  628|  2.57k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 24));
  629|       |    // b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 3rd row
  630|  2.57k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 24));
  631|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  632|  2.57k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[24]));
  633|  2.57k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  634|       |    // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  635|  2.57k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);
  636|       |    // b00*q0 b01*q1 b02*q2 b03*q3 b04*q4  b05*q5 b06*q6 b07*q7 -- 16 bit result
  637|  2.57k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  638|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  639|  2.57k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  640|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  641|  2.57k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  642|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 - 32 bits long
  643|  2.57k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  644|       |    // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  645|  2.57k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  646|  2.57k|    if(qp_div >= 6)
  ------------------
  |  Branch (646:8): [True: 834, False: 1.74k]
  ------------------
  647|    834|    {
  648|    834|        resq_r3_1 = _mm_slli_epi32(temp5, qp_div - 6);
  649|    834|        resq_r3_2 = _mm_slli_epi32(temp7, qp_div - 6);
  650|    834|    }
  651|  1.74k|    else
  652|  1.74k|    {
  653|  1.74k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  654|  1.74k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  655|  1.74k|        resq_r3_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  656|  1.74k|        resq_r3_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  657|  1.74k|    }
  658|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4  a05*b05*q5 a06*b06*q6 a07*b07*q7
  659|  2.57k|    resq_r3_1 = _mm_packs_epi32(resq_r3_1, resq_r3_2);
  660|       |    // Row 4 processing
  661|       |    // a00 a01 a02 a03 a04 a05 a06 a07 a08 --  the source matrix 4th row
  662|  2.57k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 32));
  663|       |    // b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 4th row
  664|  2.57k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 32));
  665|  2.57k|    dequant_r0 = _mm_loadu_si128(
  666|  2.57k|        (__m128i *) (&pu2_weigh_mat[32]));              // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  667|  2.57k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  668|  2.57k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);  // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  669|       |    // b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result
  670|  2.57k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  671|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  672|  2.57k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  673|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  674|  2.57k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  675|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  676|  2.57k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  677|       |    // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  678|  2.57k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  679|  2.57k|    if(qp_div >= 6)
  ------------------
  |  Branch (679:8): [True: 834, False: 1.74k]
  ------------------
  680|    834|    {
  681|    834|        resq_r4_1 = _mm_slli_epi32(temp5, qp_div - 6);
  682|    834|        resq_r4_2 = _mm_slli_epi32(temp7, qp_div - 6);
  683|    834|    }
  684|  1.74k|    else
  685|  1.74k|    {
  686|  1.74k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  687|  1.74k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  688|  1.74k|        resq_r4_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  689|  1.74k|        resq_r4_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  690|  1.74k|    }
  691|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7
  692|  2.57k|    resq_r4_1 = _mm_packs_epi32(resq_r4_1, resq_r4_2);
  693|       |    // Row 5 processing
  694|       |    // a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 5th row
  695|  2.57k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 40));
  696|       |    // b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 5th row
  697|  2.57k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 40));
  698|       |    // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  699|  2.57k|    dequant_r0 = _mm_loadu_si128((__m128i *) (&pu2_weigh_mat[40]));
  700|  2.57k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  701|  2.57k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);  // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  702|       |    // b00*q0 b01*q1 b02*q2 b03*q3 b04*q4  b05*q5 b06*q6 b07*q7 -- 16 bit result
  703|  2.57k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  704|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  705|  2.57k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  706|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  707|  2.57k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  708|       |    // a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long
  709|  2.57k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  710|       |    // a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long
  711|  2.57k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  712|  2.57k|    if(qp_div >= 6)
  ------------------
  |  Branch (712:8): [True: 834, False: 1.74k]
  ------------------
  713|    834|    {
  714|    834|        resq_r5_1 = _mm_slli_epi32(temp5, qp_div - 6);
  715|    834|        resq_r5_2 = _mm_slli_epi32(temp7, qp_div - 6);
  716|    834|    }
  717|  1.74k|    else
  718|  1.74k|    {
  719|  1.74k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  720|  1.74k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  721|  1.74k|        resq_r5_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  722|  1.74k|        resq_r5_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  723|  1.74k|    }
  724|       |    /* a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 */
  725|  2.57k|    resq_r5_1 = _mm_packs_epi32(resq_r5_1, resq_r5_2);
  726|       |    // Row 6 processing
  727|       |    /* a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 6th row */
  728|  2.57k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 48));
  729|       |    /* b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 6th row */
  730|  2.57k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 48));
  731|  2.57k|    dequant_r0 = _mm_loadu_si128(
  732|  2.57k|        (__m128i *) (&pu2_weigh_mat[48]));              // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  733|  2.57k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  734|  2.57k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);  // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  735|       |    /* b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result */
  736|  2.57k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  737|       |    // b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long
  738|  2.57k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  739|       |    // b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long
  740|  2.57k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  741|       |    /* a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long */
  742|  2.57k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  743|       |    /* a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long */
  744|  2.57k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  745|  2.57k|    if(qp_div >= 6)
  ------------------
  |  Branch (745:8): [True: 834, False: 1.74k]
  ------------------
  746|    834|    {
  747|    834|        resq_r6_1 = _mm_slli_epi32(temp5, qp_div - 6);
  748|    834|        resq_r6_2 = _mm_slli_epi32(temp7, qp_div - 6);
  749|    834|    }
  750|  1.74k|    else
  751|  1.74k|    {
  752|  1.74k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  753|  1.74k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  754|  1.74k|        resq_r6_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  755|  1.74k|        resq_r6_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  756|  1.74k|    }
  757|       |    /* a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 */
  758|  2.57k|    resq_r6_1 = _mm_packs_epi32(resq_r6_1, resq_r6_2);
  759|       |    // Row 7 processing
  760|       |    /* a00 a01 a02 a03 a04 a05 a06 a07 a08 -- the source matrix 7th row */
  761|  2.57k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_src + 56));
  762|       |    /* b00 b01 b02 b03 b04 b05 b06 b07 b08 -- the scaling matrix 7th row */
  763|  2.57k|    scalemat_r0 = _mm_loadu_si128((__m128i *) (pu2_iscale_mat + 56));
  764|  2.57k|    dequant_r0 = _mm_loadu_si128(
  765|  2.57k|        (__m128i *) (&pu2_weigh_mat[56]));              // q0 q1 q2 q3 q4 q5 q6 q7 -- all 16 bits
  766|  2.57k|    src_r0_1 = _mm_unpacklo_epi16(src_r0, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
  767|  2.57k|    src_r0_2 = _mm_unpackhi_epi16(src_r0, zero_8x16b);  // a04 0 a05 0 a06 0 a07 0 -- 16 bit long
  768|       |
  769|       |    /* b00*q0 b01*q1 b02*q2 b03*q3 b04*q4 b05*q5 b06*q6 b07*q7 -- 16 bit result */
  770|  2.57k|    temp10 = _mm_mullo_epi16(scalemat_r0, dequant_r0);
  771|       |    /* b00*q0 0 b01*q1 0 b02*q2 0 b03*q3 0 -- 16 bit long */
  772|  2.57k|    scalemat_r0_1 = _mm_unpacklo_epi16(temp10, zero_8x16b);
  773|       |    /* b04*q4 0 b05*q5 0 b06*q6 0 b07*q7 0 -- 16 bit long */
  774|  2.57k|    scalemat_r0_2 = _mm_unpackhi_epi16(temp10, zero_8x16b);
  775|       |    /* a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 -- 32 bits long */
  776|  2.57k|    temp5 = _mm_madd_epi16(src_r0_1, scalemat_r0_1);
  777|       |    /* a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 -- 32 bits long */
  778|  2.57k|    temp7 = _mm_madd_epi16(src_r0_2, scalemat_r0_2);
  779|  2.57k|    if(qp_div >= 6)
  ------------------
  |  Branch (779:8): [True: 834, False: 1.74k]
  ------------------
  780|    834|    {
  781|    834|        resq_r7_1 = _mm_slli_epi32(temp5, qp_div - 6);
  782|    834|        resq_r7_2 = _mm_slli_epi32(temp7, qp_div - 6);
  783|    834|    }
  784|  1.74k|    else
  785|  1.74k|    {
  786|  1.74k|        temp5 = _mm_add_epi32(temp5, add_rshift);
  787|  1.74k|        temp7 = _mm_add_epi32(temp7, add_rshift);
  788|  1.74k|        resq_r7_1 = _mm_srai_epi32(temp5, 6 - qp_div);
  789|  1.74k|        resq_r7_2 = _mm_srai_epi32(temp7, 6 - qp_div);
  790|  1.74k|    }
  791|       |    /* a00*b00*q0 a01*b01*q1 a02*b02*q2 a03*b03*q3 a04*b04*q4 a05*b05*q5 a06*b06*q6 a07*b07*q7 */
  792|  2.57k|    resq_r7_1 = _mm_packs_epi32(resq_r7_1, resq_r7_2);
  793|       |    /* Perform Inverse transform */
  794|       |    /*--------------------------------------------------------------------*/
  795|       |    /* IDCT [ Horizontal transformation ]                                 */
  796|       |    /*--------------------------------------------------------------------*/
  797|       |    // Matrix transpose
  798|       |    /*
  799|       |     *  a0 a1 a2 a3 a4 a5 a6 a7
  800|       |     *  b0 b1 b2 b3 b4 b5 b6 b7
  801|       |     *  c0 c1 c2 c3 c4 c5 c6 c7
  802|       |     *  d0 d1 d2 d3 d4 d5 d6 d7
  803|       |     */
  804|  2.57k|    temp1 = _mm_unpacklo_epi16(resq_r0_1, resq_r1_1);  // a0 b0 a1 b1 a2 b2 a3 b3
  805|  2.57k|    temp3 = _mm_unpacklo_epi16(resq_r2_1, resq_r3_1);  // c0 d0 c1 d1 c2 d2 c3 d3
  806|  2.57k|    temp2 = _mm_unpackhi_epi16(resq_r0_1, resq_r1_1);  // a4 b4 a5 b5 a6 b6 a7 b7
  807|  2.57k|    temp4 = _mm_unpackhi_epi16(resq_r2_1, resq_r3_1);  // c4 d4 c5 d5 c6 d6 c7 d7
  808|  2.57k|    resq_r0_1 = _mm_unpacklo_epi32(temp1, temp3);      // a0 b0 c0 d0 a1 b1 c1 d1
  809|  2.57k|    resq_r1_1 = _mm_unpackhi_epi32(temp1, temp3);      // a2 b2 c2 d2 a3 b3 c3 d3
  810|  2.57k|    resq_r2_1 = _mm_unpacklo_epi32(temp2, temp4);      // a4 b4 c4 d4 a5 b5 c5 d5
  811|  2.57k|    resq_r3_1 = _mm_unpackhi_epi32(temp2, temp4);      // a6 b6 c6 d6 a7 b7 c7 d7
  812|       |    /*
  813|       |     * e0 e1 e2 e3 e4 e5 e6 e7
  814|       |     * f0 f1 f2 f3 f4 f5 f6 f7
  815|       |     * g0 g1 g2 g3 g4 g5 g6 g7
  816|       |     * h0 h1 h2 h3 h4 h5 h6 h7
  817|       |     */
  818|  2.57k|    temp1 = _mm_unpacklo_epi16(resq_r4_1, resq_r5_1);  // e0 f0 e1 f1 e2 f2 e2 f3
  819|  2.57k|    temp3 = _mm_unpacklo_epi16(resq_r6_1, resq_r7_1);  // g0 h0 g1 h1 g2 h2 g3 h3
  820|  2.57k|    temp2 = _mm_unpackhi_epi16(resq_r4_1, resq_r5_1);  // e4 f4 e5 f5 e6 f6 e7 f7
  821|  2.57k|    temp4 = _mm_unpackhi_epi16(resq_r6_1, resq_r7_1);  // g4 h4 g5 h5 g6 h6 g7 h7
  822|  2.57k|    resq_r4_1 = _mm_unpacklo_epi32(temp1, temp3);      // e0 f0 g0 h0 e1 f1 g1 h1
  823|  2.57k|    resq_r5_1 = _mm_unpackhi_epi32(temp1, temp3);      // e2 f2 g2 h2 e3 f3 g3 h3
  824|  2.57k|    resq_r6_1 = _mm_unpacklo_epi32(temp2, temp4);      // e4 f4 g4 h4 e5 f5 g5 h5
  825|  2.57k|    resq_r7_1 = _mm_unpackhi_epi32(temp2, temp4);      // e6 f6 g6 h6 e7 f7 g7 h7
  826|       |    /*
  827|       |     * a0 b0 c0 d0 a1 b1 c1 d1
  828|       |     * a2 b2 c2 d2 a3 b3 c3 d3
  829|       |     * a4 b4 c4 d4 a5 b5 c5 d5
  830|       |     * a6 b6 c6 d6 a7 b7 c7 d7
  831|       |     * e0 f0 g0 h0 e1 f1 g1 h1
  832|       |     * e2 f2 g2 h2 e3 f3 g3 h3
  833|       |     * e4 f4 g4 h4 e5 f5 g5 h5
  834|       |     * e6 f6 g6 h6 e7 f7 g7 h7
  835|       |     */
  836|  2.57k|    resq_r0_2 = _mm_unpacklo_epi64(resq_r0_1, resq_r4_1);  // a0 b0 c0 d0 e0 f0 g0 h0
  837|  2.57k|    resq_r1_2 = _mm_unpackhi_epi64(resq_r0_1, resq_r4_1);  // a1 b1 c1 d1 e1 f1 g1 h1
  838|  2.57k|    resq_r2_2 = _mm_unpacklo_epi64(resq_r1_1, resq_r5_1);  // a2 b2 c2 d2 e2 f2 g2 h2
  839|  2.57k|    resq_r3_2 = _mm_unpackhi_epi64(resq_r1_1, resq_r5_1);  // a3 b3 c3 d3 e3 f3 g3 h3
  840|  2.57k|    resq_r4_2 = _mm_unpacklo_epi64(resq_r2_1, resq_r6_1);  // a4 b4 c4 d4 e4 f4 g4 h4
  841|  2.57k|    resq_r5_2 = _mm_unpackhi_epi64(resq_r2_1, resq_r6_1);  // a5 b5 c5 d5 e5 f5 g5 h5
  842|  2.57k|    resq_r6_2 = _mm_unpacklo_epi64(resq_r3_1, resq_r7_1);  // a6 b6 c6 d6 e6 f6 g6 h6
  843|  2.57k|    resq_r7_2 = _mm_unpackhi_epi64(resq_r3_1, resq_r7_1);  // a7 b7 c7 d7 e7 f7 g7 h7
  844|       |
  845|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r1_2);
  846|  2.57k|    resq_r1_1 = _mm_unpacklo_epi16(resq_r1_2, sign_reg);  // a1 b1 c1 d1 -- 32 bit
  847|  2.57k|    resq_r1_2 = _mm_unpackhi_epi16(resq_r1_2, sign_reg);  // e1 f1 g1 h1 -- 32 bit
  848|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r3_2);
  849|  2.57k|    resq_r3_1 = _mm_unpacklo_epi16(resq_r3_2, sign_reg);  // a3 b3 c3 d3 -- 32 bit
  850|  2.57k|    resq_r3_2 = _mm_unpackhi_epi16(resq_r3_2, sign_reg);  // e3 f3 g3 h3 -- 32 bit
  851|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r5_2);
  852|  2.57k|    resq_r5_1 = _mm_unpacklo_epi16(resq_r5_2, sign_reg);  // a5 b5 c5 d5 -- 32 bit
  853|  2.57k|    resq_r5_2 = _mm_unpackhi_epi16(resq_r5_2, sign_reg);  // e5 f5 g5 h5 -- 32 bit
  854|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r7_2);
  855|  2.57k|    resq_r7_1 = _mm_unpacklo_epi16(resq_r7_2, sign_reg);  // a7 b7 c7 d7 -- 32 bit
  856|  2.57k|    resq_r7_2 = _mm_unpackhi_epi16(resq_r7_2, sign_reg);  // e7 f7 g7 h7 -- 32 bit
  857|       |    // Transform starts -- horizontal transform
  858|       |    /*------------------------------------------------------------------*/
  859|       |    /* y0 = w0 + w4                                                     */
  860|  2.57k|    temp1 = _mm_add_epi16(resq_r0_2, resq_r4_2);
  861|       |    /* y2 = w0 - w4                                                      */
  862|  2.57k|    temp3 = _mm_sub_epi16(resq_r0_2, resq_r4_2);
  863|       |    /* y1 = -w3 + w5 - w7 - (w7 >> 1)                                   */
  864|  2.57k|    temp2 = _mm_sub_epi32(resq_r5_1, resq_r3_1);  //-w3+w5
  865|  2.57k|    temp10 = _mm_sub_epi32(resq_r5_2, resq_r3_2);
  866|  2.57k|    temp4 = _mm_sub_epi32(temp2, resq_r7_1);      //-w3+w5-w7
  867|  2.57k|    temp12 = _mm_sub_epi32(temp10, resq_r7_2);
  868|  2.57k|    temp5 = _mm_srai_epi32(resq_r7_1, 1);         // w7>>1
  869|  2.57k|    temp13 = _mm_srai_epi32(resq_r7_2, 1);
  870|  2.57k|    temp2 = _mm_sub_epi32(temp4, temp5);          //-w3+w5-w7 -(w7>>1)
  871|  2.57k|    temp10 = _mm_sub_epi32(temp12, temp13);
  872|  2.57k|    temp2 = _mm_packs_epi32(temp2, temp10);
  873|       |    /* y3 = w1 + w7 - w3 - (w3 >> 1)                                    */
  874|  2.57k|    temp4 = _mm_add_epi32(resq_r1_1, resq_r7_1);  // w1+w7
  875|  2.57k|    temp12 = _mm_add_epi32(resq_r1_2, resq_r7_2);
  876|  2.57k|    temp4 = _mm_sub_epi32(temp4, resq_r3_1);      // w1+w7-w3
  877|  2.57k|    temp12 = _mm_sub_epi32(temp12, resq_r3_2);
  878|  2.57k|    temp5 = _mm_srai_epi32(resq_r3_1, 1);         // w3>>1
  879|  2.57k|    temp13 = _mm_srai_epi32(resq_r3_2, 1);
  880|  2.57k|    temp4 = _mm_sub_epi32(temp4, temp5);          // w1+w7-w3-(w3>>1)
  881|  2.57k|    temp12 = _mm_sub_epi32(temp12, temp13);
  882|  2.57k|    temp4 = _mm_packs_epi32(temp4, temp12);
  883|       |    /* y4 = (w2 >> 1) - w6                                              */
  884|  2.57k|    temp5 = _mm_srai_epi16(resq_r2_2, 1);     // w2>>1
  885|  2.57k|    temp5 = _mm_sub_epi16(temp5, resq_r6_2);  //(w2>>1)-w6
  886|       |    /* y5 = -w1 + w7 + w5 + (w5 >> 1)                                   */
  887|  2.57k|    temp6 = _mm_sub_epi32(resq_r7_1, resq_r1_1);  // w7-w1
  888|  2.57k|    temp14 = _mm_sub_epi32(resq_r7_2, resq_r1_2);
  889|  2.57k|    temp6 = _mm_add_epi32(temp6, resq_r5_1);      // w7-w1+w5
  890|  2.57k|    temp14 = _mm_add_epi32(temp14, resq_r5_2);
  891|  2.57k|    temp7 = _mm_srai_epi32(resq_r5_1, 1);         // w5>>1
  892|  2.57k|    temp15 = _mm_srai_epi32(resq_r5_2, 1);
  893|  2.57k|    temp6 = _mm_add_epi32(temp6, temp7);          // w7-w1_w5+(w5>>1)
  894|  2.57k|    temp14 = _mm_add_epi32(temp14, temp15);
  895|  2.57k|    temp6 = _mm_packs_epi32(temp6, temp14);
  896|       |    /* y6 = w2 + (w6 >> 1)                                              */
  897|  2.57k|    temp7 = _mm_srai_epi16(resq_r6_2, 1);     // w6>>1
  898|  2.57k|    temp7 = _mm_add_epi16(temp7, resq_r2_2);  //(w6>>1)+w2
  899|       |    /* y7 = w3 + w5 + w1 + (w1 >> 1)                                    */
  900|  2.57k|    temp8 = _mm_add_epi32(resq_r3_1, resq_r5_1);  // w3+w5
  901|  2.57k|    temp16 = _mm_add_epi32(resq_r3_2, resq_r5_2);
  902|  2.57k|    temp8 = _mm_add_epi32(temp8, resq_r1_1);      // w3+w5+w1
  903|  2.57k|    temp16 = _mm_add_epi32(temp16, resq_r1_2);
  904|  2.57k|    temp17 = _mm_srai_epi32(resq_r1_1, 1);        // w1>>1
  905|  2.57k|    temp18 = _mm_srai_epi32(resq_r1_2, 1);
  906|  2.57k|    temp8 = _mm_add_epi32(temp8, temp17);         // w3+w5+w1+(w1>>1)
  907|  2.57k|    temp16 = _mm_add_epi32(temp16, temp18);
  908|  2.57k|    temp8 = _mm_packs_epi32(temp8, temp16);
  909|       |    /*------------------------------------------------------------------*/
  910|       |    /*------------------------------------------------------------------*/
  911|       |    /* z0 = y0 + y6                                                        */
  912|  2.57k|    resq_r0_1 = _mm_add_epi16(temp1, temp7);
  913|       |    /* z1 = y1 + (y7 >> 2)                                                */
  914|  2.57k|    resq_r1_1 = _mm_srai_epi16(temp8, 2);
  915|  2.57k|    resq_r1_1 = _mm_add_epi16(resq_r1_1, temp2);
  916|       |    /* z2 = y2 + y4                                                        */
  917|  2.57k|    resq_r2_1 = _mm_add_epi16(temp3, temp5);
  918|       |    /* z3 = y3 + (y5 >> 2)                                                */
  919|  2.57k|    resq_r3_1 = _mm_srai_epi16(temp6, 2);
  920|  2.57k|    resq_r3_1 = _mm_add_epi16(resq_r3_1, temp4);
  921|       |    /* z4 = y2 - y4                                                        */
  922|  2.57k|    resq_r4_1 = _mm_sub_epi16(temp3, temp5);
  923|       |    /* z5 = (y3 >> 2) - y5                                                 */
  924|  2.57k|    resq_r5_1 = _mm_srai_epi16(temp4, 2);
  925|  2.57k|    resq_r5_1 = _mm_sub_epi16(resq_r5_1, temp6);
  926|       |    /* z6 = y0 - y6                                                     */
  927|  2.57k|    resq_r6_1 = _mm_sub_epi16(temp1, temp7);
  928|       |    /* z7 = y7 - (y1 >> 2)                                                 */
  929|  2.57k|    resq_r7_1 = _mm_srai_epi16(temp2, 2);
  930|  2.57k|    resq_r7_1 = _mm_sub_epi16(temp8, resq_r7_1);
  931|       |    /*------------------------------------------------------------------*/
  932|       |    /*------------------------------------------------------------------*/
  933|       |    /* x0 = z0 + z7                                                        */
  934|  2.57k|    temp1 = _mm_add_epi16(resq_r0_1, resq_r7_1);
  935|       |    /* x1 = z2 + z5                                                        */
  936|  2.57k|    temp2 = _mm_add_epi16(resq_r2_1, resq_r5_1);
  937|       |    /* x2 = z4 + z3                                                        */
  938|  2.57k|    temp3 = _mm_add_epi16(resq_r4_1, resq_r3_1);
  939|       |    /* x3 = z6 + z1                                                        */
  940|  2.57k|    temp4 = _mm_add_epi16(resq_r6_1, resq_r1_1);
  941|       |    /* x4 = z6 - z1                                                        */
  942|  2.57k|    temp5 = _mm_sub_epi16(resq_r6_1, resq_r1_1);
  943|       |    /* x5 = z4 - z3                                                        */
  944|  2.57k|    temp6 = _mm_sub_epi16(resq_r4_1, resq_r3_1);
  945|       |    /* x6 = z2 - z5                                                        */
  946|  2.57k|    temp7 = _mm_sub_epi16(resq_r2_1, resq_r5_1);
  947|       |    /* x7 = z0 - z7                                                        */
  948|  2.57k|    temp8 = _mm_sub_epi16(resq_r0_1, resq_r7_1);
  949|       |    /*------------------------------------------------------------------*/
  950|       |    // Matrix transpose
  951|       |    /*
  952|       |     *  a0 b0 c0 d0 e0 f0 g0 h0
  953|       |     *  a1 b1 c1 d1 e1 f1 g1 h1
  954|       |     *  a2 b2 c2 d2 e2 f2 g2 h2
  955|       |     *  a3 b3 c3 d3 e3 f3 g3 h3
  956|       |     */
  957|  2.57k|    temp17 = _mm_unpacklo_epi16(temp1, temp2);       // a0 a1 b0 b1 c0 c1 d0 d1
  958|  2.57k|    temp19 = _mm_unpacklo_epi16(temp3, temp4);       // a2 a3 b2 b3 c2 c3 d2 d3
  959|  2.57k|    temp18 = _mm_unpackhi_epi16(temp1, temp2);       // e0 e1 f0 f1 g0 g1 h0 h1
  960|  2.57k|    temp20 = _mm_unpackhi_epi16(temp3, temp4);       // e2 e3 f2 f3 g2 g3 h2 h3
  961|       |
  962|  2.57k|    resq_r0_1 = _mm_unpacklo_epi32(temp17, temp19);  // a0 a1 a2 a3 b0 b1 b2 b3
  963|  2.57k|    resq_r1_1 = _mm_unpackhi_epi32(temp17, temp19);  // c0 c1 c2 c3 d0 d1 d2 d3
  964|  2.57k|    resq_r2_1 = _mm_unpacklo_epi32(temp18, temp20);  // e0 e1 e2 e3 f0 f1 f2 f3
  965|  2.57k|    resq_r3_1 = _mm_unpackhi_epi32(temp18, temp20);  // g0 g2 g2 g3 h0 h1 h2 h3
  966|       |    /*
  967|       |     *  a4 b4 c4 d4 e4 f4 g4 h4
  968|       |     *  a5 b5 c5 d5 e5 f5 g5 h5
  969|       |     *  a6 b6 c6 d6 e6 f6 g6 h6
  970|       |     *  a7 b7 c7 d7 e7 f7 g7 h7
  971|       |     */
  972|  2.57k|    temp17 = _mm_unpacklo_epi16(temp5, temp6);       // a4 a5 b4 b5 c4 c5 d4 d5
  973|  2.57k|    temp19 = _mm_unpacklo_epi16(temp7, temp8);       // a6 a7 b6 b7 c6 c7 d6 d7
  974|  2.57k|    temp18 = _mm_unpackhi_epi16(temp5, temp6);       // e4 e5 f4 f5 g4 g5 h4 h5
  975|  2.57k|    temp20 = _mm_unpackhi_epi16(temp7, temp8);       // e6 e7 f6 f7 g6 g7 h6 h7
  976|       |
  977|  2.57k|    resq_r4_1 = _mm_unpacklo_epi32(temp17, temp19);  // a4 a5 a6 a7 b4 b5 b6 b7
  978|  2.57k|    resq_r5_1 = _mm_unpackhi_epi32(temp17, temp19);  // c4 c5 c6 c7 d4 d5 d6 d7
  979|  2.57k|    resq_r6_1 = _mm_unpacklo_epi32(temp18, temp20);  // e4 e5 e6 e7 f4 f5 f6 f7
  980|  2.57k|    resq_r7_1 = _mm_unpackhi_epi32(temp18, temp20);  // g4 g5 g6 g7 h4 h5 h6 h7
  981|       |    /*  a0 a1 a2 a3 b0 b1 b2 b3
  982|       |     *  c0 c1 c2 c3 d0 d1 d2 d3
  983|       |     *  e0 e1 e2 e3 f0 f1 f2 f3
  984|       |     *  g0 g2 g2 g3 h0 h1 h2 h3
  985|       |     *  a4 a5 a6 a7 b4 b5 b6 b7
  986|       |     *  c4 c5 c6 c7 d4 d5 d6 d7
  987|       |     *  e4 e5 e6 e7 f4 f5 f6 f7
  988|       |     *  g4 g5 g6 g7 h4 h5 h6 h7
  989|       |     */
  990|  2.57k|    resq_r0_2 = _mm_unpacklo_epi64(resq_r0_1, resq_r4_1);  // a0 a1 a2 a3 a4 a5 a6 a7
  991|  2.57k|    resq_r1_2 = _mm_unpackhi_epi64(resq_r0_1, resq_r4_1);  // b0 b1 b2 b3 b4 b5 b6 b7
  992|  2.57k|    resq_r2_2 = _mm_unpacklo_epi64(resq_r1_1, resq_r5_1);  // c0 c1 c2 c3 c4 c5 c6 c7
  993|  2.57k|    resq_r3_2 = _mm_unpackhi_epi64(resq_r1_1, resq_r5_1);  // d0 d1 d2 d3 d4 d5 d6 d7
  994|  2.57k|    resq_r4_2 = _mm_unpacklo_epi64(resq_r2_1, resq_r6_1);  // e0 e1 e2 e3 e4 e5 e6 e7
  995|  2.57k|    resq_r5_2 = _mm_unpackhi_epi64(resq_r2_1, resq_r6_1);  // f0 f1 f2 f3 f4 f5 f6 f7
  996|  2.57k|    resq_r6_2 = _mm_unpacklo_epi64(resq_r3_1, resq_r7_1);  // g0 g1 g2 g3 g4 g5 g6 g7
  997|  2.57k|    resq_r7_2 = _mm_unpackhi_epi64(resq_r3_1, resq_r7_1);  // h0 h1 h2 h3 h4 h5 h6 h7
  998|       |
  999|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r1_2);
 1000|  2.57k|    resq_r1_1 = _mm_unpacklo_epi16(resq_r1_2, sign_reg);  // a1 b1 c1 d1 -- 32 bit
 1001|  2.57k|    resq_r1_2 = _mm_unpackhi_epi16(resq_r1_2, sign_reg);  // e1 f1 g1 h1 -- 32 bit
 1002|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r3_2);
 1003|  2.57k|    resq_r3_1 = _mm_unpacklo_epi16(resq_r3_2, sign_reg);  // a3 b3 c3 d3 -- 32 bit
 1004|  2.57k|    resq_r3_2 = _mm_unpackhi_epi16(resq_r3_2, sign_reg);  // e3 f3 g3 h3 -- 32 bit
 1005|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r5_2);
 1006|  2.57k|    resq_r5_1 = _mm_unpacklo_epi16(resq_r5_2, sign_reg);  // a5 b5 c5 d5 -- 32 bit
 1007|  2.57k|    resq_r5_2 = _mm_unpackhi_epi16(resq_r5_2, sign_reg);  // e5 f5 g5 h5 -- 32 bit
 1008|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, resq_r7_2);
 1009|  2.57k|    resq_r7_1 = _mm_unpacklo_epi16(resq_r7_2, sign_reg);  // a7 b7 c7 d7 -- 32 bit
 1010|  2.57k|    resq_r7_2 = _mm_unpackhi_epi16(resq_r7_2, sign_reg);  // e7 f7 g7 h7 -- 32 bit
 1011|       |
 1012|       |    /*--------------------------------------------------------------------*/
 1013|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6            */
 1014|       |    /*                                                                    */
 1015|       |
 1016|       |    /* y0j = w0j + w4j                                                     */
 1017|  2.57k|    temp1 = _mm_add_epi16(resq_r0_2, resq_r4_2);
 1018|       |    /* y2j = w0j - w4j                                                      */
 1019|  2.57k|    temp3 = _mm_sub_epi16(resq_r0_2, resq_r4_2);
 1020|       |    /* y1j = -w3j + w5j - w7j - (w7j >> 1)                                   */
 1021|  2.57k|    temp2 = _mm_sub_epi32(resq_r5_1, resq_r3_1);  //-w3+w5
 1022|  2.57k|    temp10 = _mm_sub_epi32(resq_r5_2, resq_r3_2);
 1023|  2.57k|    temp4 = _mm_sub_epi32(temp2, resq_r7_1);      //-w3+w5-w7
 1024|  2.57k|    temp12 = _mm_sub_epi32(temp10, resq_r7_2);
 1025|  2.57k|    temp5 = _mm_srai_epi32(resq_r7_1, 1);         // w7>>1
 1026|  2.57k|    temp13 = _mm_srai_epi32(resq_r7_2, 1);
 1027|  2.57k|    temp2 = _mm_sub_epi32(temp4, temp5);          //-w3+w5-w7 -(w7>>1)
 1028|  2.57k|    temp10 = _mm_sub_epi32(temp12, temp13);
 1029|  2.57k|    temp2 = _mm_packs_epi32(temp2, temp10);
 1030|       |    /* y3j = w1j + w7j - w3j - (w3j >> 1)                                    */
 1031|  2.57k|    temp4 = _mm_add_epi32(resq_r1_1, resq_r7_1);  // w1+w7
 1032|  2.57k|    temp12 = _mm_add_epi32(resq_r1_2, resq_r7_2);
 1033|  2.57k|    temp4 = _mm_sub_epi32(temp4, resq_r3_1);      // w1+w7-w3
 1034|  2.57k|    temp12 = _mm_sub_epi32(temp12, resq_r3_2);
 1035|  2.57k|    temp5 = _mm_srai_epi32(resq_r3_1, 1);         // w3>>1
 1036|  2.57k|    temp13 = _mm_srai_epi32(resq_r3_2, 1);
 1037|  2.57k|    temp4 = _mm_sub_epi32(temp4, temp5);          // w1+w7-w3-(w3>>1)
 1038|  2.57k|    temp12 = _mm_sub_epi32(temp12, temp13);
 1039|  2.57k|    temp4 = _mm_packs_epi32(temp4, temp12);
 1040|       |    /* y4j = (w2j >> 1) - w6j                                              */
 1041|  2.57k|    temp5 = _mm_srai_epi16(resq_r2_2, 1);     // w2>>1
 1042|  2.57k|    temp5 = _mm_sub_epi16(temp5, resq_r6_2);  //(w2>>1)-w6
 1043|       |    /* y5j = -w1j + w7j + w5j + (w5j >> 1)                                   */
 1044|  2.57k|    temp6 = _mm_sub_epi32(resq_r7_1, resq_r1_1);  // w7-w1
 1045|  2.57k|    temp14 = _mm_sub_epi32(resq_r7_2, resq_r1_2);
 1046|  2.57k|    temp6 = _mm_add_epi32(temp6, resq_r5_1);      // w7-w1+w5
 1047|  2.57k|    temp14 = _mm_add_epi32(temp14, resq_r5_2);
 1048|  2.57k|    temp7 = _mm_srai_epi32(resq_r5_1, 1);         // w5>>1
 1049|  2.57k|    temp15 = _mm_srai_epi32(resq_r5_2, 1);
 1050|  2.57k|    temp6 = _mm_add_epi32(temp6, temp7);          // w7-w1_w5+(w5>>1)
 1051|  2.57k|    temp14 = _mm_add_epi32(temp14, temp15);
 1052|  2.57k|    temp6 = _mm_packs_epi32(temp6, temp14);
 1053|       |    /* y6j = w2j + (w6j >> 1)                                              */
 1054|  2.57k|    temp7 = _mm_srai_epi16(resq_r6_2, 1);     // w6>>1
 1055|  2.57k|    temp7 = _mm_add_epi16(temp7, resq_r2_2);  //(w6>>1)+w2
 1056|       |    /* y7j = w3j + w5j + w1j + (w1j >> 1)                                    */
 1057|  2.57k|    temp8 = _mm_add_epi32(resq_r3_1, resq_r5_1);  // w3+w5
 1058|  2.57k|    temp16 = _mm_add_epi32(resq_r3_2, resq_r5_2);
 1059|  2.57k|    temp8 = _mm_add_epi32(temp8, resq_r1_1);      // w3+w5+w1
 1060|  2.57k|    temp16 = _mm_add_epi32(temp16, resq_r1_2);
 1061|  2.57k|    temp17 = _mm_srai_epi32(resq_r1_1, 1);        // w1>>1
 1062|  2.57k|    temp18 = _mm_srai_epi32(resq_r1_2, 1);
 1063|  2.57k|    temp8 = _mm_add_epi32(temp8, temp17);         // w3+w5+w1+(w1>>1)
 1064|  2.57k|    temp16 = _mm_add_epi32(temp16, temp18);
 1065|  2.57k|    temp8 = _mm_packs_epi32(temp8, temp16);
 1066|       |    /*------------------------------------------------------------------*/
 1067|       |    /*------------------------------------------------------------------*/
 1068|       |    /* z0j = y0j + y6j                                                        */
 1069|  2.57k|    resq_r0_1 = _mm_add_epi16(temp1, temp7);
 1070|       |    /* z1j = y1j + (y7j >> 2)                                                */
 1071|  2.57k|    resq_r1_1 = _mm_srai_epi16(temp8, 2);
 1072|  2.57k|    resq_r1_1 = _mm_add_epi16(resq_r1_1, temp2);
 1073|       |    /* z2j = y2j + y4j                                                        */
 1074|  2.57k|    resq_r2_1 = _mm_add_epi16(temp3, temp5);
 1075|       |    /* z3j = y3j + (y5j >> 2)                                                */
 1076|  2.57k|    resq_r3_1 = _mm_srai_epi16(temp6, 2);
 1077|  2.57k|    resq_r3_1 = _mm_add_epi16(resq_r3_1, temp4);
 1078|       |    /* z4j = y2j - y4j                                                        */
 1079|  2.57k|    resq_r4_1 = _mm_sub_epi16(temp3, temp5);
 1080|       |    /* z5j = (y3j >> 2) - y5j                                                 */
 1081|  2.57k|    resq_r5_1 = _mm_srai_epi16(temp4, 2);
 1082|  2.57k|    resq_r5_1 = _mm_sub_epi16(resq_r5_1, temp6);
 1083|       |    /* z6j = y0j - y6j                                                     */
 1084|  2.57k|    resq_r6_1 = _mm_sub_epi16(temp1, temp7);
 1085|       |    /* z7j = y7j - (y1j >> 2)                                                 */
 1086|  2.57k|    resq_r7_1 = _mm_srai_epi16(temp2, 2);
 1087|  2.57k|    resq_r7_1 = _mm_sub_epi16(temp8, resq_r7_1);
 1088|       |    /*------------------------------------------------------------------*/
 1089|       |
 1090|       |    /*------------------------------------------------------------------*/
 1091|       |    /* x0j = z0j + z7j                                                        */
 1092|  2.57k|    temp1 = _mm_add_epi16(resq_r0_1, resq_r7_1);
 1093|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp1);
 1094|  2.57k|    temp10 = _mm_unpacklo_epi16(temp1, sign_reg);
 1095|  2.57k|    temp11 = _mm_unpackhi_epi16(temp1, sign_reg);
 1096|  2.57k|    temp10 = _mm_add_epi32(temp10, value_32);
 1097|  2.57k|    temp11 = _mm_add_epi32(temp11, value_32);
 1098|  2.57k|    temp10 = _mm_srai_epi32(temp10, 6);
 1099|  2.57k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1100|  2.57k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1101|  2.57k|    temp11 = _mm_srai_epi32(temp11, 6);
 1102|  2.57k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1103|  2.57k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1104|  2.57k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1105|  2.57k|    temp1 = temp10;  //_mm_add_epi16(temp10, pred_r0_1);
 1106|       |    /* x1j = z2j + z5j                                                        */
 1107|  2.57k|    temp2 = _mm_add_epi16(resq_r2_1, resq_r5_1);
 1108|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp2);
 1109|  2.57k|    temp10 = _mm_unpacklo_epi16(temp2, sign_reg);
 1110|  2.57k|    temp11 = _mm_unpackhi_epi16(temp2, sign_reg);
 1111|  2.57k|    temp10 = _mm_add_epi32(temp10, value_32);
 1112|  2.57k|    temp11 = _mm_add_epi32(temp11, value_32);
 1113|  2.57k|    temp10 = _mm_srai_epi32(temp10, 6);
 1114|  2.57k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1115|  2.57k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1116|  2.57k|    temp11 = _mm_srai_epi32(temp11, 6);
 1117|  2.57k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1118|  2.57k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1119|  2.57k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1120|  2.57k|    temp2 = temp10;  //_mm_add_epi16(temp10, pred_r1_1);
 1121|       |    /* x2j = z4j + z3j                                                        */
 1122|  2.57k|    temp3 = _mm_add_epi16(resq_r4_1, resq_r3_1);
 1123|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp3);
 1124|  2.57k|    temp10 = _mm_unpacklo_epi16(temp3, sign_reg);
 1125|  2.57k|    temp11 = _mm_unpackhi_epi16(temp3, sign_reg);
 1126|  2.57k|    temp10 = _mm_add_epi32(temp10, value_32);
 1127|  2.57k|    temp11 = _mm_add_epi32(temp11, value_32);
 1128|  2.57k|    temp10 = _mm_srai_epi32(temp10, 6);
 1129|  2.57k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1130|  2.57k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1131|  2.57k|    temp11 = _mm_srai_epi32(temp11, 6);
 1132|  2.57k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1133|  2.57k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1134|  2.57k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1135|  2.57k|    temp3 = temp10;  //_mm_add_epi16(temp10, pred_r2_1);
 1136|       |    /* x3j = z6j + z1j                                                        */
 1137|  2.57k|    temp4 = _mm_add_epi16(resq_r6_1, resq_r1_1);
 1138|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp4);
 1139|  2.57k|    temp10 = _mm_unpacklo_epi16(temp4, sign_reg);
 1140|  2.57k|    temp11 = _mm_unpackhi_epi16(temp4, sign_reg);
 1141|  2.57k|    temp10 = _mm_add_epi32(temp10, value_32);
 1142|  2.57k|    temp11 = _mm_add_epi32(temp11, value_32);
 1143|  2.57k|    temp10 = _mm_srai_epi32(temp10, 6);
 1144|  2.57k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1145|  2.57k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1146|  2.57k|    temp11 = _mm_srai_epi32(temp11, 6);
 1147|  2.57k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1148|  2.57k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1149|  2.57k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1150|  2.57k|    temp4 = temp10;  //_mm_add_epi16(temp10, pred_r3_1);
 1151|       |    /* x4j = z6j - z1j                                                        */
 1152|  2.57k|    temp5 = _mm_sub_epi16(resq_r6_1, resq_r1_1);
 1153|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp5);
 1154|  2.57k|    temp10 = _mm_unpacklo_epi16(temp5, sign_reg);
 1155|  2.57k|    temp11 = _mm_unpackhi_epi16(temp5, sign_reg);
 1156|  2.57k|    temp10 = _mm_add_epi32(temp10, value_32);
 1157|  2.57k|    temp11 = _mm_add_epi32(temp11, value_32);
 1158|  2.57k|    temp10 = _mm_srai_epi32(temp10, 6);
 1159|  2.57k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1160|  2.57k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1161|  2.57k|    temp11 = _mm_srai_epi32(temp11, 6);
 1162|  2.57k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1163|  2.57k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1164|  2.57k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1165|  2.57k|    temp5 = temp10;  //_mm_add_epi16(temp10, pred_r4_1);
 1166|       |    /* x5j = z4j - z3j                                                        */
 1167|  2.57k|    temp6 = _mm_sub_epi16(resq_r4_1, resq_r3_1);
 1168|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp6);
 1169|  2.57k|    temp10 = _mm_unpacklo_epi16(temp6, sign_reg);
 1170|  2.57k|    temp11 = _mm_unpackhi_epi16(temp6, sign_reg);
 1171|  2.57k|    temp10 = _mm_add_epi32(temp10, value_32);
 1172|  2.57k|    temp11 = _mm_add_epi32(temp11, value_32);
 1173|  2.57k|    temp10 = _mm_srai_epi32(temp10, 6);
 1174|  2.57k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1175|  2.57k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1176|  2.57k|    temp11 = _mm_srai_epi32(temp11, 6);
 1177|  2.57k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1178|  2.57k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1179|  2.57k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1180|  2.57k|    temp6 = temp10;  //_mm_add_epi16(temp10, pred_r5_1);
 1181|       |    /* x6j = z2j - z5j                                                        */
 1182|  2.57k|    temp7 = _mm_sub_epi16(resq_r2_1, resq_r5_1);
 1183|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp7);
 1184|  2.57k|    temp10 = _mm_unpacklo_epi16(temp7, sign_reg);
 1185|  2.57k|    temp11 = _mm_unpackhi_epi16(temp7, sign_reg);
 1186|  2.57k|    temp10 = _mm_add_epi32(temp10, value_32);
 1187|  2.57k|    temp11 = _mm_add_epi32(temp11, value_32);
 1188|  2.57k|    temp10 = _mm_srai_epi32(temp10, 6);
 1189|  2.57k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1190|  2.57k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1191|  2.57k|    temp11 = _mm_srai_epi32(temp11, 6);
 1192|  2.57k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1193|  2.57k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1194|  2.57k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1195|  2.57k|    temp7 = temp10;  //_mm_add_epi16(temp10, pred_r6_1);
 1196|       |    /* x7j = z0j - z7j                                                        */
 1197|  2.57k|    temp8 = _mm_sub_epi16(resq_r0_1, resq_r7_1);
 1198|  2.57k|    sign_reg = _mm_cmpgt_epi16(zero_8x16b, temp8);
 1199|  2.57k|    temp10 = _mm_unpacklo_epi16(temp8, sign_reg);
 1200|  2.57k|    temp11 = _mm_unpackhi_epi16(temp8, sign_reg);
 1201|  2.57k|    temp10 = _mm_add_epi32(temp10, value_32);
 1202|  2.57k|    temp11 = _mm_add_epi32(temp11, value_32);
 1203|  2.57k|    temp10 = _mm_srai_epi32(temp10, 6);
 1204|  2.57k|    temp10 = _mm_min_epi32(dupmax_4x32b, temp10);
 1205|  2.57k|    temp10 = _mm_max_epi32(dupmin_4x32b, temp10);
 1206|  2.57k|    temp11 = _mm_srai_epi32(temp11, 6);
 1207|  2.57k|    temp11 = _mm_min_epi32(dupmax_4x32b, temp11);
 1208|  2.57k|    temp11 = _mm_max_epi32(dupmin_4x32b, temp11);
 1209|  2.57k|    temp10 = _mm_packs_epi32(temp10, temp11);
 1210|  2.57k|    temp8 = temp10;  //_mm_add_epi16(temp10, pred_r7_1);
 1211|       |
 1212|  2.57k|    _mm_storeu_si128((__m128i *) (&pi2_out[0]), temp1);
 1213|  2.57k|    _mm_storeu_si128((__m128i *) (&pi2_out[out_strd]), temp2);
 1214|  2.57k|    _mm_storeu_si128((__m128i *) (&pi2_out[2 * out_strd]), temp3);
 1215|  2.57k|    _mm_storeu_si128((__m128i *) (&pi2_out[3 * out_strd]), temp4);
 1216|  2.57k|    _mm_storeu_si128((__m128i *) (&pi2_out[4 * out_strd]), temp5);
 1217|  2.57k|    _mm_storeu_si128((__m128i *) (&pi2_out[5 * out_strd]), temp6);
 1218|  2.57k|    _mm_storeu_si128((__m128i *) (&pi2_out[6 * out_strd]), temp7);
 1219|  2.57k|    _mm_storeu_si128((__m128i *) (&pi2_out[7 * out_strd]), temp8);
 1220|  2.57k|}
isvcd_iquant_itrans_chroma_4x4_sse42:
 1249|  3.57k|{
 1250|  3.57k|    __m128i src_r0_r1, src_r2_r3;
 1251|  3.57k|    __m128i src_r0, src_r1, src_r2, src_r3;
 1252|  3.57k|    __m128i scalemat_r0_r1, scalemat_r2_r3;
 1253|  3.57k|    __m128i dequant_r0_r1, dequant_r2_r3;
 1254|  3.57k|    __m128i zero_8x16b = _mm_setzero_si128();  // all bits reset to zero
 1255|  3.57k|    __m128i temp0, temp1, temp2, temp3, temp4, temp5, temp6, temp7;
 1256|  3.57k|    __m128i resq_r0, resq_r1, resq_r2, resq_r3;
 1257|  3.57k|    __m128i add_rshift = _mm_set1_epi32((u4_qp_div_6 < 4) ? (1 << (3 - u4_qp_div_6)) : 0);
  ------------------
  |  Branch (1257:41): [True: 2.56k, False: 1.01k]
  ------------------
 1258|  3.57k|    __m128i value_32 = _mm_set1_epi32(32);
 1259|  3.57k|    __m128i dupmax_4x32b = _mm_set1_epi32(RSD_MAX);
  ------------------
  |  |  772|  3.57k|#define RSD_MAX 255
  ------------------
 1260|  3.57k|    __m128i dupmin_4x32b = _mm_set1_epi32(RSD_MIN);
  ------------------
  |  |  773|  3.57k|#define RSD_MIN -255
  ------------------
 1261|       |
 1262|  3.57k|    __m128i chroma_mask_even =
 1263|  3.57k|        _mm_set_epi16(0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff);
 1264|  3.57k|    __m128i chroma_mask_odd =
 1265|  3.57k|        _mm_set_epi16(0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000, 0xffff, 0x0000);
 1266|       |
 1267|  3.57k|    UNUSED(pi2_tmp);
  ------------------
  |  |   45|  3.57k|#define UNUSED(x) ((void)(x))
  ------------------
 1268|       |
 1269|       |    /*************************************************************/
 1270|       |    /* Dequantization of coefficients. Will be replaced by SIMD  */
 1271|       |    /* operations on platform                                    */
 1272|       |    /*************************************************************/
 1273|       |    // a00 a01 a02 a03 a10 a11 a12 a13 -- the source matrix 0th,1st row
 1274|  3.57k|    src_r0_r1 = _mm_loadu_si128((__m128i *) (pi2_src));
 1275|       |    // a20 a21 a22 a23 a30 a31 a32 a33 --the source matrix 2nd,3rd row
 1276|  3.57k|    src_r2_r3 = _mm_loadu_si128((__m128i *) (pi2_src + 8));
 1277|       |    // b00 b01 b02 b03 b10 b11 b12 b13 -- the scaling matrix 0th,1st row
 1278|  3.57k|    scalemat_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat));
 1279|       |    // b20 b21 b22 b23 b30 b31 b32 b33 -- the scaling matrix 2nd,3rd row
 1280|  3.57k|    scalemat_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_iscal_mat + 8));
 1281|       |    // q00 q01 q02 q03 q10 q11 q12 q13 -- all 16 bits
 1282|  3.57k|    dequant_r0_r1 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat));
 1283|       |    // q20 q21 q22 q23 q30 q31 q32 q33 -- all 16 bits
 1284|  3.57k|    dequant_r2_r3 = _mm_loadu_si128((__m128i *) (pu2_weigh_mat + 8));
 1285|       |    // b00*q00 b01*q01 b02*q02 b03*q03 b10*q10 b11*q11 b12*q12 b13*q13 -- 16 bit result
 1286|  3.57k|    temp0 = _mm_mullo_epi16(scalemat_r0_r1, dequant_r0_r1);
 1287|       |    // b00*q00 b01*q01 b02*q02 b03*q03 b10*q10 b11*q11 b12*q12 b13*q13 -- 16 bit result
 1288|  3.57k|    temp1 = _mm_mullo_epi16(scalemat_r2_r3, dequant_r2_r3);
 1289|       |    // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
 1290|  3.57k|    temp4 = _mm_unpacklo_epi16(temp0, zero_8x16b);
 1291|       |    // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
 1292|  3.57k|    temp5 = _mm_unpackhi_epi16(temp0, zero_8x16b);
 1293|       |    // b00*q00 0 b01*q01 0 b02*q02 0 b03*q03 0 -- 16 bit long
 1294|  3.57k|    temp6 = _mm_unpacklo_epi16(temp1, zero_8x16b);
 1295|       |    // b10*q10 0 b11*q11 0 b12*q12 0 b13*q13 0 -- 16 bit long
 1296|  3.57k|    temp7 = _mm_unpackhi_epi16(temp1, zero_8x16b);
 1297|       |
 1298|  3.57k|    src_r0 = _mm_unpacklo_epi16(src_r0_r1, zero_8x16b);  // a00 0 a01 0 a02 0 a03 0 -- 16 bit long
 1299|  3.57k|    src_r1 = _mm_unpackhi_epi16(src_r0_r1, zero_8x16b);  // a10 0 a11 0 a12 0 a13 0 -- 16 bit long
 1300|  3.57k|    src_r2 = _mm_unpacklo_epi16(src_r2_r3, zero_8x16b);  // a20 0 a21 0 a22 0 a23 0 -- 16 bit long
 1301|  3.57k|    src_r3 = _mm_unpackhi_epi16(src_r2_r3, zero_8x16b);  // a30 0 a31 0 a32 0 a33 0 -- 16 bit long
 1302|       |
 1303|       |    // a00*b00*q00 a10*b10*q10 a20*b20*q20 a30*b30 q30 -- 32 bits long
 1304|  3.57k|    temp4 = _mm_madd_epi16(src_r0, temp4);
 1305|  3.57k|    temp5 = _mm_madd_epi16(src_r1, temp5);
 1306|  3.57k|    temp6 = _mm_madd_epi16(src_r2, temp6);
 1307|  3.57k|    temp7 = _mm_madd_epi16(src_r3, temp7);
 1308|       |
 1309|  3.57k|    if(u4_qp_div_6 >= 4)
  ------------------
  |  Branch (1309:8): [True: 1.01k, False: 2.56k]
  ------------------
 1310|  1.01k|    {
 1311|  1.01k|        resq_r0 = _mm_slli_epi32(temp4, u4_qp_div_6 - 4);
 1312|  1.01k|        resq_r1 = _mm_slli_epi32(temp5, u4_qp_div_6 - 4);
 1313|  1.01k|        resq_r2 = _mm_slli_epi32(temp6, u4_qp_div_6 - 4);
 1314|  1.01k|        resq_r3 = _mm_slli_epi32(temp7, u4_qp_div_6 - 4);
 1315|  1.01k|    }
 1316|  2.56k|    else
 1317|  2.56k|    {
 1318|  2.56k|        temp4 = _mm_add_epi32(temp4, add_rshift);
 1319|  2.56k|        temp5 = _mm_add_epi32(temp5, add_rshift);
 1320|  2.56k|        temp6 = _mm_add_epi32(temp6, add_rshift);
 1321|  2.56k|        temp7 = _mm_add_epi32(temp7, add_rshift);
 1322|  2.56k|        resq_r0 = _mm_srai_epi32(temp4, 4 - u4_qp_div_6);
 1323|  2.56k|        resq_r1 = _mm_srai_epi32(temp5, 4 - u4_qp_div_6);
 1324|  2.56k|        resq_r2 = _mm_srai_epi32(temp6, 4 - u4_qp_div_6);
 1325|  2.56k|        resq_r3 = _mm_srai_epi32(temp7, 4 - u4_qp_div_6);
 1326|  2.56k|    }
 1327|       |
 1328|  3.57k|    resq_r0 = _mm_insert_epi32(resq_r0, (WORD32) pi2_dc_src[0], 0);
 1329|       |    /* Perform Inverse transform */
 1330|       |    /*-------------------------------------------------------------*/
 1331|       |    /* IDCT [ Horizontal transformation ]                          */
 1332|       |    /*-------------------------------------------------------------*/
 1333|       |    // Matrix transpose
 1334|       |    /*
 1335|       |     *  a0 a1 a2 a3
 1336|       |     *  b0 b1 b2 b3
 1337|       |     *  c0 c1 c2 c3
 1338|       |     *  d0 d1 d2 d3
 1339|       |     */
 1340|  3.57k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 b0 a1 b1
 1341|  3.57k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // c0 d0 c1 d1
 1342|  3.57k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // a2 b2 a3 b3
 1343|  3.57k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 d2 c3 d3
 1344|  3.57k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 b0 c0 d0
 1345|  3.57k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // a1 b1 c1 d1
 1346|  3.57k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // a2 b2 c2 d2
 1347|  3.57k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);    // a3 b3 c3 d3
 1348|       |    // Transform starts -- horizontal transform
 1349|       |    /*------------------------------------------------------------------*/
 1350|       |    /* z0 = w0 + w2                                             */
 1351|  3.57k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
 1352|       |    /* z1 = w0 - w2                                             */
 1353|  3.57k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
 1354|       |    /* z2 = (w1 >> 1) - w3                                      */
 1355|  3.57k|    temp2 = _mm_srai_epi32(resq_r1, 1);     //(w1>>1)
 1356|  3.57k|    temp2 = _mm_sub_epi32(temp2, resq_r3);  //(w1>>1) - w3
 1357|       |    /* z3 = w1 + (w3 >> 1)                                      */
 1358|  3.57k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(w3>>1) + w1
 1359|  3.57k|    temp3 = _mm_add_epi32(temp3, resq_r1);
 1360|       |    /*----------------------------------------------------------*/
 1361|       |    /* x0 = z0 + z3                                             */
 1362|  3.57k|    resq_r0 = _mm_add_epi32(temp0, temp3);
 1363|       |    /* x1 = z1 + z2                                             */
 1364|  3.57k|    resq_r1 = _mm_add_epi32(temp1, temp2);
 1365|       |    /* x2 = z1 - z2                                             */
 1366|  3.57k|    resq_r2 = _mm_sub_epi32(temp1, temp2);
 1367|       |    /* x3 = z0 - z3                                             */
 1368|  3.57k|    resq_r3 = _mm_sub_epi32(temp0, temp3);
 1369|       |    // Matrix transpose
 1370|       |    /*
 1371|       |     *  a0 b0 c0 d0
 1372|       |     *  a1 b1 c1 d1
 1373|       |     *  a2 b2 c2 d2
 1374|       |     *  a3 b3 c3 d3
 1375|       |     */
 1376|  3.57k|    temp1 = _mm_unpacklo_epi32(resq_r0, resq_r1);  // a0 a1 b0 b1
 1377|  3.57k|    temp3 = _mm_unpacklo_epi32(resq_r2, resq_r3);  // a2 a3 b2 b3
 1378|  3.57k|    temp2 = _mm_unpackhi_epi32(resq_r0, resq_r1);  // c0 c1 d0 d1
 1379|  3.57k|    temp4 = _mm_unpackhi_epi32(resq_r2, resq_r3);  // c2 c3 d2 d3
 1380|  3.57k|    resq_r0 = _mm_unpacklo_epi64(temp1, temp3);    // a0 a1 a2 a3
 1381|  3.57k|    resq_r1 = _mm_unpackhi_epi64(temp1, temp3);    // b0 b1 b2 b3
 1382|  3.57k|    resq_r2 = _mm_unpacklo_epi64(temp2, temp4);    // c0 c1 c2 c3
 1383|  3.57k|    resq_r3 = _mm_unpackhi_epi64(temp2, temp4);    // d0 d1 d2 d3
 1384|       |    // Transform ends -- horizontal transform
 1385|       |
 1386|       |    /*--------------------------------------------------------------*/
 1387|       |    /* IDCT [ Vertical transformation] and Xij = (xij + 32)>>6      */
 1388|       |    /* Add the prediction and store it back to same buffer          */
 1389|       |    /*--------------------------------------------------------------*/
 1390|       |    /* z0j = y0j + y2j                                                        */
 1391|  3.57k|    temp0 = _mm_add_epi32(resq_r0, resq_r2);
 1392|       |    /* z1j = y0j - y2j                                                        */
 1393|  3.57k|    temp1 = _mm_sub_epi32(resq_r0, resq_r2);
 1394|       |    /* z2j = (y1j>>1) - y3j */
 1395|  3.57k|    temp2 = _mm_srai_epi32(resq_r1, 1);  //(y1j>>1)
 1396|  3.57k|    temp2 = _mm_sub_epi32(temp2, resq_r3);
 1397|       |    /* z3j = y1j + (y3j>>1) */
 1398|  3.57k|    temp3 = _mm_srai_epi32(resq_r3, 1);  //(y3j>>1)
 1399|  3.57k|    temp3 = _mm_add_epi32(temp3, resq_r1);
 1400|       |
 1401|       |    /* x0j = z0j + z3j                                                        */
 1402|  3.57k|    temp4 = _mm_add_epi32(temp0, temp3);
 1403|  3.57k|    temp4 = _mm_add_epi32(temp4, value_32);
 1404|  3.57k|    temp4 = _mm_srai_epi32(temp4, 6);
 1405|  3.57k|    temp4 = _mm_min_epi32(dupmax_4x32b, temp4);
 1406|  3.57k|    temp4 = _mm_max_epi32(dupmin_4x32b, temp4);
 1407|       |
 1408|       |    /* x1j = z1j + z2j                                                        */
 1409|  3.57k|    temp5 = _mm_add_epi32(temp1, temp2);
 1410|  3.57k|    temp5 = _mm_add_epi32(temp5, value_32);
 1411|  3.57k|    temp5 = _mm_srai_epi32(temp5, 6);
 1412|  3.57k|    temp5 = _mm_min_epi32(dupmax_4x32b, temp5);
 1413|  3.57k|    temp5 = _mm_max_epi32(dupmin_4x32b, temp5);
 1414|       |
 1415|       |    /* x2j = z1j - z2j                                                        */
 1416|  3.57k|    temp6 = _mm_sub_epi32(temp1, temp2);
 1417|  3.57k|    temp6 = _mm_add_epi32(temp6, value_32);
 1418|  3.57k|    temp6 = _mm_srai_epi32(temp6, 6);
 1419|  3.57k|    temp6 = _mm_min_epi32(dupmax_4x32b, temp6);
 1420|  3.57k|    temp6 = _mm_max_epi32(dupmin_4x32b, temp6);
 1421|       |
 1422|       |    /* x3j = z0j - z3j                                                        */
 1423|  3.57k|    temp7 = _mm_sub_epi32(temp0, temp3);
 1424|  3.57k|    temp7 = _mm_add_epi32(temp7, value_32);
 1425|  3.57k|    temp7 = _mm_srai_epi32(temp7, 6);
 1426|  3.57k|    temp7 = _mm_min_epi32(dupmax_4x32b, temp7);
 1427|  3.57k|    temp7 = _mm_max_epi32(dupmin_4x32b, temp7);
 1428|       |
 1429|       |    // 32-bit to 16-bit conversion
 1430|  3.57k|    temp0 = _mm_packs_epi32(temp4, temp5);
 1431|  3.57k|    temp1 = _mm_packs_epi32(temp6, temp7);
 1432|       |
 1433|  3.57k|    resq_r0 = temp0;
 1434|  3.57k|    resq_r1 = _mm_srli_si128(temp0, 8);
 1435|  3.57k|    resq_r2 = temp1;
 1436|  3.57k|    resq_r3 = _mm_srli_si128(temp1, 8);
 1437|       |
 1438|       |    // a00 a01 a02 a03 a10 a11 a12 a13 -- the source matrix 0th,1st row
 1439|  3.57k|    src_r0 = _mm_loadu_si128((__m128i *) (pi2_out));
 1440|       |    // a20 a21 a22 a23 a30 a31 a32 a33 -- the source matrix 2nd,3rd row
 1441|  3.57k|    src_r1 = _mm_loadu_si128((__m128i *) (pi2_out + (1 * out_strd)));
 1442|       |
 1443|  3.57k|    src_r2 = _mm_loadu_si128((__m128i *) (pi2_out + (2 * out_strd)));
 1444|  3.57k|    src_r3 = _mm_loadu_si128((__m128i *) (pi2_out + (3 * out_strd)));
 1445|       |
 1446|  3.57k|    resq_r0 = _mm_and_si128(temp4, chroma_mask_even);  // macro 0 macro 0 ..
 1447|  3.57k|    resq_r1 = _mm_and_si128(temp5, chroma_mask_even);
 1448|  3.57k|    resq_r2 = _mm_and_si128(temp6, chroma_mask_even);
 1449|  3.57k|    resq_r3 = _mm_and_si128(temp7, chroma_mask_even);
 1450|       |
 1451|  3.57k|    src_r0 = _mm_and_si128(src_r0, chroma_mask_odd);  // 0 src1 0 src2 0 ...
 1452|  3.57k|    src_r1 = _mm_and_si128(src_r1, chroma_mask_odd);
 1453|  3.57k|    src_r2 = _mm_and_si128(src_r2, chroma_mask_odd);
 1454|  3.57k|    src_r3 = _mm_and_si128(src_r3, chroma_mask_odd);
 1455|       |
 1456|  3.57k|    src_r0 = _mm_add_epi16(src_r0, resq_r0);  // macro  src1 macro src2 macro ...
 1457|  3.57k|    src_r1 = _mm_add_epi16(src_r1, resq_r1);
 1458|  3.57k|    src_r2 = _mm_add_epi16(src_r2, resq_r2);
 1459|  3.57k|    src_r3 = _mm_add_epi16(src_r3, resq_r3);
 1460|       |
 1461|  3.57k|    _mm_storeu_si128((__m128i *) (&pi2_out[0]), src_r0);
 1462|  3.57k|    _mm_storeu_si128((__m128i *) (&pi2_out[out_strd]), src_r1);
 1463|  3.57k|    _mm_storeu_si128((__m128i *) (&pi2_out[2 * out_strd]), src_r2);
 1464|  3.57k|    _mm_storeu_si128((__m128i *) (&pi2_out[3 * out_strd]), src_r3);
 1465|  3.57k|}

isvcd_pred_residual_recon_4x4_sse42:
   83|  73.3k|{
   84|  73.3k|    __m128i pred_16x8b_0, pred_8x16b_0, rsd_8x16b_0, out_8x16b_0, out_16x8b_0;
   85|  73.3k|    __m128i pred_16x8b_1, pred_8x16b_1, rsd_8x16b_1, out_8x16b_1, out_16x8b_1;
   86|  73.3k|    __m128i pred_16x8b_2, pred_8x16b_2, rsd_8x16b_2, out_8x16b_2, out_16x8b_2;
   87|  73.3k|    __m128i pred_16x8b_3, pred_8x16b_3, rsd_8x16b_3, out_8x16b_3, out_16x8b_3;
   88|  73.3k|    __m128i rsd_8x16b_01, rsd_8x16b_23;
   89|       |
   90|  73.3k|    __m128i zero_8x16b = _mm_setzero_si128();
   91|  73.3k|    WORD32 i4_nnz, row_01, row_23;
   92|       |
   93|  73.3k|    pred_16x8b_0 = _mm_loadu_si128((__m128i *) (pu1_pred));
   94|  73.3k|    pred_16x8b_1 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd));
   95|  73.3k|    pred_16x8b_2 = _mm_loadu_si128((__m128i *) (pu1_pred + (pred_strd << 1)));
   96|  73.3k|    pred_16x8b_3 = _mm_loadu_si128((__m128i *) (pu1_pred + (pred_strd << 1) + pred_strd));
   97|       |
   98|  73.3k|    pred_8x16b_0 = _mm_cvtepu8_epi16(pred_16x8b_0);
   99|  73.3k|    pred_8x16b_1 = _mm_cvtepu8_epi16(pred_16x8b_1);
  100|  73.3k|    pred_8x16b_2 = _mm_cvtepu8_epi16(pred_16x8b_2);
  101|  73.3k|    pred_8x16b_3 = _mm_cvtepu8_epi16(pred_16x8b_3);
  102|       |
  103|  73.3k|    rsd_8x16b_0 = _mm_loadu_si128((__m128i *) (pi2_rsd));
  104|  73.3k|    rsd_8x16b_1 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd));
  105|  73.3k|    rsd_8x16b_2 = _mm_loadu_si128((__m128i *) (pi2_rsd + (rsd_strd << 1)));
  106|  73.3k|    rsd_8x16b_3 = _mm_loadu_si128((__m128i *) (pi2_rsd + (rsd_strd << 1) + rsd_strd));
  107|       |
  108|  73.3k|    rsd_8x16b_01 = _mm_unpacklo_epi64(rsd_8x16b_0, rsd_8x16b_1);
  109|  73.3k|    rsd_8x16b_23 = _mm_unpacklo_epi64(rsd_8x16b_2, rsd_8x16b_3);
  110|       |
  111|  73.3k|    row_01 = _mm_test_all_ones(
  112|  73.3k|        _mm_cmpeq_epi16(rsd_8x16b_01, zero_8x16b));  // return 1 if all zeros, else 0
  113|  73.3k|    row_23 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_23, zero_8x16b));
  114|       |
  115|  73.3k|    out_8x16b_0 = _mm_add_epi16(pred_8x16b_0, rsd_8x16b_0);
  116|  73.3k|    out_8x16b_1 = _mm_add_epi16(pred_8x16b_1, rsd_8x16b_1);
  117|  73.3k|    out_8x16b_2 = _mm_add_epi16(pred_8x16b_2, rsd_8x16b_2);
  118|  73.3k|    out_8x16b_3 = _mm_add_epi16(pred_8x16b_3, rsd_8x16b_3);
  119|       |
  120|  73.3k|    out_16x8b_0 = _mm_packus_epi16(out_8x16b_0, zero_8x16b);
  121|  73.3k|    out_16x8b_1 = _mm_packus_epi16(out_8x16b_1, zero_8x16b);
  122|  73.3k|    out_16x8b_2 = _mm_packus_epi16(out_8x16b_2, zero_8x16b);
  123|  73.3k|    out_16x8b_3 = _mm_packus_epi16(out_8x16b_3, zero_8x16b);
  124|       |
  125|  73.3k|    *((WORD32 *) (pu1_out)) = _mm_cvtsi128_si32(out_16x8b_0);
  126|  73.3k|    *((WORD32 *) (pu1_out + out_strd)) = _mm_cvtsi128_si32(out_16x8b_1);
  127|  73.3k|    *((WORD32 *) (pu1_out + (out_strd << 1))) = _mm_cvtsi128_si32(out_16x8b_2);
  128|  73.3k|    *((WORD32 *) (pu1_out + (out_strd * 3))) = _mm_cvtsi128_si32(out_16x8b_3);
  129|  73.3k|    i4_nnz = !(row_01 && row_23);
  ------------------
  |  Branch (129:16): [True: 72.2k, False: 1.16k]
  |  Branch (129:26): [True: 71.9k, False: 261]
  ------------------
  130|       |
  131|  73.3k|    return i4_nnz;
  132|  73.3k|}
isvcd_pred_residual_recon_8x8_sse42:
  158|  5.62k|{
  159|  5.62k|    __m128i pred_16x8b_0, pred_8x16b_0, rsd_8x16b_0, out_8x16b_0, out_16x8b_0;
  160|  5.62k|    __m128i pred_16x8b_1, pred_8x16b_1, rsd_8x16b_1, out_8x16b_1, out_16x8b_1;
  161|  5.62k|    __m128i pred_16x8b_2, pred_8x16b_2, rsd_8x16b_2, out_8x16b_2, out_16x8b_2;
  162|  5.62k|    __m128i pred_16x8b_3, pred_8x16b_3, rsd_8x16b_3, out_8x16b_3, out_16x8b_3;
  163|  5.62k|    __m128i pred_16x8b_4, pred_8x16b_4, rsd_8x16b_4, out_8x16b_4, out_16x8b_4;
  164|  5.62k|    __m128i pred_16x8b_5, pred_8x16b_5, rsd_8x16b_5, out_8x16b_5, out_16x8b_5;
  165|  5.62k|    __m128i pred_16x8b_6, pred_8x16b_6, rsd_8x16b_6, out_8x16b_6, out_16x8b_6;
  166|  5.62k|    __m128i pred_16x8b_7, pred_8x16b_7, rsd_8x16b_7, out_8x16b_7, out_16x8b_7;
  167|  5.62k|    __m128i rsd_8x16b_01_b0, rsd_8x16b_23_b0, rsd_8x16b_45_b2, rsd_8x16b_67_b2;
  168|  5.62k|    __m128i rsd_8x16b_01_b1, rsd_8x16b_23_b1, rsd_8x16b_45_b3, rsd_8x16b_67_b3;
  169|       |
  170|  5.62k|    WORD32 row_01_b0, row_23_b0, row_45_b2, row_67_b2;
  171|  5.62k|    WORD32 row_01_b1, row_23_b1, row_45_b3, row_67_b3;
  172|  5.62k|    WORD32 i4_nnz, i4_nnz_b0, i4_nnz_b1, i4_nnz_b2, i4_nnz_b3;
  173|       |
  174|  5.62k|    __m128i zero_8x16b = _mm_setzero_si128();
  175|       |
  176|  5.62k|    WORD32 pred_strd2 = (pred_strd << 1);
  177|  5.62k|    WORD32 pred_strd4 = (pred_strd << 2);
  178|  5.62k|    WORD32 rsd_strd2 = (rsd_strd << 1);
  179|  5.62k|    WORD32 rsd_strd4 = (rsd_strd << 2);
  180|  5.62k|    WORD32 out_strd2 = (out_strd << 1);
  181|  5.62k|    WORD32 out_strd4 = (out_strd << 2);
  182|       |
  183|  5.62k|    pred_16x8b_0 = _mm_loadu_si128((__m128i *) (pu1_pred));
  184|  5.62k|    pred_16x8b_1 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd));
  185|  5.62k|    pred_16x8b_2 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd2));
  186|  5.62k|    pred_16x8b_3 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd2 + pred_strd));
  187|  5.62k|    pred_16x8b_4 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4));
  188|  5.62k|    pred_16x8b_5 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd));
  189|  5.62k|    pred_16x8b_6 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd2));
  190|  5.62k|    pred_16x8b_7 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd2 + pred_strd));
  191|       |
  192|  5.62k|    pred_8x16b_0 = _mm_cvtepu8_epi16(pred_16x8b_0);
  193|  5.62k|    pred_8x16b_1 = _mm_cvtepu8_epi16(pred_16x8b_1);
  194|  5.62k|    pred_8x16b_2 = _mm_cvtepu8_epi16(pred_16x8b_2);
  195|  5.62k|    pred_8x16b_3 = _mm_cvtepu8_epi16(pred_16x8b_3);
  196|  5.62k|    pred_8x16b_4 = _mm_cvtepu8_epi16(pred_16x8b_4);
  197|  5.62k|    pred_8x16b_5 = _mm_cvtepu8_epi16(pred_16x8b_5);
  198|  5.62k|    pred_8x16b_6 = _mm_cvtepu8_epi16(pred_16x8b_6);
  199|  5.62k|    pred_8x16b_7 = _mm_cvtepu8_epi16(pred_16x8b_7);
  200|       |
  201|  5.62k|    rsd_8x16b_0 = _mm_loadu_si128((__m128i *) (pi2_rsd));
  202|  5.62k|    rsd_8x16b_1 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd));
  203|  5.62k|    rsd_8x16b_2 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd2));
  204|  5.62k|    rsd_8x16b_3 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd2 + rsd_strd));
  205|  5.62k|    rsd_8x16b_4 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4));
  206|  5.62k|    rsd_8x16b_5 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd));
  207|  5.62k|    rsd_8x16b_6 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd2));
  208|  5.62k|    rsd_8x16b_7 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd2 + rsd_strd));
  209|       |
  210|  5.62k|    rsd_8x16b_01_b0 = _mm_unpacklo_epi64(rsd_8x16b_0, rsd_8x16b_1);
  211|  5.62k|    rsd_8x16b_23_b0 = _mm_unpacklo_epi64(rsd_8x16b_2, rsd_8x16b_3);
  212|  5.62k|    rsd_8x16b_01_b1 = _mm_unpackhi_epi64(rsd_8x16b_0, rsd_8x16b_1);
  213|  5.62k|    rsd_8x16b_23_b1 = _mm_unpackhi_epi64(rsd_8x16b_2, rsd_8x16b_3);
  214|       |
  215|  5.62k|    rsd_8x16b_45_b2 = _mm_unpacklo_epi64(rsd_8x16b_4, rsd_8x16b_5);
  216|  5.62k|    rsd_8x16b_67_b2 = _mm_unpacklo_epi64(rsd_8x16b_6, rsd_8x16b_7);
  217|  5.62k|    rsd_8x16b_45_b3 = _mm_unpackhi_epi64(rsd_8x16b_4, rsd_8x16b_5);
  218|  5.62k|    rsd_8x16b_67_b3 = _mm_unpackhi_epi64(rsd_8x16b_6, rsd_8x16b_7);
  219|       |
  220|  5.62k|    row_01_b0 = _mm_test_all_ones(
  221|  5.62k|        _mm_cmpeq_epi16(rsd_8x16b_01_b0, zero_8x16b));  // return 1 if all zeros, else 0
  222|  5.62k|    row_23_b0 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_23_b0, zero_8x16b));
  223|  5.62k|    row_01_b1 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_01_b1, zero_8x16b));
  224|  5.62k|    row_23_b1 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_23_b1, zero_8x16b));
  225|  5.62k|    row_45_b2 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_45_b2, zero_8x16b));
  226|  5.62k|    row_67_b2 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_67_b2, zero_8x16b));
  227|  5.62k|    row_45_b3 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_45_b3, zero_8x16b));
  228|  5.62k|    row_67_b3 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_67_b3, zero_8x16b));
  229|       |
  230|  5.62k|    out_8x16b_0 = _mm_add_epi16(pred_8x16b_0, rsd_8x16b_0);
  231|  5.62k|    out_8x16b_1 = _mm_add_epi16(pred_8x16b_1, rsd_8x16b_1);
  232|  5.62k|    out_8x16b_2 = _mm_add_epi16(pred_8x16b_2, rsd_8x16b_2);
  233|  5.62k|    out_8x16b_3 = _mm_add_epi16(pred_8x16b_3, rsd_8x16b_3);
  234|  5.62k|    out_8x16b_4 = _mm_add_epi16(pred_8x16b_4, rsd_8x16b_4);
  235|  5.62k|    out_8x16b_5 = _mm_add_epi16(pred_8x16b_5, rsd_8x16b_5);
  236|  5.62k|    out_8x16b_6 = _mm_add_epi16(pred_8x16b_6, rsd_8x16b_6);
  237|  5.62k|    out_8x16b_7 = _mm_add_epi16(pred_8x16b_7, rsd_8x16b_7);
  238|       |
  239|  5.62k|    out_16x8b_0 = _mm_packus_epi16(out_8x16b_0, zero_8x16b);
  240|  5.62k|    out_16x8b_1 = _mm_packus_epi16(out_8x16b_1, zero_8x16b);
  241|  5.62k|    out_16x8b_2 = _mm_packus_epi16(out_8x16b_2, zero_8x16b);
  242|  5.62k|    out_16x8b_3 = _mm_packus_epi16(out_8x16b_3, zero_8x16b);
  243|  5.62k|    out_16x8b_4 = _mm_packus_epi16(out_8x16b_4, zero_8x16b);
  244|  5.62k|    out_16x8b_5 = _mm_packus_epi16(out_8x16b_5, zero_8x16b);
  245|  5.62k|    out_16x8b_6 = _mm_packus_epi16(out_8x16b_6, zero_8x16b);
  246|  5.62k|    out_16x8b_7 = _mm_packus_epi16(out_8x16b_7, zero_8x16b);
  247|       |
  248|  5.62k|    _mm_storel_epi64((__m128i *) (pu1_out), out_16x8b_0);
  249|  5.62k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd), out_16x8b_1);
  250|  5.62k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd2), out_16x8b_2);
  251|  5.62k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd2 + out_strd), out_16x8b_3);
  252|  5.62k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4), out_16x8b_4);
  253|  5.62k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd), out_16x8b_5);
  254|  5.62k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd2), out_16x8b_6);
  255|  5.62k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd2 + out_strd), out_16x8b_7);
  256|       |
  257|  5.62k|    i4_nnz_b0 = (!(row_01_b0 && row_23_b0));
  ------------------
  |  Branch (257:20): [True: 5.18k, False: 439]
  |  Branch (257:33): [True: 5.18k, False: 0]
  ------------------
  258|  5.62k|    i4_nnz_b1 = (!(row_01_b1 && row_23_b1)) << 1;
  ------------------
  |  Branch (258:20): [True: 5.21k, False: 411]
  |  Branch (258:33): [True: 5.21k, False: 0]
  ------------------
  259|  5.62k|    i4_nnz_b2 = (!(row_45_b2 && row_67_b2)) << 4;
  ------------------
  |  Branch (259:20): [True: 5.21k, False: 413]
  |  Branch (259:33): [True: 5.21k, False: 0]
  ------------------
  260|  5.62k|    i4_nnz_b3 = (!(row_45_b3 && row_67_b3)) << 5;
  ------------------
  |  Branch (260:20): [True: 5.22k, False: 398]
  |  Branch (260:33): [True: 5.22k, False: 0]
  ------------------
  261|       |
  262|  5.62k|    i4_nnz = (i4_nnz_b0 | i4_nnz_b1 | i4_nnz_b2 | i4_nnz_b3);
  263|  5.62k|    return i4_nnz;
  264|  5.62k|}
isvcd_pred_residual_recon_16x16_sse42:
  290|  58.1k|{
  291|  58.1k|    __m128i pred_16x8b_0, pred_8x16b_0, rsd_8x16b_0, out_8x16b_0, out_16x8b_0;
  292|  58.1k|    __m128i pred_16x8b_1, pred_8x16b_1, rsd_8x16b_1, out_8x16b_1, out_16x8b_1;
  293|  58.1k|    __m128i pred_16x8b_2, pred_8x16b_2, rsd_8x16b_2, out_8x16b_2, out_16x8b_2;
  294|  58.1k|    __m128i pred_16x8b_3, pred_8x16b_3, rsd_8x16b_3, out_8x16b_3, out_16x8b_3;
  295|  58.1k|    __m128i pred_16x8b_4, pred_8x16b_4, rsd_8x16b_4, out_8x16b_4, out_16x8b_4;
  296|  58.1k|    __m128i pred_16x8b_5, pred_8x16b_5, rsd_8x16b_5, out_8x16b_5, out_16x8b_5;
  297|  58.1k|    __m128i pred_16x8b_6, pred_8x16b_6, rsd_8x16b_6, out_8x16b_6, out_16x8b_6;
  298|  58.1k|    __m128i pred_16x8b_7, pred_8x16b_7, rsd_8x16b_7, out_8x16b_7, out_16x8b_7;
  299|  58.1k|    __m128i rsd_8x16b_01_b0, rsd_8x16b_23_b0, rsd_8x16b_45_b2, rsd_8x16b_67_b2;
  300|  58.1k|    __m128i rsd_8x16b_01_b1, rsd_8x16b_23_b1, rsd_8x16b_45_b3, rsd_8x16b_67_b3;
  301|       |
  302|  58.1k|    WORD32 row_01_b0, row_23_b0, row_45_b2, row_67_b2;
  303|  58.1k|    WORD32 row_01_b1, row_23_b1, row_45_b3, row_67_b3;
  304|  58.1k|    WORD32 i4_nnz, i4_nnz_b0, i4_nnz_b1, i4_nnz_b2, i4_nnz_b3;
  305|       |
  306|  58.1k|    __m128i zero_8x16b = _mm_setzero_si128();
  307|       |
  308|  58.1k|    WORD32 pred_strd2 = (pred_strd << 1);
  309|  58.1k|    WORD32 pred_strd4 = (pred_strd << 2);
  310|  58.1k|    WORD32 rsd_strd2 = (rsd_strd << 1);
  311|  58.1k|    WORD32 rsd_strd4 = (rsd_strd << 2);
  312|  58.1k|    WORD32 out_strd2 = (out_strd << 1);
  313|  58.1k|    WORD32 out_strd4 = (out_strd << 2);
  314|       |
  315|  58.1k|    pred_16x8b_0 = _mm_loadu_si128((__m128i *) (pu1_pred));
  316|  58.1k|    pred_16x8b_1 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd));
  317|  58.1k|    pred_16x8b_2 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd2));
  318|  58.1k|    pred_16x8b_3 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd2 + pred_strd));
  319|  58.1k|    pred_16x8b_4 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4));
  320|  58.1k|    pred_16x8b_5 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd));
  321|  58.1k|    pred_16x8b_6 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd2));
  322|  58.1k|    pred_16x8b_7 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd2 + pred_strd));
  323|       |
  324|  58.1k|    pred_8x16b_0 = _mm_cvtepu8_epi16(pred_16x8b_0);
  325|  58.1k|    pred_8x16b_1 = _mm_cvtepu8_epi16(pred_16x8b_1);
  326|  58.1k|    pred_8x16b_2 = _mm_cvtepu8_epi16(pred_16x8b_2);
  327|  58.1k|    pred_8x16b_3 = _mm_cvtepu8_epi16(pred_16x8b_3);
  328|  58.1k|    pred_8x16b_4 = _mm_cvtepu8_epi16(pred_16x8b_4);
  329|  58.1k|    pred_8x16b_5 = _mm_cvtepu8_epi16(pred_16x8b_5);
  330|  58.1k|    pred_8x16b_6 = _mm_cvtepu8_epi16(pred_16x8b_6);
  331|  58.1k|    pred_8x16b_7 = _mm_cvtepu8_epi16(pred_16x8b_7);
  332|       |
  333|  58.1k|    rsd_8x16b_0 = _mm_loadu_si128((__m128i *) (pi2_rsd));
  334|  58.1k|    rsd_8x16b_1 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd));
  335|  58.1k|    rsd_8x16b_2 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd2));
  336|  58.1k|    rsd_8x16b_3 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd2 + rsd_strd));
  337|  58.1k|    rsd_8x16b_4 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4));
  338|  58.1k|    rsd_8x16b_5 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd));
  339|  58.1k|    rsd_8x16b_6 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd2));
  340|  58.1k|    rsd_8x16b_7 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd2 + rsd_strd));
  341|       |
  342|  58.1k|    rsd_8x16b_01_b0 = _mm_unpacklo_epi64(rsd_8x16b_0, rsd_8x16b_1);
  343|  58.1k|    rsd_8x16b_23_b0 = _mm_unpacklo_epi64(rsd_8x16b_2, rsd_8x16b_3);
  344|  58.1k|    rsd_8x16b_01_b1 = _mm_unpackhi_epi64(rsd_8x16b_0, rsd_8x16b_1);
  345|  58.1k|    rsd_8x16b_23_b1 = _mm_unpackhi_epi64(rsd_8x16b_2, rsd_8x16b_3);
  346|       |
  347|  58.1k|    rsd_8x16b_45_b2 = _mm_unpacklo_epi64(rsd_8x16b_4, rsd_8x16b_5);
  348|  58.1k|    rsd_8x16b_67_b2 = _mm_unpacklo_epi64(rsd_8x16b_6, rsd_8x16b_7);
  349|  58.1k|    rsd_8x16b_45_b3 = _mm_unpackhi_epi64(rsd_8x16b_4, rsd_8x16b_5);
  350|  58.1k|    rsd_8x16b_67_b3 = _mm_unpackhi_epi64(rsd_8x16b_6, rsd_8x16b_7);
  351|       |
  352|  58.1k|    row_01_b0 = _mm_test_all_ones(
  353|  58.1k|        _mm_cmpeq_epi16(rsd_8x16b_01_b0, zero_8x16b));  // return 1 if all zeros, else 0
  354|  58.1k|    row_23_b0 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_23_b0, zero_8x16b));
  355|  58.1k|    row_01_b1 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_01_b1, zero_8x16b));
  356|  58.1k|    row_23_b1 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_23_b1, zero_8x16b));
  357|  58.1k|    row_45_b2 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_45_b2, zero_8x16b));
  358|  58.1k|    row_67_b2 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_67_b2, zero_8x16b));
  359|  58.1k|    row_45_b3 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_45_b3, zero_8x16b));
  360|  58.1k|    row_67_b3 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_67_b3, zero_8x16b));
  361|       |
  362|  58.1k|    out_8x16b_0 = _mm_add_epi16(pred_8x16b_0, rsd_8x16b_0);
  363|  58.1k|    out_8x16b_1 = _mm_add_epi16(pred_8x16b_1, rsd_8x16b_1);
  364|  58.1k|    out_8x16b_2 = _mm_add_epi16(pred_8x16b_2, rsd_8x16b_2);
  365|  58.1k|    out_8x16b_3 = _mm_add_epi16(pred_8x16b_3, rsd_8x16b_3);
  366|  58.1k|    out_8x16b_4 = _mm_add_epi16(pred_8x16b_4, rsd_8x16b_4);
  367|  58.1k|    out_8x16b_5 = _mm_add_epi16(pred_8x16b_5, rsd_8x16b_5);
  368|  58.1k|    out_8x16b_6 = _mm_add_epi16(pred_8x16b_6, rsd_8x16b_6);
  369|  58.1k|    out_8x16b_7 = _mm_add_epi16(pred_8x16b_7, rsd_8x16b_7);
  370|       |
  371|  58.1k|    out_16x8b_0 = _mm_packus_epi16(out_8x16b_0, zero_8x16b);
  372|  58.1k|    out_16x8b_1 = _mm_packus_epi16(out_8x16b_1, zero_8x16b);
  373|  58.1k|    out_16x8b_2 = _mm_packus_epi16(out_8x16b_2, zero_8x16b);
  374|  58.1k|    out_16x8b_3 = _mm_packus_epi16(out_8x16b_3, zero_8x16b);
  375|  58.1k|    out_16x8b_4 = _mm_packus_epi16(out_8x16b_4, zero_8x16b);
  376|  58.1k|    out_16x8b_5 = _mm_packus_epi16(out_8x16b_5, zero_8x16b);
  377|  58.1k|    out_16x8b_6 = _mm_packus_epi16(out_8x16b_6, zero_8x16b);
  378|  58.1k|    out_16x8b_7 = _mm_packus_epi16(out_8x16b_7, zero_8x16b);
  379|       |
  380|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out), out_16x8b_0);
  381|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd), out_16x8b_1);
  382|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd2), out_16x8b_2);
  383|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd2 + out_strd), out_16x8b_3);
  384|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4), out_16x8b_4);
  385|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd), out_16x8b_5);
  386|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd2), out_16x8b_6);
  387|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd2 + out_strd), out_16x8b_7);
  388|       |
  389|  58.1k|    i4_nnz_b0 = (!(row_01_b0 && row_23_b0));
  ------------------
  |  Branch (389:20): [True: 56.7k, False: 1.44k]
  |  Branch (389:33): [True: 56.3k, False: 401]
  ------------------
  390|  58.1k|    i4_nnz_b1 = (!(row_01_b1 && row_23_b1)) << 1;
  ------------------
  |  Branch (390:20): [True: 57.1k, False: 980]
  |  Branch (390:33): [True: 56.3k, False: 789]
  ------------------
  391|  58.1k|    i4_nnz_b2 = (!(row_45_b2 && row_67_b2)) << 4;
  ------------------
  |  Branch (391:20): [True: 56.4k, False: 1.71k]
  |  Branch (391:33): [True: 56.3k, False: 72]
  ------------------
  392|  58.1k|    i4_nnz_b3 = (!(row_45_b3 && row_67_b3)) << 5;
  ------------------
  |  Branch (392:20): [True: 56.9k, False: 1.25k]
  |  Branch (392:33): [True: 56.4k, False: 464]
  ------------------
  393|       |
  394|  58.1k|    i4_nnz = (i4_nnz_b0 | i4_nnz_b1 | i4_nnz_b2 | i4_nnz_b3);
  395|       |
  396|  58.1k|    pu1_pred += 8;
  397|  58.1k|    pi2_rsd += 8;
  398|  58.1k|    pu1_out += 8;
  399|       |
  400|  58.1k|    pred_16x8b_0 = _mm_loadu_si128((__m128i *) (pu1_pred));
  401|  58.1k|    pred_16x8b_1 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd));
  402|  58.1k|    pred_16x8b_2 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd2));
  403|  58.1k|    pred_16x8b_3 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd2 + pred_strd));
  404|  58.1k|    pred_16x8b_4 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4));
  405|  58.1k|    pred_16x8b_5 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd));
  406|  58.1k|    pred_16x8b_6 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd2));
  407|  58.1k|    pred_16x8b_7 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd2 + pred_strd));
  408|       |
  409|  58.1k|    pred_8x16b_0 = _mm_cvtepu8_epi16(pred_16x8b_0);
  410|  58.1k|    pred_8x16b_1 = _mm_cvtepu8_epi16(pred_16x8b_1);
  411|  58.1k|    pred_8x16b_2 = _mm_cvtepu8_epi16(pred_16x8b_2);
  412|  58.1k|    pred_8x16b_3 = _mm_cvtepu8_epi16(pred_16x8b_3);
  413|  58.1k|    pred_8x16b_4 = _mm_cvtepu8_epi16(pred_16x8b_4);
  414|  58.1k|    pred_8x16b_5 = _mm_cvtepu8_epi16(pred_16x8b_5);
  415|  58.1k|    pred_8x16b_6 = _mm_cvtepu8_epi16(pred_16x8b_6);
  416|  58.1k|    pred_8x16b_7 = _mm_cvtepu8_epi16(pred_16x8b_7);
  417|       |
  418|  58.1k|    rsd_8x16b_0 = _mm_loadu_si128((__m128i *) (pi2_rsd));
  419|  58.1k|    rsd_8x16b_1 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd));
  420|  58.1k|    rsd_8x16b_2 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd2));
  421|  58.1k|    rsd_8x16b_3 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd2 + rsd_strd));
  422|  58.1k|    rsd_8x16b_4 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4));
  423|  58.1k|    rsd_8x16b_5 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd));
  424|  58.1k|    rsd_8x16b_6 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd2));
  425|  58.1k|    rsd_8x16b_7 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd2 + rsd_strd));
  426|       |
  427|  58.1k|    rsd_8x16b_01_b0 = _mm_unpacklo_epi64(rsd_8x16b_0, rsd_8x16b_1);
  428|  58.1k|    rsd_8x16b_23_b0 = _mm_unpacklo_epi64(rsd_8x16b_2, rsd_8x16b_3);
  429|  58.1k|    rsd_8x16b_01_b1 = _mm_unpackhi_epi64(rsd_8x16b_0, rsd_8x16b_1);
  430|  58.1k|    rsd_8x16b_23_b1 = _mm_unpackhi_epi64(rsd_8x16b_2, rsd_8x16b_3);
  431|       |
  432|  58.1k|    rsd_8x16b_45_b2 = _mm_unpacklo_epi64(rsd_8x16b_4, rsd_8x16b_5);
  433|  58.1k|    rsd_8x16b_67_b2 = _mm_unpacklo_epi64(rsd_8x16b_6, rsd_8x16b_7);
  434|  58.1k|    rsd_8x16b_45_b3 = _mm_unpackhi_epi64(rsd_8x16b_4, rsd_8x16b_5);
  435|  58.1k|    rsd_8x16b_67_b3 = _mm_unpackhi_epi64(rsd_8x16b_6, rsd_8x16b_7);
  436|       |
  437|  58.1k|    row_01_b0 = _mm_test_all_ones(
  438|  58.1k|        _mm_cmpeq_epi16(rsd_8x16b_01_b0, zero_8x16b));  // return 1 if all zeros, else 0
  439|  58.1k|    row_23_b0 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_23_b0, zero_8x16b));
  440|  58.1k|    row_01_b1 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_01_b1, zero_8x16b));
  441|  58.1k|    row_23_b1 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_23_b1, zero_8x16b));
  442|  58.1k|    row_45_b2 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_45_b2, zero_8x16b));
  443|  58.1k|    row_67_b2 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_67_b2, zero_8x16b));
  444|  58.1k|    row_45_b3 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_45_b3, zero_8x16b));
  445|  58.1k|    row_67_b3 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_67_b3, zero_8x16b));
  446|       |
  447|  58.1k|    out_8x16b_0 = _mm_add_epi16(pred_8x16b_0, rsd_8x16b_0);
  448|  58.1k|    out_8x16b_1 = _mm_add_epi16(pred_8x16b_1, rsd_8x16b_1);
  449|  58.1k|    out_8x16b_2 = _mm_add_epi16(pred_8x16b_2, rsd_8x16b_2);
  450|  58.1k|    out_8x16b_3 = _mm_add_epi16(pred_8x16b_3, rsd_8x16b_3);
  451|  58.1k|    out_8x16b_4 = _mm_add_epi16(pred_8x16b_4, rsd_8x16b_4);
  452|  58.1k|    out_8x16b_5 = _mm_add_epi16(pred_8x16b_5, rsd_8x16b_5);
  453|  58.1k|    out_8x16b_6 = _mm_add_epi16(pred_8x16b_6, rsd_8x16b_6);
  454|  58.1k|    out_8x16b_7 = _mm_add_epi16(pred_8x16b_7, rsd_8x16b_7);
  455|       |
  456|  58.1k|    out_16x8b_0 = _mm_packus_epi16(out_8x16b_0, zero_8x16b);
  457|  58.1k|    out_16x8b_1 = _mm_packus_epi16(out_8x16b_1, zero_8x16b);
  458|  58.1k|    out_16x8b_2 = _mm_packus_epi16(out_8x16b_2, zero_8x16b);
  459|  58.1k|    out_16x8b_3 = _mm_packus_epi16(out_8x16b_3, zero_8x16b);
  460|  58.1k|    out_16x8b_4 = _mm_packus_epi16(out_8x16b_4, zero_8x16b);
  461|  58.1k|    out_16x8b_5 = _mm_packus_epi16(out_8x16b_5, zero_8x16b);
  462|  58.1k|    out_16x8b_6 = _mm_packus_epi16(out_8x16b_6, zero_8x16b);
  463|  58.1k|    out_16x8b_7 = _mm_packus_epi16(out_8x16b_7, zero_8x16b);
  464|       |
  465|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out), out_16x8b_0);
  466|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd), out_16x8b_1);
  467|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd2), out_16x8b_2);
  468|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd2 + out_strd), out_16x8b_3);
  469|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4), out_16x8b_4);
  470|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd), out_16x8b_5);
  471|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd2), out_16x8b_6);
  472|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd2 + out_strd), out_16x8b_7);
  473|       |
  474|  58.1k|    i4_nnz_b0 = (!(row_01_b0 && row_23_b0)) << 2;
  ------------------
  |  Branch (474:20): [True: 56.6k, False: 1.55k]
  |  Branch (474:33): [True: 56.2k, False: 386]
  ------------------
  475|  58.1k|    i4_nnz_b1 = (!(row_01_b1 && row_23_b1)) << 3;
  ------------------
  |  Branch (475:20): [True: 57.0k, False: 1.12k]
  |  Branch (475:33): [True: 56.2k, False: 798]
  ------------------
  476|  58.1k|    i4_nnz_b2 = (!(row_45_b2 && row_67_b2)) << 6;
  ------------------
  |  Branch (476:20): [True: 56.4k, False: 1.72k]
  |  Branch (476:33): [True: 56.3k, False: 112]
  ------------------
  477|  58.1k|    i4_nnz_b3 = (!(row_45_b3 && row_67_b3)) << 7;
  ------------------
  |  Branch (477:20): [True: 56.8k, False: 1.28k]
  |  Branch (477:33): [True: 56.4k, False: 479]
  ------------------
  478|       |
  479|  58.1k|    i4_nnz |= (i4_nnz_b0 | i4_nnz_b1 | i4_nnz_b2 | i4_nnz_b3);
  480|       |
  481|  58.1k|    pu1_pred -= 8;
  482|  58.1k|    pi2_rsd -= 8;
  483|  58.1k|    pu1_out -= 8;
  484|       |
  485|  58.1k|    pu1_pred += (pred_strd << 3);
  486|  58.1k|    pi2_rsd += (rsd_strd << 3);
  487|  58.1k|    pu1_out += (out_strd << 3);
  488|       |
  489|  58.1k|    pred_16x8b_0 = _mm_loadu_si128((__m128i *) (pu1_pred));
  490|  58.1k|    pred_16x8b_1 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd));
  491|  58.1k|    pred_16x8b_2 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd2));
  492|  58.1k|    pred_16x8b_3 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd2 + pred_strd));
  493|  58.1k|    pred_16x8b_4 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4));
  494|  58.1k|    pred_16x8b_5 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd));
  495|  58.1k|    pred_16x8b_6 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd2));
  496|  58.1k|    pred_16x8b_7 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd2 + pred_strd));
  497|       |
  498|  58.1k|    pred_8x16b_0 = _mm_cvtepu8_epi16(pred_16x8b_0);
  499|  58.1k|    pred_8x16b_1 = _mm_cvtepu8_epi16(pred_16x8b_1);
  500|  58.1k|    pred_8x16b_2 = _mm_cvtepu8_epi16(pred_16x8b_2);
  501|  58.1k|    pred_8x16b_3 = _mm_cvtepu8_epi16(pred_16x8b_3);
  502|  58.1k|    pred_8x16b_4 = _mm_cvtepu8_epi16(pred_16x8b_4);
  503|  58.1k|    pred_8x16b_5 = _mm_cvtepu8_epi16(pred_16x8b_5);
  504|  58.1k|    pred_8x16b_6 = _mm_cvtepu8_epi16(pred_16x8b_6);
  505|  58.1k|    pred_8x16b_7 = _mm_cvtepu8_epi16(pred_16x8b_7);
  506|       |
  507|  58.1k|    rsd_8x16b_0 = _mm_loadu_si128((__m128i *) (pi2_rsd));
  508|  58.1k|    rsd_8x16b_1 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd));
  509|  58.1k|    rsd_8x16b_2 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd2));
  510|  58.1k|    rsd_8x16b_3 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd2 + rsd_strd));
  511|  58.1k|    rsd_8x16b_4 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4));
  512|  58.1k|    rsd_8x16b_5 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd));
  513|  58.1k|    rsd_8x16b_6 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd2));
  514|  58.1k|    rsd_8x16b_7 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd2 + rsd_strd));
  515|       |
  516|  58.1k|    rsd_8x16b_01_b0 = _mm_unpacklo_epi64(rsd_8x16b_0, rsd_8x16b_1);
  517|  58.1k|    rsd_8x16b_23_b0 = _mm_unpacklo_epi64(rsd_8x16b_2, rsd_8x16b_3);
  518|  58.1k|    rsd_8x16b_01_b1 = _mm_unpackhi_epi64(rsd_8x16b_0, rsd_8x16b_1);
  519|  58.1k|    rsd_8x16b_23_b1 = _mm_unpackhi_epi64(rsd_8x16b_2, rsd_8x16b_3);
  520|       |
  521|  58.1k|    rsd_8x16b_45_b2 = _mm_unpacklo_epi64(rsd_8x16b_4, rsd_8x16b_5);
  522|  58.1k|    rsd_8x16b_67_b2 = _mm_unpacklo_epi64(rsd_8x16b_6, rsd_8x16b_7);
  523|  58.1k|    rsd_8x16b_45_b3 = _mm_unpackhi_epi64(rsd_8x16b_4, rsd_8x16b_5);
  524|  58.1k|    rsd_8x16b_67_b3 = _mm_unpackhi_epi64(rsd_8x16b_6, rsd_8x16b_7);
  525|       |
  526|  58.1k|    row_01_b0 = _mm_test_all_ones(
  527|  58.1k|        _mm_cmpeq_epi16(rsd_8x16b_01_b0, zero_8x16b));  // return 1 if all zeros, else 0
  528|  58.1k|    row_23_b0 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_23_b0, zero_8x16b));
  529|  58.1k|    row_01_b1 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_01_b1, zero_8x16b));
  530|  58.1k|    row_23_b1 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_23_b1, zero_8x16b));
  531|  58.1k|    row_45_b2 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_45_b2, zero_8x16b));
  532|  58.1k|    row_67_b2 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_67_b2, zero_8x16b));
  533|  58.1k|    row_45_b3 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_45_b3, zero_8x16b));
  534|  58.1k|    row_67_b3 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_67_b3, zero_8x16b));
  535|       |
  536|  58.1k|    out_8x16b_0 = _mm_add_epi16(pred_8x16b_0, rsd_8x16b_0);
  537|  58.1k|    out_8x16b_1 = _mm_add_epi16(pred_8x16b_1, rsd_8x16b_1);
  538|  58.1k|    out_8x16b_2 = _mm_add_epi16(pred_8x16b_2, rsd_8x16b_2);
  539|  58.1k|    out_8x16b_3 = _mm_add_epi16(pred_8x16b_3, rsd_8x16b_3);
  540|  58.1k|    out_8x16b_4 = _mm_add_epi16(pred_8x16b_4, rsd_8x16b_4);
  541|  58.1k|    out_8x16b_5 = _mm_add_epi16(pred_8x16b_5, rsd_8x16b_5);
  542|  58.1k|    out_8x16b_6 = _mm_add_epi16(pred_8x16b_6, rsd_8x16b_6);
  543|  58.1k|    out_8x16b_7 = _mm_add_epi16(pred_8x16b_7, rsd_8x16b_7);
  544|       |
  545|  58.1k|    out_16x8b_0 = _mm_packus_epi16(out_8x16b_0, zero_8x16b);
  546|  58.1k|    out_16x8b_1 = _mm_packus_epi16(out_8x16b_1, zero_8x16b);
  547|  58.1k|    out_16x8b_2 = _mm_packus_epi16(out_8x16b_2, zero_8x16b);
  548|  58.1k|    out_16x8b_3 = _mm_packus_epi16(out_8x16b_3, zero_8x16b);
  549|  58.1k|    out_16x8b_4 = _mm_packus_epi16(out_8x16b_4, zero_8x16b);
  550|  58.1k|    out_16x8b_5 = _mm_packus_epi16(out_8x16b_5, zero_8x16b);
  551|  58.1k|    out_16x8b_6 = _mm_packus_epi16(out_8x16b_6, zero_8x16b);
  552|  58.1k|    out_16x8b_7 = _mm_packus_epi16(out_8x16b_7, zero_8x16b);
  553|       |
  554|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out), out_16x8b_0);
  555|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd), out_16x8b_1);
  556|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd2), out_16x8b_2);
  557|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd2 + out_strd), out_16x8b_3);
  558|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4), out_16x8b_4);
  559|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd), out_16x8b_5);
  560|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd2), out_16x8b_6);
  561|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd2 + out_strd), out_16x8b_7);
  562|       |
  563|  58.1k|    i4_nnz_b0 = (!(row_01_b0 && row_23_b0)) << 8;
  ------------------
  |  Branch (563:20): [True: 56.6k, False: 1.50k]
  |  Branch (563:33): [True: 56.2k, False: 391]
  ------------------
  564|  58.1k|    i4_nnz_b1 = (!(row_01_b1 && row_23_b1)) << 9;
  ------------------
  |  Branch (564:20): [True: 57.2k, False: 930]
  |  Branch (564:33): [True: 56.4k, False: 819]
  ------------------
  565|  58.1k|    i4_nnz_b2 = (!(row_45_b2 && row_67_b2)) << 12;
  ------------------
  |  Branch (565:20): [True: 56.4k, False: 1.74k]
  |  Branch (565:33): [True: 56.3k, False: 43]
  ------------------
  566|  58.1k|    i4_nnz_b3 = (!(row_45_b3 && row_67_b3)) << 13;
  ------------------
  |  Branch (566:20): [True: 56.9k, False: 1.25k]
  |  Branch (566:33): [True: 56.4k, False: 485]
  ------------------
  567|       |
  568|  58.1k|    i4_nnz |= (i4_nnz_b0 | i4_nnz_b1 | i4_nnz_b2 | i4_nnz_b3);
  569|       |
  570|  58.1k|    pu1_pred += 8;
  571|  58.1k|    pi2_rsd += 8;
  572|  58.1k|    pu1_out += 8;
  573|       |
  574|  58.1k|    pred_16x8b_0 = _mm_loadu_si128((__m128i *) (pu1_pred));
  575|  58.1k|    pred_16x8b_1 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd));
  576|  58.1k|    pred_16x8b_2 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd2));
  577|  58.1k|    pred_16x8b_3 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd2 + pred_strd));
  578|  58.1k|    pred_16x8b_4 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4));
  579|  58.1k|    pred_16x8b_5 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd));
  580|  58.1k|    pred_16x8b_6 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd2));
  581|  58.1k|    pred_16x8b_7 = _mm_loadu_si128((__m128i *) (pu1_pred + pred_strd4 + pred_strd2 + pred_strd));
  582|       |
  583|  58.1k|    pred_8x16b_0 = _mm_cvtepu8_epi16(pred_16x8b_0);
  584|  58.1k|    pred_8x16b_1 = _mm_cvtepu8_epi16(pred_16x8b_1);
  585|  58.1k|    pred_8x16b_2 = _mm_cvtepu8_epi16(pred_16x8b_2);
  586|  58.1k|    pred_8x16b_3 = _mm_cvtepu8_epi16(pred_16x8b_3);
  587|  58.1k|    pred_8x16b_4 = _mm_cvtepu8_epi16(pred_16x8b_4);
  588|  58.1k|    pred_8x16b_5 = _mm_cvtepu8_epi16(pred_16x8b_5);
  589|  58.1k|    pred_8x16b_6 = _mm_cvtepu8_epi16(pred_16x8b_6);
  590|  58.1k|    pred_8x16b_7 = _mm_cvtepu8_epi16(pred_16x8b_7);
  591|       |
  592|  58.1k|    rsd_8x16b_0 = _mm_loadu_si128((__m128i *) (pi2_rsd));
  593|  58.1k|    rsd_8x16b_1 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd));
  594|  58.1k|    rsd_8x16b_2 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd2));
  595|  58.1k|    rsd_8x16b_3 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd2 + rsd_strd));
  596|  58.1k|    rsd_8x16b_4 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4));
  597|  58.1k|    rsd_8x16b_5 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd));
  598|  58.1k|    rsd_8x16b_6 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd2));
  599|  58.1k|    rsd_8x16b_7 = _mm_loadu_si128((__m128i *) (pi2_rsd + rsd_strd4 + rsd_strd2 + rsd_strd));
  600|       |
  601|  58.1k|    rsd_8x16b_01_b0 = _mm_unpacklo_epi64(rsd_8x16b_0, rsd_8x16b_1);
  602|  58.1k|    rsd_8x16b_23_b0 = _mm_unpacklo_epi64(rsd_8x16b_2, rsd_8x16b_3);
  603|  58.1k|    rsd_8x16b_01_b1 = _mm_unpackhi_epi64(rsd_8x16b_0, rsd_8x16b_1);
  604|  58.1k|    rsd_8x16b_23_b1 = _mm_unpackhi_epi64(rsd_8x16b_2, rsd_8x16b_3);
  605|       |
  606|  58.1k|    rsd_8x16b_45_b2 = _mm_unpacklo_epi64(rsd_8x16b_4, rsd_8x16b_5);
  607|  58.1k|    rsd_8x16b_67_b2 = _mm_unpacklo_epi64(rsd_8x16b_6, rsd_8x16b_7);
  608|  58.1k|    rsd_8x16b_45_b3 = _mm_unpackhi_epi64(rsd_8x16b_4, rsd_8x16b_5);
  609|  58.1k|    rsd_8x16b_67_b3 = _mm_unpackhi_epi64(rsd_8x16b_6, rsd_8x16b_7);
  610|       |
  611|  58.1k|    row_01_b0 = _mm_test_all_ones(
  612|  58.1k|        _mm_cmpeq_epi16(rsd_8x16b_01_b0, zero_8x16b));  // return 1 if all zeros, else 0
  613|  58.1k|    row_23_b0 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_23_b0, zero_8x16b));
  614|  58.1k|    row_01_b1 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_01_b1, zero_8x16b));
  615|  58.1k|    row_23_b1 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_23_b1, zero_8x16b));
  616|  58.1k|    row_45_b2 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_45_b2, zero_8x16b));
  617|  58.1k|    row_67_b2 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_67_b2, zero_8x16b));
  618|  58.1k|    row_45_b3 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_45_b3, zero_8x16b));
  619|  58.1k|    row_67_b3 = _mm_test_all_ones(_mm_cmpeq_epi16(rsd_8x16b_67_b3, zero_8x16b));
  620|       |
  621|  58.1k|    out_8x16b_0 = _mm_add_epi16(pred_8x16b_0, rsd_8x16b_0);
  622|  58.1k|    out_8x16b_1 = _mm_add_epi16(pred_8x16b_1, rsd_8x16b_1);
  623|  58.1k|    out_8x16b_2 = _mm_add_epi16(pred_8x16b_2, rsd_8x16b_2);
  624|  58.1k|    out_8x16b_3 = _mm_add_epi16(pred_8x16b_3, rsd_8x16b_3);
  625|  58.1k|    out_8x16b_4 = _mm_add_epi16(pred_8x16b_4, rsd_8x16b_4);
  626|  58.1k|    out_8x16b_5 = _mm_add_epi16(pred_8x16b_5, rsd_8x16b_5);
  627|  58.1k|    out_8x16b_6 = _mm_add_epi16(pred_8x16b_6, rsd_8x16b_6);
  628|  58.1k|    out_8x16b_7 = _mm_add_epi16(pred_8x16b_7, rsd_8x16b_7);
  629|       |
  630|  58.1k|    out_16x8b_0 = _mm_packus_epi16(out_8x16b_0, zero_8x16b);
  631|  58.1k|    out_16x8b_1 = _mm_packus_epi16(out_8x16b_1, zero_8x16b);
  632|  58.1k|    out_16x8b_2 = _mm_packus_epi16(out_8x16b_2, zero_8x16b);
  633|  58.1k|    out_16x8b_3 = _mm_packus_epi16(out_8x16b_3, zero_8x16b);
  634|  58.1k|    out_16x8b_4 = _mm_packus_epi16(out_8x16b_4, zero_8x16b);
  635|  58.1k|    out_16x8b_5 = _mm_packus_epi16(out_8x16b_5, zero_8x16b);
  636|  58.1k|    out_16x8b_6 = _mm_packus_epi16(out_8x16b_6, zero_8x16b);
  637|  58.1k|    out_16x8b_7 = _mm_packus_epi16(out_8x16b_7, zero_8x16b);
  638|       |
  639|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out), out_16x8b_0);
  640|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd), out_16x8b_1);
  641|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd2), out_16x8b_2);
  642|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd2 + out_strd), out_16x8b_3);
  643|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4), out_16x8b_4);
  644|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd), out_16x8b_5);
  645|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd2), out_16x8b_6);
  646|  58.1k|    _mm_storel_epi64((__m128i *) (pu1_out + out_strd4 + out_strd2 + out_strd), out_16x8b_7);
  647|       |
  648|  58.1k|    i4_nnz_b0 = (!(row_01_b0 && row_23_b0)) << 10;
  ------------------
  |  Branch (648:20): [True: 56.5k, False: 1.58k]
  |  Branch (648:33): [True: 56.1k, False: 378]
  ------------------
  649|  58.1k|    i4_nnz_b1 = (!(row_01_b1 && row_23_b1)) << 11;
  ------------------
  |  Branch (649:20): [True: 57.0k, False: 1.12k]
  |  Branch (649:33): [True: 56.2k, False: 800]
  ------------------
  650|  58.1k|    i4_nnz_b2 = (!(row_45_b2 && row_67_b2)) << 14;
  ------------------
  |  Branch (650:20): [True: 56.3k, False: 1.82k]
  |  Branch (650:33): [True: 56.3k, False: 13]
  ------------------
  651|  58.1k|    i4_nnz_b3 = (!(row_45_b3 && row_67_b3)) << 15;
  ------------------
  |  Branch (651:20): [True: 56.7k, False: 1.37k]
  |  Branch (651:33): [True: 56.3k, False: 450]
  ------------------
  652|       |
  653|  58.1k|    i4_nnz |= (i4_nnz_b0 | i4_nnz_b1 | i4_nnz_b2 | i4_nnz_b3);
  654|  58.1k|    return i4_nnz;
  655|  58.1k|}
isvcd_pred_residual_recon_chroma_4x4_sse42:
  681|  14.7k|{
  682|  14.7k|    __m128i src_r0, src_r1, src_r2, src_r3;
  683|  14.7k|    __m128i pred_r0, pred_r1, pred_r2, pred_r3;
  684|  14.7k|    __m128i pred0, pred1, pred2, pred3;
  685|  14.7k|    __m128i rsd_r0, rsd_r1, rsd_r2, rsd_r3;
  686|  14.7k|    __m128i zero_16x8b;  // all bits reset to zero
  687|  14.7k|    __m128i chroma_mask_even;
  688|  14.7k|    __m128i chroma_mask_odd;
  689|       |
  690|  14.7k|    zero_16x8b = _mm_setzero_si128();
  691|       |
  692|  14.7k|    rsd_r0 = _mm_loadu_si128((__m128i *) (pi2_rsd));
  693|  14.7k|    rsd_r1 = _mm_loadu_si128((__m128i *) (pi2_rsd + (1 * rsd_strd)));
  694|  14.7k|    rsd_r2 = _mm_loadu_si128((__m128i *) (pi2_rsd + (2 * rsd_strd)));
  695|  14.7k|    rsd_r3 = _mm_loadu_si128((__m128i *) (pi2_rsd + (3 * rsd_strd)));
  696|       |
  697|  14.7k|    pred_r0 = _mm_loadu_si128((__m128i *) (pu1_pred));
  698|  14.7k|    pred_r1 = _mm_loadu_si128((__m128i *) (pu1_pred + (1 * pred_strd)));
  699|  14.7k|    pred_r2 = _mm_loadu_si128((__m128i *) (pu1_pred + (2 * pred_strd)));
  700|  14.7k|    pred_r3 = _mm_loadu_si128((__m128i *) (pu1_pred + (3 * pred_strd)));
  701|       |
  702|  14.7k|    src_r0 = _mm_loadu_si128((__m128i *) (pu1_out));
  703|  14.7k|    src_r1 = _mm_loadu_si128((__m128i *) (pu1_out + (1 * out_strd)));
  704|  14.7k|    src_r2 = _mm_loadu_si128((__m128i *) (pu1_out + (2 * out_strd)));
  705|  14.7k|    src_r3 = _mm_loadu_si128((__m128i *) (pu1_out + (3 * out_strd)));
  706|       |
  707|  14.7k|    pred0 = _mm_cvtepu8_epi16(pred_r0);
  708|  14.7k|    pred1 = _mm_cvtepu8_epi16(pred_r1);
  709|  14.7k|    pred2 = _mm_cvtepu8_epi16(pred_r2);
  710|  14.7k|    pred3 = _mm_cvtepu8_epi16(pred_r3);
  711|       |
  712|  14.7k|    pred0 = _mm_add_epi16(pred0, rsd_r0);
  713|  14.7k|    pred1 = _mm_add_epi16(pred1, rsd_r1);
  714|  14.7k|    pred2 = _mm_add_epi16(pred2, rsd_r2);
  715|  14.7k|    pred3 = _mm_add_epi16(pred3, rsd_r3);
  716|       |
  717|  14.7k|    pred0 = _mm_packus_epi16(pred0, zero_16x8b);
  718|  14.7k|    pred1 = _mm_packus_epi16(pred1, zero_16x8b);
  719|  14.7k|    pred2 = _mm_packus_epi16(pred2, zero_16x8b);
  720|  14.7k|    pred3 = _mm_packus_epi16(pred3, zero_16x8b);
  721|       |
  722|  14.7k|    chroma_mask_even = _mm_set_epi8(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
  723|  14.7k|                                    0x00, 0xff, 0x00, 0xff, 0x00, 0xff);
  724|  14.7k|    chroma_mask_odd = _mm_set_epi8(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff,
  725|  14.7k|                                   0x00, 0xff, 0x00, 0xff, 0x00);
  726|       |
  727|  14.7k|    src_r0 = _mm_and_si128(src_r0, chroma_mask_odd);  // 0 src1 0 src2 0 ...
  728|  14.7k|    src_r1 = _mm_and_si128(src_r1, chroma_mask_odd);
  729|  14.7k|    src_r2 = _mm_and_si128(src_r2, chroma_mask_odd);
  730|  14.7k|    src_r3 = _mm_and_si128(src_r3, chroma_mask_odd);
  731|       |
  732|  14.7k|    pred0 = _mm_and_si128(pred0, chroma_mask_even);  // val 0 val 0 ..
  733|  14.7k|    pred1 = _mm_and_si128(pred1, chroma_mask_even);
  734|  14.7k|    pred2 = _mm_and_si128(pred2, chroma_mask_even);
  735|  14.7k|    pred3 = _mm_and_si128(pred3, chroma_mask_even);
  736|       |
  737|  14.7k|    src_r0 = _mm_add_epi8(src_r0, pred0);  // macro  src1 macro src2 macro ...
  738|  14.7k|    src_r1 = _mm_add_epi8(src_r1, pred1);
  739|  14.7k|    src_r2 = _mm_add_epi8(src_r2, pred2);
  740|  14.7k|    src_r3 = _mm_add_epi8(src_r3, pred3);
  741|       |
  742|  14.7k|    _mm_storel_epi64((__m128i *) (&pu1_out[0]), src_r0);
  743|  14.7k|    _mm_storel_epi64((__m128i *) (&pu1_out[out_strd]), src_r1);
  744|  14.7k|    _mm_storel_epi64((__m128i *) (&pu1_out[2 * out_strd]), src_r2);
  745|  14.7k|    _mm_storel_epi64((__m128i *) (&pu1_out[3 * out_strd]), src_r3);
  746|  14.7k|}
isvcd_pred_residual_recon_chroma_8x8_sse42:
  772|   127k|{
  773|   127k|    __m128i src_r0, src_r1, src_r2, src_r3, src_r4, src_r5, src_r6, src_r7;
  774|   127k|    __m128i pred0, pred1, pred2, pred3, pred4, pred5, pred6, pred7;
  775|   127k|    __m128i rsd_r0, rsd_r1, rsd_r2, rsd_r3, rsd_r4, rsd_r5, rsd_r6, rsd_r7;
  776|   127k|    __m128i zero_16x8b;  // all bits reset to zero
  777|   127k|    __m128i chroma_mask_even;
  778|   127k|    __m128i chroma_mask_odd;
  779|       |
  780|   127k|    zero_16x8b = _mm_setzero_si128();
  781|       |
  782|   127k|    rsd_r0 = _mm_loadu_si128((__m128i *) (pi2_rsd));
  783|   127k|    rsd_r1 = _mm_loadu_si128((__m128i *) (pi2_rsd + (1 * rsd_strd)));
  784|   127k|    rsd_r2 = _mm_loadu_si128((__m128i *) (pi2_rsd + (2 * rsd_strd)));
  785|   127k|    rsd_r3 = _mm_loadu_si128((__m128i *) (pi2_rsd + (3 * rsd_strd)));
  786|   127k|    rsd_r4 = _mm_loadu_si128((__m128i *) (pi2_rsd + (4 * rsd_strd)));
  787|   127k|    rsd_r5 = _mm_loadu_si128((__m128i *) (pi2_rsd + (5 * rsd_strd)));
  788|   127k|    rsd_r6 = _mm_loadu_si128((__m128i *) (pi2_rsd + (6 * rsd_strd)));
  789|   127k|    rsd_r7 = _mm_loadu_si128((__m128i *) (pi2_rsd + (7 * rsd_strd)));
  790|       |
  791|   127k|    pred0 = _mm_loadu_si128((__m128i *) (pu1_pred));
  792|   127k|    pred1 = _mm_loadu_si128((__m128i *) (pu1_pred + (1 * pred_strd)));
  793|   127k|    pred2 = _mm_loadu_si128((__m128i *) (pu1_pred + (2 * pred_strd)));
  794|   127k|    pred3 = _mm_loadu_si128((__m128i *) (pu1_pred + (3 * pred_strd)));
  795|   127k|    pred4 = _mm_loadu_si128((__m128i *) (pu1_pred + (4 * pred_strd)));
  796|   127k|    pred5 = _mm_loadu_si128((__m128i *) (pu1_pred + (5 * pred_strd)));
  797|   127k|    pred6 = _mm_loadu_si128((__m128i *) (pu1_pred + (6 * pred_strd)));
  798|   127k|    pred7 = _mm_loadu_si128((__m128i *) (pu1_pred + (7 * pred_strd)));
  799|       |
  800|   127k|    src_r0 = _mm_loadu_si128((__m128i *) (pu1_out));
  801|   127k|    src_r1 = _mm_loadu_si128((__m128i *) (pu1_out + (1 * out_strd)));
  802|   127k|    src_r2 = _mm_loadu_si128((__m128i *) (pu1_out + (2 * out_strd)));
  803|   127k|    src_r3 = _mm_loadu_si128((__m128i *) (pu1_out + (3 * out_strd)));
  804|   127k|    src_r4 = _mm_loadu_si128((__m128i *) (pu1_out + (4 * out_strd)));
  805|   127k|    src_r5 = _mm_loadu_si128((__m128i *) (pu1_out + (5 * out_strd)));
  806|   127k|    src_r6 = _mm_loadu_si128((__m128i *) (pu1_out + (6 * out_strd)));
  807|   127k|    src_r7 = _mm_loadu_si128((__m128i *) (pu1_out + (7 * out_strd)));
  808|       |
  809|   127k|    pred0 = _mm_cvtepu8_epi16(pred0);
  810|   127k|    pred1 = _mm_cvtepu8_epi16(pred1);
  811|   127k|    pred2 = _mm_cvtepu8_epi16(pred2);
  812|   127k|    pred3 = _mm_cvtepu8_epi16(pred3);
  813|   127k|    pred4 = _mm_cvtepu8_epi16(pred4);
  814|   127k|    pred5 = _mm_cvtepu8_epi16(pred5);
  815|   127k|    pred6 = _mm_cvtepu8_epi16(pred6);
  816|   127k|    pred7 = _mm_cvtepu8_epi16(pred7);
  817|       |
  818|   127k|    pred0 = _mm_add_epi16(pred0, rsd_r0);
  819|   127k|    pred1 = _mm_add_epi16(pred1, rsd_r1);
  820|   127k|    pred2 = _mm_add_epi16(pred2, rsd_r2);
  821|   127k|    pred3 = _mm_add_epi16(pred3, rsd_r3);
  822|   127k|    pred4 = _mm_add_epi16(pred4, rsd_r4);
  823|   127k|    pred5 = _mm_add_epi16(pred5, rsd_r5);
  824|   127k|    pred6 = _mm_add_epi16(pred6, rsd_r6);
  825|   127k|    pred7 = _mm_add_epi16(pred7, rsd_r7);
  826|       |
  827|   127k|    pred0 = _mm_packus_epi16(pred0, zero_16x8b);
  828|   127k|    pred1 = _mm_packus_epi16(pred1, zero_16x8b);
  829|   127k|    pred2 = _mm_packus_epi16(pred2, zero_16x8b);
  830|   127k|    pred3 = _mm_packus_epi16(pred3, zero_16x8b);
  831|   127k|    pred4 = _mm_packus_epi16(pred4, zero_16x8b);
  832|   127k|    pred5 = _mm_packus_epi16(pred5, zero_16x8b);
  833|   127k|    pred6 = _mm_packus_epi16(pred6, zero_16x8b);
  834|   127k|    pred7 = _mm_packus_epi16(pred7, zero_16x8b);
  835|       |
  836|   127k|    chroma_mask_even = _mm_set_epi8(0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
  837|   127k|                                    0x00, 0xff, 0x00, 0xff, 0x00, 0xff);
  838|   127k|    chroma_mask_odd = _mm_set_epi8(0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff, 0x00, 0xff,
  839|   127k|                                   0x00, 0xff, 0x00, 0xff, 0x00);
  840|       |
  841|   127k|    src_r0 = _mm_and_si128(src_r0, chroma_mask_odd);  // 0 src1 0 src2 0 ...
  842|   127k|    src_r1 = _mm_and_si128(src_r1, chroma_mask_odd);
  843|   127k|    src_r2 = _mm_and_si128(src_r2, chroma_mask_odd);
  844|   127k|    src_r3 = _mm_and_si128(src_r3, chroma_mask_odd);
  845|   127k|    src_r4 = _mm_and_si128(src_r4, chroma_mask_odd);
  846|   127k|    src_r5 = _mm_and_si128(src_r5, chroma_mask_odd);
  847|   127k|    src_r6 = _mm_and_si128(src_r6, chroma_mask_odd);
  848|   127k|    src_r7 = _mm_and_si128(src_r7, chroma_mask_odd);
  849|       |
  850|   127k|    pred0 = _mm_and_si128(pred0, chroma_mask_even);  // val 0 val 0 ..
  851|   127k|    pred1 = _mm_and_si128(pred1, chroma_mask_even);
  852|   127k|    pred2 = _mm_and_si128(pred2, chroma_mask_even);
  853|   127k|    pred3 = _mm_and_si128(pred3, chroma_mask_even);
  854|   127k|    pred4 = _mm_and_si128(pred4, chroma_mask_even);
  855|   127k|    pred5 = _mm_and_si128(pred5, chroma_mask_even);
  856|   127k|    pred6 = _mm_and_si128(pred6, chroma_mask_even);
  857|   127k|    pred7 = _mm_and_si128(pred7, chroma_mask_even);
  858|       |
  859|   127k|    src_r0 = _mm_add_epi8(src_r0, pred0);  // macro  src1 macro src2 macro ...
  860|   127k|    src_r1 = _mm_add_epi8(src_r1, pred1);
  861|   127k|    src_r2 = _mm_add_epi8(src_r2, pred2);
  862|   127k|    src_r3 = _mm_add_epi8(src_r3, pred3);
  863|   127k|    src_r4 = _mm_add_epi8(src_r4, pred4);
  864|   127k|    src_r5 = _mm_add_epi8(src_r5, pred5);
  865|   127k|    src_r6 = _mm_add_epi8(src_r6, pred6);
  866|   127k|    src_r7 = _mm_add_epi8(src_r7, pred7);
  867|       |
  868|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[0]), src_r0);
  869|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[out_strd]), src_r1);
  870|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[2 * out_strd]), src_r2);
  871|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[3 * out_strd]), src_r3);
  872|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[4 * out_strd]), src_r4);
  873|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[5 * out_strd]), src_r5);
  874|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[6 * out_strd]), src_r6);
  875|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[7 * out_strd]), src_r7);
  876|       |
  877|       |    /* load and repeat for the last 4 elements interleaved in the row */
  878|       |
  879|   127k|    rsd_r0 = _mm_loadu_si128((__m128i *) (pi2_rsd + 8));
  880|   127k|    rsd_r1 = _mm_loadu_si128((__m128i *) (pi2_rsd + (1 * rsd_strd) + 8));
  881|   127k|    rsd_r2 = _mm_loadu_si128((__m128i *) (pi2_rsd + (2 * rsd_strd) + 8));
  882|   127k|    rsd_r3 = _mm_loadu_si128((__m128i *) (pi2_rsd + (3 * rsd_strd) + 8));
  883|   127k|    rsd_r4 = _mm_loadu_si128((__m128i *) (pi2_rsd + (4 * rsd_strd) + 8));
  884|   127k|    rsd_r5 = _mm_loadu_si128((__m128i *) (pi2_rsd + (5 * rsd_strd) + 8));
  885|   127k|    rsd_r6 = _mm_loadu_si128((__m128i *) (pi2_rsd + (6 * rsd_strd) + 8));
  886|   127k|    rsd_r7 = _mm_loadu_si128((__m128i *) (pi2_rsd + (7 * rsd_strd) + 8));
  887|       |
  888|   127k|    pred0 = _mm_loadu_si128((__m128i *) (pu1_pred + 8));
  889|   127k|    pred1 = _mm_loadu_si128((__m128i *) (pu1_pred + (1 * pred_strd) + 8));
  890|   127k|    pred2 = _mm_loadu_si128((__m128i *) (pu1_pred + (2 * pred_strd) + 8));
  891|   127k|    pred3 = _mm_loadu_si128((__m128i *) (pu1_pred + (3 * pred_strd) + 8));
  892|   127k|    pred4 = _mm_loadu_si128((__m128i *) (pu1_pred + (4 * pred_strd) + 8));
  893|   127k|    pred5 = _mm_loadu_si128((__m128i *) (pu1_pred + (5 * pred_strd) + 8));
  894|   127k|    pred6 = _mm_loadu_si128((__m128i *) (pu1_pred + (6 * pred_strd) + 8));
  895|   127k|    pred7 = _mm_loadu_si128((__m128i *) (pu1_pred + (7 * pred_strd) + 8));
  896|       |
  897|   127k|    src_r0 = _mm_loadu_si128((__m128i *) (pu1_out + 8));
  898|   127k|    src_r1 = _mm_loadu_si128((__m128i *) (pu1_out + (1 * out_strd) + 8));
  899|   127k|    src_r2 = _mm_loadu_si128((__m128i *) (pu1_out + (2 * out_strd) + 8));
  900|   127k|    src_r3 = _mm_loadu_si128((__m128i *) (pu1_out + (3 * out_strd) + 8));
  901|   127k|    src_r4 = _mm_loadu_si128((__m128i *) (pu1_out + (4 * out_strd) + 8));
  902|   127k|    src_r5 = _mm_loadu_si128((__m128i *) (pu1_out + (5 * out_strd) + 8));
  903|   127k|    src_r6 = _mm_loadu_si128((__m128i *) (pu1_out + (6 * out_strd) + 8));
  904|   127k|    src_r7 = _mm_loadu_si128((__m128i *) (pu1_out + (7 * out_strd) + 8));
  905|       |
  906|   127k|    pred0 = _mm_cvtepu8_epi16(pred0);
  907|   127k|    pred1 = _mm_cvtepu8_epi16(pred1);
  908|   127k|    pred2 = _mm_cvtepu8_epi16(pred2);
  909|   127k|    pred3 = _mm_cvtepu8_epi16(pred3);
  910|   127k|    pred4 = _mm_cvtepu8_epi16(pred4);
  911|   127k|    pred5 = _mm_cvtepu8_epi16(pred5);
  912|   127k|    pred6 = _mm_cvtepu8_epi16(pred6);
  913|   127k|    pred7 = _mm_cvtepu8_epi16(pred7);
  914|       |
  915|   127k|    pred0 = _mm_add_epi16(pred0, rsd_r0);
  916|   127k|    pred1 = _mm_add_epi16(pred1, rsd_r1);
  917|   127k|    pred2 = _mm_add_epi16(pred2, rsd_r2);
  918|   127k|    pred3 = _mm_add_epi16(pred3, rsd_r3);
  919|   127k|    pred4 = _mm_add_epi16(pred4, rsd_r4);
  920|   127k|    pred5 = _mm_add_epi16(pred5, rsd_r5);
  921|   127k|    pred6 = _mm_add_epi16(pred6, rsd_r6);
  922|   127k|    pred7 = _mm_add_epi16(pred7, rsd_r7);
  923|       |
  924|   127k|    pred0 = _mm_packus_epi16(pred0, zero_16x8b);
  925|   127k|    pred1 = _mm_packus_epi16(pred1, zero_16x8b);
  926|   127k|    pred2 = _mm_packus_epi16(pred2, zero_16x8b);
  927|   127k|    pred3 = _mm_packus_epi16(pred3, zero_16x8b);
  928|   127k|    pred4 = _mm_packus_epi16(pred4, zero_16x8b);
  929|   127k|    pred5 = _mm_packus_epi16(pred5, zero_16x8b);
  930|   127k|    pred6 = _mm_packus_epi16(pred6, zero_16x8b);
  931|   127k|    pred7 = _mm_packus_epi16(pred7, zero_16x8b);
  932|       |
  933|   127k|    src_r0 = _mm_and_si128(src_r0, chroma_mask_odd);  // 0 src1 0 src2 0 ...
  934|   127k|    src_r1 = _mm_and_si128(src_r1, chroma_mask_odd);
  935|   127k|    src_r2 = _mm_and_si128(src_r2, chroma_mask_odd);
  936|   127k|    src_r3 = _mm_and_si128(src_r3, chroma_mask_odd);
  937|   127k|    src_r4 = _mm_and_si128(src_r4, chroma_mask_odd);
  938|   127k|    src_r5 = _mm_and_si128(src_r5, chroma_mask_odd);
  939|   127k|    src_r6 = _mm_and_si128(src_r6, chroma_mask_odd);
  940|   127k|    src_r7 = _mm_and_si128(src_r7, chroma_mask_odd);
  941|       |
  942|   127k|    pred0 = _mm_and_si128(pred0, chroma_mask_even);  // val 0 val 0 ..
  943|   127k|    pred1 = _mm_and_si128(pred1, chroma_mask_even);
  944|   127k|    pred2 = _mm_and_si128(pred2, chroma_mask_even);
  945|   127k|    pred3 = _mm_and_si128(pred3, chroma_mask_even);
  946|   127k|    pred4 = _mm_and_si128(pred4, chroma_mask_even);
  947|   127k|    pred5 = _mm_and_si128(pred5, chroma_mask_even);
  948|   127k|    pred6 = _mm_and_si128(pred6, chroma_mask_even);
  949|   127k|    pred7 = _mm_and_si128(pred7, chroma_mask_even);
  950|       |
  951|   127k|    src_r0 = _mm_add_epi8(src_r0, pred0);  // macro  src1 macro src2 macro ...
  952|   127k|    src_r1 = _mm_add_epi8(src_r1, pred1);
  953|   127k|    src_r2 = _mm_add_epi8(src_r2, pred2);
  954|   127k|    src_r3 = _mm_add_epi8(src_r3, pred3);
  955|   127k|    src_r4 = _mm_add_epi8(src_r4, pred4);
  956|   127k|    src_r5 = _mm_add_epi8(src_r5, pred5);
  957|   127k|    src_r6 = _mm_add_epi8(src_r6, pred6);
  958|   127k|    src_r7 = _mm_add_epi8(src_r7, pred7);
  959|       |
  960|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[0] + 8), src_r0);
  961|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[out_strd] + 8), src_r1);
  962|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[(2 * out_strd)] + 8), src_r2);
  963|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[(3 * out_strd)] + 8), src_r3);
  964|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[(4 * out_strd)] + 8), src_r4);
  965|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[(5 * out_strd)] + 8), src_r5);
  966|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[(6 * out_strd)] + 8), src_r6);
  967|   127k|    _mm_storel_epi64((__m128i *) (&pu1_out[(7 * out_strd)] + 8), src_r7);
  968|   127k|}

isvcd_residual_luma_dyadic_sse42:
   75|  21.7k|{
   76|  21.7k|    WORD16 *pi2_refarray_buffer;
   77|  21.7k|    WORD32 i4_blk_ctr;
   78|  21.7k|    residual_sampling_ctxt_t *ps_ctxt;
   79|       |
   80|  21.7k|    UNUSED(ps_ref_mb_mode);
  ------------------
  |  |   45|  21.7k|#define UNUSED(x) ((void)(x))
  ------------------
   81|  21.7k|    UNUSED(u2_mb_x);
  ------------------
  |  |   45|  21.7k|#define UNUSED(x) ((void)(x))
  ------------------
   82|  21.7k|    UNUSED(u2_mb_y);
  ------------------
  |  |   45|  21.7k|#define UNUSED(x) ((void)(x))
  ------------------
   83|       |
   84|  21.7k|    ps_ctxt = (residual_sampling_ctxt_t *) pv_residual_samp_ctxt;
   85|  21.7k|    pi2_refarray_buffer = ps_ctxt->pi2_refarray_buffer;
   86|       |
   87|       |    /* based on transform size the counter and interpolation width and */
   88|       |    /* height are intialised as follows                                */
   89|       |
   90|  21.7k|    if((i4_ref_tx_size) && (0 != i4_ref_nnz))
  ------------------
  |  Branch (90:8): [True: 738, False: 20.9k]
  |  Branch (90:28): [True: 482, False: 256]
  ------------------
   91|    482|    {
   92|    482|        WORD16 *pi2_ref_data_byte;
   93|    482|        WORD32 i4_i, i4_j;
   94|    482|        WORD16 *pi2_refarray_buffer_tmp = pi2_refarray_buffer;
   95|       |
   96|    482|        __m128i i2_coeff_8x16b_r1_0, i2_coeff_8x16b_r1_1;
   97|    482|        __m128i res_8x16b_r1_0, res_8x16b_r1_1;
   98|    482|        __m128i final_res_8x16b_r1_0, final_res_8x16b_r1_1;
   99|       |
  100|    482|        __m128i coeff_add_8x16b_r1;
  101|       |
  102|    482|        __m128i coeff_add_8x16b_r2;
  103|    482|        __m128i i2_coeff_8x16b_r2_0, i2_coeff_8x16b_r2_1;
  104|    482|        __m128i res_8x16b_r2_0, res_8x16b_r2_1;
  105|    482|        __m128i final_res_8x16b_r2_0, final_res_8x16b_r2_1;
  106|       |
  107|    482|        pi2_ref_data_byte = pi2_inp_data;
  108|       |
  109|       |        /* ----------- Horizontal Interpolation ---------------- */
  110|  2.41k|        for(i4_i = 0; i4_i < BLOCK_HEIGHT; i4_i += 2)
  ------------------
  |  |   65|  2.41k|#define BLOCK_HEIGHT 8
  ------------------
  |  Branch (110:23): [True: 1.92k, False: 482]
  ------------------
  111|  1.92k|        {
  112|  1.92k|            i2_coeff_8x16b_r1_0 =
  113|  1.92k|                _mm_loadu_si128((__m128i *) pi2_ref_data_byte);         // a0 a1 a2 a3 a4 a5 a6 a7
  114|  1.92k|            i2_coeff_8x16b_r2_0 = _mm_loadu_si128(
  115|  1.92k|                (__m128i *) (pi2_ref_data_byte + i4_inp_data_stride));  // b0 b1 b2 b3 b4 b5 b6 b7
  116|       |
  117|  1.92k|            i2_coeff_8x16b_r1_1 = _mm_srli_si128(i2_coeff_8x16b_r1_0, 2);  // a1 a2 a3 a4 a5 a6 a7 0
  118|  1.92k|            i2_coeff_8x16b_r2_1 = _mm_srli_si128(i2_coeff_8x16b_r2_0, 2);  // b1 b2 b3 b4 b5 b6 b7 0
  119|       |
  120|  1.92k|            coeff_add_8x16b_r1 = _mm_add_epi16(i2_coeff_8x16b_r1_0, i2_coeff_8x16b_r1_1);
  121|  1.92k|            coeff_add_8x16b_r2 = _mm_add_epi16(i2_coeff_8x16b_r2_0, i2_coeff_8x16b_r2_1);
  122|       |
  123|  1.92k|            i2_coeff_8x16b_r1_0 = _mm_slli_epi16(i2_coeff_8x16b_r1_0, 1);
  124|  1.92k|            i2_coeff_8x16b_r2_0 = _mm_slli_epi16(i2_coeff_8x16b_r2_0, 1);
  125|       |
  126|  1.92k|            i2_coeff_8x16b_r1_1 = _mm_slli_epi16(i2_coeff_8x16b_r1_1, 1);
  127|  1.92k|            i2_coeff_8x16b_r2_1 = _mm_slli_epi16(i2_coeff_8x16b_r2_1, 1);
  128|       |
  129|  1.92k|            res_8x16b_r1_0 = _mm_add_epi16(i2_coeff_8x16b_r1_0, coeff_add_8x16b_r1);
  130|  1.92k|            res_8x16b_r2_0 = _mm_add_epi16(i2_coeff_8x16b_r2_0, coeff_add_8x16b_r2);
  131|       |
  132|  1.92k|            res_8x16b_r1_1 = _mm_add_epi16(i2_coeff_8x16b_r1_1, coeff_add_8x16b_r1);
  133|  1.92k|            res_8x16b_r2_1 = _mm_add_epi16(i2_coeff_8x16b_r2_1, coeff_add_8x16b_r2);
  134|       |
  135|  1.92k|            final_res_8x16b_r1_0 = _mm_unpacklo_epi16(res_8x16b_r1_0, res_8x16b_r1_1);
  136|  1.92k|            final_res_8x16b_r2_0 = _mm_unpacklo_epi16(res_8x16b_r2_0, res_8x16b_r2_1);
  137|       |
  138|  1.92k|            final_res_8x16b_r1_1 = _mm_unpackhi_epi16(res_8x16b_r1_0, res_8x16b_r1_1);
  139|  1.92k|            final_res_8x16b_r2_1 = _mm_unpackhi_epi16(res_8x16b_r2_0, res_8x16b_r2_1);
  140|       |
  141|  1.92k|            _mm_storeu_si128((__m128i *) (pi2_refarray_buffer + 1), final_res_8x16b_r1_0);
  142|  1.92k|            _mm_storeu_si128((__m128i *) (pi2_refarray_buffer + 9), final_res_8x16b_r1_1);
  143|       |
  144|  1.92k|            _mm_storeu_si128((__m128i *) (pi2_refarray_buffer + 17), final_res_8x16b_r2_0);
  145|  1.92k|            _mm_storeu_si128((__m128i *) (pi2_refarray_buffer + 25), final_res_8x16b_r2_1);
  146|       |
  147|  1.92k|            pi2_refarray_buffer[0] = (pi2_ref_data_byte[0] << 2);
  148|  1.92k|            pi2_refarray_buffer[15] = (pi2_ref_data_byte[7] << 2);
  149|  1.92k|            pi2_ref_data_byte += i4_inp_data_stride;
  150|  1.92k|            pi2_refarray_buffer[16] = (pi2_ref_data_byte[0] << 2);
  151|  1.92k|            pi2_refarray_buffer[31] = (pi2_ref_data_byte[7] << 2);
  152|       |
  153|       |            /* vertical loop uopdates */
  154|  1.92k|            pi2_ref_data_byte = pi2_inp_data + ((i4_i + 2) * i4_inp_data_stride);
  155|  1.92k|            pi2_refarray_buffer += 32;
  156|  1.92k|        }
  157|       |
  158|       |        /* ----------- Vertical Interpolation ---------------- */
  159|    482|        pi2_refarray_buffer = pi2_refarray_buffer_tmp;
  160|       |
  161|    482|        {
  162|    482|            __m128i i4_horz_samp_4x32b_r1_1, i4_horz_samp_4x32b_r1_2, i4_horz_samp_4x32b_r1_3,
  163|    482|                i4_horz_samp_4x32b_r1_4;
  164|    482|            __m128i i4_horz_samp_4x32b_r2_1, i4_horz_samp_4x32b_r2_2, i4_horz_samp_4x32b_r2_3,
  165|    482|                i4_horz_samp_4x32b_r2_4;
  166|    482|            __m128i i4_res_samp_4x32b_r1_1, i4_res_samp_4x32b_r1_2, i4_res_samp_4x32b_r1_3,
  167|    482|                i4_res_samp_4x32b_r1_4;
  168|    482|            __m128i i4_res_samp_4x32b_r2_1, i4_res_samp_4x32b_r2_2, i4_res_samp_4x32b_r2_3,
  169|    482|                i4_res_samp_4x32b_r2_4;
  170|    482|            __m128i horz_add_4x32b_r2_1, horz_add_4x32b_r2_2, horz_add_4x32b_r2_3,
  171|    482|                horz_add_4x32b_r2_4;
  172|       |
  173|    482|            __m128i i4_horz_samp_8x16b_r1_1, i4_horz_samp_8x16b_r2_1;
  174|    482|            __m128i i4_horz_samp_8x16b_r1_2, i4_horz_samp_8x16b_r2_2;
  175|    482|            __m128i i4_horz_samp_8x16b_r1_3, i4_horz_samp_8x16b_r2_3;
  176|    482|            __m128i i4_horz_samp_8x16b_r1_4, i4_horz_samp_8x16b_r2_4;
  177|       |
  178|    482|            __m128i twos = _mm_set1_epi32(2);
  179|    482|            __m128i eights = _mm_set1_epi32(8);
  180|       |
  181|    482|            WORD16 *pi2_out;
  182|       |
  183|    482|            pi2_out = pi2_out_res;
  184|       |
  185|    482|            i4_horz_samp_8x16b_r1_1 = _mm_loadu_si128((__m128i *) (pi2_refarray_buffer));
  186|    482|            i4_horz_samp_8x16b_r1_2 = _mm_loadu_si128((__m128i *) (pi2_refarray_buffer + 4));
  187|    482|            i4_horz_samp_8x16b_r1_3 = _mm_loadu_si128((__m128i *) (pi2_refarray_buffer + 8));
  188|    482|            i4_horz_samp_8x16b_r1_4 = _mm_loadu_si128((__m128i *) (pi2_refarray_buffer + 12));
  189|       |
  190|    482|            i4_horz_samp_4x32b_r1_1 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r1_1);
  191|    482|            i4_horz_samp_4x32b_r1_2 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r1_2);
  192|    482|            i4_horz_samp_4x32b_r1_3 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r1_3);
  193|    482|            i4_horz_samp_4x32b_r1_4 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r1_4);
  194|       |
  195|       |            /* populate the first inter sample */
  196|    482|            i4_res_samp_4x32b_r1_1 =
  197|    482|                _mm_srai_epi32(_mm_add_epi32(i4_horz_samp_4x32b_r1_1, twos), 2);
  198|    482|            i4_res_samp_4x32b_r1_2 =
  199|    482|                _mm_srai_epi32(_mm_add_epi32(i4_horz_samp_4x32b_r1_2, twos), 2);
  200|    482|            i4_res_samp_4x32b_r1_3 =
  201|    482|                _mm_srai_epi32(_mm_add_epi32(i4_horz_samp_4x32b_r1_3, twos), 2);
  202|    482|            i4_res_samp_4x32b_r1_4 =
  203|    482|                _mm_srai_epi32(_mm_add_epi32(i4_horz_samp_4x32b_r1_4, twos), 2);
  204|       |
  205|    482|            _mm_storeu_si128((__m128i *) pi2_out,
  206|    482|                             _mm_packs_epi32(i4_res_samp_4x32b_r1_1, i4_res_samp_4x32b_r1_2));
  207|    482|            _mm_storeu_si128((__m128i *) (pi2_out + 8),
  208|    482|                             _mm_packs_epi32(i4_res_samp_4x32b_r1_3, i4_res_samp_4x32b_r1_4));
  209|    482|            pi2_out += i4_out_res_stride;
  210|       |
  211|  3.85k|            for(i4_j = 0; i4_j < 14; i4_j += 2)
  ------------------
  |  Branch (211:27): [True: 3.37k, False: 482]
  ------------------
  212|  3.37k|            {
  213|  3.37k|                pi2_refarray_buffer += MB_WIDTH;
  ------------------
  |  |   67|  3.37k|#define MB_WIDTH 16
  ------------------
  214|       |
  215|  3.37k|                i4_horz_samp_8x16b_r2_1 = _mm_loadu_si128((__m128i *) (pi2_refarray_buffer));
  216|  3.37k|                i4_horz_samp_8x16b_r2_2 = _mm_loadu_si128((__m128i *) (pi2_refarray_buffer + 4));
  217|  3.37k|                i4_horz_samp_8x16b_r2_3 = _mm_loadu_si128((__m128i *) (pi2_refarray_buffer + 8));
  218|  3.37k|                i4_horz_samp_8x16b_r2_4 = _mm_loadu_si128((__m128i *) (pi2_refarray_buffer + 12));
  219|       |
  220|  3.37k|                i4_horz_samp_4x32b_r2_1 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r2_1);
  221|  3.37k|                i4_horz_samp_4x32b_r2_2 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r2_2);
  222|  3.37k|                i4_horz_samp_4x32b_r2_3 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r2_3);
  223|  3.37k|                i4_horz_samp_4x32b_r2_4 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r2_4);
  224|       |
  225|  3.37k|                horz_add_4x32b_r2_1 =
  226|  3.37k|                    _mm_add_epi32(i4_horz_samp_4x32b_r1_1, i4_horz_samp_4x32b_r2_1);
  227|  3.37k|                horz_add_4x32b_r2_2 =
  228|  3.37k|                    _mm_add_epi32(i4_horz_samp_4x32b_r1_2, i4_horz_samp_4x32b_r2_2);
  229|  3.37k|                horz_add_4x32b_r2_3 =
  230|  3.37k|                    _mm_add_epi32(i4_horz_samp_4x32b_r1_3, i4_horz_samp_4x32b_r2_3);
  231|  3.37k|                horz_add_4x32b_r2_4 =
  232|  3.37k|                    _mm_add_epi32(i4_horz_samp_4x32b_r1_4, i4_horz_samp_4x32b_r2_4);
  233|       |
  234|  3.37k|                i4_res_samp_4x32b_r1_1 =
  235|  3.37k|                    _mm_add_epi32(_mm_slli_epi32(i4_horz_samp_4x32b_r1_1, 1), horz_add_4x32b_r2_1);
  236|  3.37k|                i4_res_samp_4x32b_r1_2 =
  237|  3.37k|                    _mm_add_epi32(_mm_slli_epi32(i4_horz_samp_4x32b_r1_2, 1), horz_add_4x32b_r2_2);
  238|  3.37k|                i4_res_samp_4x32b_r1_3 =
  239|  3.37k|                    _mm_add_epi32(_mm_slli_epi32(i4_horz_samp_4x32b_r1_3, 1), horz_add_4x32b_r2_3);
  240|  3.37k|                i4_res_samp_4x32b_r1_4 =
  241|  3.37k|                    _mm_add_epi32(_mm_slli_epi32(i4_horz_samp_4x32b_r1_4, 1), horz_add_4x32b_r2_4);
  242|       |
  243|  3.37k|                i4_res_samp_4x32b_r2_1 =
  244|  3.37k|                    _mm_add_epi32(_mm_slli_epi32(i4_horz_samp_4x32b_r2_1, 1), horz_add_4x32b_r2_1);
  245|  3.37k|                i4_res_samp_4x32b_r2_2 =
  246|  3.37k|                    _mm_add_epi32(_mm_slli_epi32(i4_horz_samp_4x32b_r2_2, 1), horz_add_4x32b_r2_2);
  247|  3.37k|                i4_res_samp_4x32b_r2_3 =
  248|  3.37k|                    _mm_add_epi32(_mm_slli_epi32(i4_horz_samp_4x32b_r2_3, 1), horz_add_4x32b_r2_3);
  249|  3.37k|                i4_res_samp_4x32b_r2_4 =
  250|  3.37k|                    _mm_add_epi32(_mm_slli_epi32(i4_horz_samp_4x32b_r2_4, 1), horz_add_4x32b_r2_4);
  251|       |
  252|  3.37k|                i4_res_samp_4x32b_r1_1 =
  253|  3.37k|                    _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r1_1, eights), 4);
  254|  3.37k|                i4_res_samp_4x32b_r1_2 =
  255|  3.37k|                    _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r1_2, eights), 4);
  256|  3.37k|                i4_res_samp_4x32b_r1_3 =
  257|  3.37k|                    _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r1_3, eights), 4);
  258|  3.37k|                i4_res_samp_4x32b_r1_4 =
  259|  3.37k|                    _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r1_4, eights), 4);
  260|       |
  261|  3.37k|                i4_res_samp_4x32b_r2_1 =
  262|  3.37k|                    _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r2_1, eights), 4);
  263|  3.37k|                i4_res_samp_4x32b_r2_2 =
  264|  3.37k|                    _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r2_2, eights), 4);
  265|  3.37k|                i4_res_samp_4x32b_r2_3 =
  266|  3.37k|                    _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r2_3, eights), 4);
  267|  3.37k|                i4_res_samp_4x32b_r2_4 =
  268|  3.37k|                    _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r2_4, eights), 4);
  269|       |
  270|       |                /* populate 2 samples based on current coeffs */
  271|  3.37k|                _mm_storeu_si128((__m128i *) pi2_out,
  272|  3.37k|                                 _mm_packs_epi32(i4_res_samp_4x32b_r1_1, i4_res_samp_4x32b_r1_2));
  273|  3.37k|                _mm_storeu_si128((__m128i *) (pi2_out + 8),
  274|  3.37k|                                 _mm_packs_epi32(i4_res_samp_4x32b_r1_3, i4_res_samp_4x32b_r1_4));
  275|  3.37k|                pi2_out += i4_out_res_stride;
  276|       |
  277|  3.37k|                _mm_storeu_si128((__m128i *) pi2_out,
  278|  3.37k|                                 _mm_packs_epi32(i4_res_samp_4x32b_r2_1, i4_res_samp_4x32b_r2_2));
  279|  3.37k|                _mm_storeu_si128((__m128i *) (pi2_out + 8),
  280|  3.37k|                                 _mm_packs_epi32(i4_res_samp_4x32b_r2_3, i4_res_samp_4x32b_r2_4));
  281|  3.37k|                pi2_out += i4_out_res_stride;
  282|       |
  283|       |                /* store the coeff 2 to coeff 1 */
  284|       |                /* (used in next iteration)     */
  285|  3.37k|                i4_horz_samp_4x32b_r1_1 = i4_horz_samp_4x32b_r2_1;
  286|  3.37k|                i4_horz_samp_4x32b_r1_2 = i4_horz_samp_4x32b_r2_2;
  287|  3.37k|                i4_horz_samp_4x32b_r1_3 = i4_horz_samp_4x32b_r2_3;
  288|  3.37k|                i4_horz_samp_4x32b_r1_4 = i4_horz_samp_4x32b_r2_4;
  289|  3.37k|            }
  290|       |
  291|    482|            i4_res_samp_4x32b_r1_1 =
  292|    482|                _mm_srai_epi32(_mm_add_epi32(i4_horz_samp_4x32b_r1_1, twos), 2);
  293|    482|            i4_res_samp_4x32b_r1_2 =
  294|    482|                _mm_srai_epi32(_mm_add_epi32(i4_horz_samp_4x32b_r1_2, twos), 2);
  295|    482|            i4_res_samp_4x32b_r1_3 =
  296|    482|                _mm_srai_epi32(_mm_add_epi32(i4_horz_samp_4x32b_r1_3, twos), 2);
  297|    482|            i4_res_samp_4x32b_r1_4 =
  298|    482|                _mm_srai_epi32(_mm_add_epi32(i4_horz_samp_4x32b_r1_4, twos), 2);
  299|       |
  300|    482|            _mm_storeu_si128((__m128i *) pi2_out,
  301|    482|                             _mm_packs_epi32(i4_res_samp_4x32b_r1_1, i4_res_samp_4x32b_r1_2));
  302|    482|            _mm_storeu_si128((__m128i *) (pi2_out + 8),
  303|    482|                             _mm_packs_epi32(i4_res_samp_4x32b_r1_3, i4_res_samp_4x32b_r1_4));
  304|    482|        }
  305|    482|    }
  306|  21.2k|    else
  307|  21.2k|    {
  308|       |        /* ----------------------------------------------------------------- */
  309|       |        /* LOOP over number of blocks                                        */
  310|       |        /* ----------------------------------------------------------------- */
  311|   106k|        for(i4_blk_ctr = 0; i4_blk_ctr < 4; i4_blk_ctr++)
  ------------------
  |  Branch (311:29): [True: 84.9k, False: 21.2k]
  ------------------
  312|  84.9k|        {
  313|       |            /* if reference layer is not coded then no processing */
  314|  84.9k|            if(0 != (i4_ref_nnz & 0x1))
  ------------------
  |  Branch (314:16): [True: 5.35k, False: 79.6k]
  ------------------
  315|  5.35k|            {
  316|  5.35k|                __m128i i2_coeff_8x16b_r1_0, i2_coeff_8x16b_r1_1;
  317|  5.35k|                __m128i i2_coeff_8x16b_r2_0, i2_coeff_8x16b_r2_1;
  318|  5.35k|                __m128i i2_coeff_8x16b_r3_0, i2_coeff_8x16b_r3_1;
  319|  5.35k|                __m128i i2_coeff_8x16b_r4_0, i2_coeff_8x16b_r4_1;
  320|       |
  321|  5.35k|                __m128i res_8x16b_r1_0, res_8x16b_r1_1;
  322|  5.35k|                __m128i res_8x16b_r2_0, res_8x16b_r2_1;
  323|  5.35k|                __m128i res_8x16b_r3_0, res_8x16b_r3_1;
  324|  5.35k|                __m128i res_8x16b_r4_0, res_8x16b_r4_1;
  325|  5.35k|                __m128i final_res_8x16b_r1_0;
  326|  5.35k|                __m128i final_res_8x16b_r2_0;
  327|  5.35k|                __m128i final_res_8x16b_r3_0;
  328|  5.35k|                __m128i final_res_8x16b_r4_0;
  329|       |
  330|  5.35k|                __m128i coeff_add_8x16b_r1;
  331|  5.35k|                __m128i coeff_add_8x16b_r2;
  332|  5.35k|                __m128i coeff_add_8x16b_r3;
  333|  5.35k|                __m128i coeff_add_8x16b_r4;
  334|       |
  335|       |                /* ----------- Horizontal Interpolation ---------------- */
  336|       |
  337|  5.35k|                i2_coeff_8x16b_r1_0 =
  338|  5.35k|                    _mm_loadu_si128((__m128i *) pi2_inp_data);         // a0 a1 a2 a3 a4 a5 a6 a7
  339|  5.35k|                i2_coeff_8x16b_r2_0 = _mm_loadu_si128(
  340|  5.35k|                    (__m128i *) (pi2_inp_data + i4_inp_data_stride));  // b0 b1 b2 b3 b4 b5 b6 b7
  341|  5.35k|                i2_coeff_8x16b_r3_0 =
  342|  5.35k|                    _mm_loadu_si128((__m128i *) (pi2_inp_data + (i4_inp_data_stride << 1)));
  343|  5.35k|                i2_coeff_8x16b_r4_0 =
  344|  5.35k|                    _mm_loadu_si128((__m128i *) (pi2_inp_data + (i4_inp_data_stride * 3)));
  345|       |
  346|  5.35k|                i2_coeff_8x16b_r1_1 = _mm_srli_si128(i2_coeff_8x16b_r1_0,
  347|  5.35k|                                                     2);  // a1 a2 a3 a4 a5 a6 a7 0
  348|  5.35k|                i2_coeff_8x16b_r2_1 = _mm_srli_si128(i2_coeff_8x16b_r2_0,
  349|  5.35k|                                                     2);  // b1 b2 b3 b4 b5 b6 b7 0
  350|  5.35k|                i2_coeff_8x16b_r3_1 = _mm_srli_si128(i2_coeff_8x16b_r3_0, 2);
  351|  5.35k|                i2_coeff_8x16b_r4_1 = _mm_srli_si128(i2_coeff_8x16b_r4_0, 2);
  352|       |
  353|  5.35k|                coeff_add_8x16b_r1 = _mm_add_epi16(i2_coeff_8x16b_r1_0, i2_coeff_8x16b_r1_1);
  354|  5.35k|                coeff_add_8x16b_r2 = _mm_add_epi16(i2_coeff_8x16b_r2_0, i2_coeff_8x16b_r2_1);
  355|  5.35k|                coeff_add_8x16b_r3 = _mm_add_epi16(i2_coeff_8x16b_r3_0, i2_coeff_8x16b_r3_1);
  356|  5.35k|                coeff_add_8x16b_r4 = _mm_add_epi16(i2_coeff_8x16b_r4_0, i2_coeff_8x16b_r4_1);
  357|       |
  358|  5.35k|                i2_coeff_8x16b_r1_0 = _mm_slli_epi16(i2_coeff_8x16b_r1_0, 1);
  359|  5.35k|                i2_coeff_8x16b_r2_0 = _mm_slli_epi16(i2_coeff_8x16b_r2_0, 1);
  360|  5.35k|                i2_coeff_8x16b_r3_0 = _mm_slli_epi16(i2_coeff_8x16b_r3_0, 1);
  361|  5.35k|                i2_coeff_8x16b_r4_0 = _mm_slli_epi16(i2_coeff_8x16b_r4_0, 1);
  362|       |
  363|  5.35k|                i2_coeff_8x16b_r1_1 = _mm_slli_epi16(i2_coeff_8x16b_r1_1, 1);
  364|  5.35k|                i2_coeff_8x16b_r2_1 = _mm_slli_epi16(i2_coeff_8x16b_r2_1, 1);
  365|  5.35k|                i2_coeff_8x16b_r3_1 = _mm_slli_epi16(i2_coeff_8x16b_r3_1, 1);
  366|  5.35k|                i2_coeff_8x16b_r4_1 = _mm_slli_epi16(i2_coeff_8x16b_r4_1, 1);
  367|       |
  368|  5.35k|                res_8x16b_r1_0 = _mm_add_epi16(i2_coeff_8x16b_r1_0, coeff_add_8x16b_r1);
  369|  5.35k|                res_8x16b_r2_0 = _mm_add_epi16(i2_coeff_8x16b_r2_0, coeff_add_8x16b_r2);
  370|  5.35k|                res_8x16b_r3_0 = _mm_add_epi16(i2_coeff_8x16b_r3_0, coeff_add_8x16b_r3);
  371|  5.35k|                res_8x16b_r4_0 = _mm_add_epi16(i2_coeff_8x16b_r4_0, coeff_add_8x16b_r4);
  372|       |
  373|  5.35k|                res_8x16b_r1_1 = _mm_add_epi16(i2_coeff_8x16b_r1_1, coeff_add_8x16b_r1);
  374|  5.35k|                res_8x16b_r2_1 = _mm_add_epi16(i2_coeff_8x16b_r2_1, coeff_add_8x16b_r2);
  375|  5.35k|                res_8x16b_r3_1 = _mm_add_epi16(i2_coeff_8x16b_r3_1, coeff_add_8x16b_r3);
  376|  5.35k|                res_8x16b_r4_1 = _mm_add_epi16(i2_coeff_8x16b_r4_1, coeff_add_8x16b_r4);
  377|       |
  378|  5.35k|                final_res_8x16b_r1_0 = _mm_unpacklo_epi16(res_8x16b_r1_0, res_8x16b_r1_1);
  379|  5.35k|                final_res_8x16b_r2_0 = _mm_unpacklo_epi16(res_8x16b_r2_0, res_8x16b_r2_1);
  380|  5.35k|                final_res_8x16b_r3_0 = _mm_unpacklo_epi16(res_8x16b_r3_0, res_8x16b_r3_1);
  381|  5.35k|                final_res_8x16b_r4_0 = _mm_unpacklo_epi16(res_8x16b_r4_0, res_8x16b_r4_1);
  382|       |
  383|  5.35k|                _mm_storeu_si128((__m128i *) (pi2_refarray_buffer + 1), final_res_8x16b_r1_0);
  384|  5.35k|                _mm_storeu_si128((__m128i *) (pi2_refarray_buffer + 9), final_res_8x16b_r2_0);
  385|  5.35k|                _mm_storeu_si128((__m128i *) (pi2_refarray_buffer + 17), final_res_8x16b_r3_0);
  386|  5.35k|                _mm_storeu_si128((__m128i *) (pi2_refarray_buffer + 25), final_res_8x16b_r4_0);
  387|       |
  388|  5.35k|                pi2_refarray_buffer[0] = (pi2_inp_data[0] << 2);
  389|  5.35k|                pi2_refarray_buffer[7] = (pi2_inp_data[3] << 2);
  390|  5.35k|                pi2_refarray_buffer[8] = (pi2_inp_data[i4_inp_data_stride] << 2);
  391|  5.35k|                pi2_refarray_buffer[15] = (pi2_inp_data[i4_inp_data_stride + 3] << 2);
  392|  5.35k|                pi2_refarray_buffer[16] = (pi2_inp_data[(i4_inp_data_stride << 1)] << 2);
  393|  5.35k|                pi2_refarray_buffer[23] = (pi2_inp_data[(i4_inp_data_stride << 1) + 3] << 2);
  394|  5.35k|                pi2_refarray_buffer[24] = (pi2_inp_data[(i4_inp_data_stride * 3)] << 2);
  395|  5.35k|                pi2_refarray_buffer[31] = (pi2_inp_data[(i4_inp_data_stride * 3) + 3] << 2);
  396|       |
  397|       |                /* ----------- Vertical Interpolation ---------------- */
  398|  5.35k|                {
  399|  5.35k|                    __m128i i4_horz_samp_8x16b_r0_1, i4_horz_samp_8x16b_r0_2;
  400|  5.35k|                    __m128i i4_horz_samp_8x16b_r1_1, i4_horz_samp_8x16b_r1_2;
  401|  5.35k|                    __m128i i4_horz_samp_8x16b_r2_1, i4_horz_samp_8x16b_r2_2;
  402|  5.35k|                    __m128i i4_horz_samp_8x16b_r3_1, i4_horz_samp_8x16b_r3_2;
  403|       |
  404|  5.35k|                    __m128i i4_horz_samp_4x32b_r0_1, i4_horz_samp_4x32b_r0_2;
  405|  5.35k|                    __m128i i4_horz_samp_4x32b_r1_1, i4_horz_samp_4x32b_r1_2;
  406|  5.35k|                    __m128i i4_horz_samp_4x32b_r2_1, i4_horz_samp_4x32b_r2_2;
  407|  5.35k|                    __m128i i4_horz_samp_4x32b_r3_1, i4_horz_samp_4x32b_r3_2;
  408|       |
  409|  5.35k|                    __m128i i4_res_samp_4x32b_r0_1, i4_res_samp_4x32b_r0_2;
  410|  5.35k|                    __m128i i4_res_samp_4x32b_r1_1, i4_res_samp_4x32b_r1_2;
  411|  5.35k|                    __m128i i4_res_samp_4x32b_r2_1, i4_res_samp_4x32b_r2_2;
  412|  5.35k|                    __m128i i4_res_samp_4x32b_r3_1, i4_res_samp_4x32b_r3_2;
  413|  5.35k|                    __m128i i4_res_samp_4x32b_r4_1, i4_res_samp_4x32b_r4_2;
  414|  5.35k|                    __m128i i4_res_samp_4x32b_r5_1, i4_res_samp_4x32b_r5_2;
  415|  5.35k|                    __m128i i4_res_samp_4x32b_r6_1, i4_res_samp_4x32b_r6_2;
  416|  5.35k|                    __m128i i4_res_samp_4x32b_r7_1, i4_res_samp_4x32b_r7_2;
  417|       |
  418|  5.35k|                    __m128i horz_add_4x32b_r1_1, horz_add_4x32b_r1_2;
  419|  5.35k|                    __m128i horz_add_4x32b_r2_1, horz_add_4x32b_r2_2;
  420|  5.35k|                    __m128i horz_add_4x32b_r3_1, horz_add_4x32b_r3_2;
  421|       |
  422|  5.35k|                    __m128i twos = _mm_set1_epi32(2);
  423|  5.35k|                    __m128i eights = _mm_set1_epi32(8);
  424|       |
  425|  5.35k|                    i4_horz_samp_8x16b_r0_1 = _mm_loadu_si128((__m128i *) (pi2_refarray_buffer));
  426|  5.35k|                    i4_horz_samp_8x16b_r0_2 =
  427|  5.35k|                        _mm_loadu_si128((__m128i *) (pi2_refarray_buffer + 4));
  428|  5.35k|                    i4_horz_samp_8x16b_r1_1 =
  429|  5.35k|                        _mm_loadu_si128((__m128i *) (pi2_refarray_buffer + BLOCK_WIDTH));
  ------------------
  |  |   64|  5.35k|#define BLOCK_WIDTH 8
  ------------------
  430|  5.35k|                    i4_horz_samp_8x16b_r1_2 =
  431|  5.35k|                        _mm_loadu_si128((__m128i *) (pi2_refarray_buffer + BLOCK_WIDTH + 4));
  ------------------
  |  |   64|  5.35k|#define BLOCK_WIDTH 8
  ------------------
  432|  5.35k|                    i4_horz_samp_8x16b_r2_1 =
  433|  5.35k|                        _mm_loadu_si128((__m128i *) (pi2_refarray_buffer + (BLOCK_WIDTH << 1)));
  ------------------
  |  |   64|  5.35k|#define BLOCK_WIDTH 8
  ------------------
  434|  5.35k|                    i4_horz_samp_8x16b_r2_2 =
  435|  5.35k|                        _mm_loadu_si128((__m128i *) (pi2_refarray_buffer + (BLOCK_WIDTH << 1) + 4));
  ------------------
  |  |   64|  5.35k|#define BLOCK_WIDTH 8
  ------------------
  436|  5.35k|                    i4_horz_samp_8x16b_r3_1 =
  437|  5.35k|                        _mm_loadu_si128((__m128i *) (pi2_refarray_buffer + (BLOCK_WIDTH * 3)));
  ------------------
  |  |   64|  5.35k|#define BLOCK_WIDTH 8
  ------------------
  438|  5.35k|                    i4_horz_samp_8x16b_r3_2 =
  439|  5.35k|                        _mm_loadu_si128((__m128i *) (pi2_refarray_buffer + (BLOCK_WIDTH * 3) + 4));
  ------------------
  |  |   64|  5.35k|#define BLOCK_WIDTH 8
  ------------------
  440|       |
  441|  5.35k|                    i4_horz_samp_4x32b_r0_1 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r0_1);
  442|  5.35k|                    i4_horz_samp_4x32b_r0_2 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r0_2);
  443|  5.35k|                    i4_horz_samp_4x32b_r1_1 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r1_1);
  444|  5.35k|                    i4_horz_samp_4x32b_r1_2 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r1_2);
  445|  5.35k|                    i4_horz_samp_4x32b_r2_1 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r2_1);
  446|  5.35k|                    i4_horz_samp_4x32b_r2_2 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r2_2);
  447|  5.35k|                    i4_horz_samp_4x32b_r3_1 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r3_1);
  448|  5.35k|                    i4_horz_samp_4x32b_r3_2 = _mm_cvtepi16_epi32(i4_horz_samp_8x16b_r3_2);
  449|       |
  450|  5.35k|                    horz_add_4x32b_r1_1 =
  451|  5.35k|                        _mm_add_epi32(i4_horz_samp_4x32b_r0_1, i4_horz_samp_4x32b_r1_1);
  452|  5.35k|                    horz_add_4x32b_r2_1 =
  453|  5.35k|                        _mm_add_epi32(i4_horz_samp_4x32b_r1_1, i4_horz_samp_4x32b_r2_1);
  454|  5.35k|                    horz_add_4x32b_r3_1 =
  455|  5.35k|                        _mm_add_epi32(i4_horz_samp_4x32b_r2_1, i4_horz_samp_4x32b_r3_1);
  456|       |
  457|  5.35k|                    horz_add_4x32b_r1_2 =
  458|  5.35k|                        _mm_add_epi32(i4_horz_samp_4x32b_r0_2, i4_horz_samp_4x32b_r1_2);
  459|  5.35k|                    horz_add_4x32b_r2_2 =
  460|  5.35k|                        _mm_add_epi32(i4_horz_samp_4x32b_r1_2, i4_horz_samp_4x32b_r2_2);
  461|  5.35k|                    horz_add_4x32b_r3_2 =
  462|  5.35k|                        _mm_add_epi32(i4_horz_samp_4x32b_r2_2, i4_horz_samp_4x32b_r3_2);
  463|       |
  464|  5.35k|                    i4_res_samp_4x32b_r1_1 = _mm_add_epi32(
  465|  5.35k|                        _mm_slli_epi32(i4_horz_samp_4x32b_r0_1, 1), horz_add_4x32b_r1_1);
  466|  5.35k|                    i4_res_samp_4x32b_r2_1 = _mm_add_epi32(
  467|  5.35k|                        _mm_slli_epi32(i4_horz_samp_4x32b_r1_1, 1), horz_add_4x32b_r1_1);
  468|  5.35k|                    i4_res_samp_4x32b_r3_1 = _mm_add_epi32(
  469|  5.35k|                        _mm_slli_epi32(i4_horz_samp_4x32b_r1_1, 1), horz_add_4x32b_r2_1);
  470|  5.35k|                    i4_res_samp_4x32b_r4_1 = _mm_add_epi32(
  471|  5.35k|                        _mm_slli_epi32(i4_horz_samp_4x32b_r2_1, 1), horz_add_4x32b_r2_1);
  472|  5.35k|                    i4_res_samp_4x32b_r5_1 = _mm_add_epi32(
  473|  5.35k|                        _mm_slli_epi32(i4_horz_samp_4x32b_r2_1, 1), horz_add_4x32b_r3_1);
  474|  5.35k|                    i4_res_samp_4x32b_r6_1 = _mm_add_epi32(
  475|  5.35k|                        _mm_slli_epi32(i4_horz_samp_4x32b_r3_1, 1), horz_add_4x32b_r3_1);
  476|       |
  477|  5.35k|                    i4_res_samp_4x32b_r1_2 = _mm_add_epi32(
  478|  5.35k|                        _mm_slli_epi32(i4_horz_samp_4x32b_r0_2, 1), horz_add_4x32b_r1_2);
  479|  5.35k|                    i4_res_samp_4x32b_r2_2 = _mm_add_epi32(
  480|  5.35k|                        _mm_slli_epi32(i4_horz_samp_4x32b_r1_2, 1), horz_add_4x32b_r1_2);
  481|  5.35k|                    i4_res_samp_4x32b_r3_2 = _mm_add_epi32(
  482|  5.35k|                        _mm_slli_epi32(i4_horz_samp_4x32b_r1_2, 1), horz_add_4x32b_r2_2);
  483|  5.35k|                    i4_res_samp_4x32b_r4_2 = _mm_add_epi32(
  484|  5.35k|                        _mm_slli_epi32(i4_horz_samp_4x32b_r2_2, 1), horz_add_4x32b_r2_2);
  485|  5.35k|                    i4_res_samp_4x32b_r5_2 = _mm_add_epi32(
  486|  5.35k|                        _mm_slli_epi32(i4_horz_samp_4x32b_r2_2, 1), horz_add_4x32b_r3_2);
  487|  5.35k|                    i4_res_samp_4x32b_r6_2 = _mm_add_epi32(
  488|  5.35k|                        _mm_slli_epi32(i4_horz_samp_4x32b_r3_2, 1), horz_add_4x32b_r3_2);
  489|       |
  490|  5.35k|                    i4_res_samp_4x32b_r0_1 =
  491|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_horz_samp_4x32b_r0_1, twos), 2);
  492|  5.35k|                    i4_res_samp_4x32b_r1_1 =
  493|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r1_1, eights), 4);
  494|  5.35k|                    i4_res_samp_4x32b_r2_1 =
  495|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r2_1, eights), 4);
  496|  5.35k|                    i4_res_samp_4x32b_r3_1 =
  497|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r3_1, eights), 4);
  498|  5.35k|                    i4_res_samp_4x32b_r4_1 =
  499|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r4_1, eights), 4);
  500|  5.35k|                    i4_res_samp_4x32b_r5_1 =
  501|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r5_1, eights), 4);
  502|  5.35k|                    i4_res_samp_4x32b_r6_1 =
  503|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r6_1, eights), 4);
  504|  5.35k|                    i4_res_samp_4x32b_r7_1 =
  505|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_horz_samp_4x32b_r3_1, twos), 2);
  506|       |
  507|  5.35k|                    i4_res_samp_4x32b_r0_2 =
  508|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_horz_samp_4x32b_r0_2, twos), 2);
  509|  5.35k|                    i4_res_samp_4x32b_r1_2 =
  510|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r1_2, eights), 4);
  511|  5.35k|                    i4_res_samp_4x32b_r2_2 =
  512|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r2_2, eights), 4);
  513|  5.35k|                    i4_res_samp_4x32b_r3_2 =
  514|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r3_2, eights), 4);
  515|  5.35k|                    i4_res_samp_4x32b_r4_2 =
  516|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r4_2, eights), 4);
  517|  5.35k|                    i4_res_samp_4x32b_r5_2 =
  518|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r5_2, eights), 4);
  519|  5.35k|                    i4_res_samp_4x32b_r6_2 =
  520|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_res_samp_4x32b_r6_2, eights), 4);
  521|  5.35k|                    i4_res_samp_4x32b_r7_2 =
  522|  5.35k|                        _mm_srai_epi32(_mm_add_epi32(i4_horz_samp_4x32b_r3_2, twos), 2);
  523|       |
  524|       |                    /* populate 2 samples based on current coeffs */
  525|  5.35k|                    _mm_storeu_si128(
  526|  5.35k|                        (__m128i *) pi2_out_res,
  527|  5.35k|                        _mm_packs_epi32(i4_res_samp_4x32b_r0_1, i4_res_samp_4x32b_r0_2));
  528|  5.35k|                    _mm_storeu_si128(
  529|  5.35k|                        (__m128i *) (pi2_out_res + i4_out_res_stride),
  530|  5.35k|                        _mm_packs_epi32(i4_res_samp_4x32b_r1_1, i4_res_samp_4x32b_r1_2));
  531|  5.35k|                    _mm_storeu_si128(
  532|  5.35k|                        (__m128i *) (pi2_out_res + (i4_out_res_stride << 1)),
  533|  5.35k|                        _mm_packs_epi32(i4_res_samp_4x32b_r2_1, i4_res_samp_4x32b_r2_2));
  534|  5.35k|                    _mm_storeu_si128(
  535|  5.35k|                        (__m128i *) (pi2_out_res + (i4_out_res_stride * 3)),
  536|  5.35k|                        _mm_packs_epi32(i4_res_samp_4x32b_r3_1, i4_res_samp_4x32b_r3_2));
  537|  5.35k|                    _mm_storeu_si128(
  538|  5.35k|                        (__m128i *) (pi2_out_res + (i4_out_res_stride << 2)),
  539|  5.35k|                        _mm_packs_epi32(i4_res_samp_4x32b_r4_1, i4_res_samp_4x32b_r4_2));
  540|  5.35k|                    _mm_storeu_si128(
  541|  5.35k|                        (__m128i *) (pi2_out_res + (i4_out_res_stride * 5)),
  542|  5.35k|                        _mm_packs_epi32(i4_res_samp_4x32b_r5_1, i4_res_samp_4x32b_r5_2));
  543|  5.35k|                    _mm_storeu_si128(
  544|  5.35k|                        (__m128i *) (pi2_out_res + (i4_out_res_stride * 6)),
  545|  5.35k|                        _mm_packs_epi32(i4_res_samp_4x32b_r6_1, i4_res_samp_4x32b_r6_2));
  546|  5.35k|                    _mm_storeu_si128(
  547|  5.35k|                        (__m128i *) (pi2_out_res + (i4_out_res_stride * 7)),
  548|  5.35k|                        _mm_packs_epi32(i4_res_samp_4x32b_r7_1, i4_res_samp_4x32b_r7_2));
  549|       |
  550|  5.35k|                    pi2_out_res += BLOCK_WIDTH;
  ------------------
  |  |   64|  5.35k|#define BLOCK_WIDTH 8
  ------------------
  551|  5.35k|                }
  552|  5.35k|            }
  553|  79.6k|            else
  554|  79.6k|            {
  555|  79.6k|                pi2_out_res += BLOCK_WIDTH;
  ------------------
  |  |   64|  79.6k|#define BLOCK_WIDTH 8
  ------------------
  556|  79.6k|            }
  557|       |
  558|       |            /* Block level loop updates */
  559|  84.9k|            if(1 == i4_blk_ctr)
  ------------------
  |  Branch (559:16): [True: 21.2k, False: 63.7k]
  ------------------
  560|  21.2k|            {
  561|  21.2k|                pi2_inp_data -= SUB_BLOCK_WIDTH;
  ------------------
  |  |   61|  21.2k|#define SUB_BLOCK_WIDTH 4
  ------------------
  562|  21.2k|                pi2_inp_data += (i4_inp_data_stride * SUB_BLOCK_HEIGHT);
  ------------------
  |  |   62|  21.2k|#define SUB_BLOCK_HEIGHT 4
  ------------------
  563|  21.2k|                pi2_out_res -= MB_WIDTH;
  ------------------
  |  |   67|  21.2k|#define MB_WIDTH 16
  ------------------
  564|  21.2k|                pi2_out_res += (i4_out_res_stride * BLOCK_HEIGHT);
  ------------------
  |  |   65|  21.2k|#define BLOCK_HEIGHT 8
  ------------------
  565|  21.2k|                i4_ref_nnz >>= 2;
  566|  21.2k|            }
  567|  63.7k|            else
  568|  63.7k|            {
  569|  63.7k|                pi2_inp_data += SUB_BLOCK_WIDTH;
  ------------------
  |  |   61|  63.7k|#define SUB_BLOCK_WIDTH 4
  ------------------
  570|  63.7k|            }
  571|       |
  572|  84.9k|            i4_ref_nnz >>= 1;
  573|  84.9k|        } /* end of loop over all the blocks */
  574|  21.2k|    }
  575|  21.7k|    return;
  576|  21.7k|}
isvcd_interpolate_residual_sse42:
  603|   149k|{
  604|   149k|    residual_sampling_ctxt_t *ps_ctxt;
  605|   149k|    residual_samp_map_ctxt_t *ps_map_ctxt;
  606|   149k|    res_lyr_ctxt *ps_lyr_ctxt;
  607|   149k|    ref_pixel_map_t *ps_x_pos_phase;
  608|   149k|    ref_pixel_map_t *ps_y_pos_phase;
  609|       |
  610|   149k|    WORD32 i4_x, i4_y;
  611|   149k|    WORD32 i4_frm_mb_x, i4_frm_mb_y;
  612|   149k|    WORD32 i4_temp_array_ht;
  613|   149k|    WORD32 i4_mb_wd;
  614|   149k|    WORD32 i4_mb_ht;
  615|   149k|    WORD16 *pi2_ref_array;
  616|   149k|    UWORD8 *pu1_ref_x_ptr_incr, *pu1_ref_y_ptr_incr;
  617|       |
  618|   149k|    WORD8 arr_y_ref_pos[16] = {0};
  619|   149k|    WORD8 arr_x_ref_pos[16] = {0};
  620|   149k|    WORD8 arr_x_phase[32] = {0};
  621|   149k|    WORD8 arr_y_phase[32] = {0};
  622|   149k|    WORD8 *pi1_y_ref_pos;
  623|   149k|    WORD8 *pi1_x_ref_pos;
  624|   149k|    WORD8 *pi1_y_phase;
  625|   149k|    WORD8 *pi1_x_phase;
  626|       |
  627|   149k|    ps_ctxt = (residual_sampling_ctxt_t *) pv_residual_samp_ctxt;
  628|   149k|    ps_lyr_ctxt = &ps_ctxt->as_res_lyrs[ps_ctxt->i4_res_lyr_id];
  629|   149k|    pi2_ref_array = ps_ctxt->pi2_refarray_buffer;
  630|   149k|    pu1_ref_x_ptr_incr = ps_ctxt->pu1_ref_x_ptr_incr;
  631|   149k|    pu1_ref_y_ptr_incr = ps_ctxt->pu1_ref_y_ptr_incr;
  632|       |
  633|       |    /* --------------------------------------------------------------------- */
  634|       |    /* Extracting information from the mapping context                       */
  635|       |    /* --------------------------------------------------------------------- */
  636|   149k|    if(1 == i4_chroma_flag)
  ------------------
  |  Branch (636:8): [True: 99.4k, False: 49.7k]
  ------------------
  637|  99.4k|        ps_map_ctxt = &ps_lyr_ctxt->s_chroma_map_ctxt;
  638|  49.7k|    else
  639|  49.7k|        ps_map_ctxt = &ps_lyr_ctxt->s_luma_map_ctxt;
  640|       |
  641|   149k|    i4_mb_wd = MB_WIDTH >> i4_chroma_flag;
  ------------------
  |  |   67|   149k|#define MB_WIDTH 16
  ------------------
  642|   149k|    i4_mb_ht = MB_HEIGHT >> i4_chroma_flag;
  ------------------
  |  |   68|   149k|#define MB_HEIGHT 16
  ------------------
  643|       |
  644|   149k|    ps_x_pos_phase = ps_map_ctxt->ps_x_pos_phase;
  645|   149k|    ps_y_pos_phase = ps_map_ctxt->ps_y_pos_phase;
  646|       |
  647|   149k|    i4_temp_array_ht = i4_mb_ht;
  648|   149k|    i4_frm_mb_y = u2_mb_y * i4_mb_ht;
  649|   149k|    i4_frm_mb_x = u2_mb_x * i4_mb_wd;
  650|       |
  651|       |    /* --------------------------------------------------------------------- */
  652|       |    /* Loop for interpolation                                                */
  653|       |    /* --------------------------------------------------------------------- */
  654|       |
  655|   149k|    if(i4_chroma_flag == 0)
  ------------------
  |  Branch (655:8): [True: 49.7k, False: 99.4k]
  ------------------
  656|  49.7k|    {
  657|  49.7k|        __m128i const_16_8x16b, const_128, const_ones, const_ones_8x16b, mid_indx_16x8b;
  658|  49.7k|        __m128i ref_arr_8x16b_r0_0;
  659|  49.7k|        __m128i ref_arr_8x16b_r1_0;
  660|  49.7k|        __m128i phs_mask_8x16b_0, phs_mask_16min_8x16b_0, phs_mask_16x8b_0;
  661|  49.7k|        __m128i x_ref_pos_mask_r0, x_ref_rnd_mask_r0_0;
  662|  49.7k|        __m128i x_ref_pos_mask_temp_r0_0;
  663|  49.7k|        __m128i x_ref_pos_mask_temp_r1_0;
  664|  49.7k|        __m128i phs_mask_div8_8x16b_0;
  665|  49.7k|        __m128i u1_incr_8x16b_r0_0, ref_arr_temp0_8x16b_r0_0, res0_8x16b_r0_0,
  666|  49.7k|            u1_incr_not_8x16b_r0_0;
  667|  49.7k|        __m128i u1_incr_8x16b_r1_0, ref_arr_temp1_8x16b_r0_0, res1_8x16b_r0_0;
  668|       |
  669|  49.7k|        __m128i u1_incr_not_8x16b_r0_even, u1_incr_not_8x16b_r1_even, x_ref_pos_mask_temp_r0_even,
  670|  49.7k|            x_ref_pos_mask_temp_r1_even;
  671|  49.7k|        __m128i u1_incr_not_8x16b_r0_odd, u1_incr_not_8x16b_r1_odd, x_ref_pos_mask_temp_r0_odd,
  672|  49.7k|            x_ref_pos_mask_temp_r1_odd;
  673|       |
  674|  49.7k|        __m128i ref_arr_temp0_8x16b_r1_0, res_8x16b_r0_0, res0_8x16b_r1_0, u1_incr_not_8x16b_r1_0;
  675|  49.7k|        __m128i ref_arr_temp1_8x16b_r1_0, res_8x16b_r1_0, res1_8x16b_r1_0;
  676|  49.7k|        __m128i u1_y_incr_8x16b_r0_0, u1_y_incr_8x16b_r0_1, u1_y_incr_8x16b_r0_low,
  677|  49.7k|            u1_y_incr_8x16b_r0_high;
  678|       |
  679|  49.7k|        __m128i prev_res_8x16b_r0_0;
  680|  49.7k|        __m128i prev_res_8x16b_r1_0;
  681|  49.7k|        __m128i prev_res_8x16b_r0_1;
  682|  49.7k|        __m128i prev_res_8x16b_r1_1;
  683|       |
  684|  49.7k|        __m128i u1_prev_y_incr_8x16b_r0_0;
  685|  49.7k|        __m128i u1_prev_y_incr_8x16b_r0_1;
  686|       |
  687|  49.7k|        __m128i ref_arr_8x16b_r0_1;
  688|  49.7k|        __m128i ref_arr_8x16b_r1_1;
  689|  49.7k|        __m128i phs_mask_8x16b_1, phs_mask_div8_8x16b_1, phs_mask_16min_8x16b_1;
  690|  49.7k|        __m128i x_ref_pos_mask_temp_r0_1;
  691|  49.7k|        __m128i x_ref_pos_mask_temp_r1_1;
  692|  49.7k|        __m128i ref_arr_temp0_8x16b_r0_1, res0_8x16b_r0_1, u1_incr_not_8x16b_r0_1;
  693|  49.7k|        __m128i ref_arr_temp1_8x16b_r0_1, res1_8x16b_r0_1;
  694|       |
  695|  49.7k|        __m128i ref_arr_temp0_8x16b_r1_1, res_8x16b_r0_1, res0_8x16b_r1_1, u1_incr_not_8x16b_r1_1;
  696|  49.7k|        __m128i ref_arr_temp1_8x16b_r1_1, res_8x16b_r1_1, res1_8x16b_r1_1;
  697|       |
  698|  49.7k|        __m128i vert_res0_8x16b_r0_0, vert_res0_8x16b_r0_1, res_4x32b_l_0, res_4x32b_h_0;
  699|  49.7k|        __m128i vert_res1_8x16b_r0_0, vert_res1_8x16b_r0_1, res_4x32b_l_1, res_4x32b_h_1;
  700|  49.7k|        __m128i res_8x16b_l, res_8x16b_h;
  701|  49.7k|        __m128i phs_y_mask_16min_8x16b, phs_y_mask_8x16b, phs_y_mask_mix_8x16b;
  702|  49.7k|        __m128i zero_8x16b;
  703|  49.7k|        WORD32 zero_r0_0, zero_r1_0, zero_r0_1, zero_r1_1, zero_r0_r1 = 0;
  704|  49.7k|        WORD32 strt_indx_h;
  705|  49.7k|        WORD16 *pi2_ref_array_temp;
  706|  49.7k|        UWORD8 *pu1_ref_x_ptr_incr_temp, *pu1_ref_y_ptr_incr_temp;
  707|  49.7k|        WORD32 i4_y_phase;
  708|  49.7k|        WORD32 out_stride_temp;
  709|  49.7k|        const_128 = _mm_set1_epi32(128);
  710|  49.7k|        zero_8x16b = _mm_set1_epi16(0);
  711|  49.7k|        const_ones = _mm_set1_epi8(1);
  712|  49.7k|        const_ones_8x16b = _mm_set1_epi16(1);
  713|       |
  714|   844k|        for(i4_y = 0; i4_y < (i4_temp_array_ht); i4_y++)
  ------------------
  |  Branch (714:23): [True: 795k, False: 49.7k]
  ------------------
  715|   795k|        {
  716|   795k|            arr_y_phase[i4_y] = (WORD8) ps_y_pos_phase[i4_y + i4_frm_mb_y].i2_phase;
  717|   795k|            arr_y_ref_pos[i4_y] = (WORD8) (ps_y_pos_phase[i4_y + i4_frm_mb_y].i2_ref_pos);
  718|   795k|        }
  719|  49.7k|        pi1_y_ref_pos = arr_y_ref_pos;
  720|  49.7k|        pi1_y_phase = arr_y_phase;
  721|       |
  722|  49.7k|        strt_indx_h = 0;
  723|  49.7k|        strt_indx_h = (ps_x_pos_phase[8 + i4_frm_mb_x].i2_ref_pos);
  724|   844k|        for(i4_x = 0; i4_x < i4_mb_wd; i4_x++)
  ------------------
  |  Branch (724:23): [True: 795k, False: 49.7k]
  ------------------
  725|   795k|        {
  726|   795k|            arr_x_ref_pos[i4_x] = (WORD8) ps_x_pos_phase[i4_x + i4_frm_mb_x].i2_ref_pos;
  727|   795k|            arr_x_phase[i4_x] = (WORD8) ps_x_pos_phase[i4_x + i4_frm_mb_x].i2_phase;
  728|   795k|        }
  729|       |
  730|  49.7k|        pi1_x_ref_pos = arr_x_ref_pos;
  731|  49.7k|        pi1_x_phase = arr_x_phase;
  732|       |
  733|  49.7k|        x_ref_pos_mask_r0 = _mm_loadu_si128((__m128i *) (pi1_x_ref_pos));
  734|  49.7k|        phs_mask_16x8b_0 = _mm_loadu_si128((__m128i *) (pi1_x_phase));
  735|  49.7k|        phs_mask_8x16b_0 = _mm_cvtepi8_epi16(phs_mask_16x8b_0);
  736|  49.7k|        phs_mask_8x16b_1 = _mm_cvtepi8_epi16(_mm_loadu_si128((__m128i *) (pi1_x_phase + 8)));
  737|       |
  738|  49.7k|        phs_mask_div8_8x16b_0 = _mm_srli_epi16(phs_mask_8x16b_0, 3);
  739|  49.7k|        phs_mask_div8_8x16b_1 = _mm_srli_epi16(phs_mask_8x16b_1, 3);
  740|  49.7k|        phs_mask_div8_8x16b_0 = _mm_packs_epi16(phs_mask_div8_8x16b_0, phs_mask_div8_8x16b_1);
  741|  49.7k|        const_16_8x16b = _mm_set1_epi16(16);
  742|       |
  743|  49.7k|        phs_mask_16min_8x16b_0 = _mm_sub_epi16(const_16_8x16b, phs_mask_8x16b_0);
  744|  49.7k|        phs_mask_16min_8x16b_1 = _mm_sub_epi16(const_16_8x16b, phs_mask_8x16b_1);
  745|       |
  746|  49.7k|        x_ref_rnd_mask_r0_0 = _mm_add_epi8(x_ref_pos_mask_r0, phs_mask_div8_8x16b_0);
  747|  49.7k|        mid_indx_16x8b = _mm_set1_epi8((strt_indx_h << 1));
  748|   844k|        for(i4_y = 0; i4_y < (i4_temp_array_ht); i4_y++)
  ------------------
  |  Branch (748:23): [True: 795k, False: 49.7k]
  ------------------
  749|   795k|        {
  750|   795k|            if((i4_y > 0) && (pi1_y_ref_pos[i4_y] == pi1_y_ref_pos[i4_y - 1]))
  ------------------
  |  Branch (750:16): [True: 745k, False: 49.7k]
  |  Branch (750:30): [True: 248k, False: 497k]
  ------------------
  751|   248k|            {
  752|   248k|                if(zero_r0_r1)
  ------------------
  |  Branch (752:20): [True: 243k, False: 4.58k]
  ------------------
  753|   243k|                {
  754|   243k|                    res_8x16b_l = _mm_set1_epi16(0);
  755|   243k|                    res_8x16b_h = _mm_set1_epi16(0);
  756|   243k|                    out_stride_temp = (i4_y * i4_out_stride);
  757|   243k|                    _mm_storeu_si128((__m128i *) (pi2_out + out_stride_temp), res_8x16b_l);
  758|   243k|                    _mm_storeu_si128((__m128i *) (pi2_out + out_stride_temp + 8), res_8x16b_h);
  759|   243k|                    continue;
  760|   243k|                }
  761|       |
  762|  4.58k|                res_8x16b_r0_0 = prev_res_8x16b_r0_0;
  763|  4.58k|                res_8x16b_r1_0 = prev_res_8x16b_r1_0;
  764|  4.58k|                res_8x16b_r0_1 = prev_res_8x16b_r0_1;
  765|  4.58k|                res_8x16b_r1_1 = prev_res_8x16b_r1_1;
  766|       |
  767|  4.58k|                u1_y_incr_8x16b_r0_0 = u1_prev_y_incr_8x16b_r0_0;
  768|  4.58k|                u1_y_incr_8x16b_r0_1 = u1_prev_y_incr_8x16b_r0_1;
  769|  4.58k|            }
  770|   546k|            else
  771|   546k|            {
  772|   546k|                pi2_ref_array_temp = pi2_ref_array + ((pi1_y_ref_pos[i4_y]) * i4_refarray_wd);
  773|   546k|                pu1_ref_x_ptr_incr_temp =
  774|   546k|                    pu1_ref_x_ptr_incr + ((pi1_y_ref_pos[i4_y]) * i4_refarray_wd);
  775|   546k|                ref_arr_8x16b_r0_0 = _mm_loadu_si128((__m128i *) (pi2_ref_array_temp));
  776|   546k|                ref_arr_8x16b_r1_0 =
  777|   546k|                    _mm_loadu_si128((__m128i *) (pi2_ref_array_temp + i4_refarray_wd));
  778|   546k|                ref_arr_8x16b_r0_1 =
  779|   546k|                    _mm_loadu_si128((__m128i *) (pi2_ref_array_temp + strt_indx_h));
  780|   546k|                ref_arr_8x16b_r1_1 = _mm_loadu_si128(
  781|   546k|                    (__m128i *) (pi2_ref_array_temp + i4_refarray_wd + strt_indx_h));
  782|       |
  783|   546k|                zero_r0_0 = _mm_test_all_ones(_mm_cmpeq_epi16(
  784|   546k|                    ref_arr_8x16b_r0_0, zero_8x16b));  // return 1 if all zeros, else 0
  785|   546k|                zero_r1_0 = _mm_test_all_ones(_mm_cmpeq_epi16(ref_arr_8x16b_r1_0, zero_8x16b));
  786|   546k|                zero_r0_1 = _mm_test_all_ones(_mm_cmpeq_epi16(ref_arr_8x16b_r0_1, zero_8x16b));
  787|   546k|                zero_r1_1 = _mm_test_all_ones(_mm_cmpeq_epi16(ref_arr_8x16b_r1_1, zero_8x16b));
  788|       |
  789|   546k|                zero_r0_r1 = zero_r0_0 && zero_r1_0 && zero_r0_1 && zero_r1_1;
  ------------------
  |  Branch (789:30): [True: 539k, False: 6.77k]
  |  Branch (789:43): [True: 538k, False: 1.26k]
  |  Branch (789:56): [True: 538k, False: 690]
  |  Branch (789:69): [True: 537k, False: 769]
  ------------------
  790|       |
  791|   546k|                if(!zero_r0_r1)
  ------------------
  |  Branch (791:20): [True: 9.49k, False: 537k]
  ------------------
  792|  9.49k|                {
  793|  9.49k|                    u1_incr_8x16b_r0_0 = _mm_loadu_si128((__m128i *) (pu1_ref_x_ptr_incr_temp));
  794|  9.49k|                    u1_incr_8x16b_r1_0 =
  795|  9.49k|                        _mm_loadu_si128((__m128i *) (pu1_ref_x_ptr_incr_temp + i4_refarray_wd));
  796|       |
  797|  9.49k|                    u1_incr_8x16b_r0_0 = _mm_shuffle_epi8(u1_incr_8x16b_r0_0, x_ref_pos_mask_r0);
  798|  9.49k|                    u1_incr_8x16b_r1_0 = _mm_shuffle_epi8(u1_incr_8x16b_r1_0, x_ref_pos_mask_r0);
  799|       |
  800|  9.49k|                    u1_incr_not_8x16b_r0_0 =
  801|  9.49k|                        _mm_andnot_si128(u1_incr_8x16b_r0_0, phs_mask_div8_8x16b_0);
  802|  9.49k|                    u1_incr_not_8x16b_r1_0 =
  803|  9.49k|                        _mm_andnot_si128(u1_incr_8x16b_r1_0, phs_mask_div8_8x16b_0);
  804|       |
  805|  9.49k|                    u1_incr_not_8x16b_r0_0 =
  806|  9.49k|                        _mm_add_epi8(u1_incr_not_8x16b_r0_0, x_ref_pos_mask_r0);
  807|  9.49k|                    u1_incr_not_8x16b_r1_0 =
  808|  9.49k|                        _mm_add_epi8(u1_incr_not_8x16b_r1_0, x_ref_pos_mask_r0);
  809|       |
  810|  9.49k|                    x_ref_pos_mask_temp_r0_0 =
  811|  9.49k|                        _mm_add_epi8(u1_incr_not_8x16b_r0_0, u1_incr_8x16b_r0_0);
  812|  9.49k|                    x_ref_pos_mask_temp_r1_0 =
  813|  9.49k|                        _mm_add_epi8(u1_incr_not_8x16b_r1_0, u1_incr_8x16b_r1_0);
  814|       |
  815|       |                    /* _mm_slli_epi8(u1_incr_not_8x16b_r0_0, 1)*/
  816|  9.49k|                    u1_incr_not_8x16b_r0_even =
  817|  9.49k|                        _mm_add_epi8(u1_incr_not_8x16b_r0_0, u1_incr_not_8x16b_r0_0);
  818|  9.49k|                    u1_incr_not_8x16b_r1_even =
  819|  9.49k|                        _mm_add_epi8(u1_incr_not_8x16b_r1_0, u1_incr_not_8x16b_r1_0);
  820|  9.49k|                    x_ref_pos_mask_temp_r0_even =
  821|  9.49k|                        _mm_add_epi8(x_ref_pos_mask_temp_r0_0, x_ref_pos_mask_temp_r0_0);
  822|  9.49k|                    x_ref_pos_mask_temp_r1_even =
  823|  9.49k|                        _mm_add_epi8(x_ref_pos_mask_temp_r1_0, x_ref_pos_mask_temp_r1_0);
  824|       |
  825|  9.49k|                    u1_incr_not_8x16b_r0_odd = _mm_add_epi8(u1_incr_not_8x16b_r0_even, const_ones);
  826|  9.49k|                    u1_incr_not_8x16b_r1_odd = _mm_add_epi8(u1_incr_not_8x16b_r1_even, const_ones);
  827|  9.49k|                    x_ref_pos_mask_temp_r0_odd =
  828|  9.49k|                        _mm_add_epi8(x_ref_pos_mask_temp_r0_even, const_ones);
  829|  9.49k|                    x_ref_pos_mask_temp_r1_odd =
  830|  9.49k|                        _mm_add_epi8(x_ref_pos_mask_temp_r1_even, const_ones);
  831|       |
  832|  9.49k|                    u1_incr_not_8x16b_r0_0 =
  833|  9.49k|                        _mm_unpacklo_epi8(u1_incr_not_8x16b_r0_even, u1_incr_not_8x16b_r0_odd);
  834|  9.49k|                    u1_incr_not_8x16b_r1_0 =
  835|  9.49k|                        _mm_unpacklo_epi8(u1_incr_not_8x16b_r1_even, u1_incr_not_8x16b_r1_odd);
  836|  9.49k|                    x_ref_pos_mask_temp_r0_0 =
  837|  9.49k|                        _mm_unpacklo_epi8(x_ref_pos_mask_temp_r0_even, x_ref_pos_mask_temp_r0_odd);
  838|  9.49k|                    x_ref_pos_mask_temp_r1_0 =
  839|  9.49k|                        _mm_unpacklo_epi8(x_ref_pos_mask_temp_r1_even, x_ref_pos_mask_temp_r1_odd);
  840|       |
  841|  9.49k|                    u1_incr_not_8x16b_r0_1 =
  842|  9.49k|                        _mm_unpackhi_epi8(u1_incr_not_8x16b_r0_even, u1_incr_not_8x16b_r0_odd);
  843|  9.49k|                    u1_incr_not_8x16b_r1_1 =
  844|  9.49k|                        _mm_unpackhi_epi8(u1_incr_not_8x16b_r1_even, u1_incr_not_8x16b_r1_odd);
  845|  9.49k|                    x_ref_pos_mask_temp_r0_1 =
  846|  9.49k|                        _mm_unpackhi_epi8(x_ref_pos_mask_temp_r0_even, x_ref_pos_mask_temp_r0_odd);
  847|  9.49k|                    x_ref_pos_mask_temp_r1_1 =
  848|  9.49k|                        _mm_unpackhi_epi8(x_ref_pos_mask_temp_r1_even, x_ref_pos_mask_temp_r1_odd);
  849|       |
  850|  9.49k|                    u1_incr_not_8x16b_r0_1 = _mm_sub_epi8(u1_incr_not_8x16b_r0_1, mid_indx_16x8b);
  851|  9.49k|                    u1_incr_not_8x16b_r1_1 = _mm_sub_epi8(u1_incr_not_8x16b_r1_1, mid_indx_16x8b);
  852|  9.49k|                    x_ref_pos_mask_temp_r0_1 =
  853|  9.49k|                        _mm_sub_epi8(x_ref_pos_mask_temp_r0_1, mid_indx_16x8b);
  854|  9.49k|                    x_ref_pos_mask_temp_r1_1 =
  855|  9.49k|                        _mm_sub_epi8(x_ref_pos_mask_temp_r1_1, mid_indx_16x8b);
  856|       |
  857|  9.49k|                    ref_arr_temp0_8x16b_r0_0 =
  858|  9.49k|                        _mm_shuffle_epi8(ref_arr_8x16b_r0_0, u1_incr_not_8x16b_r0_0);
  859|  9.49k|                    ref_arr_temp0_8x16b_r1_0 =
  860|  9.49k|                        _mm_shuffle_epi8(ref_arr_8x16b_r1_0, u1_incr_not_8x16b_r1_0);
  861|  9.49k|                    ref_arr_temp1_8x16b_r0_0 =
  862|  9.49k|                        _mm_shuffle_epi8(ref_arr_8x16b_r0_0, x_ref_pos_mask_temp_r0_0);
  863|  9.49k|                    ref_arr_temp1_8x16b_r1_0 =
  864|  9.49k|                        _mm_shuffle_epi8(ref_arr_8x16b_r1_0, x_ref_pos_mask_temp_r1_0);
  865|  9.49k|                    ref_arr_temp0_8x16b_r0_1 =
  866|  9.49k|                        _mm_shuffle_epi8(ref_arr_8x16b_r0_1, u1_incr_not_8x16b_r0_1);
  867|  9.49k|                    ref_arr_temp0_8x16b_r1_1 =
  868|  9.49k|                        _mm_shuffle_epi8(ref_arr_8x16b_r1_1, u1_incr_not_8x16b_r1_1);
  869|  9.49k|                    ref_arr_temp1_8x16b_r0_1 =
  870|  9.49k|                        _mm_shuffle_epi8(ref_arr_8x16b_r0_1, x_ref_pos_mask_temp_r0_1);
  871|  9.49k|                    ref_arr_temp1_8x16b_r1_1 =
  872|  9.49k|                        _mm_shuffle_epi8(ref_arr_8x16b_r1_1, x_ref_pos_mask_temp_r1_1);
  873|       |
  874|  9.49k|                    res0_8x16b_r0_0 =
  875|  9.49k|                        _mm_mullo_epi16(ref_arr_temp0_8x16b_r0_0, phs_mask_16min_8x16b_0);
  876|  9.49k|                    res0_8x16b_r1_0 =
  877|  9.49k|                        _mm_mullo_epi16(ref_arr_temp0_8x16b_r1_0, phs_mask_16min_8x16b_0);
  878|  9.49k|                    res1_8x16b_r0_0 = _mm_mullo_epi16(ref_arr_temp1_8x16b_r0_0, phs_mask_8x16b_0);
  879|  9.49k|                    res1_8x16b_r1_0 = _mm_mullo_epi16(ref_arr_temp1_8x16b_r1_0, phs_mask_8x16b_0);
  880|  9.49k|                    res0_8x16b_r0_1 =
  881|  9.49k|                        _mm_mullo_epi16(ref_arr_temp0_8x16b_r0_1, phs_mask_16min_8x16b_1);
  882|  9.49k|                    res0_8x16b_r1_1 =
  883|  9.49k|                        _mm_mullo_epi16(ref_arr_temp0_8x16b_r1_1, phs_mask_16min_8x16b_1);
  884|  9.49k|                    res1_8x16b_r0_1 = _mm_mullo_epi16(ref_arr_temp1_8x16b_r0_1, phs_mask_8x16b_1);
  885|  9.49k|                    res1_8x16b_r1_1 = _mm_mullo_epi16(ref_arr_temp1_8x16b_r1_1, phs_mask_8x16b_1);
  886|       |
  887|  9.49k|                    res_8x16b_r0_0 = _mm_add_epi16(res0_8x16b_r0_0, res1_8x16b_r0_0);
  888|  9.49k|                    res_8x16b_r1_0 = _mm_add_epi16(res0_8x16b_r1_0, res1_8x16b_r1_0);
  889|  9.49k|                    res_8x16b_r0_1 = _mm_add_epi16(res0_8x16b_r0_1, res1_8x16b_r0_1);
  890|  9.49k|                    res_8x16b_r1_1 = _mm_add_epi16(res0_8x16b_r1_1, res1_8x16b_r1_1);
  891|       |
  892|  9.49k|                    prev_res_8x16b_r0_0 = res_8x16b_r0_0;
  893|  9.49k|                    prev_res_8x16b_r1_0 = res_8x16b_r1_0;
  894|  9.49k|                    prev_res_8x16b_r0_1 = res_8x16b_r0_1;
  895|  9.49k|                    prev_res_8x16b_r1_1 = res_8x16b_r1_1;
  896|       |
  897|  9.49k|                    pu1_ref_y_ptr_incr_temp =
  898|  9.49k|                        pu1_ref_y_ptr_incr + (pi1_y_ref_pos[i4_y] * i4_refarray_wd);
  899|  9.49k|                    u1_y_incr_8x16b_r0_0 = _mm_loadu_si128((__m128i *) (pu1_ref_y_ptr_incr_temp));
  900|       |
  901|  9.49k|                    u1_y_incr_8x16b_r0_0 =
  902|  9.49k|                        _mm_shuffle_epi8(u1_y_incr_8x16b_r0_0, x_ref_rnd_mask_r0_0);
  903|       |
  904|  9.49k|                    u1_y_incr_8x16b_r0_low = _mm_cvtepi8_epi16(u1_y_incr_8x16b_r0_0);
  905|  9.49k|                    u1_y_incr_8x16b_r0_high =
  906|  9.49k|                        _mm_cvtepi8_epi16(_mm_unpackhi_epi64(u1_y_incr_8x16b_r0_0, const_ones));
  907|       |
  908|  9.49k|                    u1_y_incr_8x16b_r0_0 =
  909|  9.49k|                        _mm_cmpeq_epi16(u1_y_incr_8x16b_r0_low, const_ones_8x16b);
  910|  9.49k|                    u1_y_incr_8x16b_r0_1 =
  911|  9.49k|                        _mm_cmpeq_epi16(u1_y_incr_8x16b_r0_high, const_ones_8x16b);
  912|       |
  913|  9.49k|                    u1_prev_y_incr_8x16b_r0_0 = u1_y_incr_8x16b_r0_0;
  914|  9.49k|                    u1_prev_y_incr_8x16b_r0_1 = u1_y_incr_8x16b_r0_1;
  915|  9.49k|                }
  916|   546k|            }
  917|       |
  918|   551k|            if(zero_r0_r1)
  ------------------
  |  Branch (918:16): [True: 537k, False: 14.0k]
  ------------------
  919|   537k|            {
  920|   537k|                res_8x16b_l = _mm_set1_epi16(0);
  921|   537k|                res_8x16b_h = _mm_set1_epi16(0);
  922|   537k|            }
  923|  14.0k|            else
  924|  14.0k|            {
  925|  14.0k|                i4_y_phase = pi1_y_phase[i4_y];
  926|       |
  927|  14.0k|                if((i4_y_phase) >> 3)
  ------------------
  |  Branch (927:20): [True: 9.34k, False: 4.73k]
  ------------------
  928|  9.34k|                {
  929|  9.34k|                    vert_res0_8x16b_r0_0 =
  930|  9.34k|                        _mm_blendv_epi8(res_8x16b_r1_0, res_8x16b_r0_0, u1_y_incr_8x16b_r0_0);
  931|  9.34k|                    vert_res1_8x16b_r0_0 =
  932|  9.34k|                        _mm_blendv_epi8(res_8x16b_r1_0, res_8x16b_r1_0, u1_y_incr_8x16b_r0_0);
  933|  9.34k|                    vert_res0_8x16b_r0_1 =
  934|  9.34k|                        _mm_blendv_epi8(res_8x16b_r1_1, res_8x16b_r0_1, u1_y_incr_8x16b_r0_1);
  935|  9.34k|                    vert_res1_8x16b_r0_1 =
  936|  9.34k|                        _mm_blendv_epi8(res_8x16b_r1_1, res_8x16b_r1_1, u1_y_incr_8x16b_r0_1);
  937|  9.34k|                }
  938|  4.73k|                else
  939|  4.73k|                {
  940|  4.73k|                    vert_res0_8x16b_r0_0 =
  941|  4.73k|                        _mm_blendv_epi8(res_8x16b_r0_0, res_8x16b_r0_0, u1_y_incr_8x16b_r0_0);
  942|  4.73k|                    vert_res1_8x16b_r0_0 =
  943|  4.73k|                        _mm_blendv_epi8(res_8x16b_r0_0, res_8x16b_r1_0, u1_y_incr_8x16b_r0_0);
  944|  4.73k|                    vert_res0_8x16b_r0_1 =
  945|  4.73k|                        _mm_blendv_epi8(res_8x16b_r0_1, res_8x16b_r0_1, u1_y_incr_8x16b_r0_1);
  946|  4.73k|                    vert_res1_8x16b_r0_1 =
  947|  4.73k|                        _mm_blendv_epi8(res_8x16b_r0_1, res_8x16b_r1_1, u1_y_incr_8x16b_r0_1);
  948|  4.73k|                }
  949|  14.0k|                res0_8x16b_r0_0 = _mm_unpacklo_epi16(vert_res0_8x16b_r0_0, vert_res1_8x16b_r0_0);
  950|  14.0k|                res1_8x16b_r0_0 = _mm_unpackhi_epi16(vert_res0_8x16b_r0_0, vert_res1_8x16b_r0_0);
  951|  14.0k|                res0_8x16b_r0_1 = _mm_unpacklo_epi16(vert_res0_8x16b_r0_1, vert_res1_8x16b_r0_1);
  952|  14.0k|                res1_8x16b_r0_1 = _mm_unpackhi_epi16(vert_res0_8x16b_r0_1, vert_res1_8x16b_r0_1);
  953|       |
  954|  14.0k|                phs_y_mask_16min_8x16b = _mm_set1_epi16(16 - i4_y_phase);
  955|  14.0k|                phs_y_mask_8x16b = _mm_set1_epi16(i4_y_phase);
  956|  14.0k|                phs_y_mask_mix_8x16b = _mm_unpacklo_epi16(phs_y_mask_16min_8x16b, phs_y_mask_8x16b);
  957|       |
  958|  14.0k|                res_4x32b_l_0 = _mm_madd_epi16(res0_8x16b_r0_0, phs_y_mask_mix_8x16b);
  959|  14.0k|                res_4x32b_l_1 = _mm_madd_epi16(res1_8x16b_r0_0, phs_y_mask_mix_8x16b);
  960|  14.0k|                res_4x32b_h_0 = _mm_madd_epi16(res0_8x16b_r0_1, phs_y_mask_mix_8x16b);
  961|  14.0k|                res_4x32b_h_1 = _mm_madd_epi16(res1_8x16b_r0_1, phs_y_mask_mix_8x16b);
  962|       |
  963|  14.0k|                res_4x32b_l_0 = _mm_add_epi32(res_4x32b_l_0, const_128);
  964|  14.0k|                res_4x32b_l_1 = _mm_add_epi32(res_4x32b_l_1, const_128);
  965|  14.0k|                res_4x32b_h_0 = _mm_add_epi32(res_4x32b_h_0, const_128);
  966|  14.0k|                res_4x32b_h_1 = _mm_add_epi32(res_4x32b_h_1, const_128);
  967|       |
  968|  14.0k|                res_4x32b_l_0 = _mm_srai_epi32(res_4x32b_l_0, 8);
  969|  14.0k|                res_4x32b_l_1 = _mm_srai_epi32(res_4x32b_l_1, 8);
  970|  14.0k|                res_4x32b_h_0 = _mm_srai_epi32(res_4x32b_h_0, 8);
  971|  14.0k|                res_4x32b_h_1 = _mm_srai_epi32(res_4x32b_h_1, 8);
  972|  14.0k|                res_8x16b_l = _mm_packs_epi32(res_4x32b_l_0, res_4x32b_l_1);
  973|  14.0k|                res_8x16b_h = _mm_packs_epi32(res_4x32b_h_0, res_4x32b_h_1);
  974|  14.0k|            }
  975|       |
  976|   551k|            out_stride_temp = (i4_y * i4_out_stride);
  977|   551k|            _mm_storeu_si128((__m128i *) (pi2_out + out_stride_temp), res_8x16b_l);
  978|   551k|            _mm_storeu_si128((__m128i *) (pi2_out + out_stride_temp + 8), res_8x16b_h);
  979|   551k|        }
  980|  49.7k|    }
  981|  99.4k|    else
  982|  99.4k|    {
  983|  99.4k|        __m128i const_16_8x16b, const_128, const_ones, const_ones_8x16b;
  984|  99.4k|        __m128i ref_arr_8x16b_r0_0;
  985|  99.4k|        __m128i ref_arr_8x16b_r1_0;
  986|  99.4k|        __m128i phs_mask_8x16b_0, phs_mask_div8_8x16b_0, phs_mask_16min_8x16b_0;
  987|  99.4k|        __m128i x_ref_pos_mask_r0, x_ref_rnd_mask_r0_0;
  988|  99.4k|        __m128i x_ref_pos_mask_temp_r0_0;
  989|  99.4k|        __m128i x_ref_pos_mask_temp_r1_0;
  990|       |
  991|  99.4k|        __m128i u1_incr_8x16b_r0_0, ref_arr_temp0_8x16b_r0_0, res0_8x16b_r0_0,
  992|  99.4k|            u1_incr_not_8x16b_r0_0;
  993|  99.4k|        __m128i u1_incr_8x16b_r1_0, ref_arr_temp1_8x16b_r0_0, res1_8x16b_r0_0;
  994|  99.4k|        __m128i u1_y_incr_8x16b_r0_0;
  995|       |
  996|  99.4k|        __m128i u1_incr_not_8x16b_r0_odd, u1_incr_not_8x16b_r1_odd, x_ref_pos_mask_temp_r0_odd,
  997|  99.4k|            x_ref_pos_mask_temp_r1_odd;
  998|  99.4k|        __m128i u1_incr_not_8x16b_r0_even, u1_incr_not_8x16b_r1_even, x_ref_pos_mask_temp_r0_even,
  999|  99.4k|            x_ref_pos_mask_temp_r1_even;
 1000|       |
 1001|  99.4k|        __m128i ref_arr_temp0_8x16b_r1_0, res_8x16b_r0_0, res0_8x16b_r1_0, u1_incr_not_8x16b_r1_0;
 1002|  99.4k|        __m128i ref_arr_temp1_8x16b_r1_0, res_8x16b_r1_0, res1_8x16b_r1_0;
 1003|  99.4k|        __m128i u1_prev_y_incr_8x16b_r0_0;
 1004|  99.4k|        __m128i prev_res_8x16b_r0_0;
 1005|  99.4k|        __m128i prev_res_8x16b_r1_0;
 1006|       |
 1007|  99.4k|        __m128i vert_res0_8x16b_r0_0, res_4x32b_l_0, out_4x32b_l;
 1008|  99.4k|        __m128i vert_res1_8x16b_r0_0, res_4x32b_l_1, out_4x32b_h;
 1009|  99.4k|        __m128i phs_y_mask_16min_8x16b, phs_y_mask_8x16b, phs_y_mask_mix_8x16b;
 1010|  99.4k|        __m128i chroma_mask, chroma_mask2;
 1011|  99.4k|        __m128i zero_8x16b = _mm_set1_epi16(0);
 1012|  99.4k|        WORD32 zero_r0_0, zero_r1_0, zero_r0_r1 = 0;
 1013|  99.4k|        WORD16 *pi2_ref_array_temp;
 1014|  99.4k|        UWORD8 *pu1_ref_x_ptr_incr_temp, *pu1_ref_y_ptr_incr_temp;
 1015|  99.4k|        WORD32 i4_y_phase;
 1016|  99.4k|        WORD32 out_stride_temp;
 1017|  99.4k|        const_ones = _mm_set1_epi8(1);
 1018|  99.4k|        const_ones_8x16b = _mm_set1_epi16(1);
 1019|  99.4k|        const_128 = _mm_set1_epi32(128);
 1020|       |
 1021|   894k|        for(i4_y = 0; i4_y < (i4_temp_array_ht); i4_y++)
  ------------------
  |  Branch (1021:23): [True: 795k, False: 99.4k]
  ------------------
 1022|   795k|        {
 1023|   795k|            arr_y_phase[i4_y] = (WORD8) ps_y_pos_phase[i4_y + i4_frm_mb_y].i2_phase;
 1024|   795k|            arr_y_ref_pos[i4_y] = (WORD8) (ps_y_pos_phase[i4_y + i4_frm_mb_y].i2_ref_pos);
 1025|   795k|        }
 1026|  99.4k|        pi1_y_ref_pos = arr_y_ref_pos;
 1027|  99.4k|        pi1_y_phase = arr_y_phase;
 1028|       |
 1029|   894k|        for(i4_x = 0; i4_x < i4_mb_wd; i4_x++)
  ------------------
  |  Branch (1029:23): [True: 795k, False: 99.4k]
  ------------------
 1030|   795k|        {
 1031|   795k|            arr_x_ref_pos[i4_x] = (WORD8) ps_x_pos_phase[i4_x + i4_frm_mb_x].i2_ref_pos;
 1032|   795k|            arr_x_phase[i4_x] = (WORD8) ps_x_pos_phase[i4_x + i4_frm_mb_x].i2_phase;
 1033|   795k|        }
 1034|       |
 1035|  99.4k|        pi1_x_ref_pos = arr_x_ref_pos;
 1036|  99.4k|        pi1_x_phase = arr_x_phase;
 1037|       |
 1038|  99.4k|        phs_mask_8x16b_0 = _mm_cvtepi8_epi16(_mm_loadu_si128((__m128i *) (pi1_x_phase)));
 1039|  99.4k|        x_ref_pos_mask_r0 = _mm_loadu_si128((__m128i *) (pi1_x_ref_pos));
 1040|       |
 1041|  99.4k|        const_16_8x16b = _mm_set1_epi16(16);
 1042|  99.4k|        chroma_mask = _mm_set1_epi32(0xFFFF0000);
 1043|  99.4k|        chroma_mask2 = _mm_set1_epi32(0x0000FFFF);
 1044|  99.4k|        phs_mask_div8_8x16b_0 = _mm_srli_epi16(phs_mask_8x16b_0, 3);
 1045|  99.4k|        phs_mask_div8_8x16b_0 = _mm_packs_epi16(phs_mask_div8_8x16b_0, const_ones);
 1046|       |
 1047|  99.4k|        phs_mask_16min_8x16b_0 = _mm_sub_epi16(const_16_8x16b, phs_mask_8x16b_0);
 1048|  99.4k|        x_ref_rnd_mask_r0_0 = _mm_add_epi8(x_ref_pos_mask_r0, phs_mask_div8_8x16b_0);
 1049|       |
 1050|   894k|        for(i4_y = 0; i4_y < (i4_temp_array_ht); i4_y++)
  ------------------
  |  Branch (1050:23): [True: 795k, False: 99.4k]
  ------------------
 1051|   795k|        {
 1052|   795k|            if((i4_y > 0) && (pi1_y_ref_pos[i4_y] == pi1_y_ref_pos[i4_y - 1]))
  ------------------
  |  Branch (1052:16): [True: 695k, False: 99.4k]
  |  Branch (1052:30): [True: 230k, False: 465k]
  ------------------
 1053|   230k|            {
 1054|   230k|                if(zero_r0_r1)
  ------------------
  |  Branch (1054:20): [True: 227k, False: 2.67k]
  ------------------
 1055|   227k|                {
 1056|   227k|                    res_4x32b_l_0 = _mm_set1_epi32(0);
 1057|   227k|                    res_4x32b_l_1 = _mm_set1_epi32(0);
 1058|   227k|                    out_stride_temp = (i4_y * i4_out_stride);
 1059|       |
 1060|   227k|                    out_4x32b_l = _mm_loadu_si128((__m128i *) (pi2_out + out_stride_temp));
 1061|   227k|                    out_4x32b_h = _mm_loadu_si128((__m128i *) (pi2_out + out_stride_temp + 8));
 1062|       |
 1063|   227k|                    out_4x32b_l = _mm_and_si128(out_4x32b_l, chroma_mask);
 1064|   227k|                    out_4x32b_h = _mm_and_si128(out_4x32b_h, chroma_mask);
 1065|       |
 1066|   227k|                    res_4x32b_l_0 = _mm_and_si128(res_4x32b_l_0, chroma_mask2);
 1067|   227k|                    res_4x32b_l_1 = _mm_and_si128(res_4x32b_l_1, chroma_mask2);
 1068|       |
 1069|   227k|                    out_4x32b_l = _mm_add_epi8(res_4x32b_l_0, out_4x32b_l);
 1070|   227k|                    out_4x32b_h = _mm_add_epi8(res_4x32b_l_1, out_4x32b_h);
 1071|       |
 1072|   227k|                    _mm_storeu_si128((__m128i *) (pi2_out + out_stride_temp), out_4x32b_l);
 1073|   227k|                    _mm_storeu_si128((__m128i *) (pi2_out + out_stride_temp + 8), out_4x32b_h);
 1074|   227k|                    continue;
 1075|   227k|                }
 1076|       |
 1077|  2.67k|                res_8x16b_r0_0 = prev_res_8x16b_r0_0;
 1078|  2.67k|                res_8x16b_r1_0 = prev_res_8x16b_r1_0;
 1079|       |
 1080|  2.67k|                u1_y_incr_8x16b_r0_0 = u1_prev_y_incr_8x16b_r0_0;
 1081|  2.67k|            }
 1082|   564k|            else
 1083|   564k|            {
 1084|   564k|                pi2_ref_array_temp = pi2_ref_array + ((pi1_y_ref_pos[i4_y]) * i4_refarray_wd);
 1085|   564k|                pu1_ref_x_ptr_incr_temp =
 1086|   564k|                    pu1_ref_x_ptr_incr + ((pi1_y_ref_pos[i4_y]) * i4_refarray_wd);
 1087|   564k|                ref_arr_8x16b_r0_0 = _mm_loadu_si128((__m128i *) (pi2_ref_array_temp));
 1088|   564k|                ref_arr_8x16b_r1_0 =
 1089|   564k|                    _mm_loadu_si128((__m128i *) (pi2_ref_array_temp + i4_refarray_wd));
 1090|       |
 1091|   564k|                zero_r0_0 = _mm_test_all_ones(_mm_cmpeq_epi16(
 1092|   564k|                    ref_arr_8x16b_r0_0, zero_8x16b));  // return 1 if all zeros, else 0
 1093|   564k|                zero_r1_0 = _mm_test_all_ones(_mm_cmpeq_epi16(ref_arr_8x16b_r1_0, zero_8x16b));
 1094|       |
 1095|   564k|                zero_r0_r1 = zero_r0_0 && zero_r1_0;
  ------------------
  |  Branch (1095:30): [True: 558k, False: 6.70k]
  |  Branch (1095:43): [True: 557k, False: 586]
  ------------------
 1096|       |
 1097|   564k|                if(!zero_r0_r1)
  ------------------
  |  Branch (1097:20): [True: 7.29k, False: 557k]
  ------------------
 1098|  7.29k|                {
 1099|  7.29k|                    u1_incr_8x16b_r0_0 = _mm_loadu_si128((__m128i *) (pu1_ref_x_ptr_incr_temp));
 1100|  7.29k|                    u1_incr_8x16b_r1_0 =
 1101|  7.29k|                        _mm_loadu_si128((__m128i *) (pu1_ref_x_ptr_incr_temp + i4_refarray_wd));
 1102|       |
 1103|  7.29k|                    u1_incr_8x16b_r0_0 = _mm_shuffle_epi8(u1_incr_8x16b_r0_0, x_ref_pos_mask_r0);
 1104|  7.29k|                    u1_incr_8x16b_r1_0 = _mm_shuffle_epi8(u1_incr_8x16b_r1_0, x_ref_pos_mask_r0);
 1105|       |
 1106|  7.29k|                    u1_incr_not_8x16b_r0_0 =
 1107|  7.29k|                        _mm_andnot_si128(u1_incr_8x16b_r0_0, phs_mask_div8_8x16b_0);
 1108|  7.29k|                    u1_incr_not_8x16b_r1_0 =
 1109|  7.29k|                        _mm_andnot_si128(u1_incr_8x16b_r1_0, phs_mask_div8_8x16b_0);
 1110|       |
 1111|  7.29k|                    u1_incr_not_8x16b_r0_0 =
 1112|  7.29k|                        _mm_add_epi8(u1_incr_not_8x16b_r0_0, x_ref_pos_mask_r0);
 1113|  7.29k|                    u1_incr_not_8x16b_r1_0 =
 1114|  7.29k|                        _mm_add_epi8(u1_incr_not_8x16b_r1_0, x_ref_pos_mask_r0);
 1115|       |
 1116|  7.29k|                    x_ref_pos_mask_temp_r0_0 =
 1117|  7.29k|                        _mm_add_epi8(u1_incr_not_8x16b_r0_0, u1_incr_8x16b_r0_0);
 1118|  7.29k|                    x_ref_pos_mask_temp_r1_0 =
 1119|  7.29k|                        _mm_add_epi8(u1_incr_not_8x16b_r1_0, u1_incr_8x16b_r1_0);
 1120|       |
 1121|  7.29k|                    u1_incr_not_8x16b_r0_even =
 1122|  7.29k|                        _mm_add_epi8(u1_incr_not_8x16b_r0_0, u1_incr_not_8x16b_r0_0);
 1123|  7.29k|                    u1_incr_not_8x16b_r1_even =
 1124|  7.29k|                        _mm_add_epi8(u1_incr_not_8x16b_r1_0, u1_incr_not_8x16b_r1_0);
 1125|  7.29k|                    x_ref_pos_mask_temp_r0_even =
 1126|  7.29k|                        _mm_add_epi8(x_ref_pos_mask_temp_r0_0, x_ref_pos_mask_temp_r0_0);
 1127|  7.29k|                    x_ref_pos_mask_temp_r1_even =
 1128|  7.29k|                        _mm_add_epi8(x_ref_pos_mask_temp_r1_0, x_ref_pos_mask_temp_r1_0);
 1129|       |
 1130|  7.29k|                    u1_incr_not_8x16b_r0_odd = _mm_add_epi8(u1_incr_not_8x16b_r0_even, const_ones);
 1131|  7.29k|                    u1_incr_not_8x16b_r1_odd = _mm_add_epi8(u1_incr_not_8x16b_r1_even, const_ones);
 1132|  7.29k|                    x_ref_pos_mask_temp_r0_odd =
 1133|  7.29k|                        _mm_add_epi8(x_ref_pos_mask_temp_r0_even, const_ones);
 1134|  7.29k|                    x_ref_pos_mask_temp_r1_odd =
 1135|  7.29k|                        _mm_add_epi8(x_ref_pos_mask_temp_r1_even, const_ones);
 1136|       |
 1137|  7.29k|                    u1_incr_not_8x16b_r0_0 =
 1138|  7.29k|                        _mm_unpacklo_epi8(u1_incr_not_8x16b_r0_even, u1_incr_not_8x16b_r0_odd);
 1139|  7.29k|                    u1_incr_not_8x16b_r1_0 =
 1140|  7.29k|                        _mm_unpacklo_epi8(u1_incr_not_8x16b_r1_even, u1_incr_not_8x16b_r1_odd);
 1141|  7.29k|                    x_ref_pos_mask_temp_r0_0 =
 1142|  7.29k|                        _mm_unpacklo_epi8(x_ref_pos_mask_temp_r0_even, x_ref_pos_mask_temp_r0_odd);
 1143|  7.29k|                    x_ref_pos_mask_temp_r1_0 =
 1144|  7.29k|                        _mm_unpacklo_epi8(x_ref_pos_mask_temp_r1_even, x_ref_pos_mask_temp_r1_odd);
 1145|       |
 1146|  7.29k|                    ref_arr_temp0_8x16b_r0_0 =
 1147|  7.29k|                        _mm_shuffle_epi8(ref_arr_8x16b_r0_0, u1_incr_not_8x16b_r0_0);
 1148|  7.29k|                    ref_arr_temp0_8x16b_r1_0 =
 1149|  7.29k|                        _mm_shuffle_epi8(ref_arr_8x16b_r1_0, u1_incr_not_8x16b_r1_0);
 1150|  7.29k|                    ref_arr_temp1_8x16b_r0_0 =
 1151|  7.29k|                        _mm_shuffle_epi8(ref_arr_8x16b_r0_0, x_ref_pos_mask_temp_r0_0);
 1152|  7.29k|                    ref_arr_temp1_8x16b_r1_0 =
 1153|  7.29k|                        _mm_shuffle_epi8(ref_arr_8x16b_r1_0, x_ref_pos_mask_temp_r1_0);
 1154|       |
 1155|  7.29k|                    res0_8x16b_r0_0 =
 1156|  7.29k|                        _mm_mullo_epi16(ref_arr_temp0_8x16b_r0_0, phs_mask_16min_8x16b_0);
 1157|  7.29k|                    res0_8x16b_r1_0 =
 1158|  7.29k|                        _mm_mullo_epi16(ref_arr_temp0_8x16b_r1_0, phs_mask_16min_8x16b_0);
 1159|  7.29k|                    res1_8x16b_r0_0 = _mm_mullo_epi16(ref_arr_temp1_8x16b_r0_0, phs_mask_8x16b_0);
 1160|  7.29k|                    res1_8x16b_r1_0 = _mm_mullo_epi16(ref_arr_temp1_8x16b_r1_0, phs_mask_8x16b_0);
 1161|       |
 1162|  7.29k|                    res_8x16b_r0_0 = _mm_add_epi16(res0_8x16b_r0_0, res1_8x16b_r0_0);
 1163|  7.29k|                    res_8x16b_r1_0 = _mm_add_epi16(res0_8x16b_r1_0, res1_8x16b_r1_0);
 1164|       |
 1165|  7.29k|                    pu1_ref_y_ptr_incr_temp =
 1166|  7.29k|                        pu1_ref_y_ptr_incr + (pi1_y_ref_pos[i4_y] * i4_refarray_wd);
 1167|  7.29k|                    u1_y_incr_8x16b_r0_0 = _mm_loadu_si128((__m128i *) (pu1_ref_y_ptr_incr_temp));
 1168|       |
 1169|  7.29k|                    u1_y_incr_8x16b_r0_0 =
 1170|  7.29k|                        _mm_shuffle_epi8(u1_y_incr_8x16b_r0_0, x_ref_rnd_mask_r0_0);
 1171|       |
 1172|  7.29k|                    u1_y_incr_8x16b_r0_0 = _mm_cvtepi8_epi16(u1_y_incr_8x16b_r0_0);
 1173|  7.29k|                    u1_y_incr_8x16b_r0_0 = _mm_cmpeq_epi16(u1_y_incr_8x16b_r0_0, const_ones_8x16b);
 1174|  7.29k|                    u1_prev_y_incr_8x16b_r0_0 = u1_y_incr_8x16b_r0_0;
 1175|       |
 1176|  7.29k|                    prev_res_8x16b_r0_0 = res_8x16b_r0_0;
 1177|  7.29k|                    prev_res_8x16b_r1_0 = res_8x16b_r1_0;
 1178|  7.29k|                }
 1179|   564k|            }
 1180|       |
 1181|   567k|            if(zero_r0_r1)
  ------------------
  |  Branch (1181:16): [True: 557k, False: 9.97k]
  ------------------
 1182|   557k|            {
 1183|   557k|                res_4x32b_l_0 = _mm_set1_epi32(0);
 1184|   557k|                res_4x32b_l_1 = _mm_set1_epi32(0);
 1185|   557k|            }
 1186|  9.97k|            else
 1187|  9.97k|            {
 1188|  9.97k|                i4_y_phase = pi1_y_phase[i4_y];
 1189|       |
 1190|  9.97k|                if((i4_y_phase) >> 3)
  ------------------
  |  Branch (1190:20): [True: 6.95k, False: 3.01k]
  ------------------
 1191|  6.95k|                {
 1192|  6.95k|                    vert_res0_8x16b_r0_0 =
 1193|  6.95k|                        _mm_blendv_epi8(res_8x16b_r1_0, res_8x16b_r0_0, u1_y_incr_8x16b_r0_0);
 1194|  6.95k|                    vert_res1_8x16b_r0_0 =
 1195|  6.95k|                        _mm_blendv_epi8(res_8x16b_r1_0, res_8x16b_r1_0, u1_y_incr_8x16b_r0_0);
 1196|  6.95k|                }
 1197|  3.01k|                else
 1198|  3.01k|                {
 1199|  3.01k|                    vert_res0_8x16b_r0_0 =
 1200|  3.01k|                        _mm_blendv_epi8(res_8x16b_r0_0, res_8x16b_r0_0, u1_y_incr_8x16b_r0_0);
 1201|  3.01k|                    vert_res1_8x16b_r0_0 =
 1202|  3.01k|                        _mm_blendv_epi8(res_8x16b_r0_0, res_8x16b_r1_0, u1_y_incr_8x16b_r0_0);
 1203|  3.01k|                }
 1204|       |
 1205|  9.97k|                res0_8x16b_r0_0 = _mm_unpacklo_epi16(vert_res0_8x16b_r0_0, vert_res1_8x16b_r0_0);
 1206|  9.97k|                res1_8x16b_r0_0 = _mm_unpackhi_epi16(vert_res0_8x16b_r0_0, vert_res1_8x16b_r0_0);
 1207|       |
 1208|  9.97k|                phs_y_mask_16min_8x16b = _mm_set1_epi16(16 - i4_y_phase);
 1209|  9.97k|                phs_y_mask_8x16b = _mm_set1_epi16(i4_y_phase);
 1210|  9.97k|                phs_y_mask_mix_8x16b = _mm_unpacklo_epi16(phs_y_mask_16min_8x16b, phs_y_mask_8x16b);
 1211|       |
 1212|  9.97k|                res_4x32b_l_0 = _mm_madd_epi16(res0_8x16b_r0_0, phs_y_mask_mix_8x16b);
 1213|  9.97k|                res_4x32b_l_1 = _mm_madd_epi16(res1_8x16b_r0_0, phs_y_mask_mix_8x16b);
 1214|  9.97k|                res_4x32b_l_0 = _mm_add_epi32(res_4x32b_l_0, const_128);
 1215|  9.97k|                res_4x32b_l_1 = _mm_add_epi32(res_4x32b_l_1, const_128);
 1216|       |
 1217|  9.97k|                res_4x32b_l_0 = _mm_srai_epi32(res_4x32b_l_0, 8);
 1218|  9.97k|                res_4x32b_l_1 = _mm_srai_epi32(res_4x32b_l_1, 8);
 1219|  9.97k|            }
 1220|   567k|            out_stride_temp = (i4_y * i4_out_stride);
 1221|       |
 1222|   567k|            out_4x32b_l = _mm_loadu_si128((__m128i *) (pi2_out + out_stride_temp));
 1223|   567k|            out_4x32b_h = _mm_loadu_si128((__m128i *) (pi2_out + out_stride_temp + 8));
 1224|       |
 1225|   567k|            out_4x32b_l = _mm_and_si128(out_4x32b_l, chroma_mask);
 1226|   567k|            out_4x32b_h = _mm_and_si128(out_4x32b_h, chroma_mask);
 1227|       |
 1228|   567k|            res_4x32b_l_0 = _mm_and_si128(res_4x32b_l_0, chroma_mask2);
 1229|   567k|            res_4x32b_l_1 = _mm_and_si128(res_4x32b_l_1, chroma_mask2);
 1230|       |
 1231|   567k|            out_4x32b_l = _mm_add_epi8(res_4x32b_l_0, out_4x32b_l);
 1232|   567k|            out_4x32b_h = _mm_add_epi8(res_4x32b_l_1, out_4x32b_h);
 1233|       |
 1234|   567k|            _mm_storeu_si128((__m128i *) (pi2_out + out_stride_temp), out_4x32b_l);
 1235|   567k|            _mm_storeu_si128((__m128i *) (pi2_out + out_stride_temp + 8), out_4x32b_h);
 1236|   567k|        }
 1237|  99.4k|    }
 1238|   149k|    return;
 1239|   149k|} /* End of Interpolation Function */
isvcd_residual_reflayer_const_non_boundary_mb_sse42:
 1268|  40.0k|{
 1269|  40.0k|    WORD32 i4_y;
 1270|       |
 1271|  40.0k|    WORD16 *pi2_ref_data_byte;
 1272|  40.0k|    WORD16 *pi2_ref_array_temp;
 1273|  40.0k|    if(i4_chroma_flag == 0)
  ------------------
  |  Branch (1273:8): [True: 13.3k, False: 26.6k]
  ------------------
 1274|  13.3k|    {
 1275|  13.3k|        WORD8 index_0[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
 1276|  13.3k|        __m128i ref_mb_type_8x16_q0, ref_mb_type_8x16_q1, ref_mb_type_8x16_q2, ref_mb_type_8x16_q3,
 1277|  13.3k|            mb_quard1_part_x_8x16;
 1278|  13.3k|        __m128i ref_mb_type_8x16_0, ref_mb_type_8x16_1;
 1279|  13.3k|        __m128i ref_mb_type_8x16_low_0, ref_mb_type_8x16_low_1;
 1280|  13.3k|        __m128i mb_type_mask_8x16_0 = _mm_set1_epi8(-1);
 1281|  13.3k|        __m128i mb_type_mask_8x16_1 = _mm_set1_epi8(-1);
 1282|  13.3k|        __m128i mb_type_mask_8x16_low_0, mb_type_mask_8x16_low_1;
 1283|  13.3k|        __m128i mask_8x16_0;
 1284|  13.3k|        __m128i index_arr_0;
 1285|  13.3k|        __m128i inp_data_16x8_0, inp_data_16x8_1;
 1286|  13.3k|        __m128i res_16x8_0, res_16x8_1;
 1287|  13.3k|        __m128i one_8x16 = _mm_set1_epi8(1);
 1288|  13.3k|        __m128i zero_8x16 = _mm_set1_epi8(0);
 1289|       |
 1290|  13.3k|        index_arr_0 = _mm_loadu_si128((__m128i *) index_0);
 1291|  13.3k|        ref_mb_type_8x16_q0 = _mm_set1_epi8(i4_ref_mb_type_q0);
 1292|  13.3k|        ref_mb_type_8x16_q1 = _mm_set1_epi8(i4_ref_mb_type_q1);
 1293|  13.3k|        ref_mb_type_8x16_q2 = _mm_set1_epi8(i4_ref_mb_type_q2);
 1294|  13.3k|        ref_mb_type_8x16_q3 = _mm_set1_epi8(i4_ref_mb_type_q3);
 1295|  13.3k|        if((i4_mb_quard1_part_x >= i4_refarray_wd) && (i4_mb_quard1_part_y >= i4_refarray_ht))
  ------------------
  |  Branch (1295:12): [True: 0, False: 13.3k]
  |  Branch (1295:55): [True: 0, False: 0]
  ------------------
 1296|      0|        {
 1297|       |            // Quard 0
 1298|      0|            ref_mb_type_8x16_0 = ref_mb_type_8x16_q0;
 1299|      0|            ref_mb_type_8x16_1 = ref_mb_type_8x16_q0;
 1300|      0|            mb_type_mask_8x16_0 = _mm_cmpeq_epi8(ref_mb_type_8x16_0, one_8x16);
 1301|      0|            mb_type_mask_8x16_1 = mb_type_mask_8x16_0;
 1302|      0|        }
 1303|  13.3k|        else if((i4_mb_quard1_part_y >= (i4_refarray_ht - 1)) &&
  ------------------
  |  Branch (1303:17): [True: 4.34k, False: 8.99k]
  ------------------
 1304|  4.34k|                (i4_mb_quard1_part_x < i4_refarray_wd))
  ------------------
  |  Branch (1304:17): [True: 4.34k, False: 0]
  ------------------
 1305|  4.34k|        {
 1306|       |            // Quard 0 & 1
 1307|  4.34k|            if(i4_mb_quard1_part_x == 8)
  ------------------
  |  Branch (1307:16): [True: 0, False: 4.34k]
  ------------------
 1308|      0|            {
 1309|      0|                ref_mb_type_8x16_0 = ref_mb_type_8x16_q0;
 1310|      0|                ref_mb_type_8x16_1 = ref_mb_type_8x16_q1;
 1311|      0|            }
 1312|  4.34k|            else if(i4_mb_quard1_part_x < 8)
  ------------------
  |  Branch (1312:21): [True: 4.34k, False: 0]
  ------------------
 1313|  4.34k|            {
 1314|  4.34k|                mb_quard1_part_x_8x16 = _mm_set1_epi8((i4_mb_quard1_part_x << 1));
 1315|  4.34k|                mask_8x16_0 =
 1316|  4.34k|                    _mm_cmplt_epi8(index_arr_0, mb_quard1_part_x_8x16);  // return 1 if a<b, else 0
 1317|       |
 1318|  4.34k|                ref_mb_type_8x16_0 =
 1319|  4.34k|                    _mm_blendv_epi8(ref_mb_type_8x16_q1, ref_mb_type_8x16_q0, mask_8x16_0);
 1320|  4.34k|                ref_mb_type_8x16_1 = ref_mb_type_8x16_q1;
 1321|  4.34k|            }
 1322|      0|            else
 1323|      0|            {
 1324|      0|                mb_quard1_part_x_8x16 = _mm_set1_epi8((i4_mb_quard1_part_x - 8) << 1);
 1325|      0|                mask_8x16_0 =
 1326|      0|                    _mm_cmplt_epi8(index_arr_0, mb_quard1_part_x_8x16);  // return 1 if a<b, else 0
 1327|       |
 1328|      0|                ref_mb_type_8x16_0 = ref_mb_type_8x16_q0;
 1329|      0|                ref_mb_type_8x16_1 =
 1330|      0|                    _mm_blendv_epi8(ref_mb_type_8x16_q1, ref_mb_type_8x16_q0, mask_8x16_0);
 1331|      0|            }
 1332|       |
 1333|  4.34k|            mb_type_mask_8x16_0 = _mm_cmpeq_epi8(ref_mb_type_8x16_0, one_8x16);
 1334|  4.34k|            mb_type_mask_8x16_1 = _mm_cmpeq_epi8(ref_mb_type_8x16_1, one_8x16);
 1335|  4.34k|        }
 1336|  8.99k|        else
 1337|  8.99k|        {
 1338|  8.99k|            if(i4_mb_quard1_part_x >= i4_refarray_wd)
  ------------------
  |  Branch (1338:16): [True: 0, False: 8.99k]
  ------------------
 1339|      0|            {
 1340|      0|                ref_mb_type_8x16_0 = ref_mb_type_8x16_q0;
 1341|      0|                ref_mb_type_8x16_1 = ref_mb_type_8x16_q0;
 1342|       |
 1343|      0|                ref_mb_type_8x16_low_0 = ref_mb_type_8x16_q2;
 1344|      0|                ref_mb_type_8x16_low_1 = ref_mb_type_8x16_q2;
 1345|      0|            }
 1346|  8.99k|            else
 1347|  8.99k|            {
 1348|       |                // Quard 0, 1, 2, 3
 1349|  8.99k|                if(i4_mb_quard1_part_x == 8)
  ------------------
  |  Branch (1349:20): [True: 0, False: 8.99k]
  ------------------
 1350|      0|                {
 1351|      0|                    ref_mb_type_8x16_0 = ref_mb_type_8x16_q0;
 1352|      0|                    ref_mb_type_8x16_1 = ref_mb_type_8x16_q1;
 1353|       |
 1354|      0|                    ref_mb_type_8x16_low_0 = ref_mb_type_8x16_q2;
 1355|      0|                    ref_mb_type_8x16_low_1 = ref_mb_type_8x16_q3;
 1356|      0|                }
 1357|  8.99k|                else if(i4_mb_quard1_part_x < 8)
  ------------------
  |  Branch (1357:25): [True: 8.99k, False: 0]
  ------------------
 1358|  8.99k|                {
 1359|  8.99k|                    mb_quard1_part_x_8x16 = _mm_set1_epi8((i4_mb_quard1_part_x << 1));
 1360|  8.99k|                    mask_8x16_0 = _mm_cmplt_epi8(index_arr_0,
 1361|  8.99k|                                                 mb_quard1_part_x_8x16);  // return 1 if a<b, else 0
 1362|       |
 1363|  8.99k|                    ref_mb_type_8x16_0 =
 1364|  8.99k|                        _mm_blendv_epi8(ref_mb_type_8x16_q1, ref_mb_type_8x16_q0, mask_8x16_0);
 1365|  8.99k|                    ref_mb_type_8x16_1 = ref_mb_type_8x16_q1;
 1366|       |
 1367|  8.99k|                    ref_mb_type_8x16_low_0 =
 1368|  8.99k|                        _mm_blendv_epi8(ref_mb_type_8x16_q3, ref_mb_type_8x16_q2, mask_8x16_0);
 1369|  8.99k|                    ref_mb_type_8x16_low_1 = ref_mb_type_8x16_q3;
 1370|  8.99k|                }
 1371|      0|                else
 1372|      0|                {
 1373|      0|                    mb_quard1_part_x_8x16 = _mm_set1_epi8((i4_mb_quard1_part_x - 8) << 1);
 1374|      0|                    mask_8x16_0 = _mm_cmplt_epi8(index_arr_0,
 1375|      0|                                                 mb_quard1_part_x_8x16);  // return 1 if a<b, else 0
 1376|       |
 1377|      0|                    ref_mb_type_8x16_0 = ref_mb_type_8x16_q0;
 1378|      0|                    ref_mb_type_8x16_1 =
 1379|      0|                        _mm_blendv_epi8(ref_mb_type_8x16_q1, ref_mb_type_8x16_q0, mask_8x16_0);
 1380|       |
 1381|      0|                    ref_mb_type_8x16_low_0 = ref_mb_type_8x16_q2;
 1382|      0|                    ref_mb_type_8x16_low_1 =
 1383|      0|                        _mm_blendv_epi8(ref_mb_type_8x16_q3, ref_mb_type_8x16_q2, mask_8x16_0);
 1384|      0|                }
 1385|  8.99k|                mb_type_mask_8x16_0 = _mm_cmpeq_epi8(ref_mb_type_8x16_0, one_8x16);
 1386|  8.99k|                mb_type_mask_8x16_1 = _mm_cmpeq_epi8(ref_mb_type_8x16_1, one_8x16);
 1387|       |
 1388|  8.99k|                mb_type_mask_8x16_low_0 = _mm_cmpeq_epi8(ref_mb_type_8x16_low_0, one_8x16);
 1389|  8.99k|                mb_type_mask_8x16_low_1 = _mm_cmpeq_epi8(ref_mb_type_8x16_low_1, one_8x16);
 1390|  8.99k|            }
 1391|  8.99k|        }
 1392|       |
 1393|  13.3k|        if(i4_mb_quard1_part_y < i4_refarray_ht - 1)
  ------------------
  |  Branch (1393:12): [True: 8.99k, False: 4.34k]
  ------------------
 1394|  8.99k|        {
 1395|   116k|            for(i4_y = 0; i4_y < i4_refarray_ht; i4_y++)
  ------------------
  |  Branch (1395:27): [True: 107k, False: 8.99k]
  ------------------
 1396|   107k|            {
 1397|   107k|                pi2_ref_data_byte = pi2_inp_data + (i4_y * i4_inp_data_stride);
 1398|   107k|                inp_data_16x8_0 = _mm_loadu_si128((__m128i *) (pi2_ref_data_byte));
 1399|   107k|                inp_data_16x8_1 = _mm_loadu_si128((__m128i *) (pi2_ref_data_byte + 8));
 1400|       |
 1401|   107k|                if(i4_y < i4_mb_quard1_part_y)
  ------------------
  |  Branch (1401:20): [True: 35.9k, False: 71.9k]
  ------------------
 1402|  35.9k|                {
 1403|  35.9k|                    res_16x8_0 = _mm_blendv_epi8(zero_8x16, inp_data_16x8_0, mb_type_mask_8x16_0);
 1404|  35.9k|                    res_16x8_1 = _mm_blendv_epi8(zero_8x16, inp_data_16x8_1, mb_type_mask_8x16_1);
 1405|  35.9k|                }
 1406|  71.9k|                else
 1407|  71.9k|                {
 1408|  71.9k|                    res_16x8_0 =
 1409|  71.9k|                        _mm_blendv_epi8(zero_8x16, inp_data_16x8_0, mb_type_mask_8x16_low_0);
 1410|  71.9k|                    res_16x8_1 =
 1411|  71.9k|                        _mm_blendv_epi8(zero_8x16, inp_data_16x8_1, mb_type_mask_8x16_low_1);
 1412|  71.9k|                }
 1413|       |
 1414|   107k|                pi2_ref_array_temp = pi2_ref_array + (i4_y * i4_refarray_wd);
 1415|   107k|                _mm_storeu_si128((__m128i *) (pi2_ref_array_temp), res_16x8_0);
 1416|   107k|                _mm_storeu_si128((__m128i *) (pi2_ref_array_temp + 8), res_16x8_1);
 1417|   107k|            }
 1418|  8.99k|        }
 1419|  4.34k|        else
 1420|  4.34k|        {
 1421|  56.4k|            for(i4_y = 0; i4_y < i4_refarray_ht; i4_y++)
  ------------------
  |  Branch (1421:27): [True: 52.1k, False: 4.34k]
  ------------------
 1422|  52.1k|            {
 1423|  52.1k|                pi2_ref_data_byte = pi2_inp_data + (i4_y * i4_inp_data_stride);
 1424|  52.1k|                inp_data_16x8_0 = _mm_loadu_si128((__m128i *) (pi2_ref_data_byte));
 1425|  52.1k|                inp_data_16x8_1 = _mm_loadu_si128((__m128i *) (pi2_ref_data_byte + 8));
 1426|       |
 1427|  52.1k|                res_16x8_0 = _mm_blendv_epi8(zero_8x16, inp_data_16x8_0, mb_type_mask_8x16_0);
 1428|  52.1k|                res_16x8_1 = _mm_blendv_epi8(zero_8x16, inp_data_16x8_1, mb_type_mask_8x16_1);
 1429|       |
 1430|  52.1k|                pi2_ref_array_temp = pi2_ref_array + (i4_y * i4_refarray_wd);
 1431|  52.1k|                _mm_storeu_si128((__m128i *) (pi2_ref_array_temp), res_16x8_0);
 1432|  52.1k|                _mm_storeu_si128((__m128i *) (pi2_ref_array_temp + 8), res_16x8_1);
 1433|  52.1k|            }
 1434|  4.34k|        }
 1435|  13.3k|    }
 1436|  26.6k|    else
 1437|  26.6k|    {
 1438|  26.6k|        WORD8 index_0[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15};
 1439|  26.6k|        WORD8 even_mask_arr[16] = {0, 1, 4, 5, 8, 9, 12, 13, 2, 3, 6, 7, 10, 11, 14, 15};
 1440|  26.6k|        __m128i ref_mb_type_8x16_q0, ref_mb_type_8x16_q1, ref_mb_type_8x16_q2, ref_mb_type_8x16_q3,
 1441|  26.6k|            mb_quard1_part_x_8x16;
 1442|  26.6k|        __m128i ref_mb_type_8x16_0;
 1443|  26.6k|        __m128i ref_mb_type_8x16_low_0;
 1444|  26.6k|        __m128i mb_type_mask_8x16_0 = _mm_set1_epi8(-1);
 1445|  26.6k|        __m128i mb_type_mask_8x16_low_0;
 1446|  26.6k|        __m128i mask_8x16_0;
 1447|  26.6k|        __m128i index_arr_0, even_mask;
 1448|  26.6k|        __m128i inp_data_16x8_0, inp_data_16x8_1, inp_data_16x8;
 1449|  26.6k|        __m128i res_16x8_0;
 1450|  26.6k|        __m128i one_8x16 = _mm_set1_epi8(1);
 1451|  26.6k|        __m128i zero_8x16 = _mm_set1_epi8(0);
 1452|       |
 1453|  26.6k|        index_arr_0 = _mm_loadu_si128((__m128i *) index_0);
 1454|  26.6k|        even_mask = _mm_loadu_si128((__m128i *) even_mask_arr);
 1455|       |
 1456|  26.6k|        ref_mb_type_8x16_q0 = _mm_set1_epi8(i4_ref_mb_type_q0);
 1457|  26.6k|        ref_mb_type_8x16_q1 = _mm_set1_epi8(i4_ref_mb_type_q1);
 1458|  26.6k|        ref_mb_type_8x16_q2 = _mm_set1_epi8(i4_ref_mb_type_q2);
 1459|  26.6k|        ref_mb_type_8x16_q3 = _mm_set1_epi8(i4_ref_mb_type_q3);
 1460|  26.6k|        if((i4_mb_quard1_part_x >= i4_refarray_wd) && (i4_mb_quard1_part_y >= i4_refarray_ht))
  ------------------
  |  Branch (1460:12): [True: 0, False: 26.6k]
  |  Branch (1460:55): [True: 0, False: 0]
  ------------------
 1461|      0|        {
 1462|       |            // Quard 0
 1463|      0|            ref_mb_type_8x16_0 = ref_mb_type_8x16_q0;
 1464|      0|            mb_type_mask_8x16_0 = _mm_cmpeq_epi8(ref_mb_type_8x16_0, one_8x16);
 1465|      0|        }
 1466|  26.6k|        else if((i4_mb_quard1_part_y >= (i4_refarray_ht - 1)) &&
  ------------------
  |  Branch (1466:17): [True: 8.69k, False: 17.9k]
  ------------------
 1467|  8.69k|                (i4_mb_quard1_part_x < i4_refarray_wd))
  ------------------
  |  Branch (1467:17): [True: 8.69k, False: 0]
  ------------------
 1468|  8.69k|        {
 1469|       |            // Quard 0 & 1
 1470|  8.69k|            mb_quard1_part_x_8x16 = _mm_set1_epi8((i4_mb_quard1_part_x << 1));
 1471|  8.69k|            mask_8x16_0 =
 1472|  8.69k|                _mm_cmplt_epi8(index_arr_0, mb_quard1_part_x_8x16);  // return 1 if a<b, else 0
 1473|       |
 1474|  8.69k|            ref_mb_type_8x16_0 =
 1475|  8.69k|                _mm_blendv_epi8(ref_mb_type_8x16_q1, ref_mb_type_8x16_q0, mask_8x16_0);
 1476|  8.69k|            mb_type_mask_8x16_0 = _mm_cmpeq_epi8(ref_mb_type_8x16_0, one_8x16);
 1477|  8.69k|        }
 1478|  17.9k|        else
 1479|  17.9k|        {
 1480|  17.9k|            if(i4_mb_quard1_part_x >= i4_refarray_wd)
  ------------------
  |  Branch (1480:16): [True: 0, False: 17.9k]
  ------------------
 1481|      0|            {
 1482|       |                // Quard 0 & 2
 1483|      0|                ref_mb_type_8x16_0 = ref_mb_type_8x16_q0;
 1484|      0|                ref_mb_type_8x16_low_0 = ref_mb_type_8x16_q2;
 1485|      0|            }
 1486|  17.9k|            else
 1487|  17.9k|            {
 1488|       |                // Quard 0, 1, 2, 3
 1489|  17.9k|                mb_quard1_part_x_8x16 = _mm_set1_epi8((i4_mb_quard1_part_x << 1));
 1490|  17.9k|                mask_8x16_0 =
 1491|  17.9k|                    _mm_cmplt_epi8(index_arr_0, mb_quard1_part_x_8x16);  // return 1 if a<b, else 0
 1492|       |
 1493|  17.9k|                ref_mb_type_8x16_0 =
 1494|  17.9k|                    _mm_blendv_epi8(ref_mb_type_8x16_q1, ref_mb_type_8x16_q0, mask_8x16_0);
 1495|  17.9k|                ref_mb_type_8x16_low_0 =
 1496|  17.9k|                    _mm_blendv_epi8(ref_mb_type_8x16_q3, ref_mb_type_8x16_q2, mask_8x16_0);
 1497|       |
 1498|  17.9k|                mb_type_mask_8x16_0 = _mm_cmpeq_epi8(ref_mb_type_8x16_0, one_8x16);
 1499|  17.9k|                mb_type_mask_8x16_low_0 = _mm_cmpeq_epi8(ref_mb_type_8x16_low_0, one_8x16);
 1500|  17.9k|            }
 1501|  17.9k|        }
 1502|       |
 1503|  26.6k|        if(i4_mb_quard1_part_y < i4_refarray_ht - 1)
  ------------------
  |  Branch (1503:12): [True: 17.9k, False: 8.69k]
  ------------------
 1504|  17.9k|        {
 1505|   133k|            for(i4_y = 0; i4_y < i4_refarray_ht; i4_y++)
  ------------------
  |  Branch (1505:27): [True: 115k, False: 17.9k]
  ------------------
 1506|   115k|            {
 1507|   115k|                pi2_ref_data_byte = pi2_inp_data + (i4_y * i4_inp_data_stride);
 1508|   115k|                inp_data_16x8_0 = _mm_loadu_si128((__m128i *) (pi2_ref_data_byte));
 1509|   115k|                inp_data_16x8_1 = _mm_loadu_si128((__m128i *) (pi2_ref_data_byte + 8));
 1510|       |
 1511|   115k|                inp_data_16x8_0 = _mm_shuffle_epi8(inp_data_16x8_0, even_mask);
 1512|   115k|                inp_data_16x8_1 = _mm_shuffle_epi8(inp_data_16x8_1, even_mask);
 1513|       |
 1514|   115k|                inp_data_16x8 = _mm_unpacklo_epi64(inp_data_16x8_0, inp_data_16x8_1);
 1515|   115k|                if(i4_y < i4_mb_quard1_part_y)
  ------------------
  |  Branch (1515:20): [True: 39.5k, False: 75.5k]
  ------------------
 1516|  39.5k|                {
 1517|  39.5k|                    res_16x8_0 = _mm_blendv_epi8(zero_8x16, inp_data_16x8, mb_type_mask_8x16_0);
 1518|  39.5k|                }
 1519|  75.5k|                else
 1520|  75.5k|                {
 1521|  75.5k|                    res_16x8_0 = _mm_blendv_epi8(zero_8x16, inp_data_16x8, mb_type_mask_8x16_low_0);
 1522|  75.5k|                }
 1523|       |
 1524|   115k|                pi2_ref_array_temp = pi2_ref_array + (i4_y * i4_refarray_wd);
 1525|   115k|                _mm_storeu_si128((__m128i *) (pi2_ref_array_temp), res_16x8_0);
 1526|   115k|            }
 1527|  17.9k|        }
 1528|  8.69k|        else
 1529|  8.69k|        {
 1530|  69.5k|            for(i4_y = 0; i4_y < i4_refarray_ht; i4_y++)
  ------------------
  |  Branch (1530:27): [True: 60.8k, False: 8.69k]
  ------------------
 1531|  60.8k|            {
 1532|  60.8k|                pi2_ref_data_byte = pi2_inp_data + (i4_y * i4_inp_data_stride);
 1533|  60.8k|                inp_data_16x8_0 = _mm_loadu_si128((__m128i *) (pi2_ref_data_byte));
 1534|  60.8k|                inp_data_16x8_1 = _mm_loadu_si128((__m128i *) (pi2_ref_data_byte + 8));
 1535|       |
 1536|  60.8k|                inp_data_16x8_0 = _mm_shuffle_epi8(inp_data_16x8_0, even_mask);
 1537|  60.8k|                inp_data_16x8_1 = _mm_shuffle_epi8(inp_data_16x8_1, even_mask);
 1538|  60.8k|                inp_data_16x8 = _mm_unpacklo_epi64(inp_data_16x8_0, inp_data_16x8_1);
 1539|       |
 1540|  60.8k|                res_16x8_0 = _mm_blendv_epi8(zero_8x16, inp_data_16x8, mb_type_mask_8x16_0);
 1541|  60.8k|                pi2_ref_array_temp = pi2_ref_array + (i4_y * i4_refarray_wd);
 1542|  60.8k|                _mm_storeu_si128((__m128i *) (pi2_ref_array_temp), res_16x8_0);
 1543|  60.8k|            }
 1544|  8.69k|        }
 1545|  26.6k|    }
 1546|  40.0k|}

_Z17iv_aligned_mallocPvii:
   82|  3.61M|{
   83|  3.61M|    void *buf = NULL;
   84|  3.61M|    (void) ctxt;
   85|  3.61M|    if(0 != posix_memalign(&buf, alignment, size))
  ------------------
  |  Branch (85:8): [True: 0, False: 3.61M]
  ------------------
   86|      0|    {
   87|      0|        return NULL;
   88|      0|    }
   89|  3.61M|    return buf;
   90|  3.61M|}
_Z15iv_aligned_freePvS_:
   93|  3.61M|{
   94|  3.61M|    (void) ctxt;
   95|  3.61M|    free(buf);
   96|  3.61M|}
_ZN5CodecC2E17IV_COLOR_FORMAT_Tm:
  126|  21.5k|{
  127|  21.5k|    mColorFormat = colorFormat;
  128|  21.5k|    mNumCores = numCores;
  129|  21.5k|    mCodec = nullptr;
  130|  21.5k|    mWidth = 0;
  131|  21.5k|    mHeight = 0;
  132|       |
  133|  21.5k|    memset(&mOutBufHandle, 0, sizeof(mOutBufHandle));
  134|  21.5k|}
_ZN5CodecD2Ev:
  136|  21.5k|Codec::~Codec() {}
_ZN5Codec11createCodecEv:
  138|  21.5k|{
  139|  21.5k|    IV_API_CALL_STATUS_T ret;
  140|  21.5k|    ih264d_create_ip_t create_ip{};
  141|  21.5k|    ih264d_create_op_t create_op{};
  142|  21.5k|    void *fxns = (void *) &ivd_api_function;
  ------------------
  |  |   55|  21.5k|#define ivd_api_function isvcd_api_function
  ------------------
  143|       |
  144|  21.5k|    create_ip.s_ivd_create_ip_t.e_cmd = IVD_CMD_CREATE;
  145|  21.5k|    create_ip.s_ivd_create_ip_t.u4_share_disp_buf = 0;
  146|  21.5k|    create_ip.s_ivd_create_ip_t.e_output_format = mColorFormat;
  147|  21.5k|    create_ip.s_ivd_create_ip_t.pf_aligned_alloc = iv_aligned_malloc;
  148|  21.5k|    create_ip.s_ivd_create_ip_t.pf_aligned_free = iv_aligned_free;
  149|  21.5k|    create_ip.s_ivd_create_ip_t.pv_mem_ctxt = NULL;
  150|  21.5k|    create_ip.s_ivd_create_ip_t.u4_size = sizeof(ih264d_create_ip_t);
  151|  21.5k|    create_op.s_ivd_create_op_t.u4_size = sizeof(ih264d_create_op_t);
  152|       |
  153|  21.5k|    ret = ivd_api_function(NULL, (void *) &create_ip, (void *) &create_op);
  ------------------
  |  |   55|  21.5k|#define ivd_api_function isvcd_api_function
  ------------------
  154|  21.5k|    if(ret != IV_SUCCESS)
  ------------------
  |  Branch (154:8): [True: 19, False: 21.5k]
  ------------------
  155|     19|    {
  156|     19|        return;
  157|     19|    }
  158|  21.5k|    mCodec = (iv_obj_t *) create_op.s_ivd_create_op_t.pv_handle;
  159|  21.5k|    mCodec->pv_fxns = fxns;
  160|  21.5k|    mCodec->u4_size = sizeof(iv_obj_t);
  161|  21.5k|}
_ZN5Codec11deleteCodecEv:
  164|  21.5k|{
  165|  21.5k|    ivd_delete_ip_t delete_ip{};
  166|  21.5k|    ivd_delete_op_t delete_op{};
  167|       |
  168|  21.5k|    delete_ip.e_cmd = IVD_CMD_DELETE;
  169|  21.5k|    delete_ip.u4_size = sizeof(ivd_delete_ip_t);
  170|  21.5k|    delete_op.u4_size = sizeof(ivd_delete_op_t);
  171|       |
  172|  21.5k|    ivd_api_function(mCodec, (void *) &delete_ip, (void *) &delete_op);
  ------------------
  |  |   55|  21.5k|#define ivd_api_function isvcd_api_function
  ------------------
  173|  21.5k|}
_ZN5Codec10resetCodecEv:
  176|  4.12k|{
  177|  4.12k|    ivd_ctl_reset_ip_t s_ctl_ip{};
  178|  4.12k|    ivd_ctl_reset_op_t s_ctl_op{};
  179|       |
  180|  4.12k|    s_ctl_ip.e_cmd = IVD_CMD_VIDEO_CTL;
  181|  4.12k|    s_ctl_ip.e_sub_cmd = IVD_CMD_CTL_RESET;
  182|  4.12k|    s_ctl_ip.u4_size = sizeof(ivd_ctl_reset_ip_t);
  183|  4.12k|    s_ctl_op.u4_size = sizeof(ivd_ctl_reset_op_t);
  184|       |
  185|  4.12k|    ivd_api_function(mCodec, (void *) &s_ctl_ip, (void *) &s_ctl_op);
  ------------------
  |  |   55|  4.12k|#define ivd_api_function isvcd_api_function
  ------------------
  186|  4.12k|}
_ZN5Codec8setCoresEv:
  189|  21.5k|{
  190|  21.5k|    ih264d_ctl_set_num_cores_ip_t s_ctl_ip{};
  191|  21.5k|    ih264d_ctl_set_num_cores_op_t s_ctl_op{};
  192|       |
  193|  21.5k|    s_ctl_ip.e_cmd = IVD_CMD_VIDEO_CTL;
  194|  21.5k|    s_ctl_ip.e_sub_cmd = (IVD_CONTROL_API_COMMAND_TYPE_T) IH264D_CMD_CTL_SET_NUM_CORES;
  195|  21.5k|    s_ctl_ip.u4_num_cores = mNumCores;
  196|  21.5k|    s_ctl_ip.u4_size = sizeof(ih264d_ctl_set_num_cores_ip_t);
  197|  21.5k|    s_ctl_op.u4_size = sizeof(ih264d_ctl_set_num_cores_op_t);
  198|       |
  199|  21.5k|    ivd_api_function(mCodec, (void *) &s_ctl_ip, (void *) &s_ctl_op);
  ------------------
  |  |   55|  21.5k|#define ivd_api_function isvcd_api_function
  ------------------
  200|  21.5k|}
_ZN5Codec11setTgtLayerEm:
  203|  21.5k|{
  204|  21.5k|    isvcd_set_target_layer_ip_t s_ctl_set_target_layer_ip{};
  205|  21.5k|    isvcd_set_target_layer_op_t s_ctl_set_target_layer_op{};
  206|       |
  207|  21.5k|    s_ctl_set_target_layer_ip.e_cmd = IVD_CMD_VIDEO_CTL;
  208|  21.5k|    s_ctl_set_target_layer_ip.e_sub_cmd =
  209|  21.5k|        (IVD_CONTROL_API_COMMAND_TYPE_T) ISVCD_CMD_CTL_SET_TGT_LAYER;
  210|  21.5k|    s_ctl_set_target_layer_ip.u1_tgt_priority_id = 63;
  211|  21.5k|    s_ctl_set_target_layer_ip.u1_tgt_temp_id = 7;
  212|  21.5k|    s_ctl_set_target_layer_ip.u1_tgt_quality_id = 0;
  213|  21.5k|    s_ctl_set_target_layer_ip.u1_tgt_dep_id = TgtLayer;
  214|  21.5k|    s_ctl_set_target_layer_ip.u4_size = sizeof(isvcd_set_target_layer_ip_t);
  215|  21.5k|    s_ctl_set_target_layer_op.u4_size = sizeof(isvcd_set_target_layer_op_t);
  216|       |
  217|  21.5k|    ivd_api_function(mCodec, (void *) &s_ctl_set_target_layer_ip,
  ------------------
  |  |   55|  21.5k|#define ivd_api_function isvcd_api_function
  ------------------
  218|  21.5k|                     (void *) &s_ctl_set_target_layer_op);
  219|  21.5k|}
_ZN5Codec9setParamsE23IVD_VIDEO_DECODE_MODE_T:
  222|  43.1k|{
  223|  43.1k|    ivd_ctl_set_config_ip_t s_ctl_ip{};
  224|  43.1k|    ivd_ctl_set_config_op_t s_ctl_op{};
  225|       |
  226|  43.1k|    s_ctl_ip.u4_disp_wd = 0;
  227|  43.1k|    s_ctl_ip.e_frm_skip_mode = IVD_SKIP_NONE;
  228|  43.1k|    s_ctl_ip.e_frm_out_mode = IVD_DISPLAY_FRAME_OUT;
  229|  43.1k|    s_ctl_ip.e_vid_dec_mode = mode;
  230|  43.1k|    s_ctl_ip.e_cmd = IVD_CMD_VIDEO_CTL;
  231|  43.1k|    s_ctl_ip.e_sub_cmd = IVD_CMD_CTL_SETPARAMS;
  232|  43.1k|    s_ctl_ip.u4_size = sizeof(ivd_ctl_set_config_ip_t);
  233|  43.1k|    s_ctl_op.u4_size = sizeof(ivd_ctl_set_config_op_t);
  234|       |
  235|  43.1k|    ivd_api_function(mCodec, (void *) &s_ctl_ip, (void *) &s_ctl_op);
  ------------------
  |  |   55|  43.1k|#define ivd_api_function isvcd_api_function
  ------------------
  236|  43.1k|}
_ZN5Codec15setArchitectureE10IVD_ARCH_T:
  239|  21.5k|{
  240|  21.5k|    ih264d_ctl_set_processor_ip_t s_ctl_ip{};
  241|  21.5k|    ih264d_ctl_set_processor_op_t s_ctl_op{};
  242|       |
  243|  21.5k|    s_ctl_ip.e_cmd = IVD_CMD_VIDEO_CTL;
  244|  21.5k|    s_ctl_ip.e_sub_cmd = (IVD_CONTROL_API_COMMAND_TYPE_T) IH264D_CMD_CTL_SET_PROCESSOR;
  245|  21.5k|    s_ctl_ip.u4_arch = arch;
  246|  21.5k|    s_ctl_ip.u4_soc = SOC_GENERIC;
  247|  21.5k|    s_ctl_ip.u4_size = sizeof(ih264d_ctl_set_processor_ip_t);
  248|  21.5k|    s_ctl_op.u4_size = sizeof(ih264d_ctl_set_processor_op_t);
  249|       |
  250|  21.5k|    ivd_api_function(mCodec, (void *) &s_ctl_ip, (void *) &s_ctl_op);
  ------------------
  |  |   55|  21.5k|#define ivd_api_function isvcd_api_function
  ------------------
  251|  21.5k|}
_ZN5Codec9freeFrameEv:
  254|  61.3k|{
  255|   157k|    for(unsigned int i = 0; i < mOutBufHandle.u4_num_bufs; i++)
  ------------------
  |  Branch (255:29): [True: 96.0k, False: 61.3k]
  ------------------
  256|  96.0k|    {
  257|  96.0k|        if(mOutBufHandle.pu1_bufs[i])
  ------------------
  |  Branch (257:12): [True: 96.0k, False: 0]
  ------------------
  258|  96.0k|        {
  259|       |            iv_aligned_free(NULL, mOutBufHandle.pu1_bufs[i]);
  260|  96.0k|            mOutBufHandle.pu1_bufs[i] = nullptr;
  261|  96.0k|        }
  262|  96.0k|    }
  263|  61.3k|}
_ZN5Codec10allocFrameEv:
  266|  39.8k|{
  267|  39.8k|    size_t sizes[4] = {0};
  268|  39.8k|    UWORD32 num_bufs = 0;
  269|       |
  270|  39.8k|    freeFrame();
  271|       |
  272|  39.8k|    memset(&mOutBufHandle, 0, sizeof(mOutBufHandle));
  273|       |
  274|  39.8k|    switch(mColorFormat)
  275|  39.8k|    {
  276|  12.3k|        case IV_YUV_420SP_UV:
  ------------------
  |  Branch (276:9): [True: 12.3k, False: 27.5k]
  ------------------
  277|  12.3k|            [[fallthrough]];
  278|  23.3k|        case IV_YUV_420SP_VU:
  ------------------
  |  Branch (278:9): [True: 11.0k, False: 28.7k]
  ------------------
  279|  23.3k|            sizes[0] = mWidth * mHeight;
  280|  23.3k|            sizes[1] = mWidth * mHeight >> 1;
  281|  23.3k|            num_bufs = 2;
  282|  23.3k|            break;
  283|      8|        case IV_YUV_422ILE:
  ------------------
  |  Branch (283:9): [True: 8, False: 39.8k]
  ------------------
  284|      8|            sizes[0] = mWidth * mHeight * 2;
  285|      8|            num_bufs = 1;
  286|      8|            break;
  287|      2|        case IV_RGB_565:
  ------------------
  |  Branch (287:9): [True: 2, False: 39.8k]
  ------------------
  288|      2|            sizes[0] = mWidth * mHeight * 2;
  289|      2|            num_bufs = 1;
  290|      2|            break;
  291|      9|        case IV_RGBA_8888:
  ------------------
  |  Branch (291:9): [True: 9, False: 39.8k]
  ------------------
  292|      9|            sizes[0] = mWidth * mHeight * 4;
  293|      9|            num_bufs = 1;
  294|      9|            break;
  295|  16.4k|        case IV_YUV_420P:
  ------------------
  |  Branch (295:9): [True: 16.4k, False: 23.3k]
  ------------------
  296|  16.4k|            [[fallthrough]];
  297|  16.4k|        default:
  ------------------
  |  Branch (297:9): [True: 0, False: 39.8k]
  ------------------
  298|  16.4k|            sizes[0] = mWidth * mHeight;
  299|  16.4k|            sizes[1] = mWidth * mHeight >> 2;
  300|  16.4k|            sizes[2] = mWidth * mHeight >> 2;
  301|  16.4k|            num_bufs = 3;
  302|  16.4k|            break;
  303|  39.8k|    }
  304|  39.8k|    mOutBufHandle.u4_num_bufs = num_bufs;
  305|   135k|    for(UWORD32 i = 0; i < num_bufs; i++)
  ------------------
  |  Branch (305:24): [True: 96.0k, False: 39.8k]
  ------------------
  306|  96.0k|    {
  307|  96.0k|        mOutBufHandle.u4_min_out_buf_size[i] = sizes[i];
  308|       |        mOutBufHandle.pu1_bufs[i] = (UWORD8 *) iv_aligned_malloc(NULL, 16, sizes[i]);
  309|  96.0k|    }
  310|  39.8k|}
_ZN5Codec12decodeHeaderEPKhm:
  313|  21.5k|{
  314|  21.5k|    setParams(IVD_DECODE_HEADER);
  315|  21.5k|    size_t numDecodeCalls = 0;
  316|   536k|    while(size > 0 && numDecodeCalls < kMaxNumDecodeCalls)
  ------------------
  |  Branch (316:11): [True: 516k, False: 19.4k]
  |  Branch (316:23): [True: 514k, False: 2.13k]
  ------------------
  317|   514k|    {
  318|   514k|        IV_API_CALL_STATUS_T ret;
  319|   514k|        isvcd_video_decode_ip_t s_video_decode_ip;
  320|   514k|        isvcd_video_decode_op_t s_video_decode_op;
  321|   514k|        size_t bytes_consumed;
  322|   514k|        memset(&s_video_decode_ip, 0, sizeof(s_video_decode_ip));
  323|   514k|        memset(&s_video_decode_op, 0, sizeof(s_video_decode_op));
  324|       |
  325|   514k|        s_video_decode_ip.s_ivd_video_decode_ip_t.e_cmd = IVD_CMD_VIDEO_DECODE;
  326|   514k|        s_video_decode_ip.s_ivd_video_decode_ip_t.u4_ts = 0;
  327|   514k|        s_video_decode_ip.s_ivd_video_decode_ip_t.pv_stream_buffer = (void *) data;
  328|   514k|        s_video_decode_ip.s_ivd_video_decode_ip_t.u4_num_Bytes = size;
  329|   514k|        s_video_decode_ip.s_ivd_video_decode_ip_t.u4_size = sizeof(s_video_decode_ip);
  330|   514k|        s_video_decode_op.s_ivd_video_decode_op_t.u4_size = sizeof(s_video_decode_op);
  331|       |
  332|   514k|        ret = ivd_api_function(mCodec, (void *) &s_video_decode_ip, (void *) &s_video_decode_op);
  ------------------
  |  |   55|   514k|#define ivd_api_function isvcd_api_function
  ------------------
  333|   514k|        (void(ret));
  334|   514k|        bytes_consumed = s_video_decode_op.s_ivd_video_decode_op_t.u4_num_bytes_consumed;
  335|       |        /* If no bytes are consumed, then consume 4 bytes to ensure fuzzer proceeds
  336|       |         * to feed next data */
  337|   514k|        if(!bytes_consumed) bytes_consumed = 4;
  ------------------
  |  Branch (337:12): [True: 466k, False: 47.8k]
  ------------------
  338|       |
  339|   514k|        bytes_consumed = std::min(size, bytes_consumed);
  340|       |
  341|   514k|        data += bytes_consumed;
  342|   514k|        size -= bytes_consumed;
  343|   514k|        numDecodeCalls++;
  344|       |
  345|   514k|        mWidth = std::min(s_video_decode_op.s_ivd_video_decode_op_t.u4_pic_wd, (UWORD32) 10240);
  346|   514k|        mHeight = std::min(s_video_decode_op.s_ivd_video_decode_op_t.u4_pic_ht, (UWORD32) 10240);
  347|       |
  348|       |        /* Break after successful header decode */
  349|   514k|        if(mWidth && mHeight)
  ------------------
  |  Branch (349:12): [True: 0, False: 514k]
  |  Branch (349:22): [True: 0, False: 0]
  ------------------
  350|      0|        {
  351|      0|            break;
  352|      0|        }
  353|   514k|    }
  354|       |    /* if width / height are invalid, set them to defaults */
  355|  21.5k|    if(!mWidth) mWidth = 1920;
  ------------------
  |  Branch (355:8): [True: 21.5k, False: 0]
  ------------------
  356|  21.5k|    if(!mHeight) mHeight = 1088;
  ------------------
  |  Branch (356:8): [True: 21.5k, False: 0]
  ------------------
  357|  21.5k|}
_ZN5Codec11decodeFrameEPKhmPm:
  360|   220k|{
  361|   220k|    IV_API_CALL_STATUS_T ret;
  362|   220k|    isvcd_video_decode_ip_t s_video_decode_ip{};
  363|   220k|    isvcd_video_decode_op_t s_video_decode_op{};
  364|       |
  365|   220k|    s_video_decode_ip.s_ivd_video_decode_ip_t.e_cmd = IVD_CMD_VIDEO_DECODE;
  366|   220k|    s_video_decode_ip.s_ivd_video_decode_ip_t.u4_ts = 0;
  367|   220k|    s_video_decode_ip.s_ivd_video_decode_ip_t.pv_stream_buffer = (void *) data;
  368|   220k|    s_video_decode_ip.s_ivd_video_decode_ip_t.u4_num_Bytes = size;
  369|   220k|    s_video_decode_ip.s_ivd_video_decode_ip_t.u4_size = sizeof(s_video_decode_ip);
  370|   220k|    s_video_decode_ip.s_ivd_video_decode_ip_t.s_out_buffer = mOutBufHandle;
  371|       |
  372|   220k|    s_video_decode_op.s_ivd_video_decode_op_t.u4_size = sizeof(s_video_decode_op);
  373|   220k|    s_video_decode_op.s_ivd_video_decode_op_t.u4_num_bytes_consumed = 0;
  374|   220k|    s_video_decode_op.s_ivd_video_decode_op_t.u4_pic_wd = 0;
  375|   220k|    s_video_decode_op.s_ivd_video_decode_op_t.u4_pic_ht = 0;
  376|       |
  377|   220k|    ret = ivd_api_function(mCodec, (void *) &s_video_decode_ip, (void *) &s_video_decode_op);
  ------------------
  |  |   55|   220k|#define ivd_api_function isvcd_api_function
  ------------------
  378|       |
  379|       |    /* In case of change in resolution, reset codec and feed the same data again
  380|       |     */
  381|   220k|    if(IVD_RES_CHANGED == (s_video_decode_op.s_ivd_video_decode_op_t.u4_error_code & 0xFF))
  ------------------
  |  Branch (381:8): [True: 4.12k, False: 216k]
  ------------------
  382|  4.12k|    {
  383|  4.12k|        resetCodec();
  384|  4.12k|        ret = ivd_api_function(mCodec, (void *) &s_video_decode_ip, (void *) &s_video_decode_op);
  ------------------
  |  |   55|  4.12k|#define ivd_api_function isvcd_api_function
  ------------------
  385|  4.12k|    }
  386|   220k|    *bytesConsumed = s_video_decode_op.s_ivd_video_decode_op_t.u4_num_bytes_consumed;
  387|       |
  388|       |    /* If no bytes are consumed, then consume 4 bytes to ensure fuzzer proceeds
  389|       |     * to feed next data */
  390|   220k|    if(!*bytesConsumed)
  ------------------
  |  Branch (390:8): [True: 47.6k, False: 172k]
  ------------------
  391|  47.6k|    {
  392|  47.6k|        *bytesConsumed = 4;
  393|  47.6k|    }
  394|   220k|    if(s_video_decode_op.s_ivd_video_decode_op_t.u4_pic_wd &&
  ------------------
  |  Branch (394:8): [True: 99.7k, False: 120k]
  ------------------
  395|  99.7k|       s_video_decode_op.s_ivd_video_decode_op_t.u4_pic_ht &&
  ------------------
  |  Branch (395:8): [True: 99.7k, False: 0]
  ------------------
  396|  99.7k|       (mWidth != s_video_decode_op.s_ivd_video_decode_op_t.u4_pic_wd ||
  ------------------
  |  Branch (396:9): [True: 18.0k, False: 81.6k]
  ------------------
  397|  81.6k|        mHeight != s_video_decode_op.s_ivd_video_decode_op_t.u4_pic_ht))
  ------------------
  |  Branch (397:9): [True: 217, False: 81.4k]
  ------------------
  398|  18.2k|    {
  399|  18.2k|        mWidth = std::min(s_video_decode_op.s_ivd_video_decode_op_t.u4_pic_wd, (UWORD32) 10240);
  400|  18.2k|        mHeight = std::min(s_video_decode_op.s_ivd_video_decode_op_t.u4_pic_ht, (UWORD32) 10240);
  401|  18.2k|        allocFrame();
  402|  18.2k|    }
  403|       |
  404|   220k|    return ret;
  405|   220k|}
LLVMFuzzerTestOneInput:
  408|  21.5k|{
  409|  21.5k|    if(size < 1)
  ------------------
  |  Branch (409:8): [True: 0, False: 21.5k]
  ------------------
  410|      0|    {
  411|      0|        return 0;
  412|      0|    }
  413|  21.5k|    size_t colorFormatOfst = std::min((size_t) OFFSET_COLOR_FORMAT, size - 1);
  414|  21.5k|    size_t numCoresOfst = std::min((size_t) OFFSET_NUM_CORES, size - 1);
  415|  21.5k|    size_t architectureOfst = std::min((size_t) OFFSET_ARCH, size - 1);
  416|  21.5k|    size_t architectureIdx = data[architectureOfst] % kSupportedArchitectures;
  417|  21.5k|    IVD_ARCH_T arch = (IVD_ARCH_T) supportedArchitectures[architectureIdx];
  418|  21.5k|    size_t colorFormatIdx = data[colorFormatOfst] % kSupportedColorFormats;
  419|  21.5k|    IV_COLOR_FORMAT_T colorFormat = (IV_COLOR_FORMAT_T) (supportedColorFormats[colorFormatIdx]);
  420|  21.5k|    uint32_t numCores = (data[numCoresOfst] % kMaxCores) + 1;
  421|       |
  422|  21.5k|    size_t numTgtLayerOfst = std::min((size_t) OFFSET_TGT_LAYER, size - 1);
  423|  21.5k|    uint32_t tgtLayer = (data[numTgtLayerOfst] % kMaxTgtLayer);
  424|       |
  425|  21.5k|    size_t numDecodeCalls = 0;
  426|  21.5k|    Codec *codec = new Codec(colorFormat, numCores);
  427|  21.5k|    codec->createCodec();
  428|  21.5k|    codec->setArchitecture(arch);
  429|  21.5k|    codec->setCores();
  430|  21.5k|    codec->setTgtLayer(tgtLayer);
  431|  21.5k|    codec->decodeHeader(data, size);
  432|  21.5k|    codec->setParams(IVD_DECODE_FRAME);
  433|  21.5k|    codec->allocFrame();
  434|       |
  435|   241k|    while(size > 0 && numDecodeCalls < kMaxNumDecodeCalls)
  ------------------
  |  Branch (435:11): [True: 220k, False: 21.3k]
  |  Branch (435:23): [True: 220k, False: 181]
  ------------------
  436|   220k|    {
  437|   220k|        IV_API_CALL_STATUS_T ret;
  438|   220k|        size_t bytesConsumed;
  439|   220k|        ret = codec->decodeFrame(data, size, &bytesConsumed);
  440|   220k|        (void(ret));
  441|   220k|        bytesConsumed = std::min(size, bytesConsumed);
  442|   220k|        data += bytesConsumed;
  443|   220k|        size -= bytesConsumed;
  444|   220k|        numDecodeCalls++;
  445|   220k|    }
  446|       |
  447|  21.5k|    codec->freeFrame();
  448|  21.5k|    codec->deleteCodec();
  449|  21.5k|    delete codec;
  450|  21.5k|    return 0;
  451|  21.5k|}

